/**
 * Swagger 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: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */


#include "SWGReturn.h"

#include "SWGHelpers.h"

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

namespace Swagger {

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

SWGReturn::SWGReturn() {
    init();
}

SWGReturn::~SWGReturn() {
    this->cleanup();
}

void
SWGReturn::init() {
    _return = 0;
}

void
SWGReturn::cleanup() {
    
}

SWGReturn*
SWGReturn::fromJson(QString &json) {
    QByteArray array (json.toStdString().c_str());
    QJsonDocument doc = QJsonDocument::fromJson(array);
    QJsonObject jsonObject = doc.object();
    this->fromJsonObject(jsonObject);
    return this;
}

void
SWGReturn::fromJsonObject(QJsonObject &pJson) {
    ::Swagger::setValue(&_return, pJson["return"], "qint32", "");
}

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

QJsonObject*
SWGReturn::asJsonObject() {
    QJsonObject* obj = new QJsonObject();
    
    obj->insert("return", QJsonValue(_return));

    return obj;
}

qint32
SWGReturn::getReturn() {
    return _return;
}
void
SWGReturn::setReturn(qint32 _return) {
    this->_return = _return;
}


}

