mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-05-18 15:54:42 +00:00
64 lines
1.6 KiB
C++
64 lines
1.6 KiB
C++
/**
|
|
* Swagger Petstore
|
|
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
|
*
|
|
* OpenAPI spec version: 1.0.0
|
|
* Contact: apiteam@swagger.io
|
|
*
|
|
* NOTE: This class is auto generated by the swagger code generator program.
|
|
* https://github.com/swagger-api/swagger-codegen.git
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
#ifndef ModelFactory_H_
|
|
#define ModelFactory_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("ApiResponse").compare(type) == 0) {
|
|
return new ApiResponse();
|
|
}
|
|
if(QString("Category").compare(type) == 0) {
|
|
return new Category();
|
|
}
|
|
if(QString("Order").compare(type) == 0) {
|
|
return new Order();
|
|
}
|
|
if(QString("Pet").compare(type) == 0) {
|
|
return new Pet();
|
|
}
|
|
if(QString("Tag").compare(type) == 0) {
|
|
return new Tag();
|
|
}
|
|
if(QString("User").compare(type) == 0) {
|
|
return new User();
|
|
}
|
|
|
|
return nullptr;
|
|
}
|
|
|
|
inline void* create(QString json, QString type) {
|
|
void* val = create(type);
|
|
if(val != nullptr) {
|
|
SWGObject* obj = static_cast<SWGObject*>(val);
|
|
return obj->fromJson(json);
|
|
}
|
|
if(type.startsWith("QString")) {
|
|
return new QString();
|
|
}
|
|
return nullptr;
|
|
}
|
|
|
|
}
|
|
|
|
#endif /* ModelFactory_H_ */
|