/**
 * 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_UploadTaskStatusInfo.h"

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

#include "Helpers.h"

namespace linglong {
namespace api {
namespace client {

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

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

Response_UploadTaskStatusInfo::~Response_UploadTaskStatusInfo() {}

void Response_UploadTaskStatusInfo::initializeModel() {

    m_status_isSet = false;
    m_status_isValid = false;
}

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

void Response_UploadTaskStatusInfo::fromJsonObject(QJsonObject json) {

    m_status_isValid = ::linglong::api::client::fromJsonValue(m_status, json[QString("status")]);
    m_status_isSet = !json[QString("status")].isNull() && m_status_isValid;
}

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

QJsonObject Response_UploadTaskStatusInfo::asJsonObject() const {
    QJsonObject obj;
    if (m_status_isSet) {
        obj.insert(QString("status"), ::linglong::api::client::toJsonValue(m_status));
    }
    return obj;
}

QString Response_UploadTaskStatusInfo::getStatus() const {
    return m_status;
}
void Response_UploadTaskStatusInfo::setStatus(const QString &status) {
    m_status = status;
    m_status_isSet = true;
}

bool Response_UploadTaskStatusInfo::is_status_Set() const{
    return m_status_isSet;
}

bool Response_UploadTaskStatusInfo::is_status_Valid() const{
    return m_status_isValid;
}

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

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

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