forked from loafle/openapi-generator-original
Port client updates to server (#5634)
This commit is contained in:
parent
b1efe20a04
commit
8af3d6d9bf
@ -1,6 +1,7 @@
|
||||
{{>licenseInfo}}
|
||||
#include "{{prefix}}Helpers.h"
|
||||
#include <QDebug>
|
||||
#include <QJsonParseError>
|
||||
#include "{{prefix}}Helpers.h"
|
||||
|
||||
{{#cppNamespaceDeclarations}}
|
||||
namespace {{this}} {
|
||||
@ -178,6 +179,17 @@ bool fromStringValue(const QString &inStr, double &value) {
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool fromStringValue(const QString &inStr, {{prefix}}Object &value)
|
||||
{
|
||||
QJsonParseError err;
|
||||
QJsonDocument::fromJson(inStr.toUtf8(),&err);
|
||||
if ( err.error == QJsonParseError::NoError ){
|
||||
value.fromJson(inStr);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool fromStringValue(const QString &inStr, {{prefix}}Enum &value) {
|
||||
value.fromJson(inStr);
|
||||
return true;
|
||||
|
@ -1,5 +1,4 @@
|
||||
{{>licenseInfo}}
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFile>
|
||||
#include <QJsonDocument>
|
||||
@ -11,33 +10,27 @@
|
||||
namespace {{this}} {
|
||||
{{/cppNamespaceDeclarations}}
|
||||
|
||||
void
|
||||
{{prefix}}HttpFileElement::setMimeType(const QString &mime){
|
||||
void {{prefix}}HttpFileElement::setMimeType(const QString &mime) {
|
||||
mime_type = mime;
|
||||
}
|
||||
|
||||
void
|
||||
{{prefix}}HttpFileElement::setFileName(const QString &name){
|
||||
void {{prefix}}HttpFileElement::setFileName(const QString &name) {
|
||||
local_filename = name;
|
||||
}
|
||||
|
||||
void
|
||||
{{prefix}}HttpFileElement::setVariableName(const QString &name){
|
||||
void {{prefix}}HttpFileElement::setVariableName(const QString &name) {
|
||||
variable_name = name;
|
||||
}
|
||||
|
||||
void
|
||||
{{prefix}}HttpFileElement::setRequestFileName(const QString &name){
|
||||
void {{prefix}}HttpFileElement::setRequestFileName(const QString &name) {
|
||||
request_filename = name;
|
||||
}
|
||||
|
||||
bool
|
||||
{{prefix}}HttpFileElement::isSet() const {
|
||||
bool {{prefix}}HttpFileElement::isSet() const {
|
||||
return !local_filename.isEmpty() || !request_filename.isEmpty();
|
||||
}
|
||||
|
||||
QString
|
||||
{{prefix}}HttpFileElement::asJson() const{
|
||||
QString {{prefix}}HttpFileElement::asJson() const {
|
||||
QFile file(local_filename);
|
||||
QByteArray bArray;
|
||||
bool result = false;
|
||||
@ -52,8 +45,7 @@ QString
|
||||
return QString(bArray);
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
{{prefix}}HttpFileElement::asJsonValue() const{
|
||||
QJsonValue {{prefix}}HttpFileElement::asJsonValue() const {
|
||||
QFile file(local_filename);
|
||||
QByteArray bArray;
|
||||
bool result = false;
|
||||
@ -68,8 +60,7 @@ QJsonValue
|
||||
return QJsonDocument::fromBinaryData(bArray.data()).object();
|
||||
}
|
||||
|
||||
bool
|
||||
{{prefix}}HttpFileElement::fromStringValue(const QString &instr){
|
||||
bool {{prefix}}HttpFileElement::fromStringValue(const QString &instr) {
|
||||
QFile file(local_filename);
|
||||
bool result = false;
|
||||
if (file.exists()) {
|
||||
@ -84,8 +75,7 @@ bool
|
||||
return result;
|
||||
}
|
||||
|
||||
bool
|
||||
{{prefix}}HttpFileElement::fromJsonValue(const QJsonValue &jval) {
|
||||
bool {{prefix}}HttpFileElement::fromJsonValue(const QJsonValue &jval) {
|
||||
QFile file(local_filename);
|
||||
bool result = false;
|
||||
if (file.exists()) {
|
||||
@ -100,8 +90,7 @@ bool
|
||||
return result;
|
||||
}
|
||||
|
||||
QByteArray
|
||||
{{prefix}}HttpFileElement::asByteArray() const {
|
||||
QByteArray {{prefix}}HttpFileElement::asByteArray() const {
|
||||
QFile file(local_filename);
|
||||
QByteArray bArray;
|
||||
bool result = false;
|
||||
@ -116,8 +105,7 @@ QByteArray
|
||||
return bArray;
|
||||
}
|
||||
|
||||
bool
|
||||
{{prefix}}HttpFileElement::fromByteArray(const QByteArray& bytes){
|
||||
bool {{prefix}}HttpFileElement::fromByteArray(const QByteArray &bytes) {
|
||||
QFile file(local_filename);
|
||||
bool result = false;
|
||||
if (file.exists()) {
|
||||
@ -132,8 +120,7 @@ bool
|
||||
return result;
|
||||
}
|
||||
|
||||
bool
|
||||
{{prefix}}HttpFileElement::saveToFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime, const QByteArray& bytes){
|
||||
bool {{prefix}}HttpFileElement::saveToFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime, const QByteArray &bytes) {
|
||||
setMimeType(mime);
|
||||
setFileName(localFName);
|
||||
setVariableName(varName);
|
||||
@ -141,8 +128,7 @@ bool
|
||||
return fromByteArray(bytes);
|
||||
}
|
||||
|
||||
QByteArray
|
||||
{{prefix}}HttpFileElement::loadFromFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime){
|
||||
QByteArray {{prefix}}HttpFileElement::loadFromFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime) {
|
||||
setMimeType(mime);
|
||||
setFileName(localFName);
|
||||
setVariableName(varName);
|
||||
@ -151,5 +137,5 @@ QByteArray
|
||||
}
|
||||
|
||||
{{#cppNamespaceDeclarations}}
|
||||
}
|
||||
} // namespace {{this}}
|
||||
{{/cppNamespaceDeclarations}}
|
@ -6,7 +6,6 @@
|
||||
#include <QMetaType>
|
||||
#include <QString>
|
||||
|
||||
|
||||
{{#cppNamespaceDeclarations}}
|
||||
namespace {{this}} {
|
||||
{{/cppNamespaceDeclarations}}
|
||||
@ -34,7 +33,7 @@ public:
|
||||
};
|
||||
|
||||
{{#cppNamespaceDeclarations}}
|
||||
}
|
||||
} // namespace {{this}}
|
||||
{{/cppNamespaceDeclarations}}
|
||||
|
||||
Q_DECLARE_METATYPE({{#cppNamespaceDeclarations}}{{this}}::{{/cppNamespaceDeclarations}}{{prefix}}HttpFileElement)
|
||||
|
@ -2,9 +2,9 @@
|
||||
#ifndef {{prefix}}_ENUM_H
|
||||
#define {{prefix}}_ENUM_H
|
||||
|
||||
#include <QString>
|
||||
#include <QJsonValue>
|
||||
#include <QMetaType>
|
||||
#include <QString>
|
||||
|
||||
{{#cppNamespaceDeclarations}}
|
||||
namespace {{this}} {
|
||||
@ -12,17 +12,13 @@ namespace {{this}} {
|
||||
|
||||
class {{prefix}}Enum {
|
||||
public:
|
||||
{{prefix}}Enum() {
|
||||
|
||||
}
|
||||
{{prefix}}Enum() {}
|
||||
|
||||
{{prefix}}Enum(QString jsonString) {
|
||||
fromJson(jsonString);
|
||||
}
|
||||
|
||||
virtual ~{{prefix}}Enum(){
|
||||
|
||||
}
|
||||
virtual ~{{prefix}}Enum() {}
|
||||
|
||||
virtual QJsonValue asJsonValue() const {
|
||||
return QJsonValue(jstr);
|
||||
@ -47,12 +43,13 @@ class {{prefix}}Enum {
|
||||
virtual bool isValid() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
QString jstr;
|
||||
};
|
||||
|
||||
{{#cppNamespaceDeclarations}}
|
||||
}
|
||||
} // namespace {{this}}
|
||||
{{/cppNamespaceDeclarations}}
|
||||
|
||||
Q_DECLARE_METATYPE({{#cppNamespaceDeclarations}}{{this}}::{{/cppNamespaceDeclarations}}{{prefix}}Enum)
|
||||
|
@ -3,227 +3,183 @@
|
||||
#include <QJsonParseError>
|
||||
#include "{{prefix}}Helpers.h"
|
||||
|
||||
|
||||
{{#cppNamespaceDeclarations}}
|
||||
namespace {{this}} {
|
||||
{{/cppNamespaceDeclarations}}
|
||||
|
||||
|
||||
QString
|
||||
toStringValue(const QString &value) {
|
||||
QString toStringValue(const QString &value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
QString
|
||||
toStringValue(const QDateTime &value){
|
||||
QString toStringValue(const QDateTime &value) {
|
||||
// ISO 8601
|
||||
return value.toString("yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm]");
|
||||
}
|
||||
|
||||
QString
|
||||
toStringValue(const QByteArray &value){
|
||||
QString toStringValue(const QByteArray &value) {
|
||||
return QString(value);
|
||||
}
|
||||
|
||||
QString
|
||||
toStringValue(const QDate &value){
|
||||
QString toStringValue(const QDate &value) {
|
||||
// ISO 8601
|
||||
return value.toString(Qt::DateFormat::ISODate);
|
||||
}
|
||||
|
||||
QString
|
||||
toStringValue(const qint32 &value) {
|
||||
QString toStringValue(const qint32 &value) {
|
||||
return QString::number(value);
|
||||
}
|
||||
|
||||
QString
|
||||
toStringValue(const qint64 &value) {
|
||||
QString toStringValue(const qint64 &value) {
|
||||
return QString::number(value);
|
||||
}
|
||||
|
||||
QString
|
||||
toStringValue(const bool &value) {
|
||||
QString toStringValue(const bool &value) {
|
||||
return QString(value ? "true" : "false");
|
||||
}
|
||||
|
||||
QString
|
||||
toStringValue(const float &value){
|
||||
QString toStringValue(const float &value) {
|
||||
return QString::number(static_cast<double>(value));
|
||||
}
|
||||
|
||||
QString
|
||||
toStringValue(const double &value){
|
||||
QString toStringValue(const double &value) {
|
||||
return QString::number(value);
|
||||
}
|
||||
|
||||
QString
|
||||
toStringValue(const {{prefix}}Object &value){
|
||||
QString toStringValue(const {{prefix}}Object &value) {
|
||||
return value.asJson();
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
toStringValue(const {{prefix}}Enum &value){
|
||||
QString toStringValue(const {{prefix}}Enum &value) {
|
||||
return value.asJson();
|
||||
}
|
||||
|
||||
QString
|
||||
toStringValue(const {{prefix}}HttpFileElement &value){
|
||||
QString toStringValue(const {{prefix}}HttpFileElement &value) {
|
||||
return value.asJson();
|
||||
}
|
||||
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const QString &value){
|
||||
QJsonValue toJsonValue(const QString &value) {
|
||||
return QJsonValue(value);
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const QDateTime &value){
|
||||
QJsonValue toJsonValue(const QDateTime &value) {
|
||||
return QJsonValue(value.toString(Qt::ISODate));
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const QByteArray &value){
|
||||
QJsonValue toJsonValue(const QByteArray &value) {
|
||||
return QJsonValue(QString(value.toBase64()));
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const QDate &value){
|
||||
QJsonValue toJsonValue(const QDate &value) {
|
||||
return QJsonValue(value.toString(Qt::ISODate));
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const qint32 &value){
|
||||
QJsonValue toJsonValue(const qint32 &value) {
|
||||
return QJsonValue(value);
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const qint64 &value){
|
||||
QJsonValue toJsonValue(const qint64 &value) {
|
||||
return QJsonValue(value);
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const bool &value){
|
||||
QJsonValue toJsonValue(const bool &value) {
|
||||
return QJsonValue(value);
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const float &value){
|
||||
QJsonValue toJsonValue(const float &value) {
|
||||
return QJsonValue(static_cast<double>(value));
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const double &value){
|
||||
QJsonValue toJsonValue(const double &value) {
|
||||
return QJsonValue(value);
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const {{prefix}}Object &value){
|
||||
QJsonValue toJsonValue(const {{prefix}}Object &value) {
|
||||
return value.asJsonObject();
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const {{prefix}}Enum &value){
|
||||
QJsonValue toJsonValue(const {{prefix}}Enum &value) {
|
||||
return value.asJsonValue();
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const {{prefix}}HttpFileElement &value){
|
||||
QJsonValue toJsonValue(const {{prefix}}HttpFileElement &value) {
|
||||
return value.asJsonValue();
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, QString &value){
|
||||
bool fromStringValue(const QString &inStr, QString &value) {
|
||||
value.clear();
|
||||
value.append(inStr);
|
||||
return !inStr.isEmpty();
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, QDateTime &value){
|
||||
bool fromStringValue(const QString &inStr, QDateTime &value) {
|
||||
if (inStr.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
auto dateTime = QDateTime::fromString(inStr, "yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm]");
|
||||
if (dateTime.isValid()) {
|
||||
value.setDate(dateTime.date());
|
||||
value.setTime(dateTime.time());
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
qDebug() << "DateTime is invalid";
|
||||
}
|
||||
return dateTime.isValid();
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, QByteArray &value){
|
||||
bool fromStringValue(const QString &inStr, QByteArray &value) {
|
||||
if (inStr.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
value.clear();
|
||||
value.append(inStr.toUtf8());
|
||||
return value.count() > 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, QDate &value){
|
||||
bool fromStringValue(const QString &inStr, QDate &value) {
|
||||
if (inStr.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
auto date = QDate::fromString(inStr, Qt::DateFormat::ISODate);
|
||||
if (date.isValid()) {
|
||||
value.setDate(date.year(), date.month(), date.day());
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
qDebug() << "Date is invalid";
|
||||
}
|
||||
return date.isValid();
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, qint32 &value){
|
||||
bool fromStringValue(const QString &inStr, qint32 &value) {
|
||||
bool ok = false;
|
||||
value = QVariant(inStr).toInt(&ok);
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, qint64 &value){
|
||||
bool fromStringValue(const QString &inStr, qint64 &value) {
|
||||
bool ok = false;
|
||||
value = QVariant(inStr).toLongLong(&ok);
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, bool &value){
|
||||
bool fromStringValue(const QString &inStr, bool &value) {
|
||||
value = QVariant(inStr).toBool();
|
||||
return ((inStr == "true") || (inStr == "false"));
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, float &value){
|
||||
bool fromStringValue(const QString &inStr, float &value) {
|
||||
bool ok = false;
|
||||
value = QVariant(inStr).toFloat(&ok);
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, double &value){
|
||||
bool fromStringValue(const QString &inStr, double &value) {
|
||||
bool ok = false;
|
||||
value = QVariant(inStr).toDouble(&ok);
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, {{prefix}}Object &value)
|
||||
bool fromStringValue(const QString &inStr, {{prefix}}Object &value)
|
||||
{
|
||||
QJsonParseError err;
|
||||
QJsonDocument::fromJson(inStr.toUtf8(),&err);
|
||||
@ -234,19 +190,16 @@ fromStringValue(const QString &inStr, {{prefix}}Object &value)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, {{prefix}}Enum &value){
|
||||
bool fromStringValue(const QString &inStr, {{prefix}}Enum &value) {
|
||||
value.fromJson(inStr);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, {{prefix}}HttpFileElement &value){
|
||||
bool fromStringValue(const QString &inStr, {{prefix}}HttpFileElement &value) {
|
||||
return value.fromStringValue(inStr);
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(QString &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(QString &value, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (!jval.isUndefined() && !jval.isNull()) {
|
||||
if (jval.isString()) {
|
||||
@ -264,8 +217,7 @@ fromJsonValue(QString &value, const QJsonValue &jval){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(QDateTime &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(QDateTime &value, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (!jval.isUndefined() && !jval.isNull() && jval.isString()) {
|
||||
value = QDateTime::fromString(jval.toString(), Qt::ISODate);
|
||||
@ -276,8 +228,7 @@ fromJsonValue(QDateTime &value, const QJsonValue &jval){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(QByteArray &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(QByteArray &value, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (!jval.isUndefined() && !jval.isNull() && jval.isString()) {
|
||||
value = QByteArray::fromBase64(QByteArray::fromStdString(jval.toString().toStdString()));
|
||||
@ -288,8 +239,7 @@ fromJsonValue(QByteArray &value, const QJsonValue &jval){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(QDate &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(QDate &value, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (!jval.isUndefined() && !jval.isNull() && jval.isString()) {
|
||||
value = QDate::fromString(jval.toString(), Qt::ISODate);
|
||||
@ -300,8 +250,7 @@ fromJsonValue(QDate &value, const QJsonValue &jval){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(qint32 &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(qint32 &value, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()) {
|
||||
value = jval.toInt();
|
||||
@ -311,8 +260,7 @@ fromJsonValue(qint32 &value, const QJsonValue &jval){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(qint64 &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(qint64 &value, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()) {
|
||||
value = jval.toVariant().toLongLong();
|
||||
@ -322,8 +270,7 @@ fromJsonValue(qint64 &value, const QJsonValue &jval){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(bool &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(bool &value, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (jval.isBool()) {
|
||||
value = jval.toBool();
|
||||
@ -333,8 +280,7 @@ fromJsonValue(bool &value, const QJsonValue &jval){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(float &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(float &value, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (jval.isDouble()) {
|
||||
value = static_cast<float>(jval.toDouble());
|
||||
@ -344,8 +290,7 @@ fromJsonValue(float &value, const QJsonValue &jval){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(double &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(double &value, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (jval.isDouble()) {
|
||||
value = jval.toDouble();
|
||||
@ -355,8 +300,7 @@ fromJsonValue(double &value, const QJsonValue &jval){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue({{prefix}}Object &value, const QJsonValue &jval){
|
||||
bool fromJsonValue({{prefix}}Object &value, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (jval.isObject()) {
|
||||
value.fromJsonObject(jval.toObject());
|
||||
@ -367,17 +311,15 @@ fromJsonValue({{prefix}}Object &value, const QJsonValue &jval){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue({{prefix}}Enum &value, const QJsonValue &jval){
|
||||
bool fromJsonValue({{prefix}}Enum &value, const QJsonValue &jval) {
|
||||
value.fromJsonValue(jval);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue({{prefix}}HttpFileElement &value, const QJsonValue &jval){
|
||||
bool fromJsonValue({{prefix}}HttpFileElement &value, const QJsonValue &jval) {
|
||||
return value.fromJsonValue(jval);
|
||||
}
|
||||
|
||||
{{#cppNamespaceDeclarations}}
|
||||
}
|
||||
} // namespace {{this}}
|
||||
{{/cppNamespaceDeclarations}}
|
||||
|
@ -2,24 +2,45 @@
|
||||
#ifndef {{prefix}}_HELPERS_H
|
||||
#define {{prefix}}_HELPERS_H
|
||||
|
||||
#include <QJsonObject>
|
||||
#include <QJsonValue>
|
||||
#include <QJsonArray>
|
||||
#include <QList>
|
||||
#include <QMap>
|
||||
#include <QDateTime>
|
||||
#include <QByteArray>
|
||||
#include <QDate>
|
||||
#include <QDateTime>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonValue>
|
||||
#include <QList>
|
||||
#include <QMap>
|
||||
#include <QVariant>
|
||||
|
||||
#include "{{prefix}}Object.h"
|
||||
#include "{{prefix}}Enum.h"
|
||||
#include "{{prefix}}HttpFileElement.h"
|
||||
#include "{{prefix}}Object.h"
|
||||
|
||||
{{#cppNamespaceDeclarations}}
|
||||
namespace {{this}} {
|
||||
{{/cppNamespaceDeclarations}}
|
||||
|
||||
template <typename T>
|
||||
QString toStringValue(const QList<T> &val);
|
||||
|
||||
template <typename T>
|
||||
bool fromStringValue(const QList<QString> &inStr, QList<T> &val);
|
||||
|
||||
template <typename T>
|
||||
bool fromStringValue(const QMap<QString, QString> &inStr, QMap<QString, T> &val);
|
||||
|
||||
template <typename T>
|
||||
QJsonValue toJsonValue(const QList<T> &val);
|
||||
|
||||
template <typename T>
|
||||
QJsonValue toJsonValue(const QMap<QString, T> &val);
|
||||
|
||||
template <typename T>
|
||||
bool fromJsonValue(QList<T> &val, const QJsonValue &jval);
|
||||
|
||||
template <typename T>
|
||||
bool fromJsonValue(QMap<QString, T> &val, const QJsonValue &jval);
|
||||
|
||||
QString toStringValue(const QString &value);
|
||||
QString toStringValue(const QDateTime &value);
|
||||
QString toStringValue(const QByteArray &value);
|
||||
@ -128,7 +149,7 @@ namespace {{this}} {
|
||||
bool fromJsonValue(QList<T> &val, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (jval.isArray()) {
|
||||
for(const auto& jitem : jval.toArray()){
|
||||
for (const auto jitem : jval.toArray()) {
|
||||
T item;
|
||||
ok &= fromJsonValue(item, jitem);
|
||||
val.push_back(item);
|
||||
@ -158,7 +179,7 @@ namespace {{this}} {
|
||||
}
|
||||
|
||||
{{#cppNamespaceDeclarations}}
|
||||
}
|
||||
} // namespace {{this}}
|
||||
{{/cppNamespaceDeclarations}}
|
||||
|
||||
#endif // {{prefix}}_HELPERS_H
|
||||
|
@ -3,8 +3,8 @@
|
||||
* {{{appDescription}}}
|
||||
*
|
||||
* {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}}
|
||||
* {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
|
||||
*
|
||||
*{{#infoEmail}} Contact: {{{infoEmail}}}
|
||||
*{{/infoEmail}}
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
|
@ -1,11 +1,10 @@
|
||||
{{>licenseInfo}}
|
||||
{{#models}}{{#model}}
|
||||
{{>licenseInfo}}{{#models}}{{#model}}
|
||||
#include "{{classname}}.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
#include <QObject>
|
||||
|
||||
#include "{{prefix}}Helpers.h"
|
||||
|
||||
@ -14,55 +13,54 @@ namespace {{this}} {
|
||||
{{/cppNamespaceDeclarations}}
|
||||
|
||||
{{classname}}::{{classname}}(QString json) {
|
||||
this->init();
|
||||
this->initializeModel();
|
||||
this->fromJson(json);
|
||||
}
|
||||
|
||||
{{classname}}::{{classname}}() {
|
||||
this->init();
|
||||
this->initializeModel();
|
||||
}
|
||||
|
||||
{{classname}}::~{{classname}}() {
|
||||
{{classname}}::~{{classname}}() {}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
{{classname}}::init() {
|
||||
void {{classname}}::initializeModel() {
|
||||
{{^isEnum}}{{#vars}}
|
||||
m_{{name}}_isSet = false;
|
||||
m_{{name}}_isValid = false;
|
||||
{{/vars}}{{/isEnum}}{{#isEnum}}
|
||||
m_{{name}}_isValid = false;{{^-last}}
|
||||
{{/-last}}{{/vars}}{{/isEnum}}{{#isEnum}}
|
||||
m_value_isSet = false;
|
||||
m_value_isValid = false;
|
||||
m_value = e{{classname}}::INVALID_VALUE_OPENAPI_GENERATED;
|
||||
{{/isEnum}}
|
||||
m_value = e{{classname}}::INVALID_VALUE_OPENAPI_GENERATED;{{/isEnum}}
|
||||
}
|
||||
|
||||
void
|
||||
{{classname}}::fromJson(QString jsonString) {
|
||||
void {{classname}}::fromJson(QString jsonString) {
|
||||
{{^isEnum}}QByteArray array(jsonString.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
this->fromJsonObject(jsonObject);{{/isEnum}}{{#isEnum}}{{#allowableValues}}{{#enumVars}}
|
||||
{{#-first}}if{{/-first}}{{^-first}}else if{{/-first}} ( jsonString.compare({{#isString}}"{{value}}"{{/isString}}{{^isString}}QString::number({{value}}){{/isString}}, Qt::CaseInsensitive) == 0) {
|
||||
m_value = e{{classname}}::{{name}};
|
||||
m_value_isValid = true;
|
||||
m_value_isSet = m_value_isValid = true;
|
||||
}{{/enumVars}}{{/allowableValues}}{{/isEnum}}
|
||||
}
|
||||
|
||||
void
|
||||
{{classname}}::fromJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}(QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} json) {
|
||||
{{^isEnum}}{{#vars}}
|
||||
{{^isContainer}}m_{{name}}_isValid = ::{{cppNamespace}}::fromJsonValue({{name}}, json[QString("{{baseName}}")]);{{/isContainer}}
|
||||
{{#isContainer}}{{^items.isContainer}}m_{{name}}_isValid = ::{{cppNamespace}}::fromJsonValue({{name}}, json[QString("{{baseName}}")]);{{/items.isContainer}}{{#items.isContainer}}{{#isListContainer}}
|
||||
void {{classname}}::fromJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}(QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} json) {
|
||||
{{^isEnum}}{{#vars}}{{^isContainer}}
|
||||
m_{{name}}_isValid = ::{{cppNamespace}}::fromJsonValue({{name}}, json[QString("{{baseName}}")]);
|
||||
m_{{name}}_isSet = !json[QString("{{baseName}}")].isNull() && m_{{name}}_isValid;{{/isContainer}}{{#isContainer}}{{^items.isContainer}}
|
||||
m_{{name}}_isValid = ::{{cppNamespace}}::fromJsonValue({{name}}, json[QString("{{baseName}}")]);
|
||||
m_{{name}}_isSet = !json[QString("{{baseName}}")].isNull() && m_{{name}}_isValid;{{/items.isContainer}}{{#items.isContainer}}{{#isListContainer}}
|
||||
if(json["{{baseName}}"].isArray()){
|
||||
auto arr = json["{{baseName}}"].toArray();
|
||||
m_{{name}}_isValid = true;
|
||||
for (const QJsonValue & jval : arr) {
|
||||
if(arr.count() > 0) {
|
||||
for (const QJsonValue jval : arr) {
|
||||
{{^items.isContainer}}{{items.baseType}}{{/items.isContainer}}{{#items.isListContainer}}QList<{{items.items.baseType}}>{{/items.isListContainer}}{{#items.isMapContainer}}QMap<QString, {{items.items.baseType}}>{{/items.isMapContainer}} item;
|
||||
m_{{name}}_isValid &= ::{{cppNamespace}}::fromJsonValue(item, jval)
|
||||
m_{{name}}_isValid &= ::{{cppNamespace}}::fromJsonValue(item, jval);
|
||||
m_{{name}}_isSet = !jval.isNull() && m_{{name}}_isValid;
|
||||
{{name}}.push_back(item);
|
||||
}
|
||||
}
|
||||
}{{/isListContainer}}{{#isMapContainer}}
|
||||
if(json["{{baseName}}"].isObject()){
|
||||
auto varmap = json["{{baseName}}"].toObject().toVariantMap();
|
||||
@ -72,16 +70,16 @@ void
|
||||
{{^items.isContainer}}{{items.baseType}}{{/items.isContainer}}{{#items.isListContainer}}QList<{{items.items.baseType}}>{{/items.isListContainer}}{{#items.isMapContainer}}QMap<QString, {{items.items.baseType}}>{{/items.isMapContainer}} item;
|
||||
auto jval = QJsonValue::fromVariant(varmap.value(val));
|
||||
m_{{name}}_isValid &= ::{{cppNamespace}}::fromJsonValue(item, jval);
|
||||
m_{{name}}_isSet &= !jval.isNull() && m_{{name}}_isValid;
|
||||
{{name}}.insert({{name}}.end(), val, item);
|
||||
}
|
||||
}
|
||||
}{{/isMapContainer}}{{/items.isContainer}}{{/isContainer}}
|
||||
{{/vars}}{{/isEnum}}{{#isEnum}}
|
||||
{{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}fromJson(json.toString());{{/isString}}{{^isString}}m_value = static_cast<e{{classname}}>(json.toInt());{{/isString}}{{/-first}}{{/enumVars}}{{/allowableValues}}{{/isEnum}}
|
||||
}{{/isMapContainer}}{{/items.isContainer}}{{/isContainer}}{{^-last}}
|
||||
{{/-last}}
|
||||
{{/vars}}{{/isEnum}}{{#isEnum}}{{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}fromJson(json.toString());{{/isString}}{{^isString}}m_value = static_cast<e{{classname}}>(json.toInt());{{/isString}}{{/-first}}{{/enumVars}}{{/allowableValues}}{{/isEnum}}
|
||||
}
|
||||
|
||||
QString
|
||||
{{classname}}::asJson () const {
|
||||
QString {{classname}}::asJson() const {
|
||||
{{^isEnum}}QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
@ -100,10 +98,10 @@ QString
|
||||
return val;{{/isEnum}}
|
||||
}
|
||||
|
||||
QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}
|
||||
{{classname}}::asJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}() const {
|
||||
{{^isEnum}}QJsonObject obj;{{#vars}}
|
||||
{{^isContainer}}{{#complexType}}if({{name}}.isSet()){{/complexType}}{{^complexType}}if(m_{{name}}_isSet){{/complexType}}{
|
||||
QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} {{classname}}::asJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}() const {
|
||||
{{^isEnum}}QJsonObject obj;{{#vars}}{{^isContainer}}{{#complexType}}
|
||||
if ({{name}}.isSet()){{/complexType}}{{^complexType}}
|
||||
if (m_{{name}}_isSet){{/complexType}} {
|
||||
obj.insert(QString("{{baseName}}"), ::{{cppNamespace}}::toJsonValue({{name}}));
|
||||
}{{/isContainer}}{{#isContainer}}
|
||||
if ({{name}}.size() > 0) {
|
||||
@ -114,13 +112,10 @@ QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}
|
||||
{{#allowableValues}}{{#enumVars}}{{#-first}}{{^isString}}return QJsonValue(static_cast<int>(m_value));{{/isString}}{{#isString}}return QJsonValue(asJson());{{/isString}}{{/-first}}{{/enumVars}}{{/allowableValues}}{{/isEnum}}
|
||||
}
|
||||
|
||||
{{^isEnum}}{{#vars}}
|
||||
{{{dataType}}}
|
||||
{{classname}}::{{getter}}() const {
|
||||
{{^isEnum}}{{#vars}}{{{dataType}}} {{classname}}::{{getter}}() const {
|
||||
return {{name}};
|
||||
}
|
||||
void
|
||||
{{classname}}::{{setter}}(const {{{dataType}}} &{{name}}) {
|
||||
void {{classname}}::{{setter}}(const {{{dataType}}} &{{name}}) {
|
||||
this->{{name}} = {{name}};
|
||||
this->m_{{name}}_isSet = true;
|
||||
}
|
||||
@ -135,25 +130,27 @@ void {{classname}}::setValue(const {{classname}}::e{{classname}}& value){
|
||||
m_value_isSet = true;
|
||||
}
|
||||
{{/isEnum}}
|
||||
bool
|
||||
{{classname}}::isSet() const {
|
||||
bool {{classname}}::isSet() const {
|
||||
{{^isEnum}}bool isObjectUpdated = false;
|
||||
do{ {{#vars}}
|
||||
{{#isContainer}}if({{name}}.size() > 0){{/isContainer}}{{^isContainer}}{{#complexType}}if({{name}}.isSet()){{/complexType}}{{^complexType}}if(m_{{name}}_isSet){{/complexType}}{{/isContainer}}{ isObjectUpdated = true; break;}
|
||||
{{/vars}}}while(false);
|
||||
do {
|
||||
{{#vars}} {{#isContainer}}if ({{name}}.size() > 0){{/isContainer}}{{^isContainer}}{{#complexType}}if ({{name}}.isSet()){{/complexType}}{{^complexType}}if (m_{{name}}_isSet){{/complexType}}{{/isContainer}} {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}{{^-last}}
|
||||
|
||||
{{/-last}}{{/vars}}
|
||||
} while (false);
|
||||
return isObjectUpdated;{{/isEnum}}{{#isEnum}}
|
||||
return m_value_isSet;{{/isEnum}}
|
||||
}
|
||||
|
||||
bool
|
||||
{{classname}}::isValid() const {
|
||||
bool {{classname}}::isValid() const {
|
||||
// only required properties are required for the object to be considered valid
|
||||
return {{^isEnum}}{{#vars}}{{#required}}m_{{name}}_isValid && {{/required}}{{/vars}}true{{/isEnum}}{{#isEnum}}m_value_isValid{{/isEnum}};
|
||||
}
|
||||
|
||||
{{#cppNamespaceDeclarations}}
|
||||
}
|
||||
} // namespace {{this}}
|
||||
{{/cppNamespaceDeclarations}}
|
||||
|
||||
{{/model}}
|
||||
{{/models}}
|
||||
|
@ -10,13 +10,11 @@
|
||||
|
||||
#include <QJsonObject>
|
||||
|
||||
{{/model}}{{/models}}
|
||||
{{#imports}}{{{import}}}
|
||||
{{/model}}{{/models}}{{#imports}}{{{import}}}
|
||||
{{/imports}}
|
||||
|
||||
#include "{{prefix}}Object.h"
|
||||
#include "{{prefix}}Enum.h"
|
||||
|
||||
#include "{{prefix}}Object.h"
|
||||
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
@ -34,12 +32,11 @@ public:
|
||||
QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} asJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}() const override;
|
||||
void fromJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}(QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} json) override;
|
||||
void fromJson(QString jsonString) override;
|
||||
|
||||
{{^isEnum}}{{#vars}}
|
||||
{{{dataType}}} {{getter}}() const;
|
||||
void {{setter}}(const {{{dataType}}} &{{name}});
|
||||
|
||||
{{/vars}}{{/isEnum}}{{#isEnum}}{{#allowableValues}}
|
||||
{{/vars}}{{/isEnum}}{{#isEnum}}
|
||||
{{#allowableValues}}
|
||||
enum class e{{classname}} {{#enumVars}}{{#-first}}{{^isString}}: int {{/isString}}{{/-first}}{{/enumVars}}{
|
||||
INVALID_VALUE_OPENAPI_GENERATED = 0,
|
||||
{{#enumVars}}
|
||||
@ -51,28 +48,25 @@ public:
|
||||
{{{name}}}{{^-last}}, {{/-last}}
|
||||
{{/enumVars}}
|
||||
};{{/allowableValues}}
|
||||
|
||||
{{classname}}::e{{classname}} getValue() const;
|
||||
void setValue(const {{classname}}::e{{classname}}& value);{{/isEnum}}
|
||||
|
||||
virtual bool isSet() const override;
|
||||
virtual bool isValid() const override;
|
||||
|
||||
private:
|
||||
void init();
|
||||
void initializeModel();
|
||||
{{^isEnum}}{{#vars}}
|
||||
{{{dataType}}} {{name}};
|
||||
bool m_{{name}}_isSet;
|
||||
bool m_{{name}}_isValid;
|
||||
{{/vars}}{{/isEnum}}
|
||||
{{#isEnum}}e{{classname}} m_value;
|
||||
{{/vars}}{{/isEnum}}{{#isEnum}}
|
||||
e{{classname}} m_value;
|
||||
bool m_value_isSet;
|
||||
bool m_value_isValid;
|
||||
{{/isEnum}}
|
||||
};
|
||||
{{/isEnum}}};
|
||||
|
||||
{{#cppNamespaceDeclarations}}
|
||||
}
|
||||
} // namespace {{this}}
|
||||
{{/cppNamespaceDeclarations}}
|
||||
|
||||
Q_DECLARE_METATYPE({{#cppNamespaceDeclarations}}{{this}}::{{/cppNamespaceDeclarations}}{{classname}})
|
||||
|
@ -2,8 +2,8 @@
|
||||
#ifndef {{prefix}}_OBJECT_H
|
||||
#define {{prefix}}_OBJECT_H
|
||||
|
||||
#include <QJsonObject>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QMetaType>
|
||||
|
||||
{{#cppNamespaceDeclarations}}
|
||||
@ -12,17 +12,13 @@ namespace {{this}} {
|
||||
|
||||
class {{prefix}}Object {
|
||||
public:
|
||||
{{prefix}}Object() {
|
||||
|
||||
}
|
||||
{{prefix}}Object() {}
|
||||
|
||||
{{prefix}}Object(QString jsonString) {
|
||||
fromJson(jsonString);
|
||||
}
|
||||
|
||||
virtual ~{{prefix}}Object(){
|
||||
|
||||
}
|
||||
virtual ~{{prefix}}Object() {}
|
||||
|
||||
virtual QJsonObject asJsonObject() const {
|
||||
return jObj;
|
||||
@ -49,12 +45,13 @@ class {{prefix}}Object {
|
||||
virtual bool isValid() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
QJsonObject jObj;
|
||||
};
|
||||
|
||||
{{#cppNamespaceDeclarations}}
|
||||
}
|
||||
} // namespace {{this}}
|
||||
{{/cppNamespaceDeclarations}}
|
||||
|
||||
Q_DECLARE_METATYPE({{#cppNamespaceDeclarations}}{{this}}::{{/cppNamespaceDeclarations}}{{prefix}}Object)
|
||||
|
@ -1 +1 @@
|
||||
4.2.3-SNAPSHOT
|
||||
4.3.0-SNAPSHOT
|
@ -5,7 +5,11 @@ set(CMAKE_VERBOSE_MAKEFILE ON)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
||||
if (MSVC)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
|
||||
else ()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Wno-unused-variable")
|
||||
endif ()
|
||||
|
||||
find_package(Qt5Core REQUIRED)
|
||||
find_package(Qt5Network REQUIRED)
|
||||
|
@ -9,8 +9,9 @@
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
#include "PFXHelpers.h"
|
||||
#include <QDebug>
|
||||
#include <QJsonParseError>
|
||||
#include "PFXHelpers.h"
|
||||
|
||||
namespace test_namespace {
|
||||
|
||||
@ -186,6 +187,17 @@ bool fromStringValue(const QString &inStr, double &value) {
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool fromStringValue(const QString &inStr, PFXObject &value)
|
||||
{
|
||||
QJsonParseError err;
|
||||
QJsonDocument::fromJson(inStr.toUtf8(),&err);
|
||||
if ( err.error == QJsonParseError::NoError ){
|
||||
value.fromJson(inStr);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool fromStringValue(const QString &inStr, PFXEnum &value) {
|
||||
value.fromJson(inStr);
|
||||
return true;
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
|
@ -4,39 +4,34 @@
|
||||
*
|
||||
* 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 "OAIApiResponse.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
#include <QObject>
|
||||
|
||||
#include "OAIHelpers.h"
|
||||
|
||||
namespace OpenAPI {
|
||||
|
||||
OAIApiResponse::OAIApiResponse(QString json) {
|
||||
this->init();
|
||||
this->initializeModel();
|
||||
this->fromJson(json);
|
||||
}
|
||||
|
||||
OAIApiResponse::OAIApiResponse() {
|
||||
this->init();
|
||||
this->initializeModel();
|
||||
}
|
||||
|
||||
OAIApiResponse::~OAIApiResponse() {
|
||||
OAIApiResponse::~OAIApiResponse() {}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
OAIApiResponse::init() {
|
||||
void OAIApiResponse::initializeModel() {
|
||||
|
||||
m_code_isSet = false;
|
||||
m_code_isValid = false;
|
||||
@ -48,38 +43,33 @@ OAIApiResponse::init() {
|
||||
m_message_isValid = false;
|
||||
}
|
||||
|
||||
void
|
||||
OAIApiResponse::fromJson(QString jsonString) {
|
||||
void OAIApiResponse::fromJson(QString jsonString) {
|
||||
QByteArray array(jsonString.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
this->fromJsonObject(jsonObject);
|
||||
}
|
||||
|
||||
void
|
||||
OAIApiResponse::fromJsonObject(QJsonObject json) {
|
||||
void OAIApiResponse::fromJsonObject(QJsonObject json) {
|
||||
|
||||
m_code_isValid = ::OpenAPI::fromJsonValue(code, json[QString("code")]);
|
||||
|
||||
m_code_isSet = !json[QString("code")].isNull() && m_code_isValid;
|
||||
|
||||
m_type_isValid = ::OpenAPI::fromJsonValue(type, json[QString("type")]);
|
||||
|
||||
m_type_isSet = !json[QString("type")].isNull() && m_type_isValid;
|
||||
|
||||
m_message_isValid = ::OpenAPI::fromJsonValue(message, json[QString("message")]);
|
||||
|
||||
|
||||
m_message_isSet = !json[QString("message")].isNull() && m_message_isValid;
|
||||
}
|
||||
|
||||
QString
|
||||
OAIApiResponse::asJson () const {
|
||||
QString OAIApiResponse::asJson() const {
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
OAIApiResponse::asJsonObject() const {
|
||||
QJsonObject OAIApiResponse::asJsonObject() const {
|
||||
QJsonObject obj;
|
||||
if (m_code_isSet) {
|
||||
obj.insert(QString("code"), ::OpenAPI::toJsonValue(code));
|
||||
@ -93,57 +83,54 @@ OAIApiResponse::asJsonObject() const {
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
qint32
|
||||
OAIApiResponse::getCode() const {
|
||||
qint32 OAIApiResponse::getCode() const {
|
||||
return code;
|
||||
}
|
||||
void
|
||||
OAIApiResponse::setCode(const qint32 &code) {
|
||||
void OAIApiResponse::setCode(const qint32 &code) {
|
||||
this->code = code;
|
||||
this->m_code_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
OAIApiResponse::getType() const {
|
||||
QString OAIApiResponse::getType() const {
|
||||
return type;
|
||||
}
|
||||
void
|
||||
OAIApiResponse::setType(const QString &type) {
|
||||
void OAIApiResponse::setType(const QString &type) {
|
||||
this->type = type;
|
||||
this->m_type_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
OAIApiResponse::getMessage() const {
|
||||
QString OAIApiResponse::getMessage() const {
|
||||
return message;
|
||||
}
|
||||
void
|
||||
OAIApiResponse::setMessage(const QString &message) {
|
||||
void OAIApiResponse::setMessage(const QString &message) {
|
||||
this->message = message;
|
||||
this->m_message_isSet = true;
|
||||
}
|
||||
|
||||
bool
|
||||
OAIApiResponse::isSet() const {
|
||||
bool OAIApiResponse::isSet() const {
|
||||
bool isObjectUpdated = false;
|
||||
do {
|
||||
if(m_code_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_code_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_type_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_type_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_message_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_message_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
} while (false);
|
||||
return isObjectUpdated;
|
||||
}
|
||||
|
||||
bool
|
||||
OAIApiResponse::isValid() const {
|
||||
bool OAIApiResponse::isValid() const {
|
||||
// only required properties are required for the object to be considered valid
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // namespace OpenAPI
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
@ -21,12 +20,10 @@
|
||||
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include "OAIObject.h"
|
||||
#include "OAIEnum.h"
|
||||
|
||||
#include "OAIObject.h"
|
||||
|
||||
namespace OpenAPI {
|
||||
|
||||
@ -41,25 +38,20 @@ public:
|
||||
void fromJsonObject(QJsonObject json) override;
|
||||
void fromJson(QString jsonString) override;
|
||||
|
||||
|
||||
qint32 getCode() const;
|
||||
void setCode(const qint32 &code);
|
||||
|
||||
|
||||
QString getType() const;
|
||||
void setType(const QString &type);
|
||||
|
||||
|
||||
QString getMessage() const;
|
||||
void setMessage(const QString &message);
|
||||
|
||||
|
||||
|
||||
virtual bool isSet() const override;
|
||||
virtual bool isValid() const override;
|
||||
|
||||
private:
|
||||
void init();
|
||||
void initializeModel();
|
||||
|
||||
qint32 code;
|
||||
bool m_code_isSet;
|
||||
@ -72,10 +64,9 @@ private:
|
||||
QString message;
|
||||
bool m_message_isSet;
|
||||
bool m_message_isValid;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace OpenAPI
|
||||
|
||||
Q_DECLARE_METATYPE(OpenAPI::OAIApiResponse)
|
||||
|
||||
|
@ -4,39 +4,34 @@
|
||||
*
|
||||
* 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 <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
#include <QObject>
|
||||
|
||||
#include "OAIHelpers.h"
|
||||
|
||||
namespace OpenAPI {
|
||||
|
||||
OAICategory::OAICategory(QString json) {
|
||||
this->init();
|
||||
this->initializeModel();
|
||||
this->fromJson(json);
|
||||
}
|
||||
|
||||
OAICategory::OAICategory() {
|
||||
this->init();
|
||||
this->initializeModel();
|
||||
}
|
||||
|
||||
OAICategory::~OAICategory() {
|
||||
OAICategory::~OAICategory() {}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
OAICategory::init() {
|
||||
void OAICategory::initializeModel() {
|
||||
|
||||
m_id_isSet = false;
|
||||
m_id_isValid = false;
|
||||
@ -45,35 +40,30 @@ OAICategory::init() {
|
||||
m_name_isValid = false;
|
||||
}
|
||||
|
||||
void
|
||||
OAICategory::fromJson(QString jsonString) {
|
||||
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) {
|
||||
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 {
|
||||
QString OAICategory::asJson() const {
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
OAICategory::asJsonObject() const {
|
||||
QJsonObject OAICategory::asJsonObject() const {
|
||||
QJsonObject obj;
|
||||
if (m_id_isSet) {
|
||||
obj.insert(QString("id"), ::OpenAPI::toJsonValue(id));
|
||||
@ -84,44 +74,41 @@ OAICategory::asJsonObject() const {
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
qint64
|
||||
OAICategory::getId() const {
|
||||
qint64 OAICategory::getId() const {
|
||||
return id;
|
||||
}
|
||||
void
|
||||
OAICategory::setId(const qint64 &id) {
|
||||
void OAICategory::setId(const qint64 &id) {
|
||||
this->id = id;
|
||||
this->m_id_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
OAICategory::getName() const {
|
||||
QString OAICategory::getName() const {
|
||||
return name;
|
||||
}
|
||||
void
|
||||
OAICategory::setName(const QString &name) {
|
||||
void OAICategory::setName(const QString &name) {
|
||||
this->name = name;
|
||||
this->m_name_isSet = true;
|
||||
}
|
||||
|
||||
bool
|
||||
OAICategory::isSet() const {
|
||||
bool OAICategory::isSet() const {
|
||||
bool isObjectUpdated = false;
|
||||
do {
|
||||
if(m_id_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_id_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_name_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_name_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
} while (false);
|
||||
return isObjectUpdated;
|
||||
}
|
||||
|
||||
bool
|
||||
OAICategory::isValid() const {
|
||||
bool OAICategory::isValid() const {
|
||||
// only required properties are required for the object to be considered valid
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // namespace OpenAPI
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
@ -21,12 +20,10 @@
|
||||
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include "OAIObject.h"
|
||||
#include "OAIEnum.h"
|
||||
|
||||
#include "OAIObject.h"
|
||||
|
||||
namespace OpenAPI {
|
||||
|
||||
@ -41,21 +38,17 @@ public:
|
||||
void fromJsonObject(QJsonObject json) override;
|
||||
void fromJson(QString jsonString) override;
|
||||
|
||||
|
||||
qint64 getId() const;
|
||||
void setId(const qint64 &id);
|
||||
|
||||
|
||||
QString getName() const;
|
||||
void setName(const QString &name);
|
||||
|
||||
|
||||
|
||||
virtual bool isSet() const override;
|
||||
virtual bool isValid() const override;
|
||||
|
||||
private:
|
||||
void init();
|
||||
void initializeModel();
|
||||
|
||||
qint64 id;
|
||||
bool m_id_isSet;
|
||||
@ -64,10 +57,9 @@ private:
|
||||
QString name;
|
||||
bool m_name_isSet;
|
||||
bool m_name_isValid;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace OpenAPI
|
||||
|
||||
Q_DECLARE_METATYPE(OpenAPI::OAICategory)
|
||||
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
@ -13,25 +12,21 @@
|
||||
#ifndef OAI_ENUM_H
|
||||
#define OAI_ENUM_H
|
||||
|
||||
#include <QString>
|
||||
#include <QJsonValue>
|
||||
#include <QMetaType>
|
||||
#include <QString>
|
||||
|
||||
namespace OpenAPI {
|
||||
|
||||
class OAIEnum {
|
||||
public:
|
||||
OAIEnum() {
|
||||
|
||||
}
|
||||
OAIEnum() {}
|
||||
|
||||
OAIEnum(QString jsonString) {
|
||||
fromJson(jsonString);
|
||||
}
|
||||
|
||||
virtual ~OAIEnum(){
|
||||
|
||||
}
|
||||
virtual ~OAIEnum() {}
|
||||
|
||||
virtual QJsonValue asJsonValue() const {
|
||||
return QJsonValue(jstr);
|
||||
@ -56,11 +51,12 @@ class OAIEnum {
|
||||
virtual bool isValid() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
QString jstr;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace OpenAPI
|
||||
|
||||
Q_DECLARE_METATYPE(OpenAPI::OAIEnum)
|
||||
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
@ -14,225 +13,181 @@
|
||||
#include <QJsonParseError>
|
||||
#include "OAIHelpers.h"
|
||||
|
||||
|
||||
namespace OpenAPI {
|
||||
|
||||
|
||||
QString
|
||||
toStringValue(const QString &value) {
|
||||
QString toStringValue(const QString &value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
QString
|
||||
toStringValue(const QDateTime &value){
|
||||
QString toStringValue(const QDateTime &value) {
|
||||
// ISO 8601
|
||||
return value.toString("yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm]");
|
||||
}
|
||||
|
||||
QString
|
||||
toStringValue(const QByteArray &value){
|
||||
QString toStringValue(const QByteArray &value) {
|
||||
return QString(value);
|
||||
}
|
||||
|
||||
QString
|
||||
toStringValue(const QDate &value){
|
||||
QString toStringValue(const QDate &value) {
|
||||
// ISO 8601
|
||||
return value.toString(Qt::DateFormat::ISODate);
|
||||
}
|
||||
|
||||
QString
|
||||
toStringValue(const qint32 &value) {
|
||||
QString toStringValue(const qint32 &value) {
|
||||
return QString::number(value);
|
||||
}
|
||||
|
||||
QString
|
||||
toStringValue(const qint64 &value) {
|
||||
QString toStringValue(const qint64 &value) {
|
||||
return QString::number(value);
|
||||
}
|
||||
|
||||
QString
|
||||
toStringValue(const bool &value) {
|
||||
QString toStringValue(const bool &value) {
|
||||
return QString(value ? "true" : "false");
|
||||
}
|
||||
|
||||
QString
|
||||
toStringValue(const float &value){
|
||||
QString toStringValue(const float &value) {
|
||||
return QString::number(static_cast<double>(value));
|
||||
}
|
||||
|
||||
QString
|
||||
toStringValue(const double &value){
|
||||
QString toStringValue(const double &value) {
|
||||
return QString::number(value);
|
||||
}
|
||||
|
||||
QString
|
||||
toStringValue(const OAIObject &value){
|
||||
QString toStringValue(const OAIObject &value) {
|
||||
return value.asJson();
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
toStringValue(const OAIEnum &value){
|
||||
QString toStringValue(const OAIEnum &value) {
|
||||
return value.asJson();
|
||||
}
|
||||
|
||||
QString
|
||||
toStringValue(const OAIHttpFileElement &value){
|
||||
QString toStringValue(const OAIHttpFileElement &value) {
|
||||
return value.asJson();
|
||||
}
|
||||
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const QString &value){
|
||||
QJsonValue toJsonValue(const QString &value) {
|
||||
return QJsonValue(value);
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const QDateTime &value){
|
||||
QJsonValue toJsonValue(const QDateTime &value) {
|
||||
return QJsonValue(value.toString(Qt::ISODate));
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const QByteArray &value){
|
||||
QJsonValue toJsonValue(const QByteArray &value) {
|
||||
return QJsonValue(QString(value.toBase64()));
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const QDate &value){
|
||||
QJsonValue toJsonValue(const QDate &value) {
|
||||
return QJsonValue(value.toString(Qt::ISODate));
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const qint32 &value){
|
||||
QJsonValue toJsonValue(const qint32 &value) {
|
||||
return QJsonValue(value);
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const qint64 &value){
|
||||
QJsonValue toJsonValue(const qint64 &value) {
|
||||
return QJsonValue(value);
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const bool &value){
|
||||
QJsonValue toJsonValue(const bool &value) {
|
||||
return QJsonValue(value);
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const float &value){
|
||||
QJsonValue toJsonValue(const float &value) {
|
||||
return QJsonValue(static_cast<double>(value));
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const double &value){
|
||||
QJsonValue toJsonValue(const double &value) {
|
||||
return QJsonValue(value);
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const OAIObject &value){
|
||||
QJsonValue toJsonValue(const OAIObject &value) {
|
||||
return value.asJsonObject();
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const OAIEnum &value){
|
||||
QJsonValue toJsonValue(const OAIEnum &value) {
|
||||
return value.asJsonValue();
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
toJsonValue(const OAIHttpFileElement &value){
|
||||
QJsonValue toJsonValue(const OAIHttpFileElement &value) {
|
||||
return value.asJsonValue();
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, QString &value){
|
||||
bool fromStringValue(const QString &inStr, QString &value) {
|
||||
value.clear();
|
||||
value.append(inStr);
|
||||
return !inStr.isEmpty();
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, QDateTime &value){
|
||||
bool fromStringValue(const QString &inStr, QDateTime &value) {
|
||||
if (inStr.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
auto dateTime = QDateTime::fromString(inStr, "yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm]");
|
||||
if (dateTime.isValid()) {
|
||||
value.setDate(dateTime.date());
|
||||
value.setTime(dateTime.time());
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
qDebug() << "DateTime is invalid";
|
||||
}
|
||||
return dateTime.isValid();
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, QByteArray &value){
|
||||
bool fromStringValue(const QString &inStr, QByteArray &value) {
|
||||
if (inStr.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
value.clear();
|
||||
value.append(inStr.toUtf8());
|
||||
return value.count() > 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, QDate &value){
|
||||
bool fromStringValue(const QString &inStr, QDate &value) {
|
||||
if (inStr.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
auto date = QDate::fromString(inStr, Qt::DateFormat::ISODate);
|
||||
if (date.isValid()) {
|
||||
value.setDate(date.year(), date.month(), date.day());
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
qDebug() << "Date is invalid";
|
||||
}
|
||||
return date.isValid();
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, qint32 &value){
|
||||
bool fromStringValue(const QString &inStr, qint32 &value) {
|
||||
bool ok = false;
|
||||
value = QVariant(inStr).toInt(&ok);
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, qint64 &value){
|
||||
bool fromStringValue(const QString &inStr, qint64 &value) {
|
||||
bool ok = false;
|
||||
value = QVariant(inStr).toLongLong(&ok);
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, bool &value){
|
||||
bool fromStringValue(const QString &inStr, bool &value) {
|
||||
value = QVariant(inStr).toBool();
|
||||
return ((inStr == "true") || (inStr == "false"));
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, float &value){
|
||||
bool fromStringValue(const QString &inStr, float &value) {
|
||||
bool ok = false;
|
||||
value = QVariant(inStr).toFloat(&ok);
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, double &value){
|
||||
bool fromStringValue(const QString &inStr, double &value) {
|
||||
bool ok = false;
|
||||
value = QVariant(inStr).toDouble(&ok);
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, OAIObject &value)
|
||||
bool fromStringValue(const QString &inStr, OAIObject &value)
|
||||
{
|
||||
QJsonParseError err;
|
||||
QJsonDocument::fromJson(inStr.toUtf8(),&err);
|
||||
@ -243,19 +198,16 @@ fromStringValue(const QString &inStr, OAIObject &value)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, OAIEnum &value){
|
||||
bool fromStringValue(const QString &inStr, OAIEnum &value) {
|
||||
value.fromJson(inStr);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, OAIHttpFileElement &value){
|
||||
bool fromStringValue(const QString &inStr, OAIHttpFileElement &value) {
|
||||
return value.fromStringValue(inStr);
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(QString &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(QString &value, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (!jval.isUndefined() && !jval.isNull()) {
|
||||
if (jval.isString()) {
|
||||
@ -273,8 +225,7 @@ fromJsonValue(QString &value, const QJsonValue &jval){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(QDateTime &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(QDateTime &value, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (!jval.isUndefined() && !jval.isNull() && jval.isString()) {
|
||||
value = QDateTime::fromString(jval.toString(), Qt::ISODate);
|
||||
@ -285,8 +236,7 @@ fromJsonValue(QDateTime &value, const QJsonValue &jval){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(QByteArray &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(QByteArray &value, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (!jval.isUndefined() && !jval.isNull() && jval.isString()) {
|
||||
value = QByteArray::fromBase64(QByteArray::fromStdString(jval.toString().toStdString()));
|
||||
@ -297,8 +247,7 @@ fromJsonValue(QByteArray &value, const QJsonValue &jval){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(QDate &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(QDate &value, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (!jval.isUndefined() && !jval.isNull() && jval.isString()) {
|
||||
value = QDate::fromString(jval.toString(), Qt::ISODate);
|
||||
@ -309,8 +258,7 @@ fromJsonValue(QDate &value, const QJsonValue &jval){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(qint32 &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(qint32 &value, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()) {
|
||||
value = jval.toInt();
|
||||
@ -320,8 +268,7 @@ fromJsonValue(qint32 &value, const QJsonValue &jval){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(qint64 &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(qint64 &value, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()) {
|
||||
value = jval.toVariant().toLongLong();
|
||||
@ -331,8 +278,7 @@ fromJsonValue(qint64 &value, const QJsonValue &jval){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(bool &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(bool &value, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (jval.isBool()) {
|
||||
value = jval.toBool();
|
||||
@ -342,8 +288,7 @@ fromJsonValue(bool &value, const QJsonValue &jval){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(float &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(float &value, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (jval.isDouble()) {
|
||||
value = static_cast<float>(jval.toDouble());
|
||||
@ -353,8 +298,7 @@ fromJsonValue(float &value, const QJsonValue &jval){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(double &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(double &value, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (jval.isDouble()) {
|
||||
value = jval.toDouble();
|
||||
@ -364,8 +308,7 @@ fromJsonValue(double &value, const QJsonValue &jval){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(OAIObject &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(OAIObject &value, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (jval.isObject()) {
|
||||
value.fromJsonObject(jval.toObject());
|
||||
@ -376,15 +319,13 @@ fromJsonValue(OAIObject &value, const QJsonValue &jval){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(OAIEnum &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(OAIEnum &value, const QJsonValue &jval) {
|
||||
value.fromJsonValue(jval);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
fromJsonValue(OAIHttpFileElement &value, const QJsonValue &jval){
|
||||
bool fromJsonValue(OAIHttpFileElement &value, const QJsonValue &jval) {
|
||||
return value.fromJsonValue(jval);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace OpenAPI
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
@ -13,22 +12,43 @@
|
||||
#ifndef OAI_HELPERS_H
|
||||
#define OAI_HELPERS_H
|
||||
|
||||
#include <QJsonObject>
|
||||
#include <QJsonValue>
|
||||
#include <QJsonArray>
|
||||
#include <QList>
|
||||
#include <QMap>
|
||||
#include <QDateTime>
|
||||
#include <QByteArray>
|
||||
#include <QDate>
|
||||
#include <QDateTime>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonValue>
|
||||
#include <QList>
|
||||
#include <QMap>
|
||||
#include <QVariant>
|
||||
|
||||
#include "OAIObject.h"
|
||||
#include "OAIEnum.h"
|
||||
#include "OAIHttpFileElement.h"
|
||||
#include "OAIObject.h"
|
||||
|
||||
namespace OpenAPI {
|
||||
|
||||
template <typename T>
|
||||
QString toStringValue(const QList<T> &val);
|
||||
|
||||
template <typename T>
|
||||
bool fromStringValue(const QList<QString> &inStr, QList<T> &val);
|
||||
|
||||
template <typename T>
|
||||
bool fromStringValue(const QMap<QString, QString> &inStr, QMap<QString, T> &val);
|
||||
|
||||
template <typename T>
|
||||
QJsonValue toJsonValue(const QList<T> &val);
|
||||
|
||||
template <typename T>
|
||||
QJsonValue toJsonValue(const QMap<QString, T> &val);
|
||||
|
||||
template <typename T>
|
||||
bool fromJsonValue(QList<T> &val, const QJsonValue &jval);
|
||||
|
||||
template <typename T>
|
||||
bool fromJsonValue(QMap<QString, T> &val, const QJsonValue &jval);
|
||||
|
||||
QString toStringValue(const QString &value);
|
||||
QString toStringValue(const QDateTime &value);
|
||||
QString toStringValue(const QByteArray &value);
|
||||
@ -137,7 +157,7 @@ namespace OpenAPI {
|
||||
bool fromJsonValue(QList<T> &val, const QJsonValue &jval) {
|
||||
bool ok = true;
|
||||
if (jval.isArray()) {
|
||||
for(const auto& jitem : jval.toArray()){
|
||||
for (const auto jitem : jval.toArray()) {
|
||||
T item;
|
||||
ok &= fromJsonValue(item, jitem);
|
||||
val.push_back(item);
|
||||
@ -166,6 +186,6 @@ namespace OpenAPI {
|
||||
return ok;
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace OpenAPI
|
||||
|
||||
#endif // OAI_HELPERS_H
|
||||
|
@ -4,13 +4,11 @@
|
||||
*
|
||||
* 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 <QDebug>
|
||||
#include <QFile>
|
||||
#include <QJsonDocument>
|
||||
@ -20,33 +18,27 @@
|
||||
|
||||
namespace OpenAPI {
|
||||
|
||||
void
|
||||
OAIHttpFileElement::setMimeType(const QString &mime){
|
||||
void OAIHttpFileElement::setMimeType(const QString &mime) {
|
||||
mime_type = mime;
|
||||
}
|
||||
|
||||
void
|
||||
OAIHttpFileElement::setFileName(const QString &name){
|
||||
void OAIHttpFileElement::setFileName(const QString &name) {
|
||||
local_filename = name;
|
||||
}
|
||||
|
||||
void
|
||||
OAIHttpFileElement::setVariableName(const QString &name){
|
||||
void OAIHttpFileElement::setVariableName(const QString &name) {
|
||||
variable_name = name;
|
||||
}
|
||||
|
||||
void
|
||||
OAIHttpFileElement::setRequestFileName(const QString &name){
|
||||
void OAIHttpFileElement::setRequestFileName(const QString &name) {
|
||||
request_filename = name;
|
||||
}
|
||||
|
||||
bool
|
||||
OAIHttpFileElement::isSet() const {
|
||||
bool OAIHttpFileElement::isSet() const {
|
||||
return !local_filename.isEmpty() || !request_filename.isEmpty();
|
||||
}
|
||||
|
||||
QString
|
||||
OAIHttpFileElement::asJson() const{
|
||||
QString OAIHttpFileElement::asJson() const {
|
||||
QFile file(local_filename);
|
||||
QByteArray bArray;
|
||||
bool result = false;
|
||||
@ -61,8 +53,7 @@ OAIHttpFileElement::asJson() const{
|
||||
return QString(bArray);
|
||||
}
|
||||
|
||||
QJsonValue
|
||||
OAIHttpFileElement::asJsonValue() const{
|
||||
QJsonValue OAIHttpFileElement::asJsonValue() const {
|
||||
QFile file(local_filename);
|
||||
QByteArray bArray;
|
||||
bool result = false;
|
||||
@ -77,8 +68,7 @@ OAIHttpFileElement::asJsonValue() const{
|
||||
return QJsonDocument::fromBinaryData(bArray.data()).object();
|
||||
}
|
||||
|
||||
bool
|
||||
OAIHttpFileElement::fromStringValue(const QString &instr){
|
||||
bool OAIHttpFileElement::fromStringValue(const QString &instr) {
|
||||
QFile file(local_filename);
|
||||
bool result = false;
|
||||
if (file.exists()) {
|
||||
@ -93,8 +83,7 @@ OAIHttpFileElement::fromStringValue(const QString &instr){
|
||||
return result;
|
||||
}
|
||||
|
||||
bool
|
||||
OAIHttpFileElement::fromJsonValue(const QJsonValue &jval) {
|
||||
bool OAIHttpFileElement::fromJsonValue(const QJsonValue &jval) {
|
||||
QFile file(local_filename);
|
||||
bool result = false;
|
||||
if (file.exists()) {
|
||||
@ -109,8 +98,7 @@ OAIHttpFileElement::fromJsonValue(const QJsonValue &jval) {
|
||||
return result;
|
||||
}
|
||||
|
||||
QByteArray
|
||||
OAIHttpFileElement::asByteArray() const {
|
||||
QByteArray OAIHttpFileElement::asByteArray() const {
|
||||
QFile file(local_filename);
|
||||
QByteArray bArray;
|
||||
bool result = false;
|
||||
@ -125,8 +113,7 @@ OAIHttpFileElement::asByteArray() const {
|
||||
return bArray;
|
||||
}
|
||||
|
||||
bool
|
||||
OAIHttpFileElement::fromByteArray(const QByteArray& bytes){
|
||||
bool OAIHttpFileElement::fromByteArray(const QByteArray &bytes) {
|
||||
QFile file(local_filename);
|
||||
bool result = false;
|
||||
if (file.exists()) {
|
||||
@ -141,8 +128,7 @@ OAIHttpFileElement::fromByteArray(const QByteArray& bytes){
|
||||
return result;
|
||||
}
|
||||
|
||||
bool
|
||||
OAIHttpFileElement::saveToFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime, const QByteArray& bytes){
|
||||
bool OAIHttpFileElement::saveToFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime, const QByteArray &bytes) {
|
||||
setMimeType(mime);
|
||||
setFileName(localFName);
|
||||
setVariableName(varName);
|
||||
@ -150,8 +136,7 @@ OAIHttpFileElement::saveToFile(const QString &varName, const QString &localFName
|
||||
return fromByteArray(bytes);
|
||||
}
|
||||
|
||||
QByteArray
|
||||
OAIHttpFileElement::loadFromFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime){
|
||||
QByteArray OAIHttpFileElement::loadFromFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime) {
|
||||
setMimeType(mime);
|
||||
setFileName(localFName);
|
||||
setVariableName(varName);
|
||||
@ -159,4 +144,4 @@ OAIHttpFileElement::loadFromFile(const QString &varName, const QString &localFNa
|
||||
return asByteArray();
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace OpenAPI
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
@ -17,7 +16,6 @@
|
||||
#include <QMetaType>
|
||||
#include <QString>
|
||||
|
||||
|
||||
namespace OpenAPI {
|
||||
|
||||
class OAIHttpFileElement {
|
||||
@ -42,7 +40,7 @@ public:
|
||||
QByteArray loadFromFile(const QString &variable_name, const QString &local_filename, const QString &request_filename, const QString &mime);
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace OpenAPI
|
||||
|
||||
Q_DECLARE_METATYPE(OpenAPI::OAIHttpFileElement)
|
||||
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
@ -13,25 +12,21 @@
|
||||
#ifndef OAI_OBJECT_H
|
||||
#define OAI_OBJECT_H
|
||||
|
||||
#include <QJsonObject>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QMetaType>
|
||||
|
||||
namespace OpenAPI {
|
||||
|
||||
class OAIObject {
|
||||
public:
|
||||
OAIObject() {
|
||||
|
||||
}
|
||||
OAIObject() {}
|
||||
|
||||
OAIObject(QString jsonString) {
|
||||
fromJson(jsonString);
|
||||
}
|
||||
|
||||
virtual ~OAIObject(){
|
||||
|
||||
}
|
||||
virtual ~OAIObject() {}
|
||||
|
||||
virtual QJsonObject asJsonObject() const {
|
||||
return jObj;
|
||||
@ -58,11 +53,12 @@ class OAIObject {
|
||||
virtual bool isValid() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
QJsonObject jObj;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace OpenAPI
|
||||
|
||||
Q_DECLARE_METATYPE(OpenAPI::OAIObject)
|
||||
|
||||
|
@ -4,39 +4,34 @@
|
||||
*
|
||||
* 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 "OAIOrder.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
#include <QObject>
|
||||
|
||||
#include "OAIHelpers.h"
|
||||
|
||||
namespace OpenAPI {
|
||||
|
||||
OAIOrder::OAIOrder(QString json) {
|
||||
this->init();
|
||||
this->initializeModel();
|
||||
this->fromJson(json);
|
||||
}
|
||||
|
||||
OAIOrder::OAIOrder() {
|
||||
this->init();
|
||||
this->initializeModel();
|
||||
}
|
||||
|
||||
OAIOrder::~OAIOrder() {
|
||||
OAIOrder::~OAIOrder() {}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
OAIOrder::init() {
|
||||
void OAIOrder::initializeModel() {
|
||||
|
||||
m_id_isSet = false;
|
||||
m_id_isValid = false;
|
||||
@ -57,47 +52,42 @@ OAIOrder::init() {
|
||||
m_complete_isValid = false;
|
||||
}
|
||||
|
||||
void
|
||||
OAIOrder::fromJson(QString jsonString) {
|
||||
void OAIOrder::fromJson(QString jsonString) {
|
||||
QByteArray array(jsonString.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
this->fromJsonObject(jsonObject);
|
||||
}
|
||||
|
||||
void
|
||||
OAIOrder::fromJsonObject(QJsonObject json) {
|
||||
void OAIOrder::fromJsonObject(QJsonObject json) {
|
||||
|
||||
m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]);
|
||||
|
||||
m_id_isSet = !json[QString("id")].isNull() && m_id_isValid;
|
||||
|
||||
m_pet_id_isValid = ::OpenAPI::fromJsonValue(pet_id, json[QString("petId")]);
|
||||
|
||||
m_pet_id_isSet = !json[QString("petId")].isNull() && m_pet_id_isValid;
|
||||
|
||||
m_quantity_isValid = ::OpenAPI::fromJsonValue(quantity, json[QString("quantity")]);
|
||||
|
||||
m_quantity_isSet = !json[QString("quantity")].isNull() && m_quantity_isValid;
|
||||
|
||||
m_ship_date_isValid = ::OpenAPI::fromJsonValue(ship_date, json[QString("shipDate")]);
|
||||
|
||||
m_ship_date_isSet = !json[QString("shipDate")].isNull() && m_ship_date_isValid;
|
||||
|
||||
m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]);
|
||||
|
||||
m_status_isSet = !json[QString("status")].isNull() && m_status_isValid;
|
||||
|
||||
m_complete_isValid = ::OpenAPI::fromJsonValue(complete, json[QString("complete")]);
|
||||
|
||||
|
||||
m_complete_isSet = !json[QString("complete")].isNull() && m_complete_isValid;
|
||||
}
|
||||
|
||||
QString
|
||||
OAIOrder::asJson () const {
|
||||
QString OAIOrder::asJson() const {
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
OAIOrder::asJsonObject() const {
|
||||
QJsonObject OAIOrder::asJsonObject() const {
|
||||
QJsonObject obj;
|
||||
if (m_id_isSet) {
|
||||
obj.insert(QString("id"), ::OpenAPI::toJsonValue(id));
|
||||
@ -120,96 +110,93 @@ OAIOrder::asJsonObject() const {
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
qint64
|
||||
OAIOrder::getId() const {
|
||||
qint64 OAIOrder::getId() const {
|
||||
return id;
|
||||
}
|
||||
void
|
||||
OAIOrder::setId(const qint64 &id) {
|
||||
void OAIOrder::setId(const qint64 &id) {
|
||||
this->id = id;
|
||||
this->m_id_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
qint64
|
||||
OAIOrder::getPetId() const {
|
||||
qint64 OAIOrder::getPetId() const {
|
||||
return pet_id;
|
||||
}
|
||||
void
|
||||
OAIOrder::setPetId(const qint64 &pet_id) {
|
||||
void OAIOrder::setPetId(const qint64 &pet_id) {
|
||||
this->pet_id = pet_id;
|
||||
this->m_pet_id_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
qint32
|
||||
OAIOrder::getQuantity() const {
|
||||
qint32 OAIOrder::getQuantity() const {
|
||||
return quantity;
|
||||
}
|
||||
void
|
||||
OAIOrder::setQuantity(const qint32 &quantity) {
|
||||
void OAIOrder::setQuantity(const qint32 &quantity) {
|
||||
this->quantity = quantity;
|
||||
this->m_quantity_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
QDateTime
|
||||
OAIOrder::getShipDate() const {
|
||||
QDateTime OAIOrder::getShipDate() const {
|
||||
return ship_date;
|
||||
}
|
||||
void
|
||||
OAIOrder::setShipDate(const QDateTime &ship_date) {
|
||||
void OAIOrder::setShipDate(const QDateTime &ship_date) {
|
||||
this->ship_date = ship_date;
|
||||
this->m_ship_date_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
OAIOrder::getStatus() const {
|
||||
QString OAIOrder::getStatus() const {
|
||||
return status;
|
||||
}
|
||||
void
|
||||
OAIOrder::setStatus(const QString &status) {
|
||||
void OAIOrder::setStatus(const QString &status) {
|
||||
this->status = status;
|
||||
this->m_status_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
OAIOrder::isComplete() const {
|
||||
bool OAIOrder::isComplete() const {
|
||||
return complete;
|
||||
}
|
||||
void
|
||||
OAIOrder::setComplete(const bool &complete) {
|
||||
void OAIOrder::setComplete(const bool &complete) {
|
||||
this->complete = complete;
|
||||
this->m_complete_isSet = true;
|
||||
}
|
||||
|
||||
bool
|
||||
OAIOrder::isSet() const {
|
||||
bool OAIOrder::isSet() const {
|
||||
bool isObjectUpdated = false;
|
||||
do {
|
||||
if(m_id_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_id_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_pet_id_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_pet_id_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_quantity_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_quantity_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_ship_date_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_ship_date_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_status_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_status_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_complete_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_complete_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
} while (false);
|
||||
return isObjectUpdated;
|
||||
}
|
||||
|
||||
bool
|
||||
OAIOrder::isValid() const {
|
||||
bool OAIOrder::isValid() const {
|
||||
// only required properties are required for the object to be considered valid
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // namespace OpenAPI
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
@ -21,13 +20,11 @@
|
||||
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QString>
|
||||
|
||||
#include "OAIObject.h"
|
||||
#include "OAIEnum.h"
|
||||
|
||||
#include "OAIObject.h"
|
||||
|
||||
namespace OpenAPI {
|
||||
|
||||
@ -42,37 +39,29 @@ public:
|
||||
void fromJsonObject(QJsonObject json) override;
|
||||
void fromJson(QString jsonString) override;
|
||||
|
||||
|
||||
qint64 getId() const;
|
||||
void setId(const qint64 &id);
|
||||
|
||||
|
||||
qint64 getPetId() const;
|
||||
void setPetId(const qint64 &pet_id);
|
||||
|
||||
|
||||
qint32 getQuantity() const;
|
||||
void setQuantity(const qint32 &quantity);
|
||||
|
||||
|
||||
QDateTime getShipDate() const;
|
||||
void setShipDate(const QDateTime &ship_date);
|
||||
|
||||
|
||||
QString getStatus() const;
|
||||
void setStatus(const QString &status);
|
||||
|
||||
|
||||
bool isComplete() const;
|
||||
void setComplete(const bool &complete);
|
||||
|
||||
|
||||
|
||||
virtual bool isSet() const override;
|
||||
virtual bool isValid() const override;
|
||||
|
||||
private:
|
||||
void init();
|
||||
void initializeModel();
|
||||
|
||||
qint64 id;
|
||||
bool m_id_isSet;
|
||||
@ -97,10 +86,9 @@ private:
|
||||
bool complete;
|
||||
bool m_complete_isSet;
|
||||
bool m_complete_isValid;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace OpenAPI
|
||||
|
||||
Q_DECLARE_METATYPE(OpenAPI::OAIOrder)
|
||||
|
||||
|
@ -4,39 +4,34 @@
|
||||
*
|
||||
* 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 "OAIPet.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
#include <QObject>
|
||||
|
||||
#include "OAIHelpers.h"
|
||||
|
||||
namespace OpenAPI {
|
||||
|
||||
OAIPet::OAIPet(QString json) {
|
||||
this->init();
|
||||
this->initializeModel();
|
||||
this->fromJson(json);
|
||||
}
|
||||
|
||||
OAIPet::OAIPet() {
|
||||
this->init();
|
||||
this->initializeModel();
|
||||
}
|
||||
|
||||
OAIPet::~OAIPet() {
|
||||
OAIPet::~OAIPet() {}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
OAIPet::init() {
|
||||
void OAIPet::initializeModel() {
|
||||
|
||||
m_id_isSet = false;
|
||||
m_id_isValid = false;
|
||||
@ -57,47 +52,42 @@ OAIPet::init() {
|
||||
m_status_isValid = false;
|
||||
}
|
||||
|
||||
void
|
||||
OAIPet::fromJson(QString jsonString) {
|
||||
void OAIPet::fromJson(QString jsonString) {
|
||||
QByteArray array(jsonString.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
this->fromJsonObject(jsonObject);
|
||||
}
|
||||
|
||||
void
|
||||
OAIPet::fromJsonObject(QJsonObject json) {
|
||||
void OAIPet::fromJsonObject(QJsonObject json) {
|
||||
|
||||
m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]);
|
||||
|
||||
m_id_isSet = !json[QString("id")].isNull() && m_id_isValid;
|
||||
|
||||
m_category_isValid = ::OpenAPI::fromJsonValue(category, json[QString("category")]);
|
||||
|
||||
m_category_isSet = !json[QString("category")].isNull() && m_category_isValid;
|
||||
|
||||
m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]);
|
||||
|
||||
|
||||
m_name_isSet = !json[QString("name")].isNull() && m_name_isValid;
|
||||
|
||||
m_photo_urls_isValid = ::OpenAPI::fromJsonValue(photo_urls, json[QString("photoUrls")]);
|
||||
|
||||
m_photo_urls_isSet = !json[QString("photoUrls")].isNull() && m_photo_urls_isValid;
|
||||
|
||||
m_tags_isValid = ::OpenAPI::fromJsonValue(tags, json[QString("tags")]);
|
||||
m_tags_isSet = !json[QString("tags")].isNull() && m_tags_isValid;
|
||||
|
||||
m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]);
|
||||
|
||||
|
||||
m_status_isSet = !json[QString("status")].isNull() && m_status_isValid;
|
||||
}
|
||||
|
||||
QString
|
||||
OAIPet::asJson () const {
|
||||
QString OAIPet::asJson() const {
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
OAIPet::asJsonObject() const {
|
||||
QJsonObject OAIPet::asJsonObject() const {
|
||||
QJsonObject obj;
|
||||
if (m_id_isSet) {
|
||||
obj.insert(QString("id"), ::OpenAPI::toJsonValue(id));
|
||||
@ -108,11 +98,9 @@ OAIPet::asJsonObject() const {
|
||||
if (m_name_isSet) {
|
||||
obj.insert(QString("name"), ::OpenAPI::toJsonValue(name));
|
||||
}
|
||||
|
||||
if (photo_urls.size() > 0) {
|
||||
obj.insert(QString("photoUrls"), ::OpenAPI::toJsonValue(photo_urls));
|
||||
}
|
||||
|
||||
if (tags.size() > 0) {
|
||||
obj.insert(QString("tags"), ::OpenAPI::toJsonValue(tags));
|
||||
}
|
||||
@ -122,96 +110,93 @@ OAIPet::asJsonObject() const {
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
qint64
|
||||
OAIPet::getId() const {
|
||||
qint64 OAIPet::getId() const {
|
||||
return id;
|
||||
}
|
||||
void
|
||||
OAIPet::setId(const qint64 &id) {
|
||||
void OAIPet::setId(const qint64 &id) {
|
||||
this->id = id;
|
||||
this->m_id_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
OAICategory
|
||||
OAIPet::getCategory() const {
|
||||
OAICategory OAIPet::getCategory() const {
|
||||
return category;
|
||||
}
|
||||
void
|
||||
OAIPet::setCategory(const OAICategory &category) {
|
||||
void OAIPet::setCategory(const OAICategory &category) {
|
||||
this->category = category;
|
||||
this->m_category_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
OAIPet::getName() const {
|
||||
QString OAIPet::getName() const {
|
||||
return name;
|
||||
}
|
||||
void
|
||||
OAIPet::setName(const QString &name) {
|
||||
void OAIPet::setName(const QString &name) {
|
||||
this->name = name;
|
||||
this->m_name_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
QList<QString>
|
||||
OAIPet::getPhotoUrls() const {
|
||||
QList<QString> OAIPet::getPhotoUrls() const {
|
||||
return photo_urls;
|
||||
}
|
||||
void
|
||||
OAIPet::setPhotoUrls(const QList<QString> &photo_urls) {
|
||||
void OAIPet::setPhotoUrls(const QList<QString> &photo_urls) {
|
||||
this->photo_urls = photo_urls;
|
||||
this->m_photo_urls_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
QList<OAITag>
|
||||
OAIPet::getTags() const {
|
||||
QList<OAITag> OAIPet::getTags() const {
|
||||
return tags;
|
||||
}
|
||||
void
|
||||
OAIPet::setTags(const QList<OAITag> &tags) {
|
||||
void OAIPet::setTags(const QList<OAITag> &tags) {
|
||||
this->tags = tags;
|
||||
this->m_tags_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
OAIPet::getStatus() const {
|
||||
QString OAIPet::getStatus() const {
|
||||
return status;
|
||||
}
|
||||
void
|
||||
OAIPet::setStatus(const QString &status) {
|
||||
void OAIPet::setStatus(const QString &status) {
|
||||
this->status = status;
|
||||
this->m_status_isSet = true;
|
||||
}
|
||||
|
||||
bool
|
||||
OAIPet::isSet() const {
|
||||
bool OAIPet::isSet() const {
|
||||
bool isObjectUpdated = false;
|
||||
do {
|
||||
if(m_id_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_id_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(category.isSet()){ isObjectUpdated = true; break;}
|
||||
if (category.isSet()) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_name_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_name_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(photo_urls.size() > 0){ isObjectUpdated = true; break;}
|
||||
if (photo_urls.size() > 0) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(tags.size() > 0){ isObjectUpdated = true; break;}
|
||||
if (tags.size() > 0) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_status_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_status_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
} while (false);
|
||||
return isObjectUpdated;
|
||||
}
|
||||
|
||||
bool
|
||||
OAIPet::isValid() const {
|
||||
bool OAIPet::isValid() const {
|
||||
// only required properties are required for the object to be considered valid
|
||||
return m_name_isValid && m_photo_urls_isValid && true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // namespace OpenAPI
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
@ -21,15 +20,13 @@
|
||||
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include "OAICategory.h"
|
||||
#include "OAITag.h"
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
#include "OAIObject.h"
|
||||
#include "OAIEnum.h"
|
||||
|
||||
#include "OAIObject.h"
|
||||
|
||||
namespace OpenAPI {
|
||||
|
||||
@ -44,37 +41,29 @@ public:
|
||||
void fromJsonObject(QJsonObject json) override;
|
||||
void fromJson(QString jsonString) override;
|
||||
|
||||
|
||||
qint64 getId() const;
|
||||
void setId(const qint64 &id);
|
||||
|
||||
|
||||
OAICategory getCategory() const;
|
||||
void setCategory(const OAICategory &category);
|
||||
|
||||
|
||||
QString getName() const;
|
||||
void setName(const QString &name);
|
||||
|
||||
|
||||
QList<QString> getPhotoUrls() const;
|
||||
void setPhotoUrls(const QList<QString> &photo_urls);
|
||||
|
||||
|
||||
QList<OAITag> getTags() const;
|
||||
void setTags(const QList<OAITag> &tags);
|
||||
|
||||
|
||||
QString getStatus() const;
|
||||
void setStatus(const QString &status);
|
||||
|
||||
|
||||
|
||||
virtual bool isSet() const override;
|
||||
virtual bool isValid() const override;
|
||||
|
||||
private:
|
||||
void init();
|
||||
void initializeModel();
|
||||
|
||||
qint64 id;
|
||||
bool m_id_isSet;
|
||||
@ -99,10 +88,9 @@ private:
|
||||
QString status;
|
||||
bool m_status_isSet;
|
||||
bool m_status_isValid;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace OpenAPI
|
||||
|
||||
Q_DECLARE_METATYPE(OpenAPI::OAIPet)
|
||||
|
||||
|
@ -4,39 +4,34 @@
|
||||
*
|
||||
* 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 "OAITag.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
#include <QObject>
|
||||
|
||||
#include "OAIHelpers.h"
|
||||
|
||||
namespace OpenAPI {
|
||||
|
||||
OAITag::OAITag(QString json) {
|
||||
this->init();
|
||||
this->initializeModel();
|
||||
this->fromJson(json);
|
||||
}
|
||||
|
||||
OAITag::OAITag() {
|
||||
this->init();
|
||||
this->initializeModel();
|
||||
}
|
||||
|
||||
OAITag::~OAITag() {
|
||||
OAITag::~OAITag() {}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
OAITag::init() {
|
||||
void OAITag::initializeModel() {
|
||||
|
||||
m_id_isSet = false;
|
||||
m_id_isValid = false;
|
||||
@ -45,35 +40,30 @@ OAITag::init() {
|
||||
m_name_isValid = false;
|
||||
}
|
||||
|
||||
void
|
||||
OAITag::fromJson(QString jsonString) {
|
||||
void OAITag::fromJson(QString jsonString) {
|
||||
QByteArray array(jsonString.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
this->fromJsonObject(jsonObject);
|
||||
}
|
||||
|
||||
void
|
||||
OAITag::fromJsonObject(QJsonObject json) {
|
||||
void OAITag::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
|
||||
OAITag::asJson () const {
|
||||
QString OAITag::asJson() const {
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
OAITag::asJsonObject() const {
|
||||
QJsonObject OAITag::asJsonObject() const {
|
||||
QJsonObject obj;
|
||||
if (m_id_isSet) {
|
||||
obj.insert(QString("id"), ::OpenAPI::toJsonValue(id));
|
||||
@ -84,44 +74,41 @@ OAITag::asJsonObject() const {
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
qint64
|
||||
OAITag::getId() const {
|
||||
qint64 OAITag::getId() const {
|
||||
return id;
|
||||
}
|
||||
void
|
||||
OAITag::setId(const qint64 &id) {
|
||||
void OAITag::setId(const qint64 &id) {
|
||||
this->id = id;
|
||||
this->m_id_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
OAITag::getName() const {
|
||||
QString OAITag::getName() const {
|
||||
return name;
|
||||
}
|
||||
void
|
||||
OAITag::setName(const QString &name) {
|
||||
void OAITag::setName(const QString &name) {
|
||||
this->name = name;
|
||||
this->m_name_isSet = true;
|
||||
}
|
||||
|
||||
bool
|
||||
OAITag::isSet() const {
|
||||
bool OAITag::isSet() const {
|
||||
bool isObjectUpdated = false;
|
||||
do {
|
||||
if(m_id_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_id_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_name_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_name_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
} while (false);
|
||||
return isObjectUpdated;
|
||||
}
|
||||
|
||||
bool
|
||||
OAITag::isValid() const {
|
||||
bool OAITag::isValid() const {
|
||||
// only required properties are required for the object to be considered valid
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // namespace OpenAPI
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
@ -21,12 +20,10 @@
|
||||
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include "OAIObject.h"
|
||||
#include "OAIEnum.h"
|
||||
|
||||
#include "OAIObject.h"
|
||||
|
||||
namespace OpenAPI {
|
||||
|
||||
@ -41,21 +38,17 @@ public:
|
||||
void fromJsonObject(QJsonObject json) override;
|
||||
void fromJson(QString jsonString) override;
|
||||
|
||||
|
||||
qint64 getId() const;
|
||||
void setId(const qint64 &id);
|
||||
|
||||
|
||||
QString getName() const;
|
||||
void setName(const QString &name);
|
||||
|
||||
|
||||
|
||||
virtual bool isSet() const override;
|
||||
virtual bool isValid() const override;
|
||||
|
||||
private:
|
||||
void init();
|
||||
void initializeModel();
|
||||
|
||||
qint64 id;
|
||||
bool m_id_isSet;
|
||||
@ -64,10 +57,9 @@ private:
|
||||
QString name;
|
||||
bool m_name_isSet;
|
||||
bool m_name_isValid;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace OpenAPI
|
||||
|
||||
Q_DECLARE_METATYPE(OpenAPI::OAITag)
|
||||
|
||||
|
@ -4,39 +4,34 @@
|
||||
*
|
||||
* 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 "OAIUser.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
#include <QObject>
|
||||
|
||||
#include "OAIHelpers.h"
|
||||
|
||||
namespace OpenAPI {
|
||||
|
||||
OAIUser::OAIUser(QString json) {
|
||||
this->init();
|
||||
this->initializeModel();
|
||||
this->fromJson(json);
|
||||
}
|
||||
|
||||
OAIUser::OAIUser() {
|
||||
this->init();
|
||||
this->initializeModel();
|
||||
}
|
||||
|
||||
OAIUser::~OAIUser() {
|
||||
OAIUser::~OAIUser() {}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
OAIUser::init() {
|
||||
void OAIUser::initializeModel() {
|
||||
|
||||
m_id_isSet = false;
|
||||
m_id_isValid = false;
|
||||
@ -63,53 +58,48 @@ OAIUser::init() {
|
||||
m_user_status_isValid = false;
|
||||
}
|
||||
|
||||
void
|
||||
OAIUser::fromJson(QString jsonString) {
|
||||
void OAIUser::fromJson(QString jsonString) {
|
||||
QByteArray array(jsonString.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
this->fromJsonObject(jsonObject);
|
||||
}
|
||||
|
||||
void
|
||||
OAIUser::fromJsonObject(QJsonObject json) {
|
||||
void OAIUser::fromJsonObject(QJsonObject json) {
|
||||
|
||||
m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]);
|
||||
|
||||
m_id_isSet = !json[QString("id")].isNull() && m_id_isValid;
|
||||
|
||||
m_username_isValid = ::OpenAPI::fromJsonValue(username, json[QString("username")]);
|
||||
|
||||
m_username_isSet = !json[QString("username")].isNull() && m_username_isValid;
|
||||
|
||||
m_first_name_isValid = ::OpenAPI::fromJsonValue(first_name, json[QString("firstName")]);
|
||||
|
||||
m_first_name_isSet = !json[QString("firstName")].isNull() && m_first_name_isValid;
|
||||
|
||||
m_last_name_isValid = ::OpenAPI::fromJsonValue(last_name, json[QString("lastName")]);
|
||||
|
||||
m_last_name_isSet = !json[QString("lastName")].isNull() && m_last_name_isValid;
|
||||
|
||||
m_email_isValid = ::OpenAPI::fromJsonValue(email, json[QString("email")]);
|
||||
|
||||
m_email_isSet = !json[QString("email")].isNull() && m_email_isValid;
|
||||
|
||||
m_password_isValid = ::OpenAPI::fromJsonValue(password, json[QString("password")]);
|
||||
|
||||
m_password_isSet = !json[QString("password")].isNull() && m_password_isValid;
|
||||
|
||||
m_phone_isValid = ::OpenAPI::fromJsonValue(phone, json[QString("phone")]);
|
||||
|
||||
m_phone_isSet = !json[QString("phone")].isNull() && m_phone_isValid;
|
||||
|
||||
m_user_status_isValid = ::OpenAPI::fromJsonValue(user_status, json[QString("userStatus")]);
|
||||
|
||||
|
||||
m_user_status_isSet = !json[QString("userStatus")].isNull() && m_user_status_isValid;
|
||||
}
|
||||
|
||||
QString
|
||||
OAIUser::asJson () const {
|
||||
QString OAIUser::asJson() const {
|
||||
QJsonObject obj = this->asJsonObject();
|
||||
QJsonDocument doc(obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject
|
||||
OAIUser::asJsonObject() const {
|
||||
QJsonObject OAIUser::asJsonObject() const {
|
||||
QJsonObject obj;
|
||||
if (m_id_isSet) {
|
||||
obj.insert(QString("id"), ::OpenAPI::toJsonValue(id));
|
||||
@ -138,122 +128,119 @@ OAIUser::asJsonObject() const {
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
qint64
|
||||
OAIUser::getId() const {
|
||||
qint64 OAIUser::getId() const {
|
||||
return id;
|
||||
}
|
||||
void
|
||||
OAIUser::setId(const qint64 &id) {
|
||||
void OAIUser::setId(const qint64 &id) {
|
||||
this->id = id;
|
||||
this->m_id_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
OAIUser::getUsername() const {
|
||||
QString OAIUser::getUsername() const {
|
||||
return username;
|
||||
}
|
||||
void
|
||||
OAIUser::setUsername(const QString &username) {
|
||||
void OAIUser::setUsername(const QString &username) {
|
||||
this->username = username;
|
||||
this->m_username_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
OAIUser::getFirstName() const {
|
||||
QString OAIUser::getFirstName() const {
|
||||
return first_name;
|
||||
}
|
||||
void
|
||||
OAIUser::setFirstName(const QString &first_name) {
|
||||
void OAIUser::setFirstName(const QString &first_name) {
|
||||
this->first_name = first_name;
|
||||
this->m_first_name_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
OAIUser::getLastName() const {
|
||||
QString OAIUser::getLastName() const {
|
||||
return last_name;
|
||||
}
|
||||
void
|
||||
OAIUser::setLastName(const QString &last_name) {
|
||||
void OAIUser::setLastName(const QString &last_name) {
|
||||
this->last_name = last_name;
|
||||
this->m_last_name_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
OAIUser::getEmail() const {
|
||||
QString OAIUser::getEmail() const {
|
||||
return email;
|
||||
}
|
||||
void
|
||||
OAIUser::setEmail(const QString &email) {
|
||||
void OAIUser::setEmail(const QString &email) {
|
||||
this->email = email;
|
||||
this->m_email_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
OAIUser::getPassword() const {
|
||||
QString OAIUser::getPassword() const {
|
||||
return password;
|
||||
}
|
||||
void
|
||||
OAIUser::setPassword(const QString &password) {
|
||||
void OAIUser::setPassword(const QString &password) {
|
||||
this->password = password;
|
||||
this->m_password_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
OAIUser::getPhone() const {
|
||||
QString OAIUser::getPhone() const {
|
||||
return phone;
|
||||
}
|
||||
void
|
||||
OAIUser::setPhone(const QString &phone) {
|
||||
void OAIUser::setPhone(const QString &phone) {
|
||||
this->phone = phone;
|
||||
this->m_phone_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
qint32
|
||||
OAIUser::getUserStatus() const {
|
||||
qint32 OAIUser::getUserStatus() const {
|
||||
return user_status;
|
||||
}
|
||||
void
|
||||
OAIUser::setUserStatus(const qint32 &user_status) {
|
||||
void OAIUser::setUserStatus(const qint32 &user_status) {
|
||||
this->user_status = user_status;
|
||||
this->m_user_status_isSet = true;
|
||||
}
|
||||
|
||||
bool
|
||||
OAIUser::isSet() const {
|
||||
bool OAIUser::isSet() const {
|
||||
bool isObjectUpdated = false;
|
||||
do {
|
||||
if(m_id_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_id_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_username_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_username_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_first_name_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_first_name_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_last_name_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_last_name_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_email_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_email_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_password_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_password_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_phone_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_phone_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_user_status_isSet){ isObjectUpdated = true; break;}
|
||||
if (m_user_status_isSet) {
|
||||
isObjectUpdated = true;
|
||||
break;
|
||||
}
|
||||
} while (false);
|
||||
return isObjectUpdated;
|
||||
}
|
||||
|
||||
bool
|
||||
OAIUser::isValid() const {
|
||||
bool OAIUser::isValid() const {
|
||||
// only required properties are required for the object to be considered valid
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // namespace OpenAPI
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
@ -21,12 +20,10 @@
|
||||
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include "OAIObject.h"
|
||||
#include "OAIEnum.h"
|
||||
|
||||
#include "OAIObject.h"
|
||||
|
||||
namespace OpenAPI {
|
||||
|
||||
@ -41,45 +38,35 @@ public:
|
||||
void fromJsonObject(QJsonObject json) override;
|
||||
void fromJson(QString jsonString) override;
|
||||
|
||||
|
||||
qint64 getId() const;
|
||||
void setId(const qint64 &id);
|
||||
|
||||
|
||||
QString getUsername() const;
|
||||
void setUsername(const QString &username);
|
||||
|
||||
|
||||
QString getFirstName() const;
|
||||
void setFirstName(const QString &first_name);
|
||||
|
||||
|
||||
QString getLastName() const;
|
||||
void setLastName(const QString &last_name);
|
||||
|
||||
|
||||
QString getEmail() const;
|
||||
void setEmail(const QString &email);
|
||||
|
||||
|
||||
QString getPassword() const;
|
||||
void setPassword(const QString &password);
|
||||
|
||||
|
||||
QString getPhone() const;
|
||||
void setPhone(const QString &phone);
|
||||
|
||||
|
||||
qint32 getUserStatus() const;
|
||||
void setUserStatus(const qint32 &user_status);
|
||||
|
||||
|
||||
|
||||
virtual bool isSet() const override;
|
||||
virtual bool isValid() const override;
|
||||
|
||||
private:
|
||||
void init();
|
||||
void initializeModel();
|
||||
|
||||
qint64 id;
|
||||
bool m_id_isSet;
|
||||
@ -112,10 +99,9 @@ private:
|
||||
qint32 user_status;
|
||||
bool m_user_status_isSet;
|
||||
bool m_user_status_isValid;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace OpenAPI
|
||||
|
||||
Q_DECLARE_METATYPE(OpenAPI::OAIUser)
|
||||
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user