cpp qt5 client: fix prefix bug (#4432)

This commit is contained in:
Martin Delille 2019-11-10 09:44:46 +01:00 committed by sunn
parent 357f6caed5
commit 3e87a5fbaf
40 changed files with 858 additions and 853 deletions

View File

@ -27,6 +27,11 @@ 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/2_0/petstore.yaml -g cpp-qt5-client -o samples/client/petstore/cpp-qt5 $@" args="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 \
--additional-properties=cppNamespace=test_namespace \
--additional-properties=modelNamePrefix=PFX \
-o samples/client/petstore/cpp-qt5 $@"
java $JAVA_OPTS -jar $executable $ags java $JAVA_OPTS -jar $executable $args

View File

@ -83,7 +83,7 @@ QMap<QString, QString> {{prefix}}HttpRequestWorker::getResponseHeaders() const {
return files[fieldname]; return files[fieldname];
} }
} }
return OAIHttpFileElement(); return {{prefix}}HttpFileElement();
} }
QByteArray *{{prefix}}HttpRequestWorker::getMultiPartField(const QString &fieldname){ QByteArray *{{prefix}}HttpRequestWorker::getMultiPartField(const QString &fieldname){

View File

@ -70,7 +70,7 @@ signals:
private: private:
QNetworkAccessManager *manager; QNetworkAccessManager *manager;
QMap<QString, QString> headers; QMap<QString, QString> headers;
QMap<QString, OAIHttpFileElement> files; QMap<QString, {{prefix}}HttpFileElement> files;
QMap<QString, QByteArray*> multiPartFields; QMap<QString, QByteArray*> multiPartFields;
QString workingDirectory; QString workingDirectory;
int timeout; int timeout;

View File

@ -3,8 +3,8 @@
#include <QTest> #include <QTest>
#include <QTimer> #include <QTimer>
OAIPet PetApiTests::createRandomPet() { PFXPet PetApiTests::createRandomPet() {
OAIPet pet; PFXPet pet;
qint64 id = QDateTime::currentMSecsSinceEpoch(); qint64 id = QDateTime::currentMSecsSinceEpoch();
pet.setName("monster"); pet.setName("monster");
pet.setId(id); pet.setId(id);
@ -13,14 +13,14 @@ OAIPet PetApiTests::createRandomPet() {
} }
void PetApiTests::findPetsByStatusTest() { void PetApiTests::findPetsByStatusTest() {
OAIPetApi api; PFXPetApi api;
api.setHost(PetStoreHost); api.setHost(PetStoreHost);
QEventLoop loop; QEventLoop loop;
bool petFound = false; bool petFound = false;
connect(&api, &OAIPetApi::findPetsByStatusSignal, [&](QList<OAIPet> pets) { connect(&api, &PFXPetApi::findPetsByStatusSignal, [&](QList<PFXPet> pets) {
petFound = true; petFound = true;
foreach(OAIPet pet, pets) { foreach(PFXPet pet, pets) {
QVERIFY(pet.getStatus().startsWith("available") || pet.getStatus().startsWith("sold")); QVERIFY(pet.getStatus().startsWith("available") || pet.getStatus().startsWith("sold"));
} }
loop.quit(); loop.quit();
@ -33,18 +33,18 @@ void PetApiTests::findPetsByStatusTest() {
} }
void PetApiTests::createAndGetPetTest() { void PetApiTests::createAndGetPetTest() {
OAIPetApi api; PFXPetApi api;
api.setHost(PetStoreHost); api.setHost(PetStoreHost);
QEventLoop loop; QEventLoop loop;
bool petCreated = false; bool petCreated = false;
connect(&api, &OAIPetApi::addPetSignal, [&]() { connect(&api, &PFXPetApi::addPetSignal, [&]() {
// pet created // pet created
petCreated = true; petCreated = true;
loop.quit(); loop.quit();
}); });
OAIPet pet = createRandomPet(); PFXPet pet = createRandomPet();
qint64 id = pet.getId(); qint64 id = pet.getId();
api.addPet(pet); api.addPet(pet);
@ -54,7 +54,7 @@ void PetApiTests::createAndGetPetTest() {
bool petFetched = false; bool petFetched = false;
connect(&api, &OAIPetApi::getPetByIdSignal, [&](OAIPet pet) { connect(&api, &PFXPetApi::getPetByIdSignal, [&](PFXPet pet) {
QVERIFY(pet.getId() > 0); QVERIFY(pet.getId() > 0);
QVERIFY(pet.getStatus().compare("freaky") == 0); QVERIFY(pet.getStatus().compare("freaky") == 0);
loop.quit(); loop.quit();
@ -69,16 +69,16 @@ void PetApiTests::createAndGetPetTest() {
} }
void PetApiTests::updatePetTest() { void PetApiTests::updatePetTest() {
OAIPetApi api; PFXPetApi api;
api.setHost(PetStoreHost); api.setHost(PetStoreHost);
OAIPet pet = createRandomPet(); PFXPet pet = createRandomPet();
OAIPet petToCheck; PFXPet petToCheck;
qint64 id = pet.getId(); qint64 id = pet.getId();
QEventLoop loop; QEventLoop loop;
bool petAdded = false; bool petAdded = false;
connect(&api, &OAIPetApi::addPetSignal, [&](){ connect(&api, &PFXPetApi::addPetSignal, [&](){
petAdded = true; petAdded = true;
loop.quit(); loop.quit();
}); });
@ -92,7 +92,7 @@ void PetApiTests::updatePetTest() {
// fetch it // fetch it
bool petFetched = false; bool petFetched = false;
connect(&api, &OAIPetApi::getPetByIdSignal, this, [&](OAIPet pet) { connect(&api, &PFXPetApi::getPetByIdSignal, this, [&](PFXPet pet) {
petFetched = true; petFetched = true;
petToCheck = pet; petToCheck = pet;
loop.quit(); loop.quit();
@ -106,7 +106,7 @@ void PetApiTests::updatePetTest() {
// update it // update it
bool petUpdated = false; bool petUpdated = false;
connect(&api, &OAIPetApi::updatePetSignal, [&]() { connect(&api, &PFXPetApi::updatePetSignal, [&]() {
petUpdated = true; petUpdated = true;
loop.quit(); loop.quit();
}); });
@ -120,7 +120,7 @@ void PetApiTests::updatePetTest() {
// check it // check it
bool petFetched2 = false; bool petFetched2 = false;
connect(&api, &OAIPetApi::getPetByIdSignal, [&](OAIPet pet) { connect(&api, &PFXPetApi::getPetByIdSignal, [&](PFXPet pet) {
petFetched2 = true; petFetched2 = true;
QVERIFY(pet.getId() == petToCheck.getId()); QVERIFY(pet.getId() == petToCheck.getId());
QVERIFY(pet.getStatus().compare(petToCheck.getStatus()) == 0); QVERIFY(pet.getStatus().compare(petToCheck.getStatus()) == 0);
@ -133,17 +133,17 @@ void PetApiTests::updatePetTest() {
} }
void PetApiTests::updatePetWithFormTest() { void PetApiTests::updatePetWithFormTest() {
OAIPetApi api; PFXPetApi api;
api.setHost(PetStoreHost); api.setHost(PetStoreHost);
OAIPet pet = createRandomPet(); PFXPet pet = createRandomPet();
OAIPet petToCheck; PFXPet petToCheck;
qint64 id = pet.getId(); qint64 id = pet.getId();
QEventLoop loop; QEventLoop loop;
// create pet // create pet
bool petAdded = false; bool petAdded = false;
connect(&api, &OAIPetApi::addPetSignal, [&](){ connect(&api, &PFXPetApi::addPetSignal, [&](){
petAdded = true; petAdded = true;
loop.quit(); loop.quit();
}); });
@ -155,7 +155,7 @@ void PetApiTests::updatePetWithFormTest() {
// fetch it // fetch it
bool petFetched = false; bool petFetched = false;
connect(&api, &OAIPetApi::getPetByIdSignal, [&](OAIPet pet) { connect(&api, &PFXPetApi::getPetByIdSignal, [&](PFXPet pet) {
petFetched = true; petFetched = true;
petToCheck = pet; petToCheck = pet;
loop.quit(); loop.quit();
@ -168,7 +168,7 @@ void PetApiTests::updatePetWithFormTest() {
// update it // update it
bool petUpdated = false; bool petUpdated = false;
connect(&api, &OAIPetApi::updatePetWithFormSignal, [&](){ connect(&api, &PFXPetApi::updatePetWithFormSignal, [&](){
petUpdated = true; petUpdated = true;
loop.quit(); loop.quit();
}); });
@ -181,7 +181,7 @@ void PetApiTests::updatePetWithFormTest() {
// fetch it // fetch it
bool petUpdated2 = false; bool petUpdated2 = false;
connect(&api, &OAIPetApi::getPetByIdSignal, [&](OAIPet pet) { connect(&api, &PFXPetApi::getPetByIdSignal, [&](PFXPet pet) {
petUpdated2 = true; petUpdated2 = true;
QVERIFY(pet.getName().compare(QString("gorilla")) == 0); QVERIFY(pet.getName().compare(QString("gorilla")) == 0);
loop.quit(); loop.quit();

View File

@ -1,13 +1,13 @@
#pragma once #pragma once
#include "../client/OAIPetApi.h" #include "../client/PFXPetApi.h"
using namespace OpenAPI; using namespace test_namespace;
class PetApiTests: public QObject { class PetApiTests: public QObject {
Q_OBJECT Q_OBJECT
OAIPet createRandomPet(); PFXPet createRandomPet();
private slots: private slots:
void findPetsByStatusTest(); void findPetsByStatusTest();

View File

@ -16,7 +16,7 @@ CONFIG += c++11
TEMPLATE = app TEMPLATE = app
include(../client/client.pri) include(../client/PFXclient.pri)
SOURCES += main.cpp \ SOURCES += main.cpp \
PetApiTests.cpp \ PetApiTests.cpp \

View File

@ -5,24 +5,24 @@
#include <QDebug> #include <QDebug>
void StoreApiTests::placeOrderTest() { void StoreApiTests::placeOrderTest() {
OAIStoreApi api; PFXStoreApi api;
api.setHost(PetStoreHost); api.setHost(PetStoreHost);
QEventLoop loop; QEventLoop loop;
bool orderPlaced = false; bool orderPlaced = false;
connect(&api, &OAIStoreApi::placeOrderSignal, [&](OAIOrder order) { connect(&api, &PFXStoreApi::placeOrderSignal, [&](PFXOrder order) {
orderPlaced = true; orderPlaced = true;
QVERIFY(order.getPetId() == 10000); QVERIFY(order.getPetId() == 10000);
QVERIFY((order.getId() == 500)); QVERIFY((order.getId() == 500));
qDebug() << order.getShipDate(); qDebug() << order.getShipDate();
loop.quit(); loop.quit();
}); });
connect(&api, &OAIStoreApi::placeOrderSignalE, [&](){ connect(&api, &PFXStoreApi::placeOrderSignalE, [&](){
QFAIL("shouldn't trigger error"); QFAIL("shouldn't trigger error");
loop.quit(); loop.quit();
}); });
OAIOrder order; PFXOrder order;
order.setId(500); order.setId(500);
order.setQuantity(10); order.setQuantity(10);
order.setPetId(10000); order.setPetId(10000);
@ -37,12 +37,12 @@ void StoreApiTests::placeOrderTest() {
} }
void StoreApiTests::getOrderByIdTest() { void StoreApiTests::getOrderByIdTest() {
OAIStoreApi api; PFXStoreApi api;
api.setHost(PetStoreHost); api.setHost(PetStoreHost);
QEventLoop loop; QEventLoop loop;
bool orderFetched = false; bool orderFetched = false;
connect(&api, &OAIStoreApi::getOrderByIdSignal, [&](OAIOrder order) { connect(&api, &PFXStoreApi::getOrderByIdSignal, [&](PFXOrder order) {
orderFetched = true; orderFetched = true;
QVERIFY(order.getPetId() == 10000); QVERIFY(order.getPetId() == 10000);
QVERIFY((order.getId() == 500)); QVERIFY((order.getId() == 500));
@ -58,12 +58,12 @@ void StoreApiTests::getOrderByIdTest() {
} }
void StoreApiTests::getInventoryTest() { void StoreApiTests::getInventoryTest() {
OAIStoreApi api; PFXStoreApi api;
api.setHost(PetStoreHost); api.setHost(PetStoreHost);
QEventLoop loop; QEventLoop loop;
bool inventoryFetched = false; bool inventoryFetched = false;
connect(&api, &OAIStoreApi::getInventorySignal, [&](QMap<QString, qint32> status) { connect(&api, &PFXStoreApi::getInventorySignal, [&](QMap<QString, qint32> status) {
inventoryFetched = true; inventoryFetched = true;
for(const auto& key : status.keys()) { for(const auto& key : status.keys()) {
qDebug() << (key) << " Quantities " << status.value(key); qDebug() << (key) << " Quantities " << status.value(key);

View File

@ -1,8 +1,8 @@
#pragma once #pragma once
#include "../client/OAIStoreApi.h" #include "../client/PFXStoreApi.h"
using namespace OpenAPI; using namespace test_namespace;
class StoreApiTests: public QObject { class StoreApiTests: public QObject {
Q_OBJECT Q_OBJECT

View File

@ -4,8 +4,8 @@
#include <QTimer> #include <QTimer>
#include <QDebug> #include <QDebug>
OAIUser UserApiTests::createRandomUser() { PFXUser UserApiTests::createRandomUser() {
OAIUser user; PFXUser user;
user.setId(QDateTime::currentMSecsSinceEpoch()); user.setId(QDateTime::currentMSecsSinceEpoch());
user.setEmail("Jane.Doe@openapitools.io"); user.setEmail("Jane.Doe@openapitools.io");
user.setFirstName("Jane"); user.setFirstName("Jane");
@ -18,12 +18,12 @@ OAIUser UserApiTests::createRandomUser() {
} }
void UserApiTests::createUserTest(){ void UserApiTests::createUserTest(){
OAIUserApi api; PFXUserApi api;
api.setHost(PetStoreHost); api.setHost(PetStoreHost);
QEventLoop loop; QEventLoop loop;
bool userCreated = false; bool userCreated = false;
connect(&api, &OAIUserApi::createUserSignal, [&](){ connect(&api, &PFXUserApi::createUserSignal, [&](){
userCreated = true; userCreated = true;
loop.quit(); loop.quit();
}); });
@ -35,17 +35,17 @@ void UserApiTests::createUserTest(){
} }
void UserApiTests::createUsersWithArrayInputTest(){ void UserApiTests::createUsersWithArrayInputTest(){
OAIUserApi api; PFXUserApi api;
api.setHost(PetStoreHost); api.setHost(PetStoreHost);
QEventLoop loop; QEventLoop loop;
bool usersCreated = false; bool usersCreated = false;
connect(&api, &OAIUserApi::createUsersWithArrayInputSignal, [&](){ connect(&api, &PFXUserApi::createUsersWithArrayInputSignal, [&](){
usersCreated = true; usersCreated = true;
loop.quit(); loop.quit();
}); });
QList<OAIUser> users; QList<PFXUser> users;
users.append(createRandomUser()); users.append(createRandomUser());
users.append(createRandomUser()); users.append(createRandomUser());
users.append(createRandomUser()); users.append(createRandomUser());
@ -56,17 +56,17 @@ void UserApiTests::createUsersWithArrayInputTest(){
} }
void UserApiTests::createUsersWithListInputTest(){ void UserApiTests::createUsersWithListInputTest(){
OAIUserApi api; PFXUserApi api;
api.setHost(PetStoreHost); api.setHost(PetStoreHost);
QEventLoop loop; QEventLoop loop;
bool usersCreated = false; bool usersCreated = false;
connect(&api, &OAIUserApi::createUsersWithListInputSignal, [&](){ connect(&api, &PFXUserApi::createUsersWithListInputSignal, [&](){
usersCreated = true; usersCreated = true;
loop.quit(); loop.quit();
}); });
QList<OAIUser> users; QList<PFXUser> users;
auto johndoe = createRandomUser(); auto johndoe = createRandomUser();
johndoe.setUsername("johndoe"); johndoe.setUsername("johndoe");
auto rambo = createRandomUser(); auto rambo = createRandomUser();
@ -81,12 +81,12 @@ void UserApiTests::createUsersWithListInputTest(){
} }
void UserApiTests::deleteUserTest(){ void UserApiTests::deleteUserTest(){
OAIUserApi api; PFXUserApi api;
api.setHost(PetStoreHost); api.setHost(PetStoreHost);
QEventLoop loop; QEventLoop loop;
bool userDeleted = false; bool userDeleted = false;
connect(&api, &OAIUserApi::deleteUserSignal, [&](){ connect(&api, &PFXUserApi::deleteUserSignal, [&](){
userDeleted = true; userDeleted = true;
loop.quit(); loop.quit();
}); });
@ -98,12 +98,12 @@ void UserApiTests::deleteUserTest(){
} }
void UserApiTests::getUserByNameTest(){ void UserApiTests::getUserByNameTest(){
OAIUserApi api; PFXUserApi api;
api.setHost(PetStoreHost); api.setHost(PetStoreHost);
QEventLoop loop; QEventLoop loop;
bool userFetched = false; bool userFetched = false;
connect(&api, &OAIUserApi::getUserByNameSignal, [&](OAIUser summary) { connect(&api, &PFXUserApi::getUserByNameSignal, [&](PFXUser summary) {
userFetched = true; userFetched = true;
qDebug() << summary.getUsername(); qDebug() << summary.getUsername();
QVERIFY(summary.getUsername() == "johndoe"); QVERIFY(summary.getUsername() == "johndoe");
@ -117,12 +117,12 @@ void UserApiTests::getUserByNameTest(){
} }
void UserApiTests::loginUserTest(){ void UserApiTests::loginUserTest(){
OAIUserApi api; PFXUserApi api;
api.setHost(PetStoreHost); api.setHost(PetStoreHost);
QEventLoop loop; QEventLoop loop;
bool userLogged = false; bool userLogged = false;
connect(&api, &OAIUserApi::loginUserSignal, [&](QString summary) { connect(&api, &PFXUserApi::loginUserSignal, [&](QString summary) {
userLogged = true; userLogged = true;
qDebug() << summary; qDebug() << summary;
loop.quit(); loop.quit();
@ -135,12 +135,12 @@ void UserApiTests::loginUserTest(){
} }
void UserApiTests::logoutUserTest(){ void UserApiTests::logoutUserTest(){
OAIUserApi api; PFXUserApi api;
api.setHost(PetStoreHost); api.setHost(PetStoreHost);
QEventLoop loop; QEventLoop loop;
bool userLoggedOut = false; bool userLoggedOut = false;
connect(&api, &OAIUserApi::logoutUserSignal, [&](){ connect(&api, &PFXUserApi::logoutUserSignal, [&](){
userLoggedOut = true; userLoggedOut = true;
loop.quit(); loop.quit();
}); });
@ -152,12 +152,12 @@ void UserApiTests::logoutUserTest(){
} }
void UserApiTests::updateUserTest(){ void UserApiTests::updateUserTest(){
OAIUserApi api; PFXUserApi api;
api.setHost(PetStoreHost); api.setHost(PetStoreHost);
QEventLoop loop; QEventLoop loop;
bool userUpdated = false; bool userUpdated = false;
connect(&api, &OAIUserApi::updateUserSignal, [&]() { connect(&api, &PFXUserApi::updateUserSignal, [&]() {
userUpdated = true; userUpdated = true;
loop.quit(); loop.quit();
}); });

View File

@ -1,13 +1,13 @@
#pragma once #pragma once
#include "../client/OAIUserApi.h" #include "../client/PFXUserApi.h"
using namespace OpenAPI; using namespace test_namespace;
class UserApiTests: public QObject { class UserApiTests: public QObject {
Q_OBJECT Q_OBJECT
OAIUser createRandomUser(); PFXUser createRandomUser();
private slots: private slots:
void createUserTest(); void createUserTest();

View File

@ -1,105 +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.
*/
#ifndef OAI_OAIPetApi_H
#define OAI_OAIPetApi_H
#include "OAIHttpRequest.h"
#include "OAIApiResponse.h"
#include "OAIHttpFileElement.h"
#include "OAIPet.h"
#include <QString>
#include <QObject>
namespace OpenAPI {
class OAIPetApi: public QObject {
Q_OBJECT
public:
OAIPetApi();
OAIPetApi(const QString& host, const QString& basePath, const int toutMs = 0);
~OAIPetApi();
void setBasePath(const QString& basePath);
void setHost(const QString& host);
void setApiTimeOutMs(const int tout);
void setWorkingDirectory(const QString& path);
void addHeaders(const QString& key, const QString& value);
void addPet(const OAIPet& body);
void deletePet(const qint64& pet_id, const QString& api_key);
void findPetsByStatus(const QList<QString>& status);
void findPetsByTags(const QList<QString>& tags);
void getPetById(const qint64& pet_id);
void updatePet(const OAIPet& body);
void updatePetWithForm(const qint64& pet_id, const QString& name, const QString& status);
void uploadFile(const qint64& pet_id, const QString& additional_metadata, const OAIHttpFileElement& file);
private:
QString basePath;
QString host;
QString workingDirectory;
int timeout;
QMap<QString, QString> defaultHeaders;
void addPetCallback (OAIHttpRequestWorker * worker);
void deletePetCallback (OAIHttpRequestWorker * worker);
void findPetsByStatusCallback (OAIHttpRequestWorker * worker);
void findPetsByTagsCallback (OAIHttpRequestWorker * worker);
void getPetByIdCallback (OAIHttpRequestWorker * worker);
void updatePetCallback (OAIHttpRequestWorker * worker);
void updatePetWithFormCallback (OAIHttpRequestWorker * worker);
void uploadFileCallback (OAIHttpRequestWorker * worker);
signals:
void addPetSignal();
void deletePetSignal();
void findPetsByStatusSignal(QList<OAIPet> summary);
void findPetsByTagsSignal(QList<OAIPet> summary);
void getPetByIdSignal(OAIPet summary);
void updatePetSignal();
void updatePetWithFormSignal();
void uploadFileSignal(OAIApiResponse summary);
void addPetSignalFull(OAIHttpRequestWorker* worker);
void deletePetSignalFull(OAIHttpRequestWorker* worker);
void findPetsByStatusSignalFull(OAIHttpRequestWorker* worker, QList<OAIPet> summary);
void findPetsByTagsSignalFull(OAIHttpRequestWorker* worker, QList<OAIPet> summary);
void getPetByIdSignalFull(OAIHttpRequestWorker* worker, OAIPet summary);
void updatePetSignalFull(OAIHttpRequestWorker* worker);
void updatePetWithFormSignalFull(OAIHttpRequestWorker* worker);
void uploadFileSignalFull(OAIHttpRequestWorker* worker, OAIApiResponse summary);
void addPetSignalE(QNetworkReply::NetworkError error_type, QString error_str);
void deletePetSignalE(QNetworkReply::NetworkError error_type, QString error_str);
void findPetsByStatusSignalE(QList<OAIPet> summary, QNetworkReply::NetworkError error_type, QString error_str);
void findPetsByTagsSignalE(QList<OAIPet> summary, QNetworkReply::NetworkError error_type, QString error_str);
void getPetByIdSignalE(OAIPet summary, QNetworkReply::NetworkError error_type, QString error_str);
void updatePetSignalE(QNetworkReply::NetworkError error_type, QString error_str);
void updatePetWithFormSignalE(QNetworkReply::NetworkError error_type, QString error_str);
void uploadFileSignalE(OAIApiResponse summary, QNetworkReply::NetworkError error_type, QString error_str);
void addPetSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void deletePetSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void findPetsByStatusSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void findPetsByTagsSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void getPetByIdSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void updatePetSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void updatePetWithFormSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void uploadFileSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
};
}
#endif

View File

@ -11,32 +11,32 @@
*/ */
#include "OAIApiResponse.h" #include "PFXApiResponse.h"
#include <QJsonDocument> #include <QJsonDocument>
#include <QJsonArray> #include <QJsonArray>
#include <QObject> #include <QObject>
#include <QDebug> #include <QDebug>
#include "OAIHelpers.h" #include "PFXHelpers.h"
namespace OpenAPI { namespace test_namespace {
OAIApiResponse::OAIApiResponse(QString json) { PFXApiResponse::PFXApiResponse(QString json) {
this->initializeModel(); this->initializeModel();
this->fromJson(json); this->fromJson(json);
} }
OAIApiResponse::OAIApiResponse() { PFXApiResponse::PFXApiResponse() {
this->initializeModel(); this->initializeModel();
} }
OAIApiResponse::~OAIApiResponse() { PFXApiResponse::~PFXApiResponse() {
} }
void void
OAIApiResponse::initializeModel() { PFXApiResponse::initializeModel() {
m_code_isSet = false; m_code_isSet = false;
m_code_isValid = false; m_code_isValid = false;
@ -50,7 +50,7 @@ OAIApiResponse::initializeModel() {
} }
void void
OAIApiResponse::fromJson(QString jsonString) { PFXApiResponse::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();
@ -58,21 +58,21 @@ OAIApiResponse::fromJson(QString jsonString) {
} }
void void
OAIApiResponse::fromJsonObject(QJsonObject json) { PFXApiResponse::fromJsonObject(QJsonObject json) {
m_code_isValid = ::OpenAPI::fromJsonValue(code, json[QString("code")]); m_code_isValid = ::test_namespace::fromJsonValue(code, json[QString("code")]);
m_code_isSet = !json[QString("code")].isNull() && m_code_isValid; m_code_isSet = !json[QString("code")].isNull() && m_code_isValid;
m_type_isValid = ::OpenAPI::fromJsonValue(type, json[QString("type")]); m_type_isValid = ::test_namespace::fromJsonValue(type, json[QString("type")]);
m_type_isSet = !json[QString("type")].isNull() && m_type_isValid; m_type_isSet = !json[QString("type")].isNull() && m_type_isValid;
m_message_isValid = ::OpenAPI::fromJsonValue(message, json[QString("message")]); m_message_isValid = ::test_namespace::fromJsonValue(message, json[QString("message")]);
m_message_isSet = !json[QString("message")].isNull() && m_message_isValid; m_message_isSet = !json[QString("message")].isNull() && m_message_isValid;
} }
QString QString
OAIApiResponse::asJson () const { PFXApiResponse::asJson () const {
QJsonObject obj = this->asJsonObject(); QJsonObject obj = this->asJsonObject();
QJsonDocument doc(obj); QJsonDocument doc(obj);
QByteArray bytes = doc.toJson(); QByteArray bytes = doc.toJson();
@ -80,55 +80,55 @@ OAIApiResponse::asJson () const {
} }
QJsonObject QJsonObject
OAIApiResponse::asJsonObject() const { PFXApiResponse::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"), ::test_namespace::toJsonValue(code));
} }
if(m_type_isSet){ if(m_type_isSet){
obj.insert(QString("type"), ::OpenAPI::toJsonValue(type)); obj.insert(QString("type"), ::test_namespace::toJsonValue(type));
} }
if(m_message_isSet){ if(m_message_isSet){
obj.insert(QString("message"), ::OpenAPI::toJsonValue(message)); obj.insert(QString("message"), ::test_namespace::toJsonValue(message));
} }
return obj; return obj;
} }
qint32 qint32
OAIApiResponse::getCode() const { PFXApiResponse::getCode() const {
return code; return code;
} }
void void
OAIApiResponse::setCode(const qint32 &code) { PFXApiResponse::setCode(const qint32 &code) {
this->code = code; this->code = code;
this->m_code_isSet = true; this->m_code_isSet = true;
} }
QString QString
OAIApiResponse::getType() const { PFXApiResponse::getType() const {
return type; return type;
} }
void void
OAIApiResponse::setType(const QString &type) { PFXApiResponse::setType(const QString &type) {
this->type = type; this->type = type;
this->m_type_isSet = true; this->m_type_isSet = true;
} }
QString QString
OAIApiResponse::getMessage() const { PFXApiResponse::getMessage() const {
return message; return message;
} }
void void
OAIApiResponse::setMessage(const QString &message) { PFXApiResponse::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 { PFXApiResponse::isSet() const {
bool isObjectUpdated = false; bool isObjectUpdated = false;
do{ do{
if(m_code_isSet){ isObjectUpdated = true; break;} if(m_code_isSet){ isObjectUpdated = true; break;}
@ -141,7 +141,7 @@ OAIApiResponse::isSet() const {
} }
bool bool
OAIApiResponse::isValid() const { PFXApiResponse::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;
} }

View File

@ -11,30 +11,30 @@
*/ */
/* /*
* OAIApiResponse.h * PFXApiResponse.h
* *
* Describes the result of uploading an image resource * Describes the result of uploading an image resource
*/ */
#ifndef OAIApiResponse_H #ifndef PFXApiResponse_H
#define OAIApiResponse_H #define PFXApiResponse_H
#include <QJsonObject> #include <QJsonObject>
#include <QString> #include <QString>
#include "OAIObject.h" #include "PFXObject.h"
#include "OAIEnum.h" #include "PFXEnum.h"
namespace OpenAPI { namespace test_namespace {
class OAIApiResponse: public OAIObject { class PFXApiResponse: public PFXObject {
public: public:
OAIApiResponse(); PFXApiResponse();
OAIApiResponse(QString json); PFXApiResponse(QString json);
~OAIApiResponse() override; ~PFXApiResponse() override;
QString asJson () const override; QString asJson () const override;
QJsonObject asJsonObject() const override; QJsonObject asJsonObject() const override;
@ -77,6 +77,6 @@ private:
} }
Q_DECLARE_METATYPE(OpenAPI::OAIApiResponse) Q_DECLARE_METATYPE(test_namespace::PFXApiResponse)
#endif // OAIApiResponse_H #endif // PFXApiResponse_H

View File

@ -11,32 +11,32 @@
*/ */
#include "OAICategory.h" #include "PFXCategory.h"
#include <QJsonDocument> #include <QJsonDocument>
#include <QJsonArray> #include <QJsonArray>
#include <QObject> #include <QObject>
#include <QDebug> #include <QDebug>
#include "OAIHelpers.h" #include "PFXHelpers.h"
namespace OpenAPI { namespace test_namespace {
OAICategory::OAICategory(QString json) { PFXCategory::PFXCategory(QString json) {
this->initializeModel(); this->initializeModel();
this->fromJson(json); this->fromJson(json);
} }
OAICategory::OAICategory() { PFXCategory::PFXCategory() {
this->initializeModel(); this->initializeModel();
} }
OAICategory::~OAICategory() { PFXCategory::~PFXCategory() {
} }
void void
OAICategory::initializeModel() { PFXCategory::initializeModel() {
m_id_isSet = false; m_id_isSet = false;
m_id_isValid = false; m_id_isValid = false;
@ -47,7 +47,7 @@ OAICategory::initializeModel() {
} }
void void
OAICategory::fromJson(QString jsonString) { PFXCategory::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();
@ -55,18 +55,18 @@ OAICategory::fromJson(QString jsonString) {
} }
void void
OAICategory::fromJsonObject(QJsonObject json) { PFXCategory::fromJsonObject(QJsonObject json) {
m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]);
m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; m_id_isSet = !json[QString("id")].isNull() && m_id_isValid;
m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]); m_name_isValid = ::test_namespace::fromJsonValue(name, json[QString("name")]);
m_name_isSet = !json[QString("name")].isNull() && m_name_isValid; m_name_isSet = !json[QString("name")].isNull() && m_name_isValid;
} }
QString QString
OAICategory::asJson () const { PFXCategory::asJson () const {
QJsonObject obj = this->asJsonObject(); QJsonObject obj = this->asJsonObject();
QJsonDocument doc(obj); QJsonDocument doc(obj);
QByteArray bytes = doc.toJson(); QByteArray bytes = doc.toJson();
@ -74,41 +74,41 @@ OAICategory::asJson () const {
} }
QJsonObject QJsonObject
OAICategory::asJsonObject() const { PFXCategory::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"), ::test_namespace::toJsonValue(id));
} }
if(m_name_isSet){ if(m_name_isSet){
obj.insert(QString("name"), ::OpenAPI::toJsonValue(name)); obj.insert(QString("name"), ::test_namespace::toJsonValue(name));
} }
return obj; return obj;
} }
qint64 qint64
OAICategory::getId() const { PFXCategory::getId() const {
return id; return id;
} }
void void
OAICategory::setId(const qint64 &id) { PFXCategory::setId(const qint64 &id) {
this->id = id; this->id = id;
this->m_id_isSet = true; this->m_id_isSet = true;
} }
QString QString
OAICategory::getName() const { PFXCategory::getName() const {
return name; return name;
} }
void void
OAICategory::setName(const QString &name) { PFXCategory::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 { PFXCategory::isSet() const {
bool isObjectUpdated = false; bool isObjectUpdated = false;
do{ do{
if(m_id_isSet){ isObjectUpdated = true; break;} if(m_id_isSet){ isObjectUpdated = true; break;}
@ -119,7 +119,7 @@ OAICategory::isSet() const {
} }
bool bool
OAICategory::isValid() const { PFXCategory::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;
} }

View File

@ -11,30 +11,30 @@
*/ */
/* /*
* OAICategory.h * PFXCategory.h
* *
* A category for a pet * A category for a pet
*/ */
#ifndef OAICategory_H #ifndef PFXCategory_H
#define OAICategory_H #define PFXCategory_H
#include <QJsonObject> #include <QJsonObject>
#include <QString> #include <QString>
#include "OAIObject.h" #include "PFXObject.h"
#include "OAIEnum.h" #include "PFXEnum.h"
namespace OpenAPI { namespace test_namespace {
class OAICategory: public OAIObject { class PFXCategory: public PFXObject {
public: public:
OAICategory(); PFXCategory();
OAICategory(QString json); PFXCategory(QString json);
~OAICategory() override; ~PFXCategory() override;
QString asJson () const override; QString asJson () const override;
QJsonObject asJsonObject() const override; QJsonObject asJsonObject() const override;
@ -69,6 +69,6 @@ private:
} }
Q_DECLARE_METATYPE(OpenAPI::OAICategory) Q_DECLARE_METATYPE(test_namespace::PFXCategory)
#endif // OAICategory_H #endif // PFXCategory_H

View File

@ -10,26 +10,26 @@
* Do not edit the class manually. * Do not edit the class manually.
*/ */
#ifndef OAI_ENUM_H #ifndef PFX_ENUM_H
#define OAI_ENUM_H #define PFX_ENUM_H
#include <QString> #include <QString>
#include <QJsonValue> #include <QJsonValue>
#include <QMetaType> #include <QMetaType>
namespace OpenAPI { namespace test_namespace {
class OAIEnum { class PFXEnum {
public: public:
OAIEnum() { PFXEnum() {
} }
OAIEnum(QString jsonString) { PFXEnum(QString jsonString) {
fromJson(jsonString); fromJson(jsonString);
} }
virtual ~OAIEnum(){ virtual ~PFXEnum(){
} }
@ -62,6 +62,6 @@ private :
} }
Q_DECLARE_METATYPE(OpenAPI::OAIEnum) Q_DECLARE_METATYPE(test_namespace::PFXEnum)
#endif // OAI_ENUM_H #endif // PFX_ENUM_H

View File

@ -11,10 +11,10 @@
*/ */
#include <QDebug> #include <QDebug>
#include "OAIHelpers.h" #include "PFXHelpers.h"
namespace OpenAPI { namespace test_namespace {
QString QString
@ -65,18 +65,18 @@ toStringValue(const double &value){
} }
QString QString
toStringValue(const OAIObject &value){ toStringValue(const PFXObject &value){
return value.asJson(); return value.asJson();
} }
QString QString
toStringValue(const OAIEnum &value){ toStringValue(const PFXEnum &value){
return value.asJson(); return value.asJson();
} }
QString QString
toStringValue(const OAIHttpFileElement &value){ toStringValue(const PFXHttpFileElement &value){
return value.asJson(); return value.asJson();
} }
@ -127,17 +127,17 @@ toJsonValue(const double &value){
} }
QJsonValue QJsonValue
toJsonValue(const OAIObject &value){ toJsonValue(const PFXObject &value){
return value.asJsonObject(); return value.asJsonObject();
} }
QJsonValue QJsonValue
toJsonValue(const OAIEnum &value){ toJsonValue(const PFXEnum &value){
return value.asJsonValue(); return value.asJsonValue();
} }
QJsonValue QJsonValue
toJsonValue(const OAIHttpFileElement &value){ toJsonValue(const PFXHttpFileElement &value){
return value.asJsonValue(); return value.asJsonValue();
} }
@ -231,13 +231,13 @@ fromStringValue(const QString &inStr, double &value){
} }
bool bool
fromStringValue(const QString &inStr, OAIEnum &value){ fromStringValue(const QString &inStr, PFXEnum &value){
value.fromJson(inStr); value.fromJson(inStr);
return true; return true;
} }
bool bool
fromStringValue(const QString &inStr, OAIHttpFileElement &value){ fromStringValue(const QString &inStr, PFXHttpFileElement &value){
return value.fromStringValue(inStr); return value.fromStringValue(inStr);
} }
@ -352,7 +352,7 @@ fromJsonValue(double &value, const QJsonValue &jval){
} }
bool bool
fromJsonValue(OAIObject &value, const QJsonValue &jval){ fromJsonValue(PFXObject &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
if(jval.isObject()){ if(jval.isObject()){
value.fromJsonObject(jval.toObject()); value.fromJsonObject(jval.toObject());
@ -364,13 +364,13 @@ fromJsonValue(OAIObject &value, const QJsonValue &jval){
} }
bool bool
fromJsonValue(OAIEnum &value, const QJsonValue &jval){ fromJsonValue(PFXEnum &value, const QJsonValue &jval){
value.fromJsonValue(jval); value.fromJsonValue(jval);
return true; return true;
} }
bool bool
fromJsonValue(OAIHttpFileElement &value, const QJsonValue &jval){ fromJsonValue(PFXHttpFileElement &value, const QJsonValue &jval){
return value.fromJsonValue(jval); return value.fromJsonValue(jval);
} }

View File

@ -10,8 +10,8 @@
* Do not edit the class manually. * Do not edit the class manually.
*/ */
#ifndef OAI_HELPERS_H #ifndef PFX_HELPERS_H
#define OAI_HELPERS_H #define PFX_HELPERS_H
#include <QJsonObject> #include <QJsonObject>
#include <QJsonValue> #include <QJsonValue>
@ -23,11 +23,11 @@
#include <QDate> #include <QDate>
#include <QVariant> #include <QVariant>
#include "OAIObject.h" #include "PFXObject.h"
#include "OAIEnum.h" #include "PFXEnum.h"
#include "OAIHttpFileElement.h" #include "PFXHttpFileElement.h"
namespace OpenAPI { namespace test_namespace {
template <typename T> QString template <typename T> QString
toStringValue(const QList<T> &val); toStringValue(const QList<T> &val);
@ -59,9 +59,9 @@ namespace OpenAPI {
QString toStringValue(const bool &value); QString toStringValue(const bool &value);
QString toStringValue(const float &value); QString toStringValue(const float &value);
QString toStringValue(const double &value); QString toStringValue(const double &value);
QString toStringValue(const OAIObject &value); QString toStringValue(const PFXObject &value);
QString toStringValue(const OAIEnum &value); QString toStringValue(const PFXEnum &value);
QString toStringValue(const OAIHttpFileElement &value); QString toStringValue(const PFXHttpFileElement &value);
template <typename T> template <typename T>
QString toStringValue(const QList<T> &val) { QString toStringValue(const QList<T> &val) {
@ -84,9 +84,9 @@ namespace OpenAPI {
QJsonValue toJsonValue(const bool &value); QJsonValue toJsonValue(const bool &value);
QJsonValue toJsonValue(const float &value); QJsonValue toJsonValue(const float &value);
QJsonValue toJsonValue(const double &value); QJsonValue toJsonValue(const double &value);
QJsonValue toJsonValue(const OAIObject &value); QJsonValue toJsonValue(const PFXObject &value);
QJsonValue toJsonValue(const OAIEnum &value); QJsonValue toJsonValue(const PFXEnum &value);
QJsonValue toJsonValue(const OAIHttpFileElement &value); QJsonValue toJsonValue(const PFXHttpFileElement &value);
template <typename T> template <typename T>
QJsonValue toJsonValue(const QList<T> &val) { QJsonValue toJsonValue(const QList<T> &val) {
@ -115,9 +115,9 @@ namespace OpenAPI {
bool fromStringValue(const QString &inStr, bool &value); bool fromStringValue(const QString &inStr, bool &value);
bool fromStringValue(const QString &inStr, float &value); bool fromStringValue(const QString &inStr, float &value);
bool fromStringValue(const QString &inStr, double &value); bool fromStringValue(const QString &inStr, double &value);
bool fromStringValue(const QString &inStr, OAIObject &value); bool fromStringValue(const QString &inStr, PFXObject &value);
bool fromStringValue(const QString &inStr, OAIEnum &value); bool fromStringValue(const QString &inStr, PFXEnum &value);
bool fromStringValue(const QString &inStr, OAIHttpFileElement &value); bool fromStringValue(const QString &inStr, PFXHttpFileElement &value);
template <typename T> template <typename T>
bool fromStringValue(const QList<QString> &inStr, QList<T> &val) { bool fromStringValue(const QList<QString> &inStr, QList<T> &val) {
@ -150,9 +150,9 @@ namespace OpenAPI {
bool fromJsonValue(bool &value, const QJsonValue &jval); bool fromJsonValue(bool &value, const QJsonValue &jval);
bool fromJsonValue(float &value, const QJsonValue &jval); bool fromJsonValue(float &value, const QJsonValue &jval);
bool fromJsonValue(double &value, const QJsonValue &jval); bool fromJsonValue(double &value, const QJsonValue &jval);
bool fromJsonValue(OAIObject &value, const QJsonValue &jval); bool fromJsonValue(PFXObject &value, const QJsonValue &jval);
bool fromJsonValue(OAIEnum &value, const QJsonValue &jval); bool fromJsonValue(PFXEnum &value, const QJsonValue &jval);
bool fromJsonValue(OAIHttpFileElement &value, const QJsonValue &jval); bool fromJsonValue(PFXHttpFileElement &value, const QJsonValue &jval);
template <typename T> template <typename T>
bool fromJsonValue(QList<T> &val, const QJsonValue &jval) { bool fromJsonValue(QList<T> &val, const QJsonValue &jval) {
@ -189,4 +189,4 @@ namespace OpenAPI {
} }
#endif // OAI_HELPERS_H #endif // PFX_HELPERS_H

View File

@ -16,37 +16,37 @@
#include <QJsonDocument> #include <QJsonDocument>
#include <QJsonObject> #include <QJsonObject>
#include "OAIHttpFileElement.h" #include "PFXHttpFileElement.h"
namespace OpenAPI { namespace test_namespace {
void void
OAIHttpFileElement::setMimeType(const QString &mime){ PFXHttpFileElement::setMimeType(const QString &mime){
mime_type = mime; mime_type = mime;
} }
void void
OAIHttpFileElement::setFileName(const QString &name){ PFXHttpFileElement::setFileName(const QString &name){
local_filename = name; local_filename = name;
} }
void void
OAIHttpFileElement::setVariableName(const QString &name){ PFXHttpFileElement::setVariableName(const QString &name){
variable_name = name; variable_name = name;
} }
void void
OAIHttpFileElement::setRequestFileName(const QString &name){ PFXHttpFileElement::setRequestFileName(const QString &name){
request_filename = name; request_filename = name;
} }
bool bool
OAIHttpFileElement::isSet() const { PFXHttpFileElement::isSet() const {
return !local_filename.isEmpty() || !request_filename.isEmpty(); return !local_filename.isEmpty() || !request_filename.isEmpty();
} }
QString QString
OAIHttpFileElement::asJson() const{ PFXHttpFileElement::asJson() const{
QFile file(local_filename); QFile file(local_filename);
QByteArray bArray; QByteArray bArray;
bool result = false; bool result = false;
@ -62,7 +62,7 @@ OAIHttpFileElement::asJson() const{
} }
QJsonValue QJsonValue
OAIHttpFileElement::asJsonValue() const{ PFXHttpFileElement::asJsonValue() const{
QFile file(local_filename); QFile file(local_filename);
QByteArray bArray; QByteArray bArray;
bool result = false; bool result = false;
@ -78,7 +78,7 @@ OAIHttpFileElement::asJsonValue() const{
} }
bool bool
OAIHttpFileElement::fromStringValue(const QString &instr){ PFXHttpFileElement::fromStringValue(const QString &instr){
QFile file(local_filename); QFile file(local_filename);
bool result = false; bool result = false;
if(file.exists()) { if(file.exists()) {
@ -94,7 +94,7 @@ OAIHttpFileElement::fromStringValue(const QString &instr){
} }
bool bool
OAIHttpFileElement::fromJsonValue(const QJsonValue &jval) { PFXHttpFileElement::fromJsonValue(const QJsonValue &jval) {
QFile file(local_filename); QFile file(local_filename);
bool result = false; bool result = false;
if(file.exists()) { if(file.exists()) {
@ -110,7 +110,7 @@ OAIHttpFileElement::fromJsonValue(const QJsonValue &jval) {
} }
QByteArray QByteArray
OAIHttpFileElement::asByteArray() const { PFXHttpFileElement::asByteArray() const {
QFile file(local_filename); QFile file(local_filename);
QByteArray bArray; QByteArray bArray;
bool result = false; bool result = false;
@ -126,7 +126,7 @@ OAIHttpFileElement::asByteArray() const {
} }
bool bool
OAIHttpFileElement::fromByteArray(const QByteArray& bytes){ PFXHttpFileElement::fromByteArray(const QByteArray& bytes){
QFile file(local_filename); QFile file(local_filename);
bool result = false; bool result = false;
if(file.exists()){ if(file.exists()){
@ -142,7 +142,7 @@ OAIHttpFileElement::fromByteArray(const QByteArray& bytes){
} }
bool bool
OAIHttpFileElement::saveToFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime, const QByteArray& bytes){ PFXHttpFileElement::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);
@ -151,7 +151,7 @@ OAIHttpFileElement::saveToFile(const QString &varName, const QString &localFName
} }
QByteArray QByteArray
OAIHttpFileElement::loadFromFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime){ PFXHttpFileElement::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);

View File

@ -10,17 +10,17 @@
* Do not edit the class manually. * Do not edit the class manually.
*/ */
#ifndef OAI_HTTP_FILE_ELEMENT_H #ifndef PFX_HTTP_FILE_ELEMENT_H
#define OAI_HTTP_FILE_ELEMENT_H #define PFX_HTTP_FILE_ELEMENT_H
#include <QJsonValue> #include <QJsonValue>
#include <QMetaType> #include <QMetaType>
#include <QString> #include <QString>
namespace OpenAPI { namespace test_namespace {
class OAIHttpFileElement { class PFXHttpFileElement {
public: public:
QString variable_name; QString variable_name;
@ -44,6 +44,6 @@ public:
} }
Q_DECLARE_METATYPE(OpenAPI::OAIHttpFileElement) Q_DECLARE_METATYPE(test_namespace::PFXHttpFileElement)
#endif // OAI_HTTP_FILE_ELEMENT_H #endif // PFX_HTTP_FILE_ELEMENT_H

View File

@ -20,33 +20,33 @@
#include <QBuffer> #include <QBuffer>
#include <QtGlobal> #include <QtGlobal>
#include "OAIHttpRequest.h" #include "PFXHttpRequest.h"
namespace OpenAPI { namespace test_namespace {
OAIHttpRequestInput::OAIHttpRequestInput() { PFXHttpRequestInput::PFXHttpRequestInput() {
initialize(); initialize();
} }
OAIHttpRequestInput::OAIHttpRequestInput(QString v_url_str, QString v_http_method) { PFXHttpRequestInput::PFXHttpRequestInput(QString v_url_str, QString v_http_method) {
initialize(); initialize();
url_str = v_url_str; url_str = v_url_str;
http_method = v_http_method; http_method = v_http_method;
} }
void OAIHttpRequestInput::initialize() { void PFXHttpRequestInput::initialize() {
var_layout = NOT_SET; var_layout = NOT_SET;
url_str = ""; url_str = "";
http_method = "GET"; http_method = "GET";
} }
void OAIHttpRequestInput::add_var(QString key, QString value) { void PFXHttpRequestInput::add_var(QString key, QString value) {
vars[key] = value; vars[key] = value;
} }
void OAIHttpRequestInput::add_file(QString variable_name, QString local_filename, QString request_filename, QString mime_type) { void PFXHttpRequestInput::add_file(QString variable_name, QString local_filename, QString request_filename, QString mime_type) {
OAIHttpFileElement file; PFXHttpFileElement file;
file.variable_name = variable_name; file.variable_name = variable_name;
file.local_filename = local_filename; file.local_filename = local_filename;
file.request_filename = request_filename; file.request_filename = request_filename;
@ -55,7 +55,7 @@ void OAIHttpRequestInput::add_file(QString variable_name, QString local_filename
} }
OAIHttpRequestWorker::OAIHttpRequestWorker(QObject *parent) PFXHttpRequestWorker::PFXHttpRequestWorker(QObject *parent)
: QObject(parent), manager(nullptr) : QObject(parent), manager(nullptr)
{ {
qsrand(QDateTime::currentDateTime().toTime_t()); qsrand(QDateTime::currentDateTime().toTime_t());
@ -63,10 +63,10 @@ OAIHttpRequestWorker::OAIHttpRequestWorker(QObject *parent)
timer = new QTimer(); timer = new QTimer();
manager = new QNetworkAccessManager(this); manager = new QNetworkAccessManager(this);
workingDirectory = QDir::currentPath(); workingDirectory = QDir::currentPath();
connect(manager, &QNetworkAccessManager::finished, this, &OAIHttpRequestWorker::on_manager_finished); connect(manager, &QNetworkAccessManager::finished, this, &PFXHttpRequestWorker::on_manager_finished);
} }
OAIHttpRequestWorker::~OAIHttpRequestWorker() { PFXHttpRequestWorker::~PFXHttpRequestWorker() {
if(timer != nullptr){ if(timer != nullptr){
if(timer->isActive()){ if(timer->isActive()){
timer->stop(); timer->stop();
@ -80,11 +80,11 @@ OAIHttpRequestWorker::~OAIHttpRequestWorker() {
} }
} }
QMap<QString, QString> OAIHttpRequestWorker::getResponseHeaders() const { QMap<QString, QString> PFXHttpRequestWorker::getResponseHeaders() const {
return headers; return headers;
} }
OAIHttpFileElement OAIHttpRequestWorker::getHttpFileElement(const QString &fieldname){ PFXHttpFileElement PFXHttpRequestWorker::getHttpFileElement(const QString &fieldname){
if(!files.isEmpty()){ if(!files.isEmpty()){
if(fieldname.isEmpty()){ if(fieldname.isEmpty()){
return files.first(); return files.first();
@ -92,10 +92,10 @@ OAIHttpFileElement OAIHttpRequestWorker::getHttpFileElement(const QString &field
return files[fieldname]; return files[fieldname];
} }
} }
return OAIHttpFileElement(); return PFXHttpFileElement();
} }
QByteArray *OAIHttpRequestWorker::getMultiPartField(const QString &fieldname){ QByteArray *PFXHttpRequestWorker::getMultiPartField(const QString &fieldname){
if(!multiPartFields.isEmpty()){ if(!multiPartFields.isEmpty()){
if(fieldname.isEmpty()){ if(fieldname.isEmpty()){
return multiPartFields.first(); return multiPartFields.first();
@ -106,18 +106,18 @@ QByteArray *OAIHttpRequestWorker::getMultiPartField(const QString &fieldname){
return nullptr; return nullptr;
} }
void OAIHttpRequestWorker::setTimeOut(int tout){ void PFXHttpRequestWorker::setTimeOut(int tout){
timeout = tout; timeout = tout;
} }
void OAIHttpRequestWorker::setWorkingDirectory(const QString &path){ void PFXHttpRequestWorker::setWorkingDirectory(const QString &path){
if(!path.isEmpty()){ if(!path.isEmpty()){
workingDirectory = path; workingDirectory = path;
} }
} }
QString OAIHttpRequestWorker::http_attribute_encode(QString attribute_name, QString input) { QString PFXHttpRequestWorker::http_attribute_encode(QString attribute_name, QString input) {
// result structure follows RFC 5987 // result structure follows RFC 5987
bool need_utf_encoding = false; bool need_utf_encoding = false;
QString result = ""; QString result = "";
@ -165,7 +165,7 @@ QString OAIHttpRequestWorker::http_attribute_encode(QString attribute_name, QStr
return QString("%1=\"%2\"; %1*=utf-8''%3").arg(attribute_name, result, result_utf8); return QString("%1=\"%2\"; %1*=utf-8''%3").arg(attribute_name, result, result_utf8);
} }
void OAIHttpRequestWorker::execute(OAIHttpRequestInput *input) { void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) {
// reset variables // reset variables
QNetworkReply* reply = nullptr; QNetworkReply* reply = nullptr;
@ -245,7 +245,7 @@ void OAIHttpRequestWorker::execute(OAIHttpRequestInput *input) {
} }
// add files // add files
for (QList<OAIHttpFileElement>::iterator file_info = input->files.begin(); file_info != input->files.end(); file_info++) { for (QList<PFXHttpFileElement>::iterator file_info = input->files.begin(); file_info != input->files.end(); file_info++) {
QFileInfo fi(file_info->local_filename); QFileInfo fi(file_info->local_filename);
// ensure necessary variables are available // ensure necessary variables are available
@ -317,8 +317,8 @@ void OAIHttpRequestWorker::execute(OAIHttpRequestInput *input) {
// prepare connection // prepare connection
QNetworkRequest request = QNetworkRequest(QUrl(input->url_str)); QNetworkRequest request = QNetworkRequest(QUrl(input->url_str));
if (OAIHttpRequestWorker::sslDefaultConfiguration != nullptr) { if (PFXHttpRequestWorker::sslDefaultConfiguration != nullptr) {
request.setSslConfiguration(*OAIHttpRequestWorker::sslDefaultConfiguration); request.setSslConfiguration(*PFXHttpRequestWorker::sslDefaultConfiguration);
} }
request.setRawHeader("User-Agent", "OpenAPI-Generator/1.0.0/cpp-qt5"); request.setRawHeader("User-Agent", "OpenAPI-Generator/1.0.0/cpp-qt5");
foreach(QString key, input->headers.keys()) { foreach(QString key, input->headers.keys()) {
@ -375,7 +375,7 @@ void OAIHttpRequestWorker::execute(OAIHttpRequestInput *input) {
} }
} }
void OAIHttpRequestWorker::on_manager_finished(QNetworkReply *reply) { void PFXHttpRequestWorker::on_manager_finished(QNetworkReply *reply) {
error_type = reply->error(); error_type = reply->error();
response = reply->readAll(); response = reply->readAll();
error_str = reply->errorString(); error_str = reply->errorString();
@ -389,7 +389,7 @@ void OAIHttpRequestWorker::on_manager_finished(QNetworkReply *reply) {
emit on_execution_finished(this); emit on_execution_finished(this);
} }
void OAIHttpRequestWorker::on_manager_timeout(QNetworkReply *reply) { void PFXHttpRequestWorker::on_manager_timeout(QNetworkReply *reply) {
error_type = QNetworkReply::TimeoutError; error_type = QNetworkReply::TimeoutError;
response = ""; response = "";
error_str = "Timed out waiting for response"; error_str = "Timed out waiting for response";
@ -399,7 +399,7 @@ void OAIHttpRequestWorker::on_manager_timeout(QNetworkReply *reply) {
emit on_execution_finished(this); emit on_execution_finished(this);
} }
void OAIHttpRequestWorker::process_form_response() { void PFXHttpRequestWorker::process_form_response() {
if(getResponseHeaders().contains(QString("Content-Disposition")) ) { if(getResponseHeaders().contains(QString("Content-Disposition")) ) {
auto contentDisposition = getResponseHeaders().value(QString("Content-Disposition").toUtf8()).split(QString(";"), QString::SkipEmptyParts); auto contentDisposition = getResponseHeaders().value(QString("Content-Disposition").toUtf8()).split(QString(";"), QString::SkipEmptyParts);
auto contentType = getResponseHeaders().contains(QString("Content-Type")) ? getResponseHeaders().value(QString("Content-Type").toUtf8()).split(QString(";"), QString::SkipEmptyParts).first() : QString(); auto contentType = getResponseHeaders().contains(QString("Content-Type")) ? getResponseHeaders().value(QString("Content-Type").toUtf8()).split(QString(";"), QString::SkipEmptyParts).first() : QString();
@ -411,7 +411,7 @@ void OAIHttpRequestWorker::process_form_response() {
break; break;
} }
} }
OAIHttpFileElement felement; PFXHttpFileElement felement;
felement.saveToFile(QString(), workingDirectory + QDir::separator() + filename, filename, contentType, response.data()); felement.saveToFile(QString(), workingDirectory + QDir::separator() + filename, filename, contentType, response.data());
files.insert(filename, felement); files.insert(filename, felement);
} }
@ -427,7 +427,7 @@ void OAIHttpRequestWorker::process_form_response() {
} }
} }
QSslConfiguration* OAIHttpRequestWorker::sslDefaultConfiguration; QSslConfiguration* PFXHttpRequestWorker::sslDefaultConfiguration;
} }

View File

@ -16,8 +16,8 @@
* *
**/ **/
#ifndef OAI_HTTPREQUESTWORKER_H #ifndef PFX_HTTPREQUESTWORKER_H
#define OAI_HTTPREQUESTWORKER_H #define PFX_HTTPREQUESTWORKER_H
#include <QObject> #include <QObject>
#include <QString> #include <QString>
@ -27,26 +27,26 @@
#include <QNetworkReply> #include <QNetworkReply>
#include "OAIHttpFileElement.h" #include "PFXHttpFileElement.h"
namespace OpenAPI { namespace test_namespace {
enum OAIHttpRequestVarLayout {NOT_SET, ADDRESS, URL_ENCODED, MULTIPART}; enum PFXHttpRequestVarLayout {NOT_SET, ADDRESS, URL_ENCODED, MULTIPART};
class OAIHttpRequestInput { class PFXHttpRequestInput {
public: public:
QString url_str; QString url_str;
QString http_method; QString http_method;
OAIHttpRequestVarLayout var_layout; PFXHttpRequestVarLayout var_layout;
QMap<QString, QString> vars; QMap<QString, QString> vars;
QMap<QString, QString> headers; QMap<QString, QString> headers;
QList<OAIHttpFileElement> files; QList<PFXHttpFileElement> files;
QByteArray request_body; QByteArray request_body;
OAIHttpRequestInput(); PFXHttpRequestInput();
OAIHttpRequestInput(QString v_url_str, QString v_http_method); PFXHttpRequestInput(QString v_url_str, QString v_http_method);
void initialize(); void initialize();
void add_var(QString key, QString value); void add_var(QString key, QString value);
void add_file(QString variable_name, QString local_filename, QString request_filename, QString mime_type); void add_file(QString variable_name, QString local_filename, QString request_filename, QString mime_type);
@ -54,7 +54,7 @@ public:
}; };
class OAIHttpRequestWorker : public QObject { class PFXHttpRequestWorker : public QObject {
Q_OBJECT Q_OBJECT
public: public:
@ -62,24 +62,24 @@ public:
QNetworkReply::NetworkError error_type; QNetworkReply::NetworkError error_type;
QString error_str; QString error_str;
QTimer *timer; QTimer *timer;
explicit OAIHttpRequestWorker(QObject *parent = nullptr); explicit PFXHttpRequestWorker(QObject *parent = nullptr);
virtual ~OAIHttpRequestWorker(); virtual ~PFXHttpRequestWorker();
QMap<QString, QString> getResponseHeaders() const; QMap<QString, QString> getResponseHeaders() const;
QString http_attribute_encode(QString attribute_name, QString input); QString http_attribute_encode(QString attribute_name, QString input);
void execute(OAIHttpRequestInput *input); void execute(PFXHttpRequestInput *input);
static QSslConfiguration* sslDefaultConfiguration; static QSslConfiguration* sslDefaultConfiguration;
void setTimeOut(int tout); void setTimeOut(int tout);
void setWorkingDirectory(const QString &path); void setWorkingDirectory(const QString &path);
OAIHttpFileElement getHttpFileElement(const QString &fieldname = QString()); PFXHttpFileElement getHttpFileElement(const QString &fieldname = QString());
QByteArray* getMultiPartField(const QString &fieldname = QString()); QByteArray* getMultiPartField(const QString &fieldname = QString());
signals: signals:
void on_execution_finished(OAIHttpRequestWorker *worker); void on_execution_finished(PFXHttpRequestWorker *worker);
private: private:
QNetworkAccessManager *manager; QNetworkAccessManager *manager;
QMap<QString, QString> headers; QMap<QString, QString> headers;
QMap<QString, OAIHttpFileElement> files; QMap<QString, PFXHttpFileElement> files;
QMap<QString, QByteArray*> multiPartFields; QMap<QString, QByteArray*> multiPartFields;
QString workingDirectory; QString workingDirectory;
int timeout; int timeout;
@ -91,4 +91,4 @@ private slots:
} }
#endif // OAI_HTTPREQUESTWORKER_H #endif // PFX_HTTPREQUESTWORKER_H

View File

@ -10,26 +10,26 @@
* Do not edit the class manually. * Do not edit the class manually.
*/ */
#ifndef OAI_OBJECT_H #ifndef PFX_OBJECT_H
#define OAI_OBJECT_H #define PFX_OBJECT_H
#include <QJsonObject> #include <QJsonObject>
#include <QJsonDocument> #include <QJsonDocument>
#include <QMetaType> #include <QMetaType>
namespace OpenAPI { namespace test_namespace {
class OAIObject { class PFXObject {
public: public:
OAIObject() { PFXObject() {
} }
OAIObject(QString jsonString) { PFXObject(QString jsonString) {
fromJson(jsonString); fromJson(jsonString);
} }
virtual ~OAIObject(){ virtual ~PFXObject(){
} }
@ -64,6 +64,6 @@ private :
} }
Q_DECLARE_METATYPE(OpenAPI::OAIObject) Q_DECLARE_METATYPE(test_namespace::PFXObject)
#endif // OAI_OBJECT_H #endif // PFX_OBJECT_H

View File

@ -11,32 +11,32 @@
*/ */
#include "OAIOrder.h" #include "PFXOrder.h"
#include <QJsonDocument> #include <QJsonDocument>
#include <QJsonArray> #include <QJsonArray>
#include <QObject> #include <QObject>
#include <QDebug> #include <QDebug>
#include "OAIHelpers.h" #include "PFXHelpers.h"
namespace OpenAPI { namespace test_namespace {
OAIOrder::OAIOrder(QString json) { PFXOrder::PFXOrder(QString json) {
this->initializeModel(); this->initializeModel();
this->fromJson(json); this->fromJson(json);
} }
OAIOrder::OAIOrder() { PFXOrder::PFXOrder() {
this->initializeModel(); this->initializeModel();
} }
OAIOrder::~OAIOrder() { PFXOrder::~PFXOrder() {
} }
void void
OAIOrder::initializeModel() { PFXOrder::initializeModel() {
m_id_isSet = false; m_id_isSet = false;
m_id_isValid = false; m_id_isValid = false;
@ -59,7 +59,7 @@ OAIOrder::initializeModel() {
} }
void void
OAIOrder::fromJson(QString jsonString) { PFXOrder::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();
@ -67,30 +67,30 @@ OAIOrder::fromJson(QString jsonString) {
} }
void void
OAIOrder::fromJsonObject(QJsonObject json) { PFXOrder::fromJsonObject(QJsonObject json) {
m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]);
m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; 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 = ::test_namespace::fromJsonValue(pet_id, json[QString("petId")]);
m_pet_id_isSet = !json[QString("petId")].isNull() && m_pet_id_isValid; m_pet_id_isSet = !json[QString("petId")].isNull() && m_pet_id_isValid;
m_quantity_isValid = ::OpenAPI::fromJsonValue(quantity, json[QString("quantity")]); m_quantity_isValid = ::test_namespace::fromJsonValue(quantity, json[QString("quantity")]);
m_quantity_isSet = !json[QString("quantity")].isNull() && m_quantity_isValid; 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 = ::test_namespace::fromJsonValue(ship_date, json[QString("shipDate")]);
m_ship_date_isSet = !json[QString("shipDate")].isNull() && m_ship_date_isValid; m_ship_date_isSet = !json[QString("shipDate")].isNull() && m_ship_date_isValid;
m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]); m_status_isValid = ::test_namespace::fromJsonValue(status, json[QString("status")]);
m_status_isSet = !json[QString("status")].isNull() && m_status_isValid; m_status_isSet = !json[QString("status")].isNull() && m_status_isValid;
m_complete_isValid = ::OpenAPI::fromJsonValue(complete, json[QString("complete")]); m_complete_isValid = ::test_namespace::fromJsonValue(complete, json[QString("complete")]);
m_complete_isSet = !json[QString("complete")].isNull() && m_complete_isValid; m_complete_isSet = !json[QString("complete")].isNull() && m_complete_isValid;
} }
QString QString
OAIOrder::asJson () const { PFXOrder::asJson () const {
QJsonObject obj = this->asJsonObject(); QJsonObject obj = this->asJsonObject();
QJsonDocument doc(obj); QJsonDocument doc(obj);
QByteArray bytes = doc.toJson(); QByteArray bytes = doc.toJson();
@ -98,97 +98,97 @@ OAIOrder::asJson () const {
} }
QJsonObject QJsonObject
OAIOrder::asJsonObject() const { PFXOrder::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"), ::test_namespace::toJsonValue(id));
} }
if(m_pet_id_isSet){ if(m_pet_id_isSet){
obj.insert(QString("petId"), ::OpenAPI::toJsonValue(pet_id)); obj.insert(QString("petId"), ::test_namespace::toJsonValue(pet_id));
} }
if(m_quantity_isSet){ if(m_quantity_isSet){
obj.insert(QString("quantity"), ::OpenAPI::toJsonValue(quantity)); obj.insert(QString("quantity"), ::test_namespace::toJsonValue(quantity));
} }
if(m_ship_date_isSet){ if(m_ship_date_isSet){
obj.insert(QString("shipDate"), ::OpenAPI::toJsonValue(ship_date)); obj.insert(QString("shipDate"), ::test_namespace::toJsonValue(ship_date));
} }
if(m_status_isSet){ if(m_status_isSet){
obj.insert(QString("status"), ::OpenAPI::toJsonValue(status)); obj.insert(QString("status"), ::test_namespace::toJsonValue(status));
} }
if(m_complete_isSet){ if(m_complete_isSet){
obj.insert(QString("complete"), ::OpenAPI::toJsonValue(complete)); obj.insert(QString("complete"), ::test_namespace::toJsonValue(complete));
} }
return obj; return obj;
} }
qint64 qint64
OAIOrder::getId() const { PFXOrder::getId() const {
return id; return id;
} }
void void
OAIOrder::setId(const qint64 &id) { PFXOrder::setId(const qint64 &id) {
this->id = id; this->id = id;
this->m_id_isSet = true; this->m_id_isSet = true;
} }
qint64 qint64
OAIOrder::getPetId() const { PFXOrder::getPetId() const {
return pet_id; return pet_id;
} }
void void
OAIOrder::setPetId(const qint64 &pet_id) { PFXOrder::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 qint32
OAIOrder::getQuantity() const { PFXOrder::getQuantity() const {
return quantity; return quantity;
} }
void void
OAIOrder::setQuantity(const qint32 &quantity) { PFXOrder::setQuantity(const qint32 &quantity) {
this->quantity = quantity; this->quantity = quantity;
this->m_quantity_isSet = true; this->m_quantity_isSet = true;
} }
QDateTime QDateTime
OAIOrder::getShipDate() const { PFXOrder::getShipDate() const {
return ship_date; return ship_date;
} }
void void
OAIOrder::setShipDate(const QDateTime &ship_date) { PFXOrder::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 QString
OAIOrder::getStatus() const { PFXOrder::getStatus() const {
return status; return status;
} }
void void
OAIOrder::setStatus(const QString &status) { PFXOrder::setStatus(const QString &status) {
this->status = status; this->status = status;
this->m_status_isSet = true; this->m_status_isSet = true;
} }
bool bool
OAIOrder::isComplete() const { PFXOrder::isComplete() const {
return complete; return complete;
} }
void void
OAIOrder::setComplete(const bool &complete) { PFXOrder::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 { PFXOrder::isSet() const {
bool isObjectUpdated = false; bool isObjectUpdated = false;
do{ do{
if(m_id_isSet){ isObjectUpdated = true; break;} if(m_id_isSet){ isObjectUpdated = true; break;}
@ -207,7 +207,7 @@ OAIOrder::isSet() const {
} }
bool bool
OAIOrder::isValid() const { PFXOrder::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;
} }

View File

@ -11,13 +11,13 @@
*/ */
/* /*
* OAIOrder.h * PFXOrder.h
* *
* An order for a pets from the pet store * An order for a pets from the pet store
*/ */
#ifndef OAIOrder_H #ifndef PFXOrder_H
#define OAIOrder_H #define PFXOrder_H
#include <QJsonObject> #include <QJsonObject>
@ -25,17 +25,17 @@
#include <QDateTime> #include <QDateTime>
#include <QString> #include <QString>
#include "OAIObject.h" #include "PFXObject.h"
#include "OAIEnum.h" #include "PFXEnum.h"
namespace OpenAPI { namespace test_namespace {
class OAIOrder: public OAIObject { class PFXOrder: public PFXObject {
public: public:
OAIOrder(); PFXOrder();
OAIOrder(QString json); PFXOrder(QString json);
~OAIOrder() override; ~PFXOrder() override;
QString asJson () const override; QString asJson () const override;
QJsonObject asJsonObject() const override; QJsonObject asJsonObject() const override;
@ -102,6 +102,6 @@ private:
} }
Q_DECLARE_METATYPE(OpenAPI::OAIOrder) Q_DECLARE_METATYPE(test_namespace::PFXOrder)
#endif // OAIOrder_H #endif // PFXOrder_H

View File

@ -11,32 +11,32 @@
*/ */
#include "OAIPet.h" #include "PFXPet.h"
#include <QJsonDocument> #include <QJsonDocument>
#include <QJsonArray> #include <QJsonArray>
#include <QObject> #include <QObject>
#include <QDebug> #include <QDebug>
#include "OAIHelpers.h" #include "PFXHelpers.h"
namespace OpenAPI { namespace test_namespace {
OAIPet::OAIPet(QString json) { PFXPet::PFXPet(QString json) {
this->initializeModel(); this->initializeModel();
this->fromJson(json); this->fromJson(json);
} }
OAIPet::OAIPet() { PFXPet::PFXPet() {
this->initializeModel(); this->initializeModel();
} }
OAIPet::~OAIPet() { PFXPet::~PFXPet() {
} }
void void
OAIPet::initializeModel() { PFXPet::initializeModel() {
m_id_isSet = false; m_id_isSet = false;
m_id_isValid = false; m_id_isValid = false;
@ -59,7 +59,7 @@ OAIPet::initializeModel() {
} }
void void
OAIPet::fromJson(QString jsonString) { PFXPet::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();
@ -67,30 +67,30 @@ OAIPet::fromJson(QString jsonString) {
} }
void void
OAIPet::fromJsonObject(QJsonObject json) { PFXPet::fromJsonObject(QJsonObject json) {
m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]);
m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; m_id_isSet = !json[QString("id")].isNull() && m_id_isValid;
m_category_isValid = ::OpenAPI::fromJsonValue(category, json[QString("category")]); m_category_isValid = ::test_namespace::fromJsonValue(category, json[QString("category")]);
m_category_isSet = !json[QString("category")].isNull() && m_category_isValid; m_category_isSet = !json[QString("category")].isNull() && m_category_isValid;
m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]); m_name_isValid = ::test_namespace::fromJsonValue(name, json[QString("name")]);
m_name_isSet = !json[QString("name")].isNull() && m_name_isValid; 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 = ::test_namespace::fromJsonValue(photo_urls, json[QString("photoUrls")]);
m_photo_urls_isSet = !json[QString("photoUrls")].isNull() && m_photo_urls_isValid; m_photo_urls_isSet = !json[QString("photoUrls")].isNull() && m_photo_urls_isValid;
m_tags_isValid = ::OpenAPI::fromJsonValue(tags, json[QString("tags")]); m_tags_isValid = ::test_namespace::fromJsonValue(tags, json[QString("tags")]);
m_tags_isSet = !json[QString("tags")].isNull() && m_tags_isValid; m_tags_isSet = !json[QString("tags")].isNull() && m_tags_isValid;
m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]); m_status_isValid = ::test_namespace::fromJsonValue(status, json[QString("status")]);
m_status_isSet = !json[QString("status")].isNull() && m_status_isValid; m_status_isSet = !json[QString("status")].isNull() && m_status_isValid;
} }
QString QString
OAIPet::asJson () const { PFXPet::asJson () const {
QJsonObject obj = this->asJsonObject(); QJsonObject obj = this->asJsonObject();
QJsonDocument doc(obj); QJsonDocument doc(obj);
QByteArray bytes = doc.toJson(); QByteArray bytes = doc.toJson();
@ -98,99 +98,99 @@ OAIPet::asJson () const {
} }
QJsonObject QJsonObject
OAIPet::asJsonObject() const { PFXPet::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"), ::test_namespace::toJsonValue(id));
} }
if(category.isSet()){ if(category.isSet()){
obj.insert(QString("category"), ::OpenAPI::toJsonValue(category)); obj.insert(QString("category"), ::test_namespace::toJsonValue(category));
} }
if(m_name_isSet){ if(m_name_isSet){
obj.insert(QString("name"), ::OpenAPI::toJsonValue(name)); obj.insert(QString("name"), ::test_namespace::toJsonValue(name));
} }
if(photo_urls.size() > 0){ if(photo_urls.size() > 0){
obj.insert(QString("photoUrls"), ::OpenAPI::toJsonValue(photo_urls)); obj.insert(QString("photoUrls"), ::test_namespace::toJsonValue(photo_urls));
} }
if(tags.size() > 0){ if(tags.size() > 0){
obj.insert(QString("tags"), ::OpenAPI::toJsonValue(tags)); obj.insert(QString("tags"), ::test_namespace::toJsonValue(tags));
} }
if(m_status_isSet){ if(m_status_isSet){
obj.insert(QString("status"), ::OpenAPI::toJsonValue(status)); obj.insert(QString("status"), ::test_namespace::toJsonValue(status));
} }
return obj; return obj;
} }
qint64 qint64
OAIPet::getId() const { PFXPet::getId() const {
return id; return id;
} }
void void
OAIPet::setId(const qint64 &id) { PFXPet::setId(const qint64 &id) {
this->id = id; this->id = id;
this->m_id_isSet = true; this->m_id_isSet = true;
} }
OAICategory PFXCategory
OAIPet::getCategory() const { PFXPet::getCategory() const {
return category; return category;
} }
void void
OAIPet::setCategory(const OAICategory &category) { PFXPet::setCategory(const PFXCategory &category) {
this->category = category; this->category = category;
this->m_category_isSet = true; this->m_category_isSet = true;
} }
QString QString
OAIPet::getName() const { PFXPet::getName() const {
return name; return name;
} }
void void
OAIPet::setName(const QString &name) { PFXPet::setName(const QString &name) {
this->name = name; this->name = name;
this->m_name_isSet = true; this->m_name_isSet = true;
} }
QList<QString> QList<QString>
OAIPet::getPhotoUrls() const { PFXPet::getPhotoUrls() const {
return photo_urls; return photo_urls;
} }
void void
OAIPet::setPhotoUrls(const QList<QString> &photo_urls) { PFXPet::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> QList<PFXTag>
OAIPet::getTags() const { PFXPet::getTags() const {
return tags; return tags;
} }
void void
OAIPet::setTags(const QList<OAITag> &tags) { PFXPet::setTags(const QList<PFXTag> &tags) {
this->tags = tags; this->tags = tags;
this->m_tags_isSet = true; this->m_tags_isSet = true;
} }
QString QString
OAIPet::getStatus() const { PFXPet::getStatus() const {
return status; return status;
} }
void void
OAIPet::setStatus(const QString &status) { PFXPet::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 { PFXPet::isSet() const {
bool isObjectUpdated = false; bool isObjectUpdated = false;
do{ do{
if(m_id_isSet){ isObjectUpdated = true; break;} if(m_id_isSet){ isObjectUpdated = true; break;}
@ -209,7 +209,7 @@ OAIPet::isSet() const {
} }
bool bool
OAIPet::isValid() const { PFXPet::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;
} }

View File

@ -11,33 +11,33 @@
*/ */
/* /*
* OAIPet.h * PFXPet.h
* *
* A pet for sale in the pet store * A pet for sale in the pet store
*/ */
#ifndef OAIPet_H #ifndef PFXPet_H
#define OAIPet_H #define PFXPet_H
#include <QJsonObject> #include <QJsonObject>
#include "OAICategory.h" #include "PFXCategory.h"
#include "OAITag.h" #include "PFXTag.h"
#include <QList> #include <QList>
#include <QString> #include <QString>
#include "OAIObject.h" #include "PFXObject.h"
#include "OAIEnum.h" #include "PFXEnum.h"
namespace OpenAPI { namespace test_namespace {
class OAIPet: public OAIObject { class PFXPet: public PFXObject {
public: public:
OAIPet(); PFXPet();
OAIPet(QString json); PFXPet(QString json);
~OAIPet() override; ~PFXPet() override;
QString asJson () const override; QString asJson () const override;
QJsonObject asJsonObject() const override; QJsonObject asJsonObject() const override;
@ -49,8 +49,8 @@ public:
void setId(const qint64 &id); void setId(const qint64 &id);
OAICategory getCategory() const; PFXCategory getCategory() const;
void setCategory(const OAICategory &category); void setCategory(const PFXCategory &category);
QString getName() const; QString getName() const;
@ -61,8 +61,8 @@ public:
void setPhotoUrls(const QList<QString> &photo_urls); void setPhotoUrls(const QList<QString> &photo_urls);
QList<OAITag> getTags() const; QList<PFXTag> getTags() const;
void setTags(const QList<OAITag> &tags); void setTags(const QList<PFXTag> &tags);
QString getStatus() const; QString getStatus() const;
@ -80,7 +80,7 @@ private:
bool m_id_isSet; bool m_id_isSet;
bool m_id_isValid; bool m_id_isValid;
OAICategory category; PFXCategory category;
bool m_category_isSet; bool m_category_isSet;
bool m_category_isValid; bool m_category_isValid;
@ -92,7 +92,7 @@ private:
bool m_photo_urls_isSet; bool m_photo_urls_isSet;
bool m_photo_urls_isValid; bool m_photo_urls_isValid;
QList<OAITag> tags; QList<PFXTag> tags;
bool m_tags_isSet; bool m_tags_isSet;
bool m_tags_isValid; bool m_tags_isValid;
@ -104,6 +104,6 @@ private:
} }
Q_DECLARE_METATYPE(OpenAPI::OAIPet) Q_DECLARE_METATYPE(test_namespace::PFXPet)
#endif // OAIPet_H #endif // PFXPet_H

View File

@ -10,60 +10,60 @@
* Do not edit the class manually. * Do not edit the class manually.
*/ */
#include "OAIPetApi.h" #include "PFXPetApi.h"
#include "OAIHelpers.h" #include "PFXHelpers.h"
#include <QJsonArray> #include <QJsonArray>
#include <QJsonDocument> #include <QJsonDocument>
namespace OpenAPI { namespace test_namespace {
OAIPetApi::OAIPetApi() : basePath("/v2"), PFXPetApi::PFXPetApi() : basePath("/v2"),
host("petstore.swagger.io"), host("petstore.swagger.io"),
timeout(0){ timeout(0){
} }
OAIPetApi::~OAIPetApi() { PFXPetApi::~PFXPetApi() {
} }
OAIPetApi::OAIPetApi(const QString& host, const QString& basePath, const int tout) { PFXPetApi::PFXPetApi(const QString& host, const QString& basePath, const int tout) {
this->host = host; this->host = host;
this->basePath = basePath; this->basePath = basePath;
this->timeout = tout; this->timeout = tout;
} }
void OAIPetApi::setBasePath(const QString& basePath){ void PFXPetApi::setBasePath(const QString& basePath){
this->basePath = basePath; this->basePath = basePath;
} }
void OAIPetApi::setHost(const QString& host){ void PFXPetApi::setHost(const QString& host){
this->host = host; this->host = host;
} }
void OAIPetApi::setApiTimeOutMs(const int tout){ void PFXPetApi::setApiTimeOutMs(const int tout){
timeout = tout; timeout = tout;
} }
void OAIPetApi::setWorkingDirectory(const QString& path){ void PFXPetApi::setWorkingDirectory(const QString& path){
workingDirectory = path; workingDirectory = path;
} }
void OAIPetApi::addHeaders(const QString& key, const QString& value){ void PFXPetApi::addHeaders(const QString& key, const QString& value){
defaultHeaders.insert(key, value); defaultHeaders.insert(key, value);
} }
void void
OAIPetApi::addPet(const OAIPet& body) { PFXPetApi::addPet(const PFXPet& body) {
QString fullPath; QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/pet"); fullPath.append(this->host).append(this->basePath).append("/pet");
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this);
worker->setTimeOut(timeout); worker->setTimeOut(timeout);
worker->setWorkingDirectory(workingDirectory); worker->setWorkingDirectory(workingDirectory);
OAIHttpRequestInput input(fullPath, "POST"); PFXHttpRequestInput input(fullPath, "POST");
QString output = body.asJson(); QString output = body.asJson();
@ -75,15 +75,15 @@ OAIPetApi::addPet(const OAIPet& body) {
} }
connect(worker, connect(worker,
&OAIHttpRequestWorker::on_execution_finished, &PFXHttpRequestWorker::on_execution_finished,
this, this,
&OAIPetApi::addPetCallback); &PFXPetApi::addPetCallback);
worker->execute(&input); worker->execute(&input);
} }
void void
OAIPetApi::addPetCallback(OAIHttpRequestWorker * worker) { PFXPetApi::addPetCallback(PFXHttpRequestWorker * worker) {
QString msg; QString msg;
QString error_str = worker->error_str; QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type; QNetworkReply::NetworkError error_type = worker->error_type;
@ -106,17 +106,17 @@ OAIPetApi::addPetCallback(OAIHttpRequestWorker * worker) {
} }
void void
OAIPetApi::deletePet(const qint64& pet_id, const QString& api_key) { PFXPetApi::deletePet(const qint64& pet_id, const QString& api_key) {
QString fullPath; QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}"); fullPath.append(this->host).append(this->basePath).append("/pet/{petId}");
QString pet_idPathParam("{"); QString pet_idPathParam("{");
pet_idPathParam.append("petId").append("}"); pet_idPathParam.append("petId").append("}");
fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(pet_id))); fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(pet_id)));
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this);
worker->setTimeOut(timeout); worker->setTimeOut(timeout);
worker->setWorkingDirectory(workingDirectory); worker->setWorkingDirectory(workingDirectory);
OAIHttpRequestInput input(fullPath, "DELETE"); PFXHttpRequestInput input(fullPath, "DELETE");
if (api_key != nullptr) { if (api_key != nullptr) {
@ -128,15 +128,15 @@ OAIPetApi::deletePet(const qint64& pet_id, const QString& api_key) {
} }
connect(worker, connect(worker,
&OAIHttpRequestWorker::on_execution_finished, &PFXHttpRequestWorker::on_execution_finished,
this, this,
&OAIPetApi::deletePetCallback); &PFXPetApi::deletePetCallback);
worker->execute(&input); worker->execute(&input);
} }
void void
OAIPetApi::deletePetCallback(OAIHttpRequestWorker * worker) { PFXPetApi::deletePetCallback(PFXHttpRequestWorker * worker) {
QString msg; QString msg;
QString error_str = worker->error_str; QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type; QNetworkReply::NetworkError error_type = worker->error_type;
@ -159,7 +159,7 @@ OAIPetApi::deletePetCallback(OAIHttpRequestWorker * worker) {
} }
void void
OAIPetApi::findPetsByStatus(const QList<QString>& status) { PFXPetApi::findPetsByStatus(const QList<QString>& status) {
QString fullPath; QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/pet/findByStatus"); fullPath.append(this->host).append(this->basePath).append("/pet/findByStatus");
@ -170,7 +170,7 @@ OAIPetApi::findPetsByStatus(const QList<QString>& status) {
fullPath.append("&"); fullPath.append("&");
else else
fullPath.append("?"); fullPath.append("?");
fullPath.append("status=").append(::OpenAPI::toStringValue(t)); fullPath.append("status=").append(::test_namespace::toStringValue(t));
} }
} }
else if (QString("csv").indexOf("ssv") == 0) { else if (QString("csv").indexOf("ssv") == 0) {
@ -184,7 +184,7 @@ OAIPetApi::findPetsByStatus(const QList<QString>& status) {
if (count > 0) { if (count > 0) {
fullPath.append(" "); fullPath.append(" ");
} }
fullPath.append(::OpenAPI::toStringValue(t)); fullPath.append(::test_namespace::toStringValue(t));
} }
} }
else if (QString("csv").indexOf("tsv") == 0) { else if (QString("csv").indexOf("tsv") == 0) {
@ -198,15 +198,15 @@ OAIPetApi::findPetsByStatus(const QList<QString>& status) {
if (count > 0) { if (count > 0) {
fullPath.append("\t"); fullPath.append("\t");
} }
fullPath.append(::OpenAPI::toStringValue(t)); fullPath.append(::test_namespace::toStringValue(t));
} }
} }
} }
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this);
worker->setTimeOut(timeout); worker->setTimeOut(timeout);
worker->setWorkingDirectory(workingDirectory); worker->setWorkingDirectory(workingDirectory);
OAIHttpRequestInput input(fullPath, "GET"); PFXHttpRequestInput input(fullPath, "GET");
@ -215,15 +215,15 @@ OAIPetApi::findPetsByStatus(const QList<QString>& status) {
} }
connect(worker, connect(worker,
&OAIHttpRequestWorker::on_execution_finished, &PFXHttpRequestWorker::on_execution_finished,
this, this,
&OAIPetApi::findPetsByStatusCallback); &PFXPetApi::findPetsByStatusCallback);
worker->execute(&input); worker->execute(&input);
} }
void void
OAIPetApi::findPetsByStatusCallback(OAIHttpRequestWorker * worker) { PFXPetApi::findPetsByStatusCallback(PFXHttpRequestWorker * worker) {
QString msg; QString msg;
QString error_str = worker->error_str; QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type; QNetworkReply::NetworkError error_type = worker->error_type;
@ -234,14 +234,14 @@ OAIPetApi::findPetsByStatusCallback(OAIHttpRequestWorker * worker) {
else { else {
msg = "Error: " + worker->error_str; msg = "Error: " + worker->error_str;
} }
QList<OAIPet> output; QList<PFXPet> output;
QString json(worker->response); QString json(worker->response);
QByteArray array (json.toStdString().c_str()); QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array); QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonArray jsonArray = doc.array(); QJsonArray jsonArray = doc.array();
foreach(QJsonValue obj, jsonArray) { foreach(QJsonValue obj, jsonArray) {
OAIPet val; PFXPet val;
::OpenAPI::fromJsonValue(val, obj); ::test_namespace::fromJsonValue(val, obj);
output.append(val); output.append(val);
} }
worker->deleteLater(); worker->deleteLater();
@ -256,7 +256,7 @@ OAIPetApi::findPetsByStatusCallback(OAIHttpRequestWorker * worker) {
} }
void void
OAIPetApi::findPetsByTags(const QList<QString>& tags) { PFXPetApi::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");
@ -267,7 +267,7 @@ OAIPetApi::findPetsByTags(const QList<QString>& tags) {
fullPath.append("&"); fullPath.append("&");
else else
fullPath.append("?"); fullPath.append("?");
fullPath.append("tags=").append(::OpenAPI::toStringValue(t)); fullPath.append("tags=").append(::test_namespace::toStringValue(t));
} }
} }
else if (QString("csv").indexOf("ssv") == 0) { else if (QString("csv").indexOf("ssv") == 0) {
@ -281,7 +281,7 @@ OAIPetApi::findPetsByTags(const QList<QString>& tags) {
if (count > 0) { if (count > 0) {
fullPath.append(" "); fullPath.append(" ");
} }
fullPath.append(::OpenAPI::toStringValue(t)); fullPath.append(::test_namespace::toStringValue(t));
} }
} }
else if (QString("csv").indexOf("tsv") == 0) { else if (QString("csv").indexOf("tsv") == 0) {
@ -295,15 +295,15 @@ OAIPetApi::findPetsByTags(const QList<QString>& tags) {
if (count > 0) { if (count > 0) {
fullPath.append("\t"); fullPath.append("\t");
} }
fullPath.append(::OpenAPI::toStringValue(t)); fullPath.append(::test_namespace::toStringValue(t));
} }
} }
} }
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this);
worker->setTimeOut(timeout); worker->setTimeOut(timeout);
worker->setWorkingDirectory(workingDirectory); worker->setWorkingDirectory(workingDirectory);
OAIHttpRequestInput input(fullPath, "GET"); PFXHttpRequestInput input(fullPath, "GET");
@ -312,15 +312,15 @@ OAIPetApi::findPetsByTags(const QList<QString>& tags) {
} }
connect(worker, connect(worker,
&OAIHttpRequestWorker::on_execution_finished, &PFXHttpRequestWorker::on_execution_finished,
this, this,
&OAIPetApi::findPetsByTagsCallback); &PFXPetApi::findPetsByTagsCallback);
worker->execute(&input); worker->execute(&input);
} }
void void
OAIPetApi::findPetsByTagsCallback(OAIHttpRequestWorker * worker) { PFXPetApi::findPetsByTagsCallback(PFXHttpRequestWorker * worker) {
QString msg; QString msg;
QString error_str = worker->error_str; QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type; QNetworkReply::NetworkError error_type = worker->error_type;
@ -331,14 +331,14 @@ OAIPetApi::findPetsByTagsCallback(OAIHttpRequestWorker * worker) {
else { else {
msg = "Error: " + worker->error_str; msg = "Error: " + worker->error_str;
} }
QList<OAIPet> output; QList<PFXPet> output;
QString json(worker->response); QString json(worker->response);
QByteArray array (json.toStdString().c_str()); QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array); QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonArray jsonArray = doc.array(); QJsonArray jsonArray = doc.array();
foreach(QJsonValue obj, jsonArray) { foreach(QJsonValue obj, jsonArray) {
OAIPet val; PFXPet val;
::OpenAPI::fromJsonValue(val, obj); ::test_namespace::fromJsonValue(val, obj);
output.append(val); output.append(val);
} }
worker->deleteLater(); worker->deleteLater();
@ -353,17 +353,17 @@ OAIPetApi::findPetsByTagsCallback(OAIHttpRequestWorker * worker) {
} }
void void
OAIPetApi::getPetById(const qint64& pet_id) { PFXPetApi::getPetById(const qint64& pet_id) {
QString fullPath; QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}"); fullPath.append(this->host).append(this->basePath).append("/pet/{petId}");
QString pet_idPathParam("{"); QString pet_idPathParam("{");
pet_idPathParam.append("petId").append("}"); pet_idPathParam.append("petId").append("}");
fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(pet_id))); fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(pet_id)));
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this);
worker->setTimeOut(timeout); worker->setTimeOut(timeout);
worker->setWorkingDirectory(workingDirectory); worker->setWorkingDirectory(workingDirectory);
OAIHttpRequestInput input(fullPath, "GET"); PFXHttpRequestInput input(fullPath, "GET");
@ -372,15 +372,15 @@ OAIPetApi::getPetById(const qint64& pet_id) {
} }
connect(worker, connect(worker,
&OAIHttpRequestWorker::on_execution_finished, &PFXHttpRequestWorker::on_execution_finished,
this, this,
&OAIPetApi::getPetByIdCallback); &PFXPetApi::getPetByIdCallback);
worker->execute(&input); worker->execute(&input);
} }
void void
OAIPetApi::getPetByIdCallback(OAIHttpRequestWorker * worker) { PFXPetApi::getPetByIdCallback(PFXHttpRequestWorker * worker) {
QString msg; QString msg;
QString error_str = worker->error_str; QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type; QNetworkReply::NetworkError error_type = worker->error_type;
@ -391,7 +391,7 @@ OAIPetApi::getPetByIdCallback(OAIHttpRequestWorker * worker) {
else { else {
msg = "Error: " + worker->error_str; msg = "Error: " + worker->error_str;
} }
OAIPet output(QString(worker->response)); PFXPet output(QString(worker->response));
worker->deleteLater(); worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) { if (worker->error_type == QNetworkReply::NoError) {
@ -404,14 +404,14 @@ OAIPetApi::getPetByIdCallback(OAIHttpRequestWorker * worker) {
} }
void void
OAIPetApi::updatePet(const OAIPet& body) { PFXPetApi::updatePet(const PFXPet& body) {
QString fullPath; QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/pet"); fullPath.append(this->host).append(this->basePath).append("/pet");
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this);
worker->setTimeOut(timeout); worker->setTimeOut(timeout);
worker->setWorkingDirectory(workingDirectory); worker->setWorkingDirectory(workingDirectory);
OAIHttpRequestInput input(fullPath, "PUT"); PFXHttpRequestInput input(fullPath, "PUT");
QString output = body.asJson(); QString output = body.asJson();
@ -423,15 +423,15 @@ OAIPetApi::updatePet(const OAIPet& body) {
} }
connect(worker, connect(worker,
&OAIHttpRequestWorker::on_execution_finished, &PFXHttpRequestWorker::on_execution_finished,
this, this,
&OAIPetApi::updatePetCallback); &PFXPetApi::updatePetCallback);
worker->execute(&input); worker->execute(&input);
} }
void void
OAIPetApi::updatePetCallback(OAIHttpRequestWorker * worker) { PFXPetApi::updatePetCallback(PFXHttpRequestWorker * worker) {
QString msg; QString msg;
QString error_str = worker->error_str; QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type; QNetworkReply::NetworkError error_type = worker->error_type;
@ -454,20 +454,20 @@ OAIPetApi::updatePetCallback(OAIHttpRequestWorker * worker) {
} }
void void
OAIPetApi::updatePetWithForm(const qint64& pet_id, const QString& name, const QString& status) { PFXPetApi::updatePetWithForm(const qint64& pet_id, const QString& name, const QString& status) {
QString fullPath; QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}"); fullPath.append(this->host).append(this->basePath).append("/pet/{petId}");
QString pet_idPathParam("{"); QString pet_idPathParam("{");
pet_idPathParam.append("petId").append("}"); pet_idPathParam.append("petId").append("}");
fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(pet_id))); fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(pet_id)));
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this);
worker->setTimeOut(timeout); worker->setTimeOut(timeout);
worker->setWorkingDirectory(workingDirectory); worker->setWorkingDirectory(workingDirectory);
OAIHttpRequestInput input(fullPath, "POST"); PFXHttpRequestInput input(fullPath, "POST");
input.add_var("name", ::OpenAPI::toStringValue(name)); input.add_var("name", ::test_namespace::toStringValue(name));
input.add_var("status", ::OpenAPI::toStringValue(status)); input.add_var("status", ::test_namespace::toStringValue(status));
foreach(QString key, this->defaultHeaders.keys()) { foreach(QString key, this->defaultHeaders.keys()) {
@ -475,15 +475,15 @@ OAIPetApi::updatePetWithForm(const qint64& pet_id, const QString& name, const QS
} }
connect(worker, connect(worker,
&OAIHttpRequestWorker::on_execution_finished, &PFXHttpRequestWorker::on_execution_finished,
this, this,
&OAIPetApi::updatePetWithFormCallback); &PFXPetApi::updatePetWithFormCallback);
worker->execute(&input); worker->execute(&input);
} }
void void
OAIPetApi::updatePetWithFormCallback(OAIHttpRequestWorker * worker) { PFXPetApi::updatePetWithFormCallback(PFXHttpRequestWorker * worker) {
QString msg; QString msg;
QString error_str = worker->error_str; QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type; QNetworkReply::NetworkError error_type = worker->error_type;
@ -506,19 +506,19 @@ OAIPetApi::updatePetWithFormCallback(OAIHttpRequestWorker * worker) {
} }
void void
OAIPetApi::uploadFile(const qint64& pet_id, const QString& additional_metadata, const OAIHttpFileElement& file) { PFXPetApi::uploadFile(const qint64& pet_id, const QString& additional_metadata, const PFXHttpFileElement& file) {
QString fullPath; QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}/uploadImage"); fullPath.append(this->host).append(this->basePath).append("/pet/{petId}/uploadImage");
QString pet_idPathParam("{"); QString pet_idPathParam("{");
pet_idPathParam.append("petId").append("}"); pet_idPathParam.append("petId").append("}");
fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(pet_id))); fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(pet_id)));
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this);
worker->setTimeOut(timeout); worker->setTimeOut(timeout);
worker->setWorkingDirectory(workingDirectory); worker->setWorkingDirectory(workingDirectory);
OAIHttpRequestInput input(fullPath, "POST"); PFXHttpRequestInput input(fullPath, "POST");
input.add_var("additionalMetadata", ::OpenAPI::toStringValue(additional_metadata)); input.add_var("additionalMetadata", ::test_namespace::toStringValue(additional_metadata));
input.add_file("file", file.local_filename, file.request_filename, file.mime_type); input.add_file("file", file.local_filename, file.request_filename, file.mime_type);
@ -527,15 +527,15 @@ OAIPetApi::uploadFile(const qint64& pet_id, const QString& additional_metadata,
} }
connect(worker, connect(worker,
&OAIHttpRequestWorker::on_execution_finished, &PFXHttpRequestWorker::on_execution_finished,
this, this,
&OAIPetApi::uploadFileCallback); &PFXPetApi::uploadFileCallback);
worker->execute(&input); worker->execute(&input);
} }
void void
OAIPetApi::uploadFileCallback(OAIHttpRequestWorker * worker) { PFXPetApi::uploadFileCallback(PFXHttpRequestWorker * worker) {
QString msg; QString msg;
QString error_str = worker->error_str; QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type; QNetworkReply::NetworkError error_type = worker->error_type;
@ -546,7 +546,7 @@ OAIPetApi::uploadFileCallback(OAIHttpRequestWorker * worker) {
else { else {
msg = "Error: " + worker->error_str; msg = "Error: " + worker->error_str;
} }
OAIApiResponse output(QString(worker->response)); PFXApiResponse output(QString(worker->response));
worker->deleteLater(); worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) { if (worker->error_type == QNetworkReply::NoError) {

View File

@ -0,0 +1,105 @@
/**
* 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.
*/
#ifndef PFX_PFXPetApi_H
#define PFX_PFXPetApi_H
#include "PFXHttpRequest.h"
#include "PFXApiResponse.h"
#include "PFXHttpFileElement.h"
#include "PFXPet.h"
#include <QString>
#include <QObject>
namespace test_namespace {
class PFXPetApi: public QObject {
Q_OBJECT
public:
PFXPetApi();
PFXPetApi(const QString& host, const QString& basePath, const int toutMs = 0);
~PFXPetApi();
void setBasePath(const QString& basePath);
void setHost(const QString& host);
void setApiTimeOutMs(const int tout);
void setWorkingDirectory(const QString& path);
void addHeaders(const QString& key, const QString& value);
void addPet(const PFXPet& body);
void deletePet(const qint64& pet_id, const QString& api_key);
void findPetsByStatus(const QList<QString>& status);
void findPetsByTags(const QList<QString>& tags);
void getPetById(const qint64& pet_id);
void updatePet(const PFXPet& body);
void updatePetWithForm(const qint64& pet_id, const QString& name, const QString& status);
void uploadFile(const qint64& pet_id, const QString& additional_metadata, const PFXHttpFileElement& file);
private:
QString basePath;
QString host;
QString workingDirectory;
int timeout;
QMap<QString, QString> defaultHeaders;
void addPetCallback (PFXHttpRequestWorker * worker);
void deletePetCallback (PFXHttpRequestWorker * worker);
void findPetsByStatusCallback (PFXHttpRequestWorker * worker);
void findPetsByTagsCallback (PFXHttpRequestWorker * worker);
void getPetByIdCallback (PFXHttpRequestWorker * worker);
void updatePetCallback (PFXHttpRequestWorker * worker);
void updatePetWithFormCallback (PFXHttpRequestWorker * worker);
void uploadFileCallback (PFXHttpRequestWorker * worker);
signals:
void addPetSignal();
void deletePetSignal();
void findPetsByStatusSignal(QList<PFXPet> summary);
void findPetsByTagsSignal(QList<PFXPet> summary);
void getPetByIdSignal(PFXPet summary);
void updatePetSignal();
void updatePetWithFormSignal();
void uploadFileSignal(PFXApiResponse summary);
void addPetSignalFull(PFXHttpRequestWorker* worker);
void deletePetSignalFull(PFXHttpRequestWorker* worker);
void findPetsByStatusSignalFull(PFXHttpRequestWorker* worker, QList<PFXPet> summary);
void findPetsByTagsSignalFull(PFXHttpRequestWorker* worker, QList<PFXPet> summary);
void getPetByIdSignalFull(PFXHttpRequestWorker* worker, PFXPet summary);
void updatePetSignalFull(PFXHttpRequestWorker* worker);
void updatePetWithFormSignalFull(PFXHttpRequestWorker* worker);
void uploadFileSignalFull(PFXHttpRequestWorker* worker, PFXApiResponse summary);
void addPetSignalE(QNetworkReply::NetworkError error_type, QString error_str);
void deletePetSignalE(QNetworkReply::NetworkError error_type, QString error_str);
void findPetsByStatusSignalE(QList<PFXPet> summary, QNetworkReply::NetworkError error_type, QString error_str);
void findPetsByTagsSignalE(QList<PFXPet> summary, QNetworkReply::NetworkError error_type, QString error_str);
void getPetByIdSignalE(PFXPet summary, QNetworkReply::NetworkError error_type, QString error_str);
void updatePetSignalE(QNetworkReply::NetworkError error_type, QString error_str);
void updatePetWithFormSignalE(QNetworkReply::NetworkError error_type, QString error_str);
void uploadFileSignalE(PFXApiResponse summary, QNetworkReply::NetworkError error_type, QString error_str);
void addPetSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void deletePetSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void findPetsByStatusSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void findPetsByTagsSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void getPetByIdSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void updatePetSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void updatePetWithFormSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void uploadFileSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
};
}
#endif

View File

@ -10,63 +10,63 @@
* Do not edit the class manually. * Do not edit the class manually.
*/ */
#include "OAIStoreApi.h" #include "PFXStoreApi.h"
#include "OAIHelpers.h" #include "PFXHelpers.h"
#include <QJsonArray> #include <QJsonArray>
#include <QJsonDocument> #include <QJsonDocument>
namespace OpenAPI { namespace test_namespace {
OAIStoreApi::OAIStoreApi() : basePath("/v2"), PFXStoreApi::PFXStoreApi() : basePath("/v2"),
host("petstore.swagger.io"), host("petstore.swagger.io"),
timeout(0){ timeout(0){
} }
OAIStoreApi::~OAIStoreApi() { PFXStoreApi::~PFXStoreApi() {
} }
OAIStoreApi::OAIStoreApi(const QString& host, const QString& basePath, const int tout) { PFXStoreApi::PFXStoreApi(const QString& host, const QString& basePath, const int tout) {
this->host = host; this->host = host;
this->basePath = basePath; this->basePath = basePath;
this->timeout = tout; this->timeout = tout;
} }
void OAIStoreApi::setBasePath(const QString& basePath){ void PFXStoreApi::setBasePath(const QString& basePath){
this->basePath = basePath; this->basePath = basePath;
} }
void OAIStoreApi::setHost(const QString& host){ void PFXStoreApi::setHost(const QString& host){
this->host = host; this->host = host;
} }
void OAIStoreApi::setApiTimeOutMs(const int tout){ void PFXStoreApi::setApiTimeOutMs(const int tout){
timeout = tout; timeout = tout;
} }
void OAIStoreApi::setWorkingDirectory(const QString& path){ void PFXStoreApi::setWorkingDirectory(const QString& path){
workingDirectory = path; workingDirectory = path;
} }
void OAIStoreApi::addHeaders(const QString& key, const QString& value){ void PFXStoreApi::addHeaders(const QString& key, const QString& value){
defaultHeaders.insert(key, value); defaultHeaders.insert(key, value);
} }
void void
OAIStoreApi::deleteOrder(const QString& order_id) { PFXStoreApi::deleteOrder(const QString& order_id) {
QString fullPath; QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/store/order/{orderId}"); fullPath.append(this->host).append(this->basePath).append("/store/order/{orderId}");
QString order_idPathParam("{"); QString order_idPathParam("{");
order_idPathParam.append("orderId").append("}"); order_idPathParam.append("orderId").append("}");
fullPath.replace(order_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(order_id))); fullPath.replace(order_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(order_id)));
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this);
worker->setTimeOut(timeout); worker->setTimeOut(timeout);
worker->setWorkingDirectory(workingDirectory); worker->setWorkingDirectory(workingDirectory);
OAIHttpRequestInput input(fullPath, "DELETE"); PFXHttpRequestInput input(fullPath, "DELETE");
@ -75,15 +75,15 @@ OAIStoreApi::deleteOrder(const QString& order_id) {
} }
connect(worker, connect(worker,
&OAIHttpRequestWorker::on_execution_finished, &PFXHttpRequestWorker::on_execution_finished,
this, this,
&OAIStoreApi::deleteOrderCallback); &PFXStoreApi::deleteOrderCallback);
worker->execute(&input); worker->execute(&input);
} }
void void
OAIStoreApi::deleteOrderCallback(OAIHttpRequestWorker * worker) { PFXStoreApi::deleteOrderCallback(PFXHttpRequestWorker * worker) {
QString msg; QString msg;
QString error_str = worker->error_str; QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type; QNetworkReply::NetworkError error_type = worker->error_type;
@ -106,14 +106,14 @@ OAIStoreApi::deleteOrderCallback(OAIHttpRequestWorker * worker) {
} }
void void
OAIStoreApi::getInventory() { PFXStoreApi::getInventory() {
QString fullPath; QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/store/inventory"); fullPath.append(this->host).append(this->basePath).append("/store/inventory");
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this);
worker->setTimeOut(timeout); worker->setTimeOut(timeout);
worker->setWorkingDirectory(workingDirectory); worker->setWorkingDirectory(workingDirectory);
OAIHttpRequestInput input(fullPath, "GET"); PFXHttpRequestInput input(fullPath, "GET");
@ -122,15 +122,15 @@ OAIStoreApi::getInventory() {
} }
connect(worker, connect(worker,
&OAIHttpRequestWorker::on_execution_finished, &PFXHttpRequestWorker::on_execution_finished,
this, this,
&OAIStoreApi::getInventoryCallback); &PFXStoreApi::getInventoryCallback);
worker->execute(&input); worker->execute(&input);
} }
void void
OAIStoreApi::getInventoryCallback(OAIHttpRequestWorker * worker) { PFXStoreApi::getInventoryCallback(PFXHttpRequestWorker * worker) {
QString msg; QString msg;
QString error_str = worker->error_str; QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type; QNetworkReply::NetworkError error_type = worker->error_type;
@ -148,7 +148,7 @@ OAIStoreApi::getInventoryCallback(OAIHttpRequestWorker * worker) {
QJsonObject obj = doc.object(); QJsonObject obj = doc.object();
foreach(QString key, obj.keys()) { foreach(QString key, obj.keys()) {
qint32 val; qint32 val;
::OpenAPI::fromJsonValue(val, obj[key]); ::test_namespace::fromJsonValue(val, obj[key]);
output.insert(key, val); output.insert(key, val);
} }
worker->deleteLater(); worker->deleteLater();
@ -163,17 +163,17 @@ OAIStoreApi::getInventoryCallback(OAIHttpRequestWorker * worker) {
} }
void void
OAIStoreApi::getOrderById(const qint64& order_id) { PFXStoreApi::getOrderById(const qint64& order_id) {
QString fullPath; QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/store/order/{orderId}"); fullPath.append(this->host).append(this->basePath).append("/store/order/{orderId}");
QString order_idPathParam("{"); QString order_idPathParam("{");
order_idPathParam.append("orderId").append("}"); order_idPathParam.append("orderId").append("}");
fullPath.replace(order_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(order_id))); fullPath.replace(order_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(order_id)));
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this);
worker->setTimeOut(timeout); worker->setTimeOut(timeout);
worker->setWorkingDirectory(workingDirectory); worker->setWorkingDirectory(workingDirectory);
OAIHttpRequestInput input(fullPath, "GET"); PFXHttpRequestInput input(fullPath, "GET");
@ -182,15 +182,15 @@ OAIStoreApi::getOrderById(const qint64& order_id) {
} }
connect(worker, connect(worker,
&OAIHttpRequestWorker::on_execution_finished, &PFXHttpRequestWorker::on_execution_finished,
this, this,
&OAIStoreApi::getOrderByIdCallback); &PFXStoreApi::getOrderByIdCallback);
worker->execute(&input); worker->execute(&input);
} }
void void
OAIStoreApi::getOrderByIdCallback(OAIHttpRequestWorker * worker) { PFXStoreApi::getOrderByIdCallback(PFXHttpRequestWorker * worker) {
QString msg; QString msg;
QString error_str = worker->error_str; QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type; QNetworkReply::NetworkError error_type = worker->error_type;
@ -201,7 +201,7 @@ OAIStoreApi::getOrderByIdCallback(OAIHttpRequestWorker * worker) {
else { else {
msg = "Error: " + worker->error_str; msg = "Error: " + worker->error_str;
} }
OAIOrder output(QString(worker->response)); PFXOrder output(QString(worker->response));
worker->deleteLater(); worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) { if (worker->error_type == QNetworkReply::NoError) {
@ -214,14 +214,14 @@ OAIStoreApi::getOrderByIdCallback(OAIHttpRequestWorker * worker) {
} }
void void
OAIStoreApi::placeOrder(const OAIOrder& body) { PFXStoreApi::placeOrder(const PFXOrder& 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");
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this);
worker->setTimeOut(timeout); worker->setTimeOut(timeout);
worker->setWorkingDirectory(workingDirectory); worker->setWorkingDirectory(workingDirectory);
OAIHttpRequestInput input(fullPath, "POST"); PFXHttpRequestInput input(fullPath, "POST");
QString output = body.asJson(); QString output = body.asJson();
@ -233,15 +233,15 @@ OAIStoreApi::placeOrder(const OAIOrder& body) {
} }
connect(worker, connect(worker,
&OAIHttpRequestWorker::on_execution_finished, &PFXHttpRequestWorker::on_execution_finished,
this, this,
&OAIStoreApi::placeOrderCallback); &PFXStoreApi::placeOrderCallback);
worker->execute(&input); worker->execute(&input);
} }
void void
OAIStoreApi::placeOrderCallback(OAIHttpRequestWorker * worker) { PFXStoreApi::placeOrderCallback(PFXHttpRequestWorker * worker) {
QString msg; QString msg;
QString error_str = worker->error_str; QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type; QNetworkReply::NetworkError error_type = worker->error_type;
@ -252,7 +252,7 @@ OAIStoreApi::placeOrderCallback(OAIHttpRequestWorker * worker) {
else { else {
msg = "Error: " + worker->error_str; msg = "Error: " + worker->error_str;
} }
OAIOrder output(QString(worker->response)); PFXOrder output(QString(worker->response));
worker->deleteLater(); worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) { if (worker->error_type == QNetworkReply::NoError) {

View File

@ -10,26 +10,26 @@
* Do not edit the class manually. * Do not edit the class manually.
*/ */
#ifndef OAI_OAIStoreApi_H #ifndef PFX_PFXStoreApi_H
#define OAI_OAIStoreApi_H #define PFX_PFXStoreApi_H
#include "OAIHttpRequest.h" #include "PFXHttpRequest.h"
#include "OAIOrder.h" #include "PFXOrder.h"
#include <QMap> #include <QMap>
#include <QString> #include <QString>
#include <QObject> #include <QObject>
namespace OpenAPI { namespace test_namespace {
class OAIStoreApi: public QObject { class PFXStoreApi: public QObject {
Q_OBJECT Q_OBJECT
public: public:
OAIStoreApi(); PFXStoreApi();
OAIStoreApi(const QString& host, const QString& basePath, const int toutMs = 0); PFXStoreApi(const QString& host, const QString& basePath, const int toutMs = 0);
~OAIStoreApi(); ~PFXStoreApi();
void setBasePath(const QString& basePath); void setBasePath(const QString& basePath);
void setHost(const QString& host); void setHost(const QString& host);
@ -40,7 +40,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& body); void placeOrder(const PFXOrder& body);
private: private:
QString basePath; QString basePath;
@ -48,31 +48,31 @@ private:
QString workingDirectory; QString workingDirectory;
int timeout; int timeout;
QMap<QString, QString> defaultHeaders; QMap<QString, QString> defaultHeaders;
void deleteOrderCallback (OAIHttpRequestWorker * worker); void deleteOrderCallback (PFXHttpRequestWorker * worker);
void getInventoryCallback (OAIHttpRequestWorker * worker); void getInventoryCallback (PFXHttpRequestWorker * worker);
void getOrderByIdCallback (OAIHttpRequestWorker * worker); void getOrderByIdCallback (PFXHttpRequestWorker * worker);
void placeOrderCallback (OAIHttpRequestWorker * worker); void placeOrderCallback (PFXHttpRequestWorker * worker);
signals: signals:
void deleteOrderSignal(); void deleteOrderSignal();
void getInventorySignal(QMap<QString, qint32> summary); void getInventorySignal(QMap<QString, qint32> summary);
void getOrderByIdSignal(OAIOrder summary); void getOrderByIdSignal(PFXOrder summary);
void placeOrderSignal(OAIOrder summary); void placeOrderSignal(PFXOrder summary);
void deleteOrderSignalFull(OAIHttpRequestWorker* worker); void deleteOrderSignalFull(PFXHttpRequestWorker* worker);
void getInventorySignalFull(OAIHttpRequestWorker* worker, QMap<QString, qint32> summary); void getInventorySignalFull(PFXHttpRequestWorker* worker, QMap<QString, qint32> summary);
void getOrderByIdSignalFull(OAIHttpRequestWorker* worker, OAIOrder summary); void getOrderByIdSignalFull(PFXHttpRequestWorker* worker, PFXOrder summary);
void placeOrderSignalFull(OAIHttpRequestWorker* worker, OAIOrder summary); void placeOrderSignalFull(PFXHttpRequestWorker* worker, PFXOrder summary);
void deleteOrderSignalE(QNetworkReply::NetworkError error_type, QString error_str); void deleteOrderSignalE(QNetworkReply::NetworkError error_type, QString error_str);
void getInventorySignalE(QMap<QString, qint32> summary, QNetworkReply::NetworkError error_type, QString error_str); void getInventorySignalE(QMap<QString, qint32> summary, QNetworkReply::NetworkError error_type, QString error_str);
void getOrderByIdSignalE(OAIOrder summary, QNetworkReply::NetworkError error_type, QString error_str); void getOrderByIdSignalE(PFXOrder summary, QNetworkReply::NetworkError error_type, QString error_str);
void placeOrderSignalE(OAIOrder summary, QNetworkReply::NetworkError error_type, QString error_str); void placeOrderSignalE(PFXOrder summary, QNetworkReply::NetworkError error_type, QString error_str);
void deleteOrderSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); void deleteOrderSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void getInventorySignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); void getInventorySignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void getOrderByIdSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); void getOrderByIdSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void placeOrderSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); void placeOrderSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
}; };

View File

@ -11,32 +11,32 @@
*/ */
#include "OAITag.h" #include "PFXTag.h"
#include <QJsonDocument> #include <QJsonDocument>
#include <QJsonArray> #include <QJsonArray>
#include <QObject> #include <QObject>
#include <QDebug> #include <QDebug>
#include "OAIHelpers.h" #include "PFXHelpers.h"
namespace OpenAPI { namespace test_namespace {
OAITag::OAITag(QString json) { PFXTag::PFXTag(QString json) {
this->initializeModel(); this->initializeModel();
this->fromJson(json); this->fromJson(json);
} }
OAITag::OAITag() { PFXTag::PFXTag() {
this->initializeModel(); this->initializeModel();
} }
OAITag::~OAITag() { PFXTag::~PFXTag() {
} }
void void
OAITag::initializeModel() { PFXTag::initializeModel() {
m_id_isSet = false; m_id_isSet = false;
m_id_isValid = false; m_id_isValid = false;
@ -47,7 +47,7 @@ OAITag::initializeModel() {
} }
void void
OAITag::fromJson(QString jsonString) { PFXTag::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();
@ -55,18 +55,18 @@ OAITag::fromJson(QString jsonString) {
} }
void void
OAITag::fromJsonObject(QJsonObject json) { PFXTag::fromJsonObject(QJsonObject json) {
m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]);
m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; m_id_isSet = !json[QString("id")].isNull() && m_id_isValid;
m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]); m_name_isValid = ::test_namespace::fromJsonValue(name, json[QString("name")]);
m_name_isSet = !json[QString("name")].isNull() && m_name_isValid; m_name_isSet = !json[QString("name")].isNull() && m_name_isValid;
} }
QString QString
OAITag::asJson () const { PFXTag::asJson () const {
QJsonObject obj = this->asJsonObject(); QJsonObject obj = this->asJsonObject();
QJsonDocument doc(obj); QJsonDocument doc(obj);
QByteArray bytes = doc.toJson(); QByteArray bytes = doc.toJson();
@ -74,41 +74,41 @@ OAITag::asJson () const {
} }
QJsonObject QJsonObject
OAITag::asJsonObject() const { PFXTag::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"), ::test_namespace::toJsonValue(id));
} }
if(m_name_isSet){ if(m_name_isSet){
obj.insert(QString("name"), ::OpenAPI::toJsonValue(name)); obj.insert(QString("name"), ::test_namespace::toJsonValue(name));
} }
return obj; return obj;
} }
qint64 qint64
OAITag::getId() const { PFXTag::getId() const {
return id; return id;
} }
void void
OAITag::setId(const qint64 &id) { PFXTag::setId(const qint64 &id) {
this->id = id; this->id = id;
this->m_id_isSet = true; this->m_id_isSet = true;
} }
QString QString
OAITag::getName() const { PFXTag::getName() const {
return name; return name;
} }
void void
OAITag::setName(const QString &name) { PFXTag::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 { PFXTag::isSet() const {
bool isObjectUpdated = false; bool isObjectUpdated = false;
do{ do{
if(m_id_isSet){ isObjectUpdated = true; break;} if(m_id_isSet){ isObjectUpdated = true; break;}
@ -119,7 +119,7 @@ OAITag::isSet() const {
} }
bool bool
OAITag::isValid() const { PFXTag::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;
} }

View File

@ -11,30 +11,30 @@
*/ */
/* /*
* OAITag.h * PFXTag.h
* *
* A tag for a pet * A tag for a pet
*/ */
#ifndef OAITag_H #ifndef PFXTag_H
#define OAITag_H #define PFXTag_H
#include <QJsonObject> #include <QJsonObject>
#include <QString> #include <QString>
#include "OAIObject.h" #include "PFXObject.h"
#include "OAIEnum.h" #include "PFXEnum.h"
namespace OpenAPI { namespace test_namespace {
class OAITag: public OAIObject { class PFXTag: public PFXObject {
public: public:
OAITag(); PFXTag();
OAITag(QString json); PFXTag(QString json);
~OAITag() override; ~PFXTag() override;
QString asJson () const override; QString asJson () const override;
QJsonObject asJsonObject() const override; QJsonObject asJsonObject() const override;
@ -69,6 +69,6 @@ private:
} }
Q_DECLARE_METATYPE(OpenAPI::OAITag) Q_DECLARE_METATYPE(test_namespace::PFXTag)
#endif // OAITag_H #endif // PFXTag_H

View File

@ -11,32 +11,32 @@
*/ */
#include "OAIUser.h" #include "PFXUser.h"
#include <QJsonDocument> #include <QJsonDocument>
#include <QJsonArray> #include <QJsonArray>
#include <QObject> #include <QObject>
#include <QDebug> #include <QDebug>
#include "OAIHelpers.h" #include "PFXHelpers.h"
namespace OpenAPI { namespace test_namespace {
OAIUser::OAIUser(QString json) { PFXUser::PFXUser(QString json) {
this->initializeModel(); this->initializeModel();
this->fromJson(json); this->fromJson(json);
} }
OAIUser::OAIUser() { PFXUser::PFXUser() {
this->initializeModel(); this->initializeModel();
} }
OAIUser::~OAIUser() { PFXUser::~PFXUser() {
} }
void void
OAIUser::initializeModel() { PFXUser::initializeModel() {
m_id_isSet = false; m_id_isSet = false;
m_id_isValid = false; m_id_isValid = false;
@ -65,7 +65,7 @@ OAIUser::initializeModel() {
} }
void void
OAIUser::fromJson(QString jsonString) { PFXUser::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();
@ -73,36 +73,36 @@ OAIUser::fromJson(QString jsonString) {
} }
void void
OAIUser::fromJsonObject(QJsonObject json) { PFXUser::fromJsonObject(QJsonObject json) {
m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]);
m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; m_id_isSet = !json[QString("id")].isNull() && m_id_isValid;
m_username_isValid = ::OpenAPI::fromJsonValue(username, json[QString("username")]); m_username_isValid = ::test_namespace::fromJsonValue(username, json[QString("username")]);
m_username_isSet = !json[QString("username")].isNull() && m_username_isValid; 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 = ::test_namespace::fromJsonValue(first_name, json[QString("firstName")]);
m_first_name_isSet = !json[QString("firstName")].isNull() && m_first_name_isValid; 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 = ::test_namespace::fromJsonValue(last_name, json[QString("lastName")]);
m_last_name_isSet = !json[QString("lastName")].isNull() && m_last_name_isValid; m_last_name_isSet = !json[QString("lastName")].isNull() && m_last_name_isValid;
m_email_isValid = ::OpenAPI::fromJsonValue(email, json[QString("email")]); m_email_isValid = ::test_namespace::fromJsonValue(email, json[QString("email")]);
m_email_isSet = !json[QString("email")].isNull() && m_email_isValid; m_email_isSet = !json[QString("email")].isNull() && m_email_isValid;
m_password_isValid = ::OpenAPI::fromJsonValue(password, json[QString("password")]); m_password_isValid = ::test_namespace::fromJsonValue(password, json[QString("password")]);
m_password_isSet = !json[QString("password")].isNull() && m_password_isValid; m_password_isSet = !json[QString("password")].isNull() && m_password_isValid;
m_phone_isValid = ::OpenAPI::fromJsonValue(phone, json[QString("phone")]); m_phone_isValid = ::test_namespace::fromJsonValue(phone, json[QString("phone")]);
m_phone_isSet = !json[QString("phone")].isNull() && m_phone_isValid; 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 = ::test_namespace::fromJsonValue(user_status, json[QString("userStatus")]);
m_user_status_isSet = !json[QString("userStatus")].isNull() && m_user_status_isValid; m_user_status_isSet = !json[QString("userStatus")].isNull() && m_user_status_isValid;
} }
QString QString
OAIUser::asJson () const { PFXUser::asJson () const {
QJsonObject obj = this->asJsonObject(); QJsonObject obj = this->asJsonObject();
QJsonDocument doc(obj); QJsonDocument doc(obj);
QByteArray bytes = doc.toJson(); QByteArray bytes = doc.toJson();
@ -110,125 +110,125 @@ OAIUser::asJson () const {
} }
QJsonObject QJsonObject
OAIUser::asJsonObject() const { PFXUser::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"), ::test_namespace::toJsonValue(id));
} }
if(m_username_isSet){ if(m_username_isSet){
obj.insert(QString("username"), ::OpenAPI::toJsonValue(username)); obj.insert(QString("username"), ::test_namespace::toJsonValue(username));
} }
if(m_first_name_isSet){ if(m_first_name_isSet){
obj.insert(QString("firstName"), ::OpenAPI::toJsonValue(first_name)); obj.insert(QString("firstName"), ::test_namespace::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"), ::test_namespace::toJsonValue(last_name));
} }
if(m_email_isSet){ if(m_email_isSet){
obj.insert(QString("email"), ::OpenAPI::toJsonValue(email)); obj.insert(QString("email"), ::test_namespace::toJsonValue(email));
} }
if(m_password_isSet){ if(m_password_isSet){
obj.insert(QString("password"), ::OpenAPI::toJsonValue(password)); obj.insert(QString("password"), ::test_namespace::toJsonValue(password));
} }
if(m_phone_isSet){ if(m_phone_isSet){
obj.insert(QString("phone"), ::OpenAPI::toJsonValue(phone)); obj.insert(QString("phone"), ::test_namespace::toJsonValue(phone));
} }
if(m_user_status_isSet){ if(m_user_status_isSet){
obj.insert(QString("userStatus"), ::OpenAPI::toJsonValue(user_status)); obj.insert(QString("userStatus"), ::test_namespace::toJsonValue(user_status));
} }
return obj; return obj;
} }
qint64 qint64
OAIUser::getId() const { PFXUser::getId() const {
return id; return id;
} }
void void
OAIUser::setId(const qint64 &id) { PFXUser::setId(const qint64 &id) {
this->id = id; this->id = id;
this->m_id_isSet = true; this->m_id_isSet = true;
} }
QString QString
OAIUser::getUsername() const { PFXUser::getUsername() const {
return username; return username;
} }
void void
OAIUser::setUsername(const QString &username) { PFXUser::setUsername(const QString &username) {
this->username = username; this->username = username;
this->m_username_isSet = true; this->m_username_isSet = true;
} }
QString QString
OAIUser::getFirstName() const { PFXUser::getFirstName() const {
return first_name; return first_name;
} }
void void
OAIUser::setFirstName(const QString &first_name) { PFXUser::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 QString
OAIUser::getLastName() const { PFXUser::getLastName() const {
return last_name; return last_name;
} }
void void
OAIUser::setLastName(const QString &last_name) { PFXUser::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 QString
OAIUser::getEmail() const { PFXUser::getEmail() const {
return email; return email;
} }
void void
OAIUser::setEmail(const QString &email) { PFXUser::setEmail(const QString &email) {
this->email = email; this->email = email;
this->m_email_isSet = true; this->m_email_isSet = true;
} }
QString QString
OAIUser::getPassword() const { PFXUser::getPassword() const {
return password; return password;
} }
void void
OAIUser::setPassword(const QString &password) { PFXUser::setPassword(const QString &password) {
this->password = password; this->password = password;
this->m_password_isSet = true; this->m_password_isSet = true;
} }
QString QString
OAIUser::getPhone() const { PFXUser::getPhone() const {
return phone; return phone;
} }
void void
OAIUser::setPhone(const QString &phone) { PFXUser::setPhone(const QString &phone) {
this->phone = phone; this->phone = phone;
this->m_phone_isSet = true; this->m_phone_isSet = true;
} }
qint32 qint32
OAIUser::getUserStatus() const { PFXUser::getUserStatus() const {
return user_status; return user_status;
} }
void void
OAIUser::setUserStatus(const qint32 &user_status) { PFXUser::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 { PFXUser::isSet() const {
bool isObjectUpdated = false; bool isObjectUpdated = false;
do{ do{
if(m_id_isSet){ isObjectUpdated = true; break;} if(m_id_isSet){ isObjectUpdated = true; break;}
@ -251,7 +251,7 @@ OAIUser::isSet() const {
} }
bool bool
OAIUser::isValid() const { PFXUser::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;
} }

View File

@ -11,30 +11,30 @@
*/ */
/* /*
* OAIUser.h * PFXUser.h
* *
* A User who is purchasing from the pet store * A User who is purchasing from the pet store
*/ */
#ifndef OAIUser_H #ifndef PFXUser_H
#define OAIUser_H #define PFXUser_H
#include <QJsonObject> #include <QJsonObject>
#include <QString> #include <QString>
#include "OAIObject.h" #include "PFXObject.h"
#include "OAIEnum.h" #include "PFXEnum.h"
namespace OpenAPI { namespace test_namespace {
class OAIUser: public OAIObject { class PFXUser: public PFXObject {
public: public:
OAIUser(); PFXUser();
OAIUser(QString json); PFXUser(QString json);
~OAIUser() override; ~PFXUser() override;
QString asJson () const override; QString asJson () const override;
QJsonObject asJsonObject() const override; QJsonObject asJsonObject() const override;
@ -117,6 +117,6 @@ private:
} }
Q_DECLARE_METATYPE(OpenAPI::OAIUser) Q_DECLARE_METATYPE(test_namespace::PFXUser)
#endif // OAIUser_H #endif // PFXUser_H

View File

@ -10,60 +10,60 @@
* Do not edit the class manually. * Do not edit the class manually.
*/ */
#include "OAIUserApi.h" #include "PFXUserApi.h"
#include "OAIHelpers.h" #include "PFXHelpers.h"
#include <QJsonArray> #include <QJsonArray>
#include <QJsonDocument> #include <QJsonDocument>
namespace OpenAPI { namespace test_namespace {
OAIUserApi::OAIUserApi() : basePath("/v2"), PFXUserApi::PFXUserApi() : basePath("/v2"),
host("petstore.swagger.io"), host("petstore.swagger.io"),
timeout(0){ timeout(0){
} }
OAIUserApi::~OAIUserApi() { PFXUserApi::~PFXUserApi() {
} }
OAIUserApi::OAIUserApi(const QString& host, const QString& basePath, const int tout) { PFXUserApi::PFXUserApi(const QString& host, const QString& basePath, const int tout) {
this->host = host; this->host = host;
this->basePath = basePath; this->basePath = basePath;
this->timeout = tout; this->timeout = tout;
} }
void OAIUserApi::setBasePath(const QString& basePath){ void PFXUserApi::setBasePath(const QString& basePath){
this->basePath = basePath; this->basePath = basePath;
} }
void OAIUserApi::setHost(const QString& host){ void PFXUserApi::setHost(const QString& host){
this->host = host; this->host = host;
} }
void OAIUserApi::setApiTimeOutMs(const int tout){ void PFXUserApi::setApiTimeOutMs(const int tout){
timeout = tout; timeout = tout;
} }
void OAIUserApi::setWorkingDirectory(const QString& path){ void PFXUserApi::setWorkingDirectory(const QString& path){
workingDirectory = path; workingDirectory = path;
} }
void OAIUserApi::addHeaders(const QString& key, const QString& value){ void PFXUserApi::addHeaders(const QString& key, const QString& value){
defaultHeaders.insert(key, value); defaultHeaders.insert(key, value);
} }
void void
OAIUserApi::createUser(const OAIUser& body) { PFXUserApi::createUser(const PFXUser& body) {
QString fullPath; QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/user"); fullPath.append(this->host).append(this->basePath).append("/user");
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this);
worker->setTimeOut(timeout); worker->setTimeOut(timeout);
worker->setWorkingDirectory(workingDirectory); worker->setWorkingDirectory(workingDirectory);
OAIHttpRequestInput input(fullPath, "POST"); PFXHttpRequestInput input(fullPath, "POST");
QString output = body.asJson(); QString output = body.asJson();
@ -75,15 +75,15 @@ OAIUserApi::createUser(const OAIUser& body) {
} }
connect(worker, connect(worker,
&OAIHttpRequestWorker::on_execution_finished, &PFXHttpRequestWorker::on_execution_finished,
this, this,
&OAIUserApi::createUserCallback); &PFXUserApi::createUserCallback);
worker->execute(&input); worker->execute(&input);
} }
void void
OAIUserApi::createUserCallback(OAIHttpRequestWorker * worker) { PFXUserApi::createUserCallback(PFXHttpRequestWorker * worker) {
QString msg; QString msg;
QString error_str = worker->error_str; QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type; QNetworkReply::NetworkError error_type = worker->error_type;
@ -106,17 +106,17 @@ OAIUserApi::createUserCallback(OAIHttpRequestWorker * worker) {
} }
void void
OAIUserApi::createUsersWithArrayInput(const QList<OAIUser>& body) { PFXUserApi::createUsersWithArrayInput(const QList<PFXUser>& 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");
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this);
worker->setTimeOut(timeout); worker->setTimeOut(timeout);
worker->setWorkingDirectory(workingDirectory); worker->setWorkingDirectory(workingDirectory);
OAIHttpRequestInput input(fullPath, "POST"); PFXHttpRequestInput input(fullPath, "POST");
QJsonDocument doc(::OpenAPI::toJsonValue(body).toArray()); QJsonDocument doc(::test_namespace::toJsonValue(body).toArray());
QByteArray bytes = doc.toJson(); QByteArray bytes = doc.toJson();
input.request_body.append(bytes); input.request_body.append(bytes);
@ -126,15 +126,15 @@ OAIUserApi::createUsersWithArrayInput(const QList<OAIUser>& body) {
} }
connect(worker, connect(worker,
&OAIHttpRequestWorker::on_execution_finished, &PFXHttpRequestWorker::on_execution_finished,
this, this,
&OAIUserApi::createUsersWithArrayInputCallback); &PFXUserApi::createUsersWithArrayInputCallback);
worker->execute(&input); worker->execute(&input);
} }
void void
OAIUserApi::createUsersWithArrayInputCallback(OAIHttpRequestWorker * worker) { PFXUserApi::createUsersWithArrayInputCallback(PFXHttpRequestWorker * worker) {
QString msg; QString msg;
QString error_str = worker->error_str; QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type; QNetworkReply::NetworkError error_type = worker->error_type;
@ -157,17 +157,17 @@ OAIUserApi::createUsersWithArrayInputCallback(OAIHttpRequestWorker * worker) {
} }
void void
OAIUserApi::createUsersWithListInput(const QList<OAIUser>& body) { PFXUserApi::createUsersWithListInput(const QList<PFXUser>& 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");
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this);
worker->setTimeOut(timeout); worker->setTimeOut(timeout);
worker->setWorkingDirectory(workingDirectory); worker->setWorkingDirectory(workingDirectory);
OAIHttpRequestInput input(fullPath, "POST"); PFXHttpRequestInput input(fullPath, "POST");
QJsonDocument doc(::OpenAPI::toJsonValue(body).toArray()); QJsonDocument doc(::test_namespace::toJsonValue(body).toArray());
QByteArray bytes = doc.toJson(); QByteArray bytes = doc.toJson();
input.request_body.append(bytes); input.request_body.append(bytes);
@ -177,15 +177,15 @@ OAIUserApi::createUsersWithListInput(const QList<OAIUser>& body) {
} }
connect(worker, connect(worker,
&OAIHttpRequestWorker::on_execution_finished, &PFXHttpRequestWorker::on_execution_finished,
this, this,
&OAIUserApi::createUsersWithListInputCallback); &PFXUserApi::createUsersWithListInputCallback);
worker->execute(&input); worker->execute(&input);
} }
void void
OAIUserApi::createUsersWithListInputCallback(OAIHttpRequestWorker * worker) { PFXUserApi::createUsersWithListInputCallback(PFXHttpRequestWorker * worker) {
QString msg; QString msg;
QString error_str = worker->error_str; QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type; QNetworkReply::NetworkError error_type = worker->error_type;
@ -208,17 +208,17 @@ OAIUserApi::createUsersWithListInputCallback(OAIHttpRequestWorker * worker) {
} }
void void
OAIUserApi::deleteUser(const QString& username) { PFXUserApi::deleteUser(const QString& username) {
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("{");
usernamePathParam.append("username").append("}"); usernamePathParam.append("username").append("}");
fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(username))); fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(username)));
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this);
worker->setTimeOut(timeout); worker->setTimeOut(timeout);
worker->setWorkingDirectory(workingDirectory); worker->setWorkingDirectory(workingDirectory);
OAIHttpRequestInput input(fullPath, "DELETE"); PFXHttpRequestInput input(fullPath, "DELETE");
@ -227,15 +227,15 @@ OAIUserApi::deleteUser(const QString& username) {
} }
connect(worker, connect(worker,
&OAIHttpRequestWorker::on_execution_finished, &PFXHttpRequestWorker::on_execution_finished,
this, this,
&OAIUserApi::deleteUserCallback); &PFXUserApi::deleteUserCallback);
worker->execute(&input); worker->execute(&input);
} }
void void
OAIUserApi::deleteUserCallback(OAIHttpRequestWorker * worker) { PFXUserApi::deleteUserCallback(PFXHttpRequestWorker * worker) {
QString msg; QString msg;
QString error_str = worker->error_str; QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type; QNetworkReply::NetworkError error_type = worker->error_type;
@ -258,17 +258,17 @@ OAIUserApi::deleteUserCallback(OAIHttpRequestWorker * worker) {
} }
void void
OAIUserApi::getUserByName(const QString& username) { PFXUserApi::getUserByName(const QString& username) {
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("{");
usernamePathParam.append("username").append("}"); usernamePathParam.append("username").append("}");
fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(username))); fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(username)));
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this);
worker->setTimeOut(timeout); worker->setTimeOut(timeout);
worker->setWorkingDirectory(workingDirectory); worker->setWorkingDirectory(workingDirectory);
OAIHttpRequestInput input(fullPath, "GET"); PFXHttpRequestInput input(fullPath, "GET");
@ -277,15 +277,15 @@ OAIUserApi::getUserByName(const QString& username) {
} }
connect(worker, connect(worker,
&OAIHttpRequestWorker::on_execution_finished, &PFXHttpRequestWorker::on_execution_finished,
this, this,
&OAIUserApi::getUserByNameCallback); &PFXUserApi::getUserByNameCallback);
worker->execute(&input); worker->execute(&input);
} }
void void
OAIUserApi::getUserByNameCallback(OAIHttpRequestWorker * worker) { PFXUserApi::getUserByNameCallback(PFXHttpRequestWorker * worker) {
QString msg; QString msg;
QString error_str = worker->error_str; QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type; QNetworkReply::NetworkError error_type = worker->error_type;
@ -296,7 +296,7 @@ OAIUserApi::getUserByNameCallback(OAIHttpRequestWorker * worker) {
else { else {
msg = "Error: " + worker->error_str; msg = "Error: " + worker->error_str;
} }
OAIUser output(QString(worker->response)); PFXUser output(QString(worker->response));
worker->deleteLater(); worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) { if (worker->error_type == QNetworkReply::NoError) {
@ -309,7 +309,7 @@ OAIUserApi::getUserByNameCallback(OAIHttpRequestWorker * worker) {
} }
void void
OAIUserApi::loginUser(const QString& username, const QString& password) { PFXUserApi::loginUser(const QString& username, const QString& password) {
QString fullPath; QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/user/login"); fullPath.append(this->host).append(this->basePath).append("/user/login");
@ -319,7 +319,7 @@ OAIUserApi::loginUser(const QString& username, const QString& password) {
fullPath.append("?"); fullPath.append("?");
fullPath.append(QUrl::toPercentEncoding("username")) fullPath.append(QUrl::toPercentEncoding("username"))
.append("=") .append("=")
.append(QUrl::toPercentEncoding(::OpenAPI::toStringValue(username))); .append(QUrl::toPercentEncoding(::test_namespace::toStringValue(username)));
if (fullPath.indexOf("?") > 0) if (fullPath.indexOf("?") > 0)
fullPath.append("&"); fullPath.append("&");
@ -327,12 +327,12 @@ OAIUserApi::loginUser(const QString& username, const QString& password) {
fullPath.append("?"); fullPath.append("?");
fullPath.append(QUrl::toPercentEncoding("password")) fullPath.append(QUrl::toPercentEncoding("password"))
.append("=") .append("=")
.append(QUrl::toPercentEncoding(::OpenAPI::toStringValue(password))); .append(QUrl::toPercentEncoding(::test_namespace::toStringValue(password)));
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this);
worker->setTimeOut(timeout); worker->setTimeOut(timeout);
worker->setWorkingDirectory(workingDirectory); worker->setWorkingDirectory(workingDirectory);
OAIHttpRequestInput input(fullPath, "GET"); PFXHttpRequestInput input(fullPath, "GET");
@ -341,15 +341,15 @@ OAIUserApi::loginUser(const QString& username, const QString& password) {
} }
connect(worker, connect(worker,
&OAIHttpRequestWorker::on_execution_finished, &PFXHttpRequestWorker::on_execution_finished,
this, this,
&OAIUserApi::loginUserCallback); &PFXUserApi::loginUserCallback);
worker->execute(&input); worker->execute(&input);
} }
void void
OAIUserApi::loginUserCallback(OAIHttpRequestWorker * worker) { PFXUserApi::loginUserCallback(PFXHttpRequestWorker * worker) {
QString msg; QString msg;
QString error_str = worker->error_str; QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type; QNetworkReply::NetworkError error_type = worker->error_type;
@ -361,7 +361,7 @@ OAIUserApi::loginUserCallback(OAIHttpRequestWorker * worker) {
msg = "Error: " + worker->error_str; msg = "Error: " + worker->error_str;
} }
QString output; QString output;
::OpenAPI::fromStringValue(QString(worker->response), output); ::test_namespace::fromStringValue(QString(worker->response), output);
worker->deleteLater(); worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) { if (worker->error_type == QNetworkReply::NoError) {
@ -374,14 +374,14 @@ OAIUserApi::loginUserCallback(OAIHttpRequestWorker * worker) {
} }
void void
OAIUserApi::logoutUser() { PFXUserApi::logoutUser() {
QString fullPath; QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/user/logout"); fullPath.append(this->host).append(this->basePath).append("/user/logout");
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this);
worker->setTimeOut(timeout); worker->setTimeOut(timeout);
worker->setWorkingDirectory(workingDirectory); worker->setWorkingDirectory(workingDirectory);
OAIHttpRequestInput input(fullPath, "GET"); PFXHttpRequestInput input(fullPath, "GET");
@ -390,15 +390,15 @@ OAIUserApi::logoutUser() {
} }
connect(worker, connect(worker,
&OAIHttpRequestWorker::on_execution_finished, &PFXHttpRequestWorker::on_execution_finished,
this, this,
&OAIUserApi::logoutUserCallback); &PFXUserApi::logoutUserCallback);
worker->execute(&input); worker->execute(&input);
} }
void void
OAIUserApi::logoutUserCallback(OAIHttpRequestWorker * worker) { PFXUserApi::logoutUserCallback(PFXHttpRequestWorker * worker) {
QString msg; QString msg;
QString error_str = worker->error_str; QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type; QNetworkReply::NetworkError error_type = worker->error_type;
@ -421,17 +421,17 @@ OAIUserApi::logoutUserCallback(OAIHttpRequestWorker * worker) {
} }
void void
OAIUserApi::updateUser(const QString& username, const OAIUser& body) { PFXUserApi::updateUser(const QString& username, const PFXUser& 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("{");
usernamePathParam.append("username").append("}"); usernamePathParam.append("username").append("}");
fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(username))); fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(username)));
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(this); PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this);
worker->setTimeOut(timeout); worker->setTimeOut(timeout);
worker->setWorkingDirectory(workingDirectory); worker->setWorkingDirectory(workingDirectory);
OAIHttpRequestInput input(fullPath, "PUT"); PFXHttpRequestInput input(fullPath, "PUT");
QString output = body.asJson(); QString output = body.asJson();
@ -443,15 +443,15 @@ OAIUserApi::updateUser(const QString& username, const OAIUser& body) {
} }
connect(worker, connect(worker,
&OAIHttpRequestWorker::on_execution_finished, &PFXHttpRequestWorker::on_execution_finished,
this, this,
&OAIUserApi::updateUserCallback); &PFXUserApi::updateUserCallback);
worker->execute(&input); worker->execute(&input);
} }
void void
OAIUserApi::updateUserCallback(OAIHttpRequestWorker * worker) { PFXUserApi::updateUserCallback(PFXHttpRequestWorker * worker) {
QString msg; QString msg;
QString error_str = worker->error_str; QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type; QNetworkReply::NetworkError error_type = worker->error_type;

View File

@ -10,26 +10,26 @@
* Do not edit the class manually. * Do not edit the class manually.
*/ */
#ifndef OAI_OAIUserApi_H #ifndef PFX_PFXUserApi_H
#define OAI_OAIUserApi_H #define PFX_PFXUserApi_H
#include "OAIHttpRequest.h" #include "PFXHttpRequest.h"
#include "OAIUser.h" #include "PFXUser.h"
#include <QList> #include <QList>
#include <QString> #include <QString>
#include <QObject> #include <QObject>
namespace OpenAPI { namespace test_namespace {
class OAIUserApi: public QObject { class PFXUserApi: public QObject {
Q_OBJECT Q_OBJECT
public: public:
OAIUserApi(); PFXUserApi();
OAIUserApi(const QString& host, const QString& basePath, const int toutMs = 0); PFXUserApi(const QString& host, const QString& basePath, const int toutMs = 0);
~OAIUserApi(); ~PFXUserApi();
void setBasePath(const QString& basePath); void setBasePath(const QString& basePath);
void setHost(const QString& host); void setHost(const QString& host);
@ -37,14 +37,14 @@ public:
void setWorkingDirectory(const QString& path); void setWorkingDirectory(const QString& path);
void addHeaders(const QString& key, const QString& value); void addHeaders(const QString& key, const QString& value);
void createUser(const OAIUser& body); void createUser(const PFXUser& body);
void createUsersWithArrayInput(const QList<OAIUser>& body); void createUsersWithArrayInput(const QList<PFXUser>& body);
void createUsersWithListInput(const QList<OAIUser>& body); void createUsersWithListInput(const QList<PFXUser>& 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& body); void updateUser(const QString& username, const PFXUser& body);
private: private:
QString basePath; QString basePath;
@ -52,51 +52,51 @@ private:
QString workingDirectory; QString workingDirectory;
int timeout; int timeout;
QMap<QString, QString> defaultHeaders; QMap<QString, QString> defaultHeaders;
void createUserCallback (OAIHttpRequestWorker * worker); void createUserCallback (PFXHttpRequestWorker * worker);
void createUsersWithArrayInputCallback (OAIHttpRequestWorker * worker); void createUsersWithArrayInputCallback (PFXHttpRequestWorker * worker);
void createUsersWithListInputCallback (OAIHttpRequestWorker * worker); void createUsersWithListInputCallback (PFXHttpRequestWorker * worker);
void deleteUserCallback (OAIHttpRequestWorker * worker); void deleteUserCallback (PFXHttpRequestWorker * worker);
void getUserByNameCallback (OAIHttpRequestWorker * worker); void getUserByNameCallback (PFXHttpRequestWorker * worker);
void loginUserCallback (OAIHttpRequestWorker * worker); void loginUserCallback (PFXHttpRequestWorker * worker);
void logoutUserCallback (OAIHttpRequestWorker * worker); void logoutUserCallback (PFXHttpRequestWorker * worker);
void updateUserCallback (OAIHttpRequestWorker * worker); void updateUserCallback (PFXHttpRequestWorker * worker);
signals: signals:
void createUserSignal(); void createUserSignal();
void createUsersWithArrayInputSignal(); void createUsersWithArrayInputSignal();
void createUsersWithListInputSignal(); void createUsersWithListInputSignal();
void deleteUserSignal(); void deleteUserSignal();
void getUserByNameSignal(OAIUser summary); void getUserByNameSignal(PFXUser summary);
void loginUserSignal(QString summary); void loginUserSignal(QString summary);
void logoutUserSignal(); void logoutUserSignal();
void updateUserSignal(); void updateUserSignal();
void createUserSignalFull(OAIHttpRequestWorker* worker); void createUserSignalFull(PFXHttpRequestWorker* worker);
void createUsersWithArrayInputSignalFull(OAIHttpRequestWorker* worker); void createUsersWithArrayInputSignalFull(PFXHttpRequestWorker* worker);
void createUsersWithListInputSignalFull(OAIHttpRequestWorker* worker); void createUsersWithListInputSignalFull(PFXHttpRequestWorker* worker);
void deleteUserSignalFull(OAIHttpRequestWorker* worker); void deleteUserSignalFull(PFXHttpRequestWorker* worker);
void getUserByNameSignalFull(OAIHttpRequestWorker* worker, OAIUser summary); void getUserByNameSignalFull(PFXHttpRequestWorker* worker, PFXUser summary);
void loginUserSignalFull(OAIHttpRequestWorker* worker, QString summary); void loginUserSignalFull(PFXHttpRequestWorker* worker, QString summary);
void logoutUserSignalFull(OAIHttpRequestWorker* worker); void logoutUserSignalFull(PFXHttpRequestWorker* worker);
void updateUserSignalFull(OAIHttpRequestWorker* worker); void updateUserSignalFull(PFXHttpRequestWorker* worker);
void createUserSignalE(QNetworkReply::NetworkError error_type, QString error_str); void createUserSignalE(QNetworkReply::NetworkError error_type, QString error_str);
void createUsersWithArrayInputSignalE(QNetworkReply::NetworkError error_type, QString error_str); void createUsersWithArrayInputSignalE(QNetworkReply::NetworkError error_type, QString error_str);
void createUsersWithListInputSignalE(QNetworkReply::NetworkError error_type, QString error_str); void createUsersWithListInputSignalE(QNetworkReply::NetworkError error_type, QString error_str);
void deleteUserSignalE(QNetworkReply::NetworkError error_type, QString error_str); void deleteUserSignalE(QNetworkReply::NetworkError error_type, QString error_str);
void getUserByNameSignalE(OAIUser summary, QNetworkReply::NetworkError error_type, QString error_str); void getUserByNameSignalE(PFXUser summary, QNetworkReply::NetworkError error_type, QString error_str);
void loginUserSignalE(QString summary, QNetworkReply::NetworkError error_type, QString error_str); void loginUserSignalE(QString summary, QNetworkReply::NetworkError error_type, QString error_str);
void logoutUserSignalE(QNetworkReply::NetworkError error_type, QString error_str); void logoutUserSignalE(QNetworkReply::NetworkError error_type, QString error_str);
void updateUserSignalE(QNetworkReply::NetworkError error_type, QString error_str); void updateUserSignalE(QNetworkReply::NetworkError error_type, QString error_str);
void createUserSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); void createUserSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void createUsersWithArrayInputSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); void createUsersWithArrayInputSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void createUsersWithListInputSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); void createUsersWithListInputSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void deleteUserSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); void deleteUserSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void getUserByNameSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); void getUserByNameSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void loginUserSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); void loginUserSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void logoutUserSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); void logoutUserSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
void updateUserSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); void updateUserSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
}; };

View File

@ -0,0 +1,38 @@
QT += network
HEADERS += \
# Models
$${PWD}/PFXApiResponse.h \
$${PWD}/PFXCategory.h \
$${PWD}/PFXOrder.h \
$${PWD}/PFXPet.h \
$${PWD}/PFXTag.h \
$${PWD}/PFXUser.h \
# APIs
$${PWD}/PFXPetApi.h \
$${PWD}/PFXStoreApi.h \
$${PWD}/PFXUserApi.h \
# Others
$${PWD}/PFXHelpers.h \
$${PWD}/PFXHttpRequest.h \
$${PWD}/PFXObject.h \
$${PWD}/PFXEnum.h \
$${PWD}/PFXHttpFileElement.h
SOURCES += \
# Models
$${PWD}/PFXApiResponse.cpp \
$${PWD}/PFXCategory.cpp \
$${PWD}/PFXOrder.cpp \
$${PWD}/PFXPet.cpp \
$${PWD}/PFXTag.cpp \
$${PWD}/PFXUser.cpp \
# APIs
$${PWD}/PFXPetApi.cpp \
$${PWD}/PFXStoreApi.cpp \
$${PWD}/PFXUserApi.cpp \
# Others
$${PWD}/PFXHelpers.cpp \
$${PWD}/PFXHttpRequest.cpp \
$${PWD}/PFXHttpFileElement.cpp

View File

@ -1,38 +0,0 @@
QT += network
HEADERS += \
# Models
$${PWD}/OAIApiResponse.h \
$${PWD}/OAICategory.h \
$${PWD}/OAIOrder.h \
$${PWD}/OAIPet.h \
$${PWD}/OAITag.h \
$${PWD}/OAIUser.h \
# APIs
$${PWD}/OAIPetApi.h \
$${PWD}/OAIStoreApi.h \
$${PWD}/OAIUserApi.h \
# Others
$${PWD}/OAIHelpers.h \
$${PWD}/OAIHttpRequest.h \
$${PWD}/OAIObject.h \
$${PWD}/OAIEnum.h \
$${PWD}/OAIHttpFileElement.h
SOURCES += \
# Models
$${PWD}/OAIApiResponse.cpp \
$${PWD}/OAICategory.cpp \
$${PWD}/OAIOrder.cpp \
$${PWD}/OAIPet.cpp \
$${PWD}/OAITag.cpp \
$${PWD}/OAIUser.cpp \
# APIs
$${PWD}/OAIPetApi.cpp \
$${PWD}/OAIStoreApi.cpp \
$${PWD}/OAIUserApi.cpp \
# Others
$${PWD}/OAIHelpers.cpp \
$${PWD}/OAIHttpRequest.cpp \
$${PWD}/OAIHttpFileElement.cpp