add http info support for python

This commit is contained in:
wing328 2015-12-12 15:58:35 +08:00
parent 75ed978cec
commit f44e5faf1b
8 changed files with 1279 additions and 821 deletions

View File

@ -47,7 +47,7 @@ class {{classname}}(object):
self.api_client = config.api_client
{{#operation}}
def {{nickname}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs):
def {{operationId}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs):
"""
{{{summary}}}
{{{notes}}}
@ -59,10 +59,43 @@ class {{classname}}(object):
>>> pprint(response)
>>>
{{#sortParamsByRequiredFlag}}
>>> thread = api.{{nickname}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}callback=callback_function)
>>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}callback=callback_function)
{{/sortParamsByRequiredFlag}}
{{^sortParamsByRequiredFlag}}
>>> thread = api.{{nickname}}({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}callback=callback_function)
>>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}callback=callback_function)
{{/sortParamsByRequiredFlag}}
:param callback function: The callback function
for asynchronous request. (optional)
{{#allParams}}
:param {{dataType}} {{paramName}}: {{{description}}}{{#required}} (required){{/required}}{{#optional}}(optional){{/optional}}
{{/allParams}}
:return: {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}}
If the method is called asynchronously,
returns the request thread.
"""
if kwargs.get('callback'):
return self.{{operationId}}_with_http_info({{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs)
else:
(data, status_code, response_headers) = self.{{operationId}}_with_http_info({{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs)
return data
def {{operationId}}_with_http_info(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs):
"""
{{{summary}}}
{{{notes}}}
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)
>>>
{{#sortParamsByRequiredFlag}}
>>> thread = api.{{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}callback=callback_function)
{{/sortParamsByRequiredFlag}}
{{^sortParamsByRequiredFlag}}
>>> thread = api.{{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}callback=callback_function)
{{/sortParamsByRequiredFlag}}
:param callback function: The callback function
@ -83,7 +116,7 @@ class {{classname}}(object):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method {{nickname}}" % key
" to method {{operationId}}" % key
)
params[key] = val
del params['kwargs']
@ -92,7 +125,7 @@ class {{classname}}(object):
{{#required}}
# verify the required parameter '{{paramName}}' is set
if ('{{paramName}}' not in params) or (params['{{paramName}}'] is None):
raise ValueError("Missing the required parameter `{{paramName}}` when calling `{{nickname}}`")
raise ValueError("Missing the required parameter `{{paramName}}` when calling `{{operationId}}`")
{{/required}}
{{/allParams}}
@ -141,7 +174,7 @@ class {{classname}}(object):
# Authentication setting
auth_settings = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}]
response = self.api_client.call_api(resource_path, '{{httpMethod}}',
return self.api_client.call_api(resource_path, '{{httpMethod}}',
path_params,
query_params,
header_params,
@ -151,6 +184,5 @@ class {{classname}}(object):
response_type={{#returnType}}'{{returnType}}'{{/returnType}}{{^returnType}}None{{/returnType}},
auth_settings=auth_settings,
callback=params.get('callback'))
return response
{{/operation}}
{{/operations}}

View File

@ -157,9 +157,9 @@ class ApiClient(object):
deserialized_data = None
if callback:
callback(deserialized_data)
callback((deserialized_data, response_data.status, response_data.getheaders()))
else:
return deserialized_data
return (deserialized_data, response_data.status, response_data.getheaders())
def to_path_value(self, obj):
"""

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,253 @@
Collecting nose (from -r dev-requirements.txt (line 1))
Using cached nose-1.3.7-py2-none-any.whl
Collecting tox (from -r dev-requirements.txt (line 2))
Using cached tox-2.1.1-py2.py3-none-any.whl
Collecting coverage (from -r dev-requirements.txt (line 3))
Collecting randomize (from -r dev-requirements.txt (line 4))
Using cached randomize-0.13-py2.py3-none-any.whl
Collecting virtualenv>=1.11.2 (from tox->-r dev-requirements.txt (line 2))
Using cached virtualenv-13.1.2-py2.py3-none-any.whl
Collecting py>=1.4.17 (from tox->-r dev-requirements.txt (line 2))
Using cached py-1.4.30-py2.py3-none-any.whl
Collecting pluggy<0.4.0,>=0.3.0 (from tox->-r dev-requirements.txt (line 2))
Using cached pluggy-0.3.0-py2.py3-none-any.whl
Installing collected packages: nose, virtualenv, py, pluggy, tox, coverage, randomize
Successfully installed coverage-3.7.1 nose-1.3.7 pluggy-0.3.0 py-1.4.30 randomize-0.13 tox-2.1.1 virtualenv-13.1.2
Requirement already satisfied (use --upgrade to upgrade): nose in ./.venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./.venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./.venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./.venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./.venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./.venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./.venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Collecting nose (from -r dev-requirements.txt (line 1))
Using cached nose-1.3.7-py2-none-any.whl
Collecting tox (from -r dev-requirements.txt (line 2))
Using cached tox-2.2.1-py2.py3-none-any.whl
Collecting coverage (from -r dev-requirements.txt (line 3))
Downloading coverage-4.0.3.tar.gz (354kB)
Collecting randomize (from -r dev-requirements.txt (line 4))
Using cached randomize-0.13-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in /Library/Python/2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Collecting py>=1.4.17 (from tox->-r dev-requirements.txt (line 2))
Downloading py-1.4.31-py2.py3-none-any.whl (81kB)
Collecting pluggy<0.4.0,>=0.3.0 (from tox->-r dev-requirements.txt (line 2))
Using cached pluggy-0.3.1-py2.py3-none-any.whl
Installing collected packages: nose, py, pluggy, tox, coverage, randomize
Collecting nose (from -r dev-requirements.txt (line 1))
Using cached nose-1.3.7-py2-none-any.whl
Collecting tox (from -r dev-requirements.txt (line 2))
Using cached tox-2.2.1-py2.py3-none-any.whl
Collecting coverage (from -r dev-requirements.txt (line 3))
Using cached coverage-4.0.3.tar.gz
Collecting randomize (from -r dev-requirements.txt (line 4))
Using cached randomize-0.13-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in /Library/Python/2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Collecting py>=1.4.17 (from tox->-r dev-requirements.txt (line 2))
Using cached py-1.4.31-py2.py3-none-any.whl
Collecting pluggy<0.4.0,>=0.3.0 (from tox->-r dev-requirements.txt (line 2))
Using cached pluggy-0.3.1-py2.py3-none-any.whl
Installing collected packages: nose, py, pluggy, tox, coverage, randomize
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2))

View File

@ -157,9 +157,9 @@ class ApiClient(object):
deserialized_data = None
if callback:
callback(deserialized_data)
callback((deserialized_data, response_data.status, response_data.getheaders()))
else:
return deserialized_data
return (deserialized_data, response_data.status, response_data.getheaders())
def to_path_value(self, obj):
"""

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
"""
StoreApi.py
Copyright 2016 SmartBear Software
Copyright 2015 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -45,157 +45,6 @@ class StoreApi(object):
config.api_client = ApiClient()
self.api_client = config.api_client
def delete_order(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(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.
"""
all_params = ['order_id']
all_params.append('callback')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method delete_order" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'order_id' is set
if ('order_id' not in params) or (params['order_id'] is None):
raise ValueError("Missing the required parameter `order_id` when calling `delete_order`")
resource_path = '/store/order/{orderId}'.replace('{format}', 'json')
path_params = {}
if 'order_id' in params:
path_params['orderId'] = params['order_id']
query_params = {}
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json', 'application/xml'])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type([])
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
return response
def find_orders_by_status(self, **kwargs):
"""
Finds orders by status
A single status value can be provided as a string
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_orders_by_status(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str status: Status value that needs to be considered for query
:return: list[Order]
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['status']
all_params.append('callback')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method find_orders_by_status" % key
)
params[key] = val
del params['kwargs']
resource_path = '/store/findByStatus'.replace('{format}', 'json')
path_params = {}
query_params = {}
if 'status' in params:
query_params['status'] = params['status']
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json', 'application/xml'])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type([])
# Authentication setting
auth_settings = ['test_api_client_id', 'test_api_client_secret']
response = self.api_client.call_api(resource_path, 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[Order]',
auth_settings=auth_settings,
callback=params.get('callback'))
return response
def get_inventory(self, **kwargs):
"""
Returns pet inventories by status
@ -209,6 +58,31 @@ 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.
"""
if kwargs.get('callback'):
return self.get_inventory_with_http_info(**kwargs)
else:
(data, status_code, response_headers) = 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)
@ -231,14 +105,16 @@ class StoreApi(object):
resource_path = '/store/inventory'.replace('{format}', 'json')
method = 'GET'
path_params = {}
query_params = {}
header_params = {}
form_params = []
local_var_files = {}
form_params = {}
files = {}
body_params = None
@ -255,22 +131,21 @@ 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, method,
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
files=files,
response_type='dict(str, int)',
auth_settings=auth_settings,
callback=params.get('callback'))
return response
def get_inventory_in_object(self, **kwargs):
def place_order(self, **kwargs):
"""
Fake endpoint to test arbitrary object return by 'Get inventory'
Returns an arbitrary object which is actually a map of status codes to quantities
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
@ -278,16 +153,43 @@ class StoreApi(object):
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.get_inventory_in_object(callback=callback_function)
>>> thread = api.place_order(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:return: object
:param Order body: order placed for purchasing the pet
:return: Order
If the method is called asynchronously,
returns the request thread.
"""
if kwargs.get('callback'):
return self.place_order_with_http_info(**kwargs)
else:
(data, status_code, response_headers) = self.place_order_with_http_info(**kwargs)
return data
def place_order_with_http_info(self, **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(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param Order body: order placed for purchasing the pet
:return: Order
If the method is called asynchronously,
returns the request thread.
"""
all_params = []
all_params = ['body']
all_params.append('callback')
params = locals()
@ -295,23 +197,27 @@ class StoreApi(object):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_inventory_in_object" % key
" to method place_order" % key
)
params[key] = val
del params['kwargs']
resource_path = '/store/inventory?response=arbitrary_object'.replace('{format}', 'json')
resource_path = '/store/order'.replace('{format}', 'json')
method = 'POST'
path_params = {}
query_params = {}
header_params = {}
form_params = []
local_var_files = {}
form_params = {}
files = {}
body_params = None
if 'body' in params:
body_params = params['body']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
@ -324,19 +230,18 @@ class StoreApi(object):
select_header_content_type([])
# Authentication setting
auth_settings = ['api_key']
auth_settings = []
response = self.api_client.call_api(resource_path, 'GET',
return self.api_client.call_api(resource_path, method,
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='object',
files=files,
response_type='Order',
auth_settings=auth_settings,
callback=params.get('callback'))
return response
def get_order_by_id(self, order_id, **kwargs):
"""
@ -351,6 +256,32 @@ 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 str order_id: ID of pet that needs to be fetched (required)
:return: Order
If the method is called asynchronously,
returns the request thread.
"""
if kwargs.get('callback'):
return self.get_order_by_id_with_http_info(order_id, **kwargs)
else:
(data, status_code, response_headers) = 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 str order_id: ID of pet that needs to be fetched (required)
@ -377,6 +308,8 @@ class StoreApi(object):
raise ValueError("Missing the required parameter `order_id` when calling `get_order_by_id`")
resource_path = '/store/order/{orderId}'.replace('{format}', 'json')
method = 'GET'
path_params = {}
if 'order_id' in params:
path_params['orderId'] = params['order_id']
@ -385,8 +318,8 @@ class StoreApi(object):
header_params = {}
form_params = []
local_var_files = {}
form_params = {}
files = {}
body_params = None
@ -401,24 +334,23 @@ class StoreApi(object):
select_header_content_type([])
# Authentication setting
auth_settings = ['test_api_key_header', 'test_api_key_query']
auth_settings = []
response = self.api_client.call_api(resource_path, 'GET',
return self.api_client.call_api(resource_path, method,
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
files=files,
response_type='Order',
auth_settings=auth_settings,
callback=params.get('callback'))
return response
def place_order(self, **kwargs):
def delete_order(self, order_id, **kwargs):
"""
Place an order for a pet
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
@ -426,17 +358,43 @@ class StoreApi(object):
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.place_order(callback=callback_function)
>>> thread = api.delete_order(order_id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param Order body: order placed for purchasing the pet
:return: Order
: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.
"""
if kwargs.get('callback'):
return self.delete_order_with_http_info(order_id, **kwargs)
else:
(data, status_code, response_headers) = 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)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['body']
all_params = ['order_id']
all_params.append('callback')
params = locals()
@ -444,25 +402,30 @@ class StoreApi(object):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method place_order" % key
" to method delete_order" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'order_id' is set
if ('order_id' not in params) or (params['order_id'] is None):
raise ValueError("Missing the required parameter `order_id` when calling `delete_order`")
resource_path = '/store/order/{orderId}'.replace('{format}', 'json')
method = 'DELETE'
resource_path = '/store/order'.replace('{format}', 'json')
path_params = {}
if 'order_id' in params:
path_params['orderId'] = params['order_id']
query_params = {}
header_params = {}
form_params = []
local_var_files = {}
form_params = {}
files = {}
body_params = None
if 'body' in params:
body_params = params['body']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
@ -475,16 +438,15 @@ class StoreApi(object):
select_header_content_type([])
# Authentication setting
auth_settings = ['test_api_client_id', 'test_api_client_secret']
auth_settings = []
response = self.api_client.call_api(resource_path, 'POST',
return self.api_client.call_api(resource_path, method,
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Order',
files=files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
return response

View File

@ -2,7 +2,7 @@
"""
UserApi.py
Copyright 2016 SmartBear Software
Copyright 2015 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -58,6 +58,32 @@ class UserApi(object):
>>>
>>> thread = api.create_user(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param User body: Created user object
:return: None
If the method is called asynchronously,
returns the request thread.
"""
if kwargs.get('callback'):
return self.create_user_with_http_info(**kwargs)
else:
(data, status_code, response_headers) = self.create_user_with_http_info(**kwargs)
return data
def create_user_with_http_info(self, **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(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param User body: Created user object
@ -81,14 +107,16 @@ class UserApi(object):
resource_path = '/user'.replace('{format}', 'json')
method = 'POST'
path_params = {}
query_params = {}
header_params = {}
form_params = []
local_var_files = {}
form_params = {}
files = {}
body_params = None
if 'body' in params:
@ -107,17 +135,16 @@ class UserApi(object):
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, 'POST',
return self.api_client.call_api(resource_path, method,
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
files=files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
return response
def create_users_with_array_input(self, **kwargs):
"""
@ -132,6 +159,32 @@ class UserApi(object):
>>>
>>> thread = api.create_users_with_array_input(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param list[User] body: List of user object
:return: None
If the method is called asynchronously,
returns the request thread.
"""
if kwargs.get('callback'):
return self.create_users_with_array_input_with_http_info(**kwargs)
else:
(data, status_code, response_headers) = self.create_users_with_array_input_with_http_info(**kwargs)
return data
def create_users_with_array_input_with_http_info(self, **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(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param list[User] body: List of user object
@ -155,14 +208,16 @@ class UserApi(object):
resource_path = '/user/createWithArray'.replace('{format}', 'json')
method = 'POST'
path_params = {}
query_params = {}
header_params = {}
form_params = []
local_var_files = {}
form_params = {}
files = {}
body_params = None
if 'body' in params:
@ -181,17 +236,16 @@ class UserApi(object):
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, 'POST',
return self.api_client.call_api(resource_path, method,
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
files=files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
return response
def create_users_with_list_input(self, **kwargs):
"""
@ -206,6 +260,32 @@ class UserApi(object):
>>>
>>> thread = api.create_users_with_list_input(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param list[User] body: List of user object
:return: None
If the method is called asynchronously,
returns the request thread.
"""
if kwargs.get('callback'):
return self.create_users_with_list_input_with_http_info(**kwargs)
else:
(data, status_code, response_headers) = self.create_users_with_list_input_with_http_info(**kwargs)
return data
def create_users_with_list_input_with_http_info(self, **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(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param list[User] body: List of user object
@ -229,14 +309,16 @@ class UserApi(object):
resource_path = '/user/createWithList'.replace('{format}', 'json')
method = 'POST'
path_params = {}
query_params = {}
header_params = {}
form_params = []
local_var_files = {}
form_params = {}
files = {}
body_params = None
if 'body' in params:
@ -255,22 +337,21 @@ class UserApi(object):
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, 'POST',
return self.api_client.call_api(resource_path, method,
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
files=files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
return response
def delete_user(self, username, **kwargs):
def login_user(self, **kwargs):
"""
Delete user
This can only be done by the logged in user.
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
@ -278,17 +359,45 @@ class UserApi(object):
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.delete_user(username, callback=callback_function)
>>> thread = api.login_user(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
:param str username: The user name for login
:param str password: The password for login in clear text
:return: str
If the method is called asynchronously,
returns the request thread.
"""
if kwargs.get('callback'):
return self.login_user_with_http_info(**kwargs)
else:
(data, status_code, response_headers) = self.login_user_with_http_info(**kwargs)
return data
def login_user_with_http_info(self, **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(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str username: The user name for login
:param str password: The password for login in clear text
:return: str
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['username']
all_params = ['username', 'password']
all_params.append('callback')
params = locals()
@ -296,26 +405,27 @@ class UserApi(object):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method delete_user" % key
" to method login_user" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'username' is set
if ('username' not in params) or (params['username'] is None):
raise ValueError("Missing the required parameter `username` when calling `delete_user`")
resource_path = '/user/{username}'.replace('{format}', 'json')
resource_path = '/user/login'.replace('{format}', 'json')
method = 'GET'
path_params = {}
if 'username' in params:
path_params['username'] = params['username']
query_params = {}
if 'username' in params:
query_params['username'] = params['username']
if 'password' in params:
query_params['password'] = params['password']
header_params = {}
form_params = []
local_var_files = {}
form_params = {}
files = {}
body_params = None
@ -330,19 +440,115 @@ class UserApi(object):
select_header_content_type([])
# Authentication setting
auth_settings = ['test_http_basic']
auth_settings = []
response = self.api_client.call_api(resource_path, 'DELETE',
return self.api_client.call_api(resource_path, method,
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
files=files,
response_type='str',
auth_settings=auth_settings,
callback=params.get('callback'))
def logout_user(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(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.
"""
if kwargs.get('callback'):
return self.logout_user_with_http_info(**kwargs)
else:
(data, status_code, response_headers) = 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
If the method is called asynchronously,
returns the request thread.
"""
all_params = []
all_params.append('callback')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method logout_user" % key
)
params[key] = val
del params['kwargs']
resource_path = '/user/logout'.replace('{format}', 'json')
method = 'GET'
path_params = {}
query_params = {}
header_params = {}
form_params = {}
files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json', 'application/xml'])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type([])
# Authentication setting
auth_settings = []
return self.api_client.call_api(resource_path, method,
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
return response
def get_user_by_name(self, username, **kwargs):
"""
@ -357,6 +563,32 @@ 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.
"""
if kwargs.get('callback'):
return self.get_user_by_name_with_http_info(username, **kwargs)
else:
(data, status_code, response_headers) = 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)
@ -383,6 +615,8 @@ class UserApi(object):
raise ValueError("Missing the required parameter `username` when calling `get_user_by_name`")
resource_path = '/user/{username}'.replace('{format}', 'json')
method = 'GET'
path_params = {}
if 'username' in params:
path_params['username'] = params['username']
@ -391,8 +625,8 @@ class UserApi(object):
header_params = {}
form_params = []
local_var_files = {}
form_params = {}
files = {}
body_params = None
@ -409,165 +643,16 @@ class UserApi(object):
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, 'GET',
return self.api_client.call_api(resource_path, method,
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
files=files,
response_type='User',
auth_settings=auth_settings,
callback=params.get('callback'))
return response
def login_user(self, **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(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str username: The user name for login
:param str password: The password for login in clear text
:return: str
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['username', 'password']
all_params.append('callback')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method login_user" % key
)
params[key] = val
del params['kwargs']
resource_path = '/user/login'.replace('{format}', 'json')
path_params = {}
query_params = {}
if 'username' in params:
query_params['username'] = params['username']
if 'password' in params:
query_params['password'] = params['password']
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json', 'application/xml'])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type([])
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='str',
auth_settings=auth_settings,
callback=params.get('callback'))
return response
def logout_user(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(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.
"""
all_params = []
all_params.append('callback')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method logout_user" % key
)
params[key] = val
del params['kwargs']
resource_path = '/user/logout'.replace('{format}', 'json')
path_params = {}
query_params = {}
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json', 'application/xml'])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type([])
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
return response
def update_user(self, username, **kwargs):
"""
@ -582,6 +667,33 @@ class UserApi(object):
>>>
>>> thread = api.update_user(username, 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
:return: None
If the method is called asynchronously,
returns the request thread.
"""
if kwargs.get('callback'):
return self.update_user_with_http_info(username, **kwargs)
else:
(data, status_code, response_headers) = self.update_user_with_http_info(username, **kwargs)
return data
def update_user_with_http_info(self, username, **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, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str username: name that need to be deleted (required)
@ -609,6 +721,8 @@ class UserApi(object):
raise ValueError("Missing the required parameter `username` when calling `update_user`")
resource_path = '/user/{username}'.replace('{format}', 'json')
method = 'PUT'
path_params = {}
if 'username' in params:
path_params['username'] = params['username']
@ -617,8 +731,8 @@ class UserApi(object):
header_params = {}
form_params = []
local_var_files = {}
form_params = {}
files = {}
body_params = None
if 'body' in params:
@ -637,14 +751,117 @@ class UserApi(object):
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, 'PUT',
return self.api_client.call_api(resource_path, method,
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
files=files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
def delete_user(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(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.
"""
if kwargs.get('callback'):
return self.delete_user_with_http_info(username, **kwargs)
else:
(data, status_code, response_headers) = 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)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['username']
all_params.append('callback')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method delete_user" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'username' is set
if ('username' not in params) or (params['username'] is None):
raise ValueError("Missing the required parameter `username` when calling `delete_user`")
resource_path = '/user/{username}'.replace('{format}', 'json')
method = 'DELETE'
path_params = {}
if 'username' in params:
path_params['username'] = params['username']
query_params = {}
header_params = {}
form_params = {}
files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json', 'application/xml'])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type([])
# Authentication setting
auth_settings = []
return self.api_client.call_api(resource_path, method,
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=files,
response_type=None,
auth_settings=auth_settings,
callback=params.get('callback'))
return response