Revision control
+ /**
+ * OpenAPI Petstore
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * Do not edit the class manually.
+ */
+
+ #include "OAIApiResponse.h"
+ #include "OAIHelpers.h"
+
+ #include <QtCore/qdebug.h>
+
+ namespace OpenAPI {
+
+ OAIApiResponse::OAIApiResponse(const QString &json)
+ {
+ this->initializeModel();
+ this->fromJson(json);
+ }
+
+ OAIApiResponse::OAIApiResponse()
+ {
+ this->initializeModel();
+ }
+
+ OAIApiResponse::~OAIApiResponse()
+ {
+ }
+
+ void OAIApiResponse::initializeModel()
+ {
+
+ m_codeIsSet = false;
+ m_codeIsValid = false;
+
+ m_typeIsSet = false;
+ m_typeIsValid = false;
+
+ m_messageIsSet = false;
+ m_messageIsValid = false;
+ }
+
+ void OAIApiResponse::fromJson(const QString &jsonString)
+ {
+ QByteArray array(jsonString.toStdString().c_str());
+ QJsonDocument doc = QJsonDocument::fromJson(array);
+ QJsonObject jsonObject = doc.object();
+ this->fromJsonObject(jsonObject);
+ }
+
+ void OAIApiResponse::fromJsonObject(const QJsonObject &json)
+ {
+
+ m_codeIsValid = ::OpenAPI::fromJsonValue(m_code, json[QString("code")]);
+ m_codeIsSet = !json[QString("code")].isNull() && m_codeIsValid;
+
+ m_typeIsValid = ::OpenAPI::fromJsonValue(m_type, json[QString("type")]);
+ m_typeIsSet = !json[QString("type")].isNull() && m_typeIsValid;
+
+ m_messageIsValid = ::OpenAPI::fromJsonValue(m_message, json[QString("message")]);
+ m_messageIsSet = !json[QString("message")].isNull() && m_messageIsValid;
+ }
+
+ QString OAIApiResponse::asJson() const
+ {
+ QJsonObject obj = this->asJsonObject();
+ QJsonDocument doc(obj);
+ QByteArray bytes = doc.toJson();
+ return QString(bytes);
+ }
+
+ QJsonObject OAIApiResponse::asJsonObject() const
+ {
+ QJsonObject obj;
+ if (m_codeIsSet) {
+ obj.insert(QString("code"), ::OpenAPI::toJsonValue(m_code));
+ }
+ if (m_typeIsSet) {
+ obj.insert(QString("type"), ::OpenAPI::toJsonValue(m_type));
+ }
+ if (m_messageIsSet) {
+ obj.insert(QString("message"), ::OpenAPI::toJsonValue(m_message));
+ }
+ return obj;
+ }
+
+ qint32 OAIApiResponse::getCode() const
+ {
+ return m_code;
+ }
+ void OAIApiResponse::setCode(const qint32 &code)
+ {
+ m_code = code;
+ m_codeIsSet = true;
+ }
+
+ bool OAIApiResponse::isCodeSet() const
+ {
+ return m_codeIsSet;
+ }
+
+ bool OAIApiResponse::isCodeValid() const
+ {
+ return m_codeIsValid;
+ }
+
+ QString OAIApiResponse::getType() const
+ {
+ return m_type;
+ }
+ void OAIApiResponse::setType(const QString &type)
+ {
+ m_type = type;
+ m_typeIsSet = true;
+ }
+
+ bool OAIApiResponse::isTypeSet() const
+ {
+ return m_typeIsSet;
+ }
+
+ bool OAIApiResponse::isTypeValid() const
+ {
+ return m_typeIsValid;
+ }
+
+ QString OAIApiResponse::getMessage() const
+ {
+ return m_message;
+ }
+ void OAIApiResponse::setMessage(const QString &message)
+ {
+ m_message = message;
+ m_messageIsSet = true;
+ }
+
+ bool OAIApiResponse::isMessageSet() const
+ {
+ return m_messageIsSet;
+ }
+
+ bool OAIApiResponse::isMessageValid() const
+ {
+ return m_messageIsValid;
+ }
+
+ bool OAIApiResponse::isSet() const
+ {
+ bool isObjectUpdated = false;
+ do {
+ if (m_codeIsSet) {
+ isObjectUpdated = true;
+ break;
+ }
+
+ if (m_typeIsSet) {
+ isObjectUpdated = true;
+ break;
+ }
+
+ if (m_messageIsSet) {
+ isObjectUpdated = true;
+ break;
+ }
+ } while (false);
+ return isObjectUpdated;
+ }
+
+ bool OAIApiResponse::isValid() const
+ {
+ // only required properties are required for the object to be considered valid
+ return true;
+ }
+
+ } // namespace OpenAPI