Remove Apache license from API client generators (#4197)

* remove php apache license

* remove apache license from C#

* remove apache license in objc code

* remove license from swift 3 code

* remove apache license from perl code

* remove license from scala code

* remove license from ts, go, android, cpp, scala

* remove license from java api client

* restore clojure petstore files

* remove license from travis file

* clean up apache-related terms in php, ruby, python mustache tempaltes

* remove license from JS API cilent
This commit is contained in:
wing328
2016-11-16 21:44:49 +08:00
committed by GitHub
parent 39ffc0ae62
commit 90512e6326
993 changed files with 2705 additions and 24008 deletions

View File

@@ -1,25 +1,13 @@
/**
* Swagger Petstore
* This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@wordnik.com
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -51,6 +39,12 @@ PetApi::~PetApi()
pplx::task<void> PetApi::addPet(std::shared_ptr<Pet> body)
{
// verify the required parameter 'body' is set
if (body == nullptr)
{
throw ApiException(400, U("Missing required parameter 'body' when calling PetApi->addPet"));
}
std::shared_ptr<ApiConfiguration> apiConfiguration( m_ApiClient->getConfiguration() );
utility::string_t path = U("/pet");
@@ -61,8 +55,8 @@ pplx::task<void> PetApi::addPet(std::shared_ptr<Pet> body)
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( U("application/json") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/json") );
utility::string_t responseHttpContentType;
@@ -76,7 +70,7 @@ responseHttpContentTypes.insert( U("application/xml") );
{
responseHttpContentType = U("multipart/form-data");
}
else
else
{
throw ApiException(400, U("PetApi->addPet does not produce any supported media type"));
}
@@ -132,19 +126,19 @@ consumeHttpContentTypes.insert( U("application/xml") );
return m_ApiClient->callApi(path, U("POST"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType)
.then([=](web::http::http_response response)
{
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling addPet: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling addPet: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// check response content type
// check response content type
if(response.headers().has(U("Content-Type")))
{
utility::string_t contentType = response.headers()[U("Content-Type")];
@@ -155,8 +149,8 @@ consumeHttpContentTypes.insert( U("application/xml") );
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
}
return response.extract_string();
return response.extract_string();
})
.then([=](utility::string_t response)
{
@@ -177,8 +171,8 @@ pplx::task<void> PetApi::deletePet(int64_t petId, utility::string_t apiKey)
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( U("application/json") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/json") );
utility::string_t responseHttpContentType;
@@ -192,7 +186,7 @@ responseHttpContentTypes.insert( U("application/xml") );
{
responseHttpContentType = U("multipart/form-data");
}
else
else
{
throw ApiException(400, U("PetApi->deletePet does not produce any supported media type"));
}
@@ -238,19 +232,19 @@ responseHttpContentTypes.insert( U("application/xml") );
return m_ApiClient->callApi(path, U("DELETE"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType)
.then([=](web::http::http_response response)
{
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling deletePet: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling deletePet: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// check response content type
// check response content type
if(response.headers().has(U("Content-Type")))
{
utility::string_t contentType = response.headers()[U("Content-Type")];
@@ -261,8 +255,8 @@ responseHttpContentTypes.insert( U("application/xml") );
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
}
return response.extract_string();
return response.extract_string();
})
.then([=](utility::string_t response)
{
@@ -282,8 +276,8 @@ pplx::task<std::vector<std::shared_ptr<Pet>>> PetApi::findPetsByStatus(std::vect
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( U("application/json") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/json") );
utility::string_t responseHttpContentType;
@@ -297,7 +291,7 @@ responseHttpContentTypes.insert( U("application/xml") );
{
responseHttpContentType = U("multipart/form-data");
}
else
else
{
throw ApiException(400, U("PetApi->findPetsByStatus does not produce any supported media type"));
}
@@ -339,19 +333,19 @@ responseHttpContentTypes.insert( U("application/xml") );
return m_ApiClient->callApi(path, U("GET"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType)
.then([=](web::http::http_response response)
{
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling findPetsByStatus: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling findPetsByStatus: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// check response content type
// check response content type
if(response.headers().has(U("Content-Type")))
{
utility::string_t contentType = response.headers()[U("Content-Type")];
@@ -362,8 +356,8 @@ responseHttpContentTypes.insert( U("application/xml") );
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
}
return response.extract_string();
return response.extract_string();
})
.then([=](utility::string_t response)
{
@@ -389,8 +383,8 @@ responseHttpContentTypes.insert( U("application/xml") );
// }
else
{
throw ApiException(500
, U("error calling findPetsByStatus: unsupported response type"));
throw ApiException(500
, U("error calling findPetsByStatus: unsupported response type"));
}
return result;
@@ -409,8 +403,8 @@ pplx::task<std::vector<std::shared_ptr<Pet>>> PetApi::findPetsByTags(std::vector
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( U("application/json") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/json") );
utility::string_t responseHttpContentType;
@@ -424,7 +418,7 @@ responseHttpContentTypes.insert( U("application/xml") );
{
responseHttpContentType = U("multipart/form-data");
}
else
else
{
throw ApiException(400, U("PetApi->findPetsByTags does not produce any supported media type"));
}
@@ -466,19 +460,19 @@ responseHttpContentTypes.insert( U("application/xml") );
return m_ApiClient->callApi(path, U("GET"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType)
.then([=](web::http::http_response response)
{
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling findPetsByTags: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling findPetsByTags: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// check response content type
// check response content type
if(response.headers().has(U("Content-Type")))
{
utility::string_t contentType = response.headers()[U("Content-Type")];
@@ -489,8 +483,8 @@ responseHttpContentTypes.insert( U("application/xml") );
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
}
return response.extract_string();
return response.extract_string();
})
.then([=](utility::string_t response)
{
@@ -516,8 +510,8 @@ responseHttpContentTypes.insert( U("application/xml") );
// }
else
{
throw ApiException(500
, U("error calling findPetsByStatus: unsupported response type"));
throw ApiException(500
, U("error calling findPetsByStatus: unsupported response type"));
}
return result;
@@ -537,8 +531,8 @@ pplx::task<std::shared_ptr<Pet>> PetApi::getPetById(int64_t petId)
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( U("application/json") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/json") );
utility::string_t responseHttpContentType;
@@ -552,7 +546,7 @@ responseHttpContentTypes.insert( U("application/xml") );
{
responseHttpContentType = U("multipart/form-data");
}
else
else
{
throw ApiException(400, U("PetApi->getPetById does not produce any supported media type"));
}
@@ -587,8 +581,6 @@ responseHttpContentTypes.insert( U("application/xml") );
throw ApiException(415, U("PetApi->getPetById does not consume any supported media type"));
}
// authentication (petstore_auth) required
// oauth2 authentication is added automatically as part of the http_client_config
// authentication (api_key) required
{
utility::string_t apiKey = apiConfiguration->getApiKey(U("api_key"));
@@ -601,19 +593,19 @@ responseHttpContentTypes.insert( U("application/xml") );
return m_ApiClient->callApi(path, U("GET"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType)
.then([=](web::http::http_response response)
{
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling getPetById: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling getPetById: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// check response content type
// check response content type
if(response.headers().has(U("Content-Type")))
{
utility::string_t contentType = response.headers()[U("Content-Type")];
@@ -624,8 +616,8 @@ responseHttpContentTypes.insert( U("application/xml") );
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
}
return response.extract_string();
return response.extract_string();
})
.then([=](utility::string_t response)
{
@@ -643,8 +635,8 @@ responseHttpContentTypes.insert( U("application/xml") );
// }
else
{
throw ApiException(500
, U("error calling findPetsByStatus: unsupported response type"));
throw ApiException(500
, U("error calling findPetsByStatus: unsupported response type"));
}
return result;
@@ -653,6 +645,12 @@ responseHttpContentTypes.insert( U("application/xml") );
pplx::task<void> PetApi::updatePet(std::shared_ptr<Pet> body)
{
// verify the required parameter 'body' is set
if (body == nullptr)
{
throw ApiException(400, U("Missing required parameter 'body' when calling PetApi->updatePet"));
}
std::shared_ptr<ApiConfiguration> apiConfiguration( m_ApiClient->getConfiguration() );
utility::string_t path = U("/pet");
@@ -663,8 +661,8 @@ pplx::task<void> PetApi::updatePet(std::shared_ptr<Pet> body)
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( U("application/json") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/json") );
utility::string_t responseHttpContentType;
@@ -678,7 +676,7 @@ responseHttpContentTypes.insert( U("application/xml") );
{
responseHttpContentType = U("multipart/form-data");
}
else
else
{
throw ApiException(400, U("PetApi->updatePet does not produce any supported media type"));
}
@@ -734,19 +732,19 @@ consumeHttpContentTypes.insert( U("application/xml") );
return m_ApiClient->callApi(path, U("PUT"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType)
.then([=](web::http::http_response response)
{
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling updatePet: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling updatePet: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// check response content type
// check response content type
if(response.headers().has(U("Content-Type")))
{
utility::string_t contentType = response.headers()[U("Content-Type")];
@@ -757,15 +755,15 @@ consumeHttpContentTypes.insert( U("application/xml") );
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
}
return response.extract_string();
return response.extract_string();
})
.then([=](utility::string_t response)
{
return void();
});
}
pplx::task<void> PetApi::updatePetWithForm(utility::string_t petId, utility::string_t name, utility::string_t status)
pplx::task<void> PetApi::updatePetWithForm(int64_t petId, utility::string_t name, utility::string_t status)
{
@@ -779,8 +777,8 @@ pplx::task<void> PetApi::updatePetWithForm(utility::string_t petId, utility::str
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( U("application/json") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/json") );
utility::string_t responseHttpContentType;
@@ -794,7 +792,7 @@ responseHttpContentTypes.insert( U("application/xml") );
{
responseHttpContentType = U("multipart/form-data");
}
else
else
{
throw ApiException(400, U("PetApi->updatePetWithForm does not produce any supported media type"));
}
@@ -846,19 +844,19 @@ responseHttpContentTypes.insert( U("application/xml") );
return m_ApiClient->callApi(path, U("POST"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType)
.then([=](web::http::http_response response)
{
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling updatePetWithForm: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling updatePetWithForm: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// check response content type
// check response content type
if(response.headers().has(U("Content-Type")))
{
utility::string_t contentType = response.headers()[U("Content-Type")];
@@ -869,15 +867,15 @@ responseHttpContentTypes.insert( U("application/xml") );
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
}
return response.extract_string();
return response.extract_string();
})
.then([=](utility::string_t response)
{
return void();
});
}
pplx::task<void> PetApi::uploadFile(int64_t petId, utility::string_t additionalMetadata, std::shared_ptr<HttpContent> file)
pplx::task<std::shared_ptr<ApiResponse>> PetApi::uploadFile(int64_t petId, utility::string_t additionalMetadata, std::shared_ptr<HttpContent> file)
{
@@ -892,7 +890,6 @@ pplx::task<void> PetApi::uploadFile(int64_t petId, utility::string_t additionalM
std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( U("application/json") );
responseHttpContentTypes.insert( U("application/xml") );
utility::string_t responseHttpContentType;
@@ -906,7 +903,7 @@ responseHttpContentTypes.insert( U("application/xml") );
{
responseHttpContentType = U("multipart/form-data");
}
else
else
{
throw ApiException(400, U("PetApi->uploadFile does not produce any supported media type"));
}
@@ -958,19 +955,19 @@ responseHttpContentTypes.insert( U("application/xml") );
return m_ApiClient->callApi(path, U("POST"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType)
.then([=](web::http::http_response response)
{
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling uploadFile: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling uploadFile: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// check response content type
// check response content type
if(response.headers().has(U("Content-Type")))
{
utility::string_t contentType = response.headers()[U("Content-Type")];
@@ -981,13 +978,31 @@ responseHttpContentTypes.insert( U("application/xml") );
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
}
return response.extract_string();
return response.extract_string();
})
.then([=](utility::string_t response)
{
return void();
});
std::shared_ptr<ApiResponse> result(new ApiResponse());
if(responseHttpContentType == U("application/json"))
{
web::json::value json = web::json::value::parse(response);
result->fromJson(json);
}
// else if(responseHttpContentType == U("multipart/form-data"))
// {
// TODO multipart response parsing
// }
else
{
throw ApiException(500
, U("error calling findPetsByStatus: unsupported response type"));
}
return result;
});
}
}

View File

@@ -1,25 +1,13 @@
/**
* Swagger Petstore
* This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@wordnik.com
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
@@ -34,9 +22,10 @@
#include "ApiClient.h"
#include "ApiResponse.h"
#include "HttpContent.h"
#include "Pet.h"
#include <cpprest/details/basic_types.h>
#include "HttpContent.h"
namespace io {
namespace swagger {
@@ -56,7 +45,7 @@ public:
/// <remarks>
///
/// </remarks>
/// <param name="body">Pet object that needs to be added to the store (optional)</param>
/// <param name="body">Pet object that needs to be added to the store</param>
pplx::task<void> addPet(std::shared_ptr<Pet> body);
/// <summary>
/// Deletes a pet
@@ -72,7 +61,7 @@ public:
/// <remarks>
/// Multiple status values can be provided with comma separated strings
/// </remarks>
/// <param name="status">Status values that need to be considered for filter (optional, default to available)</param>
/// <param name="status">Status values that need to be considered for filter</param>
pplx::task<std::vector<std::shared_ptr<Pet>>> findPetsByStatus(std::vector<utility::string_t> status);
/// <summary>
/// Finds Pets by tags
@@ -80,15 +69,15 @@ public:
/// <remarks>
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
/// </remarks>
/// <param name="tags">Tags to filter by (optional)</param>
/// <param name="tags">Tags to filter by</param>
pplx::task<std::vector<std::shared_ptr<Pet>>> findPetsByTags(std::vector<utility::string_t> tags);
/// <summary>
/// Find pet by ID
/// </summary>
/// <remarks>
/// Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
/// Returns a single pet
/// </remarks>
/// <param name="petId">ID of pet that needs to be fetched</param>
/// <param name="petId">ID of pet to return</param>
pplx::task<std::shared_ptr<Pet>> getPetById(int64_t petId);
/// <summary>
/// Update an existing pet
@@ -96,7 +85,7 @@ public:
/// <remarks>
///
/// </remarks>
/// <param name="body">Pet object that needs to be added to the store (optional)</param>
/// <param name="body">Pet object that needs to be added to the store</param>
pplx::task<void> updatePet(std::shared_ptr<Pet> body);
/// <summary>
/// Updates a pet in the store with form data
@@ -105,7 +94,7 @@ public:
///
/// </remarks>
/// <param name="petId">ID of pet that needs to be updated</param>/// <param name="name">Updated name of the pet (optional)</param>/// <param name="status">Updated status of the pet (optional)</param>
pplx::task<void> updatePetWithForm(utility::string_t petId, utility::string_t name, utility::string_t status);
pplx::task<void> updatePetWithForm(int64_t petId, utility::string_t name, utility::string_t status);
/// <summary>
/// uploads an image
/// </summary>
@@ -113,7 +102,7 @@ public:
///
/// </remarks>
/// <param name="petId">ID of pet to update</param>/// <param name="additionalMetadata">Additional data to pass to server (optional)</param>/// <param name="file">file to upload (optional)</param>
pplx::task<void> uploadFile(int64_t petId, utility::string_t additionalMetadata, std::shared_ptr<HttpContent> file);
pplx::task<std::shared_ptr<ApiResponse>> uploadFile(int64_t petId, utility::string_t additionalMetadata, std::shared_ptr<HttpContent> file);
protected:
std::shared_ptr<ApiClient> m_ApiClient;

View File

@@ -1,25 +1,13 @@
/**
* Swagger Petstore
* This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@wordnik.com
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -62,8 +50,8 @@ pplx::task<void> StoreApi::deleteOrder(utility::string_t orderId)
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( U("application/json") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/json") );
utility::string_t responseHttpContentType;
@@ -77,7 +65,7 @@ responseHttpContentTypes.insert( U("application/xml") );
{
responseHttpContentType = U("multipart/form-data");
}
else
else
{
throw ApiException(400, U("StoreApi->deleteOrder does not produce any supported media type"));
}
@@ -116,19 +104,19 @@ responseHttpContentTypes.insert( U("application/xml") );
return m_ApiClient->callApi(path, U("DELETE"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType)
.then([=](web::http::http_response response)
{
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling deleteOrder: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling deleteOrder: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// check response content type
// check response content type
if(response.headers().has(U("Content-Type")))
{
utility::string_t contentType = response.headers()[U("Content-Type")];
@@ -139,8 +127,8 @@ responseHttpContentTypes.insert( U("application/xml") );
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
}
return response.extract_string();
return response.extract_string();
})
.then([=](utility::string_t response)
{
@@ -161,7 +149,6 @@ pplx::task<std::map<utility::string_t, int32_t>> StoreApi::getInventory()
std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( U("application/json") );
responseHttpContentTypes.insert( U("application/xml") );
utility::string_t responseHttpContentType;
@@ -175,7 +162,7 @@ responseHttpContentTypes.insert( U("application/xml") );
{
responseHttpContentType = U("multipart/form-data");
}
else
else
{
throw ApiException(400, U("StoreApi->getInventory does not produce any supported media type"));
}
@@ -218,19 +205,19 @@ responseHttpContentTypes.insert( U("application/xml") );
return m_ApiClient->callApi(path, U("GET"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType)
.then([=](web::http::http_response response)
{
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling getInventory: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling getInventory: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// check response content type
// check response content type
if(response.headers().has(U("Content-Type")))
{
utility::string_t contentType = response.headers()[U("Content-Type")];
@@ -241,8 +228,8 @@ responseHttpContentTypes.insert( U("application/xml") );
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
}
return response.extract_string();
return response.extract_string();
})
.then([=](utility::string_t response)
{
@@ -266,14 +253,14 @@ responseHttpContentTypes.insert( U("application/xml") );
// }
else
{
throw ApiException(500
, U("error calling findPetsByStatus: unsupported response type"));
throw ApiException(500
, U("error calling findPetsByStatus: unsupported response type"));
}
return result;
});
}
pplx::task<std::shared_ptr<Order>> StoreApi::getOrderById(utility::string_t orderId)
pplx::task<std::shared_ptr<Order>> StoreApi::getOrderById(int64_t orderId)
{
@@ -287,8 +274,8 @@ pplx::task<std::shared_ptr<Order>> StoreApi::getOrderById(utility::string_t orde
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( U("application/json") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/json") );
utility::string_t responseHttpContentType;
@@ -302,7 +289,7 @@ responseHttpContentTypes.insert( U("application/xml") );
{
responseHttpContentType = U("multipart/form-data");
}
else
else
{
throw ApiException(400, U("StoreApi->getOrderById does not produce any supported media type"));
}
@@ -341,19 +328,19 @@ responseHttpContentTypes.insert( U("application/xml") );
return m_ApiClient->callApi(path, U("GET"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType)
.then([=](web::http::http_response response)
{
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling getOrderById: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling getOrderById: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// check response content type
// check response content type
if(response.headers().has(U("Content-Type")))
{
utility::string_t contentType = response.headers()[U("Content-Type")];
@@ -364,8 +351,8 @@ responseHttpContentTypes.insert( U("application/xml") );
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
}
return response.extract_string();
return response.extract_string();
})
.then([=](utility::string_t response)
{
@@ -383,8 +370,8 @@ responseHttpContentTypes.insert( U("application/xml") );
// }
else
{
throw ApiException(500
, U("error calling findPetsByStatus: unsupported response type"));
throw ApiException(500
, U("error calling findPetsByStatus: unsupported response type"));
}
return result;
@@ -393,6 +380,12 @@ responseHttpContentTypes.insert( U("application/xml") );
pplx::task<std::shared_ptr<Order>> StoreApi::placeOrder(std::shared_ptr<Order> body)
{
// verify the required parameter 'body' is set
if (body == nullptr)
{
throw ApiException(400, U("Missing required parameter 'body' when calling StoreApi->placeOrder"));
}
std::shared_ptr<ApiConfiguration> apiConfiguration( m_ApiClient->getConfiguration() );
utility::string_t path = U("/store/order");
@@ -403,8 +396,8 @@ pplx::task<std::shared_ptr<Order>> StoreApi::placeOrder(std::shared_ptr<Order> b
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( U("application/json") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/json") );
utility::string_t responseHttpContentType;
@@ -418,7 +411,7 @@ responseHttpContentTypes.insert( U("application/xml") );
{
responseHttpContentType = U("multipart/form-data");
}
else
else
{
throw ApiException(400, U("StoreApi->placeOrder does not produce any supported media type"));
}
@@ -470,19 +463,19 @@ responseHttpContentTypes.insert( U("application/xml") );
return m_ApiClient->callApi(path, U("POST"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType)
.then([=](web::http::http_response response)
{
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling placeOrder: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling placeOrder: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// check response content type
// check response content type
if(response.headers().has(U("Content-Type")))
{
utility::string_t contentType = response.headers()[U("Content-Type")];
@@ -493,8 +486,8 @@ responseHttpContentTypes.insert( U("application/xml") );
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
}
return response.extract_string();
return response.extract_string();
})
.then([=](utility::string_t response)
{
@@ -512,8 +505,8 @@ responseHttpContentTypes.insert( U("application/xml") );
// }
else
{
throw ApiException(500
, U("error calling findPetsByStatus: unsupported response type"));
throw ApiException(500
, U("error calling findPetsByStatus: unsupported response type"));
}
return result;

View File

@@ -1,25 +1,13 @@
/**
* Swagger Petstore
* This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@wordnik.com
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
@@ -34,9 +22,9 @@
#include "ApiClient.h"
#include <cpprest/details/basic_types.h>
#include <map>
#include "Order.h"
#include <map>
#include <cpprest/details/basic_types.h>
namespace io {
namespace swagger {
@@ -73,14 +61,14 @@ public:
/// For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
/// </remarks>
/// <param name="orderId">ID of pet that needs to be fetched</param>
pplx::task<std::shared_ptr<Order>> getOrderById(utility::string_t orderId);
pplx::task<std::shared_ptr<Order>> getOrderById(int64_t orderId);
/// <summary>
/// Place an order for a pet
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="body">order placed for purchasing the pet (optional)</param>
/// <param name="body">order placed for purchasing the pet</param>
pplx::task<std::shared_ptr<Order>> placeOrder(std::shared_ptr<Order> body);
protected:

View File

@@ -1,25 +1,13 @@
/**
* Swagger Petstore
* This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@wordnik.com
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -51,6 +39,12 @@ UserApi::~UserApi()
pplx::task<void> UserApi::createUser(std::shared_ptr<User> body)
{
// verify the required parameter 'body' is set
if (body == nullptr)
{
throw ApiException(400, U("Missing required parameter 'body' when calling UserApi->createUser"));
}
std::shared_ptr<ApiConfiguration> apiConfiguration( m_ApiClient->getConfiguration() );
utility::string_t path = U("/user");
@@ -61,8 +55,8 @@ pplx::task<void> UserApi::createUser(std::shared_ptr<User> body)
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( U("application/json") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/json") );
utility::string_t responseHttpContentType;
@@ -76,7 +70,7 @@ responseHttpContentTypes.insert( U("application/xml") );
{
responseHttpContentType = U("multipart/form-data");
}
else
else
{
throw ApiException(400, U("UserApi->createUser does not produce any supported media type"));
}
@@ -128,19 +122,19 @@ responseHttpContentTypes.insert( U("application/xml") );
return m_ApiClient->callApi(path, U("POST"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType)
.then([=](web::http::http_response response)
{
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling createUser: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling createUser: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// check response content type
// check response content type
if(response.headers().has(U("Content-Type")))
{
utility::string_t contentType = response.headers()[U("Content-Type")];
@@ -151,8 +145,8 @@ responseHttpContentTypes.insert( U("application/xml") );
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
}
return response.extract_string();
return response.extract_string();
})
.then([=](utility::string_t response)
{
@@ -172,8 +166,8 @@ pplx::task<void> UserApi::createUsersWithArrayInput(std::vector<std::shared_ptr<
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( U("application/json") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/json") );
utility::string_t responseHttpContentType;
@@ -187,7 +181,7 @@ responseHttpContentTypes.insert( U("application/xml") );
{
responseHttpContentType = U("multipart/form-data");
}
else
else
{
throw ApiException(400, U("UserApi->createUsersWithArrayInput does not produce any supported media type"));
}
@@ -253,19 +247,19 @@ responseHttpContentTypes.insert( U("application/xml") );
return m_ApiClient->callApi(path, U("POST"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType)
.then([=](web::http::http_response response)
{
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling createUsersWithArrayInput: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling createUsersWithArrayInput: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// check response content type
// check response content type
if(response.headers().has(U("Content-Type")))
{
utility::string_t contentType = response.headers()[U("Content-Type")];
@@ -276,8 +270,8 @@ responseHttpContentTypes.insert( U("application/xml") );
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
}
return response.extract_string();
return response.extract_string();
})
.then([=](utility::string_t response)
{
@@ -297,8 +291,8 @@ pplx::task<void> UserApi::createUsersWithListInput(std::vector<std::shared_ptr<U
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( U("application/json") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/json") );
utility::string_t responseHttpContentType;
@@ -312,7 +306,7 @@ responseHttpContentTypes.insert( U("application/xml") );
{
responseHttpContentType = U("multipart/form-data");
}
else
else
{
throw ApiException(400, U("UserApi->createUsersWithListInput does not produce any supported media type"));
}
@@ -378,19 +372,19 @@ responseHttpContentTypes.insert( U("application/xml") );
return m_ApiClient->callApi(path, U("POST"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType)
.then([=](web::http::http_response response)
{
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling createUsersWithListInput: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling createUsersWithListInput: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// check response content type
// check response content type
if(response.headers().has(U("Content-Type")))
{
utility::string_t contentType = response.headers()[U("Content-Type")];
@@ -401,8 +395,8 @@ responseHttpContentTypes.insert( U("application/xml") );
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
}
return response.extract_string();
return response.extract_string();
})
.then([=](utility::string_t response)
{
@@ -423,8 +417,8 @@ pplx::task<void> UserApi::deleteUser(utility::string_t username)
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( U("application/json") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/json") );
utility::string_t responseHttpContentType;
@@ -438,7 +432,7 @@ responseHttpContentTypes.insert( U("application/xml") );
{
responseHttpContentType = U("multipart/form-data");
}
else
else
{
throw ApiException(400, U("UserApi->deleteUser does not produce any supported media type"));
}
@@ -477,19 +471,19 @@ responseHttpContentTypes.insert( U("application/xml") );
return m_ApiClient->callApi(path, U("DELETE"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType)
.then([=](web::http::http_response response)
{
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling deleteUser: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling deleteUser: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// check response content type
// check response content type
if(response.headers().has(U("Content-Type")))
{
utility::string_t contentType = response.headers()[U("Content-Type")];
@@ -500,8 +494,8 @@ responseHttpContentTypes.insert( U("application/xml") );
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
}
return response.extract_string();
return response.extract_string();
})
.then([=](utility::string_t response)
{
@@ -522,8 +516,8 @@ pplx::task<std::shared_ptr<User>> UserApi::getUserByName(utility::string_t usern
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( U("application/json") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/json") );
utility::string_t responseHttpContentType;
@@ -537,7 +531,7 @@ responseHttpContentTypes.insert( U("application/xml") );
{
responseHttpContentType = U("multipart/form-data");
}
else
else
{
throw ApiException(400, U("UserApi->getUserByName does not produce any supported media type"));
}
@@ -576,19 +570,19 @@ responseHttpContentTypes.insert( U("application/xml") );
return m_ApiClient->callApi(path, U("GET"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType)
.then([=](web::http::http_response response)
{
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling getUserByName: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling getUserByName: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// check response content type
// check response content type
if(response.headers().has(U("Content-Type")))
{
utility::string_t contentType = response.headers()[U("Content-Type")];
@@ -599,8 +593,8 @@ responseHttpContentTypes.insert( U("application/xml") );
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
}
return response.extract_string();
return response.extract_string();
})
.then([=](utility::string_t response)
{
@@ -618,8 +612,8 @@ responseHttpContentTypes.insert( U("application/xml") );
// }
else
{
throw ApiException(500
, U("error calling findPetsByStatus: unsupported response type"));
throw ApiException(500
, U("error calling findPetsByStatus: unsupported response type"));
}
return result;
@@ -638,8 +632,8 @@ pplx::task<utility::string_t> UserApi::loginUser(utility::string_t username, uti
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( U("application/json") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/json") );
utility::string_t responseHttpContentType;
@@ -653,7 +647,7 @@ responseHttpContentTypes.insert( U("application/xml") );
{
responseHttpContentType = U("multipart/form-data");
}
else
else
{
throw ApiException(400, U("UserApi->loginUser does not produce any supported media type"));
}
@@ -698,19 +692,19 @@ responseHttpContentTypes.insert( U("application/xml") );
return m_ApiClient->callApi(path, U("GET"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType)
.then([=](web::http::http_response response)
{
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling loginUser: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling loginUser: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// check response content type
// check response content type
if(response.headers().has(U("Content-Type")))
{
utility::string_t contentType = response.headers()[U("Content-Type")];
@@ -721,8 +715,8 @@ responseHttpContentTypes.insert( U("application/xml") );
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
}
return response.extract_string();
return response.extract_string();
})
.then([=](utility::string_t response)
{
@@ -741,8 +735,8 @@ responseHttpContentTypes.insert( U("application/xml") );
// }
else
{
throw ApiException(500
, U("error calling findPetsByStatus: unsupported response type"));
throw ApiException(500
, U("error calling findPetsByStatus: unsupported response type"));
}
return result;
@@ -761,8 +755,8 @@ pplx::task<void> UserApi::logoutUser()
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( U("application/json") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/json") );
utility::string_t responseHttpContentType;
@@ -776,7 +770,7 @@ responseHttpContentTypes.insert( U("application/xml") );
{
responseHttpContentType = U("multipart/form-data");
}
else
else
{
throw ApiException(400, U("UserApi->logoutUser does not produce any supported media type"));
}
@@ -811,19 +805,19 @@ responseHttpContentTypes.insert( U("application/xml") );
return m_ApiClient->callApi(path, U("GET"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType)
.then([=](web::http::http_response response)
{
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling logoutUser: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling logoutUser: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// check response content type
// check response content type
if(response.headers().has(U("Content-Type")))
{
utility::string_t contentType = response.headers()[U("Content-Type")];
@@ -834,8 +828,8 @@ responseHttpContentTypes.insert( U("application/xml") );
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
}
return response.extract_string();
return response.extract_string();
})
.then([=](utility::string_t response)
{
@@ -845,6 +839,12 @@ responseHttpContentTypes.insert( U("application/xml") );
pplx::task<void> UserApi::updateUser(utility::string_t username, std::shared_ptr<User> body)
{
// verify the required parameter 'body' is set
if (body == nullptr)
{
throw ApiException(400, U("Missing required parameter 'body' when calling UserApi->updateUser"));
}
std::shared_ptr<ApiConfiguration> apiConfiguration( m_ApiClient->getConfiguration() );
utility::string_t path = U("/user/{username}");
@@ -856,8 +856,8 @@ pplx::task<void> UserApi::updateUser(utility::string_t username, std::shared_ptr
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( U("application/json") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/xml") );
responseHttpContentTypes.insert( U("application/json") );
utility::string_t responseHttpContentType;
@@ -871,7 +871,7 @@ responseHttpContentTypes.insert( U("application/xml") );
{
responseHttpContentType = U("multipart/form-data");
}
else
else
{
throw ApiException(400, U("UserApi->updateUser does not produce any supported media type"));
}
@@ -927,19 +927,19 @@ responseHttpContentTypes.insert( U("application/xml") );
return m_ApiClient->callApi(path, U("PUT"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType)
.then([=](web::http::http_response response)
{
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling updateUser: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (response.status_code() >= 400)
{
throw ApiException(response.status_code()
, U("error calling updateUser: ") + response.reason_phrase()
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
// check response content type
// check response content type
if(response.headers().has(U("Content-Type")))
{
utility::string_t contentType = response.headers()[U("Content-Type")];
@@ -950,8 +950,8 @@ responseHttpContentTypes.insert( U("application/xml") );
, std::make_shared<std::stringstream>(response.extract_utf8string(true).get()));
}
}
return response.extract_string();
return response.extract_string();
})
.then([=](utility::string_t response)
{

View File

@@ -1,25 +1,13 @@
/**
* Swagger Petstore
* This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@wordnik.com
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
@@ -56,7 +44,7 @@ public:
/// <remarks>
/// This can only be done by the logged in user.
/// </remarks>
/// <param name="body">Created user object (optional)</param>
/// <param name="body">Created user object</param>
pplx::task<void> createUser(std::shared_ptr<User> body);
/// <summary>
/// Creates list of users with given input array
@@ -64,7 +52,7 @@ public:
/// <remarks>
///
/// </remarks>
/// <param name="body">List of user object (optional)</param>
/// <param name="body">List of user object</param>
pplx::task<void> createUsersWithArrayInput(std::vector<std::shared_ptr<User>> body);
/// <summary>
/// Creates list of users with given input array
@@ -72,7 +60,7 @@ public:
/// <remarks>
///
/// </remarks>
/// <param name="body">List of user object (optional)</param>
/// <param name="body">List of user object</param>
pplx::task<void> createUsersWithListInput(std::vector<std::shared_ptr<User>> body);
/// <summary>
/// Delete user
@@ -96,7 +84,7 @@ public:
/// <remarks>
///
/// </remarks>
/// <param name="username">The user name for login (optional)</param>/// <param name="password">The password for login in clear text (optional)</param>
/// <param name="username">The user name for login</param>/// <param name="password">The password for login in clear text</param>
pplx::task<utility::string_t> loginUser(utility::string_t username, utility::string_t password);
/// <summary>
/// Logs out current logged in user session
@@ -112,7 +100,7 @@ public:
/// <remarks>
/// This can only be done by the logged in user.
/// </remarks>
/// <param name="username">name that need to be deleted</param>/// <param name="body">Updated user object (optional)</param>
/// <param name="username">name that need to be deleted</param>/// <param name="body">Updated user object</param>
pplx::task<void> updateUser(utility::string_t username, std::shared_ptr<User> body);
protected: