|
| 1 | +/** |
| 2 | + * OpenAPI Petstore |
| 3 | + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. |
| 4 | + * |
| 5 | + * The version of the OpenAPI document: 1.0.0 |
| 6 | + * |
| 7 | + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| 8 | + * https://openapi-generator.tech |
| 9 | + * Do not edit the class manually. |
| 10 | + */ |
| 11 | + |
| 12 | +#include "PFXTestAnyType.h" |
| 13 | + |
| 14 | +#include <QDebug> |
| 15 | +#include <QJsonArray> |
| 16 | +#include <QJsonDocument> |
| 17 | +#include <QObject> |
| 18 | + |
| 19 | +#include "PFXHelpers.h" |
| 20 | + |
| 21 | +namespace test_namespace { |
| 22 | + |
| 23 | +PFXTestAnyType::PFXTestAnyType(QString json) { |
| 24 | + this->initializeModel(); |
| 25 | + this->fromJson(json); |
| 26 | +} |
| 27 | + |
| 28 | +PFXTestAnyType::PFXTestAnyType() { |
| 29 | + this->initializeModel(); |
| 30 | +} |
| 31 | + |
| 32 | +PFXTestAnyType::~PFXTestAnyType() {} |
| 33 | + |
| 34 | +void PFXTestAnyType::initializeModel() { |
| 35 | + |
| 36 | + m_code_isSet = false; |
| 37 | + m_code_isValid = false; |
| 38 | + |
| 39 | + m_message_isSet = false; |
| 40 | + m_message_isValid = false; |
| 41 | +} |
| 42 | + |
| 43 | +void PFXTestAnyType::fromJson(QString jsonString) { |
| 44 | + QByteArray array(jsonString.toStdString().c_str()); |
| 45 | + QJsonDocument doc = QJsonDocument::fromJson(array); |
| 46 | + QJsonObject jsonObject = doc.object(); |
| 47 | + this->fromJsonObject(jsonObject); |
| 48 | +} |
| 49 | + |
| 50 | +void PFXTestAnyType::fromJsonObject(QJsonObject json) { |
| 51 | + |
| 52 | + m_code_isValid = ::test_namespace::fromJsonValue(code, json[QString("code")]); |
| 53 | + m_code_isSet = !json[QString("code")].isNull() && m_code_isValid; |
| 54 | + |
| 55 | + m_message_isValid = ::test_namespace::fromJsonValue(message, json[QString("message")]); |
| 56 | + m_message_isSet = !json[QString("message")].isNull() && m_message_isValid; |
| 57 | +} |
| 58 | + |
| 59 | +QString PFXTestAnyType::asJson() const { |
| 60 | + QJsonObject obj = this->asJsonObject(); |
| 61 | + QJsonDocument doc(obj); |
| 62 | + QByteArray bytes = doc.toJson(); |
| 63 | + return QString(bytes); |
| 64 | +} |
| 65 | + |
| 66 | +QJsonObject PFXTestAnyType::asJsonObject() const { |
| 67 | + QJsonObject obj; |
| 68 | + if (m_code_isSet) { |
| 69 | + obj.insert(QString("code"), ::test_namespace::toJsonValue(code)); |
| 70 | + } |
| 71 | + if (m_message_isSet) { |
| 72 | + obj.insert(QString("message"), ::test_namespace::toJsonValue(message)); |
| 73 | + } |
| 74 | + return obj; |
| 75 | +} |
| 76 | + |
| 77 | +QJsonValue PFXTestAnyType::getCode() const { |
| 78 | + return code; |
| 79 | +} |
| 80 | +void PFXTestAnyType::setCode(const QJsonValue &code) { |
| 81 | + this->code = code; |
| 82 | + this->m_code_isSet = true; |
| 83 | +} |
| 84 | + |
| 85 | +bool PFXTestAnyType::is_code_Set() const{ |
| 86 | + return m_code_isSet; |
| 87 | +} |
| 88 | + |
| 89 | +bool PFXTestAnyType::is_code_Valid() const{ |
| 90 | + return m_code_isValid; |
| 91 | +} |
| 92 | + |
| 93 | +QString PFXTestAnyType::getMessage() const { |
| 94 | + return message; |
| 95 | +} |
| 96 | +void PFXTestAnyType::setMessage(const QString &message) { |
| 97 | + this->message = message; |
| 98 | + this->m_message_isSet = true; |
| 99 | +} |
| 100 | + |
| 101 | +bool PFXTestAnyType::is_message_Set() const{ |
| 102 | + return m_message_isSet; |
| 103 | +} |
| 104 | + |
| 105 | +bool PFXTestAnyType::is_message_Valid() const{ |
| 106 | + return m_message_isValid; |
| 107 | +} |
| 108 | + |
| 109 | +bool PFXTestAnyType::isSet() const { |
| 110 | + bool isObjectUpdated = false; |
| 111 | + do { |
| 112 | + if (m_code_isSet) { |
| 113 | + isObjectUpdated = true; |
| 114 | + break; |
| 115 | + } |
| 116 | + |
| 117 | + if (m_message_isSet) { |
| 118 | + isObjectUpdated = true; |
| 119 | + break; |
| 120 | + } |
| 121 | + } while (false); |
| 122 | + return isObjectUpdated; |
| 123 | +} |
| 124 | + |
| 125 | +bool PFXTestAnyType::isValid() const { |
| 126 | + // only required properties are required for the object to be considered valid |
| 127 | + return true; |
| 128 | +} |
| 129 | + |
| 130 | +} // namespace test_namespace |
0 commit comments