mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-10-14 00:13:50 +00:00
This reverts commit 40f1f920dfa03c2c172d196e6ad4dd5950f17405.
This commit is contained in:
parent
8231cbfe81
commit
fabe021fb0
@ -27,6 +27,6 @@ fi
|
|||||||
|
|
||||||
# if you've executed sbt assembly previously it will use that instead.
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
ags="generate -t modules/openapi-generator/src/main/resources/cpp-qt5-client -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g cpp-qt5-client -o samples/client/petstore/cpp-qt5 $@"
|
ags="generate -t modules/openapi-generator/src/main/resources/cpp-qt5-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-qt5-client -o samples/client/petstore/cpp-qt5 $@"
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
|
@ -1,127 +0,0 @@
|
|||||||
/**
|
|
||||||
* OpenAPI Petstore
|
|
||||||
* 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
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
* https://openapi-generator.tech
|
|
||||||
* Do not edit the class manually.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include "OAIInline_object.h"
|
|
||||||
|
|
||||||
#include "OAIHelpers.h"
|
|
||||||
|
|
||||||
#include <QJsonDocument>
|
|
||||||
#include <QJsonArray>
|
|
||||||
#include <QObject>
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
namespace OpenAPI {
|
|
||||||
|
|
||||||
OAIInline_object::OAIInline_object(QString json) {
|
|
||||||
this->init();
|
|
||||||
this->fromJson(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
OAIInline_object::OAIInline_object() {
|
|
||||||
this->init();
|
|
||||||
}
|
|
||||||
|
|
||||||
OAIInline_object::~OAIInline_object() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
OAIInline_object::init() {
|
|
||||||
|
|
||||||
m_name_isSet = false;
|
|
||||||
m_name_isValid = false;
|
|
||||||
|
|
||||||
m_status_isSet = false;
|
|
||||||
m_status_isValid = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
OAIInline_object::fromJson(QString jsonString) {
|
|
||||||
QByteArray array (jsonString.toStdString().c_str());
|
|
||||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
|
||||||
QJsonObject jsonObject = doc.object();
|
|
||||||
this->fromJsonObject(jsonObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
OAIInline_object::fromJsonObject(QJsonObject json) {
|
|
||||||
|
|
||||||
m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]);
|
|
||||||
|
|
||||||
|
|
||||||
m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
QString
|
|
||||||
OAIInline_object::asJson () const {
|
|
||||||
QJsonObject obj = this->asJsonObject();
|
|
||||||
QJsonDocument doc(obj);
|
|
||||||
QByteArray bytes = doc.toJson();
|
|
||||||
return QString(bytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
QJsonObject
|
|
||||||
OAIInline_object::asJsonObject() const {
|
|
||||||
QJsonObject obj;
|
|
||||||
if(m_name_isSet){
|
|
||||||
obj.insert(QString("name"), ::OpenAPI::toJsonValue(name));
|
|
||||||
}
|
|
||||||
if(m_status_isSet){
|
|
||||||
obj.insert(QString("status"), ::OpenAPI::toJsonValue(status));
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QString
|
|
||||||
OAIInline_object::getName() const {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
void
|
|
||||||
OAIInline_object::setName(const QString &name) {
|
|
||||||
this->name = name;
|
|
||||||
this->m_name_isSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QString
|
|
||||||
OAIInline_object::getStatus() const {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
void
|
|
||||||
OAIInline_object::setStatus(const QString &status) {
|
|
||||||
this->status = status;
|
|
||||||
this->m_status_isSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
OAIInline_object::isSet() const {
|
|
||||||
bool isObjectUpdated = false;
|
|
||||||
do{
|
|
||||||
if(m_name_isSet){ isObjectUpdated = true; break;}
|
|
||||||
|
|
||||||
if(m_status_isSet){ isObjectUpdated = true; break;}
|
|
||||||
}while(false);
|
|
||||||
return isObjectUpdated;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
OAIInline_object::isValid() const {
|
|
||||||
// only required properties are required for the object to be considered valid
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,73 +0,0 @@
|
|||||||
/**
|
|
||||||
* OpenAPI Petstore
|
|
||||||
* 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
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
* https://openapi-generator.tech
|
|
||||||
* Do not edit the class manually.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* OAIInline_object.h
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef OAIInline_object_H
|
|
||||||
#define OAIInline_object_H
|
|
||||||
|
|
||||||
#include <QJsonObject>
|
|
||||||
|
|
||||||
|
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
#include "OAIObject.h"
|
|
||||||
#include "OAIEnum.h"
|
|
||||||
|
|
||||||
namespace OpenAPI {
|
|
||||||
|
|
||||||
class OAIInline_object: public OAIObject {
|
|
||||||
public:
|
|
||||||
OAIInline_object();
|
|
||||||
OAIInline_object(QString json);
|
|
||||||
~OAIInline_object() override;
|
|
||||||
|
|
||||||
QString asJson () const override;
|
|
||||||
QJsonObject asJsonObject() const override;
|
|
||||||
void fromJsonObject(QJsonObject json) override;
|
|
||||||
void fromJson(QString jsonString) override;
|
|
||||||
|
|
||||||
|
|
||||||
QString getName() const;
|
|
||||||
void setName(const QString &name);
|
|
||||||
|
|
||||||
|
|
||||||
QString getStatus() const;
|
|
||||||
void setStatus(const QString &status);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
virtual bool isSet() const override;
|
|
||||||
virtual bool isValid() const override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
void init();
|
|
||||||
|
|
||||||
QString name;
|
|
||||||
bool m_name_isSet;
|
|
||||||
bool m_name_isValid;
|
|
||||||
|
|
||||||
QString status;
|
|
||||||
bool m_status_isSet;
|
|
||||||
bool m_status_isValid;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(OpenAPI::OAIInline_object)
|
|
||||||
|
|
||||||
#endif // OAIInline_object_H
|
|
@ -1,127 +0,0 @@
|
|||||||
/**
|
|
||||||
* OpenAPI Petstore
|
|
||||||
* 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
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
* https://openapi-generator.tech
|
|
||||||
* Do not edit the class manually.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include "OAIInline_object_1.h"
|
|
||||||
|
|
||||||
#include "OAIHelpers.h"
|
|
||||||
|
|
||||||
#include <QJsonDocument>
|
|
||||||
#include <QJsonArray>
|
|
||||||
#include <QObject>
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
namespace OpenAPI {
|
|
||||||
|
|
||||||
OAIInline_object_1::OAIInline_object_1(QString json) {
|
|
||||||
this->init();
|
|
||||||
this->fromJson(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
OAIInline_object_1::OAIInline_object_1() {
|
|
||||||
this->init();
|
|
||||||
}
|
|
||||||
|
|
||||||
OAIInline_object_1::~OAIInline_object_1() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
OAIInline_object_1::init() {
|
|
||||||
|
|
||||||
m_additional_metadata_isSet = false;
|
|
||||||
m_additional_metadata_isValid = false;
|
|
||||||
|
|
||||||
m_file_isSet = false;
|
|
||||||
m_file_isValid = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
OAIInline_object_1::fromJson(QString jsonString) {
|
|
||||||
QByteArray array (jsonString.toStdString().c_str());
|
|
||||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
|
||||||
QJsonObject jsonObject = doc.object();
|
|
||||||
this->fromJsonObject(jsonObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
OAIInline_object_1::fromJsonObject(QJsonObject json) {
|
|
||||||
|
|
||||||
m_additional_metadata_isValid = ::OpenAPI::fromJsonValue(additional_metadata, json[QString("additionalMetadata")]);
|
|
||||||
|
|
||||||
|
|
||||||
m_file_isValid = ::OpenAPI::fromJsonValue(file, json[QString("file")]);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
QString
|
|
||||||
OAIInline_object_1::asJson () const {
|
|
||||||
QJsonObject obj = this->asJsonObject();
|
|
||||||
QJsonDocument doc(obj);
|
|
||||||
QByteArray bytes = doc.toJson();
|
|
||||||
return QString(bytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
QJsonObject
|
|
||||||
OAIInline_object_1::asJsonObject() const {
|
|
||||||
QJsonObject obj;
|
|
||||||
if(m_additional_metadata_isSet){
|
|
||||||
obj.insert(QString("additionalMetadata"), ::OpenAPI::toJsonValue(additional_metadata));
|
|
||||||
}
|
|
||||||
if(file.isSet()){
|
|
||||||
obj.insert(QString("file"), ::OpenAPI::toJsonValue(file));
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QString
|
|
||||||
OAIInline_object_1::getAdditionalMetadata() const {
|
|
||||||
return additional_metadata;
|
|
||||||
}
|
|
||||||
void
|
|
||||||
OAIInline_object_1::setAdditionalMetadata(const QString &additional_metadata) {
|
|
||||||
this->additional_metadata = additional_metadata;
|
|
||||||
this->m_additional_metadata_isSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
OAIHttpRequestInputFileElement*
|
|
||||||
OAIInline_object_1::getFile() const {
|
|
||||||
return file;
|
|
||||||
}
|
|
||||||
void
|
|
||||||
OAIInline_object_1::setFile(const OAIHttpRequestInputFileElement* &file) {
|
|
||||||
this->file = file;
|
|
||||||
this->m_file_isSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
OAIInline_object_1::isSet() const {
|
|
||||||
bool isObjectUpdated = false;
|
|
||||||
do{
|
|
||||||
if(m_additional_metadata_isSet){ isObjectUpdated = true; break;}
|
|
||||||
|
|
||||||
if(file.isSet()){ isObjectUpdated = true; break;}
|
|
||||||
}while(false);
|
|
||||||
return isObjectUpdated;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
OAIInline_object_1::isValid() const {
|
|
||||||
// only required properties are required for the object to be considered valid
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,74 +0,0 @@
|
|||||||
/**
|
|
||||||
* OpenAPI Petstore
|
|
||||||
* 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
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
* https://openapi-generator.tech
|
|
||||||
* Do not edit the class manually.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* OAIInline_object_1.h
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef OAIInline_object_1_H
|
|
||||||
#define OAIInline_object_1_H
|
|
||||||
|
|
||||||
#include <QJsonObject>
|
|
||||||
|
|
||||||
|
|
||||||
#include "OAIHttpRequest.h"
|
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
#include "OAIObject.h"
|
|
||||||
#include "OAIEnum.h"
|
|
||||||
|
|
||||||
namespace OpenAPI {
|
|
||||||
|
|
||||||
class OAIInline_object_1: public OAIObject {
|
|
||||||
public:
|
|
||||||
OAIInline_object_1();
|
|
||||||
OAIInline_object_1(QString json);
|
|
||||||
~OAIInline_object_1() override;
|
|
||||||
|
|
||||||
QString asJson () const override;
|
|
||||||
QJsonObject asJsonObject() const override;
|
|
||||||
void fromJsonObject(QJsonObject json) override;
|
|
||||||
void fromJson(QString jsonString) override;
|
|
||||||
|
|
||||||
|
|
||||||
QString getAdditionalMetadata() const;
|
|
||||||
void setAdditionalMetadata(const QString &additional_metadata);
|
|
||||||
|
|
||||||
|
|
||||||
OAIHttpRequestInputFileElement* getFile() const;
|
|
||||||
void setFile(const OAIHttpRequestInputFileElement* &file);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
virtual bool isSet() const override;
|
|
||||||
virtual bool isValid() const override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
void init();
|
|
||||||
|
|
||||||
QString additional_metadata;
|
|
||||||
bool m_additional_metadata_isSet;
|
|
||||||
bool m_additional_metadata_isValid;
|
|
||||||
|
|
||||||
OAIHttpRequestInputFileElement* file;
|
|
||||||
bool m_file_isSet;
|
|
||||||
bool m_file_isValid;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(OpenAPI::OAIInline_object_1)
|
|
||||||
|
|
||||||
#endif // OAIInline_object_1_H
|
|
@ -52,7 +52,7 @@ void OAIPetApi::addHeaders(const QString& key, const QString& value){
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
OAIPetApi::addPet(const OAIPet& oai_pet) {
|
OAIPetApi::addPet(const OAIPet& body) {
|
||||||
QString fullPath;
|
QString fullPath;
|
||||||
fullPath.append(this->host).append(this->basePath).append("/pet");
|
fullPath.append(this->host).append(this->basePath).append("/pet");
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ OAIPetApi::addPet(const OAIPet& oai_pet) {
|
|||||||
OAIHttpRequestInput input(fullPath, "POST");
|
OAIHttpRequestInput input(fullPath, "POST");
|
||||||
|
|
||||||
|
|
||||||
QString output = oai_pet.asJson();
|
QString output = body.asJson();
|
||||||
input.request_body.append(output);
|
input.request_body.append(output);
|
||||||
|
|
||||||
|
|
||||||
@ -247,7 +247,7 @@ OAIPetApi::findPetsByStatusCallback(OAIHttpRequestWorker * worker) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
OAIPetApi::findPetsByTags(const QList<QString>& tags, const qint32& max_count) {
|
OAIPetApi::findPetsByTags(const QList<QString>& tags) {
|
||||||
QString fullPath;
|
QString fullPath;
|
||||||
fullPath.append(this->host).append(this->basePath).append("/pet/findByTags");
|
fullPath.append(this->host).append(this->basePath).append("/pet/findByTags");
|
||||||
|
|
||||||
@ -291,14 +291,6 @@ OAIPetApi::findPetsByTags(const QList<QString>& tags, const qint32& max_count) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fullPath.indexOf("?") > 0)
|
|
||||||
fullPath.append("&");
|
|
||||||
else
|
|
||||||
fullPath.append("?");
|
|
||||||
fullPath.append(QUrl::toPercentEncoding("maxCount"))
|
|
||||||
.append("=")
|
|
||||||
.append(QUrl::toPercentEncoding(::OpenAPI::toStringValue(max_count)));
|
|
||||||
|
|
||||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||||
worker->setTimeOut(timeout);
|
worker->setTimeOut(timeout);
|
||||||
OAIHttpRequestInput input(fullPath, "GET");
|
OAIHttpRequestInput input(fullPath, "GET");
|
||||||
@ -399,7 +391,7 @@ OAIPetApi::getPetByIdCallback(OAIHttpRequestWorker * worker) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
OAIPetApi::updatePet(const OAIPet& oai_pet) {
|
OAIPetApi::updatePet(const OAIPet& body) {
|
||||||
QString fullPath;
|
QString fullPath;
|
||||||
fullPath.append(this->host).append(this->basePath).append("/pet");
|
fullPath.append(this->host).append(this->basePath).append("/pet");
|
||||||
|
|
||||||
@ -408,7 +400,7 @@ OAIPetApi::updatePet(const OAIPet& oai_pet) {
|
|||||||
OAIHttpRequestInput input(fullPath, "PUT");
|
OAIHttpRequestInput input(fullPath, "PUT");
|
||||||
|
|
||||||
|
|
||||||
QString output = oai_pet.asJson();
|
QString output = body.asJson();
|
||||||
input.request_body.append(output);
|
input.request_body.append(output);
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,12 +37,12 @@ public:
|
|||||||
void setApiTimeOutMs(const int tout);
|
void setApiTimeOutMs(const int tout);
|
||||||
void addHeaders(const QString& key, const QString& value);
|
void addHeaders(const QString& key, const QString& value);
|
||||||
|
|
||||||
void addPet(const OAIPet& oai_pet);
|
void addPet(const OAIPet& body);
|
||||||
void deletePet(const qint64& pet_id, const QString& api_key);
|
void deletePet(const qint64& pet_id, const QString& api_key);
|
||||||
void findPetsByStatus(const QList<QString>& status);
|
void findPetsByStatus(const QList<QString>& status);
|
||||||
void findPetsByTags(const QList<QString>& tags, const qint32& max_count);
|
void findPetsByTags(const QList<QString>& tags);
|
||||||
void getPetById(const qint64& pet_id);
|
void getPetById(const qint64& pet_id);
|
||||||
void updatePet(const OAIPet& oai_pet);
|
void updatePet(const OAIPet& body);
|
||||||
void updatePetWithForm(const qint64& pet_id, const QString& name, const QString& status);
|
void updatePetWithForm(const qint64& pet_id, const QString& name, const QString& status);
|
||||||
void uploadFile(const qint64& pet_id, const QString& additional_metadata, const OAIHttpRequestInputFileElement*& file);
|
void uploadFile(const qint64& pet_id, const QString& additional_metadata, const OAIHttpRequestInputFileElement*& file);
|
||||||
|
|
||||||
|
@ -204,7 +204,7 @@ OAIStoreApi::getOrderByIdCallback(OAIHttpRequestWorker * worker) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
OAIStoreApi::placeOrder(const OAIOrder& oai_order) {
|
OAIStoreApi::placeOrder(const OAIOrder& body) {
|
||||||
QString fullPath;
|
QString fullPath;
|
||||||
fullPath.append(this->host).append(this->basePath).append("/store/order");
|
fullPath.append(this->host).append(this->basePath).append("/store/order");
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ OAIStoreApi::placeOrder(const OAIOrder& oai_order) {
|
|||||||
OAIHttpRequestInput input(fullPath, "POST");
|
OAIHttpRequestInput input(fullPath, "POST");
|
||||||
|
|
||||||
|
|
||||||
QString output = oai_order.asJson();
|
QString output = body.asJson();
|
||||||
input.request_body.append(output);
|
input.request_body.append(output);
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ public:
|
|||||||
void deleteOrder(const QString& order_id);
|
void deleteOrder(const QString& order_id);
|
||||||
void getInventory();
|
void getInventory();
|
||||||
void getOrderById(const qint64& order_id);
|
void getOrderById(const qint64& order_id);
|
||||||
void placeOrder(const OAIOrder& oai_order);
|
void placeOrder(const OAIOrder& body);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString basePath;
|
QString basePath;
|
||||||
|
@ -52,7 +52,7 @@ void OAIUserApi::addHeaders(const QString& key, const QString& value){
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
OAIUserApi::createUser(const OAIUser& oai_user) {
|
OAIUserApi::createUser(const OAIUser& body) {
|
||||||
QString fullPath;
|
QString fullPath;
|
||||||
fullPath.append(this->host).append(this->basePath).append("/user");
|
fullPath.append(this->host).append(this->basePath).append("/user");
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ OAIUserApi::createUser(const OAIUser& oai_user) {
|
|||||||
OAIHttpRequestInput input(fullPath, "POST");
|
OAIHttpRequestInput input(fullPath, "POST");
|
||||||
|
|
||||||
|
|
||||||
QString output = oai_user.asJson();
|
QString output = body.asJson();
|
||||||
input.request_body.append(output);
|
input.request_body.append(output);
|
||||||
|
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ OAIUserApi::createUserCallback(OAIHttpRequestWorker * worker) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
OAIUserApi::createUsersWithArrayInput(const QList<OAIUser>& oai_user) {
|
OAIUserApi::createUsersWithArrayInput(const QList<OAIUser>& body) {
|
||||||
QString fullPath;
|
QString fullPath;
|
||||||
fullPath.append(this->host).append(this->basePath).append("/user/createWithArray");
|
fullPath.append(this->host).append(this->basePath).append("/user/createWithArray");
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ OAIUserApi::createUsersWithArrayInput(const QList<OAIUser>& oai_user) {
|
|||||||
OAIHttpRequestInput input(fullPath, "POST");
|
OAIHttpRequestInput input(fullPath, "POST");
|
||||||
|
|
||||||
|
|
||||||
QJsonDocument doc(::OpenAPI::toJsonValue(oai_user).toArray());
|
QJsonDocument doc(::OpenAPI::toJsonValue(body).toArray());
|
||||||
QByteArray bytes = doc.toJson();
|
QByteArray bytes = doc.toJson();
|
||||||
input.request_body.append(bytes);
|
input.request_body.append(bytes);
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ OAIUserApi::createUsersWithArrayInputCallback(OAIHttpRequestWorker * worker) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
OAIUserApi::createUsersWithListInput(const QList<OAIUser>& oai_user) {
|
OAIUserApi::createUsersWithListInput(const QList<OAIUser>& body) {
|
||||||
QString fullPath;
|
QString fullPath;
|
||||||
fullPath.append(this->host).append(this->basePath).append("/user/createWithList");
|
fullPath.append(this->host).append(this->basePath).append("/user/createWithList");
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ OAIUserApi::createUsersWithListInput(const QList<OAIUser>& oai_user) {
|
|||||||
OAIHttpRequestInput input(fullPath, "POST");
|
OAIHttpRequestInput input(fullPath, "POST");
|
||||||
|
|
||||||
|
|
||||||
QJsonDocument doc(::OpenAPI::toJsonValue(oai_user).toArray());
|
QJsonDocument doc(::OpenAPI::toJsonValue(body).toArray());
|
||||||
QByteArray bytes = doc.toJson();
|
QByteArray bytes = doc.toJson();
|
||||||
input.request_body.append(bytes);
|
input.request_body.append(bytes);
|
||||||
|
|
||||||
@ -406,7 +406,7 @@ OAIUserApi::logoutUserCallback(OAIHttpRequestWorker * worker) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
OAIUserApi::updateUser(const QString& username, const OAIUser& oai_user) {
|
OAIUserApi::updateUser(const QString& username, const OAIUser& body) {
|
||||||
QString fullPath;
|
QString fullPath;
|
||||||
fullPath.append(this->host).append(this->basePath).append("/user/{username}");
|
fullPath.append(this->host).append(this->basePath).append("/user/{username}");
|
||||||
QString usernamePathParam("{");
|
QString usernamePathParam("{");
|
||||||
@ -418,7 +418,7 @@ OAIUserApi::updateUser(const QString& username, const OAIUser& oai_user) {
|
|||||||
OAIHttpRequestInput input(fullPath, "PUT");
|
OAIHttpRequestInput input(fullPath, "PUT");
|
||||||
|
|
||||||
|
|
||||||
QString output = oai_user.asJson();
|
QString output = body.asJson();
|
||||||
input.request_body.append(output);
|
input.request_body.append(output);
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,14 +36,14 @@ public:
|
|||||||
void setApiTimeOutMs(const int tout);
|
void setApiTimeOutMs(const int tout);
|
||||||
void addHeaders(const QString& key, const QString& value);
|
void addHeaders(const QString& key, const QString& value);
|
||||||
|
|
||||||
void createUser(const OAIUser& oai_user);
|
void createUser(const OAIUser& body);
|
||||||
void createUsersWithArrayInput(const QList<OAIUser>& oai_user);
|
void createUsersWithArrayInput(const QList<OAIUser>& body);
|
||||||
void createUsersWithListInput(const QList<OAIUser>& oai_user);
|
void createUsersWithListInput(const QList<OAIUser>& body);
|
||||||
void deleteUser(const QString& username);
|
void deleteUser(const QString& username);
|
||||||
void getUserByName(const QString& username);
|
void getUserByName(const QString& username);
|
||||||
void loginUser(const QString& username, const QString& password);
|
void loginUser(const QString& username, const QString& password);
|
||||||
void logoutUser();
|
void logoutUser();
|
||||||
void updateUser(const QString& username, const OAIUser& oai_user);
|
void updateUser(const QString& username, const OAIUser& body);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString basePath;
|
QString basePath;
|
||||||
|
@ -4,8 +4,6 @@ HEADERS += \
|
|||||||
# Models
|
# Models
|
||||||
$${PWD}/OAIApiResponse.h \
|
$${PWD}/OAIApiResponse.h \
|
||||||
$${PWD}/OAICategory.h \
|
$${PWD}/OAICategory.h \
|
||||||
$${PWD}/OAIInline_object.h \
|
|
||||||
$${PWD}/OAIInline_object_1.h \
|
|
||||||
$${PWD}/OAIOrder.h \
|
$${PWD}/OAIOrder.h \
|
||||||
$${PWD}/OAIPet.h \
|
$${PWD}/OAIPet.h \
|
||||||
$${PWD}/OAITag.h \
|
$${PWD}/OAITag.h \
|
||||||
@ -24,8 +22,6 @@ SOURCES += \
|
|||||||
# Models
|
# Models
|
||||||
$${PWD}/OAIApiResponse.cpp \
|
$${PWD}/OAIApiResponse.cpp \
|
||||||
$${PWD}/OAICategory.cpp \
|
$${PWD}/OAICategory.cpp \
|
||||||
$${PWD}/OAIInline_object.cpp \
|
|
||||||
$${PWD}/OAIInline_object_1.cpp \
|
|
||||||
$${PWD}/OAIOrder.cpp \
|
$${PWD}/OAIOrder.cpp \
|
||||||
$${PWD}/OAIPet.cpp \
|
$${PWD}/OAIPet.cpp \
|
||||||
$${PWD}/OAITag.cpp \
|
$${PWD}/OAITag.cpp \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user