forked from loafle/openapi-generator-original
* Add initial version of File upload and download for Qt5 client * Update after reviews * Remove unused header
216 lines
4.4 KiB
C++
216 lines
4.4 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 "OAIOrder.h"
|
|
|
|
#include <QJsonDocument>
|
|
#include <QJsonArray>
|
|
#include <QObject>
|
|
#include <QDebug>
|
|
|
|
#include "OAIHelpers.h"
|
|
|
|
namespace OpenAPI {
|
|
|
|
OAIOrder::OAIOrder(QString json) {
|
|
this->init();
|
|
this->fromJson(json);
|
|
}
|
|
|
|
OAIOrder::OAIOrder() {
|
|
this->init();
|
|
}
|
|
|
|
OAIOrder::~OAIOrder() {
|
|
|
|
}
|
|
|
|
void
|
|
OAIOrder::init() {
|
|
|
|
m_id_isSet = false;
|
|
m_id_isValid = false;
|
|
|
|
m_pet_id_isSet = false;
|
|
m_pet_id_isValid = false;
|
|
|
|
m_quantity_isSet = false;
|
|
m_quantity_isValid = false;
|
|
|
|
m_ship_date_isSet = false;
|
|
m_ship_date_isValid = false;
|
|
|
|
m_status_isSet = false;
|
|
m_status_isValid = false;
|
|
|
|
m_complete_isSet = false;
|
|
m_complete_isValid = false;
|
|
}
|
|
|
|
void
|
|
OAIOrder::fromJson(QString jsonString) {
|
|
QByteArray array (jsonString.toStdString().c_str());
|
|
QJsonDocument doc = QJsonDocument::fromJson(array);
|
|
QJsonObject jsonObject = doc.object();
|
|
this->fromJsonObject(jsonObject);
|
|
}
|
|
|
|
void
|
|
OAIOrder::fromJsonObject(QJsonObject json) {
|
|
|
|
m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]);
|
|
|
|
|
|
m_pet_id_isValid = ::OpenAPI::fromJsonValue(pet_id, json[QString("petId")]);
|
|
|
|
|
|
m_quantity_isValid = ::OpenAPI::fromJsonValue(quantity, json[QString("quantity")]);
|
|
|
|
|
|
m_ship_date_isValid = ::OpenAPI::fromJsonValue(ship_date, json[QString("shipDate")]);
|
|
|
|
|
|
m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]);
|
|
|
|
|
|
m_complete_isValid = ::OpenAPI::fromJsonValue(complete, json[QString("complete")]);
|
|
|
|
|
|
}
|
|
|
|
QString
|
|
OAIOrder::asJson () const {
|
|
QJsonObject obj = this->asJsonObject();
|
|
QJsonDocument doc(obj);
|
|
QByteArray bytes = doc.toJson();
|
|
return QString(bytes);
|
|
}
|
|
|
|
QJsonObject
|
|
OAIOrder::asJsonObject() const {
|
|
QJsonObject obj;
|
|
if(m_id_isSet){
|
|
obj.insert(QString("id"), ::OpenAPI::toJsonValue(id));
|
|
}
|
|
if(m_pet_id_isSet){
|
|
obj.insert(QString("petId"), ::OpenAPI::toJsonValue(pet_id));
|
|
}
|
|
if(m_quantity_isSet){
|
|
obj.insert(QString("quantity"), ::OpenAPI::toJsonValue(quantity));
|
|
}
|
|
if(m_ship_date_isSet){
|
|
obj.insert(QString("shipDate"), ::OpenAPI::toJsonValue(ship_date));
|
|
}
|
|
if(m_status_isSet){
|
|
obj.insert(QString("status"), ::OpenAPI::toJsonValue(status));
|
|
}
|
|
if(m_complete_isSet){
|
|
obj.insert(QString("complete"), ::OpenAPI::toJsonValue(complete));
|
|
}
|
|
return obj;
|
|
}
|
|
|
|
|
|
qint64
|
|
OAIOrder::getId() const {
|
|
return id;
|
|
}
|
|
void
|
|
OAIOrder::setId(const qint64 &id) {
|
|
this->id = id;
|
|
this->m_id_isSet = true;
|
|
}
|
|
|
|
|
|
qint64
|
|
OAIOrder::getPetId() const {
|
|
return pet_id;
|
|
}
|
|
void
|
|
OAIOrder::setPetId(const qint64 &pet_id) {
|
|
this->pet_id = pet_id;
|
|
this->m_pet_id_isSet = true;
|
|
}
|
|
|
|
|
|
qint32
|
|
OAIOrder::getQuantity() const {
|
|
return quantity;
|
|
}
|
|
void
|
|
OAIOrder::setQuantity(const qint32 &quantity) {
|
|
this->quantity = quantity;
|
|
this->m_quantity_isSet = true;
|
|
}
|
|
|
|
|
|
QDateTime
|
|
OAIOrder::getShipDate() const {
|
|
return ship_date;
|
|
}
|
|
void
|
|
OAIOrder::setShipDate(const QDateTime &ship_date) {
|
|
this->ship_date = ship_date;
|
|
this->m_ship_date_isSet = true;
|
|
}
|
|
|
|
|
|
QString
|
|
OAIOrder::getStatus() const {
|
|
return status;
|
|
}
|
|
void
|
|
OAIOrder::setStatus(const QString &status) {
|
|
this->status = status;
|
|
this->m_status_isSet = true;
|
|
}
|
|
|
|
|
|
bool
|
|
OAIOrder::isComplete() const {
|
|
return complete;
|
|
}
|
|
void
|
|
OAIOrder::setComplete(const bool &complete) {
|
|
this->complete = complete;
|
|
this->m_complete_isSet = true;
|
|
}
|
|
|
|
bool
|
|
OAIOrder::isSet() const {
|
|
bool isObjectUpdated = false;
|
|
do{
|
|
if(m_id_isSet){ isObjectUpdated = true; break;}
|
|
|
|
if(m_pet_id_isSet){ isObjectUpdated = true; break;}
|
|
|
|
if(m_quantity_isSet){ isObjectUpdated = true; break;}
|
|
|
|
if(m_ship_date_isSet){ isObjectUpdated = true; break;}
|
|
|
|
if(m_status_isSet){ isObjectUpdated = true; break;}
|
|
|
|
if(m_complete_isSet){ isObjectUpdated = true; break;}
|
|
}while(false);
|
|
return isObjectUpdated;
|
|
}
|
|
|
|
bool
|
|
OAIOrder::isValid() const {
|
|
// only required properties are required for the object to be considered valid
|
|
return true;
|
|
}
|
|
|
|
}
|
|
|