-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathOAIMessage.cpp
More file actions
100 lines (80 loc) · 2.32 KB
/
OAIMessage.cpp
File metadata and controls
100 lines (80 loc) · 2.32 KB
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
/**
* 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: 25.04.23
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "OAIMessage.h"
#include <QDebug>
#include <QJsonArray>
#include <QJsonDocument>
#include <QObject>
#include "OAIHelpers.h"
namespace OpenAPI {
OAIMessage::OAIMessage(QString json) {
this->initializeModel();
this->fromJson(json);
}
OAIMessage::OAIMessage() {
this->initializeModel();
}
OAIMessage::~OAIMessage() {}
void OAIMessage::initializeModel() {
m_message_isSet = false;
m_message_isValid = false;
}
void OAIMessage::fromJson(QString jsonString) {
QByteArray array(jsonString.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
}
void OAIMessage::fromJsonObject(QJsonObject json) {
m_message_isValid = ::OpenAPI::fromJsonValue(m_message, json[QString("message")]);
m_message_isSet = !json[QString("message")].isNull() && m_message_isValid;
}
QString OAIMessage::asJson() const {
QJsonObject obj = this->asJsonObject();
QJsonDocument doc(obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject OAIMessage::asJsonObject() const {
QJsonObject obj;
if (m_message_isSet) {
obj.insert(QString("message"), ::OpenAPI::toJsonValue(m_message));
}
return obj;
}
QString OAIMessage::getMessage() const {
return m_message;
}
void OAIMessage::setMessage(const QString &message) {
m_message = message;
m_message_isSet = true;
}
bool OAIMessage::is_message_Set() const{
return m_message_isSet;
}
bool OAIMessage::is_message_Valid() const{
return m_message_isValid;
}
bool OAIMessage::isSet() const {
bool isObjectUpdated = false;
do {
if (m_message_isSet) {
isObjectUpdated = true;
break;
}
} while (false);
return isObjectUpdated;
}
bool OAIMessage::isValid() const {
// only required properties are required for the object to be considered valid
return true;
}
} // namespace OpenAPI