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 @@ 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)
{