/**
* GameBrain API
* GameBrain API
*
* The version of the OpenAPI document: 1.0.1
* Contact: mail@gamebrain.co
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "OAIGameResponse_official_stores_inner.h"
#include <QDebug>
#include <QJsonArray>
#include <QJsonDocument>
#include <QObject>
#include "OAIHelpers.h"
namespace OpenAPI {
OAIGameResponse_official_stores_inner::OAIGameResponse_official_stores_inner(QString json) {
this->initializeModel();
this->fromJson(json);
}
OAIGameResponse_official_stores_inner::OAIGameResponse_official_stores_inner() {
this->initializeModel();
}
OAIGameResponse_official_stores_inner::~OAIGameResponse_official_stores_inner() {}
void OAIGameResponse_official_stores_inner::initializeModel() {
m_source_isSet = false;
m_source_isValid = false;
m_url_isSet = false;
m_url_isValid = false;
}
void OAIGameResponse_official_stores_inner::fromJson(QString jsonString) {
QByteArray array(jsonString.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
}
void OAIGameResponse_official_stores_inner::fromJsonObject(QJsonObject json) {
m_source_isValid = ::OpenAPI::fromJsonValue(m_source, json[QString("source")]);
m_source_isSet = !json[QString("source")].isNull() && m_source_isValid;
m_url_isValid = ::OpenAPI::fromJsonValue(m_url, json[QString("url")]);
m_url_isSet = !json[QString("url")].isNull() && m_url_isValid;
}
QString OAIGameResponse_official_stores_inner::asJson() const {
QJsonObject obj = this->asJsonObject();
QJsonDocument doc(obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject OAIGameResponse_official_stores_inner::asJsonObject() const {
QJsonObject obj;
if (m_source_isSet) {
obj.insert(QString("source"), ::OpenAPI::toJsonValue(m_source));
}
if (m_url_isSet) {
obj.insert(QString("url"), ::OpenAPI::toJsonValue(m_url));
}
return obj;
}
QString OAIGameResponse_official_stores_inner::getSource() const {
return m_source;
}
void OAIGameResponse_official_stores_inner::setSource(const QString &source) {
m_source = source;
m_source_isSet = true;
}
bool OAIGameResponse_official_stores_inner::is_source_Set() const{
return m_source_isSet;
}
bool OAIGameResponse_official_stores_inner::is_source_Valid() const{
return m_source_isValid;
}
QString OAIGameResponse_official_stores_inner::getUrl() const {
return m_url;
}
void OAIGameResponse_official_stores_inner::setUrl(const QString &url) {
m_url = url;
m_url_isSet = true;
}
bool OAIGameResponse_official_stores_inner::is_url_Set() const{
return m_url_isSet;
}
bool OAIGameResponse_official_stores_inner::is_url_Valid() const{
return m_url_isValid;
}
bool OAIGameResponse_official_stores_inner::isSet() const {
bool isObjectUpdated = false;
do {
if (m_source_isSet) {
isObjectUpdated = true;
break;
}
if (m_url_isSet) {
isObjectUpdated = true;
break;
}
} while (false);
return isObjectUpdated;
}
bool OAIGameResponse_official_stores_inner::isValid() const {
// only required properties are required for the object to be considered valid
return true;
}
} // namespace OpenAPI