Merge branch 'new_python_with_http_info' of https://github.com/zhenjun115/swagger-codegen into zhenjun115-new_python_with_http_info

Conflicts:
	modules/swagger-codegen/src/main/resources/python/api.mustache
	samples/client/petstore/python/swagger_client/__init__.py
	samples/client/petstore/python/swagger_client/api_client.py
	samples/client/petstore/python/swagger_client/apis/pet_api.py
	samples/client/petstore/python/swagger_client/apis/store_api.py
	samples/client/petstore/python/swagger_client/apis/user_api.py
	samples/client/petstore/python/swagger_client/models/__init__.py
	samples/client/petstore/python/swagger_client/models/name.py
This commit is contained in:
wing328
2016-06-20 11:58:35 +08:00
12 changed files with 1175 additions and 79 deletions

View File

@@ -103,7 +103,7 @@ class ApiClient(object):
def __call_api(self, resource_path, method,
path_params=None, query_params=None, header_params=None,
body=None, post_params=None, files=None,
response_type=None, auth_settings=None, callback=None):
response_type=None, auth_settings=None, callback=None, _return_http_data_only=None):
# headers parameters
header_params = header_params or {}
@@ -157,9 +157,12 @@ class ApiClient(object):
deserialized_data = None
if callback:
callback(deserialized_data)
callback(deserialized_data) if _return_http_data_only else callback((deserialized_data, response_data.status, response_data.getheaders()))
elif _return_http_data_only:
return ( deserialized_data );
else:
return deserialized_data
return (deserialized_data, response_data.status, response_data.getheaders())
def to_path_value(self, obj):
"""
@@ -287,7 +290,7 @@ class ApiClient(object):
def call_api(self, resource_path, method,
path_params=None, query_params=None, header_params=None,
body=None, post_params=None, files=None,
response_type=None, auth_settings=None, callback=None):
response_type=None, auth_settings=None, callback=None, _return_http_data_only=None):
"""
Makes the HTTP request (synchronous) and return the deserialized data.
To make an async request, define a function for callback.
@@ -308,6 +311,7 @@ class ApiClient(object):
:param callback function: Callback function for asynchronous request.
If provide this parameter,
the request will be called asynchronously.
:param _return_http_data_only: response data without head status code and headers
:return:
If provide parameter callback,
the request will be called asynchronously.
@@ -319,7 +323,7 @@ class ApiClient(object):
return self.__call_api(resource_path, method,
path_params, query_params, header_params,
body, post_params, files,
response_type, auth_settings, callback)
response_type, auth_settings, callback, _return_http_data_only)
else:
thread = threading.Thread(target=self.__call_api,
args=(resource_path, method,
@@ -327,7 +331,7 @@ class ApiClient(object):
header_params, body,
post_params, files,
response_type, auth_settings,
callback))
callback,_return_http_data_only))
thread.start()
return thread

View File

