Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C++][restsdk] Replace tab with spaces, fix empty spaces in new lines #632

Merged
merged 1 commit into from
Jul 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ utility::string_t ApiClient::parameterToString(utility::string_t value)
}
utility::string_t ApiClient::parameterToString(int64_t value)
{
std::stringstream valueAsStringStream;
valueAsStringStream << value;
std::stringstream valueAsStringStream;
valueAsStringStream << value;
return utility::conversions::to_string_t(valueAsStringStream.str());
}
utility::string_t ApiClient::parameterToString(int32_t value)
{
std::stringstream valueAsStringStream;
valueAsStringStream << value;
std::stringstream valueAsStringStream;
valueAsStringStream << value;
return utility::conversions::to_string_t(valueAsStringStream.str());
}

Expand Down Expand Up @@ -132,7 +132,7 @@ pplx::task<web::http::http_response> ApiClient::callApi(
if (!formParams.empty())
{
request.set_body(body_data);
}
}
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,29 +245,35 @@ void {{classname}}::fromJson(web::json::value& val)
{{#isString}}
{{setter}}(ModelBase::stringFromJson(val[utility::conversions::to_string_t("{{baseName}}")]));
{{/isString}}
{{#isByteArray}}{{setter}}(ModelBase::stringFromJson(val[utility::conversions::to_string_t("{{baseName}}")]));{{/isByteArray}}
{{#isByteArray}}
{{setter}}(ModelBase::stringFromJson(val[utility::conversions::to_string_t("{{baseName}}")]));
{{/isByteArray}}
{{^isString}}
{{#isDateTime}}
{{setter}}(ModelBase::dateFromJson(val[utility::conversions::to_string_t("{{baseName}}")]));
{{/isDateTime}}
{{^isDateTime}}{{^isByteArray}}
{{^isDateTime}}
{{^isByteArray}}
if(!val[utility::conversions::to_string_t("{{baseName}}")].is_null())
{
{{{dataType}}} newItem({{{defaultValue}}});
newItem->fromJson(val[utility::conversions::to_string_t("{{baseName}}")]);
{{setter}}( newItem );
}
{{/isByteArray}}{{/isDateTime}}
{{/isByteArray}}
{{/isDateTime}}
{{/isString}}
}
{{/required}}
{{#required}}
{{#isString}}
{{setter}}(ModelBase::stringFromJson(val[utility::conversions::to_string_t("{{baseName}}")]));
{{/isString}}{{#isByteArray}}
{{/isString}}
{{#isByteArray}}
{{setter}}(ModelBase::stringFromJson(val[utility::conversions::to_string_t("{{baseName}}")]));
{{/isByteArray}}
{{^isString}}{{^isByteArray}}
{{^isString}}
{{^isByteArray}}
{{#isDateTime}}
{{setter}}
(ModelBase::dateFromJson(val[utility::conversions::to_string_t("{{baseName}}")]));
Expand All @@ -282,7 +288,8 @@ void {{classname}}::fromJson(web::json::value& val)
{{setter}}( new{{name}} );
{{/vendorExtensions.x-codegen-file}}
{{/isDateTime}}
{{/isByteArray}}{{/isString}}
{{/isByteArray}}
{{/isString}}
{{/required}}
{{/isPrimitiveType}}
{{/isMapContainer}}
Expand Down Expand Up @@ -356,33 +363,47 @@ void {{classname}}::toMultipart(std::shared_ptr<MultipartFormData> multipart, co
{{^required}}
if(m_{{name}}IsSet)
{
{{#isString}}multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("{{baseName}}"), m_{{name}}));{{/isString}}{{#isByteArray}}multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("{{baseName}}"), m_{{name}}));
{{/isByteArray}}{{^isString}}{{#isDateTime}}multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("{{baseName}}"), m_{{name}}));
{{/isDateTime}}{{^isDateTime}}{{^isByteArray}}if (m_{{name}}.get())
{{#isString}}
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("{{baseName}}"), m_{{name}}));
{{/isString}}
{{#isByteArray}}
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("{{baseName}}"), m_{{name}}));
{{/isByteArray}}
{{^isString}}
{{#isDateTime}}
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("{{baseName}}"), m_{{name}}));
{{/isDateTime}}
{{^isDateTime}}
{{^isByteArray}}if (m_{{name}}.get())
{
m_{{name}}->toMultipart(multipart, utility::conversions::to_string_t("{{baseName}}."));
}
{{/isByteArray}}{{/isDateTime}}{{/isString}}
{{/isByteArray}}
{{/isDateTime}}
{{/isString}}
}
{{/required}}
{{#required}}
{{#isString}}
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("{{baseName}}"), m_{{name}}));
{{/isString}}{{#isByteArray}}
{{/isString}}
{{#isByteArray}}
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("{{baseName}}"), m_{{name}}));
{{/isByteArray}}
{{^isString}}
{{#isDateTime}}
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("{{baseName}}"), m_{{name}}));
{{/isDateTime}}
{{^isDateTime}}{{^isByteArray}}
{{^isDateTime}}
{{^isByteArray}}
{{#vendorExtensions.x-codegen-file}}
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("{{baseName}}"), m_{{name}}));
{{/vendorExtensions.x-codegen-file}}
{{^vendorExtensions.x-codegen-file}}
m_{{name}}->toMultipart(multipart, utility::conversions::to_string_t("{{baseName}}."));
{{/vendorExtensions.x-codegen-file}}
{{/isByteArray}}{{/isDateTime}}
{{/isByteArray}}
{{/isDateTime}}
{{/isString}}
{{/required}}
{{/isPrimitiveType}}
Expand Down Expand Up @@ -513,8 +534,11 @@ void {{classname}}::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
{{#isString}}
{{setter}}(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("{{baseName}}"))));
{{/isString}}
{{#isByteArray}}{{setter}}(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("{{baseName}}"))));{{/isByteArray}}
{{^isString}}{{^isByteArray}}
{{#isByteArray}}
{{setter}}(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("{{baseName}}"))));
{{/isByteArray}}
{{^isString}}
{{^isByteArray}}
{{#isDateTime}}
{{setter}}(ModelBase::dateFromHttpContent(multipart->getContent(utility::conversions::to_string_t("{{baseName}}"))));
{{/isDateTime}}
Expand All @@ -526,14 +550,19 @@ void {{classname}}::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
{{setter}}( newItem );
}
{{/isDateTime}}
{{/isByteArray}}{{/isString}}
{{/isByteArray}}
{{/isString}}
}
{{/required}}
{{#required}}
{{#isString}}
{{setter}}(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("{{baseName}}"))));
{{/isString}}{{#isByteArray}}{{setter}}(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("{{baseName}}"))));{{/isByteArray}}
{{^isString}}{{^isByteArray}}
{{/isString}}
{{#isByteArray}}
{{setter}}(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("{{baseName}}"))));
{{/isByteArray}}
{{^isString}}
{{^isByteArray}}
{{#isDateTime}}
{{setter}}(ModelBase::dateFromHttpContent(multipart->getContent(utility::conversions::to_string_t("{{baseName}}"))));
{{/isDateTime}}
Expand All @@ -547,7 +576,8 @@ void {{classname}}::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
{{setter}}( new{{name}} );
{{/vendorExtensions.x-codegen-file}}
{{/isDateTime}}
{{/isByteArray}}{{/isString}}
{{/isByteArray}}
{{/isString}}
{{/required}}
{{/isPrimitiveType}}
{{/isMapContainer}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.1-SNAPSHOT
3.1.2-SNAPSHOT
12 changes: 6 additions & 6 deletions samples/client/petstore/cpp-restsdk/ApiClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.2-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Expand Down Expand Up @@ -44,14 +44,14 @@ utility::string_t ApiClient::parameterToString(utility::string_t value)
}
utility::string_t ApiClient::parameterToString(int64_t value)
{
std::stringstream valueAsStringStream;
valueAsStringStream << value;
std::stringstream valueAsStringStream;
valueAsStringStream << value;
return utility::conversions::to_string_t(valueAsStringStream.str());
}
utility::string_t ApiClient::parameterToString(int32_t value)
{
std::stringstream valueAsStringStream;
valueAsStringStream << value;
std::stringstream valueAsStringStream;
valueAsStringStream << value;
return utility::conversions::to_string_t(valueAsStringStream.str());
}

Expand Down Expand Up @@ -143,7 +143,7 @@ pplx::task<web::http::http_response> ApiClient::callApi(
if (!formParams.empty())
{
request.set_body(body_data);
}
}
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-restsdk/ApiClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.2-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-restsdk/ApiConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.2-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-restsdk/ApiConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.2-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-restsdk/ApiException.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.2-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-restsdk/ApiException.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.2-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-restsdk/HttpContent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.2-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-restsdk/HttpContent.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.2-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-restsdk/IHttpBody.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.2-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-restsdk/JsonBody.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.2-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-restsdk/JsonBody.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.2-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-restsdk/ModelBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.2-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-restsdk/ModelBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.2-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-restsdk/MultipartFormData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.2-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-restsdk/MultipartFormData.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.2-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-restsdk/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.2-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-restsdk/Object.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.2-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-restsdk/api/PetApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.2-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/cpp-restsdk/api/PetApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.1.2-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Expand Down Expand Up @@ -43,7 +43,7 @@ class PetApi

explicit PetApi( std::shared_ptr<ApiClient> apiClient );

virtual ~PetApi();
virtual ~PetApi() = default;

/// <summary>
/// Add a new pet to the store
Expand Down
Loading