[cpp rest-sdk] Constness (#1295)

* Improve method signatures to use const when the value won't change

* Update PetStore

* Change setters for non-primitive types to receive const reference parameters

* Update PetStore
This commit is contained in:
Juan Eugenio Abadie
2018-10-28 04:01:52 -03:00
committed by sunn
parent 107467497c
commit d80f3a6197
42 changed files with 270 additions and 208 deletions

View File

@@ -36,7 +36,7 @@ public:
void validate() override;
web::json::value toJson() const override;
void fromJson(web::json::value& json) override;
void fromJson(const web::json::value& json) override;
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
void fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
@@ -54,7 +54,14 @@ public:
{{/isNotContainer}}{{^required}}bool {{nameInCamelCase}}IsSet() const;
void unset{{name}}();
{{/required}}
{{#isPrimitiveType}}
void {{setter}}({{{dataType}}} value);
{{/isPrimitiveType}}
{{^isPrimitiveType}}
void {{setter}}(const {{{dataType}}}& value);
{{/isPrimitiveType}}
{{/isInherited}}
{{/vars}}

View File

@@ -126,7 +126,7 @@ web::json::value {{classname}}::toJson() const
return val;
}
void {{classname}}::fromJson(web::json::value& val)
void {{classname}}::fromJson(const web::json::value& val)
{
{{#parent}}
this->{{{parent}}}::fromJson(val);
@@ -140,7 +140,7 @@ void {{classname}}::fromJson(web::json::value& val)
{{^required}}
if(val.has_field(utility::conversions::to_string_t("{{baseName}}")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("{{baseName}}")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("{{baseName}}"));
if(!fieldValue.is_null())
{
{{setter}}(ModelBase::{{baseType}}FromJson(fieldValue));
@@ -148,7 +148,7 @@ void {{classname}}::fromJson(web::json::value& val)
}
{{/required}}
{{#required}}
{{setter}}(ModelBase::{{baseType}}FromJson(val[utility::conversions::to_string_t("{{baseName}}")]));
{{setter}}(ModelBase::{{baseType}}FromJson(val.at(utility::conversions::to_string_t("{{baseName}}"))));
{{/required}}
{{/isMapContainer}}
{{/isListContainer}}
@@ -161,7 +161,7 @@ void {{classname}}::fromJson(web::json::value& val)
if(val.has_field(utility::conversions::to_string_t("{{baseName}}")))
{
{{/required}}
for( auto& item : val[utility::conversions::to_string_t("{{baseName}}")].as_array() )
for( auto& item : val.at(utility::conversions::to_string_t("{{baseName}}")).as_array() )
{
{{#items.isPrimitiveType}}
m_{{name}}.push_back(ModelBase::{{items.baseType}}FromJson(item));
@@ -202,21 +202,21 @@ void {{classname}}::fromJson(web::json::value& val)
if(val.has_field(utility::conversions::to_string_t("{{baseName}}")))
{
{{/required}}
for( auto& item : val[utility::conversions::to_string_t("{{baseName}}")].as_array() )
for( const auto& item : val.at(utility::conversions::to_string_t("{{baseName}}")).as_array() )
{
if(item.has_field(utility::conversions::to_string_t("key")))
{
utility::string_t key = ModelBase::stringFromJson(item[utility::conversions::to_string_t("key")]);
utility::string_t key = ModelBase::stringFromJson(item.at(utility::conversions::to_string_t("key")));
{{#items.isPrimitiveType}}
m_{{name}}.insert(std::pair<utility::string_t,{{{items.datatype}}}>( key, ModelBase::{{items.baseType}}FromJson(item[utility::conversions::to_string_t("value")])));
m_{{name}}.insert(std::pair<utility::string_t,{{{items.datatype}}}>( key, ModelBase::{{items.baseType}}FromJson(item.at(utility::conversions::to_string_t("value")))));
{{/items.isPrimitiveType}}
{{^items.isPrimitiveType}}
{{#items.isString}}
m_{{name}}.insert(std::pair<utility::string_t,{{{items.datatype}}}>( key, ModelBase::stringFromJson(item[utility::conversions::to_string_t("value")])));
m_{{name}}.insert(std::pair<utility::string_t,{{{items.datatype}}}>( key, ModelBase::stringFromJson(item.at(utility::conversions::to_string_t("value")))));
{{/items.isString}}
{{^items.isString}}
{{#items.isDateTime}}
m_{{name}}.insert(std::pair<utility::string_t,{{{items.datatype}}}>( key, ModelBase::dateFromJson(item[utility::conversions::to_string_t("value")])));
m_{{name}}.insert(std::pair<utility::string_t,{{{items.datatype}}}>( key, ModelBase::dateFromJson(item.at(utility::conversions::to_string_t("value")))));
{{/items.isDateTime}}
{{^items.isDateTime}}
if(item.is_null())
@@ -226,7 +226,7 @@ void {{classname}}::fromJson(web::json::value& val)
else
{
{{{items.datatype}}} newItem({{{items.defaultValue}}});
newItem->fromJson(item[utility::conversions::to_string_t("value")]);
newItem->fromJson(item.at(utility::conversions::to_string_t("value")));
m_{{name}}.insert(std::pair<utility::string_t,{{{items.datatype}}}>( key, newItem ));
}
{{/items.isDateTime}}
@@ -245,7 +245,7 @@ void {{classname}}::fromJson(web::json::value& val)
{{^required}}
if(val.has_field(utility::conversions::to_string_t("{{baseName}}")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("{{baseName}}")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("{{baseName}}"));
if(!fieldValue.is_null())
{
{{#isString}}
@@ -271,7 +271,7 @@ void {{classname}}::fromJson(web::json::value& val)
{{/required}}
{{#required}}
{{#isString}}
{{setter}}(ModelBase::stringFromJson(val[utility::conversions::to_string_t("{{baseName}}")]));
{{setter}}(ModelBase::stringFromJson(val.at(utility::conversions::to_string_t("{{baseName}}"))));
{{/isString}}
{{#isByteArray}}
{{setter}}(ModelBase::stringFromJson(val[utility::conversions::to_string_t("{{baseName}}")]));
@@ -280,15 +280,15 @@ void {{classname}}::fromJson(web::json::value& val)
{{^isByteArray}}
{{#isDateTime}}
{{setter}}
(ModelBase::dateFromJson(val[utility::conversions::to_string_t("{{baseName}}")]));
(ModelBase::dateFromJson(val.at(utility::conversions::to_string_t("{{baseName}}"))));
{{/isDateTime}}
{{^isDateTime}}
{{#vendorExtensions.x-codegen-file}}
{{setter}}(ModelBase::fileFromJson(val[utility::conversions::to_string_t("{{baseName}}")]));
{{setter}}(ModelBase::fileFromJson(val.at(utility::conversions::to_string_t("{{baseName}}"))));
{{/vendorExtensions.x-codegen-file}}
{{^vendorExtensions.x-codegen-file}}
{{{dataType}}} new{{name}}({{{defaultValue}}});
new{{name}}->fromJson(val[utility::conversions::to_string_t("{{baseName}}")]);
new{{name}}->fromJson(val.at(utility::conversions::to_string_t("{{baseName}}")));
{{setter}}( new{{name}} );
{{/vendorExtensions.x-codegen-file}}
{{/isDateTime}}
@@ -596,26 +596,25 @@ void {{classname}}::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
{
return m_{{name}};
}
void {{classname}}::{{setter}}({{{dataType}}} value)
{
m_{{name}} = value;
{{^required}}m_{{name}}IsSet = true;{{/required}}
}
{{/isNotContainer}}
{{#isNotContainer}}
{{{dataType}}} {{classname}}::{{getter}}() const
{
return m_{{name}};
}
{{/isNotContainer}}
{{#isPrimitiveType}}
void {{classname}}::{{setter}}({{{dataType}}} value)
{{/isPrimitiveType}}
{{^isPrimitiveType}}
void {{classname}}::{{setter}}(const {{{dataType}}}& value)
{{/isPrimitiveType}}
{
m_{{name}} = value;
{{^required}}m_{{name}}IsSet = true;{{/required}}
}
{{/isNotContainer}}
{{^required}}
bool {{classname}}::{{nameInCamelCase}}IsSet() const
{

View File

@@ -30,7 +30,7 @@ public:
virtual void validate() = 0;
virtual web::json::value toJson() const = 0;
virtual void fromJson(web::json::value& json) = 0;
virtual void fromJson(const web::json::value& json) = 0;
virtual void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const = 0;
virtual void fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) = 0;
@@ -46,14 +46,14 @@ public:
template<class T>
static web::json::value toJson(const std::vector<T>& value);
static int64_t int64_tFromJson(web::json::value& val);
static int32_t int32_tFromJson(web::json::value& val);
static float floatFromJson(web::json::value& val);
static utility::string_t stringFromJson(web::json::value& val);
static utility::datetime dateFromJson(web::json::value& val);
static double doubleFromJson(web::json::value& val);
static bool boolFromJson(web::json::value& val);
static std::shared_ptr<HttpContent> fileFromJson(web::json::value& val);
static int64_t int64_tFromJson(const web::json::value& val);
static int32_t int32_tFromJson(const web::json::value& val);
static float floatFromJson(const web::json::value& val);
static utility::string_t stringFromJson(const web::json::value& val);
static utility::datetime dateFromJson(const web::json::value& val);
static double doubleFromJson(const web::json::value& val);
static bool boolFromJson(const web::json::value& val);
static std::shared_ptr<HttpContent> fileFromJson(const web::json::value& val);
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, const utility::string_t& value, const utility::string_t& contentType = utility::conversions::to_string_t(""));
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, const utility::datetime& value, const utility::string_t& contentType = utility::conversions::to_string_t(""));

View File

@@ -46,25 +46,25 @@ web::json::value ModelBase::toJson( std::shared_ptr<HttpContent> content )
return value;
}
std::shared_ptr<HttpContent> ModelBase::fileFromJson(web::json::value& val)
std::shared_ptr<HttpContent> ModelBase::fileFromJson(const web::json::value& val)
{
std::shared_ptr<HttpContent> content(new HttpContent);
if(val.has_field(utility::conversions::to_string_t("ContentDisposition")))
{
content->setContentDisposition( ModelBase::stringFromJson(val[utility::conversions::to_string_t("ContentDisposition")]) );
content->setContentDisposition( ModelBase::stringFromJson(val.at(utility::conversions::to_string_t("ContentDisposition"))) );
}
if(val.has_field(utility::conversions::to_string_t("ContentType")))
{
content->setContentType( ModelBase::stringFromJson(val[utility::conversions::to_string_t("ContentType")]) );
content->setContentType( ModelBase::stringFromJson(val.at(utility::conversions::to_string_t("ContentType"))) );
}
if(val.has_field(utility::conversions::to_string_t("FileName")))
{
content->setFileName( ModelBase::stringFromJson(val[utility::conversions::to_string_t("FileName")]) );
content->setFileName( ModelBase::stringFromJson(val.at(utility::conversions::to_string_t("FileName"))) );
}
if(val.has_field(utility::conversions::to_string_t("InputStream")))
{
content->setData( ModelBase::fromBase64( ModelBase::stringFromJson(val[utility::conversions::to_string_t("InputStream")]) ) );
content->setData( ModelBase::fromBase64( ModelBase::stringFromJson(val.at(utility::conversions::to_string_t("InputStream")))) );
}
return content;
@@ -263,32 +263,32 @@ std::shared_ptr<std::istream> ModelBase::fromBase64( const utility::string_t& en
return result;
}
int64_t ModelBase::int64_tFromJson(web::json::value& val)
int64_t ModelBase::int64_tFromJson(const web::json::value& val)
{
return val.as_number().to_int64();
}
int32_t ModelBase::int32_tFromJson(web::json::value& val)
int32_t ModelBase::int32_tFromJson(const web::json::value& val)
{
return val.as_integer();
}
float ModelBase::floatFromJson(web::json::value& val)
float ModelBase::floatFromJson(const web::json::value& val)
{
return static_cast<float>(val.as_double());
}
utility::string_t ModelBase::stringFromJson(web::json::value& val)
utility::string_t ModelBase::stringFromJson(const web::json::value& val)
{
return val.is_string() ? val.as_string() : utility::conversions::to_string_t("");
}
utility::datetime ModelBase::dateFromJson(web::json::value& val)
utility::datetime ModelBase::dateFromJson(const web::json::value& val)
{
return utility::datetime::from_string(val.as_string(), utility::datetime::ISO_8601);
}
bool ModelBase::boolFromJson(web::json::value& val)
bool ModelBase::boolFromJson(const web::json::value& val)
{
return val.as_bool();
}
double ModelBase::doubleFromJson(web::json::value& val)
double ModelBase::doubleFromJson(const web::json::value& val)
{
return val.as_double();
}

View File

@@ -29,7 +29,7 @@ public:
void validate() override;
web::json::value toJson() const override;
void fromJson(web::json::value& json) override;
void fromJson(const web::json::value& json) override;
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
void fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;

View File

@@ -24,7 +24,7 @@ web::json::value Object::toJson() const
return m_object;
}
void Object::fromJson(web::json::value& val)
void Object::fromJson(const web::json::value& val)
{
if (val.is_object())
{

View File

@@ -1 +1 @@
3.3.1-SNAPSHOT
3.3.0-SNAPSHOT

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -57,25 +57,25 @@ web::json::value ModelBase::toJson( std::shared_ptr<HttpContent> content )
return value;
}
std::shared_ptr<HttpContent> ModelBase::fileFromJson(web::json::value& val)
std::shared_ptr<HttpContent> ModelBase::fileFromJson(const web::json::value& val)
{
std::shared_ptr<HttpContent> content(new HttpContent);
if(val.has_field(utility::conversions::to_string_t("ContentDisposition")))
{
content->setContentDisposition( ModelBase::stringFromJson(val[utility::conversions::to_string_t("ContentDisposition")]) );
content->setContentDisposition( ModelBase::stringFromJson(val.at(utility::conversions::to_string_t("ContentDisposition"))) );
}
if(val.has_field(utility::conversions::to_string_t("ContentType")))
{
content->setContentType( ModelBase::stringFromJson(val[utility::conversions::to_string_t("ContentType")]) );
content->setContentType( ModelBase::stringFromJson(val.at(utility::conversions::to_string_t("ContentType"))) );
}
if(val.has_field(utility::conversions::to_string_t("FileName")))
{
content->setFileName( ModelBase::stringFromJson(val[utility::conversions::to_string_t("FileName")]) );
content->setFileName( ModelBase::stringFromJson(val.at(utility::conversions::to_string_t("FileName"))) );
}
if(val.has_field(utility::conversions::to_string_t("InputStream")))
{
content->setData( ModelBase::fromBase64( ModelBase::stringFromJson(val[utility::conversions::to_string_t("InputStream")]) ) );
content->setData( ModelBase::fromBase64( ModelBase::stringFromJson(val.at(utility::conversions::to_string_t("InputStream")))) );
}
return content;
@@ -274,32 +274,32 @@ std::shared_ptr<std::istream> ModelBase::fromBase64( const utility::string_t& en
return result;
}
int64_t ModelBase::int64_tFromJson(web::json::value& val)
int64_t ModelBase::int64_tFromJson(const web::json::value& val)
{
return val.as_number().to_int64();
}
int32_t ModelBase::int32_tFromJson(web::json::value& val)
int32_t ModelBase::int32_tFromJson(const web::json::value& val)
{
return val.as_integer();
}
float ModelBase::floatFromJson(web::json::value& val)
float ModelBase::floatFromJson(const web::json::value& val)
{
return static_cast<float>(val.as_double());
}
utility::string_t ModelBase::stringFromJson(web::json::value& val)
utility::string_t ModelBase::stringFromJson(const web::json::value& val)
{
return val.is_string() ? val.as_string() : utility::conversions::to_string_t("");
}
utility::datetime ModelBase::dateFromJson(web::json::value& val)
utility::datetime ModelBase::dateFromJson(const web::json::value& val)
{
return utility::datetime::from_string(val.as_string(), utility::datetime::ISO_8601);
}
bool ModelBase::boolFromJson(web::json::value& val)
bool ModelBase::boolFromJson(const web::json::value& val)
{
return val.as_bool();
}
double ModelBase::doubleFromJson(web::json::value& val)
double ModelBase::doubleFromJson(const web::json::value& val)
{
return val.as_double();
}

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -41,7 +41,7 @@ public:
virtual void validate() = 0;
virtual web::json::value toJson() const = 0;
virtual void fromJson(web::json::value& json) = 0;
virtual void fromJson(const web::json::value& json) = 0;
virtual void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const = 0;
virtual void fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) = 0;
@@ -57,14 +57,14 @@ public:
template<class T>
static web::json::value toJson(const std::vector<T>& value);
static int64_t int64_tFromJson(web::json::value& val);
static int32_t int32_tFromJson(web::json::value& val);
static float floatFromJson(web::json::value& val);
static utility::string_t stringFromJson(web::json::value& val);
static utility::datetime dateFromJson(web::json::value& val);
static double doubleFromJson(web::json::value& val);
static bool boolFromJson(web::json::value& val);
static std::shared_ptr<HttpContent> fileFromJson(web::json::value& val);
static int64_t int64_tFromJson(const web::json::value& val);
static int32_t int32_tFromJson(const web::json::value& val);
static float floatFromJson(const web::json::value& val);
static utility::string_t stringFromJson(const web::json::value& val);
static utility::datetime dateFromJson(const web::json::value& val);
static double doubleFromJson(const web::json::value& val);
static bool boolFromJson(const web::json::value& val);
static std::shared_ptr<HttpContent> fileFromJson(const web::json::value& val);
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, const utility::string_t& value, const utility::string_t& contentType = utility::conversions::to_string_t(""));
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, const utility::datetime& value, const utility::string_t& contentType = utility::conversions::to_string_t(""));

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -35,7 +35,7 @@ web::json::value Object::toJson() const
return m_object;
}
void Object::fromJson(web::json::value& val)
void Object::fromJson(const web::json::value& val)
{
if (val.is_object())
{

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -40,7 +40,7 @@ public:
void validate() override;
web::json::value toJson() const override;
void fromJson(web::json::value& json) override;
void fromJson(const web::json::value& json) override;
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
void fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -25,7 +25,7 @@
#include "HttpContent.h"
#include "Pet.h"
#include <cpprest/details/basic_types.h>
#include "../ModelBase.h"
#include <boost/optional.hpp>
@@ -63,7 +63,7 @@ public:
///
/// </remarks>
/// <param name="petId">Pet id to delete</param>
/// <param name="apiKey"> (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="apiKey"> (optional)</param>
pplx::task<void> deletePet(
int64_t petId,
boost::optional<utility::string_t> apiKey

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -24,7 +24,7 @@
#include "Order.h"
#include <map>
#include <cpprest/details/basic_types.h>
#include "../ModelBase.h"
#include <boost/optional.hpp>

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -24,7 +24,7 @@
#include "User.h"
#include <vector>
#include <cpprest/details/basic_types.h>
#include "../ModelBase.h"
#include <boost/optional.hpp>

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -57,11 +57,11 @@ web::json::value ApiResponse::toJson() const
return val;
}
void ApiResponse::fromJson(web::json::value& val)
void ApiResponse::fromJson(const web::json::value& val)
{
if(val.has_field(utility::conversions::to_string_t("code")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("code")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("code"));
if(!fieldValue.is_null())
{
setCode(ModelBase::int32_tFromJson(fieldValue));
@@ -69,7 +69,7 @@ void ApiResponse::fromJson(web::json::value& val)
}
if(val.has_field(utility::conversions::to_string_t("type")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("type")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("type"));
if(!fieldValue.is_null())
{
setType(ModelBase::stringFromJson(fieldValue));
@@ -77,7 +77,7 @@ void ApiResponse::fromJson(web::json::value& val)
}
if(val.has_field(utility::conversions::to_string_t("message")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("message")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("message"));
if(!fieldValue.is_null())
{
setMessage(ModelBase::stringFromJson(fieldValue));
@@ -134,12 +134,12 @@ int32_t ApiResponse::getCode() const
return m_Code;
}
void ApiResponse::setCode(int32_t value)
{
m_Code = value;
m_CodeIsSet = true;
}
bool ApiResponse::codeIsSet() const
{
return m_CodeIsSet;
@@ -155,12 +155,12 @@ utility::string_t ApiResponse::getType() const
return m_Type;
}
void ApiResponse::setType(utility::string_t value)
void ApiResponse::setType(const utility::string_t& value)
{
m_Type = value;
m_TypeIsSet = true;
}
bool ApiResponse::typeIsSet() const
{
return m_TypeIsSet;
@@ -176,12 +176,12 @@ utility::string_t ApiResponse::getMessage() const
return m_Message;
}
void ApiResponse::setMessage(utility::string_t value)
void ApiResponse::setMessage(const utility::string_t& value)
{
m_Message = value;
m_MessageIsSet = true;
}
bool ApiResponse::messageIsSet() const
{
return m_MessageIsSet;

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -44,7 +44,7 @@ public:
void validate() override;
web::json::value toJson() const override;
void fromJson(web::json::value& json) override;
void fromJson(const web::json::value& json) override;
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
void fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
@@ -58,21 +58,27 @@ public:
int32_t getCode() const;
bool codeIsSet() const;
void unsetCode();
void setCode(int32_t value);
/// <summary>
///
/// </summary>
utility::string_t getType() const;
bool typeIsSet() const;
void unsetType();
void setType(utility::string_t value);
void setType(const utility::string_t& value);
/// <summary>
///
/// </summary>
utility::string_t getMessage() const;
bool messageIsSet() const;
void unsetMessage();
void setMessage(utility::string_t value);
void setMessage(const utility::string_t& value);
protected:
int32_t m_Code;

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -51,11 +51,11 @@ web::json::value Category::toJson() const
return val;
}
void Category::fromJson(web::json::value& val)
void Category::fromJson(const web::json::value& val)
{
if(val.has_field(utility::conversions::to_string_t("id")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("id")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("id"));
if(!fieldValue.is_null())
{
setId(ModelBase::int64_tFromJson(fieldValue));
@@ -63,7 +63,7 @@ void Category::fromJson(web::json::value& val)
}
if(val.has_field(utility::conversions::to_string_t("name")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("name")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("name"));
if(!fieldValue.is_null())
{
setName(ModelBase::stringFromJson(fieldValue));
@@ -112,12 +112,12 @@ int64_t Category::getId() const
return m_Id;
}
void Category::setId(int64_t value)
{
m_Id = value;
m_IdIsSet = true;
}
bool Category::idIsSet() const
{
return m_IdIsSet;
@@ -133,12 +133,12 @@ utility::string_t Category::getName() const
return m_Name;
}
void Category::setName(utility::string_t value)
void Category::setName(const utility::string_t& value)
{
m_Name = value;
m_NameIsSet = true;
}
bool Category::nameIsSet() const
{
return m_NameIsSet;

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -44,7 +44,7 @@ public:
void validate() override;
web::json::value toJson() const override;
void fromJson(web::json::value& json) override;
void fromJson(const web::json::value& json) override;
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
void fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
@@ -58,14 +58,18 @@ public:
int64_t getId() const;
bool idIsSet() const;
void unsetId();
void setId(int64_t value);
/// <summary>
///
/// </summary>
utility::string_t getName() const;
bool nameIsSet() const;
void unsetName();
void setName(utility::string_t value);
void setName(const utility::string_t& value);
protected:
int64_t m_Id;

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -75,11 +75,11 @@ web::json::value Order::toJson() const
return val;
}
void Order::fromJson(web::json::value& val)
void Order::fromJson(const web::json::value& val)
{
if(val.has_field(utility::conversions::to_string_t("id")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("id")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("id"));
if(!fieldValue.is_null())
{
setId(ModelBase::int64_tFromJson(fieldValue));
@@ -87,7 +87,7 @@ void Order::fromJson(web::json::value& val)
}
if(val.has_field(utility::conversions::to_string_t("petId")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("petId")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("petId"));
if(!fieldValue.is_null())
{
setPetId(ModelBase::int64_tFromJson(fieldValue));
@@ -95,7 +95,7 @@ void Order::fromJson(web::json::value& val)
}
if(val.has_field(utility::conversions::to_string_t("quantity")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("quantity")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("quantity"));
if(!fieldValue.is_null())
{
setQuantity(ModelBase::int32_tFromJson(fieldValue));
@@ -103,7 +103,7 @@ void Order::fromJson(web::json::value& val)
}
if(val.has_field(utility::conversions::to_string_t("shipDate")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("shipDate")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("shipDate"));
if(!fieldValue.is_null())
{
setShipDate(ModelBase::dateFromJson(fieldValue));
@@ -111,7 +111,7 @@ void Order::fromJson(web::json::value& val)
}
if(val.has_field(utility::conversions::to_string_t("status")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("status")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("status"));
if(!fieldValue.is_null())
{
setStatus(ModelBase::stringFromJson(fieldValue));
@@ -119,7 +119,7 @@ void Order::fromJson(web::json::value& val)
}
if(val.has_field(utility::conversions::to_string_t("complete")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("complete")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("complete"));
if(!fieldValue.is_null())
{
setComplete(ModelBase::boolFromJson(fieldValue));
@@ -200,12 +200,12 @@ int64_t Order::getId() const
return m_Id;
}
void Order::setId(int64_t value)
{
m_Id = value;
m_IdIsSet = true;
}
bool Order::idIsSet() const
{
return m_IdIsSet;
@@ -221,12 +221,12 @@ int64_t Order::getPetId() const
return m_PetId;
}
void Order::setPetId(int64_t value)
{
m_PetId = value;
m_PetIdIsSet = true;
}
bool Order::petIdIsSet() const
{
return m_PetIdIsSet;
@@ -242,12 +242,12 @@ int32_t Order::getQuantity() const
return m_Quantity;
}
void Order::setQuantity(int32_t value)
{
m_Quantity = value;
m_QuantityIsSet = true;
}
bool Order::quantityIsSet() const
{
return m_QuantityIsSet;
@@ -263,12 +263,12 @@ utility::datetime Order::getShipDate() const
return m_ShipDate;
}
void Order::setShipDate(utility::datetime value)
void Order::setShipDate(const utility::datetime& value)
{
m_ShipDate = value;
m_ShipDateIsSet = true;
}
bool Order::shipDateIsSet() const
{
return m_ShipDateIsSet;
@@ -284,12 +284,12 @@ utility::string_t Order::getStatus() const
return m_Status;
}
void Order::setStatus(utility::string_t value)
void Order::setStatus(const utility::string_t& value)
{
m_Status = value;
m_StatusIsSet = true;
}
bool Order::statusIsSet() const
{
return m_StatusIsSet;
@@ -305,12 +305,12 @@ bool Order::isComplete() const
return m_Complete;
}
void Order::setComplete(bool value)
{
m_Complete = value;
m_CompleteIsSet = true;
}
bool Order::completeIsSet() const
{
return m_CompleteIsSet;

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -44,7 +44,7 @@ public:
void validate() override;
web::json::value toJson() const override;
void fromJson(web::json::value& json) override;
void fromJson(const web::json::value& json) override;
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
void fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
@@ -58,43 +58,55 @@ public:
int64_t getId() const;
bool idIsSet() const;
void unsetId();
void setId(int64_t value);
/// <summary>
///
/// </summary>
int64_t getPetId() const;
bool petIdIsSet() const;
void unsetPetId();
void setPetId(int64_t value);
/// <summary>
///
/// </summary>
int32_t getQuantity() const;
bool quantityIsSet() const;
void unsetQuantity();
void setQuantity(int32_t value);
/// <summary>
///
/// </summary>
utility::datetime getShipDate() const;
bool shipDateIsSet() const;
void unsetShipDate();
void setShipDate(utility::datetime value);
void setShipDate(const utility::datetime& value);
/// <summary>
/// Order Status
/// </summary>
utility::string_t getStatus() const;
bool statusIsSet() const;
void unsetStatus();
void setStatus(utility::string_t value);
void setStatus(const utility::string_t& value);
/// <summary>
///
/// </summary>
bool isComplete() const;
bool completeIsSet() const;
void unsetComplete();
void setComplete(bool value);
protected:
int64_t m_Id;
bool m_IdIsSet;

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -78,11 +78,11 @@ web::json::value Pet::toJson() const
return val;
}
void Pet::fromJson(web::json::value& val)
void Pet::fromJson(const web::json::value& val)
{
if(val.has_field(utility::conversions::to_string_t("id")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("id")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("id"));
if(!fieldValue.is_null())
{
setId(ModelBase::int64_tFromJson(fieldValue));
@@ -90,7 +90,7 @@ void Pet::fromJson(web::json::value& val)
}
if(val.has_field(utility::conversions::to_string_t("category")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("category")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("category"));
if(!fieldValue.is_null())
{
std::shared_ptr<Category> newItem(new Category());
@@ -98,11 +98,11 @@ void Pet::fromJson(web::json::value& val)
setCategory( newItem );
}
}
setName(ModelBase::stringFromJson(val[utility::conversions::to_string_t("name")]));
setName(ModelBase::stringFromJson(val.at(utility::conversions::to_string_t("name"))));
{
m_PhotoUrls.clear();
std::vector<web::json::value> jsonArray;
for( auto& item : val[utility::conversions::to_string_t("photoUrls")].as_array() )
for( auto& item : val.at(utility::conversions::to_string_t("photoUrls")).as_array() )
{
m_PhotoUrls.push_back(ModelBase::stringFromJson(item));
}
@@ -112,7 +112,7 @@ void Pet::fromJson(web::json::value& val)
std::vector<web::json::value> jsonArray;
if(val.has_field(utility::conversions::to_string_t("tags")))
{
for( auto& item : val[utility::conversions::to_string_t("tags")].as_array() )
for( auto& item : val.at(utility::conversions::to_string_t("tags")).as_array() )
{
if(item.is_null())
{
@@ -129,7 +129,7 @@ void Pet::fromJson(web::json::value& val)
}
if(val.has_field(utility::conversions::to_string_t("status")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("status")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("status"));
if(!fieldValue.is_null())
{
setStatus(ModelBase::stringFromJson(fieldValue));
@@ -246,12 +246,12 @@ int64_t Pet::getId() const
return m_Id;
}
void Pet::setId(int64_t value)
{
m_Id = value;
m_IdIsSet = true;
}
bool Pet::idIsSet() const
{
return m_IdIsSet;
@@ -267,12 +267,12 @@ std::shared_ptr<Category> Pet::getCategory() const
return m_Category;
}
void Pet::setCategory(std::shared_ptr<Category> value)
void Pet::setCategory(const std::shared_ptr<Category>& value)
{
m_Category = value;
m_CategoryIsSet = true;
}
bool Pet::categoryIsSet() const
{
return m_CategoryIsSet;
@@ -288,32 +288,34 @@ utility::string_t Pet::getName() const
return m_Name;
}
void Pet::setName(utility::string_t value)
void Pet::setName(const utility::string_t& value)
{
m_Name = value;
}
std::vector<utility::string_t>& Pet::getPhotoUrls()
{
return m_PhotoUrls;
}
void Pet::setPhotoUrls(std::vector<utility::string_t> value)
void Pet::setPhotoUrls(const std::vector<utility::string_t>& value)
{
m_PhotoUrls = value;
}
std::vector<std::shared_ptr<Tag>>& Pet::getTags()
{
return m_Tags;
}
void Pet::setTags(std::vector<std::shared_ptr<Tag>> value)
void Pet::setTags(const std::vector<std::shared_ptr<Tag>>& value)
{
m_Tags = value;
m_TagsIsSet = true;
}
bool Pet::tagsIsSet() const
{
return m_TagsIsSet;
@@ -329,12 +331,12 @@ utility::string_t Pet::getStatus() const
return m_Status;
}
void Pet::setStatus(utility::string_t value)
void Pet::setStatus(const utility::string_t& value)
{
m_Status = value;
m_StatusIsSet = true;
}
bool Pet::statusIsSet() const
{
return m_StatusIsSet;

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -47,7 +47,7 @@ public:
void validate() override;
web::json::value toJson() const override;
void fromJson(web::json::value& json) override;
void fromJson(const web::json::value& json) override;
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
void fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
@@ -61,38 +61,50 @@ public:
int64_t getId() const;
bool idIsSet() const;
void unsetId();
void setId(int64_t value);
/// <summary>
///
/// </summary>
std::shared_ptr<Category> getCategory() const;
bool categoryIsSet() const;
void unsetCategory();
void setCategory(std::shared_ptr<Category> value);
void setCategory(const std::shared_ptr<Category>& value);
/// <summary>
///
/// </summary>
utility::string_t getName() const;
void setName(utility::string_t value);
void setName(const utility::string_t& value);
/// <summary>
///
/// </summary>
std::vector<utility::string_t>& getPhotoUrls();
void setPhotoUrls(std::vector<utility::string_t> value);
void setPhotoUrls(const std::vector<utility::string_t>& value);
/// <summary>
///
/// </summary>
std::vector<std::shared_ptr<Tag>>& getTags();
bool tagsIsSet() const;
void unsetTags();
void setTags(std::vector<std::shared_ptr<Tag>> value);
void setTags(const std::vector<std::shared_ptr<Tag>>& value);
/// <summary>
/// pet status in the store
/// </summary>
utility::string_t getStatus() const;
bool statusIsSet() const;
void unsetStatus();
void setStatus(utility::string_t value);
void setStatus(const utility::string_t& value);
protected:
int64_t m_Id;

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -51,11 +51,11 @@ web::json::value Tag::toJson() const
return val;
}
void Tag::fromJson(web::json::value& val)
void Tag::fromJson(const web::json::value& val)
{
if(val.has_field(utility::conversions::to_string_t("id")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("id")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("id"));
if(!fieldValue.is_null())
{
setId(ModelBase::int64_tFromJson(fieldValue));
@@ -63,7 +63,7 @@ void Tag::fromJson(web::json::value& val)
}
if(val.has_field(utility::conversions::to_string_t("name")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("name")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("name"));
if(!fieldValue.is_null())
{
setName(ModelBase::stringFromJson(fieldValue));
@@ -112,12 +112,12 @@ int64_t Tag::getId() const
return m_Id;
}
void Tag::setId(int64_t value)
{
m_Id = value;
m_IdIsSet = true;
}
bool Tag::idIsSet() const
{
return m_IdIsSet;
@@ -133,12 +133,12 @@ utility::string_t Tag::getName() const
return m_Name;
}
void Tag::setName(utility::string_t value)
void Tag::setName(const utility::string_t& value)
{
m_Name = value;
m_NameIsSet = true;
}
bool Tag::nameIsSet() const
{
return m_NameIsSet;

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -44,7 +44,7 @@ public:
void validate() override;
web::json::value toJson() const override;
void fromJson(web::json::value& json) override;
void fromJson(const web::json::value& json) override;
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
void fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
@@ -58,14 +58,18 @@ public:
int64_t getId() const;
bool idIsSet() const;
void unsetId();
void setId(int64_t value);
/// <summary>
///
/// </summary>
utility::string_t getName() const;
bool nameIsSet() const;
void unsetName();
void setName(utility::string_t value);
void setName(const utility::string_t& value);
protected:
int64_t m_Id;

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -87,11 +87,11 @@ web::json::value User::toJson() const
return val;
}
void User::fromJson(web::json::value& val)
void User::fromJson(const web::json::value& val)
{
if(val.has_field(utility::conversions::to_string_t("id")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("id")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("id"));
if(!fieldValue.is_null())
{
setId(ModelBase::int64_tFromJson(fieldValue));
@@ -99,7 +99,7 @@ void User::fromJson(web::json::value& val)
}
if(val.has_field(utility::conversions::to_string_t("username")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("username")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("username"));
if(!fieldValue.is_null())
{
setUsername(ModelBase::stringFromJson(fieldValue));
@@ -107,7 +107,7 @@ void User::fromJson(web::json::value& val)
}
if(val.has_field(utility::conversions::to_string_t("firstName")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("firstName")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("firstName"));
if(!fieldValue.is_null())
{
setFirstName(ModelBase::stringFromJson(fieldValue));
@@ -115,7 +115,7 @@ void User::fromJson(web::json::value& val)
}
if(val.has_field(utility::conversions::to_string_t("lastName")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("lastName")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("lastName"));
if(!fieldValue.is_null())
{
setLastName(ModelBase::stringFromJson(fieldValue));
@@ -123,7 +123,7 @@ void User::fromJson(web::json::value& val)
}
if(val.has_field(utility::conversions::to_string_t("email")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("email")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("email"));
if(!fieldValue.is_null())
{
setEmail(ModelBase::stringFromJson(fieldValue));
@@ -131,7 +131,7 @@ void User::fromJson(web::json::value& val)
}
if(val.has_field(utility::conversions::to_string_t("password")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("password")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("password"));
if(!fieldValue.is_null())
{
setPassword(ModelBase::stringFromJson(fieldValue));
@@ -139,7 +139,7 @@ void User::fromJson(web::json::value& val)
}
if(val.has_field(utility::conversions::to_string_t("phone")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("phone")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("phone"));
if(!fieldValue.is_null())
{
setPhone(ModelBase::stringFromJson(fieldValue));
@@ -147,7 +147,7 @@ void User::fromJson(web::json::value& val)
}
if(val.has_field(utility::conversions::to_string_t("userStatus")))
{
web::json::value& fieldValue = val[utility::conversions::to_string_t("userStatus")];
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("userStatus"));
if(!fieldValue.is_null())
{
setUserStatus(ModelBase::int32_tFromJson(fieldValue));
@@ -244,12 +244,12 @@ int64_t User::getId() const
return m_Id;
}
void User::setId(int64_t value)
{
m_Id = value;
m_IdIsSet = true;
}
bool User::idIsSet() const
{
return m_IdIsSet;
@@ -265,12 +265,12 @@ utility::string_t User::getUsername() const
return m_Username;
}
void User::setUsername(utility::string_t value)
void User::setUsername(const utility::string_t& value)
{
m_Username = value;
m_UsernameIsSet = true;
}
bool User::usernameIsSet() const
{
return m_UsernameIsSet;
@@ -286,12 +286,12 @@ utility::string_t User::getFirstName() const
return m_FirstName;
}
void User::setFirstName(utility::string_t value)
void User::setFirstName(const utility::string_t& value)
{
m_FirstName = value;
m_FirstNameIsSet = true;
}
bool User::firstNameIsSet() const
{
return m_FirstNameIsSet;
@@ -307,12 +307,12 @@ utility::string_t User::getLastName() const
return m_LastName;
}
void User::setLastName(utility::string_t value)
void User::setLastName(const utility::string_t& value)
{
m_LastName = value;
m_LastNameIsSet = true;
}
bool User::lastNameIsSet() const
{
return m_LastNameIsSet;
@@ -328,12 +328,12 @@ utility::string_t User::getEmail() const
return m_Email;
}
void User::setEmail(utility::string_t value)
void User::setEmail(const utility::string_t& value)
{
m_Email = value;
m_EmailIsSet = true;
}
bool User::emailIsSet() const
{
return m_EmailIsSet;
@@ -349,12 +349,12 @@ utility::string_t User::getPassword() const
return m_Password;
}
void User::setPassword(utility::string_t value)
void User::setPassword(const utility::string_t& value)
{
m_Password = value;
m_PasswordIsSet = true;
}
bool User::passwordIsSet() const
{
return m_PasswordIsSet;
@@ -370,12 +370,12 @@ utility::string_t User::getPhone() const
return m_Phone;
}
void User::setPhone(utility::string_t value)
void User::setPhone(const utility::string_t& value)
{
m_Phone = value;
m_PhoneIsSet = true;
}
bool User::phoneIsSet() const
{
return m_PhoneIsSet;
@@ -391,12 +391,12 @@ int32_t User::getUserStatus() const
return m_UserStatus;
}
void User::setUserStatus(int32_t value)
{
m_UserStatus = value;
m_UserStatusIsSet = true;
}
bool User::userStatusIsSet() const
{
return m_UserStatusIsSet;

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -44,7 +44,7 @@ public:
void validate() override;
web::json::value toJson() const override;
void fromJson(web::json::value& json) override;
void fromJson(const web::json::value& json) override;
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
void fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
@@ -58,57 +58,73 @@ public:
int64_t getId() const;
bool idIsSet() const;
void unsetId();
void setId(int64_t value);
/// <summary>
///
/// </summary>
utility::string_t getUsername() const;
bool usernameIsSet() const;
void unsetUsername();
void setUsername(utility::string_t value);
void setUsername(const utility::string_t& value);
/// <summary>
///
/// </summary>
utility::string_t getFirstName() const;
bool firstNameIsSet() const;
void unsetFirstName();
void setFirstName(utility::string_t value);
void setFirstName(const utility::string_t& value);
/// <summary>
///
/// </summary>
utility::string_t getLastName() const;
bool lastNameIsSet() const;
void unsetLastName();
void setLastName(utility::string_t value);
void setLastName(const utility::string_t& value);
/// <summary>
///
/// </summary>
utility::string_t getEmail() const;
bool emailIsSet() const;
void unsetEmail();
void setEmail(utility::string_t value);
void setEmail(const utility::string_t& value);
/// <summary>
///
/// </summary>
utility::string_t getPassword() const;
bool passwordIsSet() const;
void unsetPassword();
void setPassword(utility::string_t value);
void setPassword(const utility::string_t& value);
/// <summary>
///
/// </summary>
utility::string_t getPhone() const;
bool phoneIsSet() const;
void unsetPhone();
void setPhone(utility::string_t value);
void setPhone(const utility::string_t& value);
/// <summary>
/// User Status
/// </summary>
int32_t getUserStatus() const;
bool userStatusIsSet() const;
void unsetUserStatus();
void setUserStatus(int32_t value);
protected:
int64_t m_Id;
bool m_IdIsSet;