@@ -64,6 +64,44 @@ class FakeApi(object):
>>>
>>> thread = api.test_endpoint_parameters(number, double, string, byte, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param float number: None (required)
:param float double: None (required)
:param str string: None (required)
:param str byte: None (required)
:param int integer: None
:param int int32: None
:param int int64: None
:param float float: None
:param str binary: None
:param date date: None
:param datetime date_time: None
:param str password: None
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.test_endpoint_parameters_with_http_info(number, double, string, byte, **kwargs)
else:
(data) = self.test_endpoint_parameters_with_http_info(number, double, string, byte, **kwargs)
return data
def test_endpoint_parameters_with_http_info(self, number, double, string, byte, **kwargs):
"""
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.test_endpoint_parameters_with_http_info(number, double, string, byte, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param float number: None (required)
@@ -85,6 +123,7 @@ class FakeApi(object):
all_params = ['number', 'double', 'string', 'byte', 'integer', 'int32', 'int64', 'float', 'binary', 'date', 'date_time', 'password']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -181,7 +220,7 @@ class FakeApi(object):
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, 'POST',
return self.api_client.call_api(resource_path, 'POST',
path_params,
query_params,
header_params,
@@ -190,5 +229,5 @@ class FakeApi(object):
files=local_var_files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))

View File

@@ -64,6 +64,33 @@ class PetApi(object):
>>>
>>> thread = api.add_pet(body, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param Pet body: Pet object that needs to be added to the store (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.add_pet_with_http_info(body, **kwargs)
else:
(data) = self.add_pet_with_http_info(body, **kwargs)
return data
def add_pet_with_http_info(self, body, **kwargs):
"""
Add a new pet to the store
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.add_pet_with_http_info(body, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param Pet body: Pet object that needs to be added to the store (required)
@@ -74,6 +101,7 @@ class PetApi(object):
all_params = ['body']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -115,7 +143,7 @@ class PetApi(object):
# Authentication setting
auth_settings = ['petstore_auth']
response = self.api_client.call_api(resource_path, 'POST',
return self.api_client.call_api(resource_path, 'POST',
path_params,
query_params,
header_params,
@@ -124,8 +152,8 @@ class PetApi(object):
files=local_var_files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))
def delete_pet(self, pet_id, **kwargs):
"""
@@ -140,6 +168,34 @@ class PetApi(object):
>>>
>>> thread = api.delete_pet(pet_id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param int pet_id: Pet id to delete (required)
:param str api_key:
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.delete_pet_with_http_info(pet_id, **kwargs)
else:
(data) = self.delete_pet_with_http_info(pet_id, **kwargs)
return data
def delete_pet_with_http_info(self, pet_id, **kwargs):
"""
Deletes a pet
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.delete_pet_with_http_info(pet_id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param int pet_id: Pet id to delete (required)
@@ -151,6 +207,7 @@ class PetApi(object):
all_params = ['pet_id', 'api_key']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -194,7 +251,7 @@ class PetApi(object):
# Authentication setting
auth_settings = ['petstore_auth']
response = self.api_client.call_api(resource_path, 'DELETE',
return self.api_client.call_api(resource_path, 'DELETE',
path_params,
query_params,
header_params,
@@ -203,8 +260,8 @@ class PetApi(object):
files=local_var_files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))
def find_pets_by_status(self, status, **kwargs):
"""
@@ -219,6 +276,33 @@ class PetApi(object):
>>>
>>> thread = api.find_pets_by_status(status, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param list[str] status: Status values that need to be considered for filter (required)
:return: list[Pet]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.find_pets_by_status_with_http_info(status, **kwargs)
else:
(data) = self.find_pets_by_status_with_http_info(status, **kwargs)
return data
def find_pets_by_status_with_http_info(self, status, **kwargs):
"""
Finds Pets by status
Multiple status values can be provided with comma separated strings
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.find_pets_by_status_with_http_info(status, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param list[str] status: Status values that need to be considered for filter (required)
@@ -229,6 +313,7 @@ class PetApi(object):
all_params = ['status']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -270,7 +355,7 @@ class PetApi(object):
# Authentication setting
auth_settings = ['petstore_auth']
response = self.api_client.call_api(resource_path, 'GET',
return self.api_client.call_api(resource_path, 'GET',
path_params,
query_params,
header_params,
@@ -279,8 +364,8 @@ class PetApi(object):
files=local_var_files,
response_type='list[Pet]',
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))
def find_pets_by_tags(self, tags, **kwargs):
"""
@@ -295,6 +380,33 @@ class PetApi(object):
>>>
>>> thread = api.find_pets_by_tags(tags, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param list[str] tags: Tags to filter by (required)
:return: list[Pet]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.find_pets_by_tags_with_http_info(tags, **kwargs)
else:
(data) = self.find_pets_by_tags_with_http_info(tags, **kwargs)
return data
def find_pets_by_tags_with_http_info(self, tags, **kwargs):
"""
Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.find_pets_by_tags_with_http_info(tags, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param list[str] tags: Tags to filter by (required)
@@ -305,6 +417,7 @@ class PetApi(object):
all_params = ['tags']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -346,7 +459,7 @@ class PetApi(object):
# Authentication setting
auth_settings = ['petstore_auth']
response = self.api_client.call_api(resource_path, 'GET',
return self.api_client.call_api(resource_path, 'GET',
path_params,
query_params,
header_params,
@@ -355,8 +468,8 @@ class PetApi(object):
files=local_var_files,
response_type='list[Pet]',
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))
def get_pet_by_id(self, pet_id, **kwargs):
"""
@@ -371,6 +484,33 @@ class PetApi(object):
>>>
>>> thread = api.get_pet_by_id(pet_id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param int pet_id: ID of pet to return (required)
:return: Pet
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.get_pet_by_id_with_http_info(pet_id, **kwargs)
else:
(data) = self.get_pet_by_id_with_http_info(pet_id, **kwargs)
return data
def get_pet_by_id_with_http_info(self, pet_id, **kwargs):
"""
Find pet by ID
Returns a single pet
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.get_pet_by_id_with_http_info(pet_id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param int pet_id: ID of pet to return (required)
@@ -381,6 +521,7 @@ class PetApi(object):
all_params = ['pet_id']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -422,7 +563,7 @@ class PetApi(object):
# Authentication setting
auth_settings = ['api_key']
response = self.api_client.call_api(resource_path, 'GET',
return self.api_client.call_api(resource_path, 'GET',
path_params,
query_params,
header_params,
@@ -431,8 +572,8 @@ class PetApi(object):
files=local_var_files,
response_type='Pet',
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))
def update_pet(self, body, **kwargs):
"""
@@ -447,6 +588,33 @@ class PetApi(object):
>>>
>>> thread = api.update_pet(body, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param Pet body: Pet object that needs to be added to the store (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.update_pet_with_http_info(body, **kwargs)
else:
(data) = self.update_pet_with_http_info(body, **kwargs)
return data
def update_pet_with_http_info(self, body, **kwargs):
"""
Update an existing pet
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.update_pet_with_http_info(body, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param Pet body: Pet object that needs to be added to the store (required)
@@ -457,6 +625,7 @@ class PetApi(object):
all_params = ['body']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -498,7 +667,7 @@ class PetApi(object):
# Authentication setting
auth_settings = ['petstore_auth']
response = self.api_client.call_api(resource_path, 'PUT',
return self.api_client.call_api(resource_path, 'PUT',
path_params,
query_params,
header_params,
@@ -507,8 +676,8 @@ class PetApi(object):
files=local_var_files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))
def update_pet_with_form(self, pet_id, **kwargs):
"""
@@ -523,6 +692,35 @@ class PetApi(object):
>>>
>>> thread = api.update_pet_with_form(pet_id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param int pet_id: ID of pet that needs to be updated (required)
:param str name: Updated name of the pet
:param str status: Updated status of the pet
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.update_pet_with_form_with_http_info(pet_id, **kwargs)
else:
(data) = self.update_pet_with_form_with_http_info(pet_id, **kwargs)
return data
def update_pet_with_form_with_http_info(self, pet_id, **kwargs):
"""
Updates a pet in the store with form data
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.update_pet_with_form_with_http_info(pet_id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param int pet_id: ID of pet that needs to be updated (required)
@@ -535,6 +733,7 @@ class PetApi(object):
all_params = ['pet_id', 'name', 'status']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -580,7 +779,7 @@ class PetApi(object):
# Authentication setting
auth_settings = ['petstore_auth']
response = self.api_client.call_api(resource_path, 'POST',
return self.api_client.call_api(resource_path, 'POST',
path_params,
query_params,
header_params,
@@ -589,8 +788,8 @@ class PetApi(object):
files=local_var_files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))
def upload_file(self, pet_id, **kwargs):
"""
@@ -605,6 +804,35 @@ class PetApi(object):
>>>
>>> thread = api.upload_file(pet_id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param int pet_id: ID of pet to update (required)
:param str additional_metadata: Additional data to pass to server
:param file file: file to upload
:return: ApiResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.upload_file_with_http_info(pet_id, **kwargs)
else:
(data) = self.upload_file_with_http_info(pet_id, **kwargs)
return data
def upload_file_with_http_info(self, pet_id, **kwargs):
"""
uploads an image
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.upload_file_with_http_info(pet_id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param int pet_id: ID of pet to update (required)
@@ -617,6 +845,7 @@ class PetApi(object):
all_params = ['pet_id', 'additional_metadata', 'file']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -662,7 +891,7 @@ class PetApi(object):
# Authentication setting
auth_settings = ['petstore_auth']
response = self.api_client.call_api(resource_path, 'POST',
return self.api_client.call_api(resource_path, 'POST',
path_params,
query_params,
header_params,
@@ -671,5 +900,5 @@ class PetApi(object):
files=local_var_files,
response_type='ApiResponse',
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))

View File

@@ -64,6 +64,33 @@ class StoreApi(object):
>>>
>>> thread = api.delete_order(order_id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str order_id: ID of the order that needs to be deleted (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.delete_order_with_http_info(order_id, **kwargs)
else:
(data) = self.delete_order_with_http_info(order_id, **kwargs)
return data
def delete_order_with_http_info(self, order_id, **kwargs):
"""
Delete purchase order by ID
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.delete_order_with_http_info(order_id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str order_id: ID of the order that needs to be deleted (required)
@@ -74,6 +101,7 @@ class StoreApi(object):
all_params = ['order_id']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -117,7 +145,7 @@ class StoreApi(object):
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, 'DELETE',
return self.api_client.call_api(resource_path, 'DELETE',
path_params,
query_params,
header_params,
@@ -126,8 +154,8 @@ class StoreApi(object):
files=local_var_files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))
def get_inventory(self, **kwargs):
"""
@@ -142,6 +170,32 @@ class StoreApi(object):
>>>
>>> thread = api.get_inventory(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:return: dict(str, int)
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.get_inventory_with_http_info(**kwargs)
else:
(data) = self.get_inventory_with_http_info(**kwargs)
return data
def get_inventory_with_http_info(self, **kwargs):
"""
Returns pet inventories by status
Returns a map of status codes to quantities
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.get_inventory_with_http_info(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:return: dict(str, int)
@@ -151,6 +205,7 @@ class StoreApi(object):
all_params = []
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -187,7 +242,7 @@ class StoreApi(object):
# Authentication setting
auth_settings = ['api_key']
response = self.api_client.call_api(resource_path, 'GET',
return self.api_client.call_api(resource_path, 'GET',
path_params,
query_params,
header_params,
@@ -196,8 +251,8 @@ class StoreApi(object):
files=local_var_files,
response_type='dict(str, int)',
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))
def get_order_by_id(self, order_id, **kwargs):
"""
@@ -212,6 +267,33 @@ class StoreApi(object):
>>>
>>> thread = api.get_order_by_id(order_id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param int order_id: ID of pet that needs to be fetched (required)
:return: Order
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.get_order_by_id_with_http_info(order_id, **kwargs)
else:
(data) = self.get_order_by_id_with_http_info(order_id, **kwargs)
return data
def get_order_by_id_with_http_info(self, order_id, **kwargs):
"""
Find purchase order by ID
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.get_order_by_id_with_http_info(order_id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param int order_id: ID of pet that needs to be fetched (required)
@@ -222,6 +304,7 @@ class StoreApi(object):
all_params = ['order_id']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -267,7 +350,7 @@ class StoreApi(object):
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, 'GET',
return self.api_client.call_api(resource_path, 'GET',
path_params,
query_params,
header_params,
@@ -276,8 +359,8 @@ class StoreApi(object):
files=local_var_files,
response_type='Order',
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))
def place_order(self, body, **kwargs):
"""
@@ -292,6 +375,33 @@ class StoreApi(object):
>>>
>>> thread = api.place_order(body, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param Order body: order placed for purchasing the pet (required)
:return: Order
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.place_order_with_http_info(body, **kwargs)
else:
(data) = self.place_order_with_http_info(body, **kwargs)
return data
def place_order_with_http_info(self, body, **kwargs):
"""
Place an order for a pet
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.place_order_with_http_info(body, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param Order body: order placed for purchasing the pet (required)
@@ -302,6 +412,7 @@ class StoreApi(object):
all_params = ['body']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -343,7 +454,7 @@ class StoreApi(object):
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, 'POST',
return self.api_client.call_api(resource_path, 'POST',
path_params,
query_params,
header_params,
@@ -352,5 +463,5 @@ class StoreApi(object):
files=local_var_files,
response_type='Order',
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))

View File

@@ -64,6 +64,33 @@ class UserApi(object):
>>>
>>> thread = api.create_user(body, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param User body: Created user object (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.create_user_with_http_info(body, **kwargs)
else:
(data) = self.create_user_with_http_info(body, **kwargs)
return data
def create_user_with_http_info(self, body, **kwargs):
"""
Create user
This can only be done by the logged in user.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.create_user_with_http_info(body, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param User body: Created user object (required)
@@ -74,6 +101,7 @@ class UserApi(object):
all_params = ['body']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -115,7 +143,7 @@ class UserApi(object):
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, 'POST',
return self.api_client.call_api(resource_path, 'POST',
path_params,
query_params,
header_params,
@@ -124,8 +152,8 @@ class UserApi(object):
files=local_var_files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))
def create_users_with_array_input(self, body, **kwargs):
"""
@@ -140,6 +168,33 @@ class UserApi(object):
>>>
>>> thread = api.create_users_with_array_input(body, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param list[User] body: List of user object (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.create_users_with_array_input_with_http_info(body, **kwargs)
else:
(data) = self.create_users_with_array_input_with_http_info(body, **kwargs)
return data
def create_users_with_array_input_with_http_info(self, body, **kwargs):
"""
Creates list of users with given input array
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.create_users_with_array_input_with_http_info(body, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param list[User] body: List of user object (required)
@@ -150,6 +205,7 @@ class UserApi(object):
all_params = ['body']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -191,7 +247,7 @@ class UserApi(object):
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, 'POST',
return self.api_client.call_api(resource_path, 'POST',
path_params,
query_params,
header_params,
@@ -200,8 +256,8 @@ class UserApi(object):
files=local_var_files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))
def create_users_with_list_input(self, body, **kwargs):
"""
@@ -216,6 +272,33 @@ class UserApi(object):
>>>
>>> thread = api.create_users_with_list_input(body, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param list[User] body: List of user object (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.create_users_with_list_input_with_http_info(body, **kwargs)
else:
(data) = self.create_users_with_list_input_with_http_info(body, **kwargs)
return data
def create_users_with_list_input_with_http_info(self, body, **kwargs):
"""
Creates list of users with given input array
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.create_users_with_list_input_with_http_info(body, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param list[User] body: List of user object (required)
@@ -226,6 +309,7 @@ class UserApi(object):
all_params = ['body']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -267,7 +351,7 @@ class UserApi(object):
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, 'POST',
return self.api_client.call_api(resource_path, 'POST',
path_params,
query_params,
header_params,
@@ -276,8 +360,8 @@ class UserApi(object):
files=local_var_files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))
def delete_user(self, username, **kwargs):
"""
@@ -292,6 +376,33 @@ class UserApi(object):
>>>
>>> thread = api.delete_user(username, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str username: The name that needs to be deleted (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.delete_user_with_http_info(username, **kwargs)
else:
(data) = self.delete_user_with_http_info(username, **kwargs)
return data
def delete_user_with_http_info(self, username, **kwargs):
"""
Delete user
This can only be done by the logged in user.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.delete_user_with_http_info(username, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str username: The name that needs to be deleted (required)
@@ -302,6 +413,7 @@ class UserApi(object):
all_params = ['username']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -343,7 +455,7 @@ class UserApi(object):
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, 'DELETE',
return self.api_client.call_api(resource_path, 'DELETE',
path_params,
query_params,
header_params,
@@ -352,8 +464,8 @@ class UserApi(object):
files=local_var_files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))
def get_user_by_name(self, username, **kwargs):
"""
@@ -368,6 +480,33 @@ class UserApi(object):
>>>
>>> thread = api.get_user_by_name(username, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str username: The name that needs to be fetched. Use user1 for testing. (required)
:return: User
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.get_user_by_name_with_http_info(username, **kwargs)
else:
(data) = self.get_user_by_name_with_http_info(username, **kwargs)
return data
def get_user_by_name_with_http_info(self, username, **kwargs):
"""
Get user by user name
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.get_user_by_name_with_http_info(username, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str username: The name that needs to be fetched. Use user1 for testing. (required)
@@ -378,6 +517,7 @@ class UserApi(object):
all_params = ['username']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -419,7 +559,7 @@ class UserApi(object):
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, 'GET',
return self.api_client.call_api(resource_path, 'GET',
path_params,
query_params,
header_params,
@@ -428,8 +568,8 @@ class UserApi(object):
files=local_var_files,
response_type='User',
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))
def login_user(self, username, password, **kwargs):
"""
@@ -444,6 +584,34 @@ class UserApi(object):
>>>
>>> thread = api.login_user(username, password, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str username: The user name for login (required)
:param str password: The password for login in clear text (required)
:return: str
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.login_user_with_http_info(username, password, **kwargs)
else:
(data) = self.login_user_with_http_info(username, password, **kwargs)
return data
def login_user_with_http_info(self, username, password, **kwargs):
"""
Logs user into the system
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.login_user_with_http_info(username, password, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str username: The user name for login (required)
@@ -455,6 +623,7 @@ class UserApi(object):
all_params = ['username', 'password']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -501,7 +670,7 @@ class UserApi(object):
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, 'GET',
return self.api_client.call_api(resource_path, 'GET',
path_params,
query_params,
header_params,
@@ -510,8 +679,8 @@ class UserApi(object):
files=local_var_files,
response_type='str',
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))
def logout_user(self, **kwargs):
"""
@@ -526,6 +695,32 @@ class UserApi(object):
>>>
>>> thread = api.logout_user(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.logout_user_with_http_info(**kwargs)
else:
(data) = self.logout_user_with_http_info(**kwargs)
return data
def logout_user_with_http_info(self, **kwargs):
"""
Logs out current logged in user session
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.logout_user_with_http_info(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:return: None
@@ -535,6 +730,7 @@ class UserApi(object):
all_params = []
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -571,7 +767,7 @@ class UserApi(object):
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, 'GET',
return self.api_client.call_api(resource_path, 'GET',
path_params,
query_params,
header_params,
@@ -580,8 +776,8 @@ class UserApi(object):
files=local_var_files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))
def update_user(self, username, body, **kwargs):
"""
@@ -596,6 +792,34 @@ class UserApi(object):
>>>
>>> thread = api.update_user(username, body, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str username: name that need to be deleted (required)
:param User body: Updated user object (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.update_user_with_http_info(username, body, **kwargs)
else:
(data) = self.update_user_with_http_info(username, body, **kwargs)
return data
def update_user_with_http_info(self, username, body, **kwargs):
"""
Updated user
This can only be done by the logged in user.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.update_user_with_http_info(username, body, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str username: name that need to be deleted (required)
@@ -607,6 +831,7 @@ class UserApi(object):
all_params = ['username', 'body']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
@@ -653,7 +878,7 @@ class UserApi(object):
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, 'PUT',
return self.api_client.call_api(resource_path, 'PUT',
path_params,
query_params,
header_params,
@@ -662,5 +887,5 @@ class UserApi(object):
files=local_var_files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
return response
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'))