Update comments of python client

This commit is contained in:
geekerzp 2015-07-18 15:35:12 +08:00
parent ddfa713f55
commit 195c71da37
4 changed files with 84 additions and 147 deletions

View File

@ -50,18 +50,15 @@ class {{classname}}(object):
{{{summary}}} {{{summary}}}
{{{notes}}} {{{notes}}}
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.{{nickname}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}callback=callback_function) >>> thread = api.{{nickname}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
{{#allParams}} {{#allParams}}

View File

@ -48,18 +48,15 @@ class PetApi(object):
Update an existing pet Update an existing pet
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.update_pet(callback=callback_function) >>> thread = api.update_pet(callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
:param Pet body: Pet object that needs to be added to the store :param Pet body: Pet object that needs to be added to the store
@ -127,18 +124,15 @@ class PetApi(object):
Add a new pet to the store Add a new pet to the store
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.add_pet(callback=callback_function) >>> thread = api.add_pet(callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
:param Pet body: Pet object that needs to be added to the store :param Pet body: Pet object that needs to be added to the store
@ -206,18 +200,15 @@ class PetApi(object):
Finds Pets by status Finds Pets by status
Multiple status values can be provided with comma seperated strings Multiple status values can be provided with comma seperated strings
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.find_pets_by_status(callback=callback_function) >>> thread = api.find_pets_by_status(callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
:param list[str] status: Status values that need to be considered for filter :param list[str] status: Status values that need to be considered for filter
@ -285,18 +276,15 @@ class PetApi(object):
Finds Pets by tags Finds Pets by tags
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.
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.find_pets_by_tags(callback=callback_function) >>> thread = api.find_pets_by_tags(callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
:param list[str] tags: Tags to filter by :param list[str] tags: Tags to filter by
@ -364,18 +352,15 @@ class PetApi(object):
Find pet by ID Find pet by ID
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
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.get_pet_by_id(pet_id, callback=callback_function) >>> thread = api.get_pet_by_id(pet_id, callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
:param int pet_id: ID of pet that needs to be fetched (required) :param int pet_id: ID of pet that needs to be fetched (required)
@ -446,18 +431,15 @@ class PetApi(object):
Updates a pet in the store with form data Updates a pet in the store with form data
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.update_pet_with_form(pet_id, callback=callback_function) >>> thread = api.update_pet_with_form(pet_id, callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
:param str pet_id: ID of pet that needs to be updated (required) :param str pet_id: ID of pet that needs to be updated (required)
@ -534,18 +516,15 @@ class PetApi(object):
Deletes a pet Deletes a pet
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.delete_pet(pet_id, callback=callback_function) >>> thread = api.delete_pet(pet_id, callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
:param int pet_id: Pet id to delete (required) :param int pet_id: Pet id to delete (required)
@ -619,18 +598,15 @@ class PetApi(object):
uploads an image uploads an image
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.upload_file(pet_id, callback=callback_function) >>> thread = api.upload_file(pet_id, callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
:param int pet_id: ID of pet to update (required) :param int pet_id: ID of pet to update (required)

View File

@ -48,18 +48,15 @@ class StoreApi(object):
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
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.get_inventory(callback=callback_function) >>> thread = api.get_inventory(callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
:return: dict(str, int) :return: dict(str, int)
@ -124,18 +121,15 @@ class StoreApi(object):
Place an order for a pet Place an order for a pet
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.place_order(callback=callback_function) >>> thread = api.place_order(callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
:param Order body: order placed for purchasing the pet :param Order body: order placed for purchasing the pet
@ -203,18 +197,15 @@ class StoreApi(object):
Find purchase order by ID Find purchase order by ID
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
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.get_order_by_id(order_id, callback=callback_function) >>> thread = api.get_order_by_id(order_id, callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
:param str order_id: ID of pet that needs to be fetched (required) :param str order_id: ID of pet that needs to be fetched (required)
@ -285,18 +276,15 @@ class StoreApi(object):
Delete purchase order by ID Delete purchase order by ID
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
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.delete_order(order_id, callback=callback_function) >>> thread = api.delete_order(order_id, callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
:param str order_id: ID of the order that needs to be deleted (required) :param str order_id: ID of the order that needs to be deleted (required)

View File

@ -48,18 +48,15 @@ class UserApi(object):
Create user Create user
This can only be done by the logged in user. This can only be done by the logged in user.
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.create_user(callback=callback_function) >>> thread = api.create_user(callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
:param User body: Created user object :param User body: Created user object
@ -127,18 +124,15 @@ class UserApi(object):
Creates list of users with given input array Creates list of users with given input array
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.create_users_with_array_input(callback=callback_function) >>> thread = api.create_users_with_array_input(callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
:param list[User] body: List of user object :param list[User] body: List of user object
@ -206,18 +200,15 @@ class UserApi(object):
Creates list of users with given input array Creates list of users with given input array
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.create_users_with_list_input(callback=callback_function) >>> thread = api.create_users_with_list_input(callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
:param list[User] body: List of user object :param list[User] body: List of user object
@ -285,18 +276,15 @@ class UserApi(object):
Logs user into the system Logs user into the system
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.login_user(callback=callback_function) >>> thread = api.login_user(callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
:param str username: The user name for login :param str username: The user name for login
@ -367,18 +355,15 @@ class UserApi(object):
Logs out current logged in user session Logs out current logged in user session
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.logout_user(callback=callback_function) >>> thread = api.logout_user(callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
:return: None :return: None
@ -443,18 +428,15 @@ class UserApi(object):
Get user by user name Get user by user name
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.get_user_by_name(username, callback=callback_function) >>> thread = api.get_user_by_name(username, callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
:param str username: The name that needs to be fetched. Use user1 for testing. (required) :param str username: The name that needs to be fetched. Use user1 for testing. (required)
@ -525,18 +507,15 @@ class UserApi(object):
Updated user Updated user
This can only be done by the logged in user. This can only be done by the logged in user.
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.update_user(username, callback=callback_function) >>> thread = api.update_user(username, callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
:param str username: name that need to be deleted (required) :param str username: name that need to be deleted (required)
@ -610,18 +589,15 @@ class UserApi(object):
Delete user Delete user
This can only be done by the logged in user. This can only be done by the logged in user.
SDK also supports asynchronous requests This method makes a synchronous HTTP request by default.
in which you can define a `callback` function To make an asynchronous HTTP request,
to be passed along and invoked when receiving response: please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response): >>> def callback_function(response):
>>> pprint(response) >>> pprint(response)
>>> >>>
>>> thread = api.delete_user(username, callback=callback_function) >>> thread = api.delete_user(username, callback=callback_function)
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.
:param callback function: The callback function :param callback function: The callback function
for asynchronous request. (optional) for asynchronous request. (optional)
:param str username: The name that needs to be deleted (required) :param str username: The name that needs to be deleted (required)