/**
 * OpenAPI Petstore *_/ ' \" =end -- \\r\\n \\n \\r
 * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\  *_/ ' \" =end --       
 *
 * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
 * Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


#include "OAIReturn.h"

#include "OAIHelpers.h"

#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>

namespace OpenAPI {

OAIReturn::OAIReturn(QString json) {
    this->init();
    this->fromJson(json);
}

OAIReturn::OAIReturn() {
    this->init();
}

OAIReturn::~OAIReturn() {

}

void
OAIReturn::init() {
    m__return_isSet = false;
    m__return_isValid = false;
}

void
OAIReturn::fromJson(QString jsonString) {
    QByteArray array (jsonString.toStdString().c_str());
    QJsonDocument doc = QJsonDocument::fromJson(array);
    QJsonObject jsonObject = doc.object();
    this->fromJsonObject(jsonObject);
}

void
OAIReturn::fromJsonObject(QJsonObject json) {
    m__return_isValid = ::OpenAPI::fromJsonValue(_return, json[QString("return")]);
    
}

QString
OAIReturn::asJson () const {
    QJsonObject obj = this->asJsonObject();
    QJsonDocument doc(obj);
    QByteArray bytes = doc.toJson();
    return QString(bytes);
}

QJsonObject
OAIReturn::asJsonObject() const {
    QJsonObject obj;
	if(m__return_isSet){
        obj.insert(QString("return"), ::OpenAPI::toJsonValue(_return));
    }
    return obj;
}

qint32
OAIReturn::getReturn() const {
    return _return;
}
void
OAIReturn::setReturn(const qint32 &_return) {
    this->_return = _return;
    this->m__return_isSet = true;
}

bool
OAIReturn::isSet() const {
    bool isObjectUpdated = false;
    do{ 
        if(m__return_isSet){ isObjectUpdated = true; break;}
    }while(false);
    return isObjectUpdated;
}

bool
OAIReturn::isValid() const {
    // only required properties are required for the object to be considered valid
    return true;
}

}

