/**
 * Deepin官网
 * deepin的官方网站后台接口
 *
 * The version of the OpenAPI document: 1.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 "DHFeedback_PublicReplyResponse.h"

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

#include "DHHelpers.h"

namespace DeepinHomeAPI {

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

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

DHFeedback_PublicReplyResponse::~DHFeedback_PublicReplyResponse() {}

void DHFeedback_PublicReplyResponse::initializeModel() {

    m_content_isSet = false;
    m_content_isValid = false;

    m_created_at_isSet = false;
    m_created_at_isValid = false;
}

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

void DHFeedback_PublicReplyResponse::fromJsonObject(QJsonObject json) {

    m_content_isValid = ::DeepinHomeAPI::fromJsonValue(content, json[QString("content")]);
    m_content_isSet = !json[QString("content")].isNull() && m_content_isValid;

    m_created_at_isValid = ::DeepinHomeAPI::fromJsonValue(created_at, json[QString("created_at")]);
    m_created_at_isSet = !json[QString("created_at")].isNull() && m_created_at_isValid;
}

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

QJsonObject DHFeedback_PublicReplyResponse::asJsonObject() const {
    QJsonObject obj;
    if (m_content_isSet) {
        obj.insert(QString("content"), ::DeepinHomeAPI::toJsonValue(content));
    }
    if (m_created_at_isSet) {
        obj.insert(QString("created_at"), ::DeepinHomeAPI::toJsonValue(created_at));
    }
    return obj;
}

QString DHFeedback_PublicReplyResponse::getContent() const {
    return content;
}
void DHFeedback_PublicReplyResponse::setContent(const QString &content) {
    this->content = content;
    this->m_content_isSet = true;
}

bool DHFeedback_PublicReplyResponse::is_content_Set() const{
    return m_content_isSet;
}

bool DHFeedback_PublicReplyResponse::is_content_Valid() const{
    return m_content_isValid;
}

QString DHFeedback_PublicReplyResponse::getCreatedAt() const {
    return created_at;
}
void DHFeedback_PublicReplyResponse::setCreatedAt(const QString &created_at) {
    this->created_at = created_at;
    this->m_created_at_isSet = true;
}

bool DHFeedback_PublicReplyResponse::is_created_at_Set() const{
    return m_created_at_isSet;
}

bool DHFeedback_PublicReplyResponse::is_created_at_Valid() const{
    return m_created_at_isValid;
}

bool DHFeedback_PublicReplyResponse::isSet() const {
    bool isObjectUpdated = false;
    do {
        if (m_content_isSet) {
            isObjectUpdated = true;
            break;
        }

        if (m_created_at_isSet) {
            isObjectUpdated = true;
            break;
        }
    } while (false);
    return isObjectUpdated;
}

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

} // namespace DeepinHomeAPI
