Skip to content

Commit f1a93fa

Browse files
committed
add new test files
1 parent 88ae36e commit f1a93fa

2 files changed

Lines changed: 201 additions & 0 deletions

File tree

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
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
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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+
/*
13+
* PFXTestAnyType.h
14+
*
15+
* test any type
16+
*/
17+
18+
#ifndef PFXTestAnyType_H
19+
#define PFXTestAnyType_H
20+
21+
#include <QJsonObject>
22+
23+
#include <QJsonValue>
24+
#include <QString>
25+
26+
#include "PFXEnum.h"
27+
#include "PFXObject.h"
28+
29+
namespace test_namespace {
30+
31+
class PFXTestAnyType : public PFXObject {
32+
public:
33+
PFXTestAnyType();
34+
PFXTestAnyType(QString json);
35+
~PFXTestAnyType() override;
36+
37+
QString asJson() const override;
38+
QJsonObject asJsonObject() const override;
39+
void fromJsonObject(QJsonObject json) override;
40+
void fromJson(QString jsonString) override;
41+
42+
QJsonValue getCode() const;
43+
void setCode(const QJsonValue &code);
44+
bool is_code_Set() const;
45+
bool is_code_Valid() const;
46+
47+
QString getMessage() const;
48+
void setMessage(const QString &message);
49+
bool is_message_Set() const;
50+
bool is_message_Valid() const;
51+
52+
virtual bool isSet() const override;
53+
virtual bool isValid() const override;
54+
55+
private:
56+
void initializeModel();
57+
58+
QJsonValue code;
59+
bool m_code_isSet;
60+
bool m_code_isValid;
61+
62+
QString message;
63+
bool m_message_isSet;
64+
bool m_message_isValid;
65+
};
66+
67+
} // namespace test_namespace
68+
69+
Q_DECLARE_METATYPE(test_namespace::PFXTestAnyType)
70+
71+
#endif // PFXTestAnyType_H

0 commit comments

Comments
 (0)