forked from loafle/openapi-generator-original
* Fix not processing enums in cpp-pistache-server Defining a reusable enum as a component schema results in an empty class. Following changes are made: - activate 'postProcessModelsEnum' in 'AbstractCppCodegen' - modify model templates for the 'cpp-pistache-server' project As 'postProcessModelsEnum' is now available in the 'AbstactCppCodegen' the 'enumVars' variables are now available in mustache templates for all cpp based code generators. As the 'AbstractCppCodegen' was touched all cpp based samples were updated. * fixes encountered on real world * PR fixes Co-authored-by: mfyuce <mfyuce@netas.com.tr>
209 lines
3.7 KiB
C++
209 lines
3.7 KiB
C++
/**
|
|
* OpenAPI Petstore
|
|
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
|
*
|
|
* The version of the OpenAPI document: 1.0.0
|
|
*
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
|
|
#include "Order.h"
|
|
|
|
namespace org {
|
|
namespace openapitools {
|
|
namespace server {
|
|
namespace model {
|
|
|
|
Order::Order()
|
|
{
|
|
m_Id = 0L;
|
|
m_IdIsSet = false;
|
|
m_PetId = 0L;
|
|
m_PetIdIsSet = false;
|
|
m_Quantity = 0;
|
|
m_QuantityIsSet = false;
|
|
m_ShipDate = "";
|
|
m_ShipDateIsSet = false;
|
|
m_Status = "";
|
|
m_StatusIsSet = false;
|
|
m_Complete = false;
|
|
m_CompleteIsSet = false;
|
|
|
|
}
|
|
|
|
Order::~Order()
|
|
{
|
|
}
|
|
|
|
void Order::validate()
|
|
{
|
|
// TODO: implement validation
|
|
}
|
|
|
|
void to_json(nlohmann::json& j, const Order& o)
|
|
{
|
|
j = nlohmann::json();
|
|
if(o.idIsSet())
|
|
j["id"] = o.m_Id;
|
|
if(o.petIdIsSet())
|
|
j["petId"] = o.m_PetId;
|
|
if(o.quantityIsSet())
|
|
j["quantity"] = o.m_Quantity;
|
|
if(o.shipDateIsSet())
|
|
j["shipDate"] = o.m_ShipDate;
|
|
if(o.statusIsSet())
|
|
j["status"] = o.m_Status;
|
|
if(o.completeIsSet())
|
|
j["complete"] = o.m_Complete;
|
|
|
|
}
|
|
|
|
void from_json(const nlohmann::json& j, Order& o)
|
|
{
|
|
if(j.find("id") != j.end())
|
|
{
|
|
j.at("id").get_to(o.m_Id);
|
|
o.m_IdIsSet = true;
|
|
}
|
|
if(j.find("petId") != j.end())
|
|
{
|
|
j.at("petId").get_to(o.m_PetId);
|
|
o.m_PetIdIsSet = true;
|
|
}
|
|
if(j.find("quantity") != j.end())
|
|
{
|
|
j.at("quantity").get_to(o.m_Quantity);
|
|
o.m_QuantityIsSet = true;
|
|
}
|
|
if(j.find("shipDate") != j.end())
|
|
{
|
|
j.at("shipDate").get_to(o.m_ShipDate);
|
|
o.m_ShipDateIsSet = true;
|
|
}
|
|
if(j.find("status") != j.end())
|
|
{
|
|
j.at("status").get_to(o.m_Status);
|
|
o.m_StatusIsSet = true;
|
|
}
|
|
if(j.find("complete") != j.end())
|
|
{
|
|
j.at("complete").get_to(o.m_Complete);
|
|
o.m_CompleteIsSet = true;
|
|
}
|
|
|
|
}
|
|
|
|
int64_t Order::getId() const
|
|
{
|
|
return m_Id;
|
|
}
|
|
void Order::setId(int64_t const 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 const 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 const value)
|
|
{
|
|
m_Quantity = value;
|
|
m_QuantityIsSet = true;
|
|
}
|
|
bool Order::quantityIsSet() const
|
|
{
|
|
return m_QuantityIsSet;
|
|
}
|
|
void Order::unsetQuantity()
|
|
{
|
|
m_QuantityIsSet = false;
|
|
}
|
|
std::string Order::getShipDate() const
|
|
{
|
|
return m_ShipDate;
|
|
}
|
|
void Order::setShipDate(std::string const& value)
|
|
{
|
|
m_ShipDate = value;
|
|
m_ShipDateIsSet = true;
|
|
}
|
|
bool Order::shipDateIsSet() const
|
|
{
|
|
return m_ShipDateIsSet;
|
|
}
|
|
void Order::unsetShipDate()
|
|
{
|
|
m_ShipDateIsSet = false;
|
|
}
|
|
std::string Order::getStatus() const
|
|
{
|
|
return m_Status;
|
|
}
|
|
void Order::setStatus(std::string const& 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 const value)
|
|
{
|
|
m_Complete = value;
|
|
m_CompleteIsSet = true;
|
|
}
|
|
bool Order::completeIsSet() const
|
|
{
|
|
return m_CompleteIsSet;
|
|
}
|
|
void Order::unsetComplete()
|
|
{
|
|
m_CompleteIsSet = false;
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|