sdrangel/swagger/sdrangel/code/qt5/client/SWGErrorResponse.cpp

96 lines
1.9 KiB
C++

/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* 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 "SWGErrorResponse.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGErrorResponse::SWGErrorResponse(QString* json) {
init();
this->fromJson(*json);
}
SWGErrorResponse::SWGErrorResponse() {
init();
}
SWGErrorResponse::~SWGErrorResponse() {
this->cleanup();
}
void
SWGErrorResponse::init() {
message = new QString("");
}
void
SWGErrorResponse::cleanup() {
if(message != nullptr) {
delete message;
}
}
SWGErrorResponse*
SWGErrorResponse::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGErrorResponse::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&message, pJson["message"], "QString", "QString");
}
QString
SWGErrorResponse::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGErrorResponse::asJsonObject() {
QJsonObject* obj = new QJsonObject();
toJsonValue(QString("message"), message, obj, QString("QString"));
return obj;
}
QString*
SWGErrorResponse::getMessage() {
return message;
}
void
SWGErrorResponse::setMessage(QString* message) {
this->message = message;
}
}