Revision control

- /**
- * OpenAPI Petstore
- * This is a sample of Petstore application. For this sample, you can use the api key `special-key` to test the authorization filters.
- *
- * The version of the OpenAPI document: 1.0.0
- *
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
- * https://openapi-generator.tech
- * Do not edit the class manually.
- */
-
- #include "OAICategory.h"
-
- #include <QDebug>
- #include <QJsonArray>
- #include <QJsonDocument>
- #include <QObject>
-
- #include "OAIHelpers.h"
-
- namespace OpenAPI {
-
- OAICategory::OAICategory(QString json) {
- this->initializeModel();
- this->fromJson(json);
- }
-
- OAICategory::OAICategory() {
- this->initializeModel();
- }
-
- OAICategory::~OAICategory() {}
-
- void OAICategory::initializeModel() {
-
- m_id_isSet = false;
- m_id_isValid = false;
-
- m_name_isSet = false;
- m_name_isValid = false;
- }
-
- void OAICategory::fromJson(QString jsonString) {
- QByteArray array(jsonString.toStdString().c_str());
- QJsonDocument doc = QJsonDocument::fromJson(array);
- QJsonObject jsonObject = doc.object();
- this->fromJsonObject(jsonObject);
- }
-
- void OAICategory::fromJsonObject(QJsonObject json) {
-
- m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]);
- m_id_isSet = !json[QString("id")].isNull() && m_id_isValid;
-
- m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]);
- m_name_isSet = !json[QString("name")].isNull() && m_name_isValid;
- }
-
- QString OAICategory::asJson() const {
- QJsonObject obj = this->asJsonObject();
- QJsonDocument doc(obj);
- QByteArray bytes = doc.toJson();
- return QString(bytes);
- }
-
- QJsonObject OAICategory::asJsonObject() const {
- QJsonObject obj;
- if (m_id_isSet) {
- obj.insert(QString("id"), ::OpenAPI::toJsonValue(id));
- }
- if (m_name_isSet) {
- obj.insert(QString("name"), ::OpenAPI::toJsonValue(name));
- }
- return obj;
- }
-
- qint64 OAICategory::getId() const {
- return id;
- }
- void OAICategory::setId(const qint64 &id) {
- this->id = id;
- this->m_id_isSet = true;
- }
-
- bool OAICategory::is_id_Set() const{
- return m_id_isSet;
- }
-
- bool OAICategory::is_id_Valid() const{
- return m_id_isValid;
- }
-
- QString OAICategory::getName() const {
- return name;
- }
- void OAICategory::setName(const QString &name) {
- this->name = name;
- this->m_name_isSet = true;
- }
-
- bool OAICategory::is_name_Set() const{
- return m_name_isSet;
- }
-
- bool OAICategory::is_name_Valid() const{
- return m_name_isValid;
- }
-
- bool OAICategory::isSet() const {
- bool isObjectUpdated = false;
- do {
- if (m_id_isSet) {
- isObjectUpdated = true;
- break;
- }
-
- if (m_name_isSet) {
- isObjectUpdated = true;
- break;
- }
- } while (false);
- return isObjectUpdated;
- }
-
- bool OAICategory::isValid() const {
- // only required properties are required for the object to be considered valid
- return true;
- }
-
- } // namespace OpenAPI