forked from loafle/openapi-generator-original
Return data before response status code and headers
This commit is contained in:
parent
66112d9eb5
commit
07de03c09b
@ -17,7 +17,7 @@ module {{moduleName}}
|
|||||||
{{#allParams}}{{^required}} # @option opts [{{{dataType}}}] :{{paramName}} {{description}}
|
{{#allParams}}{{^required}} # @option opts [{{{dataType}}}] :{{paramName}} {{description}}
|
||||||
{{/required}}{{/allParams}} # @return [{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}]
|
{{/required}}{{/allParams}} # @return [{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}]
|
||||||
def {{operationId}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}opts = {})
|
def {{operationId}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}opts = {})
|
||||||
{{#returnType}}status_code, headers, data = {{/returnType}}{{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}opts)
|
{{#returnType}}data, status_code, headers = {{/returnType}}{{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}opts)
|
||||||
{{#returnType}}return data{{/returnType}}{{^returnType}}return nil{{/returnType}}
|
{{#returnType}}return data{{/returnType}}{{^returnType}}return nil{{/returnType}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ module {{moduleName}}
|
|||||||
{{#allParams}}{{#required}} # @param {{paramName}} {{description}}
|
{{#allParams}}{{#required}} # @param {{paramName}} {{description}}
|
||||||
{{/required}}{{/allParams}} # @param [Hash] opts the optional parameters
|
{{/required}}{{/allParams}} # @param [Hash] opts the optional parameters
|
||||||
{{#allParams}}{{^required}} # @option opts [{{{dataType}}}] :{{paramName}} {{description}}
|
{{#allParams}}{{^required}} # @option opts [{{{dataType}}}] :{{paramName}} {{description}}
|
||||||
{{/required}}{{/allParams}} # @return [Array<Fixnum, Hash, {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}>] response status code, response headers and {{#returnType}}{{{returnType}}} data{{/returnType}}{{^returnType}}nil{{/returnType}}
|
{{/required}}{{/allParams}} # @return [Array<({{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}, Fixnum, Hash)>] {{#returnType}}{{{returnType}}} data{{/returnType}}{{^returnType}}nil{{/returnType}}, response status code and response headers
|
||||||
def {{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}opts = {})
|
def {{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: {{classname}}#{{operationId}} ..."
|
Configuration.logger.debug "Calling API: {{classname}}#{{operationId}} ..."
|
||||||
@ -74,7 +74,7 @@ module {{moduleName}}
|
|||||||
{{/bodyParam}}
|
{{/bodyParam}}
|
||||||
|
|
||||||
auth_names = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}]
|
auth_names = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}]
|
||||||
status_code, headers, data = @api_client.call_api(:{{httpMethod}}, path,
|
data, status_code, headers = @api_client.call_api(:{{httpMethod}}, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
@ -82,9 +82,9 @@ module {{moduleName}}
|
|||||||
:auth_names => auth_names{{#returnType}},
|
:auth_names => auth_names{{#returnType}},
|
||||||
:return_type => '{{{returnType}}}'{{/returnType}})
|
:return_type => '{{{returnType}}}'{{/returnType}})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: {{classname}}#{{operationId}}\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: {{classname}}#{{operationId}}\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
{{/operation}}
|
{{/operation}}
|
||||||
end
|
end
|
||||||
|
@ -25,8 +25,10 @@ module {{moduleName}}
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
# Call an API with given options and an array of 3 elements:
|
# Call an API with given options.
|
||||||
# response status code, response headers and the data deserialized from response body (could be nil).
|
#
|
||||||
|
# @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements:
|
||||||
|
# the data deserialized from response body (could be nil), response status code and response headers.
|
||||||
def call_api(http_method, path, opts = {})
|
def call_api(http_method, path, opts = {})
|
||||||
request = build_request(http_method, path, opts)
|
request = build_request(http_method, path, opts)
|
||||||
response = request.run
|
response = request.run
|
||||||
@ -47,7 +49,7 @@ module {{moduleName}}
|
|||||||
else
|
else
|
||||||
data = nil
|
data = nil
|
||||||
end
|
end
|
||||||
return response.code, response.headers, data
|
return data, response.code, response.headers
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_request(http_method, path, opts = {})
|
def build_request(http_method, path, opts = {})
|
||||||
|
@ -22,7 +22,7 @@ module Petstore
|
|||||||
#
|
#
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @option opts [Pet] :body Pet object that needs to be added to the store
|
# @option opts [Pet] :body Pet object that needs to be added to the store
|
||||||
# @return [Array<Fixnum, Hash, nil>] response status code, response headers and nil
|
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
||||||
def update_pet_with_http_info(opts = {})
|
def update_pet_with_http_info(opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: PetApi#update_pet ..."
|
Configuration.logger.debug "Calling API: PetApi#update_pet ..."
|
||||||
@ -53,16 +53,16 @@ module Petstore
|
|||||||
|
|
||||||
|
|
||||||
auth_names = ['petstore_auth']
|
auth_names = ['petstore_auth']
|
||||||
status_code, headers, data = @api_client.call_api(:PUT, path,
|
data, status_code, headers = @api_client.call_api(:PUT, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
:body => post_body,
|
:body => post_body,
|
||||||
:auth_names => auth_names)
|
:auth_names => auth_names)
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: PetApi#update_pet\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: PetApi#update_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Add a new pet to the store
|
# Add a new pet to the store
|
||||||
@ -79,7 +79,7 @@ module Petstore
|
|||||||
#
|
#
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @option opts [Pet] :body Pet object that needs to be added to the store
|
# @option opts [Pet] :body Pet object that needs to be added to the store
|
||||||
# @return [Array<Fixnum, Hash, nil>] response status code, response headers and nil
|
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
||||||
def add_pet_with_http_info(opts = {})
|
def add_pet_with_http_info(opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: PetApi#add_pet ..."
|
Configuration.logger.debug "Calling API: PetApi#add_pet ..."
|
||||||
@ -110,16 +110,16 @@ module Petstore
|
|||||||
|
|
||||||
|
|
||||||
auth_names = ['petstore_auth']
|
auth_names = ['petstore_auth']
|
||||||
status_code, headers, data = @api_client.call_api(:POST, path,
|
data, status_code, headers = @api_client.call_api(:POST, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
:body => post_body,
|
:body => post_body,
|
||||||
:auth_names => auth_names)
|
:auth_names => auth_names)
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: PetApi#add_pet\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: PetApi#add_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Finds Pets by status
|
# Finds Pets by status
|
||||||
@ -128,7 +128,7 @@ module Petstore
|
|||||||
# @option opts [Array<String>] :status Status values that need to be considered for filter
|
# @option opts [Array<String>] :status Status values that need to be considered for filter
|
||||||
# @return [Array<Pet>]
|
# @return [Array<Pet>]
|
||||||
def find_pets_by_status(opts = {})
|
def find_pets_by_status(opts = {})
|
||||||
status_code, headers, data = find_pets_by_status_with_http_info(opts)
|
data, status_code, headers = find_pets_by_status_with_http_info(opts)
|
||||||
return data
|
return data
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -136,7 +136,7 @@ module Petstore
|
|||||||
# Multiple status values can be provided with comma seperated strings
|
# Multiple status values can be provided with comma seperated strings
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @option opts [Array<String>] :status Status values that need to be considered for filter
|
# @option opts [Array<String>] :status Status values that need to be considered for filter
|
||||||
# @return [Array<Fixnum, Hash, Array<Pet>>] response status code, response headers and Array<Pet> data
|
# @return [Array<(Array<Pet>, Fixnum, Hash)>] Array<Pet> data, response status code and response headers
|
||||||
def find_pets_by_status_with_http_info(opts = {})
|
def find_pets_by_status_with_http_info(opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: PetApi#find_pets_by_status ..."
|
Configuration.logger.debug "Calling API: PetApi#find_pets_by_status ..."
|
||||||
@ -168,7 +168,7 @@ module Petstore
|
|||||||
|
|
||||||
|
|
||||||
auth_names = ['petstore_auth']
|
auth_names = ['petstore_auth']
|
||||||
status_code, headers, data = @api_client.call_api(:GET, path,
|
data, status_code, headers = @api_client.call_api(:GET, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
@ -176,9 +176,9 @@ module Petstore
|
|||||||
:auth_names => auth_names,
|
:auth_names => auth_names,
|
||||||
:return_type => 'Array<Pet>')
|
:return_type => 'Array<Pet>')
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: PetApi#find_pets_by_status\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: PetApi#find_pets_by_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Finds Pets by tags
|
# Finds Pets by tags
|
||||||
@ -187,7 +187,7 @@ module Petstore
|
|||||||
# @option opts [Array<String>] :tags Tags to filter by
|
# @option opts [Array<String>] :tags Tags to filter by
|
||||||
# @return [Array<Pet>]
|
# @return [Array<Pet>]
|
||||||
def find_pets_by_tags(opts = {})
|
def find_pets_by_tags(opts = {})
|
||||||
status_code, headers, data = find_pets_by_tags_with_http_info(opts)
|
data, status_code, headers = find_pets_by_tags_with_http_info(opts)
|
||||||
return data
|
return data
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ module Petstore
|
|||||||
# Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
# Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @option opts [Array<String>] :tags Tags to filter by
|
# @option opts [Array<String>] :tags Tags to filter by
|
||||||
# @return [Array<Fixnum, Hash, Array<Pet>>] response status code, response headers and Array<Pet> data
|
# @return [Array<(Array<Pet>, Fixnum, Hash)>] Array<Pet> data, response status code and response headers
|
||||||
def find_pets_by_tags_with_http_info(opts = {})
|
def find_pets_by_tags_with_http_info(opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: PetApi#find_pets_by_tags ..."
|
Configuration.logger.debug "Calling API: PetApi#find_pets_by_tags ..."
|
||||||
@ -227,7 +227,7 @@ module Petstore
|
|||||||
|
|
||||||
|
|
||||||
auth_names = ['petstore_auth']
|
auth_names = ['petstore_auth']
|
||||||
status_code, headers, data = @api_client.call_api(:GET, path,
|
data, status_code, headers = @api_client.call_api(:GET, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
@ -235,9 +235,9 @@ module Petstore
|
|||||||
:auth_names => auth_names,
|
:auth_names => auth_names,
|
||||||
:return_type => 'Array<Pet>')
|
:return_type => 'Array<Pet>')
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: PetApi#find_pets_by_tags\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: PetApi#find_pets_by_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Find pet by ID
|
# Find pet by ID
|
||||||
@ -246,7 +246,7 @@ module Petstore
|
|||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @return [Pet]
|
# @return [Pet]
|
||||||
def get_pet_by_id(pet_id, opts = {})
|
def get_pet_by_id(pet_id, opts = {})
|
||||||
status_code, headers, data = get_pet_by_id_with_http_info(pet_id, opts)
|
data, status_code, headers = get_pet_by_id_with_http_info(pet_id, opts)
|
||||||
return data
|
return data
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -254,7 +254,7 @@ module Petstore
|
|||||||
# Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
# Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
# @param pet_id ID of pet that needs to be fetched
|
# @param pet_id ID of pet that needs to be fetched
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @return [Array<Fixnum, Hash, Pet>] response status code, response headers and Pet data
|
# @return [Array<(Pet, Fixnum, Hash)>] Pet data, response status code and response headers
|
||||||
def get_pet_by_id_with_http_info(pet_id, opts = {})
|
def get_pet_by_id_with_http_info(pet_id, opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: PetApi#get_pet_by_id ..."
|
Configuration.logger.debug "Calling API: PetApi#get_pet_by_id ..."
|
||||||
@ -288,7 +288,7 @@ module Petstore
|
|||||||
|
|
||||||
|
|
||||||
auth_names = ['api_key']
|
auth_names = ['api_key']
|
||||||
status_code, headers, data = @api_client.call_api(:GET, path,
|
data, status_code, headers = @api_client.call_api(:GET, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
@ -296,9 +296,9 @@ module Petstore
|
|||||||
:auth_names => auth_names,
|
:auth_names => auth_names,
|
||||||
:return_type => 'Pet')
|
:return_type => 'Pet')
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: PetApi#get_pet_by_id\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: PetApi#get_pet_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Updates a pet in the store with form data
|
# Updates a pet in the store with form data
|
||||||
@ -319,7 +319,7 @@ module Petstore
|
|||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @option opts [String] :name Updated name of the pet
|
# @option opts [String] :name Updated name of the pet
|
||||||
# @option opts [String] :status Updated status of the pet
|
# @option opts [String] :status Updated status of the pet
|
||||||
# @return [Array<Fixnum, Hash, nil>] response status code, response headers and nil
|
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
||||||
def update_pet_with_form_with_http_info(pet_id, opts = {})
|
def update_pet_with_form_with_http_info(pet_id, opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: PetApi#update_pet_with_form ..."
|
Configuration.logger.debug "Calling API: PetApi#update_pet_with_form ..."
|
||||||
@ -355,16 +355,16 @@ module Petstore
|
|||||||
|
|
||||||
|
|
||||||
auth_names = ['petstore_auth']
|
auth_names = ['petstore_auth']
|
||||||
status_code, headers, data = @api_client.call_api(:POST, path,
|
data, status_code, headers = @api_client.call_api(:POST, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
:body => post_body,
|
:body => post_body,
|
||||||
:auth_names => auth_names)
|
:auth_names => auth_names)
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: PetApi#update_pet_with_form\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: PetApi#update_pet_with_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Deletes a pet
|
# Deletes a pet
|
||||||
@ -383,7 +383,7 @@ module Petstore
|
|||||||
# @param pet_id Pet id to delete
|
# @param pet_id Pet id to delete
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @option opts [String] :api_key
|
# @option opts [String] :api_key
|
||||||
# @return [Array<Fixnum, Hash, nil>] response status code, response headers and nil
|
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
||||||
def delete_pet_with_http_info(pet_id, opts = {})
|
def delete_pet_with_http_info(pet_id, opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: PetApi#delete_pet ..."
|
Configuration.logger.debug "Calling API: PetApi#delete_pet ..."
|
||||||
@ -418,16 +418,16 @@ module Petstore
|
|||||||
|
|
||||||
|
|
||||||
auth_names = ['petstore_auth']
|
auth_names = ['petstore_auth']
|
||||||
status_code, headers, data = @api_client.call_api(:DELETE, path,
|
data, status_code, headers = @api_client.call_api(:DELETE, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
:body => post_body,
|
:body => post_body,
|
||||||
:auth_names => auth_names)
|
:auth_names => auth_names)
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: PetApi#delete_pet\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: PetApi#delete_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
|
|
||||||
# uploads an image
|
# uploads an image
|
||||||
@ -448,7 +448,7 @@ module Petstore
|
|||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @option opts [String] :additional_metadata Additional data to pass to server
|
# @option opts [String] :additional_metadata Additional data to pass to server
|
||||||
# @option opts [File] :file file to upload
|
# @option opts [File] :file file to upload
|
||||||
# @return [Array<Fixnum, Hash, nil>] response status code, response headers and nil
|
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
||||||
def upload_file_with_http_info(pet_id, opts = {})
|
def upload_file_with_http_info(pet_id, opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: PetApi#upload_file ..."
|
Configuration.logger.debug "Calling API: PetApi#upload_file ..."
|
||||||
@ -484,16 +484,16 @@ module Petstore
|
|||||||
|
|
||||||
|
|
||||||
auth_names = ['petstore_auth']
|
auth_names = ['petstore_auth']
|
||||||
status_code, headers, data = @api_client.call_api(:POST, path,
|
data, status_code, headers = @api_client.call_api(:POST, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
:body => post_body,
|
:body => post_body,
|
||||||
:auth_names => auth_names)
|
:auth_names => auth_names)
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: PetApi#upload_file\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: PetApi#upload_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -13,14 +13,14 @@ module Petstore
|
|||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @return [Hash<String, Integer>]
|
# @return [Hash<String, Integer>]
|
||||||
def get_inventory(opts = {})
|
def get_inventory(opts = {})
|
||||||
status_code, headers, data = get_inventory_with_http_info(opts)
|
data, status_code, headers = get_inventory_with_http_info(opts)
|
||||||
return data
|
return data
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns pet inventories by status
|
# Returns pet inventories by status
|
||||||
# Returns a map of status codes to quantities
|
# Returns a map of status codes to quantities
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @return [Array<Fixnum, Hash, Hash<String, Integer>>] response status code, response headers and Hash<String, Integer> data
|
# @return [Array<(Hash<String, Integer>, Fixnum, Hash)>] Hash<String, Integer> data, response status code and response headers
|
||||||
def get_inventory_with_http_info(opts = {})
|
def get_inventory_with_http_info(opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: StoreApi#get_inventory ..."
|
Configuration.logger.debug "Calling API: StoreApi#get_inventory ..."
|
||||||
@ -51,7 +51,7 @@ module Petstore
|
|||||||
|
|
||||||
|
|
||||||
auth_names = ['api_key']
|
auth_names = ['api_key']
|
||||||
status_code, headers, data = @api_client.call_api(:GET, path,
|
data, status_code, headers = @api_client.call_api(:GET, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
@ -59,9 +59,9 @@ module Petstore
|
|||||||
:auth_names => auth_names,
|
:auth_names => auth_names,
|
||||||
:return_type => 'Hash<String, Integer>')
|
:return_type => 'Hash<String, Integer>')
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: StoreApi#get_inventory\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: StoreApi#get_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Place an order for a pet
|
# Place an order for a pet
|
||||||
@ -70,7 +70,7 @@ module Petstore
|
|||||||
# @option opts [Order] :body order placed for purchasing the pet
|
# @option opts [Order] :body order placed for purchasing the pet
|
||||||
# @return [Order]
|
# @return [Order]
|
||||||
def place_order(opts = {})
|
def place_order(opts = {})
|
||||||
status_code, headers, data = place_order_with_http_info(opts)
|
data, status_code, headers = place_order_with_http_info(opts)
|
||||||
return data
|
return data
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ module Petstore
|
|||||||
#
|
#
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @option opts [Order] :body order placed for purchasing the pet
|
# @option opts [Order] :body order placed for purchasing the pet
|
||||||
# @return [Array<Fixnum, Hash, Order>] response status code, response headers and Order data
|
# @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers
|
||||||
def place_order_with_http_info(opts = {})
|
def place_order_with_http_info(opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: StoreApi#place_order ..."
|
Configuration.logger.debug "Calling API: StoreApi#place_order ..."
|
||||||
@ -109,7 +109,7 @@ module Petstore
|
|||||||
|
|
||||||
|
|
||||||
auth_names = []
|
auth_names = []
|
||||||
status_code, headers, data = @api_client.call_api(:POST, path,
|
data, status_code, headers = @api_client.call_api(:POST, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
@ -117,9 +117,9 @@ module Petstore
|
|||||||
:auth_names => auth_names,
|
:auth_names => auth_names,
|
||||||
:return_type => 'Order')
|
:return_type => 'Order')
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: StoreApi#place_order\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: StoreApi#place_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Find purchase order by ID
|
# Find purchase order by ID
|
||||||
@ -128,7 +128,7 @@ module Petstore
|
|||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @return [Order]
|
# @return [Order]
|
||||||
def get_order_by_id(order_id, opts = {})
|
def get_order_by_id(order_id, opts = {})
|
||||||
status_code, headers, data = get_order_by_id_with_http_info(order_id, opts)
|
data, status_code, headers = get_order_by_id_with_http_info(order_id, opts)
|
||||||
return data
|
return data
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -136,7 +136,7 @@ module Petstore
|
|||||||
# For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
# For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
# @param order_id ID of pet that needs to be fetched
|
# @param order_id ID of pet that needs to be fetched
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @return [Array<Fixnum, Hash, Order>] response status code, response headers and Order data
|
# @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers
|
||||||
def get_order_by_id_with_http_info(order_id, opts = {})
|
def get_order_by_id_with_http_info(order_id, opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: StoreApi#get_order_by_id ..."
|
Configuration.logger.debug "Calling API: StoreApi#get_order_by_id ..."
|
||||||
@ -170,7 +170,7 @@ module Petstore
|
|||||||
|
|
||||||
|
|
||||||
auth_names = []
|
auth_names = []
|
||||||
status_code, headers, data = @api_client.call_api(:GET, path,
|
data, status_code, headers = @api_client.call_api(:GET, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
@ -178,9 +178,9 @@ module Petstore
|
|||||||
:auth_names => auth_names,
|
:auth_names => auth_names,
|
||||||
:return_type => 'Order')
|
:return_type => 'Order')
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: StoreApi#get_order_by_id\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: StoreApi#get_order_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Delete purchase order by ID
|
# Delete purchase order by ID
|
||||||
@ -197,7 +197,7 @@ module Petstore
|
|||||||
# For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
# For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
# @param order_id ID of the order that needs to be deleted
|
# @param order_id ID of the order that needs to be deleted
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @return [Array<Fixnum, Hash, nil>] response status code, response headers and nil
|
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
||||||
def delete_order_with_http_info(order_id, opts = {})
|
def delete_order_with_http_info(order_id, opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: StoreApi#delete_order ..."
|
Configuration.logger.debug "Calling API: StoreApi#delete_order ..."
|
||||||
@ -231,16 +231,16 @@ module Petstore
|
|||||||
|
|
||||||
|
|
||||||
auth_names = []
|
auth_names = []
|
||||||
status_code, headers, data = @api_client.call_api(:DELETE, path,
|
data, status_code, headers = @api_client.call_api(:DELETE, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
:body => post_body,
|
:body => post_body,
|
||||||
:auth_names => auth_names)
|
:auth_names => auth_names)
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: StoreApi#delete_order\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: StoreApi#delete_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -22,7 +22,7 @@ module Petstore
|
|||||||
# This can only be done by the logged in user.
|
# This can only be done by the logged in user.
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @option opts [User] :body Created user object
|
# @option opts [User] :body Created user object
|
||||||
# @return [Array<Fixnum, Hash, nil>] response status code, response headers and nil
|
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
||||||
def create_user_with_http_info(opts = {})
|
def create_user_with_http_info(opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: UserApi#create_user ..."
|
Configuration.logger.debug "Calling API: UserApi#create_user ..."
|
||||||
@ -53,16 +53,16 @@ module Petstore
|
|||||||
|
|
||||||
|
|
||||||
auth_names = []
|
auth_names = []
|
||||||
status_code, headers, data = @api_client.call_api(:POST, path,
|
data, status_code, headers = @api_client.call_api(:POST, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
:body => post_body,
|
:body => post_body,
|
||||||
:auth_names => auth_names)
|
:auth_names => auth_names)
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: UserApi#create_user\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: UserApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Creates list of users with given input array
|
# Creates list of users with given input array
|
||||||
@ -79,7 +79,7 @@ module Petstore
|
|||||||
#
|
#
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @option opts [Array<User>] :body List of user object
|
# @option opts [Array<User>] :body List of user object
|
||||||
# @return [Array<Fixnum, Hash, nil>] response status code, response headers and nil
|
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
||||||
def create_users_with_array_input_with_http_info(opts = {})
|
def create_users_with_array_input_with_http_info(opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: UserApi#create_users_with_array_input ..."
|
Configuration.logger.debug "Calling API: UserApi#create_users_with_array_input ..."
|
||||||
@ -110,16 +110,16 @@ module Petstore
|
|||||||
|
|
||||||
|
|
||||||
auth_names = []
|
auth_names = []
|
||||||
status_code, headers, data = @api_client.call_api(:POST, path,
|
data, status_code, headers = @api_client.call_api(:POST, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
:body => post_body,
|
:body => post_body,
|
||||||
:auth_names => auth_names)
|
:auth_names => auth_names)
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: UserApi#create_users_with_array_input\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: UserApi#create_users_with_array_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Creates list of users with given input array
|
# Creates list of users with given input array
|
||||||
@ -136,7 +136,7 @@ module Petstore
|
|||||||
#
|
#
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @option opts [Array<User>] :body List of user object
|
# @option opts [Array<User>] :body List of user object
|
||||||
# @return [Array<Fixnum, Hash, nil>] response status code, response headers and nil
|
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
||||||
def create_users_with_list_input_with_http_info(opts = {})
|
def create_users_with_list_input_with_http_info(opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: UserApi#create_users_with_list_input ..."
|
Configuration.logger.debug "Calling API: UserApi#create_users_with_list_input ..."
|
||||||
@ -167,16 +167,16 @@ module Petstore
|
|||||||
|
|
||||||
|
|
||||||
auth_names = []
|
auth_names = []
|
||||||
status_code, headers, data = @api_client.call_api(:POST, path,
|
data, status_code, headers = @api_client.call_api(:POST, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
:body => post_body,
|
:body => post_body,
|
||||||
:auth_names => auth_names)
|
:auth_names => auth_names)
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: UserApi#create_users_with_list_input\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: UserApi#create_users_with_list_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Logs user into the system
|
# Logs user into the system
|
||||||
@ -186,7 +186,7 @@ module Petstore
|
|||||||
# @option opts [String] :password The password for login in clear text
|
# @option opts [String] :password The password for login in clear text
|
||||||
# @return [String]
|
# @return [String]
|
||||||
def login_user(opts = {})
|
def login_user(opts = {})
|
||||||
status_code, headers, data = login_user_with_http_info(opts)
|
data, status_code, headers = login_user_with_http_info(opts)
|
||||||
return data
|
return data
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ module Petstore
|
|||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @option opts [String] :username The user name for login
|
# @option opts [String] :username The user name for login
|
||||||
# @option opts [String] :password The password for login in clear text
|
# @option opts [String] :password The password for login in clear text
|
||||||
# @return [Array<Fixnum, Hash, String>] response status code, response headers and String data
|
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
||||||
def login_user_with_http_info(opts = {})
|
def login_user_with_http_info(opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: UserApi#login_user ..."
|
Configuration.logger.debug "Calling API: UserApi#login_user ..."
|
||||||
@ -228,7 +228,7 @@ module Petstore
|
|||||||
|
|
||||||
|
|
||||||
auth_names = []
|
auth_names = []
|
||||||
status_code, headers, data = @api_client.call_api(:GET, path,
|
data, status_code, headers = @api_client.call_api(:GET, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
@ -236,9 +236,9 @@ module Petstore
|
|||||||
:auth_names => auth_names,
|
:auth_names => auth_names,
|
||||||
:return_type => 'String')
|
:return_type => 'String')
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: UserApi#login_user\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: UserApi#login_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Logs out current logged in user session
|
# Logs out current logged in user session
|
||||||
@ -253,7 +253,7 @@ module Petstore
|
|||||||
# Logs out current logged in user session
|
# Logs out current logged in user session
|
||||||
#
|
#
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @return [Array<Fixnum, Hash, nil>] response status code, response headers and nil
|
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
||||||
def logout_user_with_http_info(opts = {})
|
def logout_user_with_http_info(opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: UserApi#logout_user ..."
|
Configuration.logger.debug "Calling API: UserApi#logout_user ..."
|
||||||
@ -284,16 +284,16 @@ module Petstore
|
|||||||
|
|
||||||
|
|
||||||
auth_names = []
|
auth_names = []
|
||||||
status_code, headers, data = @api_client.call_api(:GET, path,
|
data, status_code, headers = @api_client.call_api(:GET, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
:body => post_body,
|
:body => post_body,
|
||||||
:auth_names => auth_names)
|
:auth_names => auth_names)
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: UserApi#logout_user\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: UserApi#logout_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Get user by user name
|
# Get user by user name
|
||||||
@ -302,7 +302,7 @@ module Petstore
|
|||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @return [User]
|
# @return [User]
|
||||||
def get_user_by_name(username, opts = {})
|
def get_user_by_name(username, opts = {})
|
||||||
status_code, headers, data = get_user_by_name_with_http_info(username, opts)
|
data, status_code, headers = get_user_by_name_with_http_info(username, opts)
|
||||||
return data
|
return data
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -310,7 +310,7 @@ module Petstore
|
|||||||
#
|
#
|
||||||
# @param username The name that needs to be fetched. Use user1 for testing.
|
# @param username The name that needs to be fetched. Use user1 for testing.
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @return [Array<Fixnum, Hash, User>] response status code, response headers and User data
|
# @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers
|
||||||
def get_user_by_name_with_http_info(username, opts = {})
|
def get_user_by_name_with_http_info(username, opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: UserApi#get_user_by_name ..."
|
Configuration.logger.debug "Calling API: UserApi#get_user_by_name ..."
|
||||||
@ -344,7 +344,7 @@ module Petstore
|
|||||||
|
|
||||||
|
|
||||||
auth_names = []
|
auth_names = []
|
||||||
status_code, headers, data = @api_client.call_api(:GET, path,
|
data, status_code, headers = @api_client.call_api(:GET, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
@ -352,9 +352,9 @@ module Petstore
|
|||||||
:auth_names => auth_names,
|
:auth_names => auth_names,
|
||||||
:return_type => 'User')
|
:return_type => 'User')
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: UserApi#get_user_by_name\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: UserApi#get_user_by_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Updated user
|
# Updated user
|
||||||
@ -373,7 +373,7 @@ module Petstore
|
|||||||
# @param username name that need to be deleted
|
# @param username name that need to be deleted
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @option opts [User] :body Updated user object
|
# @option opts [User] :body Updated user object
|
||||||
# @return [Array<Fixnum, Hash, nil>] response status code, response headers and nil
|
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
||||||
def update_user_with_http_info(username, opts = {})
|
def update_user_with_http_info(username, opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: UserApi#update_user ..."
|
Configuration.logger.debug "Calling API: UserApi#update_user ..."
|
||||||
@ -407,16 +407,16 @@ module Petstore
|
|||||||
|
|
||||||
|
|
||||||
auth_names = []
|
auth_names = []
|
||||||
status_code, headers, data = @api_client.call_api(:PUT, path,
|
data, status_code, headers = @api_client.call_api(:PUT, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
:body => post_body,
|
:body => post_body,
|
||||||
:auth_names => auth_names)
|
:auth_names => auth_names)
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: UserApi#update_user\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: UserApi#update_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Delete user
|
# Delete user
|
||||||
@ -433,7 +433,7 @@ module Petstore
|
|||||||
# This can only be done by the logged in user.
|
# This can only be done by the logged in user.
|
||||||
# @param username The name that needs to be deleted
|
# @param username The name that needs to be deleted
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @return [Array<Fixnum, Hash, nil>] response status code, response headers and nil
|
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
||||||
def delete_user_with_http_info(username, opts = {})
|
def delete_user_with_http_info(username, opts = {})
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "Calling API: UserApi#delete_user ..."
|
Configuration.logger.debug "Calling API: UserApi#delete_user ..."
|
||||||
@ -467,16 +467,16 @@ module Petstore
|
|||||||
|
|
||||||
|
|
||||||
auth_names = []
|
auth_names = []
|
||||||
status_code, headers, data = @api_client.call_api(:DELETE, path,
|
data, status_code, headers = @api_client.call_api(:DELETE, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
:form_params => form_params,
|
:form_params => form_params,
|
||||||
:body => post_body,
|
:body => post_body,
|
||||||
:auth_names => auth_names)
|
:auth_names => auth_names)
|
||||||
if Configuration.debugging
|
if Configuration.debugging
|
||||||
Configuration.logger.debug "API called: UserApi#delete_user\nStatus code: #{status_code}\nHeaders: #{headers}\nData: #{data.inspect}"
|
Configuration.logger.debug "API called: UserApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
end
|
end
|
||||||
return status_code, headers, data
|
return data, status_code, headers
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -25,8 +25,10 @@ module Petstore
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
# Call an API with given options and an array of 3 elements:
|
# Call an API with given options.
|
||||||
# response status code, response headers and the data deserialized from response body (could be nil).
|
#
|
||||||
|
# @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements:
|
||||||
|
# the data deserialized from response body (could be nil), response status code and response headers.
|
||||||
def call_api(http_method, path, opts = {})
|
def call_api(http_method, path, opts = {})
|
||||||
request = build_request(http_method, path, opts)
|
request = build_request(http_method, path, opts)
|
||||||
response = request.run
|
response = request.run
|
||||||
@ -47,7 +49,7 @@ module Petstore
|
|||||||
else
|
else
|
||||||
data = nil
|
data = nil
|
||||||
end
|
end
|
||||||
return response.code, response.headers, data
|
return data, response.code, response.headers
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_request(http_method, path, opts = {})
|
def build_request(http_method, path, opts = {})
|
||||||
|
@ -51,7 +51,7 @@ describe "Pet" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "should fetch a pet object with http info" do
|
it "should fetch a pet object with http info" do
|
||||||
status_code, headers, pet = @pet_api.get_pet_by_id_with_http_info(10002)
|
pet, status_code, headers = @pet_api.get_pet_by_id_with_http_info(10002)
|
||||||
status_code.should == 200
|
status_code.should == 200
|
||||||
headers['Content-Type'].should == 'application/json'
|
headers['Content-Type'].should == 'application/json'
|
||||||
pet.should be_a(Petstore::Pet)
|
pet.should be_a(Petstore::Pet)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user