diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Qt5CPPGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Qt5CPPGenerator.java index c487cbda9298..e843b9868c4a 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Qt5CPPGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Qt5CPPGenerator.java @@ -217,7 +217,7 @@ public class Qt5CPPGenerator extends DefaultCodegen implements CodegenConfig { @Override public String toModelFilename(String name) { - return PREFIX + initialCaps(name); + return modelNamePrefix + initialCaps(name); } @Override @@ -332,7 +332,7 @@ public class Qt5CPPGenerator extends DefaultCodegen implements CodegenConfig { languageSpecificPrimitives.contains(type)) { return type; } else { - return PREFIX + Character.toUpperCase(type.charAt(0)) + type.substring(1); + return modelNamePrefix + Character.toUpperCase(type.charAt(0)) + type.substring(1); } } diff --git a/samples/client/petstore/qt5cpp/PetStore/PetApiTests.cpp b/samples/client/petstore/qt5cpp/PetStore/PetApiTests.cpp index 4b1d5f5cd5fe..cfc6e2776eda 100644 --- a/samples/client/petstore/qt5cpp/PetStore/PetApiTests.cpp +++ b/samples/client/petstore/qt5cpp/PetStore/PetApiTests.cpp @@ -18,8 +18,8 @@ SWGPetApi* PetApiTests::getApi() { return api; } -SWGPet* PetApiTests::createRandomPet() { - SWGPet* pet = new SWGPet(); +Pet* PetApiTests::createRandomPet() { + Pet* pet = new Pet(); qint64 id = QDateTime::currentMSecsSinceEpoch(); pet->setName(new QString("monster")); @@ -43,8 +43,8 @@ void PetApiTests::findPetsByStatusTest() { timer.setInterval(4000); timer.setSingleShot(true); - auto validator = [](QList* pets) { - foreach(SWGPet* pet, *pets) { + auto validator = [](QList* pets) { + foreach(Pet* pet, *pets) { QVERIFY(pet->getStatus()->startsWith("available") || pet->getStatus()->startsWith("sold")); } loop.quit(); @@ -79,7 +79,7 @@ void PetApiTests::createAndGetPetTest() { connect(api, &SWGPetApi::addPetSignal, this, validator); connect(&timer, &QTimer::timeout, &loop, &QEventLoop::quit); - SWGPet* pet = createRandomPet(); + Pet* pet = createRandomPet(); qint64 id = pet->getId(); api->addPet(*pet); @@ -90,7 +90,7 @@ void PetApiTests::createAndGetPetTest() { timer.setInterval(1000); timer.setSingleShot(true); - auto getPetValidator = [](SWGPet* pet) { + auto getPetValidator = [](Pet* pet) { QVERIFY(pet->getId() > 0); QVERIFY(pet->getStatus()->compare("freaky") == 0); loop.quit(); @@ -109,8 +109,8 @@ void PetApiTests::createAndGetPetTest() { void PetApiTests::updatePetTest() { static SWGPetApi* api = getApi(); - SWGPet* pet = createRandomPet(); - static SWGPet* petToCheck; + Pet* pet = createRandomPet(); + static Pet* petToCheck; qint64 id = pet->getId(); static QEventLoop loop; QTimer timer; @@ -134,7 +134,7 @@ void PetApiTests::updatePetTest() { timer.setInterval(1000); timer.setSingleShot(true); - auto fetchPet = [](SWGPet* pet) { + auto fetchPet = [](Pet* pet) { petToCheck = pet; loop.quit(); }; @@ -168,7 +168,7 @@ void PetApiTests::updatePetTest() { timer.setInterval(1000); timer.setSingleShot(true); - auto fetchPet2 = [](SWGPet* pet) { + auto fetchPet2 = [](Pet* pet) { QVERIFY(pet->getId() == petToCheck->getId()); QVERIFY(pet->getStatus()->compare(petToCheck->getStatus()) == 0); loop.quit(); @@ -184,8 +184,8 @@ void PetApiTests::updatePetTest() { void PetApiTests::updatePetWithFormTest() { static SWGPetApi* api = getApi(); - SWGPet* pet = createRandomPet(); - static SWGPet* petToCheck; + Pet* pet = createRandomPet(); + static Pet* petToCheck; qint64 id = pet->getId(); static QEventLoop loop; QTimer timer; @@ -209,7 +209,7 @@ void PetApiTests::updatePetWithFormTest() { timer.setInterval(1000); timer.setSingleShot(true); - auto fetchPet = [](SWGPet* pet) { + auto fetchPet = [](Pet* pet) { petToCheck = pet; loop.quit(); }; @@ -237,7 +237,7 @@ void PetApiTests::updatePetWithFormTest() { timer.setInterval(1000); timer.setSingleShot(true); - auto fetchUpdatedPet = [](SWGPet* pet) { + auto fetchUpdatedPet = [](Pet* pet) { QVERIFY(pet->getName()->compare(QString("gorilla")) == 0); loop.quit(); }; diff --git a/samples/client/petstore/qt5cpp/PetStore/PetApiTests.h b/samples/client/petstore/qt5cpp/PetStore/PetApiTests.h index e219bb9a6398..6de5bf4ecbda 100644 --- a/samples/client/petstore/qt5cpp/PetStore/PetApiTests.h +++ b/samples/client/petstore/qt5cpp/PetStore/PetApiTests.h @@ -18,7 +18,7 @@ public: private: SWGPetApi* getApi(); - SWGPet* createRandomPet(); + Pet* createRandomPet(); signals: void quit(); diff --git a/samples/client/petstore/qt5cpp/PetStore/PetStore.pro b/samples/client/petstore/qt5cpp/PetStore/PetStore.pro index 64f27a3c9249..f8c5480023d3 100644 --- a/samples/client/petstore/qt5cpp/PetStore/PetStore.pro +++ b/samples/client/petstore/qt5cpp/PetStore/PetStore.pro @@ -18,31 +18,31 @@ TEMPLATE = app SOURCES += main.cpp \ - ../client/SWGCategory.cpp \ + ../client/Category.cpp \ ../client/SWGHelpers.cpp \ ../client/SWGHttpRequest.cpp \ - ../client/SWGOrder.cpp \ - ../client/SWGPet.cpp \ + ../client/Order.cpp \ + ../client/Pet.cpp \ ../client/SWGPetApi.cpp \ ../client/SWGStoreApi.cpp \ - ../client/SWGTag.cpp \ - ../client/SWGUser.cpp \ + ../client/Tag.cpp \ + ../client/User.cpp \ ../client/SWGUserApi.cpp \ - ../client/SWGApiResponse.cpp \ + ../client/ApiResponse.cpp \ PetApiTests.cpp HEADERS += \ - ../client/SWGCategory.h \ + ../client/Category.h \ ../client/SWGHelpers.h \ ../client/SWGHttpRequest.h \ ../client/SWGObject.h \ - ../client/SWGOrder.h \ - ../client/SWGPet.h \ + ../client/Order.h \ + ../client/Pet.h \ ../client/SWGPetApi.h \ ../client/SWGStoreApi.h \ - ../client/SWGTag.h \ - ../client/SWGUser.h \ + ../client/Tag.h \ + ../client/User.h \ ../client/SWGUserApi.h \ PetApiTests.h \ - ../client/SWGApiResponse.h \ + ../client/ApiResponse.h \ ../client/SWGModelFactory.h diff --git a/samples/client/petstore/qt5cpp/client/SWGApiResponse.cpp b/samples/client/petstore/qt5cpp/client/ApiResponse.cpp similarity index 81% rename from samples/client/petstore/qt5cpp/client/SWGApiResponse.cpp rename to samples/client/petstore/qt5cpp/client/ApiResponse.cpp index d3260c7c399b..7a06f16a594a 100644 --- a/samples/client/petstore/qt5cpp/client/SWGApiResponse.cpp +++ b/samples/client/petstore/qt5cpp/client/ApiResponse.cpp @@ -23,7 +23,7 @@ */ -#include "SWGApiResponse.h" +#include "ApiResponse.h" #include "SWGHelpers.h" @@ -35,28 +35,28 @@ namespace Swagger { -SWGApiResponse::SWGApiResponse(QString* json) { +ApiResponse::ApiResponse(QString* json) { init(); this->fromJson(*json); } -SWGApiResponse::SWGApiResponse() { +ApiResponse::ApiResponse() { init(); } -SWGApiResponse::~SWGApiResponse() { +ApiResponse::~ApiResponse() { this->cleanup(); } void -SWGApiResponse::init() { +ApiResponse::init() { code = 0; type = new QString(""); message = new QString(""); } void -SWGApiResponse::cleanup() { +ApiResponse::cleanup() { if(type != NULL) { delete type; @@ -66,8 +66,8 @@ if(message != NULL) { } } -SWGApiResponse* -SWGApiResponse::fromJson(QString &json) { +ApiResponse* +ApiResponse::fromJson(QString &json) { QByteArray array (json.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); @@ -76,14 +76,14 @@ SWGApiResponse::fromJson(QString &json) { } void -SWGApiResponse::fromJsonObject(QJsonObject &pJson) { +ApiResponse::fromJsonObject(QJsonObject &pJson) { setValue(&code, pJson["code"], "qint32", ""); setValue(&type, pJson["type"], "QString", "QString"); setValue(&message, pJson["message"], "QString", "QString"); } QString -SWGApiResponse::asJson () +ApiResponse::asJson () { QJsonObject* obj = this->asJsonObject(); @@ -93,7 +93,7 @@ SWGApiResponse::asJson () } QJsonObject* -SWGApiResponse::asJsonObject() { +ApiResponse::asJsonObject() { QJsonObject* obj = new QJsonObject(); obj->insert("code", QJsonValue(code)); @@ -111,29 +111,29 @@ SWGApiResponse::asJsonObject() { } qint32 -SWGApiResponse::getCode() { +ApiResponse::getCode() { return code; } void -SWGApiResponse::setCode(qint32 code) { +ApiResponse::setCode(qint32 code) { this->code = code; } QString* -SWGApiResponse::getType() { +ApiResponse::getType() { return type; } void -SWGApiResponse::setType(QString* type) { +ApiResponse::setType(QString* type) { this->type = type; } QString* -SWGApiResponse::getMessage() { +ApiResponse::getMessage() { return message; } void -SWGApiResponse::setMessage(QString* message) { +ApiResponse::setMessage(QString* message) { this->message = message; } diff --git a/samples/client/petstore/qt5cpp/client/SWGApiResponse.h b/samples/client/petstore/qt5cpp/client/ApiResponse.h similarity index 85% rename from samples/client/petstore/qt5cpp/client/SWGApiResponse.h rename to samples/client/petstore/qt5cpp/client/ApiResponse.h index ee861c873455..831afa27a8b8 100644 --- a/samples/client/petstore/qt5cpp/client/SWGApiResponse.h +++ b/samples/client/petstore/qt5cpp/client/ApiResponse.h @@ -23,13 +23,13 @@ */ /* - * SWGApiResponse.h + * ApiResponse.h * * Describes the result of uploading an image resource */ -#ifndef SWGApiResponse_H_ -#define SWGApiResponse_H_ +#ifndef ApiResponse_H_ +#define ApiResponse_H_ #include @@ -41,18 +41,18 @@ namespace Swagger { -class SWGApiResponse: public SWGObject { +class ApiResponse: public SWGObject { public: - SWGApiResponse(); - SWGApiResponse(QString* json); - virtual ~SWGApiResponse(); + ApiResponse(); + ApiResponse(QString* json); + virtual ~ApiResponse(); void init(); void cleanup(); QString asJson (); QJsonObject* asJsonObject(); void fromJsonObject(QJsonObject &json); - SWGApiResponse* fromJson(QString &jsonString); + ApiResponse* fromJson(QString &jsonString); qint32 getCode(); void setCode(qint32 code); @@ -69,4 +69,4 @@ QString* message; } /* namespace Swagger */ -#endif /* SWGApiResponse_H_ */ +#endif /* ApiResponse_H_ */ diff --git a/samples/client/petstore/qt5cpp/client/SWGCategory.cpp b/samples/client/petstore/qt5cpp/client/Category.cpp similarity index 83% rename from samples/client/petstore/qt5cpp/client/SWGCategory.cpp rename to samples/client/petstore/qt5cpp/client/Category.cpp index 3ac679a863c9..e70d1992b7a1 100644 --- a/samples/client/petstore/qt5cpp/client/SWGCategory.cpp +++ b/samples/client/petstore/qt5cpp/client/Category.cpp @@ -23,7 +23,7 @@ */ -#include "SWGCategory.h" +#include "Category.h" #include "SWGHelpers.h" @@ -35,35 +35,35 @@ namespace Swagger { -SWGCategory::SWGCategory(QString* json) { +Category::Category(QString* json) { init(); this->fromJson(*json); } -SWGCategory::SWGCategory() { +Category::Category() { init(); } -SWGCategory::~SWGCategory() { +Category::~Category() { this->cleanup(); } void -SWGCategory::init() { +Category::init() { id = 0L; name = new QString(""); } void -SWGCategory::cleanup() { +Category::cleanup() { if(name != NULL) { delete name; } } -SWGCategory* -SWGCategory::fromJson(QString &json) { +Category* +Category::fromJson(QString &json) { QByteArray array (json.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); @@ -72,13 +72,13 @@ SWGCategory::fromJson(QString &json) { } void -SWGCategory::fromJsonObject(QJsonObject &pJson) { +Category::fromJsonObject(QJsonObject &pJson) { setValue(&id, pJson["id"], "qint64", ""); setValue(&name, pJson["name"], "QString", "QString"); } QString -SWGCategory::asJson () +Category::asJson () { QJsonObject* obj = this->asJsonObject(); @@ -88,7 +88,7 @@ SWGCategory::asJson () } QJsonObject* -SWGCategory::asJsonObject() { +Category::asJsonObject() { QJsonObject* obj = new QJsonObject(); obj->insert("id", QJsonValue(id)); @@ -101,20 +101,20 @@ SWGCategory::asJsonObject() { } qint64 -SWGCategory::getId() { +Category::getId() { return id; } void -SWGCategory::setId(qint64 id) { +Category::setId(qint64 id) { this->id = id; } QString* -SWGCategory::getName() { +Category::getName() { return name; } void -SWGCategory::setName(QString* name) { +Category::setName(QString* name) { this->name = name; } diff --git a/samples/client/petstore/qt5cpp/client/SWGCategory.h b/samples/client/petstore/qt5cpp/client/Category.h similarity index 85% rename from samples/client/petstore/qt5cpp/client/SWGCategory.h rename to samples/client/petstore/qt5cpp/client/Category.h index 254862e5c5fd..d1e9ec0dbf0c 100644 --- a/samples/client/petstore/qt5cpp/client/SWGCategory.h +++ b/samples/client/petstore/qt5cpp/client/Category.h @@ -23,13 +23,13 @@ */ /* - * SWGCategory.h + * Category.h * * A category for a pet */ -#ifndef SWGCategory_H_ -#define SWGCategory_H_ +#ifndef Category_H_ +#define Category_H_ #include @@ -41,18 +41,18 @@ namespace Swagger { -class SWGCategory: public SWGObject { +class Category: public SWGObject { public: - SWGCategory(); - SWGCategory(QString* json); - virtual ~SWGCategory(); + Category(); + Category(QString* json); + virtual ~Category(); void init(); void cleanup(); QString asJson (); QJsonObject* asJsonObject(); void fromJsonObject(QJsonObject &json); - SWGCategory* fromJson(QString &jsonString); + Category* fromJson(QString &jsonString); qint64 getId(); void setId(qint64 id); @@ -66,4 +66,4 @@ QString* name; } /* namespace Swagger */ -#endif /* SWGCategory_H_ */ +#endif /* Category_H_ */ diff --git a/samples/client/petstore/qt5cpp/client/SWGOrder.cpp b/samples/client/petstore/qt5cpp/client/Order.cpp similarity index 71% rename from samples/client/petstore/qt5cpp/client/SWGOrder.cpp rename to samples/client/petstore/qt5cpp/client/Order.cpp index 2c640390f38d..4b978b44a0f4 100644 --- a/samples/client/petstore/qt5cpp/client/SWGOrder.cpp +++ b/samples/client/petstore/qt5cpp/client/Order.cpp @@ -23,7 +23,7 @@ */ -#include "SWGOrder.h" +#include "Order.h" #include "SWGHelpers.h" @@ -35,36 +35,36 @@ namespace Swagger { -SWGOrder::SWGOrder(QString* json) { +Order::Order(QString* json) { init(); this->fromJson(*json); } -SWGOrder::SWGOrder() { +Order::Order() { init(); } -SWGOrder::~SWGOrder() { +Order::~Order() { this->cleanup(); } void -SWGOrder::init() { +Order::init() { id = 0L; -pet_id = 0L; +petId = 0L; quantity = 0; -ship_date = NULL; +shipDate = NULL; status = new QString(""); complete = false; } void -SWGOrder::cleanup() { +Order::cleanup() { -if(ship_date != NULL) { - delete ship_date; +if(shipDate != NULL) { + delete shipDate; } if(status != NULL) { delete status; @@ -72,8 +72,8 @@ if(status != NULL) { } -SWGOrder* -SWGOrder::fromJson(QString &json) { +Order* +Order::fromJson(QString &json) { QByteArray array (json.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); @@ -82,17 +82,17 @@ SWGOrder::fromJson(QString &json) { } void -SWGOrder::fromJsonObject(QJsonObject &pJson) { +Order::fromJsonObject(QJsonObject &pJson) { setValue(&id, pJson["id"], "qint64", ""); -setValue(&pet_id, pJson["pet_id"], "qint64", ""); +setValue(&petId, pJson["petId"], "qint64", ""); setValue(&quantity, pJson["quantity"], "qint32", ""); -setValue(&ship_date, pJson["ship_date"], "QDateTime", "QDateTime"); +setValue(&shipDate, pJson["shipDate"], "QDateTime", "QDateTime"); setValue(&status, pJson["status"], "QString", "QString"); setValue(&complete, pJson["complete"], "bool", ""); } QString -SWGOrder::asJson () +Order::asJson () { QJsonObject* obj = this->asJsonObject(); @@ -102,14 +102,14 @@ SWGOrder::asJson () } QJsonObject* -SWGOrder::asJsonObject() { +Order::asJsonObject() { QJsonObject* obj = new QJsonObject(); obj->insert("id", QJsonValue(id)); -obj->insert("pet_id", QJsonValue(pet_id)); +obj->insert("petId", QJsonValue(petId)); obj->insert("quantity", QJsonValue(quantity)); - toJsonValue(QString("ship_date"), ship_date, obj, QString("QDateTime")); + toJsonValue(QString("shipDate"), shipDate, obj, QString("QDateTime")); @@ -123,56 +123,56 @@ obj->insert("complete", QJsonValue(complete)); } qint64 -SWGOrder::getId() { +Order::getId() { return id; } void -SWGOrder::setId(qint64 id) { +Order::setId(qint64 id) { this->id = id; } qint64 -SWGOrder::getPetId() { - return pet_id; +Order::getPetId() { + return petId; } void -SWGOrder::setPetId(qint64 pet_id) { - this->pet_id = pet_id; +Order::setPetId(qint64 petId) { + this->petId = petId; } qint32 -SWGOrder::getQuantity() { +Order::getQuantity() { return quantity; } void -SWGOrder::setQuantity(qint32 quantity) { +Order::setQuantity(qint32 quantity) { this->quantity = quantity; } QDateTime* -SWGOrder::getShipDate() { - return ship_date; +Order::getShipDate() { + return shipDate; } void -SWGOrder::setShipDate(QDateTime* ship_date) { - this->ship_date = ship_date; +Order::setShipDate(QDateTime* shipDate) { + this->shipDate = shipDate; } QString* -SWGOrder::getStatus() { +Order::getStatus() { return status; } void -SWGOrder::setStatus(QString* status) { +Order::setStatus(QString* status) { this->status = status; } bool -SWGOrder::getComplete() { +Order::getComplete() { return complete; } void -SWGOrder::setComplete(bool complete) { +Order::setComplete(bool complete) { this->complete = complete; } diff --git a/samples/client/petstore/qt5cpp/client/SWGOrder.h b/samples/client/petstore/qt5cpp/client/Order.h similarity index 83% rename from samples/client/petstore/qt5cpp/client/SWGOrder.h rename to samples/client/petstore/qt5cpp/client/Order.h index 0a55773c13fa..936df4d610f7 100644 --- a/samples/client/petstore/qt5cpp/client/SWGOrder.h +++ b/samples/client/petstore/qt5cpp/client/Order.h @@ -23,13 +23,13 @@ */ /* - * SWGOrder.h + * Order.h * * An order for a pets from the pet store */ -#ifndef SWGOrder_H_ -#define SWGOrder_H_ +#ifndef Order_H_ +#define Order_H_ #include @@ -42,27 +42,27 @@ namespace Swagger { -class SWGOrder: public SWGObject { +class Order: public SWGObject { public: - SWGOrder(); - SWGOrder(QString* json); - virtual ~SWGOrder(); + Order(); + Order(QString* json); + virtual ~Order(); void init(); void cleanup(); QString asJson (); QJsonObject* asJsonObject(); void fromJsonObject(QJsonObject &json); - SWGOrder* fromJson(QString &jsonString); + Order* fromJson(QString &jsonString); qint64 getId(); void setId(qint64 id); qint64 getPetId(); - void setPetId(qint64 pet_id); + void setPetId(qint64 petId); qint32 getQuantity(); void setQuantity(qint32 quantity); QDateTime* getShipDate(); - void setShipDate(QDateTime* ship_date); + void setShipDate(QDateTime* shipDate); QString* getStatus(); void setStatus(QString* status); bool getComplete(); @@ -70,13 +70,13 @@ bool getComplete(); private: qint64 id; -qint64 pet_id; +qint64 petId; qint32 quantity; -QDateTime* ship_date; +QDateTime* shipDate; QString* status; bool complete; }; } /* namespace Swagger */ -#endif /* SWGOrder_H_ */ +#endif /* Order_H_ */ diff --git a/samples/client/petstore/qt5cpp/client/SWGPet.cpp b/samples/client/petstore/qt5cpp/client/Pet.cpp similarity index 65% rename from samples/client/petstore/qt5cpp/client/SWGPet.cpp rename to samples/client/petstore/qt5cpp/client/Pet.cpp index 7f927f6c509d..1b8f4dc714af 100644 --- a/samples/client/petstore/qt5cpp/client/SWGPet.cpp +++ b/samples/client/petstore/qt5cpp/client/Pet.cpp @@ -23,7 +23,7 @@ */ -#include "SWGPet.h" +#include "Pet.h" #include "SWGHelpers.h" @@ -35,31 +35,31 @@ namespace Swagger { -SWGPet::SWGPet(QString* json) { +Pet::Pet(QString* json) { init(); this->fromJson(*json); } -SWGPet::SWGPet() { +Pet::Pet() { init(); } -SWGPet::~SWGPet() { +Pet::~Pet() { this->cleanup(); } void -SWGPet::init() { +Pet::init() { id = 0L; -category = new SWGCategory(); +category = new Category(); name = new QString(""); -photo_urls = new QList(); -tags = new QList(); +photoUrls = new QList(); +tags = new QList(); status = new QString(""); } void -SWGPet::cleanup() { +Pet::cleanup() { if(category != NULL) { delete category; @@ -67,16 +67,16 @@ if(category != NULL) { if(name != NULL) { delete name; } -if(photo_urls != NULL) { - QList* arr = photo_urls; +if(photoUrls != NULL) { + QList* arr = photoUrls; foreach(QString* o, *arr) { delete o; } - delete photo_urls; + delete photoUrls; } if(tags != NULL) { - QList* arr = tags; - foreach(SWGTag* o, *arr) { + QList* arr = tags; + foreach(Tag* o, *arr) { delete o; } delete tags; @@ -86,8 +86,8 @@ if(status != NULL) { } } -SWGPet* -SWGPet::fromJson(QString &json) { +Pet* +Pet::fromJson(QString &json) { QByteArray array (json.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); @@ -96,17 +96,17 @@ SWGPet::fromJson(QString &json) { } void -SWGPet::fromJsonObject(QJsonObject &pJson) { +Pet::fromJsonObject(QJsonObject &pJson) { setValue(&id, pJson["id"], "qint64", ""); -setValue(&category, pJson["category"], "SWGCategory", "SWGCategory"); +setValue(&category, pJson["category"], "Category", "Category"); setValue(&name, pJson["name"], "QString", "QString"); -setValue(&photo_urls, pJson["photo_urls"], "QList", "QString"); -setValue(&tags, pJson["tags"], "QList", "SWGTag"); +setValue(&photoUrls, pJson["photoUrls"], "QList", "QString"); +setValue(&tags, pJson["tags"], "QList", "Tag"); setValue(&status, pJson["status"], "QString", "QString"); } QString -SWGPet::asJson () +Pet::asJson () { QJsonObject* obj = this->asJsonObject(); @@ -116,12 +116,12 @@ SWGPet::asJson () } QJsonObject* -SWGPet::asJsonObject() { +Pet::asJsonObject() { QJsonObject* obj = new QJsonObject(); obj->insert("id", QJsonValue(id)); - toJsonValue(QString("category"), category, obj, QString("SWGCategory")); + toJsonValue(QString("category"), category, obj, QString("Category")); @@ -131,17 +131,17 @@ SWGPet::asJsonObject() { - QList* photo_urlsList = photo_urls; - QJsonArray photo_urlsJsonArray; - toJsonArray((QList*)photo_urls, &photo_urlsJsonArray, "photo_urls", "QString"); + QList* photoUrlsList = photoUrls; + QJsonArray photoUrlsJsonArray; + toJsonArray((QList*)photoUrls, &photoUrlsJsonArray, "photoUrls", "QString"); - obj->insert("photo_urls", photo_urlsJsonArray); + obj->insert("photoUrls", photoUrlsJsonArray); - QList* tagsList = tags; + QList* tagsList = tags; QJsonArray tagsJsonArray; - toJsonArray((QList*)tags, &tagsJsonArray, "tags", "SWGTag"); + toJsonArray((QList*)tags, &tagsJsonArray, "tags", "Tag"); obj->insert("tags", tagsJsonArray); @@ -155,56 +155,56 @@ SWGPet::asJsonObject() { } qint64 -SWGPet::getId() { +Pet::getId() { return id; } void -SWGPet::setId(qint64 id) { +Pet::setId(qint64 id) { this->id = id; } -SWGCategory* -SWGPet::getCategory() { +Category* +Pet::getCategory() { return category; } void -SWGPet::setCategory(SWGCategory* category) { +Pet::setCategory(Category* category) { this->category = category; } QString* -SWGPet::getName() { +Pet::getName() { return name; } void -SWGPet::setName(QString* name) { +Pet::setName(QString* name) { this->name = name; } QList* -SWGPet::getPhotoUrls() { - return photo_urls; +Pet::getPhotoUrls() { + return photoUrls; } void -SWGPet::setPhotoUrls(QList* photo_urls) { - this->photo_urls = photo_urls; +Pet::setPhotoUrls(QList* photoUrls) { + this->photoUrls = photoUrls; } -QList* -SWGPet::getTags() { +QList* +Pet::getTags() { return tags; } void -SWGPet::setTags(QList* tags) { +Pet::setTags(QList* tags) { this->tags = tags; } QString* -SWGPet::getStatus() { +Pet::getStatus() { return status; } void -SWGPet::setStatus(QString* status) { +Pet::setStatus(QString* status) { this->status = status; } diff --git a/samples/client/petstore/qt5cpp/client/SWGPet.h b/samples/client/petstore/qt5cpp/client/Pet.h similarity index 76% rename from samples/client/petstore/qt5cpp/client/SWGPet.h rename to samples/client/petstore/qt5cpp/client/Pet.h index faa5a4003f48..03070f41507d 100644 --- a/samples/client/petstore/qt5cpp/client/SWGPet.h +++ b/samples/client/petstore/qt5cpp/client/Pet.h @@ -23,19 +23,19 @@ */ /* - * SWGPet.h + * Pet.h * * A pet for sale in the pet store */ -#ifndef SWGPet_H_ -#define SWGPet_H_ +#ifndef Pet_H_ +#define Pet_H_ #include -#include "SWGCategory.h" -#include "SWGTag.h" +#include "Category.h" +#include "Tag.h" #include #include @@ -44,41 +44,41 @@ namespace Swagger { -class SWGPet: public SWGObject { +class Pet: public SWGObject { public: - SWGPet(); - SWGPet(QString* json); - virtual ~SWGPet(); + Pet(); + Pet(QString* json); + virtual ~Pet(); void init(); void cleanup(); QString asJson (); QJsonObject* asJsonObject(); void fromJsonObject(QJsonObject &json); - SWGPet* fromJson(QString &jsonString); + Pet* fromJson(QString &jsonString); qint64 getId(); void setId(qint64 id); -SWGCategory* getCategory(); - void setCategory(SWGCategory* category); +Category* getCategory(); + void setCategory(Category* category); QString* getName(); void setName(QString* name); QList* getPhotoUrls(); - void setPhotoUrls(QList* photo_urls); -QList* getTags(); - void setTags(QList* tags); + void setPhotoUrls(QList* photoUrls); +QList* getTags(); + void setTags(QList* tags); QString* getStatus(); void setStatus(QString* status); private: qint64 id; -SWGCategory* category; +Category* category; QString* name; -QList* photo_urls; -QList* tags; +QList* photoUrls; +QList* tags; QString* status; }; } /* namespace Swagger */ -#endif /* SWGPet_H_ */ +#endif /* Pet_H_ */ diff --git a/samples/client/petstore/qt5cpp/client/SWGModelFactory.h b/samples/client/petstore/qt5cpp/client/SWGModelFactory.h index d40170cb4f1e..beee860a6ce1 100644 --- a/samples/client/petstore/qt5cpp/client/SWGModelFactory.h +++ b/samples/client/petstore/qt5cpp/client/SWGModelFactory.h @@ -26,32 +26,32 @@ #define ModelFactory_H_ -#include "SWGApiResponse.h" -#include "SWGCategory.h" -#include "SWGOrder.h" -#include "SWGPet.h" -#include "SWGTag.h" -#include "SWGUser.h" +#include "ApiResponse.h" +#include "Category.h" +#include "Order.h" +#include "Pet.h" +#include "Tag.h" +#include "User.h" namespace Swagger { inline void* create(QString type) { - if(QString("SWGApiResponse").compare(type) == 0) { - return new SWGApiResponse(); + if(QString("ApiResponse").compare(type) == 0) { + return new ApiResponse(); } - if(QString("SWGCategory").compare(type) == 0) { - return new SWGCategory(); + if(QString("Category").compare(type) == 0) { + return new Category(); } - if(QString("SWGOrder").compare(type) == 0) { - return new SWGOrder(); + if(QString("Order").compare(type) == 0) { + return new Order(); } - if(QString("SWGPet").compare(type) == 0) { - return new SWGPet(); + if(QString("Pet").compare(type) == 0) { + return new Pet(); } - if(QString("SWGTag").compare(type) == 0) { - return new SWGTag(); + if(QString("Tag").compare(type) == 0) { + return new Tag(); } - if(QString("SWGUser").compare(type) == 0) { - return new SWGUser(); + if(QString("User").compare(type) == 0) { + return new User(); } return NULL; diff --git a/samples/client/petstore/qt5cpp/client/SWGPetApi.cpp b/samples/client/petstore/qt5cpp/client/SWGPetApi.cpp index 8fba5e4757b9..a612d8718e74 100644 --- a/samples/client/petstore/qt5cpp/client/SWGPetApi.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGPetApi.cpp @@ -40,7 +40,7 @@ SWGPetApi::SWGPetApi(QString host, QString basePath) { } void -SWGPetApi::addPet(SWGPet body) { +SWGPetApi::addPet(Pet body) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/pet"); @@ -81,12 +81,12 @@ SWGPetApi::addPetCallback(HttpRequestWorker * worker) { emit addPetSignal(); } void -SWGPetApi::deletePet(qint64 pet_id, QString* api_key) { +SWGPetApi::deletePet(qint64 petId, QString* apiKey) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/pet/{petId}"); - QString pet_idPathParam("{"); pet_idPathParam.append("petId").append("}"); - fullPath.replace(pet_idPathParam, stringValue(pet_id)); + QString petIdPathParam("{"); petIdPathParam.append("petId").append("}"); + fullPath.replace(petIdPathParam, stringValue(petId)); HttpRequestWorker *worker = new HttpRequestWorker(); @@ -197,14 +197,14 @@ SWGPetApi::findPetsByStatusCallback(HttpRequestWorker * worker) { } - QList* output = new QList(); + QList* output = new QList(); QString json(worker->response); QByteArray array (json.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonArray jsonArray = doc.array(); foreach(QJsonValue obj, jsonArray) { - SWGPet* o = new SWGPet(); + Pet* o = new Pet(); QJsonObject jv = obj.toObject(); QJsonObject * ptr = (QJsonObject*)&jv; o->fromJsonObject(*ptr); @@ -293,14 +293,14 @@ SWGPetApi::findPetsByTagsCallback(HttpRequestWorker * worker) { } - QList* output = new QList(); + QList* output = new QList(); QString json(worker->response); QByteArray array (json.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonArray jsonArray = doc.array(); foreach(QJsonValue obj, jsonArray) { - SWGPet* o = new SWGPet(); + Pet* o = new Pet(); QJsonObject jv = obj.toObject(); QJsonObject * ptr = (QJsonObject*)&jv; o->fromJsonObject(*ptr); @@ -315,12 +315,12 @@ SWGPetApi::findPetsByTagsCallback(HttpRequestWorker * worker) { } void -SWGPetApi::getPetById(qint64 pet_id) { +SWGPetApi::getPetById(qint64 petId) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/pet/{petId}"); - QString pet_idPathParam("{"); pet_idPathParam.append("petId").append("}"); - fullPath.replace(pet_idPathParam, stringValue(pet_id)); + QString petIdPathParam("{"); petIdPathParam.append("petId").append("}"); + fullPath.replace(petIdPathParam, stringValue(petId)); HttpRequestWorker *worker = new HttpRequestWorker(); @@ -350,7 +350,7 @@ SWGPetApi::getPetByIdCallback(HttpRequestWorker * worker) { QString json(worker->response); - SWGPet* output = static_cast(create(json, QString("SWGPet"))); + Pet* output = static_cast(create(json, QString("Pet"))); worker->deleteLater(); @@ -359,7 +359,7 @@ SWGPetApi::getPetByIdCallback(HttpRequestWorker * worker) { } void -SWGPetApi::updatePet(SWGPet body) { +SWGPetApi::updatePet(Pet body) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/pet"); @@ -400,12 +400,12 @@ SWGPetApi::updatePetCallback(HttpRequestWorker * worker) { emit updatePetSignal(); } void -SWGPetApi::updatePetWithForm(qint64 pet_id, QString* name, QString* status) { +SWGPetApi::updatePetWithForm(qint64 petId, QString* name, QString* status) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/pet/{petId}"); - QString pet_idPathParam("{"); pet_idPathParam.append("petId").append("}"); - fullPath.replace(pet_idPathParam, stringValue(pet_id)); + QString petIdPathParam("{"); petIdPathParam.append("petId").append("}"); + fullPath.replace(petIdPathParam, stringValue(petId)); HttpRequestWorker *worker = new HttpRequestWorker(); @@ -447,19 +447,19 @@ SWGPetApi::updatePetWithFormCallback(HttpRequestWorker * worker) { emit updatePetWithFormSignal(); } void -SWGPetApi::uploadFile(qint64 pet_id, QString* additional_metadata, SWGHttpRequestInputFileElement* file) { +SWGPetApi::uploadFile(qint64 petId, QString* additionalMetadata, SWGHttpRequestInputFileElement* file) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/pet/{petId}/uploadImage"); - QString pet_idPathParam("{"); pet_idPathParam.append("petId").append("}"); - fullPath.replace(pet_idPathParam, stringValue(pet_id)); + QString petIdPathParam("{"); petIdPathParam.append("petId").append("}"); + fullPath.replace(petIdPathParam, stringValue(petId)); HttpRequestWorker *worker = new HttpRequestWorker(); HttpRequestInput input(fullPath, "POST"); - if (additional_metadata != NULL) { - input.add_var("additionalMetadata", *additional_metadata); + if (additionalMetadata != NULL) { + input.add_var("additionalMetadata", *additionalMetadata); } if (file != NULL) { input.add_file("file", (*file).local_filename, (*file).request_filename, (*file).mime_type); @@ -488,7 +488,7 @@ SWGPetApi::uploadFileCallback(HttpRequestWorker * worker) { QString json(worker->response); - SWGApiResponse* output = static_cast(create(json, QString("SWGApiResponse"))); + ApiResponse* output = static_cast(create(json, QString("ApiResponse"))); worker->deleteLater(); diff --git a/samples/client/petstore/qt5cpp/client/SWGPetApi.h b/samples/client/petstore/qt5cpp/client/SWGPetApi.h index 87ef70789477..efa973fe0774 100644 --- a/samples/client/petstore/qt5cpp/client/SWGPetApi.h +++ b/samples/client/petstore/qt5cpp/client/SWGPetApi.h @@ -27,10 +27,10 @@ #include "SWGHttpRequest.h" -#include "SWGPet.h" +#include "Pet.h" #include -#include "SWGApiResponse.h" #include "SWGHttpRequest.h" +#include "ApiResponse.h" #include @@ -47,14 +47,14 @@ public: QString host; QString basePath; - void addPet(SWGPet body); - void deletePet(qint64 pet_id, QString* api_key); + void addPet(Pet body); + void deletePet(qint64 petId, QString* apiKey); void findPetsByStatus(QList* status); void findPetsByTags(QList* tags); - void getPetById(qint64 pet_id); - void updatePet(SWGPet body); - void updatePetWithForm(qint64 pet_id, QString* name, QString* status); - void uploadFile(qint64 pet_id, QString* additional_metadata, SWGHttpRequestInputFileElement* file); + void getPetById(qint64 petId); + void updatePet(Pet body); + void updatePetWithForm(qint64 petId, QString* name, QString* status); + void uploadFile(qint64 petId, QString* additionalMetadata, SWGHttpRequestInputFileElement* file); private: void addPetCallback (HttpRequestWorker * worker); @@ -69,12 +69,12 @@ private: signals: void addPetSignal(); void deletePetSignal(); - void findPetsByStatusSignal(QList* summary); - void findPetsByTagsSignal(QList* summary); - void getPetByIdSignal(SWGPet* summary); + void findPetsByStatusSignal(QList* summary); + void findPetsByTagsSignal(QList* summary); + void getPetByIdSignal(Pet* summary); void updatePetSignal(); void updatePetWithFormSignal(); - void uploadFileSignal(SWGApiResponse* summary); + void uploadFileSignal(ApiResponse* summary); }; } diff --git a/samples/client/petstore/qt5cpp/client/SWGStoreApi.cpp b/samples/client/petstore/qt5cpp/client/SWGStoreApi.cpp index b68c8d28b6db..10ae063ec239 100644 --- a/samples/client/petstore/qt5cpp/client/SWGStoreApi.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGStoreApi.cpp @@ -40,12 +40,12 @@ SWGStoreApi::SWGStoreApi(QString host, QString basePath) { } void -SWGStoreApi::deleteOrder(QString* order_id) { +SWGStoreApi::deleteOrder(QString* orderId) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/store/order/{orderId}"); - QString order_idPathParam("{"); order_idPathParam.append("orderId").append("}"); - fullPath.replace(order_idPathParam, stringValue(order_id)); + QString orderIdPathParam("{"); orderIdPathParam.append("orderId").append("}"); + fullPath.replace(orderIdPathParam, stringValue(orderId)); HttpRequestWorker *worker = new HttpRequestWorker(); @@ -135,12 +135,12 @@ SWGStoreApi::getInventoryCallback(HttpRequestWorker * worker) { } void -SWGStoreApi::getOrderById(qint64 order_id) { +SWGStoreApi::getOrderById(qint64 orderId) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/store/order/{orderId}"); - QString order_idPathParam("{"); order_idPathParam.append("orderId").append("}"); - fullPath.replace(order_idPathParam, stringValue(order_id)); + QString orderIdPathParam("{"); orderIdPathParam.append("orderId").append("}"); + fullPath.replace(orderIdPathParam, stringValue(orderId)); HttpRequestWorker *worker = new HttpRequestWorker(); @@ -170,7 +170,7 @@ SWGStoreApi::getOrderByIdCallback(HttpRequestWorker * worker) { QString json(worker->response); - SWGOrder* output = static_cast(create(json, QString("SWGOrder"))); + Order* output = static_cast(create(json, QString("Order"))); worker->deleteLater(); @@ -179,7 +179,7 @@ SWGStoreApi::getOrderByIdCallback(HttpRequestWorker * worker) { } void -SWGStoreApi::placeOrder(SWGOrder body) { +SWGStoreApi::placeOrder(Order body) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/store/order"); @@ -214,7 +214,7 @@ SWGStoreApi::placeOrderCallback(HttpRequestWorker * worker) { QString json(worker->response); - SWGOrder* output = static_cast(create(json, QString("SWGOrder"))); + Order* output = static_cast(create(json, QString("Order"))); worker->deleteLater(); diff --git a/samples/client/petstore/qt5cpp/client/SWGStoreApi.h b/samples/client/petstore/qt5cpp/client/SWGStoreApi.h index b33cd51f5d68..fcd2692a8591 100644 --- a/samples/client/petstore/qt5cpp/client/SWGStoreApi.h +++ b/samples/client/petstore/qt5cpp/client/SWGStoreApi.h @@ -29,7 +29,7 @@ #include #include -#include "SWGOrder.h" +#include "Order.h" #include @@ -46,10 +46,10 @@ public: QString host; QString basePath; - void deleteOrder(QString* order_id); + void deleteOrder(QString* orderId); void getInventory(); - void getOrderById(qint64 order_id); - void placeOrder(SWGOrder body); + void getOrderById(qint64 orderId); + void placeOrder(Order body); private: void deleteOrderCallback (HttpRequestWorker * worker); @@ -60,8 +60,8 @@ private: signals: void deleteOrderSignal(); void getInventorySignal(QMap* summary); - void getOrderByIdSignal(SWGOrder* summary); - void placeOrderSignal(SWGOrder* summary); + void getOrderByIdSignal(Order* summary); + void placeOrderSignal(Order* summary); }; } diff --git a/samples/client/petstore/qt5cpp/client/SWGUserApi.cpp b/samples/client/petstore/qt5cpp/client/SWGUserApi.cpp index a2089cf24bbc..895edbd551d6 100644 --- a/samples/client/petstore/qt5cpp/client/SWGUserApi.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGUserApi.cpp @@ -40,7 +40,7 @@ SWGUserApi::SWGUserApi(QString host, QString basePath) { } void -SWGUserApi::createUser(SWGUser body) { +SWGUserApi::createUser(User body) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/user"); @@ -81,7 +81,7 @@ SWGUserApi::createUserCallback(HttpRequestWorker * worker) { emit createUserSignal(); } void -SWGUserApi::createUsersWithArrayInput(QList* body) { +SWGUserApi::createUsersWithArrayInput(QList* body) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/user/createWithArray"); @@ -127,7 +127,7 @@ SWGUserApi::createUsersWithArrayInputCallback(HttpRequestWorker * worker) { emit createUsersWithArrayInputSignal(); } void -SWGUserApi::createUsersWithListInput(QList* body) { +SWGUserApi::createUsersWithListInput(QList* body) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/user/createWithList"); @@ -249,7 +249,7 @@ SWGUserApi::getUserByNameCallback(HttpRequestWorker * worker) { QString json(worker->response); - SWGUser* output = static_cast(create(json, QString("SWGUser"))); + User* output = static_cast(create(json, QString("User"))); worker->deleteLater(); @@ -355,7 +355,7 @@ SWGUserApi::logoutUserCallback(HttpRequestWorker * worker) { emit logoutUserSignal(); } void -SWGUserApi::updateUser(QString* username, SWGUser body) { +SWGUserApi::updateUser(QString* username, User body) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/user/{username}"); diff --git a/samples/client/petstore/qt5cpp/client/SWGUserApi.h b/samples/client/petstore/qt5cpp/client/SWGUserApi.h index 94aa2a69dcb6..be5387612b73 100644 --- a/samples/client/petstore/qt5cpp/client/SWGUserApi.h +++ b/samples/client/petstore/qt5cpp/client/SWGUserApi.h @@ -27,7 +27,7 @@ #include "SWGHttpRequest.h" -#include "SWGUser.h" +#include "User.h" #include #include @@ -46,14 +46,14 @@ public: QString host; QString basePath; - void createUser(SWGUser body); - void createUsersWithArrayInput(QList* body); - void createUsersWithListInput(QList* body); + void createUser(User body); + void createUsersWithArrayInput(QList* body); + void createUsersWithListInput(QList* body); void deleteUser(QString* username); void getUserByName(QString* username); void loginUser(QString* username, QString* password); void logoutUser(); - void updateUser(QString* username, SWGUser body); + void updateUser(QString* username, User body); private: void createUserCallback (HttpRequestWorker * worker); @@ -70,7 +70,7 @@ signals: void createUsersWithArrayInputSignal(); void createUsersWithListInputSignal(); void deleteUserSignal(); - void getUserByNameSignal(SWGUser* summary); + void getUserByNameSignal(User* summary); void loginUserSignal(QString* summary); void logoutUserSignal(); void updateUserSignal(); diff --git a/samples/client/petstore/qt5cpp/client/SWGTag.cpp b/samples/client/petstore/qt5cpp/client/Tag.cpp similarity index 86% rename from samples/client/petstore/qt5cpp/client/SWGTag.cpp rename to samples/client/petstore/qt5cpp/client/Tag.cpp index 06ed3297b86f..3ca68cfc929e 100644 --- a/samples/client/petstore/qt5cpp/client/SWGTag.cpp +++ b/samples/client/petstore/qt5cpp/client/Tag.cpp @@ -23,7 +23,7 @@ */ -#include "SWGTag.h" +#include "Tag.h" #include "SWGHelpers.h" @@ -35,35 +35,35 @@ namespace Swagger { -SWGTag::SWGTag(QString* json) { +Tag::Tag(QString* json) { init(); this->fromJson(*json); } -SWGTag::SWGTag() { +Tag::Tag() { init(); } -SWGTag::~SWGTag() { +Tag::~Tag() { this->cleanup(); } void -SWGTag::init() { +Tag::init() { id = 0L; name = new QString(""); } void -SWGTag::cleanup() { +Tag::cleanup() { if(name != NULL) { delete name; } } -SWGTag* -SWGTag::fromJson(QString &json) { +Tag* +Tag::fromJson(QString &json) { QByteArray array (json.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); @@ -72,13 +72,13 @@ SWGTag::fromJson(QString &json) { } void -SWGTag::fromJsonObject(QJsonObject &pJson) { +Tag::fromJsonObject(QJsonObject &pJson) { setValue(&id, pJson["id"], "qint64", ""); setValue(&name, pJson["name"], "QString", "QString"); } QString -SWGTag::asJson () +Tag::asJson () { QJsonObject* obj = this->asJsonObject(); @@ -88,7 +88,7 @@ SWGTag::asJson () } QJsonObject* -SWGTag::asJsonObject() { +Tag::asJsonObject() { QJsonObject* obj = new QJsonObject(); obj->insert("id", QJsonValue(id)); @@ -101,20 +101,20 @@ SWGTag::asJsonObject() { } qint64 -SWGTag::getId() { +Tag::getId() { return id; } void -SWGTag::setId(qint64 id) { +Tag::setId(qint64 id) { this->id = id; } QString* -SWGTag::getName() { +Tag::getName() { return name; } void -SWGTag::setName(QString* name) { +Tag::setName(QString* name) { this->name = name; } diff --git a/samples/client/petstore/qt5cpp/client/SWGTag.h b/samples/client/petstore/qt5cpp/client/Tag.h similarity index 87% rename from samples/client/petstore/qt5cpp/client/SWGTag.h rename to samples/client/petstore/qt5cpp/client/Tag.h index af0d5a687a09..7359a742834b 100644 --- a/samples/client/petstore/qt5cpp/client/SWGTag.h +++ b/samples/client/petstore/qt5cpp/client/Tag.h @@ -23,13 +23,13 @@ */ /* - * SWGTag.h + * Tag.h * * A tag for a pet */ -#ifndef SWGTag_H_ -#define SWGTag_H_ +#ifndef Tag_H_ +#define Tag_H_ #include @@ -41,18 +41,18 @@ namespace Swagger { -class SWGTag: public SWGObject { +class Tag: public SWGObject { public: - SWGTag(); - SWGTag(QString* json); - virtual ~SWGTag(); + Tag(); + Tag(QString* json); + virtual ~Tag(); void init(); void cleanup(); QString asJson (); QJsonObject* asJsonObject(); void fromJsonObject(QJsonObject &json); - SWGTag* fromJson(QString &jsonString); + Tag* fromJson(QString &jsonString); qint64 getId(); void setId(qint64 id); @@ -66,4 +66,4 @@ QString* name; } /* namespace Swagger */ -#endif /* SWGTag_H_ */ +#endif /* Tag_H_ */ diff --git a/samples/client/petstore/qt5cpp/client/SWGUser.cpp b/samples/client/petstore/qt5cpp/client/User.cpp similarity index 68% rename from samples/client/petstore/qt5cpp/client/SWGUser.cpp rename to samples/client/petstore/qt5cpp/client/User.cpp index f69839926c6e..5fb2e21223f8 100644 --- a/samples/client/petstore/qt5cpp/client/SWGUser.cpp +++ b/samples/client/petstore/qt5cpp/client/User.cpp @@ -23,7 +23,7 @@ */ -#include "SWGUser.h" +#include "User.h" #include "SWGHelpers.h" @@ -35,42 +35,42 @@ namespace Swagger { -SWGUser::SWGUser(QString* json) { +User::User(QString* json) { init(); this->fromJson(*json); } -SWGUser::SWGUser() { +User::User() { init(); } -SWGUser::~SWGUser() { +User::~User() { this->cleanup(); } void -SWGUser::init() { +User::init() { id = 0L; username = new QString(""); -first_name = new QString(""); -last_name = new QString(""); +firstName = new QString(""); +lastName = new QString(""); email = new QString(""); password = new QString(""); phone = new QString(""); -user_status = 0; +userStatus = 0; } void -SWGUser::cleanup() { +User::cleanup() { if(username != NULL) { delete username; } -if(first_name != NULL) { - delete first_name; +if(firstName != NULL) { + delete firstName; } -if(last_name != NULL) { - delete last_name; +if(lastName != NULL) { + delete lastName; } if(email != NULL) { delete email; @@ -84,8 +84,8 @@ if(phone != NULL) { } -SWGUser* -SWGUser::fromJson(QString &json) { +User* +User::fromJson(QString &json) { QByteArray array (json.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); @@ -94,19 +94,19 @@ SWGUser::fromJson(QString &json) { } void -SWGUser::fromJsonObject(QJsonObject &pJson) { +User::fromJsonObject(QJsonObject &pJson) { setValue(&id, pJson["id"], "qint64", ""); setValue(&username, pJson["username"], "QString", "QString"); -setValue(&first_name, pJson["first_name"], "QString", "QString"); -setValue(&last_name, pJson["last_name"], "QString", "QString"); +setValue(&firstName, pJson["firstName"], "QString", "QString"); +setValue(&lastName, pJson["lastName"], "QString", "QString"); setValue(&email, pJson["email"], "QString", "QString"); setValue(&password, pJson["password"], "QString", "QString"); setValue(&phone, pJson["phone"], "QString", "QString"); -setValue(&user_status, pJson["user_status"], "qint32", ""); +setValue(&userStatus, pJson["userStatus"], "qint32", ""); } QString -SWGUser::asJson () +User::asJson () { QJsonObject* obj = this->asJsonObject(); @@ -116,7 +116,7 @@ SWGUser::asJson () } QJsonObject* -SWGUser::asJsonObject() { +User::asJsonObject() { QJsonObject* obj = new QJsonObject(); obj->insert("id", QJsonValue(id)); @@ -126,12 +126,12 @@ SWGUser::asJsonObject() { - toJsonValue(QString("first_name"), first_name, obj, QString("QString")); + toJsonValue(QString("firstName"), firstName, obj, QString("QString")); - toJsonValue(QString("last_name"), last_name, obj, QString("QString")); + toJsonValue(QString("lastName"), lastName, obj, QString("QString")); @@ -149,81 +149,81 @@ SWGUser::asJsonObject() { toJsonValue(QString("phone"), phone, obj, QString("QString")); -obj->insert("user_status", QJsonValue(user_status)); +obj->insert("userStatus", QJsonValue(userStatus)); return obj; } qint64 -SWGUser::getId() { +User::getId() { return id; } void -SWGUser::setId(qint64 id) { +User::setId(qint64 id) { this->id = id; } QString* -SWGUser::getUsername() { +User::getUsername() { return username; } void -SWGUser::setUsername(QString* username) { +User::setUsername(QString* username) { this->username = username; } QString* -SWGUser::getFirstName() { - return first_name; +User::getFirstName() { + return firstName; } void -SWGUser::setFirstName(QString* first_name) { - this->first_name = first_name; +User::setFirstName(QString* firstName) { + this->firstName = firstName; } QString* -SWGUser::getLastName() { - return last_name; +User::getLastName() { + return lastName; } void -SWGUser::setLastName(QString* last_name) { - this->last_name = last_name; +User::setLastName(QString* lastName) { + this->lastName = lastName; } QString* -SWGUser::getEmail() { +User::getEmail() { return email; } void -SWGUser::setEmail(QString* email) { +User::setEmail(QString* email) { this->email = email; } QString* -SWGUser::getPassword() { +User::getPassword() { return password; } void -SWGUser::setPassword(QString* password) { +User::setPassword(QString* password) { this->password = password; } QString* -SWGUser::getPhone() { +User::getPhone() { return phone; } void -SWGUser::setPhone(QString* phone) { +User::setPhone(QString* phone) { this->phone = phone; } qint32 -SWGUser::getUserStatus() { - return user_status; +User::getUserStatus() { + return userStatus; } void -SWGUser::setUserStatus(qint32 user_status) { - this->user_status = user_status; +User::setUserStatus(qint32 userStatus) { + this->userStatus = userStatus; } diff --git a/samples/client/petstore/qt5cpp/client/SWGUser.h b/samples/client/petstore/qt5cpp/client/User.h similarity index 82% rename from samples/client/petstore/qt5cpp/client/SWGUser.h rename to samples/client/petstore/qt5cpp/client/User.h index b6a5c2ab8536..06ef4913568f 100644 --- a/samples/client/petstore/qt5cpp/client/SWGUser.h +++ b/samples/client/petstore/qt5cpp/client/User.h @@ -23,13 +23,13 @@ */ /* - * SWGUser.h + * User.h * * A User who is purchasing from the pet store */ -#ifndef SWGUser_H_ -#define SWGUser_H_ +#ifndef User_H_ +#define User_H_ #include @@ -41,27 +41,27 @@ namespace Swagger { -class SWGUser: public SWGObject { +class User: public SWGObject { public: - SWGUser(); - SWGUser(QString* json); - virtual ~SWGUser(); + User(); + User(QString* json); + virtual ~User(); void init(); void cleanup(); QString asJson (); QJsonObject* asJsonObject(); void fromJsonObject(QJsonObject &json); - SWGUser* fromJson(QString &jsonString); + User* fromJson(QString &jsonString); qint64 getId(); void setId(qint64 id); QString* getUsername(); void setUsername(QString* username); QString* getFirstName(); - void setFirstName(QString* first_name); + void setFirstName(QString* firstName); QString* getLastName(); - void setLastName(QString* last_name); + void setLastName(QString* lastName); QString* getEmail(); void setEmail(QString* email); QString* getPassword(); @@ -69,19 +69,19 @@ QString* getPassword(); QString* getPhone(); void setPhone(QString* phone); qint32 getUserStatus(); - void setUserStatus(qint32 user_status); + void setUserStatus(qint32 userStatus); private: qint64 id; QString* username; -QString* first_name; -QString* last_name; +QString* firstName; +QString* lastName; QString* email; QString* password; QString* phone; -qint32 user_status; +qint32 userStatus; }; } /* namespace Swagger */ -#endif /* SWGUser_H_ */ +#endif /* User_H_ */