Port client updates to server (#5634)

This commit is contained in:
sunn 2020-03-19 16:34:59 +01:00 committed by GitHub
parent b1efe20a04
commit 8af3d6d9bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
46 changed files with 1111 additions and 1372 deletions

View File

@ -1,6 +1,7 @@
{{>licenseInfo}} {{>licenseInfo}}
#include "{{prefix}}Helpers.h"
#include <QDebug> #include <QDebug>
#include <QJsonParseError>
#include "{{prefix}}Helpers.h"
{{#cppNamespaceDeclarations}} {{#cppNamespaceDeclarations}}
namespace {{this}} { namespace {{this}} {
@ -178,6 +179,17 @@ bool fromStringValue(const QString &inStr, double &value) {
return ok; 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) { bool fromStringValue(const QString &inStr, {{prefix}}Enum &value) {
value.fromJson(inStr); value.fromJson(inStr);
return true; return true;

View File

@ -1,5 +1,4 @@
{{>licenseInfo}} {{>licenseInfo}}
#include <QDebug> #include <QDebug>
#include <QFile> #include <QFile>
#include <QJsonDocument> #include <QJsonDocument>
@ -11,129 +10,117 @@
namespace {{this}} { namespace {{this}} {
{{/cppNamespaceDeclarations}} {{/cppNamespaceDeclarations}}
void void {{prefix}}HttpFileElement::setMimeType(const QString &mime) {
{{prefix}}HttpFileElement::setMimeType(const QString &mime){
mime_type = mime; mime_type = mime;
} }
void void {{prefix}}HttpFileElement::setFileName(const QString &name) {
{{prefix}}HttpFileElement::setFileName(const QString &name){
local_filename = name; local_filename = name;
} }
void void {{prefix}}HttpFileElement::setVariableName(const QString &name) {
{{prefix}}HttpFileElement::setVariableName(const QString &name){
variable_name = name; variable_name = name;
} }
void void {{prefix}}HttpFileElement::setRequestFileName(const QString &name) {
{{prefix}}HttpFileElement::setRequestFileName(const QString &name){
request_filename = name; request_filename = name;
} }
bool bool {{prefix}}HttpFileElement::isSet() const {
{{prefix}}HttpFileElement::isSet() const {
return !local_filename.isEmpty() || !request_filename.isEmpty(); return !local_filename.isEmpty() || !request_filename.isEmpty();
} }
QString QString {{prefix}}HttpFileElement::asJson() const {
{{prefix}}HttpFileElement::asJson() const{
QFile file(local_filename); QFile file(local_filename);
QByteArray bArray; QByteArray bArray;
bool result = false; bool result = false;
if(file.exists()) { if (file.exists()) {
result = file.open(QIODevice::ReadOnly); result = file.open(QIODevice::ReadOnly);
bArray = file.readAll(); bArray = file.readAll();
file.close(); file.close();
} }
if(!result) { if (!result) {
qDebug() << "Error opening file " << local_filename; qDebug() << "Error opening file " << local_filename;
} }
return QString(bArray); return QString(bArray);
} }
QJsonValue QJsonValue {{prefix}}HttpFileElement::asJsonValue() const {
{{prefix}}HttpFileElement::asJsonValue() const{
QFile file(local_filename); QFile file(local_filename);
QByteArray bArray; QByteArray bArray;
bool result = false; bool result = false;
if(file.exists()) { if (file.exists()) {
result = file.open(QIODevice::ReadOnly); result = file.open(QIODevice::ReadOnly);
bArray = file.readAll(); bArray = file.readAll();
file.close(); file.close();
} }
if(!result) { if (!result) {
qDebug() << "Error opening file " << local_filename; qDebug() << "Error opening file " << local_filename;
} }
return QJsonDocument::fromBinaryData(bArray.data()).object(); return QJsonDocument::fromBinaryData(bArray.data()).object();
} }
bool bool {{prefix}}HttpFileElement::fromStringValue(const QString &instr) {
{{prefix}}HttpFileElement::fromStringValue(const QString &instr){
QFile file(local_filename); QFile file(local_filename);
bool result = false; bool result = false;
if(file.exists()) { if (file.exists()) {
file.remove(); file.remove();
} }
result = file.open(QIODevice::WriteOnly); result = file.open(QIODevice::WriteOnly);
file.write(instr.toUtf8()); file.write(instr.toUtf8());
file.close(); file.close();
if(!result) { if (!result) {
qDebug() << "Error creating file " << local_filename; qDebug() << "Error creating file " << local_filename;
} }
return result; return result;
} }
bool bool {{prefix}}HttpFileElement::fromJsonValue(const QJsonValue &jval) {
{{prefix}}HttpFileElement::fromJsonValue(const QJsonValue &jval) {
QFile file(local_filename); QFile file(local_filename);
bool result = false; bool result = false;
if(file.exists()) { if (file.exists()) {
file.remove(); file.remove();
} }
result = file.open(QIODevice::WriteOnly); result = file.open(QIODevice::WriteOnly);
file.write(QJsonDocument(jval.toObject()).toBinaryData()); file.write(QJsonDocument(jval.toObject()).toBinaryData());
file.close(); file.close();
if(!result) { if (!result) {
qDebug() << "Error creating file " << local_filename; qDebug() << "Error creating file " << local_filename;
} }
return result; return result;
} }
QByteArray QByteArray {{prefix}}HttpFileElement::asByteArray() const {
{{prefix}}HttpFileElement::asByteArray() const {
QFile file(local_filename); QFile file(local_filename);
QByteArray bArray; QByteArray bArray;
bool result = false; bool result = false;
if(file.exists()) { if (file.exists()) {
result = file.open(QIODevice::ReadOnly); result = file.open(QIODevice::ReadOnly);
bArray = file.readAll(); bArray = file.readAll();
file.close(); file.close();
} }
if(!result) { if (!result) {
qDebug() << "Error opening file " << local_filename; qDebug() << "Error opening file " << local_filename;
} }
return bArray; return bArray;
} }
bool bool {{prefix}}HttpFileElement::fromByteArray(const QByteArray &bytes) {
{{prefix}}HttpFileElement::fromByteArray(const QByteArray& bytes){
QFile file(local_filename); QFile file(local_filename);
bool result = false; bool result = false;
if(file.exists()){ if (file.exists()) {
file.remove(); file.remove();
} }
result = file.open(QIODevice::WriteOnly); result = file.open(QIODevice::WriteOnly);
file.write(bytes); file.write(bytes);
file.close(); file.close();
if(!result) { if (!result) {
qDebug() << "Error creating file " << local_filename; qDebug() << "Error creating file " << local_filename;
} }
return result; return result;
} }
bool bool {{prefix}}HttpFileElement::saveToFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime, const QByteArray &bytes) {
{{prefix}}HttpFileElement::saveToFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime, const QByteArray& bytes){
setMimeType(mime); setMimeType(mime);
setFileName(localFName); setFileName(localFName);
setVariableName(varName); setVariableName(varName);
@ -141,8 +128,7 @@ bool
return fromByteArray(bytes); return fromByteArray(bytes);
} }
QByteArray QByteArray {{prefix}}HttpFileElement::loadFromFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime) {
{{prefix}}HttpFileElement::loadFromFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime){
setMimeType(mime); setMimeType(mime);
setFileName(localFName); setFileName(localFName);
setVariableName(varName); setVariableName(varName);
@ -151,5 +137,5 @@ QByteArray
} }
{{#cppNamespaceDeclarations}} {{#cppNamespaceDeclarations}}
} } // namespace {{this}}
{{/cppNamespaceDeclarations}} {{/cppNamespaceDeclarations}}

View File

@ -6,7 +6,6 @@
#include <QMetaType> #include <QMetaType>
#include <QString> #include <QString>
{{#cppNamespaceDeclarations}} {{#cppNamespaceDeclarations}}
namespace {{this}} { namespace {{this}} {
{{/cppNamespaceDeclarations}} {{/cppNamespaceDeclarations}}
@ -25,8 +24,8 @@ public:
bool isSet() const; bool isSet() const;
bool fromStringValue(const QString &instr); bool fromStringValue(const QString &instr);
bool fromJsonValue(const QJsonValue &jval); bool fromJsonValue(const QJsonValue &jval);
bool fromByteArray(const QByteArray& bytes); bool fromByteArray(const QByteArray &bytes);
bool saveToFile(const QString &variable_name, const QString &local_filename, const QString &request_filename, const QString &mime, const QByteArray& bytes); bool saveToFile(const QString &variable_name, const QString &local_filename, const QString &request_filename, const QString &mime, const QByteArray &bytes);
QString asJson() const; QString asJson() const;
QJsonValue asJsonValue() const; QJsonValue asJsonValue() const;
QByteArray asByteArray() const; QByteArray asByteArray() const;
@ -34,7 +33,7 @@ public:
}; };
{{#cppNamespaceDeclarations}} {{#cppNamespaceDeclarations}}
} } // namespace {{this}}
{{/cppNamespaceDeclarations}} {{/cppNamespaceDeclarations}}
Q_DECLARE_METATYPE({{#cppNamespaceDeclarations}}{{this}}::{{/cppNamespaceDeclarations}}{{prefix}}HttpFileElement) Q_DECLARE_METATYPE({{#cppNamespaceDeclarations}}{{this}}::{{/cppNamespaceDeclarations}}{{prefix}}HttpFileElement)

View File

@ -2,27 +2,23 @@
#ifndef {{prefix}}_ENUM_H #ifndef {{prefix}}_ENUM_H
#define {{prefix}}_ENUM_H #define {{prefix}}_ENUM_H
#include <QString>
#include <QJsonValue> #include <QJsonValue>
#include <QMetaType> #include <QMetaType>
#include <QString>
{{#cppNamespaceDeclarations}} {{#cppNamespaceDeclarations}}
namespace {{this}} { namespace {{this}} {
{{/cppNamespaceDeclarations}} {{/cppNamespaceDeclarations}}
class {{prefix}}Enum { class {{prefix}}Enum {
public: public:
{{prefix}}Enum() { {{prefix}}Enum() {}
}
{{prefix}}Enum(QString jsonString) { {{prefix}}Enum(QString jsonString) {
fromJson(jsonString); fromJson(jsonString);
} }
virtual ~{{prefix}}Enum(){ virtual ~{{prefix}}Enum() {}
}
virtual QJsonValue asJsonValue() const { virtual QJsonValue asJsonValue() const {
return QJsonValue(jstr); return QJsonValue(jstr);
@ -47,12 +43,13 @@ class {{prefix}}Enum {
virtual bool isValid() const { virtual bool isValid() const {
return true; return true;
} }
private :
private:
QString jstr; QString jstr;
}; };
{{#cppNamespaceDeclarations}} {{#cppNamespaceDeclarations}}
} } // namespace {{this}}
{{/cppNamespaceDeclarations}} {{/cppNamespaceDeclarations}}
Q_DECLARE_METATYPE({{#cppNamespaceDeclarations}}{{this}}::{{/cppNamespaceDeclarations}}{{prefix}}Enum) Q_DECLARE_METATYPE({{#cppNamespaceDeclarations}}{{this}}::{{/cppNamespaceDeclarations}}{{prefix}}Enum)

View File

@ -3,227 +3,183 @@
#include <QJsonParseError> #include <QJsonParseError>
#include "{{prefix}}Helpers.h" #include "{{prefix}}Helpers.h"
{{#cppNamespaceDeclarations}} {{#cppNamespaceDeclarations}}
namespace {{this}} { namespace {{this}} {
{{/cppNamespaceDeclarations}} {{/cppNamespaceDeclarations}}
QString toStringValue(const QString &value) {
QString
toStringValue(const QString &value) {
return value; return value;
} }
QString QString toStringValue(const QDateTime &value) {
toStringValue(const QDateTime &value){
// ISO 8601 // ISO 8601
return value.toString("yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm]"); return value.toString("yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm]");
} }
QString QString toStringValue(const QByteArray &value) {
toStringValue(const QByteArray &value){
return QString(value); return QString(value);
} }
QString QString toStringValue(const QDate &value) {
toStringValue(const QDate &value){
// ISO 8601 // ISO 8601
return value.toString(Qt::DateFormat::ISODate); return value.toString(Qt::DateFormat::ISODate);
} }
QString QString toStringValue(const qint32 &value) {
toStringValue(const qint32 &value) {
return QString::number(value); return QString::number(value);
} }
QString QString toStringValue(const qint64 &value) {
toStringValue(const qint64 &value) {
return QString::number(value); return QString::number(value);
} }
QString QString toStringValue(const bool &value) {
toStringValue(const bool &value) {
return QString(value ? "true" : "false"); return QString(value ? "true" : "false");
} }
QString QString toStringValue(const float &value) {
toStringValue(const float &value){
return QString::number(static_cast<double>(value)); return QString::number(static_cast<double>(value));
} }
QString QString toStringValue(const double &value) {
toStringValue(const double &value){
return QString::number(value); return QString::number(value);
} }
QString QString toStringValue(const {{prefix}}Object &value) {
toStringValue(const {{prefix}}Object &value){
return value.asJson(); return value.asJson();
} }
QString toStringValue(const {{prefix}}Enum &value) {
QString
toStringValue(const {{prefix}}Enum &value){
return value.asJson(); return value.asJson();
} }
QString QString toStringValue(const {{prefix}}HttpFileElement &value) {
toStringValue(const {{prefix}}HttpFileElement &value){
return value.asJson(); return value.asJson();
} }
QJsonValue toJsonValue(const QString &value) {
QJsonValue return QJsonValue(value);
toJsonValue(const QString &value){
return QJsonValue(value);
} }
QJsonValue QJsonValue toJsonValue(const QDateTime &value) {
toJsonValue(const QDateTime &value){
return QJsonValue(value.toString(Qt::ISODate)); return QJsonValue(value.toString(Qt::ISODate));
} }
QJsonValue QJsonValue toJsonValue(const QByteArray &value) {
toJsonValue(const QByteArray &value){
return QJsonValue(QString(value.toBase64())); return QJsonValue(QString(value.toBase64()));
} }
QJsonValue QJsonValue toJsonValue(const QDate &value) {
toJsonValue(const QDate &value){
return QJsonValue(value.toString(Qt::ISODate)); return QJsonValue(value.toString(Qt::ISODate));
} }
QJsonValue QJsonValue toJsonValue(const qint32 &value) {
toJsonValue(const qint32 &value){
return QJsonValue(value); return QJsonValue(value);
} }
QJsonValue QJsonValue toJsonValue(const qint64 &value) {
toJsonValue(const qint64 &value){
return QJsonValue(value); return QJsonValue(value);
} }
QJsonValue QJsonValue toJsonValue(const bool &value) {
toJsonValue(const bool &value){
return QJsonValue(value); return QJsonValue(value);
} }
QJsonValue QJsonValue toJsonValue(const float &value) {
toJsonValue(const float &value){
return QJsonValue(static_cast<double>(value)); return QJsonValue(static_cast<double>(value));
} }
QJsonValue QJsonValue toJsonValue(const double &value) {
toJsonValue(const double &value){
return QJsonValue(value); return QJsonValue(value);
} }
QJsonValue QJsonValue toJsonValue(const {{prefix}}Object &value) {
toJsonValue(const {{prefix}}Object &value){
return value.asJsonObject(); return value.asJsonObject();
} }
QJsonValue QJsonValue toJsonValue(const {{prefix}}Enum &value) {
toJsonValue(const {{prefix}}Enum &value){
return value.asJsonValue(); return value.asJsonValue();
} }
QJsonValue QJsonValue toJsonValue(const {{prefix}}HttpFileElement &value) {
toJsonValue(const {{prefix}}HttpFileElement &value){
return value.asJsonValue(); return value.asJsonValue();
} }
bool fromStringValue(const QString &inStr, QString &value) {
bool
fromStringValue(const QString &inStr, QString &value){
value.clear(); value.clear();
value.append(inStr); value.append(inStr);
return !inStr.isEmpty(); return !inStr.isEmpty();
} }
bool bool fromStringValue(const QString &inStr, QDateTime &value) {
fromStringValue(const QString &inStr, QDateTime &value){ if (inStr.isEmpty()) {
if(inStr.isEmpty()){
return false; return false;
} } else {
else{
auto dateTime = QDateTime::fromString(inStr, "yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm]"); auto dateTime = QDateTime::fromString(inStr, "yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm]");
if(dateTime.isValid()){ if (dateTime.isValid()) {
value.setDate(dateTime.date()); value.setDate(dateTime.date());
value.setTime(dateTime.time()); value.setTime(dateTime.time());
} } else {
else{
qDebug() << "DateTime is invalid"; qDebug() << "DateTime is invalid";
} }
return dateTime.isValid(); return dateTime.isValid();
} }
} }
bool bool fromStringValue(const QString &inStr, QByteArray &value) {
fromStringValue(const QString &inStr, QByteArray &value){ if (inStr.isEmpty()) {
if(inStr.isEmpty()){
return false; return false;
} } else {
else{
value.clear(); value.clear();
value.append(inStr.toUtf8()); value.append(inStr.toUtf8());
return value.count() > 0; return value.count() > 0;
} }
} }
bool bool fromStringValue(const QString &inStr, QDate &value) {
fromStringValue(const QString &inStr, QDate &value){ if (inStr.isEmpty()) {
if(inStr.isEmpty()){
return false; return false;
} } else {
else{
auto date = QDate::fromString(inStr, Qt::DateFormat::ISODate); auto date = QDate::fromString(inStr, Qt::DateFormat::ISODate);
if(date.isValid()){ if (date.isValid()) {
value.setDate(date.year(), date.month(), date.day()); value.setDate(date.year(), date.month(), date.day());
} } else {
else{
qDebug() << "Date is invalid"; qDebug() << "Date is invalid";
} }
return date.isValid(); return date.isValid();
} }
} }
bool bool fromStringValue(const QString &inStr, qint32 &value) {
fromStringValue(const QString &inStr, qint32 &value){
bool ok = false; bool ok = false;
value = QVariant(inStr).toInt(&ok); value = QVariant(inStr).toInt(&ok);
return ok; return ok;
} }
bool bool fromStringValue(const QString &inStr, qint64 &value) {
fromStringValue(const QString &inStr, qint64 &value){
bool ok = false; bool ok = false;
value = QVariant(inStr).toLongLong(&ok); value = QVariant(inStr).toLongLong(&ok);
return ok; return ok;
} }
bool bool fromStringValue(const QString &inStr, bool &value) {
fromStringValue(const QString &inStr, bool &value){
value = QVariant(inStr).toBool(); value = QVariant(inStr).toBool();
return ((inStr == "true") || (inStr == "false")); return ((inStr == "true") || (inStr == "false"));
} }
bool bool fromStringValue(const QString &inStr, float &value) {
fromStringValue(const QString &inStr, float &value){
bool ok = false; bool ok = false;
value = QVariant(inStr).toFloat(&ok); value = QVariant(inStr).toFloat(&ok);
return ok; return ok;
} }
bool bool fromStringValue(const QString &inStr, double &value) {
fromStringValue(const QString &inStr, double &value){
bool ok = false; bool ok = false;
value = QVariant(inStr).toDouble(&ok); value = QVariant(inStr).toDouble(&ok);
return ok; return ok;
} }
bool bool fromStringValue(const QString &inStr, {{prefix}}Object &value)
fromStringValue(const QString &inStr, {{prefix}}Object &value)
{ {
QJsonParseError err; QJsonParseError err;
QJsonDocument::fromJson(inStr.toUtf8(),&err); QJsonDocument::fromJson(inStr.toUtf8(),&err);
@ -234,26 +190,23 @@ fromStringValue(const QString &inStr, {{prefix}}Object &value)
return false; return false;
} }
bool bool fromStringValue(const QString &inStr, {{prefix}}Enum &value) {
fromStringValue(const QString &inStr, {{prefix}}Enum &value){
value.fromJson(inStr); value.fromJson(inStr);
return true; return true;
} }
bool bool fromStringValue(const QString &inStr, {{prefix}}HttpFileElement &value) {
fromStringValue(const QString &inStr, {{prefix}}HttpFileElement &value){
return value.fromStringValue(inStr); return value.fromStringValue(inStr);
} }
bool bool fromJsonValue(QString &value, const QJsonValue &jval) {
fromJsonValue(QString &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(!jval.isUndefined() && !jval.isNull()){ if (!jval.isUndefined() && !jval.isNull()) {
if(jval.isString()){ if (jval.isString()) {
value = jval.toString(); value = jval.toString();
} else if(jval.isBool()) { } else if (jval.isBool()) {
value = jval.toBool() ? "true" : "false"; value = jval.toBool() ? "true" : "false";
} else if(jval.isDouble()){ } else if (jval.isDouble()) {
value = QString::number(jval.toDouble()); value = QString::number(jval.toDouble());
} else { } else {
ok = false; ok = false;
@ -264,10 +217,9 @@ fromJsonValue(QString &value, const QJsonValue &jval){
return ok; return ok;
} }
bool bool fromJsonValue(QDateTime &value, const QJsonValue &jval) {
fromJsonValue(QDateTime &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(!jval.isUndefined() && !jval.isNull() && jval.isString()){ if (!jval.isUndefined() && !jval.isNull() && jval.isString()) {
value = QDateTime::fromString(jval.toString(), Qt::ISODate); value = QDateTime::fromString(jval.toString(), Qt::ISODate);
ok = value.isValid(); ok = value.isValid();
} else { } else {
@ -276,22 +228,20 @@ fromJsonValue(QDateTime &value, const QJsonValue &jval){
return ok; return ok;
} }
bool bool fromJsonValue(QByteArray &value, const QJsonValue &jval) {
fromJsonValue(QByteArray &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(!jval.isUndefined() && !jval.isNull() && jval.isString()) { if (!jval.isUndefined() && !jval.isNull() && jval.isString()) {
value = QByteArray::fromBase64(QByteArray::fromStdString(jval.toString().toStdString())); value = QByteArray::fromBase64(QByteArray::fromStdString(jval.toString().toStdString()));
ok = value.size() > 0 ; ok = value.size() > 0;
} else { } else {
ok = false; ok = false;
} }
return ok; return ok;
} }
bool bool fromJsonValue(QDate &value, const QJsonValue &jval) {
fromJsonValue(QDate &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(!jval.isUndefined() && !jval.isNull() && jval.isString()){ if (!jval.isUndefined() && !jval.isNull() && jval.isString()) {
value = QDate::fromString(jval.toString(), Qt::ISODate); value = QDate::fromString(jval.toString(), Qt::ISODate);
ok = value.isValid(); ok = value.isValid();
} else { } else {
@ -300,10 +250,9 @@ fromJsonValue(QDate &value, const QJsonValue &jval){
return ok; return ok;
} }
bool bool fromJsonValue(qint32 &value, const QJsonValue &jval) {
fromJsonValue(qint32 &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()){ if (!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()) {
value = jval.toInt(); value = jval.toInt();
} else { } else {
ok = false; ok = false;
@ -311,10 +260,9 @@ fromJsonValue(qint32 &value, const QJsonValue &jval){
return ok; return ok;
} }
bool bool fromJsonValue(qint64 &value, const QJsonValue &jval) {
fromJsonValue(qint64 &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()){ if (!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()) {
value = jval.toVariant().toLongLong(); value = jval.toVariant().toLongLong();
} else { } else {
ok = false; ok = false;
@ -322,10 +270,9 @@ fromJsonValue(qint64 &value, const QJsonValue &jval){
return ok; return ok;
} }
bool bool fromJsonValue(bool &value, const QJsonValue &jval) {
fromJsonValue(bool &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(jval.isBool()){ if (jval.isBool()) {
value = jval.toBool(); value = jval.toBool();
} else { } else {
ok = false; ok = false;
@ -333,10 +280,9 @@ fromJsonValue(bool &value, const QJsonValue &jval){
return ok; return ok;
} }
bool bool fromJsonValue(float &value, const QJsonValue &jval) {
fromJsonValue(float &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(jval.isDouble()){ if (jval.isDouble()) {
value = static_cast<float>(jval.toDouble()); value = static_cast<float>(jval.toDouble());
} else { } else {
ok = false; ok = false;
@ -344,10 +290,9 @@ fromJsonValue(float &value, const QJsonValue &jval){
return ok; return ok;
} }
bool bool fromJsonValue(double &value, const QJsonValue &jval) {
fromJsonValue(double &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(jval.isDouble()){ if (jval.isDouble()) {
value = jval.toDouble(); value = jval.toDouble();
} else { } else {
ok = false; ok = false;
@ -355,10 +300,9 @@ fromJsonValue(double &value, const QJsonValue &jval){
return ok; return ok;
} }
bool bool fromJsonValue({{prefix}}Object &value, const QJsonValue &jval) {
fromJsonValue({{prefix}}Object &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(jval.isObject()){ if (jval.isObject()) {
value.fromJsonObject(jval.toObject()); value.fromJsonObject(jval.toObject());
ok = value.isValid(); ok = value.isValid();
} else { } else {
@ -367,17 +311,15 @@ fromJsonValue({{prefix}}Object &value, const QJsonValue &jval){
return ok; return ok;
} }
bool bool fromJsonValue({{prefix}}Enum &value, const QJsonValue &jval) {
fromJsonValue({{prefix}}Enum &value, const QJsonValue &jval){
value.fromJsonValue(jval); value.fromJsonValue(jval);
return true; return true;
} }
bool bool fromJsonValue({{prefix}}HttpFileElement &value, const QJsonValue &jval) {
fromJsonValue({{prefix}}HttpFileElement &value, const QJsonValue &jval){
return value.fromJsonValue(jval); return value.fromJsonValue(jval);
} }
{{#cppNamespaceDeclarations}} {{#cppNamespaceDeclarations}}
} } // namespace {{this}}
{{/cppNamespaceDeclarations}} {{/cppNamespaceDeclarations}}

View File

@ -2,163 +2,184 @@
#ifndef {{prefix}}_HELPERS_H #ifndef {{prefix}}_HELPERS_H
#define {{prefix}}_HELPERS_H #define {{prefix}}_HELPERS_H
#include <QJsonObject>
#include <QJsonValue>
#include <QJsonArray>
#include <QList>
#include <QMap>
#include <QDateTime>
#include <QByteArray> #include <QByteArray>
#include <QDate> #include <QDate>
#include <QDateTime>
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QMap>
#include <QVariant> #include <QVariant>
#include "{{prefix}}Object.h"
#include "{{prefix}}Enum.h" #include "{{prefix}}Enum.h"
#include "{{prefix}}HttpFileElement.h" #include "{{prefix}}HttpFileElement.h"
#include "{{prefix}}Object.h"
{{#cppNamespaceDeclarations}} {{#cppNamespaceDeclarations}}
namespace {{this}} { namespace {{this}} {
{{/cppNamespaceDeclarations}} {{/cppNamespaceDeclarations}}
QString toStringValue(const QString &value); template <typename T>
QString toStringValue(const QDateTime &value); QString toStringValue(const QList<T> &val);
QString toStringValue(const QByteArray &value);
QString toStringValue(const QDate &value);
QString toStringValue(const qint32 &value);
QString toStringValue(const qint64 &value);
QString toStringValue(const bool &value);
QString toStringValue(const float &value);
QString toStringValue(const double &value);
QString toStringValue(const {{prefix}}Object &value);
QString toStringValue(const {{prefix}}Enum &value);
QString toStringValue(const {{prefix}}HttpFileElement &value);
template <typename T> template <typename T>
QString toStringValue(const QList<T> &val) { bool fromStringValue(const QList<QString> &inStr, QList<T> &val);
QString strArray;
for(const auto& item : val) { template <typename T>
strArray.append(toStringValue(item) + ","); bool fromStringValue(const QMap<QString, QString> &inStr, QMap<QString, T> &val);
}
if(val.count() > 0) { template <typename T>
strArray.chop(1); QJsonValue toJsonValue(const QList<T> &val);
}
return strArray; 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);
QString toStringValue(const QDate &value);
QString toStringValue(const qint32 &value);
QString toStringValue(const qint64 &value);
QString toStringValue(const bool &value);
QString toStringValue(const float &value);
QString toStringValue(const double &value);
QString toStringValue(const {{prefix}}Object &value);
QString toStringValue(const {{prefix}}Enum &value);
QString toStringValue(const {{prefix}}HttpFileElement &value);
template <typename T>
QString toStringValue(const QList<T> &val) {
QString strArray;
for (const auto &item : val) {
strArray.append(toStringValue(item) + ",");
} }
if (val.count() > 0) {
QJsonValue toJsonValue(const QString &value); strArray.chop(1);
QJsonValue toJsonValue(const QDateTime &value);
QJsonValue toJsonValue(const QByteArray &value);
QJsonValue toJsonValue(const QDate &value);
QJsonValue toJsonValue(const qint32 &value);
QJsonValue toJsonValue(const qint64 &value);
QJsonValue toJsonValue(const bool &value);
QJsonValue toJsonValue(const float &value);
QJsonValue toJsonValue(const double &value);
QJsonValue toJsonValue(const {{prefix}}Object &value);
QJsonValue toJsonValue(const {{prefix}}Enum &value);
QJsonValue toJsonValue(const {{prefix}}HttpFileElement &value);
template <typename T>
QJsonValue toJsonValue(const QList<T> &val) {
QJsonArray jArray;
for(const auto& item : val) {
jArray.append(toJsonValue(item));
}
return jArray;
} }
return strArray;
}
template <typename T> QJsonValue toJsonValue(const QString &value);
QJsonValue toJsonValue(const QMap<QString, T> &val) { QJsonValue toJsonValue(const QDateTime &value);
QJsonObject jObject; QJsonValue toJsonValue(const QByteArray &value);
for(const auto& itemkey : val.keys()) { QJsonValue toJsonValue(const QDate &value);
jObject.insert(itemkey, toJsonValue(val.value(itemkey))); QJsonValue toJsonValue(const qint32 &value);
} QJsonValue toJsonValue(const qint64 &value);
return jObject; QJsonValue toJsonValue(const bool &value);
QJsonValue toJsonValue(const float &value);
QJsonValue toJsonValue(const double &value);
QJsonValue toJsonValue(const {{prefix}}Object &value);
QJsonValue toJsonValue(const {{prefix}}Enum &value);
QJsonValue toJsonValue(const {{prefix}}HttpFileElement &value);
template <typename T>
QJsonValue toJsonValue(const QList<T> &val) {
QJsonArray jArray;
for (const auto &item : val) {
jArray.append(toJsonValue(item));
} }
return jArray;
}
bool fromStringValue(const QString &inStr, QString &value); template <typename T>
bool fromStringValue(const QString &inStr, QDateTime &value); QJsonValue toJsonValue(const QMap<QString, T> &val) {
bool fromStringValue(const QString &inStr, QByteArray &value); QJsonObject jObject;
bool fromStringValue(const QString &inStr, QDate &value); for (const auto &itemkey : val.keys()) {
bool fromStringValue(const QString &inStr, qint32 &value); jObject.insert(itemkey, toJsonValue(val.value(itemkey)));
bool fromStringValue(const QString &inStr, qint64 &value);
bool fromStringValue(const QString &inStr, bool &value);
bool fromStringValue(const QString &inStr, float &value);
bool fromStringValue(const QString &inStr, double &value);
bool fromStringValue(const QString &inStr, {{prefix}}Object &value);
bool fromStringValue(const QString &inStr, {{prefix}}Enum &value);
bool fromStringValue(const QString &inStr, {{prefix}}HttpFileElement &value);
template <typename T>
bool fromStringValue(const QList<QString> &inStr, QList<T> &val) {
bool ok = (inStr.count() > 0);
for(const auto& item: inStr){
T itemVal;
ok &= fromStringValue(item, itemVal);
val.push_back(itemVal);
}
return ok;
} }
return jObject;
}
template <typename T> bool fromStringValue(const QString &inStr, QString &value);
bool fromStringValue(const QMap<QString, QString> &inStr, QMap<QString, T> &val) { bool fromStringValue(const QString &inStr, QDateTime &value);
bool ok = (inStr.count() > 0); bool fromStringValue(const QString &inStr, QByteArray &value);
for(const auto& itemkey : inStr.keys()){ bool fromStringValue(const QString &inStr, QDate &value);
T itemVal; bool fromStringValue(const QString &inStr, qint32 &value);
ok &= fromStringValue(inStr.value(itemkey), itemVal); bool fromStringValue(const QString &inStr, qint64 &value);
val.insert(itemkey, itemVal); bool fromStringValue(const QString &inStr, bool &value);
} bool fromStringValue(const QString &inStr, float &value);
return ok; bool fromStringValue(const QString &inStr, double &value);
bool fromStringValue(const QString &inStr, {{prefix}}Object &value);
bool fromStringValue(const QString &inStr, {{prefix}}Enum &value);
bool fromStringValue(const QString &inStr, {{prefix}}HttpFileElement &value);
template <typename T>
bool fromStringValue(const QList<QString> &inStr, QList<T> &val) {
bool ok = (inStr.count() > 0);
for (const auto &item : inStr) {
T itemVal;
ok &= fromStringValue(item, itemVal);
val.push_back(itemVal);
} }
return ok;
}
bool fromJsonValue(QString &value, const QJsonValue &jval); template <typename T>
bool fromJsonValue(QDateTime &value, const QJsonValue &jval); bool fromStringValue(const QMap<QString, QString> &inStr, QMap<QString, T> &val) {
bool fromJsonValue(QByteArray &value, const QJsonValue &jval); bool ok = (inStr.count() > 0);
bool fromJsonValue(QDate &value, const QJsonValue &jval); for (const auto &itemkey : inStr.keys()) {
bool fromJsonValue(qint32 &value, const QJsonValue &jval); T itemVal;
bool fromJsonValue(qint64 &value, const QJsonValue &jval); ok &= fromStringValue(inStr.value(itemkey), itemVal);
bool fromJsonValue(bool &value, const QJsonValue &jval); val.insert(itemkey, itemVal);
bool fromJsonValue(float &value, const QJsonValue &jval); }
bool fromJsonValue(double &value, const QJsonValue &jval); return ok;
bool fromJsonValue({{prefix}}Object &value, const QJsonValue &jval); }
bool fromJsonValue({{prefix}}Enum &value, const QJsonValue &jval);
bool fromJsonValue({{prefix}}HttpFileElement &value, const QJsonValue &jval);
template <typename T> bool fromJsonValue(QString &value, const QJsonValue &jval);
bool fromJsonValue(QList<T> &val, const QJsonValue &jval) { bool fromJsonValue(QDateTime &value, const QJsonValue &jval);
bool ok = true; bool fromJsonValue(QByteArray &value, const QJsonValue &jval);
if(jval.isArray()){ bool fromJsonValue(QDate &value, const QJsonValue &jval);
for(const auto& jitem : jval.toArray()){ bool fromJsonValue(qint32 &value, const QJsonValue &jval);
T item; bool fromJsonValue(qint64 &value, const QJsonValue &jval);
ok &= fromJsonValue(item, jitem); bool fromJsonValue(bool &value, const QJsonValue &jval);
val.push_back(item); bool fromJsonValue(float &value, const QJsonValue &jval);
bool fromJsonValue(double &value, const QJsonValue &jval);
bool fromJsonValue({{prefix}}Object &value, const QJsonValue &jval);
bool fromJsonValue({{prefix}}Enum &value, const QJsonValue &jval);
bool fromJsonValue({{prefix}}HttpFileElement &value, const QJsonValue &jval);
template <typename T>
bool fromJsonValue(QList<T> &val, const QJsonValue &jval) {
bool ok = true;
if (jval.isArray()) {
for (const auto jitem : jval.toArray()) {
T item;
ok &= fromJsonValue(item, jitem);
val.push_back(item);
}
} else {
ok = false;
}
return ok;
}
template <typename T>
bool fromJsonValue(QMap<QString, T> &val, const QJsonValue &jval) {
bool ok = true;
if (jval.isObject()) {
auto varmap = jval.toObject().toVariantMap();
if (varmap.count() > 0) {
for (const auto &itemkey : varmap.keys()) {
T itemVal;
ok &= fromJsonValue(itemVal, QJsonValue::fromVariant(varmap.value(itemkey)));
val.insert(itemkey, itemVal);
} }
} else {
ok = false;
} }
return ok; } else {
} ok = false;
template <typename T>
bool fromJsonValue(QMap<QString, T> &val, const QJsonValue &jval) {
bool ok = true;
if(jval.isObject()){
auto varmap = jval.toObject().toVariantMap();
if(varmap.count() > 0){
for(const auto& itemkey : varmap.keys() ){
T itemVal;
ok &= fromJsonValue(itemVal, QJsonValue::fromVariant(varmap.value(itemkey)));
val.insert(itemkey, itemVal);
}
}
} else {
ok = false;
}
return ok;
} }
return ok;
}
{{#cppNamespaceDeclarations}} {{#cppNamespaceDeclarations}}
} } // namespace {{this}}
{{/cppNamespaceDeclarations}} {{/cppNamespaceDeclarations}}
#endif // {{prefix}}_HELPERS_H #endif // {{prefix}}_HELPERS_H

View File

@ -3,8 +3,8 @@
* {{{appDescription}}} * {{{appDescription}}}
* *
* {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} * {{#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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.

View File

@ -1,11 +1,10 @@
{{>licenseInfo}} {{>licenseInfo}}{{#models}}{{#model}}
{{#models}}{{#model}}
#include "{{classname}}.h" #include "{{classname}}.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug> #include <QDebug>
#include <QJsonArray>
#include <QJsonDocument>
#include <QObject>
#include "{{prefix}}Helpers.h" #include "{{prefix}}Helpers.h"
@ -14,54 +13,53 @@ namespace {{this}} {
{{/cppNamespaceDeclarations}} {{/cppNamespaceDeclarations}}
{{classname}}::{{classname}}(QString json) { {{classname}}::{{classname}}(QString json) {
this->init(); this->initializeModel();
this->fromJson(json); this->fromJson(json);
} }
{{classname}}::{{classname}}() { {{classname}}::{{classname}}() {
this->init(); this->initializeModel();
} }
{{classname}}::~{{classname}}() { {{classname}}::~{{classname}}() {}
} void {{classname}}::initializeModel() {
{{^isEnum}}{{#vars}}
void
{{classname}}::init() {
{{^isEnum}}{{#vars}}
m_{{name}}_isSet = false; m_{{name}}_isSet = false;
m_{{name}}_isValid = false; m_{{name}}_isValid = false;{{^-last}}
{{/vars}}{{/isEnum}}{{#isEnum}} {{/-last}}{{/vars}}{{/isEnum}}{{#isEnum}}
m_value_isSet = false; m_value_isSet = false;
m_value_isValid = false; m_value_isValid = false;
m_value = e{{classname}}::INVALID_VALUE_OPENAPI_GENERATED; m_value = e{{classname}}::INVALID_VALUE_OPENAPI_GENERATED;{{/isEnum}}
{{/isEnum}}
} }
void void {{classname}}::fromJson(QString jsonString) {
{{classname}}::fromJson(QString jsonString) { {{^isEnum}}QByteArray array(jsonString.toStdString().c_str());
{{^isEnum}}QByteArray array (jsonString.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array); QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object(); QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);{{/isEnum}}{{#isEnum}}{{#allowableValues}}{{#enumVars}} 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) { {{#-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 = e{{classname}}::{{name}};
m_value_isValid = true; m_value_isSet = m_value_isValid = true;
}{{/enumVars}}{{/allowableValues}}{{/isEnum}} }{{/enumVars}}{{/allowableValues}}{{/isEnum}}
} }
void void {{classname}}::fromJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}(QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} json) {
{{classname}}::fromJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}(QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} json) { {{^isEnum}}{{#vars}}{{^isContainer}}
{{^isEnum}}{{#vars}} m_{{name}}_isValid = ::{{cppNamespace}}::fromJsonValue({{name}}, json[QString("{{baseName}}")]);
{{^isContainer}}m_{{name}}_isValid = ::{{cppNamespace}}::fromJsonValue({{name}}, json[QString("{{baseName}}")]);{{/isContainer}} m_{{name}}_isSet = !json[QString("{{baseName}}")].isNull() && m_{{name}}_isValid;{{/isContainer}}{{#isContainer}}{{^items.isContainer}}
{{#isContainer}}{{^items.isContainer}}m_{{name}}_isValid = ::{{cppNamespace}}::fromJsonValue({{name}}, json[QString("{{baseName}}")]);{{/items.isContainer}}{{#items.isContainer}}{{#isListContainer}} 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()){ if(json["{{baseName}}"].isArray()){
auto arr = json["{{baseName}}"].toArray(); auto arr = json["{{baseName}}"].toArray();
m_{{name}}_isValid = true; m_{{name}}_isValid = true;
for (const QJsonValue & jval : arr) { if(arr.count() > 0) {
{{^items.isContainer}}{{items.baseType}}{{/items.isContainer}}{{#items.isListContainer}}QList<{{items.items.baseType}}>{{/items.isListContainer}}{{#items.isMapContainer}}QMap<QString, {{items.items.baseType}}>{{/items.isMapContainer}} item; for (const QJsonValue jval : arr) {
m_{{name}}_isValid &= ::{{cppNamespace}}::fromJsonValue(item, jval) {{^items.isContainer}}{{items.baseType}}{{/items.isContainer}}{{#items.isListContainer}}QList<{{items.items.baseType}}>{{/items.isListContainer}}{{#items.isMapContainer}}QMap<QString, {{items.items.baseType}}>{{/items.isMapContainer}} item;
{{name}}.push_back(item); m_{{name}}_isValid &= ::{{cppNamespace}}::fromJsonValue(item, jval);
m_{{name}}_isSet = !jval.isNull() && m_{{name}}_isValid;
{{name}}.push_back(item);
}
} }
}{{/isListContainer}}{{#isMapContainer}} }{{/isListContainer}}{{#isMapContainer}}
if(json["{{baseName}}"].isObject()){ if(json["{{baseName}}"].isObject()){
@ -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; {{^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)); auto jval = QJsonValue::fromVariant(varmap.value(val));
m_{{name}}_isValid &= ::{{cppNamespace}}::fromJsonValue(item, jval); m_{{name}}_isValid &= ::{{cppNamespace}}::fromJsonValue(item, jval);
m_{{name}}_isSet &= !jval.isNull() && m_{{name}}_isValid;
{{name}}.insert({{name}}.end(), val, item); {{name}}.insert({{name}}.end(), val, item);
} }
} }
}{{/isMapContainer}}{{/items.isContainer}}{{/isContainer}} }{{/isMapContainer}}{{/items.isContainer}}{{/isContainer}}{{^-last}}
{{/vars}}{{/isEnum}}{{#isEnum}} {{/-last}}
{{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}fromJson(json.toString());{{/isString}}{{^isString}}m_value = static_cast<e{{classname}}>(json.toInt());{{/isString}}{{/-first}}{{/enumVars}}{{/allowableValues}}{{/isEnum}} {{/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 QString {{classname}}::asJson() const {
{{classname}}::asJson () const {
{{^isEnum}}QJsonObject obj = this->asJsonObject(); {{^isEnum}}QJsonObject obj = this->asJsonObject();
QJsonDocument doc(obj); QJsonDocument doc(obj);
QByteArray bytes = doc.toJson(); QByteArray bytes = doc.toJson();
@ -100,27 +98,24 @@ QString
return val;{{/isEnum}} return val;{{/isEnum}}
} }
QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} {{classname}}::asJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}() const {
{{classname}}::asJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}() const { {{^isEnum}}QJsonObject obj;{{#vars}}{{^isContainer}}{{#complexType}}
{{^isEnum}}QJsonObject obj;{{#vars}} if ({{name}}.isSet()){{/complexType}}{{^complexType}}
{{^isContainer}}{{#complexType}}if({{name}}.isSet()){{/complexType}}{{^complexType}}if(m_{{name}}_isSet){{/complexType}}{ if (m_{{name}}_isSet){{/complexType}} {
obj.insert(QString("{{baseName}}"), ::{{cppNamespace}}::toJsonValue({{name}})); obj.insert(QString("{{baseName}}"), ::{{cppNamespace}}::toJsonValue({{name}}));
}{{/isContainer}}{{#isContainer}} }{{/isContainer}}{{#isContainer}}
if({{name}}.size() > 0){ if ({{name}}.size() > 0) {
{{^items.isContainer}}obj.insert(QString("{{baseName}}"), ::{{cppNamespace}}::toJsonValue({{name}}));{{/items.isContainer}}{{#items.isContainer}} {{^items.isContainer}}obj.insert(QString("{{baseName}}"), ::{{cppNamespace}}::toJsonValue({{name}}));{{/items.isContainer}}{{#items.isContainer}}
obj.insert(QString("{{baseName}}"), toJsonValue({{name}}));{{/items.isContainer}} obj.insert(QString("{{baseName}}"), toJsonValue({{name}}));{{/items.isContainer}}
} {{/isContainer}}{{/vars}} }{{/isContainer}}{{/vars}}
return obj;{{/isEnum}}{{#isEnum}} return obj;{{/isEnum}}{{#isEnum}}
{{#allowableValues}}{{#enumVars}}{{#-first}}{{^isString}}return QJsonValue(static_cast<int>(m_value));{{/isString}}{{#isString}}return QJsonValue(asJson());{{/isString}}{{/-first}}{{/enumVars}}{{/allowableValues}}{{/isEnum}} {{#allowableValues}}{{#enumVars}}{{#-first}}{{^isString}}return QJsonValue(static_cast<int>(m_value));{{/isString}}{{#isString}}return QJsonValue(asJson());{{/isString}}{{/-first}}{{/enumVars}}{{/allowableValues}}{{/isEnum}}
} }
{{^isEnum}}{{#vars}} {{^isEnum}}{{#vars}}{{{dataType}}} {{classname}}::{{getter}}() const {
{{{dataType}}}
{{classname}}::{{getter}}() const {
return {{name}}; return {{name}};
} }
void void {{classname}}::{{setter}}(const {{{dataType}}} &{{name}}) {
{{classname}}::{{setter}}(const {{{dataType}}} &{{name}}) {
this->{{name}} = {{name}}; this->{{name}} = {{name}};
this->m_{{name}}_isSet = true; this->m_{{name}}_isSet = true;
} }
@ -135,25 +130,27 @@ void {{classname}}::setValue(const {{classname}}::e{{classname}}& value){
m_value_isSet = true; m_value_isSet = true;
} }
{{/isEnum}} {{/isEnum}}
bool bool {{classname}}::isSet() const {
{{classname}}::isSet() const {
{{^isEnum}}bool isObjectUpdated = false; {{^isEnum}}bool isObjectUpdated = false;
do{ {{#vars}} do {
{{#isContainer}}if({{name}}.size() > 0){{/isContainer}}{{^isContainer}}{{#complexType}}if({{name}}.isSet()){{/complexType}}{{^complexType}}if(m_{{name}}_isSet){{/complexType}}{{/isContainer}}{ isObjectUpdated = true; break;} {{#vars}} {{#isContainer}}if ({{name}}.size() > 0){{/isContainer}}{{^isContainer}}{{#complexType}}if ({{name}}.isSet()){{/complexType}}{{^complexType}}if (m_{{name}}_isSet){{/complexType}}{{/isContainer}} {
{{/vars}}}while(false); isObjectUpdated = true;
break;
}{{^-last}}
{{/-last}}{{/vars}}
} while (false);
return isObjectUpdated;{{/isEnum}}{{#isEnum}} return isObjectUpdated;{{/isEnum}}{{#isEnum}}
return m_value_isSet;{{/isEnum}} return m_value_isSet;{{/isEnum}}
} }
bool bool {{classname}}::isValid() const {
{{classname}}::isValid() const {
// only required properties are required for the object to be considered valid // 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}}; return {{^isEnum}}{{#vars}}{{#required}}m_{{name}}_isValid && {{/required}}{{/vars}}true{{/isEnum}}{{#isEnum}}m_value_isValid{{/isEnum}};
} }
{{#cppNamespaceDeclarations}} {{#cppNamespaceDeclarations}}
} } // namespace {{this}}
{{/cppNamespaceDeclarations}} {{/cppNamespaceDeclarations}}
{{/model}} {{/model}}
{{/models}} {{/models}}

View File

@ -10,13 +10,11 @@
#include <QJsonObject> #include <QJsonObject>
{{/model}}{{/models}} {{/model}}{{/models}}{{#imports}}{{{import}}}
{{#imports}}{{{import}}}
{{/imports}} {{/imports}}
#include "{{prefix}}Object.h"
#include "{{prefix}}Enum.h" #include "{{prefix}}Enum.h"
#include "{{prefix}}Object.h"
{{#models}} {{#models}}
{{#model}} {{#model}}
@ -24,22 +22,21 @@
namespace {{this}} { namespace {{this}} {
{{/cppNamespaceDeclarations}} {{/cppNamespaceDeclarations}}
class {{classname}}: public {{prefix}}{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Enum{{/isEnum}} { class {{classname}} : public {{prefix}}{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Enum{{/isEnum}} {
public: public:
{{classname}}(); {{classname}}();
{{classname}}(QString json); {{classname}}(QString json);
~{{classname}}() override; ~{{classname}}() override;
QString asJson () const override; QString asJson() const override;
QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} asJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}() const override; 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{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}(QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} json) override;
void fromJson(QString jsonString) override; void fromJson(QString jsonString) override;
{{^isEnum}}{{#vars}}
{{^isEnum}}{{#vars}}
{{{dataType}}} {{getter}}() const; {{{dataType}}} {{getter}}() const;
void {{setter}}(const {{{dataType}}} &{{name}}); void {{setter}}(const {{{dataType}}} &{{name}});
{{/vars}}{{/isEnum}}{{#isEnum}}
{{/vars}}{{/isEnum}}{{#isEnum}}{{#allowableValues}} {{#allowableValues}}
enum class e{{classname}} {{#enumVars}}{{#-first}}{{^isString}}: int {{/isString}}{{/-first}}{{/enumVars}}{ enum class e{{classname}} {{#enumVars}}{{#-first}}{{^isString}}: int {{/isString}}{{/-first}}{{/enumVars}}{
INVALID_VALUE_OPENAPI_GENERATED = 0, INVALID_VALUE_OPENAPI_GENERATED = 0,
{{#enumVars}} {{#enumVars}}
@ -51,28 +48,25 @@ public:
{{{name}}}{{^-last}}, {{/-last}} {{{name}}}{{^-last}}, {{/-last}}
{{/enumVars}} {{/enumVars}}
};{{/allowableValues}} };{{/allowableValues}}
{{classname}}::e{{classname}} getValue() const; {{classname}}::e{{classname}} getValue() const;
void setValue(const {{classname}}::e{{classname}}& value);{{/isEnum}} void setValue(const {{classname}}::e{{classname}}& value);{{/isEnum}}
virtual bool isSet() const override; virtual bool isSet() const override;
virtual bool isValid() const override; virtual bool isValid() const override;
private: private:
void init(); void initializeModel();
{{^isEnum}}{{#vars}} {{^isEnum}}{{#vars}}
{{{dataType}}} {{name}}; {{{dataType}}} {{name}};
bool m_{{name}}_isSet; bool m_{{name}}_isSet;
bool m_{{name}}_isValid; bool m_{{name}}_isValid;
{{/vars}}{{/isEnum}} {{/vars}}{{/isEnum}}{{#isEnum}}
{{#isEnum}}e{{classname}} m_value; e{{classname}} m_value;
bool m_value_isSet; bool m_value_isSet;
bool m_value_isValid; bool m_value_isValid;
{{/isEnum}} {{/isEnum}}};
};
{{#cppNamespaceDeclarations}} {{#cppNamespaceDeclarations}}
} } // namespace {{this}}
{{/cppNamespaceDeclarations}} {{/cppNamespaceDeclarations}}
Q_DECLARE_METATYPE({{#cppNamespaceDeclarations}}{{this}}::{{/cppNamespaceDeclarations}}{{classname}}) Q_DECLARE_METATYPE({{#cppNamespaceDeclarations}}{{this}}::{{/cppNamespaceDeclarations}}{{classname}})

View File

@ -2,8 +2,8 @@
#ifndef {{prefix}}_OBJECT_H #ifndef {{prefix}}_OBJECT_H
#define {{prefix}}_OBJECT_H #define {{prefix}}_OBJECT_H
#include <QJsonObject>
#include <QJsonDocument> #include <QJsonDocument>
#include <QJsonObject>
#include <QMetaType> #include <QMetaType>
{{#cppNamespaceDeclarations}} {{#cppNamespaceDeclarations}}
@ -11,18 +11,14 @@ namespace {{this}} {
{{/cppNamespaceDeclarations}} {{/cppNamespaceDeclarations}}
class {{prefix}}Object { class {{prefix}}Object {
public: public:
{{prefix}}Object() { {{prefix}}Object() {}
}
{{prefix}}Object(QString jsonString) { {{prefix}}Object(QString jsonString) {
fromJson(jsonString); fromJson(jsonString);
} }
virtual ~{{prefix}}Object(){ virtual ~{{prefix}}Object() {}
}
virtual QJsonObject asJsonObject() const { virtual QJsonObject asJsonObject() const {
return jObj; return jObj;
@ -49,12 +45,13 @@ class {{prefix}}Object {
virtual bool isValid() const { virtual bool isValid() const {
return true; return true;
} }
private :
private:
QJsonObject jObj; QJsonObject jObj;
}; };
{{#cppNamespaceDeclarations}} {{#cppNamespaceDeclarations}}
} } // namespace {{this}}
{{/cppNamespaceDeclarations}} {{/cppNamespaceDeclarations}}
Q_DECLARE_METATYPE({{#cppNamespaceDeclarations}}{{this}}::{{/cppNamespaceDeclarations}}{{prefix}}Object) Q_DECLARE_METATYPE({{#cppNamespaceDeclarations}}{{this}}::{{/cppNamespaceDeclarations}}{{prefix}}Object)

View File

@ -1 +1 @@
4.2.3-SNAPSHOT 4.3.0-SNAPSHOT

View File

@ -5,7 +5,11 @@ set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Wno-unused-variable") 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(Qt5Core REQUIRED)
find_package(Qt5Network REQUIRED) find_package(Qt5Network REQUIRED)

View File

@ -9,8 +9,9 @@
* Do not edit the class manually. * Do not edit the class manually.
*/ */
#include "PFXHelpers.h"
#include <QDebug> #include <QDebug>
#include <QJsonParseError>
#include "PFXHelpers.h"
namespace test_namespace { namespace test_namespace {
@ -186,6 +187,17 @@ bool fromStringValue(const QString &inStr, double &value) {
return ok; 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) { bool fromStringValue(const QString &inStr, PFXEnum &value) {
value.fromJson(inStr); value.fromJson(inStr);
return true; return true;

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech

View File

@ -3,147 +3,134 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.
*/ */
#include "OAIApiResponse.h" #include "OAIApiResponse.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug> #include <QDebug>
#include <QJsonArray>
#include <QJsonDocument>
#include <QObject>
#include "OAIHelpers.h" #include "OAIHelpers.h"
namespace OpenAPI { namespace OpenAPI {
OAIApiResponse::OAIApiResponse(QString json) { OAIApiResponse::OAIApiResponse(QString json) {
this->init(); this->initializeModel();
this->fromJson(json); this->fromJson(json);
} }
OAIApiResponse::OAIApiResponse() { OAIApiResponse::OAIApiResponse() {
this->init(); this->initializeModel();
} }
OAIApiResponse::~OAIApiResponse() { OAIApiResponse::~OAIApiResponse() {}
} void OAIApiResponse::initializeModel() {
void
OAIApiResponse::init() {
m_code_isSet = false; m_code_isSet = false;
m_code_isValid = false; m_code_isValid = false;
m_type_isSet = false; m_type_isSet = false;
m_type_isValid = false; m_type_isValid = false;
m_message_isSet = false; m_message_isSet = false;
m_message_isValid = false; m_message_isValid = false;
} }
void void OAIApiResponse::fromJson(QString jsonString) {
OAIApiResponse::fromJson(QString jsonString) { QByteArray array(jsonString.toStdString().c_str());
QByteArray array (jsonString.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array); QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object(); QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject); this->fromJsonObject(jsonObject);
} }
void void OAIApiResponse::fromJsonObject(QJsonObject json) {
OAIApiResponse::fromJsonObject(QJsonObject json) {
m_code_isValid = ::OpenAPI::fromJsonValue(code, json[QString("code")]); 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_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_isValid = ::OpenAPI::fromJsonValue(message, json[QString("message")]);
m_message_isSet = !json[QString("message")].isNull() && m_message_isValid;
} }
QString QString OAIApiResponse::asJson() const {
OAIApiResponse::asJson () const {
QJsonObject obj = this->asJsonObject(); QJsonObject obj = this->asJsonObject();
QJsonDocument doc(obj); QJsonDocument doc(obj);
QByteArray bytes = doc.toJson(); QByteArray bytes = doc.toJson();
return QString(bytes); return QString(bytes);
} }
QJsonObject QJsonObject OAIApiResponse::asJsonObject() const {
OAIApiResponse::asJsonObject() const {
QJsonObject obj; QJsonObject obj;
if(m_code_isSet){ if (m_code_isSet) {
obj.insert(QString("code"), ::OpenAPI::toJsonValue(code)); obj.insert(QString("code"), ::OpenAPI::toJsonValue(code));
} }
if(m_type_isSet){ if (m_type_isSet) {
obj.insert(QString("type"), ::OpenAPI::toJsonValue(type)); obj.insert(QString("type"), ::OpenAPI::toJsonValue(type));
} }
if(m_message_isSet){ if (m_message_isSet) {
obj.insert(QString("message"), ::OpenAPI::toJsonValue(message)); obj.insert(QString("message"), ::OpenAPI::toJsonValue(message));
} }
return obj; return obj;
} }
qint32 OAIApiResponse::getCode() const {
qint32
OAIApiResponse::getCode() const {
return code; return code;
} }
void void OAIApiResponse::setCode(const qint32 &code) {
OAIApiResponse::setCode(const qint32 &code) {
this->code = code; this->code = code;
this->m_code_isSet = true; this->m_code_isSet = true;
} }
QString OAIApiResponse::getType() const {
QString
OAIApiResponse::getType() const {
return type; return type;
} }
void void OAIApiResponse::setType(const QString &type) {
OAIApiResponse::setType(const QString &type) {
this->type = type; this->type = type;
this->m_type_isSet = true; this->m_type_isSet = true;
} }
QString OAIApiResponse::getMessage() const {
QString
OAIApiResponse::getMessage() const {
return message; return message;
} }
void void OAIApiResponse::setMessage(const QString &message) {
OAIApiResponse::setMessage(const QString &message) {
this->message = message; this->message = message;
this->m_message_isSet = true; this->m_message_isSet = true;
} }
bool bool OAIApiResponse::isSet() const {
OAIApiResponse::isSet() const {
bool isObjectUpdated = false; bool isObjectUpdated = false;
do{ do {
if(m_code_isSet){ isObjectUpdated = true; break;} if (m_code_isSet) {
isObjectUpdated = true;
if(m_type_isSet){ isObjectUpdated = true; break;} break;
}
if(m_message_isSet){ isObjectUpdated = true; break;}
}while(false); if (m_type_isSet) {
isObjectUpdated = true;
break;
}
if (m_message_isSet) {
isObjectUpdated = true;
break;
}
} while (false);
return isObjectUpdated; return isObjectUpdated;
} }
bool bool OAIApiResponse::isValid() const {
OAIApiResponse::isValid() const {
// only required properties are required for the object to be considered valid // only required properties are required for the object to be considered valid
return true; return true;
} }
} } // namespace OpenAPI

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
@ -21,61 +20,53 @@
#include <QJsonObject> #include <QJsonObject>
#include <QString> #include <QString>
#include "OAIObject.h"
#include "OAIEnum.h" #include "OAIEnum.h"
#include "OAIObject.h"
namespace OpenAPI { namespace OpenAPI {
class OAIApiResponse: public OAIObject { class OAIApiResponse : public OAIObject {
public: public:
OAIApiResponse(); OAIApiResponse();
OAIApiResponse(QString json); OAIApiResponse(QString json);
~OAIApiResponse() override; ~OAIApiResponse() override;
QString asJson () const override; QString asJson() const override;
QJsonObject asJsonObject() const override; QJsonObject asJsonObject() const override;
void fromJsonObject(QJsonObject json) override; void fromJsonObject(QJsonObject json) override;
void fromJson(QString jsonString) override; void fromJson(QString jsonString) override;
qint32 getCode() const; qint32 getCode() const;
void setCode(const qint32 &code); void setCode(const qint32 &code);
QString getType() const; QString getType() const;
void setType(const QString &type); void setType(const QString &type);
QString getMessage() const; QString getMessage() const;
void setMessage(const QString &message); void setMessage(const QString &message);
virtual bool isSet() const override; virtual bool isSet() const override;
virtual bool isValid() const override; virtual bool isValid() const override;
private: private:
void init(); void initializeModel();
qint32 code; qint32 code;
bool m_code_isSet; bool m_code_isSet;
bool m_code_isValid; bool m_code_isValid;
QString type; QString type;
bool m_type_isSet; bool m_type_isSet;
bool m_type_isValid; bool m_type_isValid;
QString message; QString message;
bool m_message_isSet; bool m_message_isSet;
bool m_message_isValid; bool m_message_isValid;
};
};
} } // namespace OpenAPI
Q_DECLARE_METATYPE(OpenAPI::OAIApiResponse) Q_DECLARE_METATYPE(OpenAPI::OAIApiResponse)

View File

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

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
@ -21,53 +20,46 @@
#include <QJsonObject> #include <QJsonObject>
#include <QString> #include <QString>
#include "OAIObject.h"
#include "OAIEnum.h" #include "OAIEnum.h"
#include "OAIObject.h"
namespace OpenAPI { namespace OpenAPI {
class OAICategory: public OAIObject { class OAICategory : public OAIObject {
public: public:
OAICategory(); OAICategory();
OAICategory(QString json); OAICategory(QString json);
~OAICategory() override; ~OAICategory() override;
QString asJson () const override; QString asJson() const override;
QJsonObject asJsonObject() const override; QJsonObject asJsonObject() const override;
void fromJsonObject(QJsonObject json) override; void fromJsonObject(QJsonObject json) override;
void fromJson(QString jsonString) override; void fromJson(QString jsonString) override;
qint64 getId() const; qint64 getId() const;
void setId(const qint64 &id); void setId(const qint64 &id);
QString getName() const; QString getName() const;
void setName(const QString &name); void setName(const QString &name);
virtual bool isSet() const override; virtual bool isSet() const override;
virtual bool isValid() const override; virtual bool isValid() const override;
private: private:
void init(); void initializeModel();
qint64 id; qint64 id;
bool m_id_isSet; bool m_id_isSet;
bool m_id_isValid; bool m_id_isValid;
QString name; QString name;
bool m_name_isSet; bool m_name_isSet;
bool m_name_isValid; bool m_name_isValid;
};
};
} } // namespace OpenAPI
Q_DECLARE_METATYPE(OpenAPI::OAICategory) Q_DECLARE_METATYPE(OpenAPI::OAICategory)

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
@ -13,25 +12,21 @@
#ifndef OAI_ENUM_H #ifndef OAI_ENUM_H
#define OAI_ENUM_H #define OAI_ENUM_H
#include <QString>
#include <QJsonValue> #include <QJsonValue>
#include <QMetaType> #include <QMetaType>
#include <QString>
namespace OpenAPI { namespace OpenAPI {
class OAIEnum { class OAIEnum {
public: public:
OAIEnum() { OAIEnum() {}
}
OAIEnum(QString jsonString) { OAIEnum(QString jsonString) {
fromJson(jsonString); fromJson(jsonString);
} }
virtual ~OAIEnum(){ virtual ~OAIEnum() {}
}
virtual QJsonValue asJsonValue() const { virtual QJsonValue asJsonValue() const {
return QJsonValue(jstr); return QJsonValue(jstr);
@ -56,11 +51,12 @@ class OAIEnum {
virtual bool isValid() const { virtual bool isValid() const {
return true; return true;
} }
private :
private:
QString jstr; QString jstr;
}; };
} } // namespace OpenAPI
Q_DECLARE_METATYPE(OpenAPI::OAIEnum) Q_DECLARE_METATYPE(OpenAPI::OAIEnum)

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
@ -14,225 +13,181 @@
#include <QJsonParseError> #include <QJsonParseError>
#include "OAIHelpers.h" #include "OAIHelpers.h"
namespace OpenAPI { namespace OpenAPI {
QString toStringValue(const QString &value) {
QString
toStringValue(const QString &value) {
return value; return value;
} }
QString QString toStringValue(const QDateTime &value) {
toStringValue(const QDateTime &value){
// ISO 8601 // ISO 8601
return value.toString("yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm]"); return value.toString("yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm]");
} }
QString QString toStringValue(const QByteArray &value) {
toStringValue(const QByteArray &value){
return QString(value); return QString(value);
} }
QString QString toStringValue(const QDate &value) {
toStringValue(const QDate &value){
// ISO 8601 // ISO 8601
return value.toString(Qt::DateFormat::ISODate); return value.toString(Qt::DateFormat::ISODate);
} }
QString QString toStringValue(const qint32 &value) {
toStringValue(const qint32 &value) {
return QString::number(value); return QString::number(value);
} }
QString QString toStringValue(const qint64 &value) {
toStringValue(const qint64 &value) {
return QString::number(value); return QString::number(value);
} }
QString QString toStringValue(const bool &value) {
toStringValue(const bool &value) {
return QString(value ? "true" : "false"); return QString(value ? "true" : "false");
} }
QString QString toStringValue(const float &value) {
toStringValue(const float &value){
return QString::number(static_cast<double>(value)); return QString::number(static_cast<double>(value));
} }
QString QString toStringValue(const double &value) {
toStringValue(const double &value){
return QString::number(value); return QString::number(value);
} }
QString QString toStringValue(const OAIObject &value) {
toStringValue(const OAIObject &value){
return value.asJson(); return value.asJson();
} }
QString toStringValue(const OAIEnum &value) {
QString
toStringValue(const OAIEnum &value){
return value.asJson(); return value.asJson();
} }
QString QString toStringValue(const OAIHttpFileElement &value) {
toStringValue(const OAIHttpFileElement &value){
return value.asJson(); return value.asJson();
} }
QJsonValue toJsonValue(const QString &value) {
QJsonValue return QJsonValue(value);
toJsonValue(const QString &value){
return QJsonValue(value);
} }
QJsonValue QJsonValue toJsonValue(const QDateTime &value) {
toJsonValue(const QDateTime &value){
return QJsonValue(value.toString(Qt::ISODate)); return QJsonValue(value.toString(Qt::ISODate));
} }
QJsonValue QJsonValue toJsonValue(const QByteArray &value) {
toJsonValue(const QByteArray &value){
return QJsonValue(QString(value.toBase64())); return QJsonValue(QString(value.toBase64()));
} }
QJsonValue QJsonValue toJsonValue(const QDate &value) {
toJsonValue(const QDate &value){
return QJsonValue(value.toString(Qt::ISODate)); return QJsonValue(value.toString(Qt::ISODate));
} }
QJsonValue QJsonValue toJsonValue(const qint32 &value) {
toJsonValue(const qint32 &value){
return QJsonValue(value); return QJsonValue(value);
} }
QJsonValue QJsonValue toJsonValue(const qint64 &value) {
toJsonValue(const qint64 &value){
return QJsonValue(value); return QJsonValue(value);
} }
QJsonValue QJsonValue toJsonValue(const bool &value) {
toJsonValue(const bool &value){
return QJsonValue(value); return QJsonValue(value);
} }
QJsonValue QJsonValue toJsonValue(const float &value) {
toJsonValue(const float &value){
return QJsonValue(static_cast<double>(value)); return QJsonValue(static_cast<double>(value));
} }
QJsonValue QJsonValue toJsonValue(const double &value) {
toJsonValue(const double &value){
return QJsonValue(value); return QJsonValue(value);
} }
QJsonValue QJsonValue toJsonValue(const OAIObject &value) {
toJsonValue(const OAIObject &value){
return value.asJsonObject(); return value.asJsonObject();
} }
QJsonValue QJsonValue toJsonValue(const OAIEnum &value) {
toJsonValue(const OAIEnum &value){
return value.asJsonValue(); return value.asJsonValue();
} }
QJsonValue QJsonValue toJsonValue(const OAIHttpFileElement &value) {
toJsonValue(const OAIHttpFileElement &value){
return value.asJsonValue(); return value.asJsonValue();
} }
bool fromStringValue(const QString &inStr, QString &value) {
bool
fromStringValue(const QString &inStr, QString &value){
value.clear(); value.clear();
value.append(inStr); value.append(inStr);
return !inStr.isEmpty(); return !inStr.isEmpty();
} }
bool bool fromStringValue(const QString &inStr, QDateTime &value) {
fromStringValue(const QString &inStr, QDateTime &value){ if (inStr.isEmpty()) {
if(inStr.isEmpty()){
return false; return false;
} } else {
else{
auto dateTime = QDateTime::fromString(inStr, "yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm]"); auto dateTime = QDateTime::fromString(inStr, "yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm]");
if(dateTime.isValid()){ if (dateTime.isValid()) {
value.setDate(dateTime.date()); value.setDate(dateTime.date());
value.setTime(dateTime.time()); value.setTime(dateTime.time());
} } else {
else{
qDebug() << "DateTime is invalid"; qDebug() << "DateTime is invalid";
} }
return dateTime.isValid(); return dateTime.isValid();
} }
} }
bool bool fromStringValue(const QString &inStr, QByteArray &value) {
fromStringValue(const QString &inStr, QByteArray &value){ if (inStr.isEmpty()) {
if(inStr.isEmpty()){
return false; return false;
} } else {
else{
value.clear(); value.clear();
value.append(inStr.toUtf8()); value.append(inStr.toUtf8());
return value.count() > 0; return value.count() > 0;
} }
} }
bool bool fromStringValue(const QString &inStr, QDate &value) {
fromStringValue(const QString &inStr, QDate &value){ if (inStr.isEmpty()) {
if(inStr.isEmpty()){
return false; return false;
} } else {
else{
auto date = QDate::fromString(inStr, Qt::DateFormat::ISODate); auto date = QDate::fromString(inStr, Qt::DateFormat::ISODate);
if(date.isValid()){ if (date.isValid()) {
value.setDate(date.year(), date.month(), date.day()); value.setDate(date.year(), date.month(), date.day());
} } else {
else{
qDebug() << "Date is invalid"; qDebug() << "Date is invalid";
} }
return date.isValid(); return date.isValid();
} }
} }
bool bool fromStringValue(const QString &inStr, qint32 &value) {
fromStringValue(const QString &inStr, qint32 &value){
bool ok = false; bool ok = false;
value = QVariant(inStr).toInt(&ok); value = QVariant(inStr).toInt(&ok);
return ok; return ok;
} }
bool bool fromStringValue(const QString &inStr, qint64 &value) {
fromStringValue(const QString &inStr, qint64 &value){
bool ok = false; bool ok = false;
value = QVariant(inStr).toLongLong(&ok); value = QVariant(inStr).toLongLong(&ok);
return ok; return ok;
} }
bool bool fromStringValue(const QString &inStr, bool &value) {
fromStringValue(const QString &inStr, bool &value){
value = QVariant(inStr).toBool(); value = QVariant(inStr).toBool();
return ((inStr == "true") || (inStr == "false")); return ((inStr == "true") || (inStr == "false"));
} }
bool bool fromStringValue(const QString &inStr, float &value) {
fromStringValue(const QString &inStr, float &value){
bool ok = false; bool ok = false;
value = QVariant(inStr).toFloat(&ok); value = QVariant(inStr).toFloat(&ok);
return ok; return ok;
} }
bool bool fromStringValue(const QString &inStr, double &value) {
fromStringValue(const QString &inStr, double &value){
bool ok = false; bool ok = false;
value = QVariant(inStr).toDouble(&ok); value = QVariant(inStr).toDouble(&ok);
return ok; return ok;
} }
bool bool fromStringValue(const QString &inStr, OAIObject &value)
fromStringValue(const QString &inStr, OAIObject &value)
{ {
QJsonParseError err; QJsonParseError err;
QJsonDocument::fromJson(inStr.toUtf8(),&err); QJsonDocument::fromJson(inStr.toUtf8(),&err);
@ -243,26 +198,23 @@ fromStringValue(const QString &inStr, OAIObject &value)
return false; return false;
} }
bool bool fromStringValue(const QString &inStr, OAIEnum &value) {
fromStringValue(const QString &inStr, OAIEnum &value){
value.fromJson(inStr); value.fromJson(inStr);
return true; return true;
} }
bool bool fromStringValue(const QString &inStr, OAIHttpFileElement &value) {
fromStringValue(const QString &inStr, OAIHttpFileElement &value){
return value.fromStringValue(inStr); return value.fromStringValue(inStr);
} }
bool bool fromJsonValue(QString &value, const QJsonValue &jval) {
fromJsonValue(QString &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(!jval.isUndefined() && !jval.isNull()){ if (!jval.isUndefined() && !jval.isNull()) {
if(jval.isString()){ if (jval.isString()) {
value = jval.toString(); value = jval.toString();
} else if(jval.isBool()) { } else if (jval.isBool()) {
value = jval.toBool() ? "true" : "false"; value = jval.toBool() ? "true" : "false";
} else if(jval.isDouble()){ } else if (jval.isDouble()) {
value = QString::number(jval.toDouble()); value = QString::number(jval.toDouble());
} else { } else {
ok = false; ok = false;
@ -273,10 +225,9 @@ fromJsonValue(QString &value, const QJsonValue &jval){
return ok; return ok;
} }
bool bool fromJsonValue(QDateTime &value, const QJsonValue &jval) {
fromJsonValue(QDateTime &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(!jval.isUndefined() && !jval.isNull() && jval.isString()){ if (!jval.isUndefined() && !jval.isNull() && jval.isString()) {
value = QDateTime::fromString(jval.toString(), Qt::ISODate); value = QDateTime::fromString(jval.toString(), Qt::ISODate);
ok = value.isValid(); ok = value.isValid();
} else { } else {
@ -285,22 +236,20 @@ fromJsonValue(QDateTime &value, const QJsonValue &jval){
return ok; return ok;
} }
bool bool fromJsonValue(QByteArray &value, const QJsonValue &jval) {
fromJsonValue(QByteArray &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(!jval.isUndefined() && !jval.isNull() && jval.isString()) { if (!jval.isUndefined() && !jval.isNull() && jval.isString()) {
value = QByteArray::fromBase64(QByteArray::fromStdString(jval.toString().toStdString())); value = QByteArray::fromBase64(QByteArray::fromStdString(jval.toString().toStdString()));
ok = value.size() > 0 ; ok = value.size() > 0;
} else { } else {
ok = false; ok = false;
} }
return ok; return ok;
} }
bool bool fromJsonValue(QDate &value, const QJsonValue &jval) {
fromJsonValue(QDate &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(!jval.isUndefined() && !jval.isNull() && jval.isString()){ if (!jval.isUndefined() && !jval.isNull() && jval.isString()) {
value = QDate::fromString(jval.toString(), Qt::ISODate); value = QDate::fromString(jval.toString(), Qt::ISODate);
ok = value.isValid(); ok = value.isValid();
} else { } else {
@ -309,10 +258,9 @@ fromJsonValue(QDate &value, const QJsonValue &jval){
return ok; return ok;
} }
bool bool fromJsonValue(qint32 &value, const QJsonValue &jval) {
fromJsonValue(qint32 &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()){ if (!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()) {
value = jval.toInt(); value = jval.toInt();
} else { } else {
ok = false; ok = false;
@ -320,10 +268,9 @@ fromJsonValue(qint32 &value, const QJsonValue &jval){
return ok; return ok;
} }
bool bool fromJsonValue(qint64 &value, const QJsonValue &jval) {
fromJsonValue(qint64 &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()){ if (!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()) {
value = jval.toVariant().toLongLong(); value = jval.toVariant().toLongLong();
} else { } else {
ok = false; ok = false;
@ -331,10 +278,9 @@ fromJsonValue(qint64 &value, const QJsonValue &jval){
return ok; return ok;
} }
bool bool fromJsonValue(bool &value, const QJsonValue &jval) {
fromJsonValue(bool &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(jval.isBool()){ if (jval.isBool()) {
value = jval.toBool(); value = jval.toBool();
} else { } else {
ok = false; ok = false;
@ -342,10 +288,9 @@ fromJsonValue(bool &value, const QJsonValue &jval){
return ok; return ok;
} }
bool bool fromJsonValue(float &value, const QJsonValue &jval) {
fromJsonValue(float &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(jval.isDouble()){ if (jval.isDouble()) {
value = static_cast<float>(jval.toDouble()); value = static_cast<float>(jval.toDouble());
} else { } else {
ok = false; ok = false;
@ -353,10 +298,9 @@ fromJsonValue(float &value, const QJsonValue &jval){
return ok; return ok;
} }
bool bool fromJsonValue(double &value, const QJsonValue &jval) {
fromJsonValue(double &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(jval.isDouble()){ if (jval.isDouble()) {
value = jval.toDouble(); value = jval.toDouble();
} else { } else {
ok = false; ok = false;
@ -364,10 +308,9 @@ fromJsonValue(double &value, const QJsonValue &jval){
return ok; return ok;
} }
bool bool fromJsonValue(OAIObject &value, const QJsonValue &jval) {
fromJsonValue(OAIObject &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(jval.isObject()){ if (jval.isObject()) {
value.fromJsonObject(jval.toObject()); value.fromJsonObject(jval.toObject());
ok = value.isValid(); ok = value.isValid();
} else { } else {
@ -376,15 +319,13 @@ fromJsonValue(OAIObject &value, const QJsonValue &jval){
return ok; return ok;
} }
bool bool fromJsonValue(OAIEnum &value, const QJsonValue &jval) {
fromJsonValue(OAIEnum &value, const QJsonValue &jval){
value.fromJsonValue(jval); value.fromJsonValue(jval);
return true; return true;
} }
bool bool fromJsonValue(OAIHttpFileElement &value, const QJsonValue &jval) {
fromJsonValue(OAIHttpFileElement &value, const QJsonValue &jval){
return value.fromJsonValue(jval); return value.fromJsonValue(jval);
} }
} } // namespace OpenAPI

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
@ -13,159 +12,180 @@
#ifndef OAI_HELPERS_H #ifndef OAI_HELPERS_H
#define OAI_HELPERS_H #define OAI_HELPERS_H
#include <QJsonObject>
#include <QJsonValue>
#include <QJsonArray>
#include <QList>
#include <QMap>
#include <QDateTime>
#include <QByteArray> #include <QByteArray>
#include <QDate> #include <QDate>
#include <QDateTime>
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QMap>
#include <QVariant> #include <QVariant>
#include "OAIObject.h"
#include "OAIEnum.h" #include "OAIEnum.h"
#include "OAIHttpFileElement.h" #include "OAIHttpFileElement.h"
#include "OAIObject.h"
namespace OpenAPI { namespace OpenAPI {
QString toStringValue(const QString &value); template <typename T>
QString toStringValue(const QDateTime &value); QString toStringValue(const QList<T> &val);
QString toStringValue(const QByteArray &value);
QString toStringValue(const QDate &value);
QString toStringValue(const qint32 &value);
QString toStringValue(const qint64 &value);
QString toStringValue(const bool &value);
QString toStringValue(const float &value);
QString toStringValue(const double &value);
QString toStringValue(const OAIObject &value);
QString toStringValue(const OAIEnum &value);
QString toStringValue(const OAIHttpFileElement &value);
template <typename T> template <typename T>
QString toStringValue(const QList<T> &val) { bool fromStringValue(const QList<QString> &inStr, QList<T> &val);
QString strArray;
for(const auto& item : val) { template <typename T>
strArray.append(toStringValue(item) + ","); bool fromStringValue(const QMap<QString, QString> &inStr, QMap<QString, T> &val);
}
if(val.count() > 0) { template <typename T>
strArray.chop(1); QJsonValue toJsonValue(const QList<T> &val);
}
return strArray; 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);
QString toStringValue(const QDate &value);
QString toStringValue(const qint32 &value);
QString toStringValue(const qint64 &value);
QString toStringValue(const bool &value);
QString toStringValue(const float &value);
QString toStringValue(const double &value);
QString toStringValue(const OAIObject &value);
QString toStringValue(const OAIEnum &value);
QString toStringValue(const OAIHttpFileElement &value);
template <typename T>
QString toStringValue(const QList<T> &val) {
QString strArray;
for (const auto &item : val) {
strArray.append(toStringValue(item) + ",");
} }
if (val.count() > 0) {
QJsonValue toJsonValue(const QString &value); strArray.chop(1);
QJsonValue toJsonValue(const QDateTime &value);
QJsonValue toJsonValue(const QByteArray &value);
QJsonValue toJsonValue(const QDate &value);
QJsonValue toJsonValue(const qint32 &value);
QJsonValue toJsonValue(const qint64 &value);
QJsonValue toJsonValue(const bool &value);
QJsonValue toJsonValue(const float &value);
QJsonValue toJsonValue(const double &value);
QJsonValue toJsonValue(const OAIObject &value);
QJsonValue toJsonValue(const OAIEnum &value);
QJsonValue toJsonValue(const OAIHttpFileElement &value);
template <typename T>
QJsonValue toJsonValue(const QList<T> &val) {
QJsonArray jArray;
for(const auto& item : val) {
jArray.append(toJsonValue(item));
}
return jArray;
} }
return strArray;
template <typename T>
QJsonValue toJsonValue(const QMap<QString, T> &val) {
QJsonObject jObject;
for(const auto& itemkey : val.keys()) {
jObject.insert(itemkey, toJsonValue(val.value(itemkey)));
}
return jObject;
}
bool fromStringValue(const QString &inStr, QString &value);
bool fromStringValue(const QString &inStr, QDateTime &value);
bool fromStringValue(const QString &inStr, QByteArray &value);
bool fromStringValue(const QString &inStr, QDate &value);
bool fromStringValue(const QString &inStr, qint32 &value);
bool fromStringValue(const QString &inStr, qint64 &value);
bool fromStringValue(const QString &inStr, bool &value);
bool fromStringValue(const QString &inStr, float &value);
bool fromStringValue(const QString &inStr, double &value);
bool fromStringValue(const QString &inStr, OAIObject &value);
bool fromStringValue(const QString &inStr, OAIEnum &value);
bool fromStringValue(const QString &inStr, OAIHttpFileElement &value);
template <typename T>
bool fromStringValue(const QList<QString> &inStr, QList<T> &val) {
bool ok = (inStr.count() > 0);
for(const auto& item: inStr){
T itemVal;
ok &= fromStringValue(item, itemVal);
val.push_back(itemVal);
}
return ok;
}
template <typename T>
bool fromStringValue(const QMap<QString, QString> &inStr, QMap<QString, T> &val) {
bool ok = (inStr.count() > 0);
for(const auto& itemkey : inStr.keys()){
T itemVal;
ok &= fromStringValue(inStr.value(itemkey), itemVal);
val.insert(itemkey, itemVal);
}
return ok;
}
bool fromJsonValue(QString &value, const QJsonValue &jval);
bool fromJsonValue(QDateTime &value, const QJsonValue &jval);
bool fromJsonValue(QByteArray &value, const QJsonValue &jval);
bool fromJsonValue(QDate &value, const QJsonValue &jval);
bool fromJsonValue(qint32 &value, const QJsonValue &jval);
bool fromJsonValue(qint64 &value, const QJsonValue &jval);
bool fromJsonValue(bool &value, const QJsonValue &jval);
bool fromJsonValue(float &value, const QJsonValue &jval);
bool fromJsonValue(double &value, const QJsonValue &jval);
bool fromJsonValue(OAIObject &value, const QJsonValue &jval);
bool fromJsonValue(OAIEnum &value, const QJsonValue &jval);
bool fromJsonValue(OAIHttpFileElement &value, const QJsonValue &jval);
template <typename T>
bool fromJsonValue(QList<T> &val, const QJsonValue &jval) {
bool ok = true;
if(jval.isArray()){
for(const auto& jitem : jval.toArray()){
T item;
ok &= fromJsonValue(item, jitem);
val.push_back(item);
}
} else {
ok = false;
}
return ok;
}
template <typename T>
bool fromJsonValue(QMap<QString, T> &val, const QJsonValue &jval) {
bool ok = true;
if(jval.isObject()){
auto varmap = jval.toObject().toVariantMap();
if(varmap.count() > 0){
for(const auto& itemkey : varmap.keys() ){
T itemVal;
ok &= fromJsonValue(itemVal, QJsonValue::fromVariant(varmap.value(itemkey)));
val.insert(itemkey, itemVal);
}
}
} else {
ok = false;
}
return ok;
}
} }
QJsonValue toJsonValue(const QString &value);
QJsonValue toJsonValue(const QDateTime &value);
QJsonValue toJsonValue(const QByteArray &value);
QJsonValue toJsonValue(const QDate &value);
QJsonValue toJsonValue(const qint32 &value);
QJsonValue toJsonValue(const qint64 &value);
QJsonValue toJsonValue(const bool &value);
QJsonValue toJsonValue(const float &value);
QJsonValue toJsonValue(const double &value);
QJsonValue toJsonValue(const OAIObject &value);
QJsonValue toJsonValue(const OAIEnum &value);
QJsonValue toJsonValue(const OAIHttpFileElement &value);
template <typename T>
QJsonValue toJsonValue(const QList<T> &val) {
QJsonArray jArray;
for (const auto &item : val) {
jArray.append(toJsonValue(item));
}
return jArray;
}
template <typename T>
QJsonValue toJsonValue(const QMap<QString, T> &val) {
QJsonObject jObject;
for (const auto &itemkey : val.keys()) {
jObject.insert(itemkey, toJsonValue(val.value(itemkey)));
}
return jObject;
}
bool fromStringValue(const QString &inStr, QString &value);
bool fromStringValue(const QString &inStr, QDateTime &value);
bool fromStringValue(const QString &inStr, QByteArray &value);
bool fromStringValue(const QString &inStr, QDate &value);
bool fromStringValue(const QString &inStr, qint32 &value);
bool fromStringValue(const QString &inStr, qint64 &value);
bool fromStringValue(const QString &inStr, bool &value);
bool fromStringValue(const QString &inStr, float &value);
bool fromStringValue(const QString &inStr, double &value);
bool fromStringValue(const QString &inStr, OAIObject &value);
bool fromStringValue(const QString &inStr, OAIEnum &value);
bool fromStringValue(const QString &inStr, OAIHttpFileElement &value);
template <typename T>
bool fromStringValue(const QList<QString> &inStr, QList<T> &val) {
bool ok = (inStr.count() > 0);
for (const auto &item : inStr) {
T itemVal;
ok &= fromStringValue(item, itemVal);
val.push_back(itemVal);
}
return ok;
}
template <typename T>
bool fromStringValue(const QMap<QString, QString> &inStr, QMap<QString, T> &val) {
bool ok = (inStr.count() > 0);
for (const auto &itemkey : inStr.keys()) {
T itemVal;
ok &= fromStringValue(inStr.value(itemkey), itemVal);
val.insert(itemkey, itemVal);
}
return ok;
}
bool fromJsonValue(QString &value, const QJsonValue &jval);
bool fromJsonValue(QDateTime &value, const QJsonValue &jval);
bool fromJsonValue(QByteArray &value, const QJsonValue &jval);
bool fromJsonValue(QDate &value, const QJsonValue &jval);
bool fromJsonValue(qint32 &value, const QJsonValue &jval);
bool fromJsonValue(qint64 &value, const QJsonValue &jval);
bool fromJsonValue(bool &value, const QJsonValue &jval);
bool fromJsonValue(float &value, const QJsonValue &jval);
bool fromJsonValue(double &value, const QJsonValue &jval);
bool fromJsonValue(OAIObject &value, const QJsonValue &jval);
bool fromJsonValue(OAIEnum &value, const QJsonValue &jval);
bool fromJsonValue(OAIHttpFileElement &value, const QJsonValue &jval);
template <typename T>
bool fromJsonValue(QList<T> &val, const QJsonValue &jval) {
bool ok = true;
if (jval.isArray()) {
for (const auto jitem : jval.toArray()) {
T item;
ok &= fromJsonValue(item, jitem);
val.push_back(item);
}
} else {
ok = false;
}
return ok;
}
template <typename T>
bool fromJsonValue(QMap<QString, T> &val, const QJsonValue &jval) {
bool ok = true;
if (jval.isObject()) {
auto varmap = jval.toObject().toVariantMap();
if (varmap.count() > 0) {
for (const auto &itemkey : varmap.keys()) {
T itemVal;
ok &= fromJsonValue(itemVal, QJsonValue::fromVariant(varmap.value(itemkey)));
val.insert(itemkey, itemVal);
}
}
} else {
ok = false;
}
return ok;
}
} // namespace OpenAPI
#endif // OAI_HELPERS_H #endif // OAI_HELPERS_H

View File

@ -3,14 +3,12 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.
*/ */
#include <QDebug> #include <QDebug>
#include <QFile> #include <QFile>
#include <QJsonDocument> #include <QJsonDocument>
@ -20,129 +18,117 @@
namespace OpenAPI { namespace OpenAPI {
void void OAIHttpFileElement::setMimeType(const QString &mime) {
OAIHttpFileElement::setMimeType(const QString &mime){
mime_type = mime; mime_type = mime;
} }
void void OAIHttpFileElement::setFileName(const QString &name) {
OAIHttpFileElement::setFileName(const QString &name){
local_filename = name; local_filename = name;
} }
void void OAIHttpFileElement::setVariableName(const QString &name) {
OAIHttpFileElement::setVariableName(const QString &name){
variable_name = name; variable_name = name;
} }
void void OAIHttpFileElement::setRequestFileName(const QString &name) {
OAIHttpFileElement::setRequestFileName(const QString &name){
request_filename = name; request_filename = name;
} }
bool bool OAIHttpFileElement::isSet() const {
OAIHttpFileElement::isSet() const {
return !local_filename.isEmpty() || !request_filename.isEmpty(); return !local_filename.isEmpty() || !request_filename.isEmpty();
} }
QString QString OAIHttpFileElement::asJson() const {
OAIHttpFileElement::asJson() const{
QFile file(local_filename); QFile file(local_filename);
QByteArray bArray; QByteArray bArray;
bool result = false; bool result = false;
if(file.exists()) { if (file.exists()) {
result = file.open(QIODevice::ReadOnly); result = file.open(QIODevice::ReadOnly);
bArray = file.readAll(); bArray = file.readAll();
file.close(); file.close();
} }
if(!result) { if (!result) {
qDebug() << "Error opening file " << local_filename; qDebug() << "Error opening file " << local_filename;
} }
return QString(bArray); return QString(bArray);
} }
QJsonValue QJsonValue OAIHttpFileElement::asJsonValue() const {
OAIHttpFileElement::asJsonValue() const{
QFile file(local_filename); QFile file(local_filename);
QByteArray bArray; QByteArray bArray;
bool result = false; bool result = false;
if(file.exists()) { if (file.exists()) {
result = file.open(QIODevice::ReadOnly); result = file.open(QIODevice::ReadOnly);
bArray = file.readAll(); bArray = file.readAll();
file.close(); file.close();
} }
if(!result) { if (!result) {
qDebug() << "Error opening file " << local_filename; qDebug() << "Error opening file " << local_filename;
} }
return QJsonDocument::fromBinaryData(bArray.data()).object(); return QJsonDocument::fromBinaryData(bArray.data()).object();
} }
bool bool OAIHttpFileElement::fromStringValue(const QString &instr) {
OAIHttpFileElement::fromStringValue(const QString &instr){
QFile file(local_filename); QFile file(local_filename);
bool result = false; bool result = false;
if(file.exists()) { if (file.exists()) {
file.remove(); file.remove();
} }
result = file.open(QIODevice::WriteOnly); result = file.open(QIODevice::WriteOnly);
file.write(instr.toUtf8()); file.write(instr.toUtf8());
file.close(); file.close();
if(!result) { if (!result) {
qDebug() << "Error creating file " << local_filename; qDebug() << "Error creating file " << local_filename;
} }
return result; return result;
} }
bool bool OAIHttpFileElement::fromJsonValue(const QJsonValue &jval) {
OAIHttpFileElement::fromJsonValue(const QJsonValue &jval) {
QFile file(local_filename); QFile file(local_filename);
bool result = false; bool result = false;
if(file.exists()) { if (file.exists()) {
file.remove(); file.remove();
} }
result = file.open(QIODevice::WriteOnly); result = file.open(QIODevice::WriteOnly);
file.write(QJsonDocument(jval.toObject()).toBinaryData()); file.write(QJsonDocument(jval.toObject()).toBinaryData());
file.close(); file.close();
if(!result) { if (!result) {
qDebug() << "Error creating file " << local_filename; qDebug() << "Error creating file " << local_filename;
} }
return result; return result;
} }
QByteArray QByteArray OAIHttpFileElement::asByteArray() const {
OAIHttpFileElement::asByteArray() const {
QFile file(local_filename); QFile file(local_filename);
QByteArray bArray; QByteArray bArray;
bool result = false; bool result = false;
if(file.exists()) { if (file.exists()) {
result = file.open(QIODevice::ReadOnly); result = file.open(QIODevice::ReadOnly);
bArray = file.readAll(); bArray = file.readAll();
file.close(); file.close();
} }
if(!result) { if (!result) {
qDebug() << "Error opening file " << local_filename; qDebug() << "Error opening file " << local_filename;
} }
return bArray; return bArray;
} }
bool bool OAIHttpFileElement::fromByteArray(const QByteArray &bytes) {
OAIHttpFileElement::fromByteArray(const QByteArray& bytes){
QFile file(local_filename); QFile file(local_filename);
bool result = false; bool result = false;
if(file.exists()){ if (file.exists()) {
file.remove(); file.remove();
} }
result = file.open(QIODevice::WriteOnly); result = file.open(QIODevice::WriteOnly);
file.write(bytes); file.write(bytes);
file.close(); file.close();
if(!result) { if (!result) {
qDebug() << "Error creating file " << local_filename; qDebug() << "Error creating file " << local_filename;
} }
return result; return result;
} }
bool bool OAIHttpFileElement::saveToFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime, const QByteArray &bytes) {
OAIHttpFileElement::saveToFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime, const QByteArray& bytes){
setMimeType(mime); setMimeType(mime);
setFileName(localFName); setFileName(localFName);
setVariableName(varName); setVariableName(varName);
@ -150,8 +136,7 @@ OAIHttpFileElement::saveToFile(const QString &varName, const QString &localFName
return fromByteArray(bytes); return fromByteArray(bytes);
} }
QByteArray QByteArray OAIHttpFileElement::loadFromFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime) {
OAIHttpFileElement::loadFromFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime){
setMimeType(mime); setMimeType(mime);
setFileName(localFName); setFileName(localFName);
setVariableName(varName); setVariableName(varName);
@ -159,4 +144,4 @@ OAIHttpFileElement::loadFromFile(const QString &varName, const QString &localFNa
return asByteArray(); return asByteArray();
} }
} } // namespace OpenAPI

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
@ -17,7 +16,6 @@
#include <QMetaType> #include <QMetaType>
#include <QString> #include <QString>
namespace OpenAPI { namespace OpenAPI {
class OAIHttpFileElement { class OAIHttpFileElement {
@ -34,15 +32,15 @@ public:
bool isSet() const; bool isSet() const;
bool fromStringValue(const QString &instr); bool fromStringValue(const QString &instr);
bool fromJsonValue(const QJsonValue &jval); bool fromJsonValue(const QJsonValue &jval);
bool fromByteArray(const QByteArray& bytes); bool fromByteArray(const QByteArray &bytes);
bool saveToFile(const QString &variable_name, const QString &local_filename, const QString &request_filename, const QString &mime, const QByteArray& bytes); bool saveToFile(const QString &variable_name, const QString &local_filename, const QString &request_filename, const QString &mime, const QByteArray &bytes);
QString asJson() const; QString asJson() const;
QJsonValue asJsonValue() const; QJsonValue asJsonValue() const;
QByteArray asByteArray() const; QByteArray asByteArray() const;
QByteArray loadFromFile(const QString &variable_name, const QString &local_filename, const QString &request_filename, const QString &mime); QByteArray loadFromFile(const QString &variable_name, const QString &local_filename, const QString &request_filename, const QString &mime);
}; };
} } // namespace OpenAPI
Q_DECLARE_METATYPE(OpenAPI::OAIHttpFileElement) Q_DECLARE_METATYPE(OpenAPI::OAIHttpFileElement)

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
@ -13,25 +12,21 @@
#ifndef OAI_OBJECT_H #ifndef OAI_OBJECT_H
#define OAI_OBJECT_H #define OAI_OBJECT_H
#include <QJsonObject>
#include <QJsonDocument> #include <QJsonDocument>
#include <QJsonObject>
#include <QMetaType> #include <QMetaType>
namespace OpenAPI { namespace OpenAPI {
class OAIObject { class OAIObject {
public: public:
OAIObject() { OAIObject() {}
}
OAIObject(QString jsonString) { OAIObject(QString jsonString) {
fromJson(jsonString); fromJson(jsonString);
} }
virtual ~OAIObject(){ virtual ~OAIObject() {}
}
virtual QJsonObject asJsonObject() const { virtual QJsonObject asJsonObject() const {
return jObj; return jObj;
@ -58,11 +53,12 @@ class OAIObject {
virtual bool isValid() const { virtual bool isValid() const {
return true; return true;
} }
private :
private:
QJsonObject jObj; QJsonObject jObj;
}; };
} } // namespace OpenAPI
Q_DECLARE_METATYPE(OpenAPI::OAIObject) Q_DECLARE_METATYPE(OpenAPI::OAIObject)

View File

@ -3,213 +3,200 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.
*/ */
#include "OAIOrder.h" #include "OAIOrder.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug> #include <QDebug>
#include <QJsonArray>
#include <QJsonDocument>
#include <QObject>
#include "OAIHelpers.h" #include "OAIHelpers.h"
namespace OpenAPI { namespace OpenAPI {
OAIOrder::OAIOrder(QString json) { OAIOrder::OAIOrder(QString json) {
this->init(); this->initializeModel();
this->fromJson(json); this->fromJson(json);
} }
OAIOrder::OAIOrder() { OAIOrder::OAIOrder() {
this->init(); this->initializeModel();
} }
OAIOrder::~OAIOrder() { OAIOrder::~OAIOrder() {}
} void OAIOrder::initializeModel() {
void
OAIOrder::init() {
m_id_isSet = false; m_id_isSet = false;
m_id_isValid = false; m_id_isValid = false;
m_pet_id_isSet = false; m_pet_id_isSet = false;
m_pet_id_isValid = false; m_pet_id_isValid = false;
m_quantity_isSet = false; m_quantity_isSet = false;
m_quantity_isValid = false; m_quantity_isValid = false;
m_ship_date_isSet = false; m_ship_date_isSet = false;
m_ship_date_isValid = false; m_ship_date_isValid = false;
m_status_isSet = false; m_status_isSet = false;
m_status_isValid = false; m_status_isValid = false;
m_complete_isSet = false; m_complete_isSet = false;
m_complete_isValid = false; m_complete_isValid = false;
} }
void void OAIOrder::fromJson(QString jsonString) {
OAIOrder::fromJson(QString jsonString) { QByteArray array(jsonString.toStdString().c_str());
QByteArray array (jsonString.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array); QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object(); QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject); this->fromJsonObject(jsonObject);
} }
void void OAIOrder::fromJsonObject(QJsonObject json) {
OAIOrder::fromJsonObject(QJsonObject json) {
m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); 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_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_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_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_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_isValid = ::OpenAPI::fromJsonValue(complete, json[QString("complete")]);
m_complete_isSet = !json[QString("complete")].isNull() && m_complete_isValid;
} }
QString QString OAIOrder::asJson() const {
OAIOrder::asJson () const {
QJsonObject obj = this->asJsonObject(); QJsonObject obj = this->asJsonObject();
QJsonDocument doc(obj); QJsonDocument doc(obj);
QByteArray bytes = doc.toJson(); QByteArray bytes = doc.toJson();
return QString(bytes); return QString(bytes);
} }
QJsonObject QJsonObject OAIOrder::asJsonObject() const {
OAIOrder::asJsonObject() const {
QJsonObject obj; QJsonObject obj;
if(m_id_isSet){ if (m_id_isSet) {
obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); obj.insert(QString("id"), ::OpenAPI::toJsonValue(id));
} }
if(m_pet_id_isSet){ if (m_pet_id_isSet) {
obj.insert(QString("petId"), ::OpenAPI::toJsonValue(pet_id)); obj.insert(QString("petId"), ::OpenAPI::toJsonValue(pet_id));
} }
if(m_quantity_isSet){ if (m_quantity_isSet) {
obj.insert(QString("quantity"), ::OpenAPI::toJsonValue(quantity)); obj.insert(QString("quantity"), ::OpenAPI::toJsonValue(quantity));
} }
if(m_ship_date_isSet){ if (m_ship_date_isSet) {
obj.insert(QString("shipDate"), ::OpenAPI::toJsonValue(ship_date)); obj.insert(QString("shipDate"), ::OpenAPI::toJsonValue(ship_date));
} }
if(m_status_isSet){ if (m_status_isSet) {
obj.insert(QString("status"), ::OpenAPI::toJsonValue(status)); obj.insert(QString("status"), ::OpenAPI::toJsonValue(status));
} }
if(m_complete_isSet){ if (m_complete_isSet) {
obj.insert(QString("complete"), ::OpenAPI::toJsonValue(complete)); obj.insert(QString("complete"), ::OpenAPI::toJsonValue(complete));
} }
return obj; return obj;
} }
qint64 OAIOrder::getId() const {
qint64
OAIOrder::getId() const {
return id; return id;
} }
void void OAIOrder::setId(const qint64 &id) {
OAIOrder::setId(const qint64 &id) {
this->id = id; this->id = id;
this->m_id_isSet = true; this->m_id_isSet = true;
} }
qint64 OAIOrder::getPetId() const {
qint64
OAIOrder::getPetId() const {
return pet_id; return pet_id;
} }
void void OAIOrder::setPetId(const qint64 &pet_id) {
OAIOrder::setPetId(const qint64 &pet_id) {
this->pet_id = pet_id; this->pet_id = pet_id;
this->m_pet_id_isSet = true; this->m_pet_id_isSet = true;
} }
qint32 OAIOrder::getQuantity() const {
qint32
OAIOrder::getQuantity() const {
return quantity; return quantity;
} }
void void OAIOrder::setQuantity(const qint32 &quantity) {
OAIOrder::setQuantity(const qint32 &quantity) {
this->quantity = quantity; this->quantity = quantity;
this->m_quantity_isSet = true; this->m_quantity_isSet = true;
} }
QDateTime OAIOrder::getShipDate() const {
QDateTime
OAIOrder::getShipDate() const {
return ship_date; return ship_date;
} }
void void OAIOrder::setShipDate(const QDateTime &ship_date) {
OAIOrder::setShipDate(const QDateTime &ship_date) {
this->ship_date = ship_date; this->ship_date = ship_date;
this->m_ship_date_isSet = true; this->m_ship_date_isSet = true;
} }
QString OAIOrder::getStatus() const {
QString
OAIOrder::getStatus() const {
return status; return status;
} }
void void OAIOrder::setStatus(const QString &status) {
OAIOrder::setStatus(const QString &status) {
this->status = status; this->status = status;
this->m_status_isSet = true; this->m_status_isSet = true;
} }
bool OAIOrder::isComplete() const {
bool
OAIOrder::isComplete() const {
return complete; return complete;
} }
void void OAIOrder::setComplete(const bool &complete) {
OAIOrder::setComplete(const bool &complete) {
this->complete = complete; this->complete = complete;
this->m_complete_isSet = true; this->m_complete_isSet = true;
} }
bool bool OAIOrder::isSet() const {
OAIOrder::isSet() const {
bool isObjectUpdated = false; bool isObjectUpdated = false;
do{ do {
if(m_id_isSet){ isObjectUpdated = true; break;} if (m_id_isSet) {
isObjectUpdated = true;
if(m_pet_id_isSet){ isObjectUpdated = true; break;} break;
}
if(m_quantity_isSet){ isObjectUpdated = true; break;}
if (m_pet_id_isSet) {
if(m_ship_date_isSet){ isObjectUpdated = true; break;} isObjectUpdated = true;
break;
if(m_status_isSet){ isObjectUpdated = true; break;} }
if(m_complete_isSet){ isObjectUpdated = true; break;} if (m_quantity_isSet) {
}while(false); isObjectUpdated = true;
break;
}
if (m_ship_date_isSet) {
isObjectUpdated = true;
break;
}
if (m_status_isSet) {
isObjectUpdated = true;
break;
}
if (m_complete_isSet) {
isObjectUpdated = true;
break;
}
} while (false);
return isObjectUpdated; return isObjectUpdated;
} }
bool bool OAIOrder::isValid() const {
OAIOrder::isValid() const {
// only required properties are required for the object to be considered valid // only required properties are required for the object to be considered valid
return true; return true;
} }
} } // namespace OpenAPI

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
@ -21,86 +20,75 @@
#include <QJsonObject> #include <QJsonObject>
#include <QDateTime> #include <QDateTime>
#include <QString> #include <QString>
#include "OAIObject.h"
#include "OAIEnum.h" #include "OAIEnum.h"
#include "OAIObject.h"
namespace OpenAPI { namespace OpenAPI {
class OAIOrder: public OAIObject { class OAIOrder : public OAIObject {
public: public:
OAIOrder(); OAIOrder();
OAIOrder(QString json); OAIOrder(QString json);
~OAIOrder() override; ~OAIOrder() override;
QString asJson () const override; QString asJson() const override;
QJsonObject asJsonObject() const override; QJsonObject asJsonObject() const override;
void fromJsonObject(QJsonObject json) override; void fromJsonObject(QJsonObject json) override;
void fromJson(QString jsonString) override; void fromJson(QString jsonString) override;
qint64 getId() const; qint64 getId() const;
void setId(const qint64 &id); void setId(const qint64 &id);
qint64 getPetId() const; qint64 getPetId() const;
void setPetId(const qint64 &pet_id); void setPetId(const qint64 &pet_id);
qint32 getQuantity() const; qint32 getQuantity() const;
void setQuantity(const qint32 &quantity); void setQuantity(const qint32 &quantity);
QDateTime getShipDate() const; QDateTime getShipDate() const;
void setShipDate(const QDateTime &ship_date); void setShipDate(const QDateTime &ship_date);
QString getStatus() const; QString getStatus() const;
void setStatus(const QString &status); void setStatus(const QString &status);
bool isComplete() const; bool isComplete() const;
void setComplete(const bool &complete); void setComplete(const bool &complete);
virtual bool isSet() const override; virtual bool isSet() const override;
virtual bool isValid() const override; virtual bool isValid() const override;
private: private:
void init(); void initializeModel();
qint64 id; qint64 id;
bool m_id_isSet; bool m_id_isSet;
bool m_id_isValid; bool m_id_isValid;
qint64 pet_id; qint64 pet_id;
bool m_pet_id_isSet; bool m_pet_id_isSet;
bool m_pet_id_isValid; bool m_pet_id_isValid;
qint32 quantity; qint32 quantity;
bool m_quantity_isSet; bool m_quantity_isSet;
bool m_quantity_isValid; bool m_quantity_isValid;
QDateTime ship_date; QDateTime ship_date;
bool m_ship_date_isSet; bool m_ship_date_isSet;
bool m_ship_date_isValid; bool m_ship_date_isValid;
QString status; QString status;
bool m_status_isSet; bool m_status_isSet;
bool m_status_isValid; bool m_status_isValid;
bool complete; bool complete;
bool m_complete_isSet; bool m_complete_isSet;
bool m_complete_isValid; bool m_complete_isValid;
};
};
} } // namespace OpenAPI
Q_DECLARE_METATYPE(OpenAPI::OAIOrder) Q_DECLARE_METATYPE(OpenAPI::OAIOrder)

View File

@ -3,215 +3,200 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.
*/ */
#include "OAIPet.h" #include "OAIPet.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug> #include <QDebug>
#include <QJsonArray>
#include <QJsonDocument>
#include <QObject>
#include "OAIHelpers.h" #include "OAIHelpers.h"
namespace OpenAPI { namespace OpenAPI {
OAIPet::OAIPet(QString json) { OAIPet::OAIPet(QString json) {
this->init(); this->initializeModel();
this->fromJson(json); this->fromJson(json);
} }
OAIPet::OAIPet() { OAIPet::OAIPet() {
this->init(); this->initializeModel();
} }
OAIPet::~OAIPet() { OAIPet::~OAIPet() {}
} void OAIPet::initializeModel() {
void
OAIPet::init() {
m_id_isSet = false; m_id_isSet = false;
m_id_isValid = false; m_id_isValid = false;
m_category_isSet = false; m_category_isSet = false;
m_category_isValid = false; m_category_isValid = false;
m_name_isSet = false; m_name_isSet = false;
m_name_isValid = false; m_name_isValid = false;
m_photo_urls_isSet = false; m_photo_urls_isSet = false;
m_photo_urls_isValid = false; m_photo_urls_isValid = false;
m_tags_isSet = false; m_tags_isSet = false;
m_tags_isValid = false; m_tags_isValid = false;
m_status_isSet = false; m_status_isSet = false;
m_status_isValid = false; m_status_isValid = false;
} }
void void OAIPet::fromJson(QString jsonString) {
OAIPet::fromJson(QString jsonString) { QByteArray array(jsonString.toStdString().c_str());
QByteArray array (jsonString.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array); QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object(); QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject); this->fromJsonObject(jsonObject);
} }
void void OAIPet::fromJsonObject(QJsonObject json) {
OAIPet::fromJsonObject(QJsonObject json) {
m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); 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_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_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_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_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_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]);
m_status_isSet = !json[QString("status")].isNull() && m_status_isValid;
} }
QString QString OAIPet::asJson() const {
OAIPet::asJson () const {
QJsonObject obj = this->asJsonObject(); QJsonObject obj = this->asJsonObject();
QJsonDocument doc(obj); QJsonDocument doc(obj);
QByteArray bytes = doc.toJson(); QByteArray bytes = doc.toJson();
return QString(bytes); return QString(bytes);
} }
QJsonObject QJsonObject OAIPet::asJsonObject() const {
OAIPet::asJsonObject() const {
QJsonObject obj; QJsonObject obj;
if(m_id_isSet){ if (m_id_isSet) {
obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); obj.insert(QString("id"), ::OpenAPI::toJsonValue(id));
} }
if(category.isSet()){ if (category.isSet()) {
obj.insert(QString("category"), ::OpenAPI::toJsonValue(category)); obj.insert(QString("category"), ::OpenAPI::toJsonValue(category));
} }
if(m_name_isSet){ if (m_name_isSet) {
obj.insert(QString("name"), ::OpenAPI::toJsonValue(name)); obj.insert(QString("name"), ::OpenAPI::toJsonValue(name));
} }
if (photo_urls.size() > 0) {
if(photo_urls.size() > 0){
obj.insert(QString("photoUrls"), ::OpenAPI::toJsonValue(photo_urls)); obj.insert(QString("photoUrls"), ::OpenAPI::toJsonValue(photo_urls));
} }
if (tags.size() > 0) {
if(tags.size() > 0){
obj.insert(QString("tags"), ::OpenAPI::toJsonValue(tags)); obj.insert(QString("tags"), ::OpenAPI::toJsonValue(tags));
} }
if(m_status_isSet){ if (m_status_isSet) {
obj.insert(QString("status"), ::OpenAPI::toJsonValue(status)); obj.insert(QString("status"), ::OpenAPI::toJsonValue(status));
} }
return obj; return obj;
} }
qint64 OAIPet::getId() const {
qint64
OAIPet::getId() const {
return id; return id;
} }
void void OAIPet::setId(const qint64 &id) {
OAIPet::setId(const qint64 &id) {
this->id = id; this->id = id;
this->m_id_isSet = true; this->m_id_isSet = true;
} }
OAICategory OAIPet::getCategory() const {
OAICategory
OAIPet::getCategory() const {
return category; return category;
} }
void void OAIPet::setCategory(const OAICategory &category) {
OAIPet::setCategory(const OAICategory &category) {
this->category = category; this->category = category;
this->m_category_isSet = true; this->m_category_isSet = true;
} }
QString OAIPet::getName() const {
QString
OAIPet::getName() const {
return name; return name;
} }
void void OAIPet::setName(const QString &name) {
OAIPet::setName(const QString &name) {
this->name = name; this->name = name;
this->m_name_isSet = true; this->m_name_isSet = true;
} }
QList<QString> OAIPet::getPhotoUrls() const {
QList<QString>
OAIPet::getPhotoUrls() const {
return photo_urls; return photo_urls;
} }
void void OAIPet::setPhotoUrls(const QList<QString> &photo_urls) {
OAIPet::setPhotoUrls(const QList<QString> &photo_urls) {
this->photo_urls = photo_urls; this->photo_urls = photo_urls;
this->m_photo_urls_isSet = true; this->m_photo_urls_isSet = true;
} }
QList<OAITag> OAIPet::getTags() const {
QList<OAITag>
OAIPet::getTags() const {
return tags; return tags;
} }
void void OAIPet::setTags(const QList<OAITag> &tags) {
OAIPet::setTags(const QList<OAITag> &tags) {
this->tags = tags; this->tags = tags;
this->m_tags_isSet = true; this->m_tags_isSet = true;
} }
QString OAIPet::getStatus() const {
QString
OAIPet::getStatus() const {
return status; return status;
} }
void void OAIPet::setStatus(const QString &status) {
OAIPet::setStatus(const QString &status) {
this->status = status; this->status = status;
this->m_status_isSet = true; this->m_status_isSet = true;
} }
bool bool OAIPet::isSet() const {
OAIPet::isSet() const {
bool isObjectUpdated = false; bool isObjectUpdated = false;
do{ do {
if(m_id_isSet){ isObjectUpdated = true; break;} if (m_id_isSet) {
isObjectUpdated = true;
if(category.isSet()){ isObjectUpdated = true; break;} break;
}
if(m_name_isSet){ isObjectUpdated = true; break;}
if (category.isSet()) {
if(photo_urls.size() > 0){ isObjectUpdated = true; break;} isObjectUpdated = true;
break;
if(tags.size() > 0){ isObjectUpdated = true; break;} }
if(m_status_isSet){ isObjectUpdated = true; break;} if (m_name_isSet) {
}while(false); isObjectUpdated = true;
break;
}
if (photo_urls.size() > 0) {
isObjectUpdated = true;
break;
}
if (tags.size() > 0) {
isObjectUpdated = true;
break;
}
if (m_status_isSet) {
isObjectUpdated = true;
break;
}
} while (false);
return isObjectUpdated; return isObjectUpdated;
} }
bool bool OAIPet::isValid() const {
OAIPet::isValid() const {
// only required properties are required for the object to be considered valid // only required properties are required for the object to be considered valid
return m_name_isValid && m_photo_urls_isValid && true; return m_name_isValid && m_photo_urls_isValid && true;
} }
} } // namespace OpenAPI

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
@ -21,88 +20,77 @@
#include <QJsonObject> #include <QJsonObject>
#include "OAICategory.h" #include "OAICategory.h"
#include "OAITag.h" #include "OAITag.h"
#include <QList> #include <QList>
#include <QString> #include <QString>
#include "OAIObject.h"
#include "OAIEnum.h" #include "OAIEnum.h"
#include "OAIObject.h"
namespace OpenAPI { namespace OpenAPI {
class OAIPet: public OAIObject { class OAIPet : public OAIObject {
public: public:
OAIPet(); OAIPet();
OAIPet(QString json); OAIPet(QString json);
~OAIPet() override; ~OAIPet() override;
QString asJson () const override; QString asJson() const override;
QJsonObject asJsonObject() const override; QJsonObject asJsonObject() const override;
void fromJsonObject(QJsonObject json) override; void fromJsonObject(QJsonObject json) override;
void fromJson(QString jsonString) override; void fromJson(QString jsonString) override;
qint64 getId() const; qint64 getId() const;
void setId(const qint64 &id); void setId(const qint64 &id);
OAICategory getCategory() const; OAICategory getCategory() const;
void setCategory(const OAICategory &category); void setCategory(const OAICategory &category);
QString getName() const; QString getName() const;
void setName(const QString &name); void setName(const QString &name);
QList<QString> getPhotoUrls() const; QList<QString> getPhotoUrls() const;
void setPhotoUrls(const QList<QString> &photo_urls); void setPhotoUrls(const QList<QString> &photo_urls);
QList<OAITag> getTags() const; QList<OAITag> getTags() const;
void setTags(const QList<OAITag> &tags); void setTags(const QList<OAITag> &tags);
QString getStatus() const; QString getStatus() const;
void setStatus(const QString &status); void setStatus(const QString &status);
virtual bool isSet() const override; virtual bool isSet() const override;
virtual bool isValid() const override; virtual bool isValid() const override;
private: private:
void init(); void initializeModel();
qint64 id; qint64 id;
bool m_id_isSet; bool m_id_isSet;
bool m_id_isValid; bool m_id_isValid;
OAICategory category; OAICategory category;
bool m_category_isSet; bool m_category_isSet;
bool m_category_isValid; bool m_category_isValid;
QString name; QString name;
bool m_name_isSet; bool m_name_isSet;
bool m_name_isValid; bool m_name_isValid;
QList<QString> photo_urls; QList<QString> photo_urls;
bool m_photo_urls_isSet; bool m_photo_urls_isSet;
bool m_photo_urls_isValid; bool m_photo_urls_isValid;
QList<OAITag> tags; QList<OAITag> tags;
bool m_tags_isSet; bool m_tags_isSet;
bool m_tags_isValid; bool m_tags_isValid;
QString status; QString status;
bool m_status_isSet; bool m_status_isSet;
bool m_status_isValid; bool m_status_isValid;
};
};
} } // namespace OpenAPI
Q_DECLARE_METATYPE(OpenAPI::OAIPet) Q_DECLARE_METATYPE(OpenAPI::OAIPet)

View File

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

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
@ -21,53 +20,46 @@
#include <QJsonObject> #include <QJsonObject>
#include <QString> #include <QString>
#include "OAIObject.h"
#include "OAIEnum.h" #include "OAIEnum.h"
#include "OAIObject.h"
namespace OpenAPI { namespace OpenAPI {
class OAITag: public OAIObject { class OAITag : public OAIObject {
public: public:
OAITag(); OAITag();
OAITag(QString json); OAITag(QString json);
~OAITag() override; ~OAITag() override;
QString asJson () const override; QString asJson() const override;
QJsonObject asJsonObject() const override; QJsonObject asJsonObject() const override;
void fromJsonObject(QJsonObject json) override; void fromJsonObject(QJsonObject json) override;
void fromJson(QString jsonString) override; void fromJson(QString jsonString) override;
qint64 getId() const; qint64 getId() const;
void setId(const qint64 &id); void setId(const qint64 &id);
QString getName() const; QString getName() const;
void setName(const QString &name); void setName(const QString &name);
virtual bool isSet() const override; virtual bool isSet() const override;
virtual bool isValid() const override; virtual bool isValid() const override;
private: private:
void init(); void initializeModel();
qint64 id; qint64 id;
bool m_id_isSet; bool m_id_isSet;
bool m_id_isValid; bool m_id_isValid;
QString name; QString name;
bool m_name_isSet; bool m_name_isSet;
bool m_name_isValid; bool m_name_isValid;
};
};
} } // namespace OpenAPI
Q_DECLARE_METATYPE(OpenAPI::OAITag) Q_DECLARE_METATYPE(OpenAPI::OAITag)

View File

@ -3,257 +3,244 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.
*/ */
#include "OAIUser.h" #include "OAIUser.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug> #include <QDebug>
#include <QJsonArray>
#include <QJsonDocument>
#include <QObject>
#include "OAIHelpers.h" #include "OAIHelpers.h"
namespace OpenAPI { namespace OpenAPI {
OAIUser::OAIUser(QString json) { OAIUser::OAIUser(QString json) {
this->init(); this->initializeModel();
this->fromJson(json); this->fromJson(json);
} }
OAIUser::OAIUser() { OAIUser::OAIUser() {
this->init(); this->initializeModel();
} }
OAIUser::~OAIUser() { OAIUser::~OAIUser() {}
} void OAIUser::initializeModel() {
void
OAIUser::init() {
m_id_isSet = false; m_id_isSet = false;
m_id_isValid = false; m_id_isValid = false;
m_username_isSet = false; m_username_isSet = false;
m_username_isValid = false; m_username_isValid = false;
m_first_name_isSet = false; m_first_name_isSet = false;
m_first_name_isValid = false; m_first_name_isValid = false;
m_last_name_isSet = false; m_last_name_isSet = false;
m_last_name_isValid = false; m_last_name_isValid = false;
m_email_isSet = false; m_email_isSet = false;
m_email_isValid = false; m_email_isValid = false;
m_password_isSet = false; m_password_isSet = false;
m_password_isValid = false; m_password_isValid = false;
m_phone_isSet = false; m_phone_isSet = false;
m_phone_isValid = false; m_phone_isValid = false;
m_user_status_isSet = false; m_user_status_isSet = false;
m_user_status_isValid = false; m_user_status_isValid = false;
} }
void void OAIUser::fromJson(QString jsonString) {
OAIUser::fromJson(QString jsonString) { QByteArray array(jsonString.toStdString().c_str());
QByteArray array (jsonString.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array); QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object(); QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject); this->fromJsonObject(jsonObject);
} }
void void OAIUser::fromJsonObject(QJsonObject json) {
OAIUser::fromJsonObject(QJsonObject json) {
m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); 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_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_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_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_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_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_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_isValid = ::OpenAPI::fromJsonValue(user_status, json[QString("userStatus")]);
m_user_status_isSet = !json[QString("userStatus")].isNull() && m_user_status_isValid;
} }
QString QString OAIUser::asJson() const {
OAIUser::asJson () const {
QJsonObject obj = this->asJsonObject(); QJsonObject obj = this->asJsonObject();
QJsonDocument doc(obj); QJsonDocument doc(obj);
QByteArray bytes = doc.toJson(); QByteArray bytes = doc.toJson();
return QString(bytes); return QString(bytes);
} }
QJsonObject QJsonObject OAIUser::asJsonObject() const {
OAIUser::asJsonObject() const {
QJsonObject obj; QJsonObject obj;
if(m_id_isSet){ if (m_id_isSet) {
obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); obj.insert(QString("id"), ::OpenAPI::toJsonValue(id));
} }
if(m_username_isSet){ if (m_username_isSet) {
obj.insert(QString("username"), ::OpenAPI::toJsonValue(username)); obj.insert(QString("username"), ::OpenAPI::toJsonValue(username));
} }
if(m_first_name_isSet){ if (m_first_name_isSet) {
obj.insert(QString("firstName"), ::OpenAPI::toJsonValue(first_name)); obj.insert(QString("firstName"), ::OpenAPI::toJsonValue(first_name));
} }
if(m_last_name_isSet){ if (m_last_name_isSet) {
obj.insert(QString("lastName"), ::OpenAPI::toJsonValue(last_name)); obj.insert(QString("lastName"), ::OpenAPI::toJsonValue(last_name));
} }
if(m_email_isSet){ if (m_email_isSet) {
obj.insert(QString("email"), ::OpenAPI::toJsonValue(email)); obj.insert(QString("email"), ::OpenAPI::toJsonValue(email));
} }
if(m_password_isSet){ if (m_password_isSet) {
obj.insert(QString("password"), ::OpenAPI::toJsonValue(password)); obj.insert(QString("password"), ::OpenAPI::toJsonValue(password));
} }
if(m_phone_isSet){ if (m_phone_isSet) {
obj.insert(QString("phone"), ::OpenAPI::toJsonValue(phone)); obj.insert(QString("phone"), ::OpenAPI::toJsonValue(phone));
} }
if(m_user_status_isSet){ if (m_user_status_isSet) {
obj.insert(QString("userStatus"), ::OpenAPI::toJsonValue(user_status)); obj.insert(QString("userStatus"), ::OpenAPI::toJsonValue(user_status));
} }
return obj; return obj;
} }
qint64 OAIUser::getId() const {
qint64
OAIUser::getId() const {
return id; return id;
} }
void void OAIUser::setId(const qint64 &id) {
OAIUser::setId(const qint64 &id) {
this->id = id; this->id = id;
this->m_id_isSet = true; this->m_id_isSet = true;
} }
QString OAIUser::getUsername() const {
QString
OAIUser::getUsername() const {
return username; return username;
} }
void void OAIUser::setUsername(const QString &username) {
OAIUser::setUsername(const QString &username) {
this->username = username; this->username = username;
this->m_username_isSet = true; this->m_username_isSet = true;
} }
QString OAIUser::getFirstName() const {
QString
OAIUser::getFirstName() const {
return first_name; return first_name;
} }
void void OAIUser::setFirstName(const QString &first_name) {
OAIUser::setFirstName(const QString &first_name) {
this->first_name = first_name; this->first_name = first_name;
this->m_first_name_isSet = true; this->m_first_name_isSet = true;
} }
QString OAIUser::getLastName() const {
QString
OAIUser::getLastName() const {
return last_name; return last_name;
} }
void void OAIUser::setLastName(const QString &last_name) {
OAIUser::setLastName(const QString &last_name) {
this->last_name = last_name; this->last_name = last_name;
this->m_last_name_isSet = true; this->m_last_name_isSet = true;
} }
QString OAIUser::getEmail() const {
QString
OAIUser::getEmail() const {
return email; return email;
} }
void void OAIUser::setEmail(const QString &email) {
OAIUser::setEmail(const QString &email) {
this->email = email; this->email = email;
this->m_email_isSet = true; this->m_email_isSet = true;
} }
QString OAIUser::getPassword() const {
QString
OAIUser::getPassword() const {
return password; return password;
} }
void void OAIUser::setPassword(const QString &password) {
OAIUser::setPassword(const QString &password) {
this->password = password; this->password = password;
this->m_password_isSet = true; this->m_password_isSet = true;
} }
QString OAIUser::getPhone() const {
QString
OAIUser::getPhone() const {
return phone; return phone;
} }
void void OAIUser::setPhone(const QString &phone) {
OAIUser::setPhone(const QString &phone) {
this->phone = phone; this->phone = phone;
this->m_phone_isSet = true; this->m_phone_isSet = true;
} }
qint32 OAIUser::getUserStatus() const {
qint32
OAIUser::getUserStatus() const {
return user_status; return user_status;
} }
void void OAIUser::setUserStatus(const qint32 &user_status) {
OAIUser::setUserStatus(const qint32 &user_status) {
this->user_status = user_status; this->user_status = user_status;
this->m_user_status_isSet = true; this->m_user_status_isSet = true;
} }
bool bool OAIUser::isSet() const {
OAIUser::isSet() const {
bool isObjectUpdated = false; bool isObjectUpdated = false;
do{ do {
if(m_id_isSet){ isObjectUpdated = true; break;} if (m_id_isSet) {
isObjectUpdated = true;
if(m_username_isSet){ isObjectUpdated = true; break;} break;
}
if(m_first_name_isSet){ isObjectUpdated = true; break;}
if (m_username_isSet) {
if(m_last_name_isSet){ isObjectUpdated = true; break;} isObjectUpdated = true;
break;
if(m_email_isSet){ isObjectUpdated = true; break;} }
if(m_password_isSet){ isObjectUpdated = true; break;} if (m_first_name_isSet) {
isObjectUpdated = true;
if(m_phone_isSet){ isObjectUpdated = true; break;} break;
}
if(m_user_status_isSet){ isObjectUpdated = true; break;}
}while(false); if (m_last_name_isSet) {
isObjectUpdated = true;
break;
}
if (m_email_isSet) {
isObjectUpdated = true;
break;
}
if (m_password_isSet) {
isObjectUpdated = true;
break;
}
if (m_phone_isSet) {
isObjectUpdated = true;
break;
}
if (m_user_status_isSet) {
isObjectUpdated = true;
break;
}
} while (false);
return isObjectUpdated; return isObjectUpdated;
} }
bool bool OAIUser::isValid() const {
OAIUser::isValid() const {
// only required properties are required for the object to be considered valid // only required properties are required for the object to be considered valid
return true; return true;
} }
} } // namespace OpenAPI

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
@ -21,101 +20,88 @@
#include <QJsonObject> #include <QJsonObject>
#include <QString> #include <QString>
#include "OAIObject.h"
#include "OAIEnum.h" #include "OAIEnum.h"
#include "OAIObject.h"
namespace OpenAPI { namespace OpenAPI {
class OAIUser: public OAIObject { class OAIUser : public OAIObject {
public: public:
OAIUser(); OAIUser();
OAIUser(QString json); OAIUser(QString json);
~OAIUser() override; ~OAIUser() override;
QString asJson () const override; QString asJson() const override;
QJsonObject asJsonObject() const override; QJsonObject asJsonObject() const override;
void fromJsonObject(QJsonObject json) override; void fromJsonObject(QJsonObject json) override;
void fromJson(QString jsonString) override; void fromJson(QString jsonString) override;
qint64 getId() const; qint64 getId() const;
void setId(const qint64 &id); void setId(const qint64 &id);
QString getUsername() const; QString getUsername() const;
void setUsername(const QString &username); void setUsername(const QString &username);
QString getFirstName() const; QString getFirstName() const;
void setFirstName(const QString &first_name); void setFirstName(const QString &first_name);
QString getLastName() const; QString getLastName() const;
void setLastName(const QString &last_name); void setLastName(const QString &last_name);
QString getEmail() const; QString getEmail() const;
void setEmail(const QString &email); void setEmail(const QString &email);
QString getPassword() const; QString getPassword() const;
void setPassword(const QString &password); void setPassword(const QString &password);
QString getPhone() const; QString getPhone() const;
void setPhone(const QString &phone); void setPhone(const QString &phone);
qint32 getUserStatus() const; qint32 getUserStatus() const;
void setUserStatus(const qint32 &user_status); void setUserStatus(const qint32 &user_status);
virtual bool isSet() const override; virtual bool isSet() const override;
virtual bool isValid() const override; virtual bool isValid() const override;
private: private:
void init(); void initializeModel();
qint64 id; qint64 id;
bool m_id_isSet; bool m_id_isSet;
bool m_id_isValid; bool m_id_isValid;
QString username; QString username;
bool m_username_isSet; bool m_username_isSet;
bool m_username_isValid; bool m_username_isValid;
QString first_name; QString first_name;
bool m_first_name_isSet; bool m_first_name_isSet;
bool m_first_name_isValid; bool m_first_name_isValid;
QString last_name; QString last_name;
bool m_last_name_isSet; bool m_last_name_isSet;
bool m_last_name_isValid; bool m_last_name_isValid;
QString email; QString email;
bool m_email_isSet; bool m_email_isSet;
bool m_email_isValid; bool m_email_isValid;
QString password; QString password;
bool m_password_isSet; bool m_password_isSet;
bool m_password_isValid; bool m_password_isValid;
QString phone; QString phone;
bool m_phone_isSet; bool m_phone_isSet;
bool m_phone_isValid; bool m_phone_isValid;
qint32 user_status; qint32 user_status;
bool m_user_status_isSet; bool m_user_status_isSet;
bool m_user_status_isValid; bool m_user_status_isValid;
};
};
} } // namespace OpenAPI
Q_DECLARE_METATYPE(OpenAPI::OAIUser) Q_DECLARE_METATYPE(OpenAPI::OAIUser)

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech

View File

@ -3,7 +3,6 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* The version of the OpenAPI document: 1.0.0 * The version of the OpenAPI document: 1.0.0
*
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech