Merge pull request #2570 from wing328/fix_indention

Fix indention in the generated code
This commit is contained in:
wing328 2016-04-12 16:00:18 +08:00
commit 221e6ad57a
13 changed files with 407 additions and 604 deletions

View File

@ -178,14 +178,15 @@ namespace {{packageName}}.Api
{{/allParams}}/// <returns>ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}}</returns>
public ApiResponse<{{#returnType}} {{{returnType}}} {{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
{
{{#allParams}}{{#required}}
{{#allParams}}
{{#required}}
// verify the required parameter '{{paramName}}' is set
if ({{paramName}} == null)
throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}");
{{/required}}{{/allParams}}
{{/required}}
{{/allParams}}
var localVarPath = "{{path}}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -195,13 +196,17 @@ namespace {{packageName}}.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
{{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
{{#consumes}}
"{{mediaType}}"{{#hasMore}}, {{/hasMore}}
{{/consumes}}
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
{{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
{{#produces}}
"{{mediaType}}"{{#hasMore}}, {{/hasMore}}
{{/produces}}
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -210,38 +215,53 @@ namespace {{packageName}}.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
{{#pathParams}}if ({{paramName}} != null) localVarPathParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // path parameter
{{#pathParams}}
if ({{paramName}} != null) localVarPathParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // path parameter
{{/pathParams}}
{{#queryParams}}if ({{paramName}} != null) localVarQueryParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // query parameter
{{#queryParams}}
if ({{paramName}} != null) localVarQueryParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // query parameter
{{/queryParams}}
{{#headerParams}}if ({{paramName}} != null) localVarHeaderParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // header parameter
{{#headerParams}}
if ({{paramName}} != null) localVarHeaderParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // header parameter
{{/headerParams}}
{{#formParams}}if ({{paramName}} != null) {{#isFile}}localVarFileParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToFile("{{baseName}}", {{paramName}}));{{/isFile}}{{^isFile}}localVarFormParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // form parameter{{/isFile}}
{{#formParams}}
if ({{paramName}} != null) {{#isFile}}localVarFileParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToFile("{{baseName}}", {{paramName}}));{{/isFile}}{{^isFile}}localVarFormParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // form parameter{{/isFile}}
{{/formParams}}
{{#bodyParam}}if ({{paramName}}.GetType() != typeof(byte[]))
{{#bodyParam}}
if ({{paramName}}.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize({{paramName}}); // http body (model) parameter
}
else
{
localVarPostBody = {{paramName}}; // byte array
}{{/bodyParam}}
}
{{/bodyParam}}
{{#authMethods}}// authentication ({{name}}) required
{{#isApiKey}}{{#isKeyInHeader}}
{{#authMethods}}
// authentication ({{name}}) required
{{#isApiKey}}
{{#isKeyInHeader}}
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("{{keyParamName}}")))
{
localVarHeaderParams["{{keyParamName}}"] = Configuration.GetApiKeyWithPrefix("{{keyParamName}}");
}{{/isKeyInHeader}}{{#isKeyInQuery}}
}
{{/isKeyInHeader}}
{{#isKeyInQuery}}
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("{{keyParamName}}")))
{
localVarQueryParams["{{keyParamName}}"] = Configuration.GetApiKeyWithPrefix("{{keyParamName}}");
}{{/isKeyInQuery}}{{/isApiKey}}{{#isBasic}}
}
{{/isKeyInQuery}}
{{/isApiKey}}
{{#isBasic}}
// http basic authentication required
if (!String.IsNullOrEmpty(Configuration.Username) || !String.IsNullOrEmpty(Configuration.Password))
{
localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(Configuration.Username + ":" + Configuration.Password);
}{{/isBasic}}{{#isOAuth}}
}
{{/isBasic}}
{{#isOAuth}}
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -291,12 +311,15 @@ namespace {{packageName}}.Api
{{/allParams}}/// <returns>Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}}</returns>
public async System.Threading.Tasks.Task<ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>> {{operationId}}AsyncWithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
{
{{#allParams}}{{#required}}// verify the required parameter '{{paramName}}' is set
if ({{paramName}} == null) throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{operationId}}");
{{/required}}{{/allParams}}
{{#allParams}}
{{#required}}
// verify the required parameter '{{paramName}}' is set
if ({{paramName}} == null)
throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}");
{{/required}}
{{/allParams}}
var localVarPath = "{{path}}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -306,13 +329,17 @@ namespace {{packageName}}.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
{{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
{{#consumes}}
"{{mediaType}}"{{#hasMore}}, {{/hasMore}}
{{/consumes}}
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
{{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
{{#produces}}
"{{mediaType}}"{{#hasMore}}, {{/hasMore}}
{{/produces}}
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -321,44 +348,59 @@ namespace {{packageName}}.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
{{#pathParams}}if ({{paramName}} != null) localVarPathParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // path parameter
{{#pathParams}}
if ({{paramName}} != null) localVarPathParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // path parameter
{{/pathParams}}
{{#queryParams}}if ({{paramName}} != null) localVarQueryParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // query parameter
{{#queryParams}}
if ({{paramName}} != null) localVarQueryParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // query parameter
{{/queryParams}}
{{#headerParams}}if ({{paramName}} != null) localVarHeaderParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // header parameter
{{#headerParams}}
if ({{paramName}} != null) localVarHeaderParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // header parameter
{{/headerParams}}
{{#formParams}}if ({{paramName}} != null) {{#isFile}}localVarFileParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToFile("{{baseName}}", {{paramName}}));{{/isFile}}{{^isFile}}localVarFormParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // form parameter{{/isFile}}
{{#formParams}}
if ({{paramName}} != null) {{#isFile}}localVarFileParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToFile("{{baseName}}", {{paramName}}));{{/isFile}}{{^isFile}}localVarFormParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // form parameter{{/isFile}}
{{/formParams}}
{{#bodyParam}}if ({{paramName}}.GetType() != typeof(byte[]))
{{#bodyParam}}
if ({{paramName}}.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize({{paramName}}); // http body (model) parameter
}
else
{
localVarPostBody = {{paramName}}; // byte array
}{{/bodyParam}}
}
{{/bodyParam}}
{{#authMethods}}
// authentication ({{name}}) required
{{#isApiKey}}{{#isKeyInHeader}}
{{#isApiKey}}
{{#isKeyInHeader}}
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("{{keyParamName}}")))
{
localVarHeaderParams["{{keyParamName}}"] = Configuration.GetApiKeyWithPrefix("{{keyParamName}}");
}{{/isKeyInHeader}}{{#isKeyInQuery}}
}
{{/isKeyInHeader}}
{{#isKeyInQuery}}
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("{{keyParamName}}")))
{
localVarQueryParams["{{keyParamName}}"] = Configuration.GetApiKeyWithPrefix("{{keyParamName}}");
}{{/isKeyInQuery}}{{/isApiKey}}{{#isBasic}}
}
{{/isKeyInQuery}}
{{/isApiKey}}
{{#isBasic}}
// http basic authentication required
if (!String.IsNullOrEmpty(Configuration.Username) || !String.IsNullOrEmpty(Configuration.Password))
{
localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(Configuration.Username + ":" + Configuration.Password);
}{{/isBasic}}{{#isOAuth}}
}
{{/isBasic}}
{{#isOAuth}}
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken;
}{{/isOAuth}}
}
{{/isOAuth}}
{{/authMethods}}
// make the HTTP request
@ -379,7 +421,9 @@ namespace {{packageName}}.Api
{{^returnType}}return new ApiResponse<Object>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);{{/returnType}}
}{{/supportsAsync}}
}
{{/supportsAsync}}
{{/operation}}
}
{{/operations}}

View File

@ -81,13 +81,15 @@ sub new {
sub {{operationId}} {
my ($self, %args) = @_;
{{#allParams}}{{#required}}
{{#allParams}}
{{#required}}
# verify the required parameter '{{paramName}}' is set
unless (exists $args{'{{paramName}}'}) {
croak("Missing the required parameter '{{paramName}}' when calling {{operationId}}");
}
{{/required}}{{/allParams}}
{{/required}}
{{/allParams}}
# parse inputs
my $_resource_path = '{{path}}';
$_resource_path =~ s/{format}/json/; # default format to json
@ -104,54 +106,70 @@ sub {{operationId}} {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type({{#consumes}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/consumes}});
{{#queryParams}}# query params
{{#queryParams}}
# query params
if ( exists $args{'{{paramName}}'}) {
$query_params->{'{{baseName}}'} = $self->{api_client}->to_query_value($args{'{{paramName}}'});
}{{/queryParams}}
{{#headerParams}}# header params
}
{{/queryParams}}
{{#headerParams}}
# header params
if ( exists $args{'{{paramName}}'}) {
$header_params->{'{{baseName}}'} = $self->{api_client}->to_header_value($args{'{{paramName}}'});
}{{/headerParams}}
{{#pathParams}}# path params
}
{{/headerParams}}
{{#pathParams}}
# path params
if ( exists $args{'{{paramName}}'}) {
my $_base_variable = "{" . "{{baseName}}" . "}";
my $_base_value = $self->{api_client}->to_path_value($args{'{{paramName}}'});
$_resource_path =~ s/$_base_variable/$_base_value/g;
}{{/pathParams}}
{{#formParams}}# form params
}
{{/pathParams}}
{{#formParams}}
# form params
if ( exists $args{'{{paramName}}'} ) {
{{#isFile}}$form_params->{'{{baseName}}'} = [] unless defined $form_params->{'{{baseName}}'};
push @{$form_params->{'{{baseName}}'}}, $args{'{{paramName}}'};
{{/isFile}}
{{^isFile}}$form_params->{'{{baseName}}'} = $self->{api_client}->to_form_value($args{'{{paramName}}'});
{{/isFile}}
}{{/formParams}}
}
{{/formParams}}
my $_body_data;
{{#bodyParams}}# body params
{{#bodyParams}}
# body params
if ( exists $args{'{{paramName}}'}) {
$_body_data = $args{'{{paramName}}'};
}{{/bodyParams}}
}
{{/bodyParams}}
# authentication setting, if any
my $auth_settings = [qw({{#authMethods}}{{name}} {{/authMethods}})];
# make the API Call
{{#returnType}}my $response = $self->{api_client}->call_api($_resource_path, $_method,
{{#returnType}}
my $response = $self->{api_client}->call_api($_resource_path, $_method,
$query_params, $form_params,
$header_params, $_body_data, $auth_settings);
if (!$response) {
return;
}
my $_response_object = $self->{api_client}->deserialize('{{returnType}}', $response);
return $_response_object;{{/returnType}}
{{^returnType}}$self->{api_client}->call_api($_resource_path, $_method,
return $_response_object;
{{/returnType}}
{{^returnType}}
$self->{api_client}->call_api($_resource_path, $_method,
$query_params, $form_params,
$header_params, $_body_data, $auth_settings);
return;
{{/returnType}}
}
{{/operation}}
{{newline}}
{{/operations}}
1;

View File

@ -608,10 +608,8 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> AddPetWithHttpInfo (Pet body = null)
{
var localVarPath = "/pet";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -621,13 +619,15 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -636,7 +636,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@ -646,7 +646,6 @@ namespace IO.Swagger.Api
}
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -691,10 +690,8 @@ namespace IO.Swagger.Api
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<ApiResponse<Object>> AddPetAsyncWithHttpInfo (Pet body = null)
{
var localVarPath = "/pet";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -704,13 +701,15 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -719,7 +718,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@ -729,7 +728,6 @@ namespace IO.Swagger.Api
}
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -753,6 +751,7 @@ namespace IO.Swagger.Api
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
/// Fake endpoint to test byte array in body parameter for adding a new pet to the store
/// </summary>
@ -772,10 +771,8 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> AddPetUsingByteArrayWithHttpInfo (byte[] body = null)
{
var localVarPath = "/pet?testing_byte_array&#x3D;true";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -785,13 +782,15 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -800,7 +799,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@ -810,7 +809,6 @@ namespace IO.Swagger.Api
}
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -855,10 +853,8 @@ namespace IO.Swagger.Api
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<ApiResponse<Object>> AddPetUsingByteArrayAsyncWithHttpInfo (byte[] body = null)
{
var localVarPath = "/pet?testing_byte_array&#x3D;true";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -868,13 +864,15 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -883,7 +881,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@ -893,7 +891,6 @@ namespace IO.Swagger.Api
}
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -917,6 +914,7 @@ namespace IO.Swagger.Api
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
/// Deletes a pet
/// </summary>
@ -938,14 +936,11 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> DeletePetWithHttpInfo (long? petId, string apiKey = null)
{
// verify the required parameter 'petId' is set
if (petId == null)
throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->DeletePet");
var localVarPath = "/pet/{petId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -955,13 +950,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -971,11 +966,9 @@ namespace IO.Swagger.Api
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter
if (apiKey != null) localVarHeaderParams.Add("api_key", Configuration.ApiClient.ParameterToString(apiKey)); // header parameter
if (apiKey != null) localVarHeaderParams.Add("api_key", Configuration.ApiClient.ParameterToString(apiKey)); // header parameter
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -1023,11 +1016,10 @@ namespace IO.Swagger.Api
public async System.Threading.Tasks.Task<ApiResponse<Object>> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null)
{
// verify the required parameter 'petId' is set
if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling DeletePet");
if (petId == null)
throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->DeletePet");
var localVarPath = "/pet/{petId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1037,13 +1029,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1053,11 +1045,9 @@ namespace IO.Swagger.Api
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter
if (apiKey != null) localVarHeaderParams.Add("api_key", Configuration.ApiClient.ParameterToString(apiKey)); // header parameter
if (apiKey != null) localVarHeaderParams.Add("api_key", Configuration.ApiClient.ParameterToString(apiKey)); // header parameter
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -1081,6 +1071,7 @@ namespace IO.Swagger.Api
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
/// Finds Pets by status Multiple status values can be provided with comma separated strings
/// </summary>
@ -1101,10 +1092,8 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of List&lt;Pet&gt;</returns>
public ApiResponse< List<Pet> > FindPetsByStatusWithHttpInfo (List<string> status = null)
{
var localVarPath = "/pet/findByStatus";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1114,13 +1103,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1129,11 +1118,9 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter
if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -1179,10 +1166,8 @@ namespace IO.Swagger.Api
/// <returns>Task of ApiResponse (List&lt;Pet&gt;)</returns>
public async System.Threading.Tasks.Task<ApiResponse<List<Pet>>> FindPetsByStatusAsyncWithHttpInfo (List<string> status = null)
{
var localVarPath = "/pet/findByStatus";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1192,13 +1177,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1207,11 +1192,9 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter
if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -1235,6 +1218,7 @@ namespace IO.Swagger.Api
(List<Pet>) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List<Pet>)));
}
/// <summary>
/// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
/// </summary>
@ -1255,10 +1239,8 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of List&lt;Pet&gt;</returns>
public ApiResponse< List<Pet> > FindPetsByTagsWithHttpInfo (List<string> tags = null)
{
var localVarPath = "/pet/findByTags";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1268,13 +1250,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1283,11 +1265,9 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (tags != null) localVarQueryParams.Add("tags", Configuration.ApiClient.ParameterToString(tags)); // query parameter
if (tags != null) localVarQueryParams.Add("tags", Configuration.ApiClient.ParameterToString(tags)); // query parameter
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -1333,10 +1313,8 @@ namespace IO.Swagger.Api
/// <returns>Task of ApiResponse (List&lt;Pet&gt;)</returns>
public async System.Threading.Tasks.Task<ApiResponse<List<Pet>>> FindPetsByTagsAsyncWithHttpInfo (List<string> tags = null)
{
var localVarPath = "/pet/findByTags";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1346,13 +1324,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1361,11 +1339,9 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (tags != null) localVarQueryParams.Add("tags", Configuration.ApiClient.ParameterToString(tags)); // query parameter
if (tags != null) localVarQueryParams.Add("tags", Configuration.ApiClient.ParameterToString(tags)); // query parameter
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -1389,6 +1365,7 @@ namespace IO.Swagger.Api
(List<Pet>) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List<Pet>)));
}
/// <summary>
/// Find pet by ID Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
/// </summary>
@ -1409,14 +1386,11 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Pet</returns>
public ApiResponse< Pet > GetPetByIdWithHttpInfo (long? petId)
{
// verify the required parameter 'petId' is set
if (petId == null)
throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetById");
var localVarPath = "/pet/{petId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1426,13 +1400,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1442,16 +1416,14 @@ namespace IO.Swagger.Api
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter
// authentication (api_key) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
{
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
}
// authentication (petstore_auth) required
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -1498,11 +1470,10 @@ namespace IO.Swagger.Api
public async System.Threading.Tasks.Task<ApiResponse<Pet>> GetPetByIdAsyncWithHttpInfo (long? petId)
{
// verify the required parameter 'petId' is set
if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling GetPetById");
if (petId == null)
throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetById");
var localVarPath = "/pet/{petId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1512,13 +1483,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1528,16 +1499,13 @@ namespace IO.Swagger.Api
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter
// authentication (api_key) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
{
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
}
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -1561,6 +1529,7 @@ namespace IO.Swagger.Api
(Pet) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Pet)));
}
/// <summary>
/// Fake endpoint to test inline arbitrary object return by &#39;Find pet by ID&#39; Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
/// </summary>
@ -1581,14 +1550,11 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of InlineResponse200</returns>
public ApiResponse< InlineResponse200 > GetPetByIdInObjectWithHttpInfo (long? petId)
{
// verify the required parameter 'petId' is set
if (petId == null)
throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetByIdInObject");
var localVarPath = "/pet/{petId}?response&#x3D;inline_arbitrary_object";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1598,13 +1564,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1614,16 +1580,14 @@ namespace IO.Swagger.Api
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter
// authentication (api_key) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
{
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
}
// authentication (petstore_auth) required
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -1670,11 +1634,10 @@ namespace IO.Swagger.Api
public async System.Threading.Tasks.Task<ApiResponse<InlineResponse200>> GetPetByIdInObjectAsyncWithHttpInfo (long? petId)
{
// verify the required parameter 'petId' is set
if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling GetPetByIdInObject");
if (petId == null)
throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetByIdInObject");
var localVarPath = "/pet/{petId}?response&#x3D;inline_arbitrary_object";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1684,13 +1647,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1700,16 +1663,13 @@ namespace IO.Swagger.Api
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter
// authentication (api_key) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
{
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
}
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -1733,6 +1693,7 @@ namespace IO.Swagger.Api
(InlineResponse200) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse200)));
}
/// <summary>
/// Fake endpoint to test byte array return by &#39;Find pet by ID&#39; Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
/// </summary>
@ -1753,14 +1714,11 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of byte[]</returns>
public ApiResponse< byte[] > PetPetIdtestingByteArraytrueGetWithHttpInfo (long? petId)
{
// verify the required parameter 'petId' is set
if (petId == null)
throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->PetPetIdtestingByteArraytrueGet");
var localVarPath = "/pet/{petId}?testing_byte_array&#x3D;true";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1770,13 +1728,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1786,16 +1744,14 @@ namespace IO.Swagger.Api
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter
// authentication (api_key) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
{
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
}
// authentication (petstore_auth) required
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -1842,11 +1798,10 @@ namespace IO.Swagger.Api
public async System.Threading.Tasks.Task<ApiResponse<byte[]>> PetPetIdtestingByteArraytrueGetAsyncWithHttpInfo (long? petId)
{
// verify the required parameter 'petId' is set
if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling PetPetIdtestingByteArraytrueGet");
if (petId == null)
throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->PetPetIdtestingByteArraytrueGet");
var localVarPath = "/pet/{petId}?testing_byte_array&#x3D;true";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1856,13 +1811,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1872,16 +1827,13 @@ namespace IO.Swagger.Api
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter
// authentication (api_key) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
{
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
}
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -1905,6 +1857,7 @@ namespace IO.Swagger.Api
(byte[]) Configuration.ApiClient.Deserialize(localVarResponse, typeof(byte[])));
}
/// <summary>
/// Update an existing pet
/// </summary>
@ -1924,10 +1877,8 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> UpdatePetWithHttpInfo (Pet body = null)
{
var localVarPath = "/pet";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1937,13 +1888,15 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1952,7 +1905,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@ -1962,7 +1915,6 @@ namespace IO.Swagger.Api
}
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -2007,10 +1959,8 @@ namespace IO.Swagger.Api
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<ApiResponse<Object>> UpdatePetAsyncWithHttpInfo (Pet body = null)
{
var localVarPath = "/pet";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -2020,13 +1970,15 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -2035,7 +1987,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@ -2045,7 +1997,6 @@ namespace IO.Swagger.Api
}
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -2069,6 +2020,7 @@ namespace IO.Swagger.Api
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
/// Updates a pet in the store with form data
/// </summary>
@ -2092,14 +2044,11 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> UpdatePetWithFormWithHttpInfo (string petId, string name = null, string status = null)
{
// verify the required parameter 'petId' is set
if (petId == null)
throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm");
var localVarPath = "/pet/{petId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -2115,7 +2064,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -2125,12 +2075,10 @@ namespace IO.Swagger.Api
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter
if (name != null) localVarFormParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // form parameter
if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // form parameter
if (name != null) localVarFormParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // form parameter
if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // form parameter
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -2180,11 +2128,10 @@ if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.Par
public async System.Threading.Tasks.Task<ApiResponse<Object>> UpdatePetWithFormAsyncWithHttpInfo (string petId, string name = null, string status = null)
{
// verify the required parameter 'petId' is set
if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UpdatePetWithForm");
if (petId == null)
throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm");
var localVarPath = "/pet/{petId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -2200,7 +2147,8 @@ if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.Par
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -2210,12 +2158,10 @@ if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.Par
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter
if (name != null) localVarFormParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // form parameter
if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // form parameter
if (name != null) localVarFormParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // form parameter
if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // form parameter
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -2239,6 +2185,7 @@ if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.Par
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
/// uploads an image
/// </summary>
@ -2262,14 +2209,11 @@ if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.Par
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, Stream file = null)
{
// verify the required parameter 'petId' is set
if (petId == null)
throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFile");
var localVarPath = "/pet/{petId}/uploadImage";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -2285,7 +2229,8 @@ if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.Par
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -2295,12 +2240,10 @@ if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.Par
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter
if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter
if (file != null) localVarFileParams.Add("file", Configuration.ApiClient.ParameterToFile("file", file));
if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter
if (file != null) localVarFileParams.Add("file", Configuration.ApiClient.ParameterToFile("file", file));
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -2350,11 +2293,10 @@ if (file != null) localVarFileParams.Add("file", Configuration.ApiClient.Paramet
public async System.Threading.Tasks.Task<ApiResponse<Object>> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, Stream file = null)
{
// verify the required parameter 'petId' is set
if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UploadFile");
if (petId == null)
throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFile");
var localVarPath = "/pet/{petId}/uploadImage";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -2370,7 +2312,8 @@ if (file != null) localVarFileParams.Add("file", Configuration.ApiClient.Paramet
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -2380,12 +2323,10 @@ if (file != null) localVarFileParams.Add("file", Configuration.ApiClient.Paramet
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter
if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter
if (file != null) localVarFileParams.Add("file", Configuration.ApiClient.ParameterToFile("file", file));
if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter
if (file != null) localVarFileParams.Add("file", Configuration.ApiClient.ParameterToFile("file", file));
// authentication (petstore_auth) required
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@ -2409,5 +2350,6 @@ if (file != null) localVarFileParams.Add("file", Configuration.ApiClient.Paramet
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
}
}

View File

@ -370,14 +370,11 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> DeleteOrderWithHttpInfo (string orderId)
{
// verify the required parameter 'orderId' is set
if (orderId == null)
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder");
var localVarPath = "/store/order/{orderId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -387,13 +384,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -403,9 +400,8 @@ namespace IO.Swagger.Api
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
@ -445,11 +441,10 @@ namespace IO.Swagger.Api
public async System.Threading.Tasks.Task<ApiResponse<Object>> DeleteOrderAsyncWithHttpInfo (string orderId)
{
// verify the required parameter 'orderId' is set
if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling DeleteOrder");
if (orderId == null)
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder");
var localVarPath = "/store/order/{orderId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -459,13 +454,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -475,7 +470,6 @@ namespace IO.Swagger.Api
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// make the HTTP request
@ -495,6 +489,7 @@ namespace IO.Swagger.Api
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
/// Finds orders by status A single status value can be provided as a string
/// </summary>
@ -515,10 +510,8 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of List&lt;Order&gt;</returns>
public ApiResponse< List<Order> > FindOrdersByStatusWithHttpInfo (string status = null)
{
var localVarPath = "/store/findByStatus";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -528,13 +521,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -543,22 +536,21 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter
if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter
// authentication (test_api_client_id) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_id")))
{
localVarHeaderParams["x-test_api_client_id"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_id");
}
// authentication (test_api_client_secret) required
// authentication (test_api_client_secret) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_secret")))
{
localVarHeaderParams["x-test_api_client_secret"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_secret");
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
@ -598,10 +590,8 @@ namespace IO.Swagger.Api
/// <returns>Task of ApiResponse (List&lt;Order&gt;)</returns>
public async System.Threading.Tasks.Task<ApiResponse<List<Order>>> FindOrdersByStatusAsyncWithHttpInfo (string status = null)
{
var localVarPath = "/store/findByStatus";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -611,13 +601,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -626,17 +616,14 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter
if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter
// authentication (test_api_client_id) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_id")))
{
localVarHeaderParams["x-test_api_client_id"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_id");
}
// authentication (test_api_client_secret) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_secret")))
{
localVarHeaderParams["x-test_api_client_secret"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_secret");
@ -659,6 +646,7 @@ namespace IO.Swagger.Api
(List<Order>) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List<Order>)));
}
/// <summary>
/// Returns pet inventories by status Returns a map of status codes to quantities
/// </summary>
@ -677,10 +665,8 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Dictionary&lt;string, int?&gt;</returns>
public ApiResponse< Dictionary<string, int?> > GetInventoryWithHttpInfo ()
{
var localVarPath = "/store/inventory";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -690,13 +676,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -705,15 +691,14 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
// authentication (api_key) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
{
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
@ -751,10 +736,8 @@ namespace IO.Swagger.Api
/// <returns>Task of ApiResponse (Dictionary&lt;string, int?&gt;)</returns>
public async System.Threading.Tasks.Task<ApiResponse<Dictionary<string, int?>>> GetInventoryAsyncWithHttpInfo ()
{
var localVarPath = "/store/inventory";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -764,13 +747,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -779,10 +762,8 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
// authentication (api_key) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
{
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
@ -805,6 +786,7 @@ namespace IO.Swagger.Api
(Dictionary<string, int?>) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary<string, int?>)));
}
/// <summary>
/// Fake endpoint to test arbitrary object return by &#39;Get inventory&#39; Returns an arbitrary object which is actually a map of status codes to quantities
/// </summary>
@ -823,10 +805,8 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Object</returns>
public ApiResponse< Object > GetInventoryInObjectWithHttpInfo ()
{
var localVarPath = "/store/inventory?response&#x3D;arbitrary_object";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -836,13 +816,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -851,15 +831,14 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
// authentication (api_key) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
{
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
@ -897,10 +876,8 @@ namespace IO.Swagger.Api
/// <returns>Task of ApiResponse (Object)</returns>
public async System.Threading.Tasks.Task<ApiResponse<Object>> GetInventoryInObjectAsyncWithHttpInfo ()
{
var localVarPath = "/store/inventory?response&#x3D;arbitrary_object";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -910,13 +887,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -925,10 +902,8 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
// authentication (api_key) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
{
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
@ -951,6 +926,7 @@ namespace IO.Swagger.Api
(Object) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object)));
}
/// <summary>
/// Find purchase order by ID For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
/// </summary>
@ -971,14 +947,11 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Order</returns>
public ApiResponse< Order > GetOrderByIdWithHttpInfo (string orderId)
{
// verify the required parameter 'orderId' is set
if (orderId == null)
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById");
var localVarPath = "/store/order/{orderId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -988,13 +961,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1004,21 +977,20 @@ namespace IO.Swagger.Api
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// authentication (test_api_key_header) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_header")))
{
localVarHeaderParams["test_api_key_header"] = Configuration.GetApiKeyWithPrefix("test_api_key_header");
}
// authentication (test_api_key_query) required
// authentication (test_api_key_query) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_query")))
{
localVarQueryParams["test_api_key_query"] = Configuration.GetApiKeyWithPrefix("test_api_key_query");
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
@ -1059,11 +1031,10 @@ namespace IO.Swagger.Api
public async System.Threading.Tasks.Task<ApiResponse<Order>> GetOrderByIdAsyncWithHttpInfo (string orderId)
{
// verify the required parameter 'orderId' is set
if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling GetOrderById");
if (orderId == null)
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById");
var localVarPath = "/store/order/{orderId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1073,13 +1044,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1089,16 +1060,13 @@ namespace IO.Swagger.Api
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// authentication (test_api_key_header) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_header")))
{
localVarHeaderParams["test_api_key_header"] = Configuration.GetApiKeyWithPrefix("test_api_key_header");
}
// authentication (test_api_key_query) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_query")))
{
localVarQueryParams["test_api_key_query"] = Configuration.GetApiKeyWithPrefix("test_api_key_query");
@ -1121,6 +1089,7 @@ namespace IO.Swagger.Api
(Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order)));
}
/// <summary>
/// Place an order for a pet
/// </summary>
@ -1141,10 +1110,8 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Order</returns>
public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body = null)
{
var localVarPath = "/store/order";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1154,13 +1121,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1169,7 +1136,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@ -1179,18 +1146,18 @@ namespace IO.Swagger.Api
}
// authentication (test_api_client_id) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_id")))
{
localVarHeaderParams["x-test_api_client_id"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_id");
}
// authentication (test_api_client_secret) required
// authentication (test_api_client_secret) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_secret")))
{
localVarHeaderParams["x-test_api_client_secret"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_secret");
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
@ -1230,10 +1197,8 @@ namespace IO.Swagger.Api
/// <returns>Task of ApiResponse (Order)</returns>
public async System.Threading.Tasks.Task<ApiResponse<Order>> PlaceOrderAsyncWithHttpInfo (Order body = null)
{
var localVarPath = "/store/order";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1243,13 +1208,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1258,7 +1223,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@ -1268,13 +1233,11 @@ namespace IO.Swagger.Api
}
// authentication (test_api_client_id) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_id")))
{
localVarHeaderParams["x-test_api_client_id"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_id");
}
// authentication (test_api_client_secret) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_secret")))
{
localVarHeaderParams["x-test_api_client_secret"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_secret");
@ -1297,5 +1260,6 @@ namespace IO.Swagger.Api
(Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order)));
}
}
}

View File

@ -466,10 +466,8 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> CreateUserWithHttpInfo (User body = null)
{
var localVarPath = "/user";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -479,13 +477,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -494,7 +492,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@ -503,7 +501,7 @@ namespace IO.Swagger.Api
localVarPostBody = body; // byte array
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
@ -542,10 +540,8 @@ namespace IO.Swagger.Api
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<ApiResponse<Object>> CreateUserAsyncWithHttpInfo (User body = null)
{
var localVarPath = "/user";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -555,13 +551,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -570,7 +566,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@ -597,6 +593,7 @@ namespace IO.Swagger.Api
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
/// Creates list of users with given input array
/// </summary>
@ -616,10 +613,8 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> CreateUsersWithArrayInputWithHttpInfo (List<User> body = null)
{
var localVarPath = "/user/createWithArray";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -629,13 +624,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -644,7 +639,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@ -653,7 +648,7 @@ namespace IO.Swagger.Api
localVarPostBody = body; // byte array
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
@ -692,10 +687,8 @@ namespace IO.Swagger.Api
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithArrayInputAsyncWithHttpInfo (List<User> body = null)
{
var localVarPath = "/user/createWithArray";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -705,13 +698,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -720,7 +713,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@ -747,6 +740,7 @@ namespace IO.Swagger.Api
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
/// Creates list of users with given input array
/// </summary>
@ -766,10 +760,8 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> CreateUsersWithListInputWithHttpInfo (List<User> body = null)
{
var localVarPath = "/user/createWithList";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -779,13 +771,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -794,7 +786,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@ -803,7 +795,7 @@ namespace IO.Swagger.Api
localVarPostBody = body; // byte array
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
@ -842,10 +834,8 @@ namespace IO.Swagger.Api
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithListInputAsyncWithHttpInfo (List<User> body = null)
{
var localVarPath = "/user/createWithList";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -855,13 +845,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -870,7 +860,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@ -897,6 +887,7 @@ namespace IO.Swagger.Api
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
/// Delete user This can only be done by the logged in user.
/// </summary>
@ -916,14 +907,11 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> DeleteUserWithHttpInfo (string username)
{
// verify the required parameter 'username' is set
if (username == null)
throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser");
var localVarPath = "/user/{username}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -933,13 +921,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -949,16 +937,15 @@ namespace IO.Swagger.Api
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter
// authentication (test_http_basic) required
// http basic authentication required
if (!String.IsNullOrEmpty(Configuration.Username) || !String.IsNullOrEmpty(Configuration.Password))
{
localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(Configuration.Username + ":" + Configuration.Password);
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
@ -998,11 +985,10 @@ namespace IO.Swagger.Api
public async System.Threading.Tasks.Task<ApiResponse<Object>> DeleteUserAsyncWithHttpInfo (string username)
{
// verify the required parameter 'username' is set
if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling DeleteUser");
if (username == null)
throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser");
var localVarPath = "/user/{username}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1012,13 +998,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1028,10 +1014,8 @@ namespace IO.Swagger.Api
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter
// authentication (test_http_basic) required
// http basic authentication required
if (!String.IsNullOrEmpty(Configuration.Username) || !String.IsNullOrEmpty(Configuration.Password))
{
@ -1055,6 +1039,7 @@ namespace IO.Swagger.Api
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
/// Get user by user name
/// </summary>
@ -1075,14 +1060,11 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of User</returns>
public ApiResponse< User > GetUserByNameWithHttpInfo (string username)
{
// verify the required parameter 'username' is set
if (username == null)
throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName");
var localVarPath = "/user/{username}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1092,13 +1074,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1108,9 +1090,8 @@ namespace IO.Swagger.Api
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
@ -1151,11 +1132,10 @@ namespace IO.Swagger.Api
public async System.Threading.Tasks.Task<ApiResponse<User>> GetUserByNameAsyncWithHttpInfo (string username)
{
// verify the required parameter 'username' is set
if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling GetUserByName");
if (username == null)
throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName");
var localVarPath = "/user/{username}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1165,13 +1145,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1181,7 +1161,6 @@ namespace IO.Swagger.Api
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter
// make the HTTP request
@ -1201,6 +1180,7 @@ namespace IO.Swagger.Api
(User) Configuration.ApiClient.Deserialize(localVarResponse, typeof(User)));
}
/// <summary>
/// Logs user into the system
/// </summary>
@ -1223,10 +1203,8 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of string</returns>
public ApiResponse< string > LoginUserWithHttpInfo (string username = null, string password = null)
{
var localVarPath = "/user/login";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1236,13 +1214,13 @@ namespace IO.Swagger.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1251,11 +1229,10 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (username != null) localVarQueryParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // query parameter
if (password != null) localVarQueryParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // query parameter
if (username != null) localVarQueryParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // query parameter
if (password != null) localVarQueryParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // query parameter
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
@ -1297,10 +1274,8 @@ if (password != null) localVarQueryParams.Add("password", Configuration.ApiClien
/// <returns>Task of ApiResponse (string)</returns>
public async System.Threading.Tasks.Task<ApiResponse<string>> LoginUserAsyncWithHttpInfo (string username = null, string password = null)
{
var localVarPath = "/user/login";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1310,13 +1285,13 @@ if (password != null) localVarQueryParams.Add("password", Configuration.ApiClien
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1325,9 +1300,8 @@ if (password != null) localVarQueryParams.Add("password", Configuration.ApiClien
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (username != null) localVarQueryParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // query parameter
if (password != null) localVarQueryParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // query parameter
if (username != null) localVarQueryParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // query parameter
if (password != null) localVarQueryParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // query parameter
// make the HTTP request
@ -1347,6 +1321,7 @@ if (password != null) localVarQueryParams.Add("password", Configuration.ApiClien
(string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string)));
}
/// <summary>
/// Logs out current logged in user session
/// </summary>
@ -1364,10 +1339,8 @@ if (password != null) localVarQueryParams.Add("password", Configuration.ApiClien
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> LogoutUserWithHttpInfo ()
{
var localVarPath = "/user/logout";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1377,13 +1350,13 @@ if (password != null) localVarQueryParams.Add("password", Configuration.ApiClien
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1392,9 +1365,8 @@ if (password != null) localVarQueryParams.Add("password", Configuration.ApiClien
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
@ -1431,10 +1403,8 @@ if (password != null) localVarQueryParams.Add("password", Configuration.ApiClien
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<ApiResponse<Object>> LogoutUserAsyncWithHttpInfo ()
{
var localVarPath = "/user/logout";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1444,13 +1414,13 @@ if (password != null) localVarQueryParams.Add("password", Configuration.ApiClien
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1459,7 +1429,6 @@ if (password != null) localVarQueryParams.Add("password", Configuration.ApiClien
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
// make the HTTP request
@ -1479,6 +1448,7 @@ if (password != null) localVarQueryParams.Add("password", Configuration.ApiClien
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
/// Updated user This can only be done by the logged in user.
/// </summary>
@ -1500,14 +1470,11 @@ if (password != null) localVarQueryParams.Add("password", Configuration.ApiClien
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> UpdateUserWithHttpInfo (string username, User body = null)
{
// verify the required parameter 'username' is set
if (username == null)
throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser");
var localVarPath = "/user/{username}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1517,13 +1484,13 @@ if (password != null) localVarQueryParams.Add("password", Configuration.ApiClien
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1533,7 +1500,7 @@ if (password != null) localVarQueryParams.Add("password", Configuration.ApiClien
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter
if (body.GetType() != typeof(byte[]))
if (body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@ -1542,7 +1509,7 @@ if (password != null) localVarQueryParams.Add("password", Configuration.ApiClien
localVarPostBody = body; // byte array
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
@ -1584,11 +1551,10 @@ if (password != null) localVarQueryParams.Add("password", Configuration.ApiClien
public async System.Threading.Tasks.Task<ApiResponse<Object>> UpdateUserAsyncWithHttpInfo (string username, User body = null)
{
// verify the required parameter 'username' is set
if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UpdateUser");
if (username == null)
throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser");
var localVarPath = "/user/{username}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -1598,13 +1564,13 @@ if (password != null) localVarQueryParams.Add("password", Configuration.ApiClien
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json", "application/xml"
"application/json",
"application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@ -1614,7 +1580,7 @@ if (password != null) localVarQueryParams.Add("password", Configuration.ApiClien
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter
if (body.GetType() != typeof(byte[]))
if (body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@ -1641,5 +1607,6 @@ if (password != null) localVarQueryParams.Add("password", Configuration.ApiClien
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
}
}

View File

@ -33,8 +33,9 @@ namespace IO.Swagger.Model
/// <param name="Binary">Binary.</param>
/// <param name="Date">Date.</param>
/// <param name="DateTime">DateTime.</param>
/// <param name="Password">Password.</param>
public FormatTest(int? Integer = null, int? Int32 = null, long? Int64 = null, double? Number = null, float? _Float = null, double? _Double = null, string _String = null, byte[] _Byte = null, byte[] Binary = null, DateTime? Date = null, string DateTime = null)
public FormatTest(int? Integer = null, int? Int32 = null, long? Int64 = null, double? Number = null, float? _Float = null, double? _Double = null, string _String = null, byte[] _Byte = null, byte[] Binary = null, DateTime? Date = null, DateTime? DateTime = null, string Password = null)
{
// to ensure "Number" is required (not null)
if (Number == null)
@ -55,6 +56,7 @@ namespace IO.Swagger.Model
this.Binary = Binary;
this.Date = Date;
this.DateTime = DateTime;
this.Password = Password;
}
@ -123,7 +125,13 @@ namespace IO.Swagger.Model
/// Gets or Sets DateTime
/// </summary>
[DataMember(Name="dateTime", EmitDefaultValue=false)]
public string DateTime { get; set; }
public DateTime? DateTime { get; set; }
/// <summary>
/// Gets or Sets Password
/// </summary>
[DataMember(Name="password", EmitDefaultValue=false)]
public string Password { get; set; }
/// <summary>
/// Returns the string presentation of the object
@ -144,6 +152,7 @@ namespace IO.Swagger.Model
sb.Append(" Binary: ").Append(Binary).Append("\n");
sb.Append(" Date: ").Append(Date).Append("\n");
sb.Append(" DateTime: ").Append(DateTime).Append("\n");
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -234,6 +243,11 @@ namespace IO.Swagger.Model
this.DateTime == other.DateTime ||
this.DateTime != null &&
this.DateTime.Equals(other.DateTime)
) &&
(
this.Password == other.Password ||
this.Password != null &&
this.Password.Equals(other.Password)
);
}
@ -270,6 +284,8 @@ namespace IO.Swagger.Model
hash = hash * 59 + this.Date.GetHashCode();
if (this.DateTime != null)
hash = hash * 59 + this.DateTime.GetHashCode();
if (this.Password != null)
hash = hash * 59 + this.Password.GetHashCode();
return hash;
}
}

View File

@ -10,7 +10,7 @@ Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/
- API version: 1.0.0
- Package version: 1.0.0
- Build date: 2016-04-11T20:30:20.696+08:00
- Build date: 2016-04-12T12:54:53.924+08:00
- Build package: class io.swagger.codegen.languages.PerlClientCodegen
## A note on Moose

View File

@ -18,7 +18,8 @@ Name | Type | Description | Notes
**byte** | **string** | | [optional]
**binary** | **string** | | [optional]
**date** | **DateTime** | | [optional]
**date_time** | **string** | | [optional]
**date_time** | **DateTime** | | [optional]
**password** | **string** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -174,12 +174,19 @@ __PACKAGE__->method_documentation({
read_only => '',
},
'date_time' => {
datatype => 'string',
datatype => 'DateTime',
base_name => 'dateTime',
description => '',
format => '',
read_only => '',
},
'password' => {
datatype => 'string',
base_name => 'password',
description => '',
format => '',
read_only => '',
},
});
__PACKAGE__->swagger_types( {
@ -193,7 +200,8 @@ __PACKAGE__->swagger_types( {
'byte' => 'string',
'binary' => 'string',
'date' => 'DateTime',
'date_time' => 'string'
'date_time' => 'DateTime',
'password' => 'string'
} );
__PACKAGE__->attribute_map( {
@ -207,7 +215,8 @@ __PACKAGE__->attribute_map( {
'byte' => 'byte',
'binary' => 'binary',
'date' => 'date',
'date_time' => 'dateTime'
'date_time' => 'dateTime',
'password' => 'password'
} );
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});

View File

@ -76,8 +76,6 @@ sub new {
sub add_pet {
my ($self, %args) = @_;
# parse inputs
my $_resource_path = '/pet';
$_resource_path =~ s/{format}/json/; # default format to json
@ -94,10 +92,6 @@ sub add_pet {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json', 'application/xml');
my $_body_data;
# body params
if ( exists $args{'body'}) {
@ -108,7 +102,6 @@ sub add_pet {
my $auth_settings = [qw(petstore_auth )];
# make the API Call
$self->{api_client}->call_api($_resource_path, $_method,
$query_params, $form_params,
$header_params, $_body_data, $auth_settings);
@ -140,8 +133,6 @@ sub add_pet {
sub add_pet_using_byte_array {
my ($self, %args) = @_;
# parse inputs
my $_resource_path = '/pet?testing_byte_array&#x3D;true';
$_resource_path =~ s/{format}/json/; # default format to json
@ -158,10 +149,6 @@ sub add_pet_using_byte_array {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json', 'application/xml');
my $_body_data;
# body params
if ( exists $args{'body'}) {
@ -172,7 +159,6 @@ sub add_pet_using_byte_array {
my $auth_settings = [qw(petstore_auth )];
# make the API Call
$self->{api_client}->call_api($_resource_path, $_method,
$query_params, $form_params,
$header_params, $_body_data, $auth_settings);
@ -210,12 +196,10 @@ sub add_pet_using_byte_array {
sub delete_pet {
my ($self, %args) = @_;
# verify the required parameter 'pet_id' is set
unless (exists $args{'pet_id'}) {
croak("Missing the required parameter 'pet_id' when calling delete_pet");
}
# parse inputs
my $_resource_path = '/pet/{petId}';
@ -233,26 +217,23 @@ sub delete_pet {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
# header params
if ( exists $args{'api_key'}) {
$header_params->{'api_key'} = $self->{api_client}->to_header_value($args{'api_key'});
}
# path params
if ( exists $args{'pet_id'}) {
my $_base_variable = "{" . "petId" . "}";
my $_base_value = $self->{api_client}->to_path_value($args{'pet_id'});
$_resource_path =~ s/$_base_variable/$_base_value/g;
}
my $_body_data;
my $_body_data;
# authentication setting, if any
my $auth_settings = [qw(petstore_auth )];
# make the API Call
$self->{api_client}->call_api($_resource_path, $_method,
$query_params, $form_params,
$header_params, $_body_data, $auth_settings);
@ -284,8 +265,6 @@ sub delete_pet {
sub find_pets_by_status {
my ($self, %args) = @_;
# parse inputs
my $_resource_path = '/pet/findByStatus';
$_resource_path =~ s/{format}/json/; # default format to json
@ -306,12 +285,8 @@ sub find_pets_by_status {
if ( exists $args{'status'}) {
$query_params->{'status'} = $self->{api_client}->to_query_value($args{'status'});
}
my $_body_data;
my $_body_data;
# authentication setting, if any
my $auth_settings = [qw(petstore_auth )];
@ -324,7 +299,7 @@ sub find_pets_by_status {
}
my $_response_object = $self->{api_client}->deserialize('ARRAY[Pet]', $response);
return $_response_object;
}
}
#
# find_pets_by_tags
@ -351,8 +326,6 @@ sub find_pets_by_status {
sub find_pets_by_tags {
my ($self, %args) = @_;
# parse inputs
my $_resource_path = '/pet/findByTags';
$_resource_path =~ s/{format}/json/; # default format to json
@ -373,12 +346,8 @@ sub find_pets_by_tags {
if ( exists $args{'tags'}) {
$query_params->{'tags'} = $self->{api_client}->to_query_value($args{'tags'});
}
my $_body_data;
my $_body_data;
# authentication setting, if any
my $auth_settings = [qw(petstore_auth )];
@ -391,7 +360,7 @@ sub find_pets_by_tags {
}
my $_response_object = $self->{api_client}->deserialize('ARRAY[Pet]', $response);
return $_response_object;
}
}
#
# get_pet_by_id
@ -418,12 +387,10 @@ sub find_pets_by_tags {
sub get_pet_by_id {
my ($self, %args) = @_;
# verify the required parameter 'pet_id' is set
unless (exists $args{'pet_id'}) {
croak("Missing the required parameter 'pet_id' when calling get_pet_by_id");
}
# parse inputs
my $_resource_path = '/pet/{petId}';
@ -441,18 +408,14 @@ sub get_pet_by_id {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
# path params
if ( exists $args{'pet_id'}) {
my $_base_variable = "{" . "petId" . "}";
my $_base_value = $self->{api_client}->to_path_value($args{'pet_id'});
$_resource_path =~ s/$_base_variable/$_base_value/g;
}
my $_body_data;
my $_body_data;
# authentication setting, if any
my $auth_settings = [qw(api_key petstore_auth )];
@ -465,7 +428,7 @@ sub get_pet_by_id {
}
my $_response_object = $self->{api_client}->deserialize('Pet', $response);
return $_response_object;
}
}
#
# get_pet_by_id_in_object
@ -492,12 +455,10 @@ sub get_pet_by_id {
sub get_pet_by_id_in_object {
my ($self, %args) = @_;
# verify the required parameter 'pet_id' is set
unless (exists $args{'pet_id'}) {
croak("Missing the required parameter 'pet_id' when calling get_pet_by_id_in_object");
}
# parse inputs
my $_resource_path = '/pet/{petId}?response&#x3D;inline_arbitrary_object';
@ -515,18 +476,14 @@ sub get_pet_by_id_in_object {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
# path params
if ( exists $args{'pet_id'}) {
my $_base_variable = "{" . "petId" . "}";
my $_base_value = $self->{api_client}->to_path_value($args{'pet_id'});
$_resource_path =~ s/$_base_variable/$_base_value/g;
}
my $_body_data;
my $_body_data;
# authentication setting, if any
my $auth_settings = [qw(api_key petstore_auth )];
@ -539,7 +496,7 @@ sub get_pet_by_id_in_object {
}
my $_response_object = $self->{api_client}->deserialize('InlineResponse200', $response);
return $_response_object;
}
}
#
# pet_pet_idtesting_byte_arraytrue_get
@ -566,12 +523,10 @@ sub get_pet_by_id_in_object {
sub pet_pet_idtesting_byte_arraytrue_get {
my ($self, %args) = @_;
# verify the required parameter 'pet_id' is set
unless (exists $args{'pet_id'}) {
croak("Missing the required parameter 'pet_id' when calling pet_pet_idtesting_byte_arraytrue_get");
}
# parse inputs
my $_resource_path = '/pet/{petId}?testing_byte_array&#x3D;true';
@ -589,18 +544,14 @@ sub pet_pet_idtesting_byte_arraytrue_get {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
# path params
if ( exists $args{'pet_id'}) {
my $_base_variable = "{" . "petId" . "}";
my $_base_value = $self->{api_client}->to_path_value($args{'pet_id'});
$_resource_path =~ s/$_base_variable/$_base_value/g;
}
my $_body_data;
my $_body_data;
# authentication setting, if any
my $auth_settings = [qw(api_key petstore_auth )];
@ -613,7 +564,7 @@ sub pet_pet_idtesting_byte_arraytrue_get {
}
my $_response_object = $self->{api_client}->deserialize('string', $response);
return $_response_object;
}
}
#
# update_pet
@ -640,8 +591,6 @@ sub pet_pet_idtesting_byte_arraytrue_get {
sub update_pet {
my ($self, %args) = @_;
# parse inputs
my $_resource_path = '/pet';
$_resource_path =~ s/{format}/json/; # default format to json
@ -658,10 +607,6 @@ sub update_pet {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json', 'application/xml');
my $_body_data;
# body params
if ( exists $args{'body'}) {
@ -672,7 +617,6 @@ sub update_pet {
my $auth_settings = [qw(petstore_auth )];
# make the API Call
$self->{api_client}->call_api($_resource_path, $_method,
$query_params, $form_params,
$header_params, $_body_data, $auth_settings);
@ -716,12 +660,10 @@ sub update_pet {
sub update_pet_with_form {
my ($self, %args) = @_;
# verify the required parameter 'pet_id' is set
unless (exists $args{'pet_id'}) {
croak("Missing the required parameter 'pet_id' when calling update_pet_with_form");
}
# parse inputs
my $_resource_path = '/pet/{petId}';
@ -739,29 +681,28 @@ sub update_pet_with_form {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/x-www-form-urlencoded');
# path params
if ( exists $args{'pet_id'}) {
my $_base_variable = "{" . "petId" . "}";
my $_base_value = $self->{api_client}->to_path_value($args{'pet_id'});
$_resource_path =~ s/$_base_variable/$_base_value/g;
}
# form params
if ( exists $args{'name'} ) {
$form_params->{'name'} = $self->{api_client}->to_form_value($args{'name'});
}# form params
}
# form params
if ( exists $args{'status'} ) {
$form_params->{'status'} = $self->{api_client}->to_form_value($args{'status'});
}
my $_body_data;
my $_body_data;
# authentication setting, if any
my $auth_settings = [qw(petstore_auth )];
# make the API Call
$self->{api_client}->call_api($_resource_path, $_method,
$query_params, $form_params,
$header_params, $_body_data, $auth_settings);
@ -805,12 +746,10 @@ sub update_pet_with_form {
sub upload_file {
my ($self, %args) = @_;
# verify the required parameter 'pet_id' is set
unless (exists $args{'pet_id'}) {
croak("Missing the required parameter 'pet_id' when calling upload_file");
}
# parse inputs
my $_resource_path = '/pet/{petId}/uploadImage';
@ -828,35 +767,33 @@ sub upload_file {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('multipart/form-data');
# path params
if ( exists $args{'pet_id'}) {
my $_base_variable = "{" . "petId" . "}";
my $_base_value = $self->{api_client}->to_path_value($args{'pet_id'});
$_resource_path =~ s/$_base_variable/$_base_value/g;
}
# form params
if ( exists $args{'additional_metadata'} ) {
$form_params->{'additionalMetadata'} = $self->{api_client}->to_form_value($args{'additional_metadata'});
}# form params
}
# form params
if ( exists $args{'file'} ) {
$form_params->{'file'} = [] unless defined $form_params->{'file'};
push @{$form_params->{'file'}}, $args{'file'};
}
my $_body_data;
my $_body_data;
# authentication setting, if any
my $auth_settings = [qw(petstore_auth )];
# make the API Call
$self->{api_client}->call_api($_resource_path, $_method,
$query_params, $form_params,
$header_params, $_body_data, $auth_settings);
return;
}
1;

View File

@ -37,7 +37,7 @@ has version_info => ( is => 'ro',
default => sub { {
app_name => 'Swagger Petstore',
app_version => '1.0.0',
generated_date => '2016-04-11T20:30:20.696+08:00',
generated_date => '2016-04-12T12:54:53.924+08:00',
generator_class => 'class io.swagger.codegen.languages.PerlClientCodegen',
} },
documentation => 'Information about the application version and the codegen codebase version'
@ -103,7 +103,7 @@ Automatically generated by the Perl Swagger Codegen project:
=over 4
=item Build date: 2016-04-11T20:30:20.696+08:00
=item Build date: 2016-04-12T12:54:53.924+08:00
=item Build package: class io.swagger.codegen.languages.PerlClientCodegen

View File

@ -76,12 +76,10 @@ sub new {
sub delete_order {
my ($self, %args) = @_;
# verify the required parameter 'order_id' is set
unless (exists $args{'order_id'}) {
croak("Missing the required parameter 'order_id' when calling delete_order");
}
# parse inputs
my $_resource_path = '/store/order/{orderId}';
@ -99,23 +97,18 @@ sub delete_order {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
# path params
if ( exists $args{'order_id'}) {
my $_base_variable = "{" . "orderId" . "}";
my $_base_value = $self->{api_client}->to_path_value($args{'order_id'});
$_resource_path =~ s/$_base_variable/$_base_value/g;
}
my $_body_data;
my $_body_data;
# authentication setting, if any
my $auth_settings = [qw()];
# make the API Call
$self->{api_client}->call_api($_resource_path, $_method,
$query_params, $form_params,
$header_params, $_body_data, $auth_settings);
@ -147,8 +140,6 @@ sub delete_order {
sub find_orders_by_status {
my ($self, %args) = @_;
# parse inputs
my $_resource_path = '/store/findByStatus';
$_resource_path =~ s/{format}/json/; # default format to json
@ -169,12 +160,8 @@ sub find_orders_by_status {
if ( exists $args{'status'}) {
$query_params->{'status'} = $self->{api_client}->to_query_value($args{'status'});
}
my $_body_data;
my $_body_data;
# authentication setting, if any
my $auth_settings = [qw(test_api_client_id test_api_client_secret )];
@ -187,7 +174,7 @@ sub find_orders_by_status {
}
my $_response_object = $self->{api_client}->deserialize('ARRAY[Order]', $response);
return $_response_object;
}
}
#
# get_inventory
@ -208,8 +195,6 @@ sub find_orders_by_status {
sub get_inventory {
my ($self, %args) = @_;
# parse inputs
my $_resource_path = '/store/inventory';
$_resource_path =~ s/{format}/json/; # default format to json
@ -226,13 +211,7 @@ sub get_inventory {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
my $_body_data;
# authentication setting, if any
my $auth_settings = [qw(api_key )];
@ -245,7 +224,7 @@ sub get_inventory {
}
my $_response_object = $self->{api_client}->deserialize('HASH[string,int]', $response);
return $_response_object;
}
}
#
# get_inventory_in_object
@ -266,8 +245,6 @@ sub get_inventory {
sub get_inventory_in_object {
my ($self, %args) = @_;
# parse inputs
my $_resource_path = '/store/inventory?response&#x3D;arbitrary_object';
$_resource_path =~ s/{format}/json/; # default format to json
@ -284,13 +261,7 @@ sub get_inventory_in_object {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
my $_body_data;
# authentication setting, if any
my $auth_settings = [qw(api_key )];
@ -303,7 +274,7 @@ sub get_inventory_in_object {
}
my $_response_object = $self->{api_client}->deserialize('object', $response);
return $_response_object;
}
}
#
# get_order_by_id
@ -330,12 +301,10 @@ sub get_inventory_in_object {
sub get_order_by_id {
my ($self, %args) = @_;
# verify the required parameter 'order_id' is set
unless (exists $args{'order_id'}) {
croak("Missing the required parameter 'order_id' when calling get_order_by_id");
}
# parse inputs
my $_resource_path = '/store/order/{orderId}';
@ -353,18 +322,14 @@ sub get_order_by_id {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
# path params
if ( exists $args{'order_id'}) {
my $_base_variable = "{" . "orderId" . "}";
my $_base_value = $self->{api_client}->to_path_value($args{'order_id'});
$_resource_path =~ s/$_base_variable/$_base_value/g;
}
my $_body_data;
my $_body_data;
# authentication setting, if any
my $auth_settings = [qw(test_api_key_header test_api_key_query )];
@ -377,7 +342,7 @@ sub get_order_by_id {
}
my $_response_object = $self->{api_client}->deserialize('Order', $response);
return $_response_object;
}
}
#
# place_order
@ -404,8 +369,6 @@ sub get_order_by_id {
sub place_order {
my ($self, %args) = @_;
# parse inputs
my $_resource_path = '/store/order';
$_resource_path =~ s/{format}/json/; # default format to json
@ -422,10 +385,6 @@ sub place_order {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
my $_body_data;
# body params
if ( exists $args{'body'}) {
@ -444,7 +403,6 @@ sub place_order {
}
my $_response_object = $self->{api_client}->deserialize('Order', $response);
return $_response_object;
}
}
1;

View File

@ -76,8 +76,6 @@ sub new {
sub create_user {
my ($self, %args) = @_;
# parse inputs
my $_resource_path = '/user';
$_resource_path =~ s/{format}/json/; # default format to json
@ -94,10 +92,6 @@ sub create_user {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
my $_body_data;
# body params
if ( exists $args{'body'}) {
@ -108,7 +102,6 @@ sub create_user {
my $auth_settings = [qw()];
# make the API Call
$self->{api_client}->call_api($_resource_path, $_method,
$query_params, $form_params,
$header_params, $_body_data, $auth_settings);
@ -140,8 +133,6 @@ sub create_user {
sub create_users_with_array_input {
my ($self, %args) = @_;
# parse inputs
my $_resource_path = '/user/createWithArray';
$_resource_path =~ s/{format}/json/; # default format to json
@ -158,10 +149,6 @@ sub create_users_with_array_input {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
my $_body_data;
# body params
if ( exists $args{'body'}) {
@ -172,7 +159,6 @@ sub create_users_with_array_input {
my $auth_settings = [qw()];
# make the API Call
$self->{api_client}->call_api($_resource_path, $_method,
$query_params, $form_params,
$header_params, $_body_data, $auth_settings);
@ -204,8 +190,6 @@ sub create_users_with_array_input {
sub create_users_with_list_input {
my ($self, %args) = @_;
# parse inputs
my $_resource_path = '/user/createWithList';
$_resource_path =~ s/{format}/json/; # default format to json
@ -222,10 +206,6 @@ sub create_users_with_list_input {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
my $_body_data;
# body params
if ( exists $args{'body'}) {
@ -236,7 +216,6 @@ sub create_users_with_list_input {
my $auth_settings = [qw()];
# make the API Call
$self->{api_client}->call_api($_resource_path, $_method,
$query_params, $form_params,
$header_params, $_body_data, $auth_settings);
@ -268,12 +247,10 @@ sub create_users_with_list_input {
sub delete_user {
my ($self, %args) = @_;
# verify the required parameter 'username' is set
unless (exists $args{'username'}) {
croak("Missing the required parameter 'username' when calling delete_user");
}
# parse inputs
my $_resource_path = '/user/{username}';
@ -291,23 +268,18 @@ sub delete_user {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
# path params
if ( exists $args{'username'}) {
my $_base_variable = "{" . "username" . "}";
my $_base_value = $self->{api_client}->to_path_value($args{'username'});
$_resource_path =~ s/$_base_variable/$_base_value/g;
}
my $_body_data;
my $_body_data;
# authentication setting, if any
my $auth_settings = [qw(test_http_basic )];
# make the API Call
$self->{api_client}->call_api($_resource_path, $_method,
$query_params, $form_params,
$header_params, $_body_data, $auth_settings);
@ -339,12 +311,10 @@ sub delete_user {
sub get_user_by_name {
my ($self, %args) = @_;
# verify the required parameter 'username' is set
unless (exists $args{'username'}) {
croak("Missing the required parameter 'username' when calling get_user_by_name");
}
# parse inputs
my $_resource_path = '/user/{username}';
@ -362,18 +332,14 @@ sub get_user_by_name {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
# path params
if ( exists $args{'username'}) {
my $_base_variable = "{" . "username" . "}";
my $_base_value = $self->{api_client}->to_path_value($args{'username'});
$_resource_path =~ s/$_base_variable/$_base_value/g;
}
my $_body_data;
my $_body_data;
# authentication setting, if any
my $auth_settings = [qw()];
@ -386,7 +352,7 @@ sub get_user_by_name {
}
my $_response_object = $self->{api_client}->deserialize('User', $response);
return $_response_object;
}
}
#
# login_user
@ -419,8 +385,6 @@ sub get_user_by_name {
sub login_user {
my ($self, %args) = @_;
# parse inputs
my $_resource_path = '/user/login';
$_resource_path =~ s/{format}/json/; # default format to json
@ -440,16 +404,14 @@ sub login_user {
# query params
if ( exists $args{'username'}) {
$query_params->{'username'} = $self->{api_client}->to_query_value($args{'username'});
}# query params
}
# query params
if ( exists $args{'password'}) {
$query_params->{'password'} = $self->{api_client}->to_query_value($args{'password'});
}
my $_body_data;
my $_body_data;
# authentication setting, if any
my $auth_settings = [qw()];
@ -462,7 +424,7 @@ sub login_user {
}
my $_response_object = $self->{api_client}->deserialize('string', $response);
return $_response_object;
}
}
#
# logout_user
@ -483,8 +445,6 @@ sub login_user {
sub logout_user {
my ($self, %args) = @_;
# parse inputs
my $_resource_path = '/user/logout';
$_resource_path =~ s/{format}/json/; # default format to json
@ -501,18 +461,11 @@ sub logout_user {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
my $_body_data;
# authentication setting, if any
my $auth_settings = [qw()];
# make the API Call
$self->{api_client}->call_api($_resource_path, $_method,
$query_params, $form_params,
$header_params, $_body_data, $auth_settings);
@ -550,12 +503,10 @@ sub logout_user {
sub update_user {
my ($self, %args) = @_;
# verify the required parameter 'username' is set
unless (exists $args{'username'}) {
croak("Missing the required parameter 'username' when calling update_user");
}
# parse inputs
my $_resource_path = '/user/{username}';
@ -573,15 +524,13 @@ sub update_user {
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
# path params
if ( exists $args{'username'}) {
my $_base_variable = "{" . "username" . "}";
my $_base_value = $self->{api_client}->to_path_value($args{'username'});
$_resource_path =~ s/$_base_variable/$_base_value/g;
}
my $_body_data;
# body params
if ( exists $args{'body'}) {
@ -592,12 +541,10 @@ sub update_user {
my $auth_settings = [qw()];
# make the API Call
$self->{api_client}->call_api($_resource_path, $_method,
$query_params, $form_params,
$header_params, $_body_data, $auth_settings);
return;
}
1;