forked from loafle/openapi-generator-original
[cpprestsdk] Implement Enum inside Objects (#19919)
* Fix #19566 implemented the missing definition of declared methods inside openapi-generator/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache, have also be added two missing body of methods definitions * Regenerated cpp-restsdk client samples * Fixed shared_ptr creation * [cpprestsdk] Implement enum inside objects
This commit is contained in:
parent
4a6dbace73
commit
0183620854
@ -8,6 +8,9 @@
|
||||
#ifndef {{modelHeaderGuardPrefix}}_{{classname}}_H_
|
||||
#define {{modelHeaderGuardPrefix}}_{{classname}}_H_
|
||||
|
||||
{{#hasEnums}}
|
||||
#include <stdexcept>
|
||||
{{/hasEnums}}
|
||||
{{#oneOf}}
|
||||
{{#-first}}
|
||||
#include <variant>
|
||||
@ -146,34 +149,64 @@ public:
|
||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
||||
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// {{classname}} members
|
||||
|
||||
{{#vars}}
|
||||
{{^isInherited}}
|
||||
{{! ENUM DEFINITIONS }}
|
||||
{{#vars}}{{^isInherited}}{{#isEnum}}
|
||||
enum class {{#isContainer}}{{{enumName}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}}
|
||||
{
|
||||
{{#allowableValues}}{{#enumVars}}{{value}},
|
||||
{{/enumVars}}{{/allowableValues}}
|
||||
};
|
||||
/// <summary>
|
||||
/// {{description}}
|
||||
/// </summary>
|
||||
{{#isContainer}}{{{dataType}}}& {{getter}}();
|
||||
{{/isContainer}}{{^isContainer}}{{{dataType}}} {{getter}}() const;
|
||||
{{/isContainer}}bool {{nameInCamelCase}}IsSet() const;
|
||||
void unset{{name}}();
|
||||
{{/isEnum}}{{/isInherited}}{{/vars}}{{#vars}}{{^isInherited}}{{#isEnum}}{{#isContainer}}
|
||||
{{! ENUM CONVERSIONS }}
|
||||
{{{enumName}}} to{{{enumName}}}(const utility::string_t& value) const;
|
||||
const utility::string_t from{{{enumName}}}(const {{{enumName}}} value) const;
|
||||
{{#isArray}}
|
||||
{{{datatypeWithEnum}}} to{{{enumName}}}(const {{{dataType}}}& value) const;
|
||||
{{{dataType}}} from{{{enumName}}}(const {{{datatypeWithEnum}}}& value) const;
|
||||
{{/isArray}}{{/isContainer}}{{^isContainer}}
|
||||
{{{datatypeWithEnum}}} to{{{datatypeWithEnum}}}(const utility::string_t& value) const;
|
||||
const utility::string_t from{{{datatypeWithEnum}}}(const {{{datatypeWithEnum}}} value) const;
|
||||
{{/isContainer}}{{/isEnum}}{{/isInherited}}{{/vars}}
|
||||
|
||||
{{! SETTER AND GETTERS }}
|
||||
{{#vars}}{{^isInherited}}
|
||||
/// <summary>
|
||||
/// {{description}}
|
||||
/// </summary>
|
||||
{{#isContainer}}{{^isEnum}}
|
||||
{{{dataType}}} {{getter}}() const;
|
||||
{{/isEnum}}{{/isContainer}}{{^isContainer}}{{^isEnum}}
|
||||
{{{dataType}}} {{getter}}() const;
|
||||
{{/isEnum}}{{/isContainer}}
|
||||
{{#isEnum}}{{^isMap}}
|
||||
{{{datatypeWithEnum}}} {{getter}}() const;
|
||||
{{/isMap}}{{#isMap}}
|
||||
{{{dataType}}} {{getter}}() const;
|
||||
{{/isMap}}{{/isEnum}}
|
||||
bool {{nameInCamelCase}}IsSet() const;
|
||||
void unset{{name}}();
|
||||
{{#isPrimitiveType}}
|
||||
void {{setter}}({{{dataType}}} value);
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isEnum}}
|
||||
void {{setter}}(const {{{dataType}}}& value);
|
||||
{{/isPrimitiveType}}
|
||||
|
||||
{{/isInherited}}
|
||||
{{/vars}}
|
||||
{{/isEnum}}{{/isPrimitiveType}}{{#isEnum}}
|
||||
void {{setter}}(const {{^isMap}}{{{datatypeWithEnum}}}{{/isMap}}{{#isMap}}{{{dataType}}}{{/isMap}} value);
|
||||
{{/isEnum}}{{/isInherited}}{{/vars}}
|
||||
|
||||
protected:
|
||||
{{#vars}}
|
||||
{{^isInherited}}
|
||||
{{^isInherited}}{{^isEnum}}
|
||||
{{{dataType}}} m_{{name}};
|
||||
bool m_{{name}}IsSet;
|
||||
{{/isEnum}}{{#isEnum}}
|
||||
{{^isMap}}{{{datatypeWithEnum}}}{{/isMap}}{{#isMap}}{{{dataType}}}{{/isMap}} m_{{name}};
|
||||
{{/isEnum}}bool m_{{name}}IsSet;
|
||||
{{/isInherited}}
|
||||
{{/vars}}
|
||||
};
|
||||
|
@ -175,7 +175,6 @@ void {{classname}}::setValue({{classname}}::e{{classname}} const value)
|
||||
}
|
||||
|
||||
{{/isEnum}}
|
||||
|
||||
{{^isEnum}}
|
||||
|
||||
{{classname}}::{{classname}}()
|
||||
@ -183,6 +182,7 @@ void {{classname}}::setValue({{classname}}::e{{classname}} const value)
|
||||
{{#vars}}
|
||||
{{^isInherited}}
|
||||
{{^isContainer}}
|
||||
{{^isEnum}}
|
||||
{{#isPrimitiveType}}
|
||||
m_{{name}} = {{{defaultValue}}};
|
||||
{{/isPrimitiveType}}
|
||||
@ -194,6 +194,7 @@ void {{classname}}::setValue({{classname}}::e{{classname}} const value)
|
||||
m_{{name}} = {{{defaultValue}}};
|
||||
{{/isDateTime}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isEnum}}
|
||||
{{/isContainer}}
|
||||
m_{{name}}IsSet = false;
|
||||
{{/isInherited}}
|
||||
@ -212,15 +213,27 @@ void {{classname}}::validate()
|
||||
web::json::value {{classname}}::toJson() const
|
||||
{
|
||||
{{#parent}}
|
||||
web::json::value val = this->{{{.}}}::toJson();{{/parent}}
|
||||
web::json::value val = this->{{{.}}}::toJson();
|
||||
{{/parent}}
|
||||
{{^parent}}
|
||||
web::json::value val = web::json::value::object();
|
||||
{{/parent}}
|
||||
{{#vars}}{{^isInherited}}
|
||||
if(m_{{name}}IsSet)
|
||||
{
|
||||
{{#isEnum}}{{#isContainer}}{{#isArray}}
|
||||
{{{dataType}}} refVal = from{{{enumName}}}(m_{{name}});
|
||||
{{/isArray}}{{#isMap}}
|
||||
val[utility::conversions::to_string_t(U("{{baseName}}"))] = ModelBase::toJson(m_{{name}});
|
||||
}{{/isInherited}}{{/vars}}
|
||||
{{/isMap}}{{/isContainer}}{{^isContainer}}
|
||||
utility::string_t refVal = from{{{datatypeWithEnum}}}(m_{{name}});
|
||||
{{/isContainer}}{{^isMap}}val[utility::conversions::to_string_t(U("{{baseName}}"))] = ModelBase::toJson(refVal);
|
||||
{{/isMap}}{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
val[utility::conversions::to_string_t(U("{{baseName}}"))] = ModelBase::toJson(m_{{name}});
|
||||
{{/isEnum}}
|
||||
}
|
||||
{{/isInherited}}{{/vars}}
|
||||
|
||||
return val;
|
||||
}
|
||||
@ -239,7 +252,16 @@ bool {{classname}}::fromJson(const web::json::value& val)
|
||||
{
|
||||
{{{dataType}}} refVal_{{setter}};
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_{{setter}});
|
||||
{{^isEnum}}
|
||||
{{setter}}(refVal_{{setter}});
|
||||
{{/isEnum}}
|
||||
{{#isEnum}}{{#isContainer}}{{#isArray}}
|
||||
{{setter}}(to{{{enumName}}}(refVal_{{setter}}));
|
||||
{{/isArray}}{{#isMap}}
|
||||
{{setter}}(refVal_{{setter}});
|
||||
{{/isMap}}{{/isContainer}}{{^isContainer}}
|
||||
{{setter}}(to{{{datatypeWithEnum}}}(refVal_{{setter}}));
|
||||
{{/isContainer}}{{/isEnum}}
|
||||
}
|
||||
}{{/isInherited}}{{/vars}}
|
||||
return ok;
|
||||
@ -255,7 +277,16 @@ void {{classname}}::toMultipart(std::shared_ptr<MultipartFormData> multipart, co
|
||||
{{#vars}}
|
||||
if(m_{{name}}IsSet)
|
||||
{
|
||||
{{^isEnum}}
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("{{baseName}}")), m_{{name}}));
|
||||
{{/isEnum}}
|
||||
{{#isEnum}}{{#isContainer}}{{#isArray}}
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("{{baseName}}")), from{{{enumName}}}(m_{{name}})));
|
||||
{{/isArray}}{{#isMap}}
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("{{baseName}}")), m_{{name}}));
|
||||
{{/isMap}}{{/isContainer}}{{^isContainer}}
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("{{baseName}}")), from{{{datatypeWithEnum}}}(m_{{name}})));
|
||||
{{/isContainer}}{{/isEnum}}
|
||||
}
|
||||
{{/vars}}
|
||||
}
|
||||
@ -274,33 +305,93 @@ bool {{classname}}::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||
{
|
||||
{{{dataType}}} refVal_{{setter}};
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("{{baseName}}"))), refVal_{{setter}} );
|
||||
{{^isEnum}}
|
||||
{{setter}}(refVal_{{setter}});
|
||||
{{/isEnum}}
|
||||
{{#isEnum}}{{#isContainer}}{{#isArray}}
|
||||
{{setter}}(to{{{enumName}}}(refVal_{{setter}}));
|
||||
{{/isArray}}{{#isMap}}
|
||||
{{setter}}(refVal_{{setter}});
|
||||
{{/isMap}}{{/isContainer}}{{^isContainer}}
|
||||
{{setter}}(to{{{datatypeWithEnum}}}(refVal_{{setter}}));
|
||||
{{/isContainer}}{{/isEnum}}
|
||||
}
|
||||
{{/vars}}
|
||||
return ok;
|
||||
}
|
||||
|
||||
{{#vars}}
|
||||
{{^isInherited}}
|
||||
{{#isContainer}}
|
||||
{{{dataType}}}& {{classname}}::{{getter}}()
|
||||
{
|
||||
return m_{{name}};
|
||||
}
|
||||
{{#vars}}{{^isInherited}}{{#isEnum}}{{#isContainer}}
|
||||
{{classname}}::{{{enumName}}} {{classname}}::to{{{enumName}}}(const utility::string_t& value) const
|
||||
{{/isContainer}}{{^isContainer}}
|
||||
{{classname}}::{{{datatypeWithEnum}}} {{classname}}::to{{{datatypeWithEnum}}}(const {{dataType}}& value) const
|
||||
{{/isContainer}}
|
||||
{{^isContainer}}
|
||||
{
|
||||
{{#allowableValues}}{{#enumVars}}
|
||||
if (value == utility::conversions::to_string_t("{{value}}")) {
|
||||
return {{#isContainer}}{{{enumName}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}}::{{value}};
|
||||
}
|
||||
{{/enumVars}}{{/allowableValues}}
|
||||
throw std::invalid_argument("Invalid value for conversion to {{{datatypeWithEnum}}}");
|
||||
}
|
||||
|
||||
{{#isContainer}}
|
||||
const utility::string_t {{classname}}::from{{{enumName}}}(const {{{enumName}}} value) const
|
||||
{{/isContainer}}{{^isContainer}}
|
||||
const {{dataType}} {{classname}}::from{{{datatypeWithEnum}}}(const {{{datatypeWithEnum}}} value) const
|
||||
{{/isContainer}}
|
||||
{
|
||||
switch(value)
|
||||
{
|
||||
{{#allowableValues}}{{#enumVars}}
|
||||
case {{#isContainer}}{{{enumName}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}}::{{value}}: return utility::conversions::to_string_t("{{value}}");
|
||||
{{/enumVars}}{{/allowableValues}}
|
||||
}
|
||||
}
|
||||
|
||||
{{#isContainer}}{{#isArray}}
|
||||
{{{dataType}}} {{{classname}}}::from{{{enumName}}}(const {{{datatypeWithEnum}}}& value) const
|
||||
{
|
||||
{{{dataType}}} ret;
|
||||
for (auto it = value.begin(); it != value.end(); it++) {
|
||||
ret.push_back(from{{{enumName}}}(*it));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
{{{baseType}}}<{{classname}}::{{{enumName}}}> {{{classname}}}::to{{{enumName}}}(const {{{dataType}}}& value) const
|
||||
{
|
||||
{{{datatypeWithEnum}}} ret;
|
||||
for (auto it = value.begin(); it != value.end(); it++) {
|
||||
ret.push_back(to{{{enumName}}}(*it));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
{{/isArray}}{{/isContainer}}{{/isEnum}}{{/isInherited}}{{/vars}}
|
||||
|
||||
{{#vars}}{{^isInherited}}{{#isContainer}}{{^isEnum}}
|
||||
{{{dataType}}} {{classname}}::{{getter}}() const
|
||||
{
|
||||
return m_{{name}};
|
||||
}
|
||||
{{/isContainer}}
|
||||
{{/isEnum}}{{/isContainer}}{{^isContainer}}{{^isEnum}}
|
||||
{{{dataType}}} {{classname}}::{{getter}}() const
|
||||
{
|
||||
return m_{{name}};
|
||||
}
|
||||
{{/isEnum}}{{/isContainer}}{{#isEnum}}
|
||||
{{^isMap}}{{#isArray}}{{{baseType}}}<{{/isArray}}{{{classname}}}::{{{enumName}}}{{#isArray}}>{{/isArray}}{{/isMap}}{{#isMap}}{{{dataType}}}{{/isMap}} {{classname}}::{{getter}}() const
|
||||
{
|
||||
return m_{{name}};
|
||||
}
|
||||
{{/isEnum}}
|
||||
|
||||
{{#isPrimitiveType}}
|
||||
void {{classname}}::{{setter}}({{{dataType}}} value)
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isEnum}}
|
||||
void {{classname}}::{{setter}}(const {{{dataType}}}& value)
|
||||
{{/isPrimitiveType}}
|
||||
{{/isEnum}}{{/isPrimitiveType}}{{#isEnum}}
|
||||
void {{classname}}::{{setter}}(const {{^isMap}}{{{datatypeWithEnum}}}{{/isMap}}{{#isMap}}{{{dataType}}}{{/isMap}} value)
|
||||
{{/isEnum}}
|
||||
{
|
||||
m_{{name}} = value;
|
||||
m_{{name}}IsSet = true;
|
||||
@ -315,8 +406,7 @@ void {{classname}}::unset{{name}}()
|
||||
{
|
||||
m_{{name}}IsSet = false;
|
||||
}
|
||||
{{/isInherited}}
|
||||
{{/vars}}
|
||||
{{/isInherited}}{{/vars}}
|
||||
{{/isEnum}}
|
||||
{{/oneOf}}
|
||||
{{#modelNamespaceDeclarations}}
|
||||
|
@ -51,22 +51,31 @@ public:
|
||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
||||
bool 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();
|
||||
|
||||
@ -75,7 +84,10 @@ public:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
utility::string_t getMessage() const;
|
||||
|
||||
|
||||
bool messageIsSet() const;
|
||||
void unsetMessage();
|
||||
|
||||
@ -83,10 +95,13 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
int32_t m_Code;
|
||||
bool m_CodeIsSet;
|
||||
|
||||
utility::string_t m_Type;
|
||||
bool m_TypeIsSet;
|
||||
|
||||
utility::string_t m_Message;
|
||||
bool m_MessageIsSet;
|
||||
};
|
||||
|
@ -51,22 +51,31 @@ public:
|
||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
||||
bool 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();
|
||||
|
||||
@ -74,8 +83,10 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
int64_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
};
|
||||
|
@ -18,6 +18,7 @@
|
||||
#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateUserOrPet_request_H_
|
||||
#define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateUserOrPet_request_H_
|
||||
|
||||
#include <stdexcept>
|
||||
#include <variant>
|
||||
|
||||
#include "CppRestPetstoreClient/ModelBase.h"
|
||||
|
@ -18,6 +18,7 @@
|
||||
#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Order_H_
|
||||
#define ORG_OPENAPITOOLS_CLIENT_MODEL_Order_H_
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
#include "CppRestPetstoreClient/ModelBase.h"
|
||||
|
||||
@ -51,40 +52,67 @@ public:
|
||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
||||
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Order members
|
||||
|
||||
|
||||
enum class StatusEnum
|
||||
{
|
||||
placed,
|
||||
approved,
|
||||
delivered,
|
||||
|
||||
};
|
||||
/// <summary>
|
||||
/// Order Status
|
||||
/// </summary>
|
||||
|
||||
StatusEnum toStatusEnum(const utility::string_t& value) const;
|
||||
const utility::string_t fromStatusEnum(const StatusEnum value) const;
|
||||
|
||||
|
||||
|
||||
/// <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();
|
||||
|
||||
@ -93,33 +121,44 @@ public:
|
||||
/// <summary>
|
||||
/// Order Status
|
||||
/// </summary>
|
||||
utility::string_t getStatus() const;
|
||||
|
||||
|
||||
StatusEnum getStatus() const;
|
||||
|
||||
bool statusIsSet() const;
|
||||
void unsetStatus();
|
||||
|
||||
void setStatus(const utility::string_t& value);
|
||||
void setStatus(const StatusEnum 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;
|
||||
|
||||
StatusEnum m_Status;
|
||||
bool m_StatusIsSet;
|
||||
|
||||
bool m_Complete;
|
||||
bool m_CompleteIsSet;
|
||||
};
|
||||
|
@ -18,6 +18,7 @@
|
||||
#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Pet_H_
|
||||
#define ORG_OPENAPITOOLS_CLIENT_MODEL_Pet_H_
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
#include "CppRestPetstoreClient/ModelBase.h"
|
||||
|
||||
@ -56,22 +57,45 @@ public:
|
||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
||||
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Pet members
|
||||
|
||||
|
||||
enum class StatusEnum
|
||||
{
|
||||
available,
|
||||
pending,
|
||||
sold,
|
||||
|
||||
};
|
||||
/// <summary>
|
||||
/// pet status in the store
|
||||
/// </summary>
|
||||
|
||||
StatusEnum toStatusEnum(const utility::string_t& value) const;
|
||||
const utility::string_t fromStatusEnum(const StatusEnum value) const;
|
||||
|
||||
|
||||
|
||||
/// <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();
|
||||
|
||||
@ -80,7 +104,10 @@ public:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
utility::string_t getName() const;
|
||||
|
||||
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
|
||||
@ -89,7 +116,10 @@ public:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::vector<utility::string_t>& getPhotoUrls();
|
||||
|
||||
std::vector<utility::string_t> getPhotoUrls() const;
|
||||
|
||||
|
||||
bool photoUrlsIsSet() const;
|
||||
void unsetPhotoUrls();
|
||||
|
||||
@ -98,7 +128,10 @@ public:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::vector<std::shared_ptr<Tag>>& getTags();
|
||||
|
||||
std::vector<std::shared_ptr<Tag>> getTags() const;
|
||||
|
||||
|
||||
bool tagsIsSet() const;
|
||||
void unsetTags();
|
||||
|
||||
@ -107,25 +140,34 @@ public:
|
||||
/// <summary>
|
||||
/// pet status in the store
|
||||
/// </summary>
|
||||
utility::string_t getStatus() const;
|
||||
|
||||
|
||||
StatusEnum getStatus() const;
|
||||
|
||||
bool statusIsSet() const;
|
||||
void unsetStatus();
|
||||
|
||||
void setStatus(const utility::string_t& value);
|
||||
void setStatus(const StatusEnum value);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
int64_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
|
||||
std::shared_ptr<Category> m_Category;
|
||||
bool m_CategoryIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
|
||||
std::vector<utility::string_t> m_PhotoUrls;
|
||||
bool m_PhotoUrlsIsSet;
|
||||
|
||||
std::vector<std::shared_ptr<Tag>> m_Tags;
|
||||
bool m_TagsIsSet;
|
||||
utility::string_t m_Status;
|
||||
|
||||
StatusEnum m_Status;
|
||||
bool m_StatusIsSet;
|
||||
};
|
||||
|
||||
|
@ -54,13 +54,20 @@ public:
|
||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
||||
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// SchemaWithSet members
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// pedigree and other certificates
|
||||
/// </summary>
|
||||
std::set<utility::string_t>& getCertificates();
|
||||
|
||||
std::set<utility::string_t> getCertificates() const;
|
||||
|
||||
|
||||
bool certificatesIsSet() const;
|
||||
void unsetCertificates();
|
||||
|
||||
@ -69,7 +76,10 @@ public:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
std::shared_ptr<SchemaWithSet_vaccinationBook> getVaccinationBook() const;
|
||||
|
||||
|
||||
bool vaccinationBookIsSet() const;
|
||||
void unsetVaccinationBook();
|
||||
|
||||
@ -77,8 +87,10 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
std::set<utility::string_t> m_Certificates;
|
||||
bool m_CertificatesIsSet;
|
||||
|
||||
std::shared_ptr<SchemaWithSet_vaccinationBook> m_VaccinationBook;
|
||||
bool m_VaccinationBookIsSet;
|
||||
};
|
||||
|
@ -53,13 +53,20 @@ public:
|
||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
||||
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// SchemaWithSet_vaccinationBook members
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::set<std::shared_ptr<Vaccine>>& getVaccines();
|
||||
|
||||
std::set<std::shared_ptr<Vaccine>> getVaccines() const;
|
||||
|
||||
|
||||
bool vaccinesIsSet() const;
|
||||
void unsetVaccines();
|
||||
|
||||
@ -67,6 +74,7 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
std::set<std::shared_ptr<Vaccine>> m_Vaccines;
|
||||
bool m_VaccinesIsSet;
|
||||
};
|
||||
|
@ -51,22 +51,31 @@ public:
|
||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
||||
bool 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();
|
||||
|
||||
@ -74,8 +83,10 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
int64_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
};
|
||||
|
@ -51,22 +51,31 @@ public:
|
||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
||||
bool 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();
|
||||
|
||||
@ -75,7 +84,10 @@ public:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
utility::string_t getFirstName() const;
|
||||
|
||||
|
||||
bool firstNameIsSet() const;
|
||||
void unsetFirstName();
|
||||
|
||||
@ -84,7 +96,10 @@ public:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
utility::string_t getLastName() const;
|
||||
|
||||
|
||||
bool lastNameIsSet() const;
|
||||
void unsetLastName();
|
||||
|
||||
@ -93,7 +108,10 @@ public:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
utility::string_t getEmail() const;
|
||||
|
||||
|
||||
bool emailIsSet() const;
|
||||
void unsetEmail();
|
||||
|
||||
@ -102,7 +120,10 @@ public:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
utility::string_t getPassword() const;
|
||||
|
||||
|
||||
bool passwordIsSet() const;
|
||||
void unsetPassword();
|
||||
|
||||
@ -111,7 +132,10 @@ public:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
utility::string_t getPhone() const;
|
||||
|
||||
|
||||
bool phoneIsSet() const;
|
||||
void unsetPhone();
|
||||
|
||||
@ -120,28 +144,38 @@ public:
|
||||
/// <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;
|
||||
};
|
||||
|
@ -51,13 +51,20 @@ public:
|
||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
||||
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Vaccine members
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// vaccination date
|
||||
/// </summary>
|
||||
|
||||
std::shared_ptr<AnyType> getDate() const;
|
||||
|
||||
|
||||
bool dateIsSet() const;
|
||||
void unsetdate();
|
||||
|
||||
@ -66,16 +73,20 @@ public:
|
||||
/// <summary>
|
||||
/// true if a booster is still needed to complete the vaccination
|
||||
/// </summary>
|
||||
|
||||
bool isBoosterRequired() const;
|
||||
|
||||
|
||||
bool boosterRequiredIsSet() const;
|
||||
void unsetBoosterRequired();
|
||||
|
||||
void setBoosterRequired(bool value);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
std::shared_ptr<AnyType> m_date;
|
||||
bool m_dateIsSet;
|
||||
|
||||
bool m_BoosterRequired;
|
||||
bool m_BoosterRequiredIsSet;
|
||||
};
|
||||
|
@ -19,7 +19,6 @@ namespace client {
|
||||
namespace model {
|
||||
|
||||
|
||||
|
||||
ApiResponse::ApiResponse()
|
||||
{
|
||||
m_Code = 0;
|
||||
@ -41,22 +40,27 @@ void ApiResponse::validate()
|
||||
|
||||
web::json::value ApiResponse::toJson() const
|
||||
{
|
||||
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_CodeIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("code"))] = ModelBase::toJson(m_Code);
|
||||
}
|
||||
|
||||
if(m_TypeIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("type"))] = ModelBase::toJson(m_Type);
|
||||
}
|
||||
|
||||
if(m_MessageIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("message"))] = ModelBase::toJson(m_Message);
|
||||
}
|
||||
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
@ -72,6 +76,7 @@ bool ApiResponse::fromJson(const web::json::value& val)
|
||||
int32_t refVal_setCode;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setCode);
|
||||
setCode(refVal_setCode);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("type"))))
|
||||
@ -82,6 +87,7 @@ bool ApiResponse::fromJson(const web::json::value& val)
|
||||
utility::string_t refVal_setType;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setType);
|
||||
setType(refVal_setType);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("message"))))
|
||||
@ -92,6 +98,7 @@ bool ApiResponse::fromJson(const web::json::value& val)
|
||||
utility::string_t refVal_setMessage;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setMessage);
|
||||
setMessage(refVal_setMessage);
|
||||
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
@ -107,14 +114,17 @@ void ApiResponse::toMultipart(std::shared_ptr<MultipartFormData> multipart, cons
|
||||
if(m_CodeIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("code")), m_Code));
|
||||
|
||||
}
|
||||
if(m_TypeIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("type")), m_Type));
|
||||
|
||||
}
|
||||
if(m_MessageIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("message")), m_Message));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -132,22 +142,28 @@ bool ApiResponse::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, co
|
||||
int32_t refVal_setCode;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("code"))), refVal_setCode );
|
||||
setCode(refVal_setCode);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("type"))))
|
||||
{
|
||||
utility::string_t refVal_setType;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("type"))), refVal_setType );
|
||||
setType(refVal_setType);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("message"))))
|
||||
{
|
||||
utility::string_t refVal_setMessage;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("message"))), refVal_setMessage );
|
||||
setMessage(refVal_setMessage);
|
||||
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int32_t ApiResponse::getCode() const
|
||||
{
|
||||
return m_Code;
|
||||
@ -168,11 +184,13 @@ void ApiResponse::unsetCode()
|
||||
{
|
||||
m_CodeIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t ApiResponse::getType() const
|
||||
{
|
||||
return m_Type;
|
||||
}
|
||||
|
||||
|
||||
void ApiResponse::setType(const utility::string_t& value)
|
||||
{
|
||||
m_Type = value;
|
||||
@ -188,11 +206,13 @@ void ApiResponse::unsetType()
|
||||
{
|
||||
m_TypeIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t ApiResponse::getMessage() const
|
||||
{
|
||||
return m_Message;
|
||||
}
|
||||
|
||||
|
||||
void ApiResponse::setMessage(const utility::string_t& value)
|
||||
{
|
||||
m_Message = value;
|
||||
@ -208,6 +228,7 @@ void ApiResponse::unsetMessage()
|
||||
{
|
||||
m_MessageIsSet = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ namespace client {
|
||||
namespace model {
|
||||
|
||||
|
||||
|
||||
Category::Category()
|
||||
{
|
||||
m_Id = 0L;
|
||||
@ -39,18 +38,21 @@ void Category::validate()
|
||||
|
||||
web::json::value Category::toJson() const
|
||||
{
|
||||
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_IdIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id);
|
||||
}
|
||||
|
||||
if(m_NameIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name);
|
||||
}
|
||||
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
@ -66,6 +68,7 @@ bool Category::fromJson(const web::json::value& val)
|
||||
int64_t refVal_setId;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setId);
|
||||
setId(refVal_setId);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("name"))))
|
||||
@ -76,6 +79,7 @@ bool Category::fromJson(const web::json::value& val)
|
||||
utility::string_t refVal_setName;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setName);
|
||||
setName(refVal_setName);
|
||||
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
@ -91,10 +95,12 @@ void Category::toMultipart(std::shared_ptr<MultipartFormData> multipart, const u
|
||||
if(m_IdIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id));
|
||||
|
||||
}
|
||||
if(m_NameIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,16 +118,21 @@ bool Category::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const
|
||||
int64_t refVal_setId;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId );
|
||||
setId(refVal_setId);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("name"))))
|
||||
{
|
||||
utility::string_t refVal_setName;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName );
|
||||
setName(refVal_setName);
|
||||
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int64_t Category::getId() const
|
||||
{
|
||||
return m_Id;
|
||||
@ -142,11 +153,13 @@ void Category::unsetId()
|
||||
{
|
||||
m_IdIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t Category::getName() const
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
|
||||
|
||||
void Category::setName(const utility::string_t& value)
|
||||
{
|
||||
m_Name = value;
|
||||
@ -162,6 +175,7 @@ void Category::unsetName()
|
||||
{
|
||||
m_NameIsSet = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ namespace client {
|
||||
namespace model {
|
||||
|
||||
|
||||
|
||||
Order::Order()
|
||||
{
|
||||
m_Id = 0L;
|
||||
@ -30,7 +29,6 @@ Order::Order()
|
||||
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;
|
||||
@ -47,34 +45,47 @@ void Order::validate()
|
||||
|
||||
web::json::value Order::toJson() const
|
||||
{
|
||||
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_IdIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id);
|
||||
}
|
||||
|
||||
if(m_PetIdIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("petId"))] = ModelBase::toJson(m_PetId);
|
||||
}
|
||||
|
||||
if(m_QuantityIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("quantity"))] = ModelBase::toJson(m_Quantity);
|
||||
}
|
||||
|
||||
if(m_ShipDateIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("shipDate"))] = ModelBase::toJson(m_ShipDate);
|
||||
}
|
||||
|
||||
if(m_StatusIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t(U("status"))] = ModelBase::toJson(m_Status);
|
||||
|
||||
utility::string_t refVal = fromStatusEnum(m_Status);
|
||||
val[utility::conversions::to_string_t(U("status"))] = ModelBase::toJson(refVal);
|
||||
|
||||
}
|
||||
|
||||
if(m_CompleteIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("complete"))] = ModelBase::toJson(m_Complete);
|
||||
}
|
||||
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
@ -90,6 +101,7 @@ bool Order::fromJson(const web::json::value& val)
|
||||
int64_t refVal_setId;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setId);
|
||||
setId(refVal_setId);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("petId"))))
|
||||
@ -100,6 +112,7 @@ bool Order::fromJson(const web::json::value& val)
|
||||
int64_t refVal_setPetId;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setPetId);
|
||||
setPetId(refVal_setPetId);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("quantity"))))
|
||||
@ -110,6 +123,7 @@ bool Order::fromJson(const web::json::value& val)
|
||||
int32_t refVal_setQuantity;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setQuantity);
|
||||
setQuantity(refVal_setQuantity);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("shipDate"))))
|
||||
@ -120,6 +134,7 @@ bool Order::fromJson(const web::json::value& val)
|
||||
utility::datetime refVal_setShipDate;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setShipDate);
|
||||
setShipDate(refVal_setShipDate);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("status"))))
|
||||
@ -129,7 +144,9 @@ bool Order::fromJson(const web::json::value& val)
|
||||
{
|
||||
utility::string_t refVal_setStatus;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setStatus);
|
||||
setStatus(refVal_setStatus);
|
||||
|
||||
setStatus(toStatusEnum(refVal_setStatus));
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("complete"))))
|
||||
@ -140,6 +157,7 @@ bool Order::fromJson(const web::json::value& val)
|
||||
bool refVal_setComplete;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setComplete);
|
||||
setComplete(refVal_setComplete);
|
||||
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
@ -155,26 +173,33 @@ void Order::toMultipart(std::shared_ptr<MultipartFormData> multipart, const util
|
||||
if(m_IdIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id));
|
||||
|
||||
}
|
||||
if(m_PetIdIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("petId")), m_PetId));
|
||||
|
||||
}
|
||||
if(m_QuantityIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("quantity")), m_Quantity));
|
||||
|
||||
}
|
||||
if(m_ShipDateIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("shipDate")), m_ShipDate));
|
||||
|
||||
}
|
||||
if(m_StatusIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("status")), m_Status));
|
||||
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("status")), fromStatusEnum(m_Status)));
|
||||
|
||||
}
|
||||
if(m_CompleteIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("complete")), m_Complete));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -192,40 +217,84 @@ bool Order::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const ut
|
||||
int64_t refVal_setId;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId );
|
||||
setId(refVal_setId);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("petId"))))
|
||||
{
|
||||
int64_t refVal_setPetId;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("petId"))), refVal_setPetId );
|
||||
setPetId(refVal_setPetId);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("quantity"))))
|
||||
{
|
||||
int32_t refVal_setQuantity;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("quantity"))), refVal_setQuantity );
|
||||
setQuantity(refVal_setQuantity);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("shipDate"))))
|
||||
{
|
||||
utility::datetime refVal_setShipDate;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("shipDate"))), refVal_setShipDate );
|
||||
setShipDate(refVal_setShipDate);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("status"))))
|
||||
{
|
||||
utility::string_t refVal_setStatus;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("status"))), refVal_setStatus );
|
||||
setStatus(refVal_setStatus);
|
||||
|
||||
setStatus(toStatusEnum(refVal_setStatus));
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("complete"))))
|
||||
{
|
||||
bool refVal_setComplete;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("complete"))), refVal_setComplete );
|
||||
setComplete(refVal_setComplete);
|
||||
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
Order::StatusEnum Order::toStatusEnum(const utility::string_t& value) const
|
||||
{
|
||||
|
||||
if (value == utility::conversions::to_string_t("placed")) {
|
||||
return StatusEnum::placed;
|
||||
}
|
||||
|
||||
if (value == utility::conversions::to_string_t("approved")) {
|
||||
return StatusEnum::approved;
|
||||
}
|
||||
|
||||
if (value == utility::conversions::to_string_t("delivered")) {
|
||||
return StatusEnum::delivered;
|
||||
}
|
||||
|
||||
throw std::invalid_argument("Invalid value for conversion to StatusEnum");
|
||||
}
|
||||
|
||||
|
||||
const utility::string_t Order::fromStatusEnum(const StatusEnum value) const
|
||||
{
|
||||
switch(value)
|
||||
{
|
||||
|
||||
case StatusEnum::placed: return utility::conversions::to_string_t("placed");
|
||||
|
||||
case StatusEnum::approved: return utility::conversions::to_string_t("approved");
|
||||
|
||||
case StatusEnum::delivered: return utility::conversions::to_string_t("delivered");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int64_t Order::getId() const
|
||||
{
|
||||
return m_Id;
|
||||
@ -246,6 +315,7 @@ void Order::unsetId()
|
||||
{
|
||||
m_IdIsSet = false;
|
||||
}
|
||||
|
||||
int64_t Order::getPetId() const
|
||||
{
|
||||
return m_PetId;
|
||||
@ -266,6 +336,7 @@ void Order::unsetPetId()
|
||||
{
|
||||
m_PetIdIsSet = false;
|
||||
}
|
||||
|
||||
int32_t Order::getQuantity() const
|
||||
{
|
||||
return m_Quantity;
|
||||
@ -286,11 +357,13 @@ void Order::unsetQuantity()
|
||||
{
|
||||
m_QuantityIsSet = false;
|
||||
}
|
||||
|
||||
utility::datetime Order::getShipDate() const
|
||||
{
|
||||
return m_ShipDate;
|
||||
}
|
||||
|
||||
|
||||
void Order::setShipDate(const utility::datetime& value)
|
||||
{
|
||||
m_ShipDate = value;
|
||||
@ -306,12 +379,14 @@ void Order::unsetShipDate()
|
||||
{
|
||||
m_ShipDateIsSet = false;
|
||||
}
|
||||
utility::string_t Order::getStatus() const
|
||||
|
||||
Order::StatusEnum Order::getStatus() const
|
||||
{
|
||||
return m_Status;
|
||||
}
|
||||
|
||||
void Order::setStatus(const utility::string_t& value)
|
||||
|
||||
void Order::setStatus(const StatusEnum value)
|
||||
{
|
||||
m_Status = value;
|
||||
m_StatusIsSet = true;
|
||||
@ -326,6 +401,7 @@ void Order::unsetStatus()
|
||||
{
|
||||
m_StatusIsSet = false;
|
||||
}
|
||||
|
||||
bool Order::isComplete() const
|
||||
{
|
||||
return m_Complete;
|
||||
@ -346,6 +422,7 @@ void Order::unsetComplete()
|
||||
{
|
||||
m_CompleteIsSet = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ namespace client {
|
||||
namespace model {
|
||||
|
||||
|
||||
|
||||
Pet::Pet()
|
||||
{
|
||||
m_Id = 0L;
|
||||
@ -29,7 +28,6 @@ Pet::Pet()
|
||||
m_NameIsSet = false;
|
||||
m_PhotoUrlsIsSet = false;
|
||||
m_TagsIsSet = false;
|
||||
m_Status = utility::conversions::to_string_t("");
|
||||
m_StatusIsSet = false;
|
||||
}
|
||||
|
||||
@ -44,34 +42,47 @@ void Pet::validate()
|
||||
|
||||
web::json::value Pet::toJson() const
|
||||
{
|
||||
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_IdIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id);
|
||||
}
|
||||
|
||||
if(m_CategoryIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("category"))] = ModelBase::toJson(m_Category);
|
||||
}
|
||||
|
||||
if(m_NameIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name);
|
||||
}
|
||||
|
||||
if(m_PhotoUrlsIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("photoUrls"))] = ModelBase::toJson(m_PhotoUrls);
|
||||
}
|
||||
|
||||
if(m_TagsIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("tags"))] = ModelBase::toJson(m_Tags);
|
||||
}
|
||||
|
||||
if(m_StatusIsSet)
|
||||
{
|
||||
val[utility::conversions::to_string_t(U("status"))] = ModelBase::toJson(m_Status);
|
||||
|
||||
utility::string_t refVal = fromStatusEnum(m_Status);
|
||||
val[utility::conversions::to_string_t(U("status"))] = ModelBase::toJson(refVal);
|
||||
|
||||
}
|
||||
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
@ -87,6 +98,7 @@ bool Pet::fromJson(const web::json::value& val)
|
||||
int64_t refVal_setId;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setId);
|
||||
setId(refVal_setId);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("category"))))
|
||||
@ -97,6 +109,7 @@ bool Pet::fromJson(const web::json::value& val)
|
||||
std::shared_ptr<Category> refVal_setCategory;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setCategory);
|
||||
setCategory(refVal_setCategory);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("name"))))
|
||||
@ -107,6 +120,7 @@ bool Pet::fromJson(const web::json::value& val)
|
||||
utility::string_t refVal_setName;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setName);
|
||||
setName(refVal_setName);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("photoUrls"))))
|
||||
@ -117,6 +131,7 @@ bool Pet::fromJson(const web::json::value& val)
|
||||
std::vector<utility::string_t> refVal_setPhotoUrls;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setPhotoUrls);
|
||||
setPhotoUrls(refVal_setPhotoUrls);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("tags"))))
|
||||
@ -127,6 +142,7 @@ bool Pet::fromJson(const web::json::value& val)
|
||||
std::vector<std::shared_ptr<Tag>> refVal_setTags;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setTags);
|
||||
setTags(refVal_setTags);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("status"))))
|
||||
@ -136,7 +152,9 @@ bool Pet::fromJson(const web::json::value& val)
|
||||
{
|
||||
utility::string_t refVal_setStatus;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setStatus);
|
||||
setStatus(refVal_setStatus);
|
||||
|
||||
setStatus(toStatusEnum(refVal_setStatus));
|
||||
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
@ -152,26 +170,33 @@ void Pet::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utilit
|
||||
if(m_IdIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id));
|
||||
|
||||
}
|
||||
if(m_CategoryIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("category")), m_Category));
|
||||
|
||||
}
|
||||
if(m_NameIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name));
|
||||
|
||||
}
|
||||
if(m_PhotoUrlsIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("photoUrls")), m_PhotoUrls));
|
||||
|
||||
}
|
||||
if(m_TagsIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("tags")), m_Tags));
|
||||
|
||||
}
|
||||
if(m_StatusIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("status")), m_Status));
|
||||
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("status")), fromStatusEnum(m_Status)));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -189,40 +214,84 @@ bool Pet::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const util
|
||||
int64_t refVal_setId;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId );
|
||||
setId(refVal_setId);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("category"))))
|
||||
{
|
||||
std::shared_ptr<Category> refVal_setCategory;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("category"))), refVal_setCategory );
|
||||
setCategory(refVal_setCategory);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("name"))))
|
||||
{
|
||||
utility::string_t refVal_setName;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName );
|
||||
setName(refVal_setName);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("photoUrls"))))
|
||||
{
|
||||
std::vector<utility::string_t> refVal_setPhotoUrls;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("photoUrls"))), refVal_setPhotoUrls );
|
||||
setPhotoUrls(refVal_setPhotoUrls);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("tags"))))
|
||||
{
|
||||
std::vector<std::shared_ptr<Tag>> refVal_setTags;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("tags"))), refVal_setTags );
|
||||
setTags(refVal_setTags);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("status"))))
|
||||
{
|
||||
utility::string_t refVal_setStatus;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("status"))), refVal_setStatus );
|
||||
setStatus(refVal_setStatus);
|
||||
|
||||
setStatus(toStatusEnum(refVal_setStatus));
|
||||
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
Pet::StatusEnum Pet::toStatusEnum(const utility::string_t& value) const
|
||||
{
|
||||
|
||||
if (value == utility::conversions::to_string_t("available")) {
|
||||
return StatusEnum::available;
|
||||
}
|
||||
|
||||
if (value == utility::conversions::to_string_t("pending")) {
|
||||
return StatusEnum::pending;
|
||||
}
|
||||
|
||||
if (value == utility::conversions::to_string_t("sold")) {
|
||||
return StatusEnum::sold;
|
||||
}
|
||||
|
||||
throw std::invalid_argument("Invalid value for conversion to StatusEnum");
|
||||
}
|
||||
|
||||
|
||||
const utility::string_t Pet::fromStatusEnum(const StatusEnum value) const
|
||||
{
|
||||
switch(value)
|
||||
{
|
||||
|
||||
case StatusEnum::available: return utility::conversions::to_string_t("available");
|
||||
|
||||
case StatusEnum::pending: return utility::conversions::to_string_t("pending");
|
||||
|
||||
case StatusEnum::sold: return utility::conversions::to_string_t("sold");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int64_t Pet::getId() const
|
||||
{
|
||||
return m_Id;
|
||||
@ -243,11 +312,13 @@ void Pet::unsetId()
|
||||
{
|
||||
m_IdIsSet = false;
|
||||
}
|
||||
|
||||
std::shared_ptr<Category> Pet::getCategory() const
|
||||
{
|
||||
return m_Category;
|
||||
}
|
||||
|
||||
|
||||
void Pet::setCategory(const std::shared_ptr<Category>& value)
|
||||
{
|
||||
m_Category = value;
|
||||
@ -263,11 +334,13 @@ void Pet::unsetCategory()
|
||||
{
|
||||
m_CategoryIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t Pet::getName() const
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
|
||||
|
||||
void Pet::setName(const utility::string_t& value)
|
||||
{
|
||||
m_Name = value;
|
||||
@ -283,11 +356,13 @@ void Pet::unsetName()
|
||||
{
|
||||
m_NameIsSet = false;
|
||||
}
|
||||
std::vector<utility::string_t>& Pet::getPhotoUrls()
|
||||
|
||||
std::vector<utility::string_t> Pet::getPhotoUrls() const
|
||||
{
|
||||
return m_PhotoUrls;
|
||||
}
|
||||
|
||||
|
||||
void Pet::setPhotoUrls(const std::vector<utility::string_t>& value)
|
||||
{
|
||||
m_PhotoUrls = value;
|
||||
@ -303,11 +378,13 @@ void Pet::unsetPhotoUrls()
|
||||
{
|
||||
m_PhotoUrlsIsSet = false;
|
||||
}
|
||||
std::vector<std::shared_ptr<Tag>>& Pet::getTags()
|
||||
|
||||
std::vector<std::shared_ptr<Tag>> Pet::getTags() const
|
||||
{
|
||||
return m_Tags;
|
||||
}
|
||||
|
||||
|
||||
void Pet::setTags(const std::vector<std::shared_ptr<Tag>>& value)
|
||||
{
|
||||
m_Tags = value;
|
||||
@ -323,12 +400,14 @@ void Pet::unsetTags()
|
||||
{
|
||||
m_TagsIsSet = false;
|
||||
}
|
||||
utility::string_t Pet::getStatus() const
|
||||
|
||||
Pet::StatusEnum Pet::getStatus() const
|
||||
{
|
||||
return m_Status;
|
||||
}
|
||||
|
||||
void Pet::setStatus(const utility::string_t& value)
|
||||
|
||||
void Pet::setStatus(const StatusEnum value)
|
||||
{
|
||||
m_Status = value;
|
||||
m_StatusIsSet = true;
|
||||
@ -343,6 +422,7 @@ void Pet::unsetStatus()
|
||||
{
|
||||
m_StatusIsSet = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ namespace client {
|
||||
namespace model {
|
||||
|
||||
|
||||
|
||||
SchemaWithSet::SchemaWithSet()
|
||||
{
|
||||
m_CertificatesIsSet = false;
|
||||
@ -37,18 +36,21 @@ void SchemaWithSet::validate()
|
||||
|
||||
web::json::value SchemaWithSet::toJson() const
|
||||
{
|
||||
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_CertificatesIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("certificates"))] = ModelBase::toJson(m_Certificates);
|
||||
}
|
||||
|
||||
if(m_VaccinationBookIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("vaccinationBook"))] = ModelBase::toJson(m_VaccinationBook);
|
||||
}
|
||||
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
@ -64,6 +66,7 @@ bool SchemaWithSet::fromJson(const web::json::value& val)
|
||||
std::set<utility::string_t> refVal_setCertificates;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setCertificates);
|
||||
setCertificates(refVal_setCertificates);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("vaccinationBook"))))
|
||||
@ -74,6 +77,7 @@ bool SchemaWithSet::fromJson(const web::json::value& val)
|
||||
std::shared_ptr<SchemaWithSet_vaccinationBook> refVal_setVaccinationBook;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setVaccinationBook);
|
||||
setVaccinationBook(refVal_setVaccinationBook);
|
||||
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
@ -89,10 +93,12 @@ void SchemaWithSet::toMultipart(std::shared_ptr<MultipartFormData> multipart, co
|
||||
if(m_CertificatesIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("certificates")), m_Certificates));
|
||||
|
||||
}
|
||||
if(m_VaccinationBookIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("vaccinationBook")), m_VaccinationBook));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,21 +116,27 @@ bool SchemaWithSet::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||
std::set<utility::string_t> refVal_setCertificates;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("certificates"))), refVal_setCertificates );
|
||||
setCertificates(refVal_setCertificates);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("vaccinationBook"))))
|
||||
{
|
||||
std::shared_ptr<SchemaWithSet_vaccinationBook> refVal_setVaccinationBook;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("vaccinationBook"))), refVal_setVaccinationBook );
|
||||
setVaccinationBook(refVal_setVaccinationBook);
|
||||
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
std::set<utility::string_t>& SchemaWithSet::getCertificates()
|
||||
|
||||
|
||||
|
||||
std::set<utility::string_t> SchemaWithSet::getCertificates() const
|
||||
{
|
||||
return m_Certificates;
|
||||
}
|
||||
|
||||
|
||||
void SchemaWithSet::setCertificates(const std::set<utility::string_t>& value)
|
||||
{
|
||||
m_Certificates = value;
|
||||
@ -140,11 +152,13 @@ void SchemaWithSet::unsetCertificates()
|
||||
{
|
||||
m_CertificatesIsSet = false;
|
||||
}
|
||||
|
||||
std::shared_ptr<SchemaWithSet_vaccinationBook> SchemaWithSet::getVaccinationBook() const
|
||||
{
|
||||
return m_VaccinationBook;
|
||||
}
|
||||
|
||||
|
||||
void SchemaWithSet::setVaccinationBook(const std::shared_ptr<SchemaWithSet_vaccinationBook>& value)
|
||||
{
|
||||
m_VaccinationBook = value;
|
||||
@ -160,6 +174,7 @@ void SchemaWithSet::unsetVaccinationBook()
|
||||
{
|
||||
m_VaccinationBookIsSet = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ namespace client {
|
||||
namespace model {
|
||||
|
||||
|
||||
|
||||
SchemaWithSet_vaccinationBook::SchemaWithSet_vaccinationBook()
|
||||
{
|
||||
m_VaccinesIsSet = false;
|
||||
@ -36,14 +35,15 @@ void SchemaWithSet_vaccinationBook::validate()
|
||||
|
||||
web::json::value SchemaWithSet_vaccinationBook::toJson() const
|
||||
{
|
||||
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_VaccinesIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("vaccines"))] = ModelBase::toJson(m_Vaccines);
|
||||
}
|
||||
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
@ -59,6 +59,7 @@ bool SchemaWithSet_vaccinationBook::fromJson(const web::json::value& val)
|
||||
std::set<std::shared_ptr<Vaccine>> refVal_setVaccines;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setVaccines);
|
||||
setVaccines(refVal_setVaccines);
|
||||
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
@ -74,6 +75,7 @@ void SchemaWithSet_vaccinationBook::toMultipart(std::shared_ptr<MultipartFormDat
|
||||
if(m_VaccinesIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("vaccines")), m_Vaccines));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -91,15 +93,20 @@ bool SchemaWithSet_vaccinationBook::fromMultiPart(std::shared_ptr<MultipartFormD
|
||||
std::set<std::shared_ptr<Vaccine>> refVal_setVaccines;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("vaccines"))), refVal_setVaccines );
|
||||
setVaccines(refVal_setVaccines);
|
||||
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
std::set<std::shared_ptr<Vaccine>>& SchemaWithSet_vaccinationBook::getVaccines()
|
||||
|
||||
|
||||
|
||||
std::set<std::shared_ptr<Vaccine>> SchemaWithSet_vaccinationBook::getVaccines() const
|
||||
{
|
||||
return m_Vaccines;
|
||||
}
|
||||
|
||||
|
||||
void SchemaWithSet_vaccinationBook::setVaccines(const std::set<std::shared_ptr<Vaccine>>& value)
|
||||
{
|
||||
m_Vaccines = value;
|
||||
@ -115,6 +122,7 @@ void SchemaWithSet_vaccinationBook::unsetVaccines()
|
||||
{
|
||||
m_VaccinesIsSet = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ namespace client {
|
||||
namespace model {
|
||||
|
||||
|
||||
|
||||
Tag::Tag()
|
||||
{
|
||||
m_Id = 0L;
|
||||
@ -39,18 +38,21 @@ void Tag::validate()
|
||||
|
||||
web::json::value Tag::toJson() const
|
||||
{
|
||||
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_IdIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id);
|
||||
}
|
||||
|
||||
if(m_NameIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name);
|
||||
}
|
||||
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
@ -66,6 +68,7 @@ bool Tag::fromJson(const web::json::value& val)
|
||||
int64_t refVal_setId;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setId);
|
||||
setId(refVal_setId);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("name"))))
|
||||
@ -76,6 +79,7 @@ bool Tag::fromJson(const web::json::value& val)
|
||||
utility::string_t refVal_setName;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setName);
|
||||
setName(refVal_setName);
|
||||
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
@ -91,10 +95,12 @@ void Tag::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utilit
|
||||
if(m_IdIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id));
|
||||
|
||||
}
|
||||
if(m_NameIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,16 +118,21 @@ bool Tag::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const util
|
||||
int64_t refVal_setId;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId );
|
||||
setId(refVal_setId);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("name"))))
|
||||
{
|
||||
utility::string_t refVal_setName;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName );
|
||||
setName(refVal_setName);
|
||||
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int64_t Tag::getId() const
|
||||
{
|
||||
return m_Id;
|
||||
@ -142,11 +153,13 @@ void Tag::unsetId()
|
||||
{
|
||||
m_IdIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t Tag::getName() const
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
|
||||
|
||||
void Tag::setName(const utility::string_t& value)
|
||||
{
|
||||
m_Name = value;
|
||||
@ -162,6 +175,7 @@ void Tag::unsetName()
|
||||
{
|
||||
m_NameIsSet = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ namespace client {
|
||||
namespace model {
|
||||
|
||||
|
||||
|
||||
User::User()
|
||||
{
|
||||
m_Id = 0L;
|
||||
@ -51,42 +50,57 @@ void User::validate()
|
||||
|
||||
web::json::value User::toJson() const
|
||||
{
|
||||
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_IdIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id);
|
||||
}
|
||||
|
||||
if(m_UsernameIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("username"))] = ModelBase::toJson(m_Username);
|
||||
}
|
||||
|
||||
if(m_FirstNameIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("firstName"))] = ModelBase::toJson(m_FirstName);
|
||||
}
|
||||
|
||||
if(m_LastNameIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("lastName"))] = ModelBase::toJson(m_LastName);
|
||||
}
|
||||
|
||||
if(m_EmailIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("email"))] = ModelBase::toJson(m_Email);
|
||||
}
|
||||
|
||||
if(m_PasswordIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("password"))] = ModelBase::toJson(m_Password);
|
||||
}
|
||||
|
||||
if(m_PhoneIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("phone"))] = ModelBase::toJson(m_Phone);
|
||||
}
|
||||
|
||||
if(m_UserStatusIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("userStatus"))] = ModelBase::toJson(m_UserStatus);
|
||||
}
|
||||
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
@ -102,6 +116,7 @@ bool User::fromJson(const web::json::value& val)
|
||||
int64_t refVal_setId;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setId);
|
||||
setId(refVal_setId);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("username"))))
|
||||
@ -112,6 +127,7 @@ bool User::fromJson(const web::json::value& val)
|
||||
utility::string_t refVal_setUsername;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setUsername);
|
||||
setUsername(refVal_setUsername);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("firstName"))))
|
||||
@ -122,6 +138,7 @@ bool User::fromJson(const web::json::value& val)
|
||||
utility::string_t refVal_setFirstName;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setFirstName);
|
||||
setFirstName(refVal_setFirstName);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("lastName"))))
|
||||
@ -132,6 +149,7 @@ bool User::fromJson(const web::json::value& val)
|
||||
utility::string_t refVal_setLastName;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setLastName);
|
||||
setLastName(refVal_setLastName);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("email"))))
|
||||
@ -142,6 +160,7 @@ bool User::fromJson(const web::json::value& val)
|
||||
utility::string_t refVal_setEmail;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setEmail);
|
||||
setEmail(refVal_setEmail);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("password"))))
|
||||
@ -152,6 +171,7 @@ bool User::fromJson(const web::json::value& val)
|
||||
utility::string_t refVal_setPassword;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setPassword);
|
||||
setPassword(refVal_setPassword);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("phone"))))
|
||||
@ -162,6 +182,7 @@ bool User::fromJson(const web::json::value& val)
|
||||
utility::string_t refVal_setPhone;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setPhone);
|
||||
setPhone(refVal_setPhone);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("userStatus"))))
|
||||
@ -172,6 +193,7 @@ bool User::fromJson(const web::json::value& val)
|
||||
int32_t refVal_setUserStatus;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setUserStatus);
|
||||
setUserStatus(refVal_setUserStatus);
|
||||
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
@ -187,34 +209,42 @@ void User::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utili
|
||||
if(m_IdIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id));
|
||||
|
||||
}
|
||||
if(m_UsernameIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("username")), m_Username));
|
||||
|
||||
}
|
||||
if(m_FirstNameIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("firstName")), m_FirstName));
|
||||
|
||||
}
|
||||
if(m_LastNameIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("lastName")), m_LastName));
|
||||
|
||||
}
|
||||
if(m_EmailIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("email")), m_Email));
|
||||
|
||||
}
|
||||
if(m_PasswordIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("password")), m_Password));
|
||||
|
||||
}
|
||||
if(m_PhoneIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("phone")), m_Phone));
|
||||
|
||||
}
|
||||
if(m_UserStatusIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("userStatus")), m_UserStatus));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -232,52 +262,63 @@ bool User::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const uti
|
||||
int64_t refVal_setId;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId );
|
||||
setId(refVal_setId);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("username"))))
|
||||
{
|
||||
utility::string_t refVal_setUsername;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("username"))), refVal_setUsername );
|
||||
setUsername(refVal_setUsername);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("firstName"))))
|
||||
{
|
||||
utility::string_t refVal_setFirstName;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("firstName"))), refVal_setFirstName );
|
||||
setFirstName(refVal_setFirstName);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("lastName"))))
|
||||
{
|
||||
utility::string_t refVal_setLastName;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("lastName"))), refVal_setLastName );
|
||||
setLastName(refVal_setLastName);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("email"))))
|
||||
{
|
||||
utility::string_t refVal_setEmail;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("email"))), refVal_setEmail );
|
||||
setEmail(refVal_setEmail);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("password"))))
|
||||
{
|
||||
utility::string_t refVal_setPassword;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("password"))), refVal_setPassword );
|
||||
setPassword(refVal_setPassword);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("phone"))))
|
||||
{
|
||||
utility::string_t refVal_setPhone;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("phone"))), refVal_setPhone );
|
||||
setPhone(refVal_setPhone);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("userStatus"))))
|
||||
{
|
||||
int32_t refVal_setUserStatus;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("userStatus"))), refVal_setUserStatus );
|
||||
setUserStatus(refVal_setUserStatus);
|
||||
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int64_t User::getId() const
|
||||
{
|
||||
return m_Id;
|
||||
@ -298,11 +339,13 @@ void User::unsetId()
|
||||
{
|
||||
m_IdIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t User::getUsername() const
|
||||
{
|
||||
return m_Username;
|
||||
}
|
||||
|
||||
|
||||
void User::setUsername(const utility::string_t& value)
|
||||
{
|
||||
m_Username = value;
|
||||
@ -318,11 +361,13 @@ void User::unsetUsername()
|
||||
{
|
||||
m_UsernameIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t User::getFirstName() const
|
||||
{
|
||||
return m_FirstName;
|
||||
}
|
||||
|
||||
|
||||
void User::setFirstName(const utility::string_t& value)
|
||||
{
|
||||
m_FirstName = value;
|
||||
@ -338,11 +383,13 @@ void User::unsetFirstName()
|
||||
{
|
||||
m_FirstNameIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t User::getLastName() const
|
||||
{
|
||||
return m_LastName;
|
||||
}
|
||||
|
||||
|
||||
void User::setLastName(const utility::string_t& value)
|
||||
{
|
||||
m_LastName = value;
|
||||
@ -358,11 +405,13 @@ void User::unsetLastName()
|
||||
{
|
||||
m_LastNameIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t User::getEmail() const
|
||||
{
|
||||
return m_Email;
|
||||
}
|
||||
|
||||
|
||||
void User::setEmail(const utility::string_t& value)
|
||||
{
|
||||
m_Email = value;
|
||||
@ -378,11 +427,13 @@ void User::unsetEmail()
|
||||
{
|
||||
m_EmailIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t User::getPassword() const
|
||||
{
|
||||
return m_Password;
|
||||
}
|
||||
|
||||
|
||||
void User::setPassword(const utility::string_t& value)
|
||||
{
|
||||
m_Password = value;
|
||||
@ -398,11 +449,13 @@ void User::unsetPassword()
|
||||
{
|
||||
m_PasswordIsSet = false;
|
||||
}
|
||||
|
||||
utility::string_t User::getPhone() const
|
||||
{
|
||||
return m_Phone;
|
||||
}
|
||||
|
||||
|
||||
void User::setPhone(const utility::string_t& value)
|
||||
{
|
||||
m_Phone = value;
|
||||
@ -418,6 +471,7 @@ void User::unsetPhone()
|
||||
{
|
||||
m_PhoneIsSet = false;
|
||||
}
|
||||
|
||||
int32_t User::getUserStatus() const
|
||||
{
|
||||
return m_UserStatus;
|
||||
@ -438,6 +492,7 @@ void User::unsetUserStatus()
|
||||
{
|
||||
m_UserStatusIsSet = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ namespace client {
|
||||
namespace model {
|
||||
|
||||
|
||||
|
||||
Vaccine::Vaccine()
|
||||
{
|
||||
m_dateIsSet = false;
|
||||
@ -38,18 +37,21 @@ void Vaccine::validate()
|
||||
|
||||
web::json::value Vaccine::toJson() const
|
||||
{
|
||||
|
||||
web::json::value val = web::json::value::object();
|
||||
|
||||
if(m_dateIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("date"))] = ModelBase::toJson(m_date);
|
||||
}
|
||||
|
||||
if(m_BoosterRequiredIsSet)
|
||||
{
|
||||
|
||||
val[utility::conversions::to_string_t(U("boosterRequired"))] = ModelBase::toJson(m_BoosterRequired);
|
||||
}
|
||||
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
@ -65,6 +67,7 @@ bool Vaccine::fromJson(const web::json::value& val)
|
||||
std::shared_ptr<AnyType> refVal_setDate;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setDate);
|
||||
setDate(refVal_setDate);
|
||||
|
||||
}
|
||||
}
|
||||
if(val.has_field(utility::conversions::to_string_t(U("boosterRequired"))))
|
||||
@ -75,6 +78,7 @@ bool Vaccine::fromJson(const web::json::value& val)
|
||||
bool refVal_setBoosterRequired;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setBoosterRequired);
|
||||
setBoosterRequired(refVal_setBoosterRequired);
|
||||
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
@ -90,10 +94,12 @@ void Vaccine::toMultipart(std::shared_ptr<MultipartFormData> multipart, const ut
|
||||
if(m_dateIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("date")), m_date));
|
||||
|
||||
}
|
||||
if(m_BoosterRequiredIsSet)
|
||||
{
|
||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("boosterRequired")), m_BoosterRequired));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,21 +117,27 @@ bool Vaccine::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const
|
||||
std::shared_ptr<AnyType> refVal_setDate;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("date"))), refVal_setDate );
|
||||
setDate(refVal_setDate);
|
||||
|
||||
}
|
||||
if(multipart->hasContent(utility::conversions::to_string_t(U("boosterRequired"))))
|
||||
{
|
||||
bool refVal_setBoosterRequired;
|
||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("boosterRequired"))), refVal_setBoosterRequired );
|
||||
setBoosterRequired(refVal_setBoosterRequired);
|
||||
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
std::shared_ptr<AnyType> Vaccine::getDate() const
|
||||
{
|
||||
return m_date;
|
||||
}
|
||||
|
||||
|
||||
void Vaccine::setDate(const std::shared_ptr<AnyType>& value)
|
||||
{
|
||||
m_date = value;
|
||||
@ -141,6 +153,7 @@ void Vaccine::unsetdate()
|
||||
{
|
||||
m_dateIsSet = false;
|
||||
}
|
||||
|
||||
bool Vaccine::isBoosterRequired() const
|
||||
{
|
||||
return m_BoosterRequired;
|
||||
@ -161,6 +174,7 @@ void Vaccine::unsetBoosterRequired()
|
||||
{
|
||||
m_BoosterRequiredIsSet = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user