/**
 * linglong仓库
 * 玲珑仓库接口
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: wurongjie@deepin.org
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

#include "Response_NewUploadTaskResp.h"

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

#include "Helpers.h"

namespace linglong {
namespace api {
namespace client {

Response_NewUploadTaskResp::Response_NewUploadTaskResp(QString json) {
    this->initializeModel();
    this->fromJson(json);
}

Response_NewUploadTaskResp::Response_NewUploadTaskResp() {
    this->initializeModel();
}

Response_NewUploadTaskResp::~Response_NewUploadTaskResp() {}

void Response_NewUploadTaskResp::initializeModel() {

    m_id_isSet = false;
    m_id_isValid = false;
}

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

void Response_NewUploadTaskResp::fromJsonObject(QJsonObject json) {

    m_id_isValid = ::linglong::api::client::fromJsonValue(m_id, json[QString("id")]);
    m_id_isSet = !json[QString("id")].isNull() && m_id_isValid;
}

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

QJsonObject Response_NewUploadTaskResp::asJsonObject() const {
    QJsonObject obj;
    if (m_id_isSet) {
        obj.insert(QString("id"), ::linglong::api::client::toJsonValue(m_id));
    }
    return obj;
}

QString Response_NewUploadTaskResp::getId() const {
    return m_id;
}
void Response_NewUploadTaskResp::setId(const QString &id) {
    m_id = id;
    m_id_isSet = true;
}

bool Response_NewUploadTaskResp::is_id_Set() const{
    return m_id_isSet;
}

bool Response_NewUploadTaskResp::is_id_Valid() const{
    return m_id_isValid;
}

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

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

} // namespace linglong
} // namespace api
} // namespace client
