[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:
Francesco Saverio 2024-12-04 09:06:45 +01:00 committed by GitHub
parent 4a6dbace73
commit 0183620854
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
21 changed files with 758 additions and 153 deletions

View File

@ -8,6 +8,9 @@
#ifndef {{modelHeaderGuardPrefix}}_{{classname}}_H_ #ifndef {{modelHeaderGuardPrefix}}_{{classname}}_H_
#define {{modelHeaderGuardPrefix}}_{{classname}}_H_ #define {{modelHeaderGuardPrefix}}_{{classname}}_H_
{{#hasEnums}}
#include <stdexcept>
{{/hasEnums}}
{{#oneOf}} {{#oneOf}}
{{#-first}} {{#-first}}
#include <variant> #include <variant>
@ -146,34 +149,64 @@ public:
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override; 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; bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
///////////////////////////////////////////// /////////////////////////////////////////////
/// {{classname}} members /// {{classname}} members
{{#vars}} {{! ENUM DEFINITIONS }}
{{^isInherited}} {{#vars}}{{^isInherited}}{{#isEnum}}
enum class {{#isContainer}}{{{enumName}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}}
{
{{#allowableValues}}{{#enumVars}}{{value}},
{{/enumVars}}{{/allowableValues}}
};
/// <summary> /// <summary>
/// {{description}} /// {{description}}
/// </summary> /// </summary>
{{#isContainer}}{{{dataType}}}& {{getter}}(); {{/isEnum}}{{/isInherited}}{{/vars}}{{#vars}}{{^isInherited}}{{#isEnum}}{{#isContainer}}
{{/isContainer}}{{^isContainer}}{{{dataType}}} {{getter}}() const; {{! ENUM CONVERSIONS }}
{{/isContainer}}bool {{nameInCamelCase}}IsSet() const; {{{enumName}}} to{{{enumName}}}(const utility::string_t& value) const;
void unset{{name}}(); 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}} {{#isPrimitiveType}}
void {{setter}}({{{dataType}}} value); void {{setter}}({{{dataType}}} value);
{{/isPrimitiveType}} {{/isPrimitiveType}}{{^isPrimitiveType}}{{^isEnum}}
{{^isPrimitiveType}}
void {{setter}}(const {{{dataType}}}& value); void {{setter}}(const {{{dataType}}}& value);
{{/isPrimitiveType}} {{/isEnum}}{{/isPrimitiveType}}{{#isEnum}}
void {{setter}}(const {{^isMap}}{{{datatypeWithEnum}}}{{/isMap}}{{#isMap}}{{{dataType}}}{{/isMap}} value);
{{/isInherited}} {{/isEnum}}{{/isInherited}}{{/vars}}
{{/vars}}
protected: protected:
{{#vars}} {{#vars}}
{{^isInherited}} {{^isInherited}}{{^isEnum}}
{{{dataType}}} m_{{name}}; {{{dataType}}} m_{{name}};
bool m_{{name}}IsSet; {{/isEnum}}{{#isEnum}}
{{^isMap}}{{{datatypeWithEnum}}}{{/isMap}}{{#isMap}}{{{dataType}}}{{/isMap}} m_{{name}};
{{/isEnum}}bool m_{{name}}IsSet;
{{/isInherited}} {{/isInherited}}
{{/vars}} {{/vars}}
}; };

View File

@ -175,7 +175,6 @@ void {{classname}}::setValue({{classname}}::e{{classname}} const value)
} }
{{/isEnum}} {{/isEnum}}
{{^isEnum}} {{^isEnum}}
{{classname}}::{{classname}}() {{classname}}::{{classname}}()
@ -183,6 +182,7 @@ void {{classname}}::setValue({{classname}}::e{{classname}} const value)
{{#vars}} {{#vars}}
{{^isInherited}} {{^isInherited}}
{{^isContainer}} {{^isContainer}}
{{^isEnum}}
{{#isPrimitiveType}} {{#isPrimitiveType}}
m_{{name}} = {{{defaultValue}}}; m_{{name}} = {{{defaultValue}}};
{{/isPrimitiveType}} {{/isPrimitiveType}}
@ -194,6 +194,7 @@ void {{classname}}::setValue({{classname}}::e{{classname}} const value)
m_{{name}} = {{{defaultValue}}}; m_{{name}} = {{{defaultValue}}};
{{/isDateTime}} {{/isDateTime}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{/isEnum}}
{{/isContainer}} {{/isContainer}}
m_{{name}}IsSet = false; m_{{name}}IsSet = false;
{{/isInherited}} {{/isInherited}}
@ -212,15 +213,27 @@ void {{classname}}::validate()
web::json::value {{classname}}::toJson() const web::json::value {{classname}}::toJson() const
{ {
{{#parent}} {{#parent}}
web::json::value val = this->{{{.}}}::toJson();{{/parent}} web::json::value val = this->{{{.}}}::toJson();
{{/parent}}
{{^parent}} {{^parent}}
web::json::value val = web::json::value::object(); web::json::value val = web::json::value::object();
{{/parent}} {{/parent}}
{{#vars}}{{^isInherited}} {{#vars}}{{^isInherited}}
if(m_{{name}}IsSet) 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}}); 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; return val;
} }
@ -239,7 +252,16 @@ bool {{classname}}::fromJson(const web::json::value& val)
{ {
{{{dataType}}} refVal_{{setter}}; {{{dataType}}} refVal_{{setter}};
ok &= ModelBase::fromJson(fieldValue, refVal_{{setter}}); ok &= ModelBase::fromJson(fieldValue, refVal_{{setter}});
{{^isEnum}}
{{setter}}(refVal_{{setter}}); {{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}} }{{/isInherited}}{{/vars}}
return ok; return ok;
@ -255,7 +277,16 @@ void {{classname}}::toMultipart(std::shared_ptr<MultipartFormData> multipart, co
{{#vars}} {{#vars}}
if(m_{{name}}IsSet) if(m_{{name}}IsSet)
{ {
{{^isEnum}}
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("{{baseName}}")), m_{{name}})); 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}} {{/vars}}
} }
@ -274,33 +305,93 @@ bool {{classname}}::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
{ {
{{{dataType}}} refVal_{{setter}}; {{{dataType}}} refVal_{{setter}};
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("{{baseName}}"))), refVal_{{setter}} ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("{{baseName}}"))), refVal_{{setter}} );
{{^isEnum}}
{{setter}}(refVal_{{setter}}); {{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}} {{/vars}}
return ok; return ok;
} }
{{#vars}} {{#vars}}{{^isInherited}}{{#isEnum}}{{#isContainer}}
{{^isInherited}} {{classname}}::{{{enumName}}} {{classname}}::to{{{enumName}}}(const utility::string_t& value) const
{{#isContainer}} {{/isContainer}}{{^isContainer}}
{{{dataType}}}& {{classname}}::{{getter}}() {{classname}}::{{{datatypeWithEnum}}} {{classname}}::to{{{datatypeWithEnum}}}(const {{dataType}}& value) const
{
return m_{{name}};
}
{{/isContainer}} {{/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 {{{dataType}}} {{classname}}::{{getter}}() const
{ {
return m_{{name}}; 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}} {{#isPrimitiveType}}
void {{classname}}::{{setter}}({{{dataType}}} value) void {{classname}}::{{setter}}({{{dataType}}} value)
{{/isPrimitiveType}} {{/isPrimitiveType}}{{^isPrimitiveType}}{{^isEnum}}
{{^isPrimitiveType}}
void {{classname}}::{{setter}}(const {{{dataType}}}& value) 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}} = value;
m_{{name}}IsSet = true; m_{{name}}IsSet = true;
@ -315,8 +406,7 @@ void {{classname}}::unset{{name}}()
{ {
m_{{name}}IsSet = false; m_{{name}}IsSet = false;
} }
{{/isInherited}} {{/isInherited}}{{/vars}}
{{/vars}}
{{/isEnum}} {{/isEnum}}
{{/oneOf}} {{/oneOf}}
{{#modelNamespaceDeclarations}} {{#modelNamespaceDeclarations}}

View File

@ -51,42 +51,57 @@ public:
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override; 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; bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
///////////////////////////////////////////// /////////////////////////////////////////////
/// ApiResponse members /// ApiResponse members
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
int32_t getCode() const; int32_t getCode() const;
bool codeIsSet() const; bool codeIsSet() const;
void unsetCode(); void unsetCode();
void setCode(int32_t value); void setCode(int32_t value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
utility::string_t getType() const; utility::string_t getType() const;
bool typeIsSet() const; bool typeIsSet() const;
void unsetType(); void unsetType();
void setType(const utility::string_t& value); void setType(const utility::string_t& value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
utility::string_t getMessage() const; utility::string_t getMessage() const;
bool messageIsSet() const; bool messageIsSet() const;
void unsetMessage(); void unsetMessage();
void setMessage(const utility::string_t& value); void setMessage(const utility::string_t& value);
protected: protected:
int32_t m_Code; int32_t m_Code;
bool m_CodeIsSet; bool m_CodeIsSet;
utility::string_t m_Type; utility::string_t m_Type;
bool m_TypeIsSet; bool m_TypeIsSet;
utility::string_t m_Message; utility::string_t m_Message;
bool m_MessageIsSet; bool m_MessageIsSet;
}; };

View File

@ -51,31 +51,42 @@ public:
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override; 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; bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
///////////////////////////////////////////// /////////////////////////////////////////////
/// Category members /// Category members
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
int64_t getId() const; int64_t getId() const;
bool idIsSet() const; bool idIsSet() const;
void unsetId(); void unsetId();
void setId(int64_t value); void setId(int64_t value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
utility::string_t getName() const; utility::string_t getName() const;
bool nameIsSet() const; bool nameIsSet() const;
void unsetName(); void unsetName();
void setName(const utility::string_t& value); void setName(const utility::string_t& value);
protected: protected:
int64_t m_Id; int64_t m_Id;
bool m_IdIsSet; bool m_IdIsSet;
utility::string_t m_Name; utility::string_t m_Name;
bool m_NameIsSet; bool m_NameIsSet;
}; };

View File

@ -18,6 +18,7 @@
#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateUserOrPet_request_H_ #ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateUserOrPet_request_H_
#define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateUserOrPet_request_H_ #define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateUserOrPet_request_H_
#include <stdexcept>
#include <variant> #include <variant>
#include "CppRestPetstoreClient/ModelBase.h" #include "CppRestPetstoreClient/ModelBase.h"

View File

@ -18,6 +18,7 @@
#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Order_H_ #ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Order_H_
#define ORG_OPENAPITOOLS_CLIENT_MODEL_Order_H_ #define ORG_OPENAPITOOLS_CLIENT_MODEL_Order_H_
#include <stdexcept>
#include "CppRestPetstoreClient/ModelBase.h" #include "CppRestPetstoreClient/ModelBase.h"
@ -51,75 +52,113 @@ public:
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override; 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; bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
///////////////////////////////////////////// /////////////////////////////////////////////
/// Order members /// 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>
/// ///
/// </summary> /// </summary>
int64_t getId() const; int64_t getId() const;
bool idIsSet() const; bool idIsSet() const;
void unsetId(); void unsetId();
void setId(int64_t value); void setId(int64_t value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
int64_t getPetId() const; int64_t getPetId() const;
bool petIdIsSet() const; bool petIdIsSet() const;
void unsetPetId(); void unsetPetId();
void setPetId(int64_t value); void setPetId(int64_t value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
int32_t getQuantity() const; int32_t getQuantity() const;
bool quantityIsSet() const; bool quantityIsSet() const;
void unsetQuantity(); void unsetQuantity();
void setQuantity(int32_t value); void setQuantity(int32_t value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
utility::datetime getShipDate() const; utility::datetime getShipDate() const;
bool shipDateIsSet() const; bool shipDateIsSet() const;
void unsetShipDate(); void unsetShipDate();
void setShipDate(const utility::datetime& value); void setShipDate(const utility::datetime& value);
/// <summary> /// <summary>
/// Order Status /// Order Status
/// </summary> /// </summary>
utility::string_t getStatus() const;
StatusEnum getStatus() const;
bool statusIsSet() const; bool statusIsSet() const;
void unsetStatus(); void unsetStatus();
void setStatus(const utility::string_t& value); void setStatus(const StatusEnum value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
bool isComplete() const; bool isComplete() const;
bool completeIsSet() const; bool completeIsSet() const;
void unsetComplete(); void unsetComplete();
void setComplete(bool value); void setComplete(bool value);
protected: protected:
int64_t m_Id; int64_t m_Id;
bool m_IdIsSet; bool m_IdIsSet;
int64_t m_PetId; int64_t m_PetId;
bool m_PetIdIsSet; bool m_PetIdIsSet;
int32_t m_Quantity; int32_t m_Quantity;
bool m_QuantityIsSet; bool m_QuantityIsSet;
utility::datetime m_ShipDate; utility::datetime m_ShipDate;
bool m_ShipDateIsSet; bool m_ShipDateIsSet;
utility::string_t m_Status;
StatusEnum m_Status;
bool m_StatusIsSet; bool m_StatusIsSet;
bool m_Complete; bool m_Complete;
bool m_CompleteIsSet; bool m_CompleteIsSet;
}; };

View File

@ -18,6 +18,7 @@
#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Pet_H_ #ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Pet_H_
#define ORG_OPENAPITOOLS_CLIENT_MODEL_Pet_H_ #define ORG_OPENAPITOOLS_CLIENT_MODEL_Pet_H_
#include <stdexcept>
#include "CppRestPetstoreClient/ModelBase.h" #include "CppRestPetstoreClient/ModelBase.h"
@ -56,76 +57,117 @@ public:
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override; 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; bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
///////////////////////////////////////////// /////////////////////////////////////////////
/// Pet members /// 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>
/// ///
/// </summary> /// </summary>
int64_t getId() const; int64_t getId() const;
bool idIsSet() const; bool idIsSet() const;
void unsetId(); void unsetId();
void setId(int64_t value); void setId(int64_t value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
std::shared_ptr<Category> getCategory() const; std::shared_ptr<Category> getCategory() const;
bool categoryIsSet() const; bool categoryIsSet() const;
void unsetCategory(); void unsetCategory();
void setCategory(const std::shared_ptr<Category>& value); void setCategory(const std::shared_ptr<Category>& value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
utility::string_t getName() const; utility::string_t getName() const;
bool nameIsSet() const; bool nameIsSet() const;
void unsetName(); void unsetName();
void setName(const utility::string_t& value); void setName(const utility::string_t& value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
std::vector<utility::string_t>& getPhotoUrls();
std::vector<utility::string_t> getPhotoUrls() const;
bool photoUrlsIsSet() const; bool photoUrlsIsSet() const;
void unsetPhotoUrls(); void unsetPhotoUrls();
void setPhotoUrls(const std::vector<utility::string_t>& value); void setPhotoUrls(const std::vector<utility::string_t>& value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
std::vector<std::shared_ptr<Tag>>& getTags();
std::vector<std::shared_ptr<Tag>> getTags() const;
bool tagsIsSet() const; bool tagsIsSet() const;
void unsetTags(); void unsetTags();
void setTags(const std::vector<std::shared_ptr<Tag>>& value); void setTags(const std::vector<std::shared_ptr<Tag>>& value);
/// <summary> /// <summary>
/// pet status in the store /// pet status in the store
/// </summary> /// </summary>
utility::string_t getStatus() const;
StatusEnum getStatus() const;
bool statusIsSet() const; bool statusIsSet() const;
void unsetStatus(); void unsetStatus();
void setStatus(const utility::string_t& value); void setStatus(const StatusEnum value);
protected: protected:
int64_t m_Id; int64_t m_Id;
bool m_IdIsSet; bool m_IdIsSet;
std::shared_ptr<Category> m_Category; std::shared_ptr<Category> m_Category;
bool m_CategoryIsSet; bool m_CategoryIsSet;
utility::string_t m_Name; utility::string_t m_Name;
bool m_NameIsSet; bool m_NameIsSet;
std::vector<utility::string_t> m_PhotoUrls; std::vector<utility::string_t> m_PhotoUrls;
bool m_PhotoUrlsIsSet; bool m_PhotoUrlsIsSet;
std::vector<std::shared_ptr<Tag>> m_Tags; std::vector<std::shared_ptr<Tag>> m_Tags;
bool m_TagsIsSet; bool m_TagsIsSet;
utility::string_t m_Status;
StatusEnum m_Status;
bool m_StatusIsSet; bool m_StatusIsSet;
}; };

View File

@ -54,31 +54,43 @@ public:
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override; 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; bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
///////////////////////////////////////////// /////////////////////////////////////////////
/// SchemaWithSet members /// SchemaWithSet members
/// <summary> /// <summary>
/// pedigree and other certificates /// pedigree and other certificates
/// </summary> /// </summary>
std::set<utility::string_t>& getCertificates();
std::set<utility::string_t> getCertificates() const;
bool certificatesIsSet() const; bool certificatesIsSet() const;
void unsetCertificates(); void unsetCertificates();
void setCertificates(const std::set<utility::string_t>& value); void setCertificates(const std::set<utility::string_t>& value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
std::shared_ptr<SchemaWithSet_vaccinationBook> getVaccinationBook() const; std::shared_ptr<SchemaWithSet_vaccinationBook> getVaccinationBook() const;
bool vaccinationBookIsSet() const; bool vaccinationBookIsSet() const;
void unsetVaccinationBook(); void unsetVaccinationBook();
void setVaccinationBook(const std::shared_ptr<SchemaWithSet_vaccinationBook>& value); void setVaccinationBook(const std::shared_ptr<SchemaWithSet_vaccinationBook>& value);
protected: protected:
std::set<utility::string_t> m_Certificates; std::set<utility::string_t> m_Certificates;
bool m_CertificatesIsSet; bool m_CertificatesIsSet;
std::shared_ptr<SchemaWithSet_vaccinationBook> m_VaccinationBook; std::shared_ptr<SchemaWithSet_vaccinationBook> m_VaccinationBook;
bool m_VaccinationBookIsSet; bool m_VaccinationBookIsSet;
}; };

View File

@ -53,20 +53,28 @@ public:
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override; 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; bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
///////////////////////////////////////////// /////////////////////////////////////////////
/// SchemaWithSet_vaccinationBook members /// SchemaWithSet_vaccinationBook members
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
std::set<std::shared_ptr<Vaccine>>& getVaccines();
std::set<std::shared_ptr<Vaccine>> getVaccines() const;
bool vaccinesIsSet() const; bool vaccinesIsSet() const;
void unsetVaccines(); void unsetVaccines();
void setVaccines(const std::set<std::shared_ptr<Vaccine>>& value); void setVaccines(const std::set<std::shared_ptr<Vaccine>>& value);
protected: protected:
std::set<std::shared_ptr<Vaccine>> m_Vaccines; std::set<std::shared_ptr<Vaccine>> m_Vaccines;
bool m_VaccinesIsSet; bool m_VaccinesIsSet;
}; };

View File

@ -51,31 +51,42 @@ public:
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override; 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; bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
///////////////////////////////////////////// /////////////////////////////////////////////
/// Tag members /// Tag members
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
int64_t getId() const; int64_t getId() const;
bool idIsSet() const; bool idIsSet() const;
void unsetId(); void unsetId();
void setId(int64_t value); void setId(int64_t value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
utility::string_t getName() const; utility::string_t getName() const;
bool nameIsSet() const; bool nameIsSet() const;
void unsetName(); void unsetName();
void setName(const utility::string_t& value); void setName(const utility::string_t& value);
protected: protected:
int64_t m_Id; int64_t m_Id;
bool m_IdIsSet; bool m_IdIsSet;
utility::string_t m_Name; utility::string_t m_Name;
bool m_NameIsSet; bool m_NameIsSet;
}; };

View File

@ -51,97 +51,131 @@ public:
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override; 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; bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
///////////////////////////////////////////// /////////////////////////////////////////////
/// User members /// User members
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
int64_t getId() const; int64_t getId() const;
bool idIsSet() const; bool idIsSet() const;
void unsetId(); void unsetId();
void setId(int64_t value); void setId(int64_t value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
utility::string_t getUsername() const; utility::string_t getUsername() const;
bool usernameIsSet() const; bool usernameIsSet() const;
void unsetUsername(); void unsetUsername();
void setUsername(const utility::string_t& value); void setUsername(const utility::string_t& value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
utility::string_t getFirstName() const; utility::string_t getFirstName() const;
bool firstNameIsSet() const; bool firstNameIsSet() const;
void unsetFirstName(); void unsetFirstName();
void setFirstName(const utility::string_t& value); void setFirstName(const utility::string_t& value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
utility::string_t getLastName() const; utility::string_t getLastName() const;
bool lastNameIsSet() const; bool lastNameIsSet() const;
void unsetLastName(); void unsetLastName();
void setLastName(const utility::string_t& value); void setLastName(const utility::string_t& value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
utility::string_t getEmail() const; utility::string_t getEmail() const;
bool emailIsSet() const; bool emailIsSet() const;
void unsetEmail(); void unsetEmail();
void setEmail(const utility::string_t& value); void setEmail(const utility::string_t& value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
utility::string_t getPassword() const; utility::string_t getPassword() const;
bool passwordIsSet() const; bool passwordIsSet() const;
void unsetPassword(); void unsetPassword();
void setPassword(const utility::string_t& value); void setPassword(const utility::string_t& value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
utility::string_t getPhone() const; utility::string_t getPhone() const;
bool phoneIsSet() const; bool phoneIsSet() const;
void unsetPhone(); void unsetPhone();
void setPhone(const utility::string_t& value); void setPhone(const utility::string_t& value);
/// <summary> /// <summary>
/// User Status /// User Status
/// </summary> /// </summary>
int32_t getUserStatus() const; int32_t getUserStatus() const;
bool userStatusIsSet() const; bool userStatusIsSet() const;
void unsetUserStatus(); void unsetUserStatus();
void setUserStatus(int32_t value); void setUserStatus(int32_t value);
protected: protected:
int64_t m_Id; int64_t m_Id;
bool m_IdIsSet; bool m_IdIsSet;
utility::string_t m_Username; utility::string_t m_Username;
bool m_UsernameIsSet; bool m_UsernameIsSet;
utility::string_t m_FirstName; utility::string_t m_FirstName;
bool m_FirstNameIsSet; bool m_FirstNameIsSet;
utility::string_t m_LastName; utility::string_t m_LastName;
bool m_LastNameIsSet; bool m_LastNameIsSet;
utility::string_t m_Email; utility::string_t m_Email;
bool m_EmailIsSet; bool m_EmailIsSet;
utility::string_t m_Password; utility::string_t m_Password;
bool m_PasswordIsSet; bool m_PasswordIsSet;
utility::string_t m_Phone; utility::string_t m_Phone;
bool m_PhoneIsSet; bool m_PhoneIsSet;
int32_t m_UserStatus; int32_t m_UserStatus;
bool m_UserStatusIsSet; bool m_UserStatusIsSet;
}; };

View File

@ -51,31 +51,42 @@ public:
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override; 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; bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
///////////////////////////////////////////// /////////////////////////////////////////////
/// Vaccine members /// Vaccine members
/// <summary> /// <summary>
/// vaccination date /// vaccination date
/// </summary> /// </summary>
std::shared_ptr<AnyType> getDate() const; std::shared_ptr<AnyType> getDate() const;
bool dateIsSet() const; bool dateIsSet() const;
void unsetdate(); void unsetdate();
void setDate(const std::shared_ptr<AnyType>& value); void setDate(const std::shared_ptr<AnyType>& value);
/// <summary> /// <summary>
/// true if a booster is still needed to complete the vaccination /// true if a booster is still needed to complete the vaccination
/// </summary> /// </summary>
bool isBoosterRequired() const; bool isBoosterRequired() const;
bool boosterRequiredIsSet() const; bool boosterRequiredIsSet() const;
void unsetBoosterRequired(); void unsetBoosterRequired();
void setBoosterRequired(bool value); void setBoosterRequired(bool value);
protected: protected:
std::shared_ptr<AnyType> m_date; std::shared_ptr<AnyType> m_date;
bool m_dateIsSet; bool m_dateIsSet;
bool m_BoosterRequired; bool m_BoosterRequired;
bool m_BoosterRequiredIsSet; bool m_BoosterRequiredIsSet;
}; };

View File

@ -19,7 +19,6 @@ namespace client {
namespace model { namespace model {
ApiResponse::ApiResponse() ApiResponse::ApiResponse()
{ {
m_Code = 0; m_Code = 0;
@ -41,21 +40,26 @@ void ApiResponse::validate()
web::json::value ApiResponse::toJson() const web::json::value ApiResponse::toJson() const
{ {
web::json::value val = web::json::value::object(); web::json::value val = web::json::value::object();
if(m_CodeIsSet) if(m_CodeIsSet)
{ {
val[utility::conversions::to_string_t(U("code"))] = ModelBase::toJson(m_Code); val[utility::conversions::to_string_t(U("code"))] = ModelBase::toJson(m_Code);
} }
if(m_TypeIsSet) if(m_TypeIsSet)
{ {
val[utility::conversions::to_string_t(U("type"))] = ModelBase::toJson(m_Type); val[utility::conversions::to_string_t(U("type"))] = ModelBase::toJson(m_Type);
} }
if(m_MessageIsSet) if(m_MessageIsSet)
{ {
val[utility::conversions::to_string_t(U("message"))] = ModelBase::toJson(m_Message); val[utility::conversions::to_string_t(U("message"))] = ModelBase::toJson(m_Message);
} }
return val; return val;
} }
@ -72,6 +76,7 @@ bool ApiResponse::fromJson(const web::json::value& val)
int32_t refVal_setCode; int32_t refVal_setCode;
ok &= ModelBase::fromJson(fieldValue, refVal_setCode); ok &= ModelBase::fromJson(fieldValue, refVal_setCode);
setCode(refVal_setCode); setCode(refVal_setCode);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("type")))) 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; utility::string_t refVal_setType;
ok &= ModelBase::fromJson(fieldValue, refVal_setType); ok &= ModelBase::fromJson(fieldValue, refVal_setType);
setType(refVal_setType); setType(refVal_setType);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("message")))) 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; utility::string_t refVal_setMessage;
ok &= ModelBase::fromJson(fieldValue, refVal_setMessage); ok &= ModelBase::fromJson(fieldValue, refVal_setMessage);
setMessage(refVal_setMessage); setMessage(refVal_setMessage);
} }
} }
return ok; return ok;
@ -107,14 +114,17 @@ void ApiResponse::toMultipart(std::shared_ptr<MultipartFormData> multipart, cons
if(m_CodeIsSet) if(m_CodeIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("code")), m_Code)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("code")), m_Code));
} }
if(m_TypeIsSet) if(m_TypeIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("type")), m_Type)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("type")), m_Type));
} }
if(m_MessageIsSet) if(m_MessageIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("message")), m_Message)); 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; int32_t refVal_setCode;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("code"))), refVal_setCode ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("code"))), refVal_setCode );
setCode(refVal_setCode); setCode(refVal_setCode);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("type")))) if(multipart->hasContent(utility::conversions::to_string_t(U("type"))))
{ {
utility::string_t refVal_setType; utility::string_t refVal_setType;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("type"))), refVal_setType ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("type"))), refVal_setType );
setType(refVal_setType); setType(refVal_setType);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("message")))) if(multipart->hasContent(utility::conversions::to_string_t(U("message"))))
{ {
utility::string_t refVal_setMessage; utility::string_t refVal_setMessage;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("message"))), refVal_setMessage ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("message"))), refVal_setMessage );
setMessage(refVal_setMessage); setMessage(refVal_setMessage);
} }
return ok; return ok;
} }
int32_t ApiResponse::getCode() const int32_t ApiResponse::getCode() const
{ {
return m_Code; return m_Code;
@ -168,11 +184,13 @@ void ApiResponse::unsetCode()
{ {
m_CodeIsSet = false; m_CodeIsSet = false;
} }
utility::string_t ApiResponse::getType() const utility::string_t ApiResponse::getType() const
{ {
return m_Type; return m_Type;
} }
void ApiResponse::setType(const utility::string_t& value) void ApiResponse::setType(const utility::string_t& value)
{ {
m_Type = value; m_Type = value;
@ -188,11 +206,13 @@ void ApiResponse::unsetType()
{ {
m_TypeIsSet = false; m_TypeIsSet = false;
} }
utility::string_t ApiResponse::getMessage() const utility::string_t ApiResponse::getMessage() const
{ {
return m_Message; return m_Message;
} }
void ApiResponse::setMessage(const utility::string_t& value) void ApiResponse::setMessage(const utility::string_t& value)
{ {
m_Message = value; m_Message = value;
@ -208,6 +228,7 @@ void ApiResponse::unsetMessage()
{ {
m_MessageIsSet = false; m_MessageIsSet = false;
} }
} }
} }
} }

View File

@ -19,7 +19,6 @@ namespace client {
namespace model { namespace model {
Category::Category() Category::Category()
{ {
m_Id = 0L; m_Id = 0L;
@ -39,17 +38,20 @@ void Category::validate()
web::json::value Category::toJson() const web::json::value Category::toJson() const
{ {
web::json::value val = web::json::value::object(); web::json::value val = web::json::value::object();
if(m_IdIsSet) if(m_IdIsSet)
{ {
val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id);
} }
if(m_NameIsSet) if(m_NameIsSet)
{ {
val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name); val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name);
} }
return val; return val;
} }
@ -66,6 +68,7 @@ bool Category::fromJson(const web::json::value& val)
int64_t refVal_setId; int64_t refVal_setId;
ok &= ModelBase::fromJson(fieldValue, refVal_setId); ok &= ModelBase::fromJson(fieldValue, refVal_setId);
setId(refVal_setId); setId(refVal_setId);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("name")))) 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; utility::string_t refVal_setName;
ok &= ModelBase::fromJson(fieldValue, refVal_setName); ok &= ModelBase::fromJson(fieldValue, refVal_setName);
setName(refVal_setName); setName(refVal_setName);
} }
} }
return ok; return ok;
@ -91,10 +95,12 @@ void Category::toMultipart(std::shared_ptr<MultipartFormData> multipart, const u
if(m_IdIsSet) if(m_IdIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id));
} }
if(m_NameIsSet) if(m_NameIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name)); 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; int64_t refVal_setId;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId );
setId(refVal_setId); setId(refVal_setId);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("name")))) if(multipart->hasContent(utility::conversions::to_string_t(U("name"))))
{ {
utility::string_t refVal_setName; utility::string_t refVal_setName;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName );
setName(refVal_setName); setName(refVal_setName);
} }
return ok; return ok;
} }
int64_t Category::getId() const int64_t Category::getId() const
{ {
return m_Id; return m_Id;
@ -142,11 +153,13 @@ void Category::unsetId()
{ {
m_IdIsSet = false; m_IdIsSet = false;
} }
utility::string_t Category::getName() const utility::string_t Category::getName() const
{ {
return m_Name; return m_Name;
} }
void Category::setName(const utility::string_t& value) void Category::setName(const utility::string_t& value)
{ {
m_Name = value; m_Name = value;
@ -162,6 +175,7 @@ void Category::unsetName()
{ {
m_NameIsSet = false; m_NameIsSet = false;
} }
} }
} }
} }

View File

@ -19,7 +19,6 @@ namespace client {
namespace model { namespace model {
Order::Order() Order::Order()
{ {
m_Id = 0L; m_Id = 0L;
@ -30,7 +29,6 @@ Order::Order()
m_QuantityIsSet = false; m_QuantityIsSet = false;
m_ShipDate = utility::datetime(); m_ShipDate = utility::datetime();
m_ShipDateIsSet = false; m_ShipDateIsSet = false;
m_Status = utility::conversions::to_string_t("");
m_StatusIsSet = false; m_StatusIsSet = false;
m_Complete = false; m_Complete = false;
m_CompleteIsSet = false; m_CompleteIsSet = false;
@ -47,33 +45,46 @@ void Order::validate()
web::json::value Order::toJson() const web::json::value Order::toJson() const
{ {
web::json::value val = web::json::value::object(); web::json::value val = web::json::value::object();
if(m_IdIsSet) if(m_IdIsSet)
{ {
val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id);
} }
if(m_PetIdIsSet) if(m_PetIdIsSet)
{ {
val[utility::conversions::to_string_t(U("petId"))] = ModelBase::toJson(m_PetId); val[utility::conversions::to_string_t(U("petId"))] = ModelBase::toJson(m_PetId);
} }
if(m_QuantityIsSet) if(m_QuantityIsSet)
{ {
val[utility::conversions::to_string_t(U("quantity"))] = ModelBase::toJson(m_Quantity); val[utility::conversions::to_string_t(U("quantity"))] = ModelBase::toJson(m_Quantity);
} }
if(m_ShipDateIsSet) if(m_ShipDateIsSet)
{ {
val[utility::conversions::to_string_t(U("shipDate"))] = ModelBase::toJson(m_ShipDate); val[utility::conversions::to_string_t(U("shipDate"))] = ModelBase::toJson(m_ShipDate);
} }
if(m_StatusIsSet) 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) if(m_CompleteIsSet)
{ {
val[utility::conversions::to_string_t(U("complete"))] = ModelBase::toJson(m_Complete); val[utility::conversions::to_string_t(U("complete"))] = ModelBase::toJson(m_Complete);
} }
return val; return val;
} }
@ -90,6 +101,7 @@ bool Order::fromJson(const web::json::value& val)
int64_t refVal_setId; int64_t refVal_setId;
ok &= ModelBase::fromJson(fieldValue, refVal_setId); ok &= ModelBase::fromJson(fieldValue, refVal_setId);
setId(refVal_setId); setId(refVal_setId);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("petId")))) 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; int64_t refVal_setPetId;
ok &= ModelBase::fromJson(fieldValue, refVal_setPetId); ok &= ModelBase::fromJson(fieldValue, refVal_setPetId);
setPetId(refVal_setPetId); setPetId(refVal_setPetId);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("quantity")))) 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; int32_t refVal_setQuantity;
ok &= ModelBase::fromJson(fieldValue, refVal_setQuantity); ok &= ModelBase::fromJson(fieldValue, refVal_setQuantity);
setQuantity(refVal_setQuantity); setQuantity(refVal_setQuantity);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("shipDate")))) 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; utility::datetime refVal_setShipDate;
ok &= ModelBase::fromJson(fieldValue, refVal_setShipDate); ok &= ModelBase::fromJson(fieldValue, refVal_setShipDate);
setShipDate(refVal_setShipDate); setShipDate(refVal_setShipDate);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("status")))) 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; utility::string_t refVal_setStatus;
ok &= ModelBase::fromJson(fieldValue, 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")))) 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; bool refVal_setComplete;
ok &= ModelBase::fromJson(fieldValue, refVal_setComplete); ok &= ModelBase::fromJson(fieldValue, refVal_setComplete);
setComplete(refVal_setComplete); setComplete(refVal_setComplete);
} }
} }
return ok; return ok;
@ -155,26 +173,33 @@ void Order::toMultipart(std::shared_ptr<MultipartFormData> multipart, const util
if(m_IdIsSet) if(m_IdIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id));
} }
if(m_PetIdIsSet) if(m_PetIdIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("petId")), m_PetId)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("petId")), m_PetId));
} }
if(m_QuantityIsSet) if(m_QuantityIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("quantity")), m_Quantity)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("quantity")), m_Quantity));
} }
if(m_ShipDateIsSet) if(m_ShipDateIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("shipDate")), m_ShipDate)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("shipDate")), m_ShipDate));
} }
if(m_StatusIsSet) 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) if(m_CompleteIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("complete")), m_Complete)); 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; int64_t refVal_setId;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId );
setId(refVal_setId); setId(refVal_setId);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("petId")))) if(multipart->hasContent(utility::conversions::to_string_t(U("petId"))))
{ {
int64_t refVal_setPetId; int64_t refVal_setPetId;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("petId"))), refVal_setPetId ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("petId"))), refVal_setPetId );
setPetId(refVal_setPetId); setPetId(refVal_setPetId);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("quantity")))) if(multipart->hasContent(utility::conversions::to_string_t(U("quantity"))))
{ {
int32_t refVal_setQuantity; int32_t refVal_setQuantity;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("quantity"))), refVal_setQuantity ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("quantity"))), refVal_setQuantity );
setQuantity(refVal_setQuantity); setQuantity(refVal_setQuantity);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("shipDate")))) if(multipart->hasContent(utility::conversions::to_string_t(U("shipDate"))))
{ {
utility::datetime refVal_setShipDate; utility::datetime refVal_setShipDate;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("shipDate"))), refVal_setShipDate ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("shipDate"))), refVal_setShipDate );
setShipDate(refVal_setShipDate); setShipDate(refVal_setShipDate);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("status")))) if(multipart->hasContent(utility::conversions::to_string_t(U("status"))))
{ {
utility::string_t refVal_setStatus; utility::string_t refVal_setStatus;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("status"))), 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")))) if(multipart->hasContent(utility::conversions::to_string_t(U("complete"))))
{ {
bool refVal_setComplete; bool refVal_setComplete;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("complete"))), refVal_setComplete ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("complete"))), refVal_setComplete );
setComplete(refVal_setComplete); setComplete(refVal_setComplete);
} }
return ok; 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 int64_t Order::getId() const
{ {
return m_Id; return m_Id;
@ -246,6 +315,7 @@ void Order::unsetId()
{ {
m_IdIsSet = false; m_IdIsSet = false;
} }
int64_t Order::getPetId() const int64_t Order::getPetId() const
{ {
return m_PetId; return m_PetId;
@ -266,6 +336,7 @@ void Order::unsetPetId()
{ {
m_PetIdIsSet = false; m_PetIdIsSet = false;
} }
int32_t Order::getQuantity() const int32_t Order::getQuantity() const
{ {
return m_Quantity; return m_Quantity;
@ -286,11 +357,13 @@ void Order::unsetQuantity()
{ {
m_QuantityIsSet = false; m_QuantityIsSet = false;
} }
utility::datetime Order::getShipDate() const utility::datetime Order::getShipDate() const
{ {
return m_ShipDate; return m_ShipDate;
} }
void Order::setShipDate(const utility::datetime& value) void Order::setShipDate(const utility::datetime& value)
{ {
m_ShipDate = value; m_ShipDate = value;
@ -306,12 +379,14 @@ void Order::unsetShipDate()
{ {
m_ShipDateIsSet = false; m_ShipDateIsSet = false;
} }
utility::string_t Order::getStatus() const
Order::StatusEnum Order::getStatus() const
{ {
return m_Status; return m_Status;
} }
void Order::setStatus(const utility::string_t& value)
void Order::setStatus(const StatusEnum value)
{ {
m_Status = value; m_Status = value;
m_StatusIsSet = true; m_StatusIsSet = true;
@ -326,6 +401,7 @@ void Order::unsetStatus()
{ {
m_StatusIsSet = false; m_StatusIsSet = false;
} }
bool Order::isComplete() const bool Order::isComplete() const
{ {
return m_Complete; return m_Complete;
@ -346,6 +422,7 @@ void Order::unsetComplete()
{ {
m_CompleteIsSet = false; m_CompleteIsSet = false;
} }
} }
} }
} }

View File

@ -19,7 +19,6 @@ namespace client {
namespace model { namespace model {
Pet::Pet() Pet::Pet()
{ {
m_Id = 0L; m_Id = 0L;
@ -29,7 +28,6 @@ Pet::Pet()
m_NameIsSet = false; m_NameIsSet = false;
m_PhotoUrlsIsSet = false; m_PhotoUrlsIsSet = false;
m_TagsIsSet = false; m_TagsIsSet = false;
m_Status = utility::conversions::to_string_t("");
m_StatusIsSet = false; m_StatusIsSet = false;
} }
@ -44,33 +42,46 @@ void Pet::validate()
web::json::value Pet::toJson() const web::json::value Pet::toJson() const
{ {
web::json::value val = web::json::value::object(); web::json::value val = web::json::value::object();
if(m_IdIsSet) if(m_IdIsSet)
{ {
val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id);
} }
if(m_CategoryIsSet) if(m_CategoryIsSet)
{ {
val[utility::conversions::to_string_t(U("category"))] = ModelBase::toJson(m_Category); val[utility::conversions::to_string_t(U("category"))] = ModelBase::toJson(m_Category);
} }
if(m_NameIsSet) if(m_NameIsSet)
{ {
val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name); val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name);
} }
if(m_PhotoUrlsIsSet) if(m_PhotoUrlsIsSet)
{ {
val[utility::conversions::to_string_t(U("photoUrls"))] = ModelBase::toJson(m_PhotoUrls); val[utility::conversions::to_string_t(U("photoUrls"))] = ModelBase::toJson(m_PhotoUrls);
} }
if(m_TagsIsSet) if(m_TagsIsSet)
{ {
val[utility::conversions::to_string_t(U("tags"))] = ModelBase::toJson(m_Tags); val[utility::conversions::to_string_t(U("tags"))] = ModelBase::toJson(m_Tags);
} }
if(m_StatusIsSet) 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; return val;
} }
@ -87,6 +98,7 @@ bool Pet::fromJson(const web::json::value& val)
int64_t refVal_setId; int64_t refVal_setId;
ok &= ModelBase::fromJson(fieldValue, refVal_setId); ok &= ModelBase::fromJson(fieldValue, refVal_setId);
setId(refVal_setId); setId(refVal_setId);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("category")))) 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; std::shared_ptr<Category> refVal_setCategory;
ok &= ModelBase::fromJson(fieldValue, refVal_setCategory); ok &= ModelBase::fromJson(fieldValue, refVal_setCategory);
setCategory(refVal_setCategory); setCategory(refVal_setCategory);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("name")))) 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; utility::string_t refVal_setName;
ok &= ModelBase::fromJson(fieldValue, refVal_setName); ok &= ModelBase::fromJson(fieldValue, refVal_setName);
setName(refVal_setName); setName(refVal_setName);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("photoUrls")))) 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; std::vector<utility::string_t> refVal_setPhotoUrls;
ok &= ModelBase::fromJson(fieldValue, refVal_setPhotoUrls); ok &= ModelBase::fromJson(fieldValue, refVal_setPhotoUrls);
setPhotoUrls(refVal_setPhotoUrls); setPhotoUrls(refVal_setPhotoUrls);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("tags")))) 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; std::vector<std::shared_ptr<Tag>> refVal_setTags;
ok &= ModelBase::fromJson(fieldValue, refVal_setTags); ok &= ModelBase::fromJson(fieldValue, refVal_setTags);
setTags(refVal_setTags); setTags(refVal_setTags);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("status")))) 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; utility::string_t refVal_setStatus;
ok &= ModelBase::fromJson(fieldValue, refVal_setStatus); ok &= ModelBase::fromJson(fieldValue, refVal_setStatus);
setStatus(refVal_setStatus);
setStatus(toStatusEnum(refVal_setStatus));
} }
} }
return ok; return ok;
@ -152,26 +170,33 @@ void Pet::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utilit
if(m_IdIsSet) if(m_IdIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id));
} }
if(m_CategoryIsSet) if(m_CategoryIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("category")), m_Category)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("category")), m_Category));
} }
if(m_NameIsSet) if(m_NameIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name));
} }
if(m_PhotoUrlsIsSet) if(m_PhotoUrlsIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("photoUrls")), m_PhotoUrls)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("photoUrls")), m_PhotoUrls));
} }
if(m_TagsIsSet) if(m_TagsIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("tags")), m_Tags)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("tags")), m_Tags));
} }
if(m_StatusIsSet) 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; int64_t refVal_setId;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId );
setId(refVal_setId); setId(refVal_setId);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("category")))) if(multipart->hasContent(utility::conversions::to_string_t(U("category"))))
{ {
std::shared_ptr<Category> refVal_setCategory; std::shared_ptr<Category> refVal_setCategory;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("category"))), refVal_setCategory ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("category"))), refVal_setCategory );
setCategory(refVal_setCategory); setCategory(refVal_setCategory);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("name")))) if(multipart->hasContent(utility::conversions::to_string_t(U("name"))))
{ {
utility::string_t refVal_setName; utility::string_t refVal_setName;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName );
setName(refVal_setName); setName(refVal_setName);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("photoUrls")))) if(multipart->hasContent(utility::conversions::to_string_t(U("photoUrls"))))
{ {
std::vector<utility::string_t> refVal_setPhotoUrls; std::vector<utility::string_t> refVal_setPhotoUrls;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("photoUrls"))), refVal_setPhotoUrls ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("photoUrls"))), refVal_setPhotoUrls );
setPhotoUrls(refVal_setPhotoUrls); setPhotoUrls(refVal_setPhotoUrls);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("tags")))) if(multipart->hasContent(utility::conversions::to_string_t(U("tags"))))
{ {
std::vector<std::shared_ptr<Tag>> refVal_setTags; std::vector<std::shared_ptr<Tag>> refVal_setTags;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("tags"))), refVal_setTags ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("tags"))), refVal_setTags );
setTags(refVal_setTags); setTags(refVal_setTags);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("status")))) if(multipart->hasContent(utility::conversions::to_string_t(U("status"))))
{ {
utility::string_t refVal_setStatus; utility::string_t refVal_setStatus;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("status"))), 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; 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 int64_t Pet::getId() const
{ {
return m_Id; return m_Id;
@ -243,11 +312,13 @@ void Pet::unsetId()
{ {
m_IdIsSet = false; m_IdIsSet = false;
} }
std::shared_ptr<Category> Pet::getCategory() const std::shared_ptr<Category> Pet::getCategory() const
{ {
return m_Category; return m_Category;
} }
void Pet::setCategory(const std::shared_ptr<Category>& value) void Pet::setCategory(const std::shared_ptr<Category>& value)
{ {
m_Category = value; m_Category = value;
@ -263,11 +334,13 @@ void Pet::unsetCategory()
{ {
m_CategoryIsSet = false; m_CategoryIsSet = false;
} }
utility::string_t Pet::getName() const utility::string_t Pet::getName() const
{ {
return m_Name; return m_Name;
} }
void Pet::setName(const utility::string_t& value) void Pet::setName(const utility::string_t& value)
{ {
m_Name = value; m_Name = value;
@ -283,11 +356,13 @@ void Pet::unsetName()
{ {
m_NameIsSet = false; m_NameIsSet = false;
} }
std::vector<utility::string_t>& Pet::getPhotoUrls()
std::vector<utility::string_t> Pet::getPhotoUrls() const
{ {
return m_PhotoUrls; return m_PhotoUrls;
} }
void Pet::setPhotoUrls(const std::vector<utility::string_t>& value) void Pet::setPhotoUrls(const std::vector<utility::string_t>& value)
{ {
m_PhotoUrls = value; m_PhotoUrls = value;
@ -303,11 +378,13 @@ void Pet::unsetPhotoUrls()
{ {
m_PhotoUrlsIsSet = false; m_PhotoUrlsIsSet = false;
} }
std::vector<std::shared_ptr<Tag>>& Pet::getTags()
std::vector<std::shared_ptr<Tag>> Pet::getTags() const
{ {
return m_Tags; return m_Tags;
} }
void Pet::setTags(const std::vector<std::shared_ptr<Tag>>& value) void Pet::setTags(const std::vector<std::shared_ptr<Tag>>& value)
{ {
m_Tags = value; m_Tags = value;
@ -323,12 +400,14 @@ void Pet::unsetTags()
{ {
m_TagsIsSet = false; m_TagsIsSet = false;
} }
utility::string_t Pet::getStatus() const
Pet::StatusEnum Pet::getStatus() const
{ {
return m_Status; return m_Status;
} }
void Pet::setStatus(const utility::string_t& value)
void Pet::setStatus(const StatusEnum value)
{ {
m_Status = value; m_Status = value;
m_StatusIsSet = true; m_StatusIsSet = true;
@ -343,6 +422,7 @@ void Pet::unsetStatus()
{ {
m_StatusIsSet = false; m_StatusIsSet = false;
} }
} }
} }
} }

View File

@ -19,7 +19,6 @@ namespace client {
namespace model { namespace model {
SchemaWithSet::SchemaWithSet() SchemaWithSet::SchemaWithSet()
{ {
m_CertificatesIsSet = false; m_CertificatesIsSet = false;
@ -37,17 +36,20 @@ void SchemaWithSet::validate()
web::json::value SchemaWithSet::toJson() const web::json::value SchemaWithSet::toJson() const
{ {
web::json::value val = web::json::value::object(); web::json::value val = web::json::value::object();
if(m_CertificatesIsSet) if(m_CertificatesIsSet)
{ {
val[utility::conversions::to_string_t(U("certificates"))] = ModelBase::toJson(m_Certificates); val[utility::conversions::to_string_t(U("certificates"))] = ModelBase::toJson(m_Certificates);
} }
if(m_VaccinationBookIsSet) if(m_VaccinationBookIsSet)
{ {
val[utility::conversions::to_string_t(U("vaccinationBook"))] = ModelBase::toJson(m_VaccinationBook); val[utility::conversions::to_string_t(U("vaccinationBook"))] = ModelBase::toJson(m_VaccinationBook);
} }
return val; return val;
} }
@ -64,6 +66,7 @@ bool SchemaWithSet::fromJson(const web::json::value& val)
std::set<utility::string_t> refVal_setCertificates; std::set<utility::string_t> refVal_setCertificates;
ok &= ModelBase::fromJson(fieldValue, refVal_setCertificates); ok &= ModelBase::fromJson(fieldValue, refVal_setCertificates);
setCertificates(refVal_setCertificates); setCertificates(refVal_setCertificates);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("vaccinationBook")))) 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; std::shared_ptr<SchemaWithSet_vaccinationBook> refVal_setVaccinationBook;
ok &= ModelBase::fromJson(fieldValue, refVal_setVaccinationBook); ok &= ModelBase::fromJson(fieldValue, refVal_setVaccinationBook);
setVaccinationBook(refVal_setVaccinationBook); setVaccinationBook(refVal_setVaccinationBook);
} }
} }
return ok; return ok;
@ -89,10 +93,12 @@ void SchemaWithSet::toMultipart(std::shared_ptr<MultipartFormData> multipart, co
if(m_CertificatesIsSet) if(m_CertificatesIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("certificates")), m_Certificates)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("certificates")), m_Certificates));
} }
if(m_VaccinationBookIsSet) if(m_VaccinationBookIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("vaccinationBook")), m_VaccinationBook)); 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; std::set<utility::string_t> refVal_setCertificates;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("certificates"))), refVal_setCertificates ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("certificates"))), refVal_setCertificates );
setCertificates(refVal_setCertificates); setCertificates(refVal_setCertificates);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("vaccinationBook")))) if(multipart->hasContent(utility::conversions::to_string_t(U("vaccinationBook"))))
{ {
std::shared_ptr<SchemaWithSet_vaccinationBook> refVal_setVaccinationBook; std::shared_ptr<SchemaWithSet_vaccinationBook> refVal_setVaccinationBook;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("vaccinationBook"))), refVal_setVaccinationBook ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("vaccinationBook"))), refVal_setVaccinationBook );
setVaccinationBook(refVal_setVaccinationBook); setVaccinationBook(refVal_setVaccinationBook);
} }
return ok; return ok;
} }
std::set<utility::string_t>& SchemaWithSet::getCertificates()
std::set<utility::string_t> SchemaWithSet::getCertificates() const
{ {
return m_Certificates; return m_Certificates;
} }
void SchemaWithSet::setCertificates(const std::set<utility::string_t>& value) void SchemaWithSet::setCertificates(const std::set<utility::string_t>& value)
{ {
m_Certificates = value; m_Certificates = value;
@ -140,11 +152,13 @@ void SchemaWithSet::unsetCertificates()
{ {
m_CertificatesIsSet = false; m_CertificatesIsSet = false;
} }
std::shared_ptr<SchemaWithSet_vaccinationBook> SchemaWithSet::getVaccinationBook() const std::shared_ptr<SchemaWithSet_vaccinationBook> SchemaWithSet::getVaccinationBook() const
{ {
return m_VaccinationBook; return m_VaccinationBook;
} }
void SchemaWithSet::setVaccinationBook(const std::shared_ptr<SchemaWithSet_vaccinationBook>& value) void SchemaWithSet::setVaccinationBook(const std::shared_ptr<SchemaWithSet_vaccinationBook>& value)
{ {
m_VaccinationBook = value; m_VaccinationBook = value;
@ -160,6 +174,7 @@ void SchemaWithSet::unsetVaccinationBook()
{ {
m_VaccinationBookIsSet = false; m_VaccinationBookIsSet = false;
} }
} }
} }
} }

View File

@ -19,7 +19,6 @@ namespace client {
namespace model { namespace model {
SchemaWithSet_vaccinationBook::SchemaWithSet_vaccinationBook() SchemaWithSet_vaccinationBook::SchemaWithSet_vaccinationBook()
{ {
m_VaccinesIsSet = false; m_VaccinesIsSet = false;
@ -36,13 +35,14 @@ void SchemaWithSet_vaccinationBook::validate()
web::json::value SchemaWithSet_vaccinationBook::toJson() const web::json::value SchemaWithSet_vaccinationBook::toJson() const
{ {
web::json::value val = web::json::value::object(); web::json::value val = web::json::value::object();
if(m_VaccinesIsSet) if(m_VaccinesIsSet)
{ {
val[utility::conversions::to_string_t(U("vaccines"))] = ModelBase::toJson(m_Vaccines); val[utility::conversions::to_string_t(U("vaccines"))] = ModelBase::toJson(m_Vaccines);
} }
return val; return val;
} }
@ -59,6 +59,7 @@ bool SchemaWithSet_vaccinationBook::fromJson(const web::json::value& val)
std::set<std::shared_ptr<Vaccine>> refVal_setVaccines; std::set<std::shared_ptr<Vaccine>> refVal_setVaccines;
ok &= ModelBase::fromJson(fieldValue, refVal_setVaccines); ok &= ModelBase::fromJson(fieldValue, refVal_setVaccines);
setVaccines(refVal_setVaccines); setVaccines(refVal_setVaccines);
} }
} }
return ok; return ok;
@ -74,6 +75,7 @@ void SchemaWithSet_vaccinationBook::toMultipart(std::shared_ptr<MultipartFormDat
if(m_VaccinesIsSet) if(m_VaccinesIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("vaccines")), m_Vaccines)); 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; std::set<std::shared_ptr<Vaccine>> refVal_setVaccines;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("vaccines"))), refVal_setVaccines ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("vaccines"))), refVal_setVaccines );
setVaccines(refVal_setVaccines); setVaccines(refVal_setVaccines);
} }
return ok; return ok;
} }
std::set<std::shared_ptr<Vaccine>>& SchemaWithSet_vaccinationBook::getVaccines()
std::set<std::shared_ptr<Vaccine>> SchemaWithSet_vaccinationBook::getVaccines() const
{ {
return m_Vaccines; return m_Vaccines;
} }
void SchemaWithSet_vaccinationBook::setVaccines(const std::set<std::shared_ptr<Vaccine>>& value) void SchemaWithSet_vaccinationBook::setVaccines(const std::set<std::shared_ptr<Vaccine>>& value)
{ {
m_Vaccines = value; m_Vaccines = value;
@ -115,6 +122,7 @@ void SchemaWithSet_vaccinationBook::unsetVaccines()
{ {
m_VaccinesIsSet = false; m_VaccinesIsSet = false;
} }
} }
} }
} }

View File

@ -19,7 +19,6 @@ namespace client {
namespace model { namespace model {
Tag::Tag() Tag::Tag()
{ {
m_Id = 0L; m_Id = 0L;
@ -39,17 +38,20 @@ void Tag::validate()
web::json::value Tag::toJson() const web::json::value Tag::toJson() const
{ {
web::json::value val = web::json::value::object(); web::json::value val = web::json::value::object();
if(m_IdIsSet) if(m_IdIsSet)
{ {
val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id);
} }
if(m_NameIsSet) if(m_NameIsSet)
{ {
val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name); val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name);
} }
return val; return val;
} }
@ -66,6 +68,7 @@ bool Tag::fromJson(const web::json::value& val)
int64_t refVal_setId; int64_t refVal_setId;
ok &= ModelBase::fromJson(fieldValue, refVal_setId); ok &= ModelBase::fromJson(fieldValue, refVal_setId);
setId(refVal_setId); setId(refVal_setId);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("name")))) 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; utility::string_t refVal_setName;
ok &= ModelBase::fromJson(fieldValue, refVal_setName); ok &= ModelBase::fromJson(fieldValue, refVal_setName);
setName(refVal_setName); setName(refVal_setName);
} }
} }
return ok; return ok;
@ -91,10 +95,12 @@ void Tag::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utilit
if(m_IdIsSet) if(m_IdIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id));
} }
if(m_NameIsSet) if(m_NameIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name)); 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; int64_t refVal_setId;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId );
setId(refVal_setId); setId(refVal_setId);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("name")))) if(multipart->hasContent(utility::conversions::to_string_t(U("name"))))
{ {
utility::string_t refVal_setName; utility::string_t refVal_setName;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName );
setName(refVal_setName); setName(refVal_setName);
} }
return ok; return ok;
} }
int64_t Tag::getId() const int64_t Tag::getId() const
{ {
return m_Id; return m_Id;
@ -142,11 +153,13 @@ void Tag::unsetId()
{ {
m_IdIsSet = false; m_IdIsSet = false;
} }
utility::string_t Tag::getName() const utility::string_t Tag::getName() const
{ {
return m_Name; return m_Name;
} }
void Tag::setName(const utility::string_t& value) void Tag::setName(const utility::string_t& value)
{ {
m_Name = value; m_Name = value;
@ -162,6 +175,7 @@ void Tag::unsetName()
{ {
m_NameIsSet = false; m_NameIsSet = false;
} }
} }
} }
} }

View File

@ -19,7 +19,6 @@ namespace client {
namespace model { namespace model {
User::User() User::User()
{ {
m_Id = 0L; m_Id = 0L;
@ -51,41 +50,56 @@ void User::validate()
web::json::value User::toJson() const web::json::value User::toJson() const
{ {
web::json::value val = web::json::value::object(); web::json::value val = web::json::value::object();
if(m_IdIsSet) if(m_IdIsSet)
{ {
val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id);
} }
if(m_UsernameIsSet) if(m_UsernameIsSet)
{ {
val[utility::conversions::to_string_t(U("username"))] = ModelBase::toJson(m_Username); val[utility::conversions::to_string_t(U("username"))] = ModelBase::toJson(m_Username);
} }
if(m_FirstNameIsSet) if(m_FirstNameIsSet)
{ {
val[utility::conversions::to_string_t(U("firstName"))] = ModelBase::toJson(m_FirstName); val[utility::conversions::to_string_t(U("firstName"))] = ModelBase::toJson(m_FirstName);
} }
if(m_LastNameIsSet) if(m_LastNameIsSet)
{ {
val[utility::conversions::to_string_t(U("lastName"))] = ModelBase::toJson(m_LastName); val[utility::conversions::to_string_t(U("lastName"))] = ModelBase::toJson(m_LastName);
} }
if(m_EmailIsSet) if(m_EmailIsSet)
{ {
val[utility::conversions::to_string_t(U("email"))] = ModelBase::toJson(m_Email); val[utility::conversions::to_string_t(U("email"))] = ModelBase::toJson(m_Email);
} }
if(m_PasswordIsSet) if(m_PasswordIsSet)
{ {
val[utility::conversions::to_string_t(U("password"))] = ModelBase::toJson(m_Password); val[utility::conversions::to_string_t(U("password"))] = ModelBase::toJson(m_Password);
} }
if(m_PhoneIsSet) if(m_PhoneIsSet)
{ {
val[utility::conversions::to_string_t(U("phone"))] = ModelBase::toJson(m_Phone); val[utility::conversions::to_string_t(U("phone"))] = ModelBase::toJson(m_Phone);
} }
if(m_UserStatusIsSet) if(m_UserStatusIsSet)
{ {
val[utility::conversions::to_string_t(U("userStatus"))] = ModelBase::toJson(m_UserStatus); val[utility::conversions::to_string_t(U("userStatus"))] = ModelBase::toJson(m_UserStatus);
} }
return val; return val;
} }
@ -102,6 +116,7 @@ bool User::fromJson(const web::json::value& val)
int64_t refVal_setId; int64_t refVal_setId;
ok &= ModelBase::fromJson(fieldValue, refVal_setId); ok &= ModelBase::fromJson(fieldValue, refVal_setId);
setId(refVal_setId); setId(refVal_setId);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("username")))) 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; utility::string_t refVal_setUsername;
ok &= ModelBase::fromJson(fieldValue, refVal_setUsername); ok &= ModelBase::fromJson(fieldValue, refVal_setUsername);
setUsername(refVal_setUsername); setUsername(refVal_setUsername);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("firstName")))) 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; utility::string_t refVal_setFirstName;
ok &= ModelBase::fromJson(fieldValue, refVal_setFirstName); ok &= ModelBase::fromJson(fieldValue, refVal_setFirstName);
setFirstName(refVal_setFirstName); setFirstName(refVal_setFirstName);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("lastName")))) 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; utility::string_t refVal_setLastName;
ok &= ModelBase::fromJson(fieldValue, refVal_setLastName); ok &= ModelBase::fromJson(fieldValue, refVal_setLastName);
setLastName(refVal_setLastName); setLastName(refVal_setLastName);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("email")))) 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; utility::string_t refVal_setEmail;
ok &= ModelBase::fromJson(fieldValue, refVal_setEmail); ok &= ModelBase::fromJson(fieldValue, refVal_setEmail);
setEmail(refVal_setEmail); setEmail(refVal_setEmail);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("password")))) 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; utility::string_t refVal_setPassword;
ok &= ModelBase::fromJson(fieldValue, refVal_setPassword); ok &= ModelBase::fromJson(fieldValue, refVal_setPassword);
setPassword(refVal_setPassword); setPassword(refVal_setPassword);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("phone")))) 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; utility::string_t refVal_setPhone;
ok &= ModelBase::fromJson(fieldValue, refVal_setPhone); ok &= ModelBase::fromJson(fieldValue, refVal_setPhone);
setPhone(refVal_setPhone); setPhone(refVal_setPhone);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("userStatus")))) 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; int32_t refVal_setUserStatus;
ok &= ModelBase::fromJson(fieldValue, refVal_setUserStatus); ok &= ModelBase::fromJson(fieldValue, refVal_setUserStatus);
setUserStatus(refVal_setUserStatus); setUserStatus(refVal_setUserStatus);
} }
} }
return ok; return ok;
@ -187,34 +209,42 @@ void User::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utili
if(m_IdIsSet) if(m_IdIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id));
} }
if(m_UsernameIsSet) if(m_UsernameIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("username")), m_Username)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("username")), m_Username));
} }
if(m_FirstNameIsSet) if(m_FirstNameIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("firstName")), m_FirstName)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("firstName")), m_FirstName));
} }
if(m_LastNameIsSet) if(m_LastNameIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("lastName")), m_LastName)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("lastName")), m_LastName));
} }
if(m_EmailIsSet) if(m_EmailIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("email")), m_Email)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("email")), m_Email));
} }
if(m_PasswordIsSet) if(m_PasswordIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("password")), m_Password)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("password")), m_Password));
} }
if(m_PhoneIsSet) if(m_PhoneIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("phone")), m_Phone)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("phone")), m_Phone));
} }
if(m_UserStatusIsSet) if(m_UserStatusIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("userStatus")), m_UserStatus)); 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; int64_t refVal_setId;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId );
setId(refVal_setId); setId(refVal_setId);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("username")))) if(multipart->hasContent(utility::conversions::to_string_t(U("username"))))
{ {
utility::string_t refVal_setUsername; utility::string_t refVal_setUsername;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("username"))), refVal_setUsername ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("username"))), refVal_setUsername );
setUsername(refVal_setUsername); setUsername(refVal_setUsername);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("firstName")))) if(multipart->hasContent(utility::conversions::to_string_t(U("firstName"))))
{ {
utility::string_t refVal_setFirstName; utility::string_t refVal_setFirstName;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("firstName"))), refVal_setFirstName ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("firstName"))), refVal_setFirstName );
setFirstName(refVal_setFirstName); setFirstName(refVal_setFirstName);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("lastName")))) if(multipart->hasContent(utility::conversions::to_string_t(U("lastName"))))
{ {
utility::string_t refVal_setLastName; utility::string_t refVal_setLastName;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("lastName"))), refVal_setLastName ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("lastName"))), refVal_setLastName );
setLastName(refVal_setLastName); setLastName(refVal_setLastName);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("email")))) if(multipart->hasContent(utility::conversions::to_string_t(U("email"))))
{ {
utility::string_t refVal_setEmail; utility::string_t refVal_setEmail;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("email"))), refVal_setEmail ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("email"))), refVal_setEmail );
setEmail(refVal_setEmail); setEmail(refVal_setEmail);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("password")))) if(multipart->hasContent(utility::conversions::to_string_t(U("password"))))
{ {
utility::string_t refVal_setPassword; utility::string_t refVal_setPassword;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("password"))), refVal_setPassword ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("password"))), refVal_setPassword );
setPassword(refVal_setPassword); setPassword(refVal_setPassword);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("phone")))) if(multipart->hasContent(utility::conversions::to_string_t(U("phone"))))
{ {
utility::string_t refVal_setPhone; utility::string_t refVal_setPhone;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("phone"))), refVal_setPhone ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("phone"))), refVal_setPhone );
setPhone(refVal_setPhone); setPhone(refVal_setPhone);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("userStatus")))) if(multipart->hasContent(utility::conversions::to_string_t(U("userStatus"))))
{ {
int32_t refVal_setUserStatus; int32_t refVal_setUserStatus;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("userStatus"))), refVal_setUserStatus ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("userStatus"))), refVal_setUserStatus );
setUserStatus(refVal_setUserStatus); setUserStatus(refVal_setUserStatus);
} }
return ok; return ok;
} }
int64_t User::getId() const int64_t User::getId() const
{ {
return m_Id; return m_Id;
@ -298,11 +339,13 @@ void User::unsetId()
{ {
m_IdIsSet = false; m_IdIsSet = false;
} }
utility::string_t User::getUsername() const utility::string_t User::getUsername() const
{ {
return m_Username; return m_Username;
} }
void User::setUsername(const utility::string_t& value) void User::setUsername(const utility::string_t& value)
{ {
m_Username = value; m_Username = value;
@ -318,11 +361,13 @@ void User::unsetUsername()
{ {
m_UsernameIsSet = false; m_UsernameIsSet = false;
} }
utility::string_t User::getFirstName() const utility::string_t User::getFirstName() const
{ {
return m_FirstName; return m_FirstName;
} }
void User::setFirstName(const utility::string_t& value) void User::setFirstName(const utility::string_t& value)
{ {
m_FirstName = value; m_FirstName = value;
@ -338,11 +383,13 @@ void User::unsetFirstName()
{ {
m_FirstNameIsSet = false; m_FirstNameIsSet = false;
} }
utility::string_t User::getLastName() const utility::string_t User::getLastName() const
{ {
return m_LastName; return m_LastName;
} }
void User::setLastName(const utility::string_t& value) void User::setLastName(const utility::string_t& value)
{ {
m_LastName = value; m_LastName = value;
@ -358,11 +405,13 @@ void User::unsetLastName()
{ {
m_LastNameIsSet = false; m_LastNameIsSet = false;
} }
utility::string_t User::getEmail() const utility::string_t User::getEmail() const
{ {
return m_Email; return m_Email;
} }
void User::setEmail(const utility::string_t& value) void User::setEmail(const utility::string_t& value)
{ {
m_Email = value; m_Email = value;
@ -378,11 +427,13 @@ void User::unsetEmail()
{ {
m_EmailIsSet = false; m_EmailIsSet = false;
} }
utility::string_t User::getPassword() const utility::string_t User::getPassword() const
{ {
return m_Password; return m_Password;
} }
void User::setPassword(const utility::string_t& value) void User::setPassword(const utility::string_t& value)
{ {
m_Password = value; m_Password = value;
@ -398,11 +449,13 @@ void User::unsetPassword()
{ {
m_PasswordIsSet = false; m_PasswordIsSet = false;
} }
utility::string_t User::getPhone() const utility::string_t User::getPhone() const
{ {
return m_Phone; return m_Phone;
} }
void User::setPhone(const utility::string_t& value) void User::setPhone(const utility::string_t& value)
{ {
m_Phone = value; m_Phone = value;
@ -418,6 +471,7 @@ void User::unsetPhone()
{ {
m_PhoneIsSet = false; m_PhoneIsSet = false;
} }
int32_t User::getUserStatus() const int32_t User::getUserStatus() const
{ {
return m_UserStatus; return m_UserStatus;
@ -438,6 +492,7 @@ void User::unsetUserStatus()
{ {
m_UserStatusIsSet = false; m_UserStatusIsSet = false;
} }
} }
} }
} }

View File

@ -19,7 +19,6 @@ namespace client {
namespace model { namespace model {
Vaccine::Vaccine() Vaccine::Vaccine()
{ {
m_dateIsSet = false; m_dateIsSet = false;
@ -38,17 +37,20 @@ void Vaccine::validate()
web::json::value Vaccine::toJson() const web::json::value Vaccine::toJson() const
{ {
web::json::value val = web::json::value::object(); web::json::value val = web::json::value::object();
if(m_dateIsSet) if(m_dateIsSet)
{ {
val[utility::conversions::to_string_t(U("date"))] = ModelBase::toJson(m_date); val[utility::conversions::to_string_t(U("date"))] = ModelBase::toJson(m_date);
} }
if(m_BoosterRequiredIsSet) if(m_BoosterRequiredIsSet)
{ {
val[utility::conversions::to_string_t(U("boosterRequired"))] = ModelBase::toJson(m_BoosterRequired); val[utility::conversions::to_string_t(U("boosterRequired"))] = ModelBase::toJson(m_BoosterRequired);
} }
return val; return val;
} }
@ -65,6 +67,7 @@ bool Vaccine::fromJson(const web::json::value& val)
std::shared_ptr<AnyType> refVal_setDate; std::shared_ptr<AnyType> refVal_setDate;
ok &= ModelBase::fromJson(fieldValue, refVal_setDate); ok &= ModelBase::fromJson(fieldValue, refVal_setDate);
setDate(refVal_setDate); setDate(refVal_setDate);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("boosterRequired")))) 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; bool refVal_setBoosterRequired;
ok &= ModelBase::fromJson(fieldValue, refVal_setBoosterRequired); ok &= ModelBase::fromJson(fieldValue, refVal_setBoosterRequired);
setBoosterRequired(refVal_setBoosterRequired); setBoosterRequired(refVal_setBoosterRequired);
} }
} }
return ok; return ok;
@ -90,10 +94,12 @@ void Vaccine::toMultipart(std::shared_ptr<MultipartFormData> multipart, const ut
if(m_dateIsSet) if(m_dateIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("date")), m_date)); multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("date")), m_date));
} }
if(m_BoosterRequiredIsSet) if(m_BoosterRequiredIsSet)
{ {
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("boosterRequired")), m_BoosterRequired)); 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; std::shared_ptr<AnyType> refVal_setDate;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("date"))), refVal_setDate ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("date"))), refVal_setDate );
setDate(refVal_setDate); setDate(refVal_setDate);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("boosterRequired")))) if(multipart->hasContent(utility::conversions::to_string_t(U("boosterRequired"))))
{ {
bool refVal_setBoosterRequired; bool refVal_setBoosterRequired;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("boosterRequired"))), refVal_setBoosterRequired ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("boosterRequired"))), refVal_setBoosterRequired );
setBoosterRequired(refVal_setBoosterRequired); setBoosterRequired(refVal_setBoosterRequired);
} }
return ok; return ok;
} }
std::shared_ptr<AnyType> Vaccine::getDate() const std::shared_ptr<AnyType> Vaccine::getDate() const
{ {
return m_date; return m_date;
} }
void Vaccine::setDate(const std::shared_ptr<AnyType>& value) void Vaccine::setDate(const std::shared_ptr<AnyType>& value)
{ {
m_date = value; m_date = value;
@ -141,6 +153,7 @@ void Vaccine::unsetdate()
{ {
m_dateIsSet = false; m_dateIsSet = false;
} }
bool Vaccine::isBoosterRequired() const bool Vaccine::isBoosterRequired() const
{ {
return m_BoosterRequired; return m_BoosterRequired;
@ -161,6 +174,7 @@ void Vaccine::unsetBoosterRequired()
{ {
m_BoosterRequiredIsSet = false; m_BoosterRequiredIsSet = false;
} }
} }
} }
} }