forked from loafle/openapi-generator-original
[C++] Adjust the names (script, sample folder, generator) to lang option (#220)
* Rename script: qt5-petstore.sh -> cpp-qt5-petstore.sh * Rename sample folder: qt5cpp -> cpp-qt5 * Rename script: cpprest-petstore.sh -> cpp-restsdk-petstore.sh * Rename sample folder: cpprest -> cpp-restsdk * Rename generator: CppRestClientCodegen -> CppRestSdkClientCodegen * Rename script: tizen-petstore.sh -> cpp-tizen-petstore.sh * Rename sample folder: tizen -> cpp-tizen * Rename script(security): qt5cpp-petstore.sh -> cpp-qt5-petstore.sh * Rename sample folder(security): qt5cpp -> cpp-qt5 * Rename script(windows): qt5cpp-petstore.bat -> cpp-qt5-petstore.bat * Change sample folder * Rename script(windows): cpprest-petstore.bat -> cpp-restsdk-petstore.bat * Change sample folder * Rename script(windows): tizen-petstore.bat -> cpp-tizen-petstore.bat * Change sample folder * Change output folder: tizen -> cpp-tizen * Rename the scripts under bin/openapi3 cpp-restsdk is not exist under bin/openapi3 * Change sample folder
This commit is contained in:
committed by
William Cheng
parent
f65193e6fb
commit
cf657f1c7b
189
samples/client/petstore/cpp-restsdk/model/ApiResponse.cpp
Normal file
189
samples/client/petstore/cpp-restsdk/model/ApiResponse.cpp
Normal file
@@ -0,0 +1,189 @@
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "ApiResponse.h"
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace client {
|
||||
namespace model {
|
||||
|
||||
ApiResponse::ApiResponse()
|
||||
{
|
||||
m_Code = 0;
|
||||
m_CodeIsSet = false;
|
||||
m_Type = utility::conversions::to_string_t("");
|
||||
m_TypeIsSet = false;
|
||||
m_Message = utility::conversions::to_string_t("");
|
||||
m_MessageIsSet = false;
|
||||
}
|
||||
|
||||
ApiResponse::~ApiResponse()
|
||||
{
|
||||
}
|
||||
|
||||
void ApiResponse::validate()
|
||||
{
|
||||
// TODO: implement validation
|
||||
}
|
||||
|
||||
web::json::value ApiResponse::toJson() const
|
||||
{
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_CodeIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("code")] = ModelBase::toJson(m_Code);
|
||||
}
|
||||
if(m_TypeIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("type")] = ModelBase::toJson(m_Type);
|
||||
}
|
||||
if(m_MessageIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("message")] = ModelBase::toJson(m_Message);
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
void ApiResponse::fromJson(web::json::value& val)
|
||||
{
|
||||
if(val.has_field(utility::conversions::to_string_t("code")))
|
||||
{
|
||||
setCode(ModelBase::int32_tFromJson(val[utility::conversions::to_string_t("code")]));
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t("type")))
|
||||
{
|
||||
setType(ModelBase::stringFromJson(val[utility::conversions::to_string_t("type")]));
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t("message")))
|
||||
{
|
||||
setMessage(ModelBase::stringFromJson(val[utility::conversions::to_string_t("message")]));
|
||||
}
|
||||
}
|
||||
|
||||
void ApiResponse::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
||||
{
|
||||
utility::string_t namePrefix = prefix;
|
||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t("."))
|
||||
{
|
||||
namePrefix += utility::conversions::to_string_t(".");
|
||||
}
|
||||
|
||||
if(m_CodeIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("code"), m_Code));
|
||||
}
|
||||
if(m_TypeIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("type"), m_Type));
|
||||
|
||||
}
|
||||
if(m_MessageIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("message"), m_Message));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void ApiResponse::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
||||
{
|
||||
utility::string_t namePrefix = prefix;
|
||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t("."))
|
||||
{
|
||||
namePrefix += utility::conversions::to_string_t(".");
|
||||
}
|
||||
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("code")))
|
||||
{
|
||||
setCode(ModelBase::int32_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("code"))));
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("type")))
|
||||
{
|
||||
setType(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("type"))));
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("message")))
|
||||
{
|
||||
setMessage(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("message"))));
|
||||
}
|
||||
}
|
||||
|
||||
int32_t ApiResponse::getCode() const
|
||||
{
|
||||
return m_Code;
|
||||
}
|
||||
|
||||
|
||||
void ApiResponse::setCode(int32_t value)
|
||||
{
|
||||
m_Code = value;
|
||||
m_CodeIsSet = true;
|
||||
}
|
||||
bool ApiResponse::codeIsSet() const
|
||||
{
|
||||
return m_CodeIsSet;
|
||||
}
|
||||
|
||||
void ApiResponse::unsetCode()
|
||||
{
|
||||
m_CodeIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t ApiResponse::getType() const
|
||||
{
|
||||
return m_Type;
|
||||
}
|
||||
|
||||
|
||||
void ApiResponse::setType(utility::string_t value)
|
||||
{
|
||||
m_Type = value;
|
||||
m_TypeIsSet = true;
|
||||
}
|
||||
bool ApiResponse::typeIsSet() const
|
||||
{
|
||||
return m_TypeIsSet;
|
||||
}
|
||||
|
||||
void ApiResponse::unsetType()
|
||||
{
|
||||
m_TypeIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t ApiResponse::getMessage() const
|
||||
{
|
||||
return m_Message;
|
||||
}
|
||||
|
||||
|
||||
void ApiResponse::setMessage(utility::string_t value)
|
||||
{
|
||||
m_Message = value;
|
||||
m_MessageIsSet = true;
|
||||
}
|
||||
bool ApiResponse::messageIsSet() const
|
||||
{
|
||||
return m_MessageIsSet;
|
||||
}
|
||||
|
||||
void ApiResponse::unsetMessage()
|
||||
{
|
||||
m_MessageIsSet = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
91
samples/client/petstore/cpp-restsdk/model/ApiResponse.h
Normal file
91
samples/client/petstore/cpp-restsdk/model/ApiResponse.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ApiResponse.h
|
||||
*
|
||||
* Describes the result of uploading an image resource
|
||||
*/
|
||||
|
||||
#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_ApiResponse_H_
|
||||
#define ORG_OPENAPITOOLS_CLIENT_MODEL_ApiResponse_H_
|
||||
|
||||
|
||||
#include "../ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace client {
|
||||
namespace model {
|
||||
|
||||
/// <summary>
|
||||
/// Describes the result of uploading an image resource
|
||||
/// </summary>
|
||||
class ApiResponse
|
||||
: public ModelBase
|
||||
{
|
||||
public:
|
||||
ApiResponse();
|
||||
virtual ~ApiResponse();
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
void validate() override;
|
||||
|
||||
web::json::value toJson() const override;
|
||||
void fromJson(web::json::value& json) override;
|
||||
|
||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
||||
void fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ApiResponse members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int32_t getCode() const;
|
||||
bool codeIsSet() const;
|
||||
void unsetCode();
|
||||
void setCode(int32_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getType() const;
|
||||
bool typeIsSet() const;
|
||||
void unsetType();
|
||||
void setType(utility::string_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getMessage() const;
|
||||
bool messageIsSet() const;
|
||||
void unsetMessage();
|
||||
void setMessage(utility::string_t value);
|
||||
|
||||
protected:
|
||||
int32_t m_Code;
|
||||
bool m_CodeIsSet;
|
||||
utility::string_t m_Type;
|
||||
bool m_TypeIsSet;
|
||||
utility::string_t m_Message;
|
||||
bool m_MessageIsSet;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_ApiResponse_H_ */
|
||||
149
samples/client/petstore/cpp-restsdk/model/Category.cpp
Normal file
149
samples/client/petstore/cpp-restsdk/model/Category.cpp
Normal file
@@ -0,0 +1,149 @@
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "Category.h"
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace client {
|
||||
namespace model {
|
||||
|
||||
Category::Category()
|
||||
{
|
||||
m_Id = 0L;
|
||||
m_IdIsSet = false;
|
||||
m_Name = utility::conversions::to_string_t("");
|
||||
m_NameIsSet = false;
|
||||
}
|
||||
|
||||
Category::~Category()
|
||||
{
|
||||
}
|
||||
|
||||
void Category::validate()
|
||||
{
|
||||
// TODO: implement validation
|
||||
}
|
||||
|
||||
web::json::value Category::toJson() const
|
||||
{
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_IdIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("id")] = ModelBase::toJson(m_Id);
|
||||
}
|
||||
if(m_NameIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("name")] = ModelBase::toJson(m_Name);
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
void Category::fromJson(web::json::value& val)
|
||||
{
|
||||
if(val.has_field(utility::conversions::to_string_t("id")))
|
||||
{
|
||||
setId(ModelBase::int64_tFromJson(val[utility::conversions::to_string_t("id")]));
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t("name")))
|
||||
{
|
||||
setName(ModelBase::stringFromJson(val[utility::conversions::to_string_t("name")]));
|
||||
}
|
||||
}
|
||||
|
||||
void Category::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
||||
{
|
||||
utility::string_t namePrefix = prefix;
|
||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t("."))
|
||||
{
|
||||
namePrefix += utility::conversions::to_string_t(".");
|
||||
}
|
||||
|
||||
if(m_IdIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("id"), m_Id));
|
||||
}
|
||||
if(m_NameIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("name"), m_Name));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void Category::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
||||
{
|
||||
utility::string_t namePrefix = prefix;
|
||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t("."))
|
||||
{
|
||||
namePrefix += utility::conversions::to_string_t(".");
|
||||
}
|
||||
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("id")))
|
||||
{
|
||||
setId(ModelBase::int64_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("id"))));
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("name")))
|
||||
{
|
||||
setName(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("name"))));
|
||||
}
|
||||
}
|
||||
|
||||
int64_t Category::getId() const
|
||||
{
|
||||
return m_Id;
|
||||
}
|
||||
|
||||
|
||||
void Category::setId(int64_t value)
|
||||
{
|
||||
m_Id = value;
|
||||
m_IdIsSet = true;
|
||||
}
|
||||
bool Category::idIsSet() const
|
||||
{
|
||||
return m_IdIsSet;
|
||||
}
|
||||
|
||||
void Category::unsetId()
|
||||
{
|
||||
m_IdIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t Category::getName() const
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
|
||||
|
||||
void Category::setName(utility::string_t value)
|
||||
{
|
||||
m_Name = value;
|
||||
m_NameIsSet = true;
|
||||
}
|
||||
bool Category::nameIsSet() const
|
||||
{
|
||||
return m_NameIsSet;
|
||||
}
|
||||
|
||||
void Category::unsetName()
|
||||
{
|
||||
m_NameIsSet = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
82
samples/client/petstore/cpp-restsdk/model/Category.h
Normal file
82
samples/client/petstore/cpp-restsdk/model/Category.h
Normal file
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Category.h
|
||||
*
|
||||
* A category for a pet
|
||||
*/
|
||||
|
||||
#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Category_H_
|
||||
#define ORG_OPENAPITOOLS_CLIENT_MODEL_Category_H_
|
||||
|
||||
|
||||
#include "../ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace client {
|
||||
namespace model {
|
||||
|
||||
/// <summary>
|
||||
/// A category for a pet
|
||||
/// </summary>
|
||||
class Category
|
||||
: public ModelBase
|
||||
{
|
||||
public:
|
||||
Category();
|
||||
virtual ~Category();
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
void validate() override;
|
||||
|
||||
web::json::value toJson() const override;
|
||||
void fromJson(web::json::value& json) override;
|
||||
|
||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
||||
void fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Category members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getId() const;
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(int64_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(utility::string_t value);
|
||||
|
||||
protected:
|
||||
int64_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_Category_H_ */
|
||||
306
samples/client/petstore/cpp-restsdk/model/Order.cpp
Normal file
306
samples/client/petstore/cpp-restsdk/model/Order.cpp
Normal file
@@ -0,0 +1,306 @@
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "Order.h"
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace client {
|
||||
namespace model {
|
||||
|
||||
Order::Order()
|
||||
{
|
||||
m_Id = 0L;
|
||||
m_IdIsSet = false;
|
||||
m_PetId = 0L;
|
||||
m_PetIdIsSet = false;
|
||||
m_Quantity = 0;
|
||||
m_QuantityIsSet = false;
|
||||
m_ShipDate = utility::datetime();
|
||||
m_ShipDateIsSet = false;
|
||||
m_Status = utility::conversions::to_string_t("");
|
||||
m_StatusIsSet = false;
|
||||
m_Complete = false;
|
||||
m_CompleteIsSet = false;
|
||||
}
|
||||
|
||||
Order::~Order()
|
||||
{
|
||||
}
|
||||
|
||||
void Order::validate()
|
||||
{
|
||||
// TODO: implement validation
|
||||
}
|
||||
|
||||
web::json::value Order::toJson() const
|
||||
{
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_IdIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("id")] = ModelBase::toJson(m_Id);
|
||||
}
|
||||
if(m_PetIdIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("petId")] = ModelBase::toJson(m_PetId);
|
||||
}
|
||||
if(m_QuantityIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("quantity")] = ModelBase::toJson(m_Quantity);
|
||||
}
|
||||
if(m_ShipDateIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("shipDate")] = ModelBase::toJson(m_ShipDate);
|
||||
}
|
||||
if(m_StatusIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("status")] = ModelBase::toJson(m_Status);
|
||||
}
|
||||
if(m_CompleteIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("complete")] = ModelBase::toJson(m_Complete);
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
void Order::fromJson(web::json::value& val)
|
||||
{
|
||||
if(val.has_field(utility::conversions::to_string_t("id")))
|
||||
{
|
||||
setId(ModelBase::int64_tFromJson(val[utility::conversions::to_string_t("id")]));
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t("petId")))
|
||||
{
|
||||
setPetId(ModelBase::int64_tFromJson(val[utility::conversions::to_string_t("petId")]));
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t("quantity")))
|
||||
{
|
||||
setQuantity(ModelBase::int32_tFromJson(val[utility::conversions::to_string_t("quantity")]));
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t("shipDate")))
|
||||
{
|
||||
setShipDate(ModelBase::dateFromJson(val[utility::conversions::to_string_t("shipDate")]));
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t("status")))
|
||||
{
|
||||
setStatus(ModelBase::stringFromJson(val[utility::conversions::to_string_t("status")]));
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t("complete")))
|
||||
{
|
||||
setComplete(ModelBase::boolFromJson(val[utility::conversions::to_string_t("complete")]));
|
||||
}
|
||||
}
|
||||
|
||||
void Order::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
||||
{
|
||||
utility::string_t namePrefix = prefix;
|
||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t("."))
|
||||
{
|
||||
namePrefix += utility::conversions::to_string_t(".");
|
||||
}
|
||||
|
||||
if(m_IdIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("id"), m_Id));
|
||||
}
|
||||
if(m_PetIdIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("petId"), m_PetId));
|
||||
}
|
||||
if(m_QuantityIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("quantity"), m_Quantity));
|
||||
}
|
||||
if(m_ShipDateIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("shipDate"), m_ShipDate));
|
||||
|
||||
}
|
||||
if(m_StatusIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("status"), m_Status));
|
||||
|
||||
}
|
||||
if(m_CompleteIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("complete"), m_Complete));
|
||||
}
|
||||
}
|
||||
|
||||
void Order::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
||||
{
|
||||
utility::string_t namePrefix = prefix;
|
||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t("."))
|
||||
{
|
||||
namePrefix += utility::conversions::to_string_t(".");
|
||||
}
|
||||
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("id")))
|
||||
{
|
||||
setId(ModelBase::int64_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("id"))));
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("petId")))
|
||||
{
|
||||
setPetId(ModelBase::int64_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("petId"))));
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("quantity")))
|
||||
{
|
||||
setQuantity(ModelBase::int32_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("quantity"))));
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("shipDate")))
|
||||
{
|
||||
setShipDate(ModelBase::dateFromHttpContent(multipart->getContent(utility::conversions::to_string_t("shipDate"))));
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("status")))
|
||||
{
|
||||
setStatus(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("status"))));
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("complete")))
|
||||
{
|
||||
setComplete(ModelBase::boolFromHttpContent(multipart->getContent(utility::conversions::to_string_t("complete"))));
|
||||
}
|
||||
}
|
||||
|
||||
int64_t Order::getId() const
|
||||
{
|
||||
return m_Id;
|
||||
}
|
||||
|
||||
|
||||
void Order::setId(int64_t value)
|
||||
{
|
||||
m_Id = value;
|
||||
m_IdIsSet = true;
|
||||
}
|
||||
bool Order::idIsSet() const
|
||||
{
|
||||
return m_IdIsSet;
|
||||
}
|
||||
|
||||
void Order::unsetId()
|
||||
{
|
||||
m_IdIsSet = false;
|
||||
}
|
||||
|
||||
int64_t Order::getPetId() const
|
||||
{
|
||||
return m_PetId;
|
||||
}
|
||||
|
||||
|
||||
void Order::setPetId(int64_t value)
|
||||
{
|
||||
m_PetId = value;
|
||||
m_PetIdIsSet = true;
|
||||
}
|
||||
bool Order::petIdIsSet() const
|
||||
{
|
||||
return m_PetIdIsSet;
|
||||
}
|
||||
|
||||
void Order::unsetPetId()
|
||||
{
|
||||
m_PetIdIsSet = false;
|
||||
}
|
||||
|
||||
int32_t Order::getQuantity() const
|
||||
{
|
||||
return m_Quantity;
|
||||
}
|
||||
|
||||
|
||||
void Order::setQuantity(int32_t value)
|
||||
{
|
||||
m_Quantity = value;
|
||||
m_QuantityIsSet = true;
|
||||
}
|
||||
bool Order::quantityIsSet() const
|
||||
{
|
||||
return m_QuantityIsSet;
|
||||
}
|
||||
|
||||
void Order::unsetQuantity()
|
||||
{
|
||||
m_QuantityIsSet = false;
|
||||
}
|
||||
|
||||
utility::datetime Order::getShipDate() const
|
||||
{
|
||||
return m_ShipDate;
|
||||
}
|
||||
|
||||
|
||||
void Order::setShipDate(utility::datetime value)
|
||||
{
|
||||
m_ShipDate = value;
|
||||
m_ShipDateIsSet = true;
|
||||
}
|
||||
bool Order::shipDateIsSet() const
|
||||
{
|
||||
return m_ShipDateIsSet;
|
||||
}
|
||||
|
||||
void Order::unsetShipDate()
|
||||
{
|
||||
m_ShipDateIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t Order::getStatus() const
|
||||
{
|
||||
return m_Status;
|
||||
}
|
||||
|
||||
|
||||
void Order::setStatus(utility::string_t value)
|
||||
{
|
||||
m_Status = value;
|
||||
m_StatusIsSet = true;
|
||||
}
|
||||
bool Order::statusIsSet() const
|
||||
{
|
||||
return m_StatusIsSet;
|
||||
}
|
||||
|
||||
void Order::unsetStatus()
|
||||
{
|
||||
m_StatusIsSet = false;
|
||||
}
|
||||
|
||||
bool Order::isComplete() const
|
||||
{
|
||||
return m_Complete;
|
||||
}
|
||||
|
||||
|
||||
void Order::setComplete(bool value)
|
||||
{
|
||||
m_Complete = value;
|
||||
m_CompleteIsSet = true;
|
||||
}
|
||||
bool Order::completeIsSet() const
|
||||
{
|
||||
return m_CompleteIsSet;
|
||||
}
|
||||
|
||||
void Order::unsetComplete()
|
||||
{
|
||||
m_CompleteIsSet = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
118
samples/client/petstore/cpp-restsdk/model/Order.h
Normal file
118
samples/client/petstore/cpp-restsdk/model/Order.h
Normal file
@@ -0,0 +1,118 @@
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Order.h
|
||||
*
|
||||
* An order for a pets from the pet store
|
||||
*/
|
||||
|
||||
#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Order_H_
|
||||
#define ORG_OPENAPITOOLS_CLIENT_MODEL_Order_H_
|
||||
|
||||
|
||||
#include "../ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace client {
|
||||
namespace model {
|
||||
|
||||
/// <summary>
|
||||
/// An order for a pets from the pet store
|
||||
/// </summary>
|
||||
class Order
|
||||
: public ModelBase
|
||||
{
|
||||
public:
|
||||
Order();
|
||||
virtual ~Order();
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
void validate() override;
|
||||
|
||||
web::json::value toJson() const override;
|
||||
void fromJson(web::json::value& json) override;
|
||||
|
||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
||||
void fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Order members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getId() const;
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(int64_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getPetId() const;
|
||||
bool petIdIsSet() const;
|
||||
void unsetPetId();
|
||||
void setPetId(int64_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int32_t getQuantity() const;
|
||||
bool quantityIsSet() const;
|
||||
void unsetQuantity();
|
||||
void setQuantity(int32_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::datetime getShipDate() const;
|
||||
bool shipDateIsSet() const;
|
||||
void unsetShipDate();
|
||||
void setShipDate(utility::datetime value);
|
||||
/// <summary>
|
||||
/// Order Status
|
||||
/// </summary>
|
||||
utility::string_t getStatus() const;
|
||||
bool statusIsSet() const;
|
||||
void unsetStatus();
|
||||
void setStatus(utility::string_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool isComplete() const;
|
||||
bool completeIsSet() const;
|
||||
void unsetComplete();
|
||||
void setComplete(bool value);
|
||||
|
||||
protected:
|
||||
int64_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
int64_t m_PetId;
|
||||
bool m_PetIdIsSet;
|
||||
int32_t m_Quantity;
|
||||
bool m_QuantityIsSet;
|
||||
utility::datetime m_ShipDate;
|
||||
bool m_ShipDateIsSet;
|
||||
utility::string_t m_Status;
|
||||
bool m_StatusIsSet;
|
||||
bool m_Complete;
|
||||
bool m_CompleteIsSet;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_Order_H_ */
|
||||
345
samples/client/petstore/cpp-restsdk/model/Pet.cpp
Normal file
345
samples/client/petstore/cpp-restsdk/model/Pet.cpp
Normal file
@@ -0,0 +1,345 @@
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "Pet.h"
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace client {
|
||||
namespace model {
|
||||
|
||||
Pet::Pet()
|
||||
{
|
||||
m_Id = 0L;
|
||||
m_IdIsSet = false;
|
||||
m_CategoryIsSet = false;
|
||||
m_Name = utility::conversions::to_string_t("");
|
||||
m_TagsIsSet = false;
|
||||
m_Status = utility::conversions::to_string_t("");
|
||||
m_StatusIsSet = false;
|
||||
}
|
||||
|
||||
Pet::~Pet()
|
||||
{
|
||||
}
|
||||
|
||||
void Pet::validate()
|
||||
{
|
||||
// TODO: implement validation
|
||||
}
|
||||
|
||||
web::json::value Pet::toJson() const
|
||||
{
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_IdIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("id")] = ModelBase::toJson(m_Id);
|
||||
}
|
||||
if(m_CategoryIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("category")] = ModelBase::toJson(m_Category);
|
||||
}
|
||||
val[utility::conversions::to_string_t("name")] = ModelBase::toJson(m_Name);
|
||||
{
|
||||
std::vector<web::json::value> jsonArray;
|
||||
for( auto& item : m_PhotoUrls )
|
||||
{
|
||||
jsonArray.push_back(ModelBase::toJson(item));
|
||||
}
|
||||
val[utility::conversions::to_string_t("photoUrls")] = web::json::value::array(jsonArray);
|
||||
}
|
||||
{
|
||||
std::vector<web::json::value> jsonArray;
|
||||
for( auto& item : m_Tags )
|
||||
{
|
||||
jsonArray.push_back(ModelBase::toJson(item));
|
||||
}
|
||||
if(jsonArray.size() > 0)
|
||||
{
|
||||
val[utility::conversions::to_string_t("tags")] = web::json::value::array(jsonArray);
|
||||
}
|
||||
}
|
||||
if(m_StatusIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("status")] = ModelBase::toJson(m_Status);
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
void Pet::fromJson(web::json::value& val)
|
||||
{
|
||||
if(val.has_field(utility::conversions::to_string_t("id")))
|
||||
{
|
||||
setId(ModelBase::int64_tFromJson(val[utility::conversions::to_string_t("id")]));
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t("category")))
|
||||
{
|
||||
if(!val[utility::conversions::to_string_t("category")].is_null())
|
||||
{
|
||||
std::shared_ptr<Category> newItem(new Category());
|
||||
newItem->fromJson(val[utility::conversions::to_string_t("category")]);
|
||||
setCategory( newItem );
|
||||
}
|
||||
}
|
||||
setName(ModelBase::stringFromJson(val[utility::conversions::to_string_t("name")]));
|
||||
{
|
||||
m_PhotoUrls.clear();
|
||||
std::vector<web::json::value> jsonArray;
|
||||
for( auto& item : val[utility::conversions::to_string_t("photoUrls")].as_array() )
|
||||
{
|
||||
m_PhotoUrls.push_back(ModelBase::stringFromJson(item));
|
||||
}
|
||||
}
|
||||
{
|
||||
m_Tags.clear();
|
||||
std::vector<web::json::value> jsonArray;
|
||||
if(val.has_field(utility::conversions::to_string_t("tags")))
|
||||
{
|
||||
for( auto& item : val[utility::conversions::to_string_t("tags")].as_array() )
|
||||
{
|
||||
if(item.is_null())
|
||||
{
|
||||
m_Tags.push_back( std::shared_ptr<Tag>(nullptr) );
|
||||
}
|
||||
else
|
||||
{
|
||||
std::shared_ptr<Tag> newItem(new Tag());
|
||||
newItem->fromJson(item);
|
||||
m_Tags.push_back( newItem );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t("status")))
|
||||
{
|
||||
setStatus(ModelBase::stringFromJson(val[utility::conversions::to_string_t("status")]));
|
||||
}
|
||||
}
|
||||
|
||||
void Pet::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
||||
{
|
||||
utility::string_t namePrefix = prefix;
|
||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t("."))
|
||||
{
|
||||
namePrefix += utility::conversions::to_string_t(".");
|
||||
}
|
||||
|
||||
if(m_IdIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("id"), m_Id));
|
||||
}
|
||||
if(m_CategoryIsSet)
|
||||
{
|
||||
if (m_Category.get())
|
||||
{
|
||||
m_Category->toMultipart(multipart, utility::conversions::to_string_t("category."));
|
||||
}
|
||||
|
||||
}
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("name"), m_Name));
|
||||
{
|
||||
std::vector<web::json::value> jsonArray;
|
||||
for( auto& item : m_PhotoUrls )
|
||||
{
|
||||
jsonArray.push_back(ModelBase::toJson(item));
|
||||
}
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("photoUrls"), web::json::value::array(jsonArray), utility::conversions::to_string_t("application/json")));
|
||||
}
|
||||
{
|
||||
std::vector<web::json::value> jsonArray;
|
||||
for( auto& item : m_Tags )
|
||||
{
|
||||
jsonArray.push_back(ModelBase::toJson(item));
|
||||
}
|
||||
|
||||
if(jsonArray.size() > 0)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("tags"), web::json::value::array(jsonArray), utility::conversions::to_string_t("application/json")));
|
||||
}
|
||||
}
|
||||
if(m_StatusIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("status"), m_Status));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void Pet::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
||||
{
|
||||
utility::string_t namePrefix = prefix;
|
||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t("."))
|
||||
{
|
||||
namePrefix += utility::conversions::to_string_t(".");
|
||||
}
|
||||
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("id")))
|
||||
{
|
||||
setId(ModelBase::int64_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("id"))));
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("category")))
|
||||
{
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("category")))
|
||||
{
|
||||
std::shared_ptr<Category> newItem(new Category());
|
||||
newItem->fromMultiPart(multipart, utility::conversions::to_string_t("category."));
|
||||
setCategory( newItem );
|
||||
}
|
||||
}
|
||||
setName(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("name"))));
|
||||
{
|
||||
m_PhotoUrls.clear();
|
||||
|
||||
web::json::value jsonArray = web::json::value::parse(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("photoUrls"))));
|
||||
for( auto& item : jsonArray.as_array() )
|
||||
{
|
||||
m_PhotoUrls.push_back(ModelBase::stringFromJson(item));
|
||||
}
|
||||
}
|
||||
{
|
||||
m_Tags.clear();
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("tags")))
|
||||
{
|
||||
|
||||
web::json::value jsonArray = web::json::value::parse(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("tags"))));
|
||||
for( auto& item : jsonArray.as_array() )
|
||||
{
|
||||
if(item.is_null())
|
||||
{
|
||||
m_Tags.push_back( std::shared_ptr<Tag>(nullptr) );
|
||||
}
|
||||
else
|
||||
{
|
||||
std::shared_ptr<Tag> newItem(new Tag());
|
||||
newItem->fromJson(item);
|
||||
m_Tags.push_back( newItem );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("status")))
|
||||
{
|
||||
setStatus(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("status"))));
|
||||
}
|
||||
}
|
||||
|
||||
int64_t Pet::getId() const
|
||||
{
|
||||
return m_Id;
|
||||
}
|
||||
|
||||
|
||||
void Pet::setId(int64_t value)
|
||||
{
|
||||
m_Id = value;
|
||||
m_IdIsSet = true;
|
||||
}
|
||||
bool Pet::idIsSet() const
|
||||
{
|
||||
return m_IdIsSet;
|
||||
}
|
||||
|
||||
void Pet::unsetId()
|
||||
{
|
||||
m_IdIsSet = false;
|
||||
}
|
||||
|
||||
std::shared_ptr<Category> Pet::getCategory() const
|
||||
{
|
||||
return m_Category;
|
||||
}
|
||||
|
||||
|
||||
void Pet::setCategory(std::shared_ptr<Category> value)
|
||||
{
|
||||
m_Category = value;
|
||||
m_CategoryIsSet = true;
|
||||
}
|
||||
bool Pet::categoryIsSet() const
|
||||
{
|
||||
return m_CategoryIsSet;
|
||||
}
|
||||
|
||||
void Pet::unsetCategory()
|
||||
{
|
||||
m_CategoryIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t Pet::getName() const
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
|
||||
|
||||
void Pet::setName(utility::string_t value)
|
||||
{
|
||||
m_Name = value;
|
||||
|
||||
}
|
||||
std::vector<utility::string_t>& Pet::getPhotoUrls()
|
||||
{
|
||||
return m_PhotoUrls;
|
||||
}
|
||||
|
||||
void Pet::setPhotoUrls(std::vector<utility::string_t> value)
|
||||
{
|
||||
m_PhotoUrls = value;
|
||||
|
||||
}
|
||||
std::vector<std::shared_ptr<Tag>>& Pet::getTags()
|
||||
{
|
||||
return m_Tags;
|
||||
}
|
||||
|
||||
void Pet::setTags(std::vector<std::shared_ptr<Tag>> value)
|
||||
{
|
||||
m_Tags = value;
|
||||
m_TagsIsSet = true;
|
||||
}
|
||||
bool Pet::tagsIsSet() const
|
||||
{
|
||||
return m_TagsIsSet;
|
||||
}
|
||||
|
||||
void Pet::unsetTags()
|
||||
{
|
||||
m_TagsIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t Pet::getStatus() const
|
||||
{
|
||||
return m_Status;
|
||||
}
|
||||
|
||||
|
||||
void Pet::setStatus(utility::string_t value)
|
||||
{
|
||||
m_Status = value;
|
||||
m_StatusIsSet = true;
|
||||
}
|
||||
bool Pet::statusIsSet() const
|
||||
{
|
||||
return m_StatusIsSet;
|
||||
}
|
||||
|
||||
void Pet::unsetStatus()
|
||||
{
|
||||
m_StatusIsSet = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
115
samples/client/petstore/cpp-restsdk/model/Pet.h
Normal file
115
samples/client/petstore/cpp-restsdk/model/Pet.h
Normal file
@@ -0,0 +1,115 @@
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Pet.h
|
||||
*
|
||||
* A pet for sale in the pet store
|
||||
*/
|
||||
|
||||
#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Pet_H_
|
||||
#define ORG_OPENAPITOOLS_CLIENT_MODEL_Pet_H_
|
||||
|
||||
|
||||
#include "../ModelBase.h"
|
||||
|
||||
#include "Tag.h"
|
||||
#include <cpprest/details/basic_types.h>
|
||||
#include "Category.h"
|
||||
#include <vector>
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace client {
|
||||
namespace model {
|
||||
|
||||
/// <summary>
|
||||
/// A pet for sale in the pet store
|
||||
/// </summary>
|
||||
class Pet
|
||||
: public ModelBase
|
||||
{
|
||||
public:
|
||||
Pet();
|
||||
virtual ~Pet();
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
void validate() override;
|
||||
|
||||
web::json::value toJson() const override;
|
||||
void fromJson(web::json::value& json) override;
|
||||
|
||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
||||
void fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Pet members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getId() const;
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(int64_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::shared_ptr<Category> getCategory() const;
|
||||
bool categoryIsSet() const;
|
||||
void unsetCategory();
|
||||
void setCategory(std::shared_ptr<Category> value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getName() const;
|
||||
void setName(utility::string_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::vector<utility::string_t>& getPhotoUrls();
|
||||
void setPhotoUrls(std::vector<utility::string_t> value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::vector<std::shared_ptr<Tag>>& getTags();
|
||||
bool tagsIsSet() const;
|
||||
void unsetTags();
|
||||
void setTags(std::vector<std::shared_ptr<Tag>> value);
|
||||
/// <summary>
|
||||
/// pet status in the store
|
||||
/// </summary>
|
||||
utility::string_t getStatus() const;
|
||||
bool statusIsSet() const;
|
||||
void unsetStatus();
|
||||
void setStatus(utility::string_t value);
|
||||
|
||||
protected:
|
||||
int64_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
std::shared_ptr<Category> m_Category;
|
||||
bool m_CategoryIsSet;
|
||||
utility::string_t m_Name;
|
||||
std::vector<utility::string_t> m_PhotoUrls;
|
||||
std::vector<std::shared_ptr<Tag>> m_Tags;
|
||||
bool m_TagsIsSet;
|
||||
utility::string_t m_Status;
|
||||
bool m_StatusIsSet;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_Pet_H_ */
|
||||
149
samples/client/petstore/cpp-restsdk/model/Tag.cpp
Normal file
149
samples/client/petstore/cpp-restsdk/model/Tag.cpp
Normal file
@@ -0,0 +1,149 @@
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "Tag.h"
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace client {
|
||||
namespace model {
|
||||
|
||||
Tag::Tag()
|
||||
{
|
||||
m_Id = 0L;
|
||||
m_IdIsSet = false;
|
||||
m_Name = utility::conversions::to_string_t("");
|
||||
m_NameIsSet = false;
|
||||
}
|
||||
|
||||
Tag::~Tag()
|
||||
{
|
||||
}
|
||||
|
||||
void Tag::validate()
|
||||
{
|
||||
// TODO: implement validation
|
||||
}
|
||||
|
||||
web::json::value Tag::toJson() const
|
||||
{
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_IdIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("id")] = ModelBase::toJson(m_Id);
|
||||
}
|
||||
if(m_NameIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("name")] = ModelBase::toJson(m_Name);
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
void Tag::fromJson(web::json::value& val)
|
||||
{
|
||||
if(val.has_field(utility::conversions::to_string_t("id")))
|
||||
{
|
||||
setId(ModelBase::int64_tFromJson(val[utility::conversions::to_string_t("id")]));
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t("name")))
|
||||
{
|
||||
setName(ModelBase::stringFromJson(val[utility::conversions::to_string_t("name")]));
|
||||
}
|
||||
}
|
||||
|
||||
void Tag::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
||||
{
|
||||
utility::string_t namePrefix = prefix;
|
||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t("."))
|
||||
{
|
||||
namePrefix += utility::conversions::to_string_t(".");
|
||||
}
|
||||
|
||||
if(m_IdIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("id"), m_Id));
|
||||
}
|
||||
if(m_NameIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("name"), m_Name));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void Tag::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
||||
{
|
||||
utility::string_t namePrefix = prefix;
|
||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t("."))
|
||||
{
|
||||
namePrefix += utility::conversions::to_string_t(".");
|
||||
}
|
||||
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("id")))
|
||||
{
|
||||
setId(ModelBase::int64_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("id"))));
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("name")))
|
||||
{
|
||||
setName(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("name"))));
|
||||
}
|
||||
}
|
||||
|
||||
int64_t Tag::getId() const
|
||||
{
|
||||
return m_Id;
|
||||
}
|
||||
|
||||
|
||||
void Tag::setId(int64_t value)
|
||||
{
|
||||
m_Id = value;
|
||||
m_IdIsSet = true;
|
||||
}
|
||||
bool Tag::idIsSet() const
|
||||
{
|
||||
return m_IdIsSet;
|
||||
}
|
||||
|
||||
void Tag::unsetId()
|
||||
{
|
||||
m_IdIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t Tag::getName() const
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
|
||||
|
||||
void Tag::setName(utility::string_t value)
|
||||
{
|
||||
m_Name = value;
|
||||
m_NameIsSet = true;
|
||||
}
|
||||
bool Tag::nameIsSet() const
|
||||
{
|
||||
return m_NameIsSet;
|
||||
}
|
||||
|
||||
void Tag::unsetName()
|
||||
{
|
||||
m_NameIsSet = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
82
samples/client/petstore/cpp-restsdk/model/Tag.h
Normal file
82
samples/client/petstore/cpp-restsdk/model/Tag.h
Normal file
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Tag.h
|
||||
*
|
||||
* A tag for a pet
|
||||
*/
|
||||
|
||||
#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Tag_H_
|
||||
#define ORG_OPENAPITOOLS_CLIENT_MODEL_Tag_H_
|
||||
|
||||
|
||||
#include "../ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace client {
|
||||
namespace model {
|
||||
|
||||
/// <summary>
|
||||
/// A tag for a pet
|
||||
/// </summary>
|
||||
class Tag
|
||||
: public ModelBase
|
||||
{
|
||||
public:
|
||||
Tag();
|
||||
virtual ~Tag();
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
void validate() override;
|
||||
|
||||
web::json::value toJson() const override;
|
||||
void fromJson(web::json::value& json) override;
|
||||
|
||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
||||
void fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Tag members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getId() const;
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(int64_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(utility::string_t value);
|
||||
|
||||
protected:
|
||||
int64_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_Tag_H_ */
|
||||
388
samples/client/petstore/cpp-restsdk/model/User.cpp
Normal file
388
samples/client/petstore/cpp-restsdk/model/User.cpp
Normal file
@@ -0,0 +1,388 @@
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "User.h"
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace client {
|
||||
namespace model {
|
||||
|
||||
User::User()
|
||||
{
|
||||
m_Id = 0L;
|
||||
m_IdIsSet = false;
|
||||
m_Username = utility::conversions::to_string_t("");
|
||||
m_UsernameIsSet = false;
|
||||
m_FirstName = utility::conversions::to_string_t("");
|
||||
m_FirstNameIsSet = false;
|
||||
m_LastName = utility::conversions::to_string_t("");
|
||||
m_LastNameIsSet = false;
|
||||
m_Email = utility::conversions::to_string_t("");
|
||||
m_EmailIsSet = false;
|
||||
m_Password = utility::conversions::to_string_t("");
|
||||
m_PasswordIsSet = false;
|
||||
m_Phone = utility::conversions::to_string_t("");
|
||||
m_PhoneIsSet = false;
|
||||
m_UserStatus = 0;
|
||||
m_UserStatusIsSet = false;
|
||||
}
|
||||
|
||||
User::~User()
|
||||
{
|
||||
}
|
||||
|
||||
void User::validate()
|
||||
{
|
||||
// TODO: implement validation
|
||||
}
|
||||
|
||||
web::json::value User::toJson() const
|
||||
{
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_IdIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("id")] = ModelBase::toJson(m_Id);
|
||||
}
|
||||
if(m_UsernameIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("username")] = ModelBase::toJson(m_Username);
|
||||
}
|
||||
if(m_FirstNameIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("firstName")] = ModelBase::toJson(m_FirstName);
|
||||
}
|
||||
if(m_LastNameIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("lastName")] = ModelBase::toJson(m_LastName);
|
||||
}
|
||||
if(m_EmailIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("email")] = ModelBase::toJson(m_Email);
|
||||
}
|
||||
if(m_PasswordIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("password")] = ModelBase::toJson(m_Password);
|
||||
}
|
||||
if(m_PhoneIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("phone")] = ModelBase::toJson(m_Phone);
|
||||
}
|
||||
if(m_UserStatusIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t("userStatus")] = ModelBase::toJson(m_UserStatus);
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
void User::fromJson(web::json::value& val)
|
||||
{
|
||||
if(val.has_field(utility::conversions::to_string_t("id")))
|
||||
{
|
||||
setId(ModelBase::int64_tFromJson(val[utility::conversions::to_string_t("id")]));
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t("username")))
|
||||
{
|
||||
setUsername(ModelBase::stringFromJson(val[utility::conversions::to_string_t("username")]));
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t("firstName")))
|
||||
{
|
||||
setFirstName(ModelBase::stringFromJson(val[utility::conversions::to_string_t("firstName")]));
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t("lastName")))
|
||||
{
|
||||
setLastName(ModelBase::stringFromJson(val[utility::conversions::to_string_t("lastName")]));
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t("email")))
|
||||
{
|
||||
setEmail(ModelBase::stringFromJson(val[utility::conversions::to_string_t("email")]));
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t("password")))
|
||||
{
|
||||
setPassword(ModelBase::stringFromJson(val[utility::conversions::to_string_t("password")]));
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t("phone")))
|
||||
{
|
||||
setPhone(ModelBase::stringFromJson(val[utility::conversions::to_string_t("phone")]));
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t("userStatus")))
|
||||
{
|
||||
setUserStatus(ModelBase::int32_tFromJson(val[utility::conversions::to_string_t("userStatus")]));
|
||||
}
|
||||
}
|
||||
|
||||
void User::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
||||
{
|
||||
utility::string_t namePrefix = prefix;
|
||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t("."))
|
||||
{
|
||||
namePrefix += utility::conversions::to_string_t(".");
|
||||
}
|
||||
|
||||
if(m_IdIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("id"), m_Id));
|
||||
}
|
||||
if(m_UsernameIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("username"), m_Username));
|
||||
|
||||
}
|
||||
if(m_FirstNameIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("firstName"), m_FirstName));
|
||||
|
||||
}
|
||||
if(m_LastNameIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("lastName"), m_LastName));
|
||||
|
||||
}
|
||||
if(m_EmailIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("email"), m_Email));
|
||||
|
||||
}
|
||||
if(m_PasswordIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("password"), m_Password));
|
||||
|
||||
}
|
||||
if(m_PhoneIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("phone"), m_Phone));
|
||||
|
||||
}
|
||||
if(m_UserStatusIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("userStatus"), m_UserStatus));
|
||||
}
|
||||
}
|
||||
|
||||
void User::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
||||
{
|
||||
utility::string_t namePrefix = prefix;
|
||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t("."))
|
||||
{
|
||||
namePrefix += utility::conversions::to_string_t(".");
|
||||
}
|
||||
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("id")))
|
||||
{
|
||||
setId(ModelBase::int64_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("id"))));
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("username")))
|
||||
{
|
||||
setUsername(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("username"))));
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("firstName")))
|
||||
{
|
||||
setFirstName(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("firstName"))));
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("lastName")))
|
||||
{
|
||||
setLastName(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("lastName"))));
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("email")))
|
||||
{
|
||||
setEmail(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("email"))));
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("password")))
|
||||
{
|
||||
setPassword(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("password"))));
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("phone")))
|
||||
{
|
||||
setPhone(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("phone"))));
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t("userStatus")))
|
||||
{
|
||||
setUserStatus(ModelBase::int32_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("userStatus"))));
|
||||
}
|
||||
}
|
||||
|
||||
int64_t User::getId() const
|
||||
{
|
||||
return m_Id;
|
||||
}
|
||||
|
||||
|
||||
void User::setId(int64_t value)
|
||||
{
|
||||
m_Id = value;
|
||||
m_IdIsSet = true;
|
||||
}
|
||||
bool User::idIsSet() const
|
||||
{
|
||||
return m_IdIsSet;
|
||||
}
|
||||
|
||||
void User::unsetId()
|
||||
{
|
||||
m_IdIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t User::getUsername() const
|
||||
{
|
||||
return m_Username;
|
||||
}
|
||||
|
||||
|
||||
void User::setUsername(utility::string_t value)
|
||||
{
|
||||
m_Username = value;
|
||||
m_UsernameIsSet = true;
|
||||
}
|
||||
bool User::usernameIsSet() const
|
||||
{
|
||||
return m_UsernameIsSet;
|
||||
}
|
||||
|
||||
void User::unsetUsername()
|
||||
{
|
||||
m_UsernameIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t User::getFirstName() const
|
||||
{
|
||||
return m_FirstName;
|
||||
}
|
||||
|
||||
|
||||
void User::setFirstName(utility::string_t value)
|
||||
{
|
||||
m_FirstName = value;
|
||||
m_FirstNameIsSet = true;
|
||||
}
|
||||
bool User::firstNameIsSet() const
|
||||
{
|
||||
return m_FirstNameIsSet;
|
||||
}
|
||||
|
||||
void User::unsetFirstName()
|
||||
{
|
||||
m_FirstNameIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t User::getLastName() const
|
||||
{
|
||||
return m_LastName;
|
||||
}
|
||||
|
||||
|
||||
void User::setLastName(utility::string_t value)
|
||||
{
|
||||
m_LastName = value;
|
||||
m_LastNameIsSet = true;
|
||||
}
|
||||
bool User::lastNameIsSet() const
|
||||
{
|
||||
return m_LastNameIsSet;
|
||||
}
|
||||
|
||||
void User::unsetLastName()
|
||||
{
|
||||
m_LastNameIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t User::getEmail() const
|
||||
{
|
||||
return m_Email;
|
||||
}
|
||||
|
||||
|
||||
void User::setEmail(utility::string_t value)
|
||||
{
|
||||
m_Email = value;
|
||||
m_EmailIsSet = true;
|
||||
}
|
||||
bool User::emailIsSet() const
|
||||
{
|
||||
return m_EmailIsSet;
|
||||
}
|
||||
|
||||
void User::unsetEmail()
|
||||
{
|
||||
m_EmailIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t User::getPassword() const
|
||||
{
|
||||
return m_Password;
|
||||
}
|
||||
|
||||
|
||||
void User::setPassword(utility::string_t value)
|
||||
{
|
||||
m_Password = value;
|
||||
m_PasswordIsSet = true;
|
||||
}
|
||||
bool User::passwordIsSet() const
|
||||
{
|
||||
return m_PasswordIsSet;
|
||||
}
|
||||
|
||||
void User::unsetPassword()
|
||||
{
|
||||
m_PasswordIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t User::getPhone() const
|
||||
{
|
||||
return m_Phone;
|
||||
}
|
||||
|
||||
|
||||
void User::setPhone(utility::string_t value)
|
||||
{
|
||||
m_Phone = value;
|
||||
m_PhoneIsSet = true;
|
||||
}
|
||||
bool User::phoneIsSet() const
|
||||
{
|
||||
return m_PhoneIsSet;
|
||||
}
|
||||
|
||||
void User::unsetPhone()
|
||||
{
|
||||
m_PhoneIsSet = false;
|
||||
}
|
||||
|
||||
int32_t User::getUserStatus() const
|
||||
{
|
||||
return m_UserStatus;
|
||||
}
|
||||
|
||||
|
||||
void User::setUserStatus(int32_t value)
|
||||
{
|
||||
m_UserStatus = value;
|
||||
m_UserStatusIsSet = true;
|
||||
}
|
||||
bool User::userStatusIsSet() const
|
||||
{
|
||||
return m_UserStatusIsSet;
|
||||
}
|
||||
|
||||
void User::unsetUserStatus()
|
||||
{
|
||||
m_UserStatusIsSet = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
136
samples/client/petstore/cpp-restsdk/model/User.h
Normal file
136
samples/client/petstore/cpp-restsdk/model/User.h
Normal file
@@ -0,0 +1,136 @@
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/*
|
||||
* User.h
|
||||
*
|
||||
* A User who is purchasing from the pet store
|
||||
*/
|
||||
|
||||
#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_User_H_
|
||||
#define ORG_OPENAPITOOLS_CLIENT_MODEL_User_H_
|
||||
|
||||
|
||||
#include "../ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace client {
|
||||
namespace model {
|
||||
|
||||
/// <summary>
|
||||
/// A User who is purchasing from the pet store
|
||||
/// </summary>
|
||||
class User
|
||||
: public ModelBase
|
||||
{
|
||||
public:
|
||||
User();
|
||||
virtual ~User();
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
void validate() override;
|
||||
|
||||
web::json::value toJson() const override;
|
||||
void fromJson(web::json::value& json) override;
|
||||
|
||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
||||
void fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// User members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getId() const;
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(int64_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getUsername() const;
|
||||
bool usernameIsSet() const;
|
||||
void unsetUsername();
|
||||
void setUsername(utility::string_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getFirstName() const;
|
||||
bool firstNameIsSet() const;
|
||||
void unsetFirstName();
|
||||
void setFirstName(utility::string_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getLastName() const;
|
||||
bool lastNameIsSet() const;
|
||||
void unsetLastName();
|
||||
void setLastName(utility::string_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getEmail() const;
|
||||
bool emailIsSet() const;
|
||||
void unsetEmail();
|
||||
void setEmail(utility::string_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getPassword() const;
|
||||
bool passwordIsSet() const;
|
||||
void unsetPassword();
|
||||
void setPassword(utility::string_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
utility::string_t getPhone() const;
|
||||
bool phoneIsSet() const;
|
||||
void unsetPhone();
|
||||
void setPhone(utility::string_t value);
|
||||
/// <summary>
|
||||
/// User Status
|
||||
/// </summary>
|
||||
int32_t getUserStatus() const;
|
||||
bool userStatusIsSet() const;
|
||||
void unsetUserStatus();
|
||||
void setUserStatus(int32_t value);
|
||||
|
||||
protected:
|
||||
int64_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
utility::string_t m_Username;
|
||||
bool m_UsernameIsSet;
|
||||
utility::string_t m_FirstName;
|
||||
bool m_FirstNameIsSet;
|
||||
utility::string_t m_LastName;
|
||||
bool m_LastNameIsSet;
|
||||
utility::string_t m_Email;
|
||||
bool m_EmailIsSet;
|
||||
utility::string_t m_Password;
|
||||
bool m_PasswordIsSet;
|
||||
utility::string_t m_Phone;
|
||||
bool m_PhoneIsSet;
|
||||
int32_t m_UserStatus;
|
||||
bool m_UserStatusIsSet;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_User_H_ */
|
||||
Reference in New Issue
Block a user