-
Notifications
You must be signed in to change notification settings - Fork 5
/
OAIGeneric_key_value_pair.cpp
130 lines (104 loc) · 3.25 KB
/
OAIGeneric_key_value_pair.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/**
* GAMS Engine
* With GAMS Engine you can register and solve GAMS models. It has a namespace management system, so you can restrict your users to certain models.
*
* The version of the OpenAPI document: latest
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "OAIGeneric_key_value_pair.h"
#include <QDebug>
#include <QJsonArray>
#include <QJsonDocument>
#include <QObject>
#include "OAIHelpers.h"
namespace OpenAPI {
OAIGeneric_key_value_pair::OAIGeneric_key_value_pair(QString json) {
this->initializeModel();
this->fromJson(json);
}
OAIGeneric_key_value_pair::OAIGeneric_key_value_pair() {
this->initializeModel();
}
OAIGeneric_key_value_pair::~OAIGeneric_key_value_pair() {}
void OAIGeneric_key_value_pair::initializeModel() {
m_key_isSet = false;
m_key_isValid = false;
m_value_isSet = false;
m_value_isValid = false;
}
void OAIGeneric_key_value_pair::fromJson(QString jsonString) {
QByteArray array(jsonString.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
}
void OAIGeneric_key_value_pair::fromJsonObject(QJsonObject json) {
m_key_isValid = ::OpenAPI::fromJsonValue(key, json[QString("key")]);
m_key_isSet = !json[QString("key")].isNull() && m_key_isValid;
m_value_isValid = ::OpenAPI::fromJsonValue(value, json[QString("value")]);
m_value_isSet = !json[QString("value")].isNull() && m_value_isValid;
}
QString OAIGeneric_key_value_pair::asJson() const {
QJsonObject obj = this->asJsonObject();
QJsonDocument doc(obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject OAIGeneric_key_value_pair::asJsonObject() const {
QJsonObject obj;
if (m_key_isSet) {
obj.insert(QString("key"), ::OpenAPI::toJsonValue(key));
}
if (m_value_isSet) {
obj.insert(QString("value"), ::OpenAPI::toJsonValue(value));
}
return obj;
}
QString OAIGeneric_key_value_pair::getKey() const {
return key;
}
void OAIGeneric_key_value_pair::setKey(const QString &key) {
this->key = key;
this->m_key_isSet = true;
}
bool OAIGeneric_key_value_pair::is_key_Set() const{
return m_key_isSet;
}
bool OAIGeneric_key_value_pair::is_key_Valid() const{
return m_key_isValid;
}
QString OAIGeneric_key_value_pair::getValue() const {
return value;
}
void OAIGeneric_key_value_pair::setValue(const QString &value) {
this->value = value;
this->m_value_isSet = true;
}
bool OAIGeneric_key_value_pair::is_value_Set() const{
return m_value_isSet;
}
bool OAIGeneric_key_value_pair::is_value_Valid() const{
return m_value_isValid;
}
bool OAIGeneric_key_value_pair::isSet() const {
bool isObjectUpdated = false;
do {
if (m_key_isSet) {
isObjectUpdated = true;
break;
}
if (m_value_isSet) {
isObjectUpdated = true;
break;
}
} while (false);
return isObjectUpdated;
}
bool OAIGeneric_key_value_pair::isValid() const {
// only required properties are required for the object to be considered valid
return true;
}
} // namespace OpenAPI