forked from loafle/openapi-generator-original
128 lines
2.6 KiB
C++
128 lines
2.6 KiB
C++
/**
|
|
* OpenAPI Petstore
|
|
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
|
*
|
|
* The version of the OpenAPI document: 1.0.0
|
|
*
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
|
|
#include "OAIInline_object.h"
|
|
|
|
#include "OAIHelpers.h"
|
|
|
|
#include <QJsonDocument>
|
|
#include <QJsonArray>
|
|
#include <QObject>
|
|
#include <QDebug>
|
|
|
|
namespace OpenAPI {
|
|
|
|
OAIInline_object::OAIInline_object(QString json) {
|
|
this->init();
|
|
this->fromJson(json);
|
|
}
|
|
|
|
OAIInline_object::OAIInline_object() {
|
|
this->init();
|
|
}
|
|
|
|
OAIInline_object::~OAIInline_object() {
|
|
|
|
}
|
|
|
|
void
|
|
OAIInline_object::init() {
|
|
|
|
m_name_isSet = false;
|
|
m_name_isValid = false;
|
|
|
|
m_status_isSet = false;
|
|
m_status_isValid = false;
|
|
}
|
|
|
|
void
|
|
OAIInline_object::fromJson(QString jsonString) {
|
|
QByteArray array (jsonString.toStdString().c_str());
|
|
QJsonDocument doc = QJsonDocument::fromJson(array);
|
|
QJsonObject jsonObject = doc.object();
|
|
this->fromJsonObject(jsonObject);
|
|
}
|
|
|
|
void
|
|
OAIInline_object::fromJsonObject(QJsonObject json) {
|
|
|
|
m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]);
|
|
|
|
|
|
m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]);
|
|
|
|
|
|
}
|
|
|
|
QString
|
|
OAIInline_object::asJson () const {
|
|
QJsonObject obj = this->asJsonObject();
|
|
QJsonDocument doc(obj);
|
|
QByteArray bytes = doc.toJson();
|
|
return QString(bytes);
|
|
}
|
|
|
|
QJsonObject
|
|
OAIInline_object::asJsonObject() const {
|
|
QJsonObject obj;
|
|
if(m_name_isSet){
|
|
obj.insert(QString("name"), ::OpenAPI::toJsonValue(name));
|
|
}
|
|
if(m_status_isSet){
|
|
obj.insert(QString("status"), ::OpenAPI::toJsonValue(status));
|
|
}
|
|
return obj;
|
|
}
|
|
|
|
|
|
QString
|
|
OAIInline_object::getName() const {
|
|
return name;
|
|
}
|
|
void
|
|
OAIInline_object::setName(const QString &name) {
|
|
this->name = name;
|
|
this->m_name_isSet = true;
|
|
}
|
|
|
|
|
|
QString
|
|
OAIInline_object::getStatus() const {
|
|
return status;
|
|
}
|
|
void
|
|
OAIInline_object::setStatus(const QString &status) {
|
|
this->status = status;
|
|
this->m_status_isSet = true;
|
|
}
|
|
|
|
bool
|
|
OAIInline_object::isSet() const {
|
|
bool isObjectUpdated = false;
|
|
do{
|
|
if(m_name_isSet){ isObjectUpdated = true; break;}
|
|
|
|
if(m_status_isSet){ isObjectUpdated = true; break;}
|
|
}while(false);
|
|
return isObjectUpdated;
|
|
}
|
|
|
|
bool
|
|
OAIInline_object::isValid() const {
|
|
// only required properties are required for the object to be considered valid
|
|
return true;
|
|
}
|
|
|
|
}
|
|
|