William Cheng 9e4afb0fc3
[C++] Rename Qt5 to Qt (#9490)
* rename qt5 to qt

* rename, update

* rename qt5 to qt in the templates

* update doc
2021-05-18 23:09:59 +08:00

311 lines
7.5 KiB
C++

/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* The version of the OpenAPI document: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "PFXUser.h"
#include <QDebug>
#include <QJsonArray>
#include <QJsonDocument>
#include <QObject>
#include "PFXHelpers.h"
namespace test_namespace {
PFXUser::PFXUser(QString json) {
this->initializeModel();
this->fromJson(json);
}
PFXUser::PFXUser() {
this->initializeModel();
}
PFXUser::~PFXUser() {}
void PFXUser::initializeModel() {
m_id_isSet = false;
m_id_isValid = false;
m_username_isSet = false;
m_username_isValid = false;
m_first_name_isSet = false;
m_first_name_isValid = false;
m_last_name_isSet = false;
m_last_name_isValid = false;
m_email_isSet = false;
m_email_isValid = false;
m_password_isSet = false;
m_password_isValid = false;
m_phone_isSet = false;
m_phone_isValid = false;
m_user_status_isSet = false;
m_user_status_isValid = false;
}
void PFXUser::fromJson(QString jsonString) {
QByteArray array(jsonString.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
}
void PFXUser::fromJsonObject(QJsonObject json) {
m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]);
m_id_isSet = !json[QString("id")].isNull() && m_id_isValid;
m_username_isValid = ::test_namespace::fromJsonValue(username, json[QString("username")]);
m_username_isSet = !json[QString("username")].isNull() && m_username_isValid;
m_first_name_isValid = ::test_namespace::fromJsonValue(first_name, json[QString("firstName")]);
m_first_name_isSet = !json[QString("firstName")].isNull() && m_first_name_isValid;
m_last_name_isValid = ::test_namespace::fromJsonValue(last_name, json[QString("lastName")]);
m_last_name_isSet = !json[QString("lastName")].isNull() && m_last_name_isValid;
m_email_isValid = ::test_namespace::fromJsonValue(email, json[QString("email")]);
m_email_isSet = !json[QString("email")].isNull() && m_email_isValid;
m_password_isValid = ::test_namespace::fromJsonValue(password, json[QString("password")]);
m_password_isSet = !json[QString("password")].isNull() && m_password_isValid;
m_phone_isValid = ::test_namespace::fromJsonValue(phone, json[QString("phone")]);
m_phone_isSet = !json[QString("phone")].isNull() && m_phone_isValid;
m_user_status_isValid = ::test_namespace::fromJsonValue(user_status, json[QString("userStatus")]);
m_user_status_isSet = !json[QString("userStatus")].isNull() && m_user_status_isValid;
}
QString PFXUser::asJson() const {
QJsonObject obj = this->asJsonObject();
QJsonDocument doc(obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject PFXUser::asJsonObject() const {
QJsonObject obj;
if (m_id_isSet) {
obj.insert(QString("id"), ::test_namespace::toJsonValue(id));
}
if (m_username_isSet) {
obj.insert(QString("username"), ::test_namespace::toJsonValue(username));
}
if (m_first_name_isSet) {
obj.insert(QString("firstName"), ::test_namespace::toJsonValue(first_name));
}
if (m_last_name_isSet) {
obj.insert(QString("lastName"), ::test_namespace::toJsonValue(last_name));
}
if (m_email_isSet) {
obj.insert(QString("email"), ::test_namespace::toJsonValue(email));
}
if (m_password_isSet) {
obj.insert(QString("password"), ::test_namespace::toJsonValue(password));
}
if (m_phone_isSet) {
obj.insert(QString("phone"), ::test_namespace::toJsonValue(phone));
}
if (m_user_status_isSet) {
obj.insert(QString("userStatus"), ::test_namespace::toJsonValue(user_status));
}
return obj;
}
qint64 PFXUser::getId() const {
return id;
}
void PFXUser::setId(const qint64 &id) {
this->id = id;
this->m_id_isSet = true;
}
bool PFXUser::is_id_Set() const{
return m_id_isSet;
}
bool PFXUser::is_id_Valid() const{
return m_id_isValid;
}
QString PFXUser::getUsername() const {
return username;
}
void PFXUser::setUsername(const QString &username) {
this->username = username;
this->m_username_isSet = true;
}
bool PFXUser::is_username_Set() const{
return m_username_isSet;
}
bool PFXUser::is_username_Valid() const{
return m_username_isValid;
}
QString PFXUser::getFirstName() const {
return first_name;
}
void PFXUser::setFirstName(const QString &first_name) {
this->first_name = first_name;
this->m_first_name_isSet = true;
}
bool PFXUser::is_first_name_Set() const{
return m_first_name_isSet;
}
bool PFXUser::is_first_name_Valid() const{
return m_first_name_isValid;
}
QString PFXUser::getLastName() const {
return last_name;
}
void PFXUser::setLastName(const QString &last_name) {
this->last_name = last_name;
this->m_last_name_isSet = true;
}
bool PFXUser::is_last_name_Set() const{
return m_last_name_isSet;
}
bool PFXUser::is_last_name_Valid() const{
return m_last_name_isValid;
}
QString PFXUser::getEmail() const {
return email;
}
void PFXUser::setEmail(const QString &email) {
this->email = email;
this->m_email_isSet = true;
}
bool PFXUser::is_email_Set() const{
return m_email_isSet;
}
bool PFXUser::is_email_Valid() const{
return m_email_isValid;
}
QString PFXUser::getPassword() const {
return password;
}
void PFXUser::setPassword(const QString &password) {
this->password = password;
this->m_password_isSet = true;
}
bool PFXUser::is_password_Set() const{
return m_password_isSet;
}
bool PFXUser::is_password_Valid() const{
return m_password_isValid;
}
QString PFXUser::getPhone() const {
return phone;
}
void PFXUser::setPhone(const QString &phone) {
this->phone = phone;
this->m_phone_isSet = true;
}
bool PFXUser::is_phone_Set() const{
return m_phone_isSet;
}
bool PFXUser::is_phone_Valid() const{
return m_phone_isValid;
}
qint32 PFXUser::getUserStatus() const {
return user_status;
}
void PFXUser::setUserStatus(const qint32 &user_status) {
this->user_status = user_status;
this->m_user_status_isSet = true;
}
bool PFXUser::is_user_status_Set() const{
return m_user_status_isSet;
}
bool PFXUser::is_user_status_Valid() const{
return m_user_status_isValid;
}
bool PFXUser::isSet() const {
bool isObjectUpdated = false;
do {
if (m_id_isSet) {
isObjectUpdated = true;
break;
}
if (m_username_isSet) {
isObjectUpdated = true;
break;
}
if (m_first_name_isSet) {
isObjectUpdated = true;
break;
}
if (m_last_name_isSet) {
isObjectUpdated = true;
break;
}
if (m_email_isSet) {
isObjectUpdated = true;
break;
}
if (m_password_isSet) {
isObjectUpdated = true;
break;
}
if (m_phone_isSet) {
isObjectUpdated = true;
break;
}
if (m_user_status_isSet) {
isObjectUpdated = true;
break;
}
} while (false);
return isObjectUpdated;
}
bool PFXUser::isValid() const {
// only required properties are required for the object to be considered valid
return true;
}
} // namespace test_namespace