[python-client] Modify python templates to resolve linting errors (#6839)

The linting results for the generated samples are as follows
where the first number is the BEFORE and the second is AFTER.

pyclient            7714 vs. 120
pyclient3           7717 vs. 120
pyclient3-asyncio   7584 vs. 120
pyclient-tornado    7633 vs. 120
pyclient3-tornado   7633 vs. 120

For the complete details please see the following gist.
https://gist.github.com/kenjones-cisco/2eb69a7e8db75e9fd53789f01570d9f2

Enforces linting for python clients by running flake8 for the generated
python client.
This commit is contained in:
Kenny Jones 2017-11-01 12:47:14 -04:00 committed by wing328
parent eba4affbb4
commit 74f70a1924
339 changed files with 9992 additions and 11581 deletions

View File

@ -67,6 +67,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
languageSpecificPrimitives.add("int"); languageSpecificPrimitives.add("int");
languageSpecificPrimitives.add("float"); languageSpecificPrimitives.add("float");
languageSpecificPrimitives.add("list"); languageSpecificPrimitives.add("list");
languageSpecificPrimitives.add("dict");
languageSpecificPrimitives.add("bool"); languageSpecificPrimitives.add("bool");
languageSpecificPrimitives.add("str"); languageSpecificPrimitives.add("str");
languageSpecificPrimitives.add("datetime"); languageSpecificPrimitives.add("datetime");
@ -189,21 +190,16 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
setPackageUrl((String) additionalProperties.get(PACKAGE_URL)); setPackageUrl((String) additionalProperties.get(PACKAGE_URL));
} }
String swaggerFolder = packageName;
modelPackage = swaggerFolder + File.separatorChar + "models";
apiPackage = swaggerFolder + File.separatorChar + "apis";
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
supportingFiles.add(new SupportingFile("tox.mustache", "", "tox.ini")); supportingFiles.add(new SupportingFile("tox.mustache", "", "tox.ini"));
supportingFiles.add(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt")); supportingFiles.add(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt"));
supportingFiles.add(new SupportingFile("requirements.mustache", "", "requirements.txt")); supportingFiles.add(new SupportingFile("requirements.mustache", "", "requirements.txt"));
supportingFiles.add(new SupportingFile("configuration.mustache", swaggerFolder, "configuration.py")); supportingFiles.add(new SupportingFile("configuration.mustache", packageName, "configuration.py"));
supportingFiles.add(new SupportingFile("__init__package.mustache", swaggerFolder, "__init__.py")); supportingFiles.add(new SupportingFile("__init__package.mustache", packageName, "__init__.py"));
supportingFiles.add(new SupportingFile("__init__model.mustache", modelPackage, "__init__.py")); supportingFiles.add(new SupportingFile("__init__model.mustache", packageName + File.separatorChar + modelPackage, "__init__.py"));
supportingFiles.add(new SupportingFile("__init__api.mustache", apiPackage, "__init__.py")); supportingFiles.add(new SupportingFile("__init__api.mustache", packageName + File.separatorChar + apiPackage, "__init__.py"));
if(Boolean.FALSE.equals(excludeTests)) { if(Boolean.FALSE.equals(excludeTests)) {
supportingFiles.add(new SupportingFile("__init__test.mustache", testFolder, "__init__.py")); supportingFiles.add(new SupportingFile("__init__test.mustache", testFolder, "__init__.py"));
@ -212,23 +208,42 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml")); supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml"));
supportingFiles.add(new SupportingFile("setup.mustache", "", "setup.py")); supportingFiles.add(new SupportingFile("setup.mustache", "", "setup.py"));
supportingFiles.add(new SupportingFile("api_client.mustache", swaggerFolder, "api_client.py")); supportingFiles.add(new SupportingFile("api_client.mustache", packageName, "api_client.py"));
if ("asyncio".equals(getLibrary())) { if ("asyncio".equals(getLibrary())) {
supportingFiles.add(new SupportingFile("asyncio/rest.mustache", swaggerFolder, "rest.py")); supportingFiles.add(new SupportingFile("asyncio/rest.mustache", packageName, "rest.py"));
additionalProperties.put("asyncio", "true"); additionalProperties.put("asyncio", "true");
} else if ("tornado".equals(getLibrary())) { } else if ("tornado".equals(getLibrary())) {
supportingFiles.add(new SupportingFile("tornado/rest.mustache", swaggerFolder, "rest.py")); supportingFiles.add(new SupportingFile("tornado/rest.mustache", packageName, "rest.py"));
additionalProperties.put("tornado", "true"); additionalProperties.put("tornado", "true");
} else { } else {
supportingFiles.add(new SupportingFile("rest.mustache", swaggerFolder, "rest.py")); supportingFiles.add(new SupportingFile("rest.mustache", packageName, "rest.py"));
} }
modelPackage = packageName + "." + modelPackage;
apiPackage = packageName + "." + apiPackage;
} }
private static String dropDots(String str) { private static String dropDots(String str) {
return str.replaceAll("\\.", "_"); return str.replaceAll("\\.", "_");
} }
@Override
public String toModelImport(String name) {
String modelImport;
if (StringUtils.startsWithAny(name,"import", "from")) {
modelImport = name;
} else {
modelImport = "from ";
if (!"".equals(modelPackage())) {
modelImport += modelPackage() + ".";
}
modelImport += toModelFilename(name)+ " import " + name;
}
return modelImport;
}
@Override @Override
public Map<String, Object> postProcessModels(Map<String, Object> objs) { public Map<String, Object> postProcessModels(Map<String, Object> objs) {
// process enum in models // process enum in models

View File

@ -6,7 +6,7 @@ from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401 from typing import List, Dict # noqa: F401
from {{modelPackage}}.base_model_ import Model from {{modelPackage}}.base_model_ import Model
{{#imports}}{{import}} # noqa: E501 {{#imports}}{{import}} # noqa: F401,E501
{{/imports}} {{/imports}}
from {{packageName}} import util from {{packageName}} import util
@ -94,7 +94,7 @@ class {{classname}}(Model):
if not set({{{name}}}).issubset(set(allowed_values)): if not set({{{name}}}).issubset(set(allowed_values)):
raise ValueError( raise ValueError(
"Invalid values for `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501 "Invalid values for `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501
.format(", ".join(map(str, set({{{name}}})-set(allowed_values))), # noqa: E501 .format(", ".join(map(str, set({{{name}}}) - set(allowed_values))), # noqa: E501
", ".join(map(str, allowed_values))) ", ".join(map(str, allowed_values)))
) )
{{/isListContainer}} {{/isListContainer}}
@ -102,7 +102,7 @@ class {{classname}}(Model):
if not set({{{name}}}.keys()).issubset(set(allowed_values)): if not set({{{name}}}.keys()).issubset(set(allowed_values)):
raise ValueError( raise ValueError(
"Invalid keys in `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501 "Invalid keys in `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501
.format(", ".join(map(str, set({{{name}}}.keys())-set(allowed_values))), # noqa: E501 .format(", ".join(map(str, set({{{name}}}.keys()) - set(allowed_values))), # noqa: E501
", ".join(map(str, allowed_values))) ", ".join(map(str, allowed_values)))
) )
{{/isMapContainer}} {{/isMapContainer}}

View File

@ -1,8 +1,7 @@
from __future__ import absolute_import from __future__ import absolute_import
# flake8: noqa
# import apis into api package # import apis into api package
{{#apiInfo}} {{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classVarName}} import {{classname}}
{{#apis}} {{/apis}}{{/apiInfo}}
from .{{classVarName}} import {{classname}}
{{/apis}}
{{/apiInfo}}

View File

@ -1,9 +1,10 @@
# coding: utf-8 # coding: utf-8
# flake8: noqa
{{>partial_header}} {{>partial_header}}
from __future__ import absolute_import from __future__ import absolute_import
# import models into model package # import models into model package
{{#models}}{{#model}}from .{{classFilename}} import {{classname}}{{/model}} {{#models}}{{#model}}from {{modelPackage}}.{{classFilename}} import {{classname}}{{/model}}
{{/models}} {{/models}}

View File

@ -1,16 +1,17 @@
# coding: utf-8 # coding: utf-8
# flake8: noqa
{{>partial_header}} {{>partial_header}}
from __future__ import absolute_import from __future__ import absolute_import
# import models into sdk package
{{#models}}{{#model}}from .models.{{classFilename}} import {{classname}}
{{/model}}{{/models}}
# import apis into sdk package # import apis into sdk package
{{#apiInfo}}{{#apis}}from .apis.{{classVarName}} import {{classname}} {{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classVarName}} import {{classname}}
{{/apis}}{{/apiInfo}} {{/apis}}{{/apiInfo}}
# import ApiClient # import ApiClient
from .api_client import ApiClient from {{packageName}}.api_client import ApiClient
from {{packageName}}.configuration import Configuration
from .configuration import Configuration # import models into sdk package
{{#models}}{{#model}}from {{modelPackage}}.{{classFilename}} import {{classname}}
{{/model}}{{/models}}

View File

@ -4,20 +4,18 @@
from __future__ import absolute_import from __future__ import absolute_import
import sys import re # noqa: F401
import os
import re
# python 2 and python 3 compatibility library # python 2 and python 3 compatibility library
from six import iteritems import six
from ..api_client import ApiClient from {{packageName}}.api_client import ApiClient
{{#operations}} {{#operations}}
class {{classname}}(object): class {{classname}}(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen Ref: https://github.com/swagger-api/swagger-codegen
""" """
@ -28,13 +26,11 @@ class {{classname}}(object):
self.api_client = api_client self.api_client = api_client
{{#operation}} {{#operation}}
def {{operationId}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): def {{operationId}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): # noqa: E501
""" """{{#summary}}{{.}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501
{{#summary}}
{{{summary}}}
{{/summary}}
{{#notes}} {{#notes}}
{{{notes}}} {{{notes}}} # noqa: E501
{{/notes}} {{/notes}}
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
@ -56,18 +52,16 @@ class {{classname}}(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.{{operationId}}_with_http_info({{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs) return self.{{operationId}}_with_http_info({{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs) # noqa: E501
else: else:
(data) = self.{{operationId}}_with_http_info({{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs) (data) = self.{{operationId}}_with_http_info({{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs) # noqa: E501
return data return data
def {{operationId}}_with_http_info(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): def {{operationId}}_with_http_info(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): # noqa: E501
""" """{{#summary}}{{.}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501
{{#summary}}
{{{summary}}}
{{/summary}}
{{#notes}} {{#notes}}
{{{notes}}} {{{notes}}} # noqa: E501
{{/notes}} {{/notes}}
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
@ -88,14 +82,14 @@ class {{classname}}(object):
returns the request thread. returns the request thread.
""" """
all_params = [{{#allParams}}'{{paramName}}'{{#hasMore}}, {{/hasMore}}{{/allParams}}] all_params = [{{#allParams}}'{{paramName}}'{{#hasMore}}, {{/hasMore}}{{/allParams}}] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -106,44 +100,48 @@ class {{classname}}(object):
{{#allParams}} {{#allParams}}
{{#required}} {{#required}}
# verify the required parameter '{{paramName}}' is set # verify the required parameter '{{paramName}}' is set
if ('{{paramName}}' not in params) or (params['{{paramName}}'] is None): if ('{{paramName}}' not in params or
raise ValueError("Missing the required parameter `{{paramName}}` when calling `{{operationId}}`") params['{{paramName}}'] is None):
raise ValueError("Missing the required parameter `{{paramName}}` when calling `{{operationId}}`") # noqa: E501
{{/required}} {{/required}}
{{/allParams}} {{/allParams}}
{{#allParams}} {{#allParams}}
{{#hasValidation}} {{#hasValidation}}
{{#maxLength}} {{#maxLength}}
if '{{paramName}}' in params and len(params['{{paramName}}']) > {{maxLength}}: if ('{{paramName}}' in params and
raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be less than or equal to `{{maxLength}}`") len(params['{{paramName}}']) > {{maxLength}}):
raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501
{{/maxLength}} {{/maxLength}}
{{#minLength}} {{#minLength}}
if '{{paramName}}' in params and len(params['{{paramName}}']) < {{minLength}}: if ('{{paramName}}' in params and
raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be greater than or equal to `{{minLength}}`") len(params['{{paramName}}']) < {{minLength}}):
raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501
{{/minLength}} {{/minLength}}
{{#maximum}} {{#maximum}}
if '{{paramName}}' in params and params['{{paramName}}'] >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}: if '{{paramName}}' in params and params['{{paramName}}'] >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}: # noqa: E501
raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501
{{/maximum}} {{/maximum}}
{{#minimum}} {{#minimum}}
if '{{paramName}}' in params and params['{{paramName}}'] <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}: if '{{paramName}}' in params and params['{{paramName}}'] <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}: # noqa: E501
raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501
{{/minimum}} {{/minimum}}
{{#pattern}} {{#pattern}}
if '{{paramName}}' in params and not re.search('{{{vendorExtensions.x-regex}}}', params['{{paramName}}']{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): if '{{paramName}}' in params and not re.search('{{{vendorExtensions.x-regex}}}', params['{{paramName}}']{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501
raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must conform to the pattern `{{{pattern}}}`") raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must conform to the pattern `{{{pattern}}}`") # noqa: E501
{{/pattern}} {{/pattern}}
{{#maxItems}} {{#maxItems}}
if '{{paramName}}' in params and len(params['{{paramName}}']) > {{maxItems}}: if ('{{paramName}}' in params and
raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be less than or equal to `{{maxItems}}`") len(params['{{paramName}}']) > {{maxItems}}):
raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501
{{/maxItems}} {{/maxItems}}
{{#minItems}} {{#minItems}}
if '{{paramName}}' in params and len(params['{{paramName}}']) < {{minItems}}: if ('{{paramName}}' in params and
raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be greater than or equal to `{{minItems}}`") len(params['{{paramName}}']) < {{minItems}}):
raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501
{{/minItems}} {{/minItems}}
{{/hasValidation}} {{/hasValidation}}
{{#-last}} {{#-last}}
{{/-last}} {{/-last}}
{{/allParams}} {{/allParams}}
collection_formats = {} collection_formats = {}
@ -151,30 +149,30 @@ class {{classname}}(object):
path_params = {} path_params = {}
{{#pathParams}} {{#pathParams}}
if '{{paramName}}' in params: if '{{paramName}}' in params:
path_params['{{baseName}}'] = params['{{paramName}}']{{#isListContainer}} path_params['{{baseName}}'] = params['{{paramName}}']{{#isListContainer}} # noqa: E501
collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501
{{/pathParams}} {{/pathParams}}
query_params = [] query_params = []
{{#queryParams}} {{#queryParams}}
if '{{paramName}}' in params: if '{{paramName}}' in params:
query_params.append(('{{baseName}}', params['{{paramName}}'])){{#isListContainer}} query_params.append(('{{baseName}}', params['{{paramName}}'])){{#isListContainer}} # noqa: E501
collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501
{{/queryParams}} {{/queryParams}}
header_params = {} header_params = {}
{{#headerParams}} {{#headerParams}}
if '{{paramName}}' in params: if '{{paramName}}' in params:
header_params['{{baseName}}'] = params['{{paramName}}']{{#isListContainer}} header_params['{{baseName}}'] = params['{{paramName}}']{{#isListContainer}} # noqa: E501
collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501
{{/headerParams}} {{/headerParams}}
form_params = [] form_params = []
local_var_files = {} local_var_files = {}
{{#formParams}} {{#formParams}}
if '{{paramName}}' in params: if '{{paramName}}' in params:
{{#notFile}}form_params.append(('{{baseName}}', params['{{paramName}}'])){{/notFile}}{{#isFile}}local_var_files['{{baseName}}'] = params['{{paramName}}']{{/isFile}}{{#isListContainer}} {{#notFile}}form_params.append(('{{baseName}}', params['{{paramName}}'])){{/notFile}}{{#isFile}}local_var_files['{{baseName}}'] = params['{{paramName}}']{{/isFile}}{{#isListContainer}} # noqa: E501
collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501
{{/formParams}} {{/formParams}}
body_params = None body_params = None
@ -184,32 +182,33 @@ class {{classname}}(object):
{{/bodyParam}} {{/bodyParam}}
{{#hasProduces}} {{#hasProduces}}
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept([{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]) [{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]) # noqa: E501
{{/hasProduces}} {{/hasProduces}}
{{#hasConsumes}} {{#hasConsumes}}
# HTTP header `Content-Type` # HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
select_header_content_type([{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]) [{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]) # noqa: E501
{{/hasConsumes}} {{/hasConsumes}}
# Authentication setting # Authentication setting
auth_settings = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}] auth_settings = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}] # noqa: E501
return self.api_client.call_api('{{{path}}}', '{{httpMethod}}', return self.api_client.call_api(
path_params, '{{{path}}}', '{{httpMethod}}',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type={{#returnType}}'{{returnType}}'{{/returnType}}{{^returnType}}None{{/returnType}}, files=local_var_files,
auth_settings=auth_settings, response_type={{#returnType}}'{{returnType}}'{{/returnType}}{{^returnType}}None{{/returnType}}, # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
{{/operation}} {{/operation}}
{{/operations}} {{/operations}}

View File

@ -2,30 +2,28 @@
{{>partial_header}} {{>partial_header}}
from __future__ import absolute_import from __future__ import absolute_import
import os import datetime
import re
import json import json
import mimetypes import mimetypes
from multiprocessing.pool import ThreadPool
import os
import re
import tempfile import tempfile
# python 2 and python 3 compatibility library
import six
from six.moves.urllib.parse import quote
{{#tornado}} {{#tornado}}
import tornado.gen import tornado.gen
{{/tornado}} {{/tornado}}
from multiprocessing.pool import ThreadPool
from datetime import date, datetime from {{packageName}}.configuration import Configuration
import {{modelPackage}}
# python 2 and python 3 compatibility library from {{packageName}} import rest
from six import PY3, integer_types, iteritems, text_type
from six.moves.urllib.parse import quote
from . import models
from .configuration import Configuration
from .rest import ApiException, RESTClientObject
class ApiClient(object): class ApiClient(object):
""" """Generic API client for Swagger client library builds.
Generic API client for Swagger client library builds.
Swagger generic API client. This client handles the client- Swagger generic API client. This client handles the client-
server communication, and is invariant across implementations. Specifics of server communication, and is invariant across implementations. Specifics of
@ -38,38 +36,39 @@ class ApiClient(object):
:param configuration: .Configuration object for this client :param configuration: .Configuration object for this client
:param header_name: a header to pass when making calls to the API. :param header_name: a header to pass when making calls to the API.
:param header_value: a header value to pass when making calls to :param header_value: a header value to pass when making calls to
the API. the API.
:param cookie: a cookie to include in the header when making calls :param cookie: a cookie to include in the header when making calls
to the API to the API
""" """
PRIMITIVE_TYPES = (float, bool, bytes, text_type) + integer_types PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types
NATIVE_TYPES_MAPPING = { NATIVE_TYPES_MAPPING = {
'int': int, 'int': int,
'long': int if PY3 else long, 'long': int if six.PY3 else long, # noqa: F821
'float': float, 'float': float,
'str': str, 'str': str,
'bool': bool, 'bool': bool,
'date': date, 'date': datetime.date,
'datetime': datetime, 'datetime': datetime.datetime,
'object': object, 'object': object,
} }
def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None): def __init__(self, configuration=None, header_name=None, header_value=None,
cookie=None):
if configuration is None: if configuration is None:
configuration = Configuration() configuration = Configuration()
self.configuration = configuration self.configuration = configuration
self.pool = ThreadPool() self.pool = ThreadPool()
self.rest_client = RESTClientObject(configuration) self.rest_client = rest.RESTClientObject(configuration)
self.default_headers = {} self.default_headers = {}
if header_name is not None: if header_name is not None:
self.default_headers[header_name] = header_value self.default_headers[header_name] = header_value
self.cookie = cookie self.cookie = cookie
# Set default User-Agent. # Set default User-Agent.
self.user_agent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{packageVersion}}}/python{{/httpUserAgent}}' self.user_agent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{packageVersion}}}/python{{/httpUserAgent}}'
def __del__(self): def __del__(self):
self.pool.close() self.pool.close()
self.pool.join() self.pool.join()
@ -89,12 +88,12 @@ class ApiClient(object):
{{#tornado}} {{#tornado}}
@tornado.gen.coroutine @tornado.gen.coroutine
{{/tornado}} {{/tornado}}
{{#asyncio}}async {{/asyncio}}def __call_api(self, resource_path, method, {{#asyncio}}async {{/asyncio}}def __call_api(
path_params=None, query_params=None, header_params=None, self, resource_path, method, path_params=None,
body=None, post_params=None, files=None, query_params=None, header_params=None, body=None, post_params=None,
response_type=None, auth_settings=None, files=None, response_type=None, auth_settings=None,
_return_http_data_only=None, collection_formats=None, _preload_content=True, _return_http_data_only=None, collection_formats=None,
_request_timeout=None): _preload_content=True, _request_timeout=None):
config = self.configuration config = self.configuration
@ -116,7 +115,9 @@ class ApiClient(object):
for k, v in path_params: for k, v in path_params:
# specified safe chars, encode everything # specified safe chars, encode everything
resource_path = resource_path.replace( resource_path = resource_path.replace(
'{%s}' % k, quote(str(v), safe=config.safe_chars_for_path_param)) '{%s}' % k,
quote(str(v), safe=config.safe_chars_for_path_param)
)
# query parameters # query parameters
if query_params: if query_params:
@ -142,14 +143,14 @@ class ApiClient(object):
url = self.configuration.host + resource_path url = self.configuration.host + resource_path
# perform request and return response # perform request and return response
response_data = {{#asyncio}}await {{/asyncio}}{{#tornado}}yield {{/tornado}}self.request(method, url, response_data = {{#asyncio}}await {{/asyncio}}{{#tornado}}yield {{/tornado}}self.request(
query_params=query_params, method, url, query_params=query_params, headers=header_params,
headers=header_params, post_params=post_params, body=body,
post_params=post_params, body=body, _preload_content=_preload_content,
_preload_content=_preload_content, _request_timeout=_request_timeout)
_request_timeout=_request_timeout)
self.last_response = response_data self.last_response = response_data
{{^tornado}}
return_data = response_data return_data = response_data
if _preload_content: if _preload_content:
@ -162,11 +163,12 @@ class ApiClient(object):
if _return_http_data_only: if _return_http_data_only:
return (return_data) return (return_data)
else: else:
return (return_data, response_data.status, response_data.getheaders()) return (return_data, response_data.status,
response_data.getheaders())
{{/tornado}}
def sanitize_for_serialization(self, obj): def sanitize_for_serialization(self, obj):
""" """Builds a JSON POST object.
Builds a JSON POST object.
If obj is None, return None. If obj is None, return None.
If obj is str, int, long, float, bool, return directly. If obj is str, int, long, float, bool, return directly.
@ -189,7 +191,7 @@ class ApiClient(object):
elif isinstance(obj, tuple): elif isinstance(obj, tuple):
return tuple(self.sanitize_for_serialization(sub_obj) return tuple(self.sanitize_for_serialization(sub_obj)
for sub_obj in obj) for sub_obj in obj)
elif isinstance(obj, (datetime, date)): elif isinstance(obj, (datetime.datetime, datetime.date)):
return obj.isoformat() return obj.isoformat()
if isinstance(obj, dict): if isinstance(obj, dict):
@ -201,15 +203,14 @@ class ApiClient(object):
# Convert attribute name to json key in # Convert attribute name to json key in
# model definition for request. # model definition for request.
obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) obj_dict = {obj.attribute_map[attr]: getattr(obj, attr)
for attr, _ in iteritems(obj.swagger_types) for attr, _ in six.iteritems(obj.swagger_types)
if getattr(obj, attr) is not None} if getattr(obj, attr) is not None}
return {key: self.sanitize_for_serialization(val) return {key: self.sanitize_for_serialization(val)
for key, val in iteritems(obj_dict)} for key, val in six.iteritems(obj_dict)}
def deserialize(self, response, response_type): def deserialize(self, response, response_type):
""" """Deserializes response into an object.
Deserializes response into an object.
:param response: RESTResponse object to be deserialized. :param response: RESTResponse object to be deserialized.
:param response_type: class literal for :param response_type: class literal for
@ -231,8 +232,7 @@ class ApiClient(object):
return self.__deserialize(data, response_type) return self.__deserialize(data, response_type)
def __deserialize(self, data, klass): def __deserialize(self, data, klass):
""" """Deserializes dict, list, str into an object.
Deserializes dict, list, str into an object.
:param data: dict, list or str. :param data: dict, list or str.
:param klass: class literal, or string of class name. :param klass: class literal, or string of class name.
@ -251,21 +251,21 @@ class ApiClient(object):
if klass.startswith('dict('): if klass.startswith('dict('):
sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2) sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2)
return {k: self.__deserialize(v, sub_kls) return {k: self.__deserialize(v, sub_kls)
for k, v in iteritems(data)} for k, v in six.iteritems(data)}
# convert str to class # convert str to class
if klass in self.NATIVE_TYPES_MAPPING: if klass in self.NATIVE_TYPES_MAPPING:
klass = self.NATIVE_TYPES_MAPPING[klass] klass = self.NATIVE_TYPES_MAPPING[klass]
else: else:
klass = getattr(models, klass) klass = getattr({{modelPackage}}, klass)
if klass in self.PRIMITIVE_TYPES: if klass in self.PRIMITIVE_TYPES:
return self.__deserialize_primitive(data, klass) return self.__deserialize_primitive(data, klass)
elif klass == object: elif klass == object:
return self.__deserialize_object(data) return self.__deserialize_object(data)
elif klass == date: elif klass == datetime.date:
return self.__deserialize_date(data) return self.__deserialize_date(data)
elif klass == datetime: elif klass == datetime.datetime:
return self.__deserialize_datatime(data) return self.__deserialize_datatime(data)
else: else:
return self.__deserialize_model(data, klass) return self.__deserialize_model(data, klass)
@ -274,10 +274,10 @@ class ApiClient(object):
path_params=None, query_params=None, header_params=None, path_params=None, query_params=None, header_params=None,
body=None, post_params=None, files=None, body=None, post_params=None, files=None,
response_type=None, auth_settings=None, async=None, response_type=None, auth_settings=None, async=None,
_return_http_data_only=None, collection_formats=None, _preload_content=True, _return_http_data_only=None, collection_formats=None,
_request_timeout=None): _preload_content=True, _request_timeout=None):
""" """Makes the HTTP request (synchronous) and returns deserialized data.
Makes the HTTP request (synchronous) and return the deserialized data.
To make an async request, set the async parameter. To make an async request, set the async parameter.
:param resource_path: Path to method endpoint. :param resource_path: Path to method endpoint.
@ -294,13 +294,17 @@ class ApiClient(object):
:param files dict: key -> filename, value -> filepath, :param files dict: key -> filename, value -> filepath,
for `multipart/form-data`. for `multipart/form-data`.
:param async bool: execute request asynchronously :param async bool: execute request asynchronously
:param _return_http_data_only: response data without head status code and headers :param _return_http_data_only: response data without head status code
and headers
:param collection_formats: dict of collection formats for path, query, :param collection_formats: dict of collection formats for path, query,
header, and post parameters. header, and post parameters.
:param _preload_content: if False, the urllib3.HTTPResponse object will be returned without :param _preload_content: if False, the urllib3.HTTPResponse object will
reading/decoding response data. Default is True. be returned without reading/decoding response
:param _request_timeout: timeout setting for this request. If one number provided, it will be total request data. Default is True.
timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:return: :return:
If async parameter is True, If async parameter is True,
the request will be called asynchronously. the request will be called asynchronously.
@ -313,22 +317,23 @@ class ApiClient(object):
path_params, query_params, header_params, path_params, query_params, header_params,
body, post_params, files, body, post_params, files,
response_type, auth_settings, response_type, auth_settings,
_return_http_data_only, collection_formats, _preload_content, _request_timeout) _return_http_data_only, collection_formats,
_preload_content, _request_timeout)
else: else:
thread = self.pool.apply_async(self.__call_api, (resource_path, method, thread = self.pool.apply_async(self.__call_api, (resource_path,
path_params, query_params, method, path_params, query_params,
header_params, body, header_params, body,
post_params, files, post_params, files,
response_type, auth_settings, response_type, auth_settings,
_return_http_data_only, _return_http_data_only,
collection_formats, _preload_content, _request_timeout)) collection_formats,
_preload_content, _request_timeout))
return thread return thread
def request(self, method, url, query_params=None, headers=None, def request(self, method, url, query_params=None, headers=None,
post_params=None, body=None, _preload_content=True, _request_timeout=None): post_params=None, body=None, _preload_content=True,
""" _request_timeout=None):
Makes the HTTP request using RESTClient. """Makes the HTTP request using RESTClient."""
"""
if method == "GET": if method == "GET":
return self.rest_client.GET(url, return self.rest_client.GET(url,
query_params=query_params, query_params=query_params,
@ -387,8 +392,7 @@ class ApiClient(object):
) )
def parameters_to_tuples(self, params, collection_formats): def parameters_to_tuples(self, params, collection_formats):
""" """Get parameters as list of tuples, formatting collections.
Get parameters as list of tuples, formatting collections.
:param params: Parameters as dict or list of two-tuples :param params: Parameters as dict or list of two-tuples
:param dict collection_formats: Parameter collection formats :param dict collection_formats: Parameter collection formats
@ -397,7 +401,7 @@ class ApiClient(object):
new_params = [] new_params = []
if collection_formats is None: if collection_formats is None:
collection_formats = {} collection_formats = {}
for k, v in iteritems(params) if isinstance(params, dict) else params: for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501
if k in collection_formats: if k in collection_formats:
collection_format = collection_formats[k] collection_format = collection_formats[k]
if collection_format == 'multi': if collection_format == 'multi':
@ -418,8 +422,7 @@ class ApiClient(object):
return new_params return new_params
def prepare_post_parameters(self, post_params=None, files=None): def prepare_post_parameters(self, post_params=None, files=None):
""" """Builds form parameters.
Builds form parameters.
:param post_params: Normal form parameters. :param post_params: Normal form parameters.
:param files: File parameters. :param files: File parameters.
@ -431,7 +434,7 @@ class ApiClient(object):
params = post_params params = post_params
if files: if files:
for k, v in iteritems(files): for k, v in six.iteritems(files):
if not v: if not v:
continue continue
file_names = v if type(v) is list else [v] file_names = v if type(v) is list else [v]
@ -439,15 +442,15 @@ class ApiClient(object):
with open(n, 'rb') as f: with open(n, 'rb') as f:
filename = os.path.basename(f.name) filename = os.path.basename(f.name)
filedata = f.read() filedata = f.read()
mimetype = mimetypes.\ mimetype = (mimetypes.guess_type(filename)[0] or
guess_type(filename)[0] or 'application/octet-stream' 'application/octet-stream')
params.append(tuple([k, tuple([filename, filedata, mimetype])])) params.append(
tuple([k, tuple([filename, filedata, mimetype])]))
return params return params
def select_header_accept(self, accepts): def select_header_accept(self, accepts):
""" """Returns `Accept` based on an array of accepts provided.
Returns `Accept` based on an array of accepts provided.
:param accepts: List of headers. :param accepts: List of headers.
:return: Accept (e.g. application/json). :return: Accept (e.g. application/json).
@ -463,8 +466,7 @@ class ApiClient(object):
return ', '.join(accepts) return ', '.join(accepts)
def select_header_content_type(self, content_types): def select_header_content_type(self, content_types):
""" """Returns `Content-Type` based on an array of content_types provided.
Returns `Content-Type` based on an array of content_types provided.
:param content_types: List of content-types. :param content_types: List of content-types.
:return: Content-Type (e.g. application/json). :return: Content-Type (e.g. application/json).
@ -480,8 +482,7 @@ class ApiClient(object):
return content_types[0] return content_types[0]
def update_params_for_auth(self, headers, querys, auth_settings): def update_params_for_auth(self, headers, querys, auth_settings):
""" """Updates header and query params based on authentication setting.
Updates header and query params based on authentication setting.
:param headers: Header parameters dict to be updated. :param headers: Header parameters dict to be updated.
:param querys: Query parameters tuple list to be updated. :param querys: Query parameters tuple list to be updated.
@ -505,7 +506,8 @@ class ApiClient(object):
) )
def __deserialize_file(self, response): def __deserialize_file(self, response):
""" """Deserializes body to file
Saves response body into a file in a temporary folder, Saves response body into a file in a temporary folder,
using the filename from the `Content-Disposition` header if provided. using the filename from the `Content-Disposition` header if provided.
@ -518,9 +520,8 @@ class ApiClient(object):
content_disposition = response.getheader("Content-Disposition") content_disposition = response.getheader("Content-Disposition")
if content_disposition: if content_disposition:
filename = re.\ filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?',
search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition).\ content_disposition).group(1)
group(1)
path = os.path.join(os.path.dirname(path), filename) path = os.path.join(os.path.dirname(path), filename)
with open(path, "w") as f: with open(path, "w") as f:
@ -529,8 +530,7 @@ class ApiClient(object):
return path return path
def __deserialize_primitive(self, data, klass): def __deserialize_primitive(self, data, klass):
""" """Deserializes string to primitive type.
Deserializes string to primitive type.
:param data: str. :param data: str.
:param klass: class literal. :param klass: class literal.
@ -540,21 +540,19 @@ class ApiClient(object):
try: try:
return klass(data) return klass(data)
except UnicodeEncodeError: except UnicodeEncodeError:
return unicode(data) return unicode(data) # noqa: F821
except TypeError: except TypeError:
return data return data
def __deserialize_object(self, value): def __deserialize_object(self, value):
""" """Return a original value.
Return a original value.
:return: object. :return: object.
""" """
return value return value
def __deserialize_date(self, string): def __deserialize_date(self, string):
""" """Deserializes string to date.
Deserializes string to date.
:param string: str. :param string: str.
:return: date. :return: date.
@ -565,14 +563,13 @@ class ApiClient(object):
except ImportError: except ImportError:
return string return string
except ValueError: except ValueError:
raise ApiException( raise rest.ApiException(
status=0, status=0,
reason="Failed to parse `{0}` into a date object".format(string) reason="Failed to parse `{0}` as date object".format(string)
) )
def __deserialize_datatime(self, string): def __deserialize_datatime(self, string):
""" """Deserializes string to datetime.
Deserializes string to datetime.
The string should be in iso8601 datetime format. The string should be in iso8601 datetime format.
@ -585,32 +582,32 @@ class ApiClient(object):
except ImportError: except ImportError:
return string return string
except ValueError: except ValueError:
raise ApiException( raise rest.ApiException(
status=0, status=0,
reason=( reason=(
"Failed to parse `{0}` into a datetime object" "Failed to parse `{0}` as datetime object"
.format(string) .format(string)
) )
) )
def __deserialize_model(self, data, klass): def __deserialize_model(self, data, klass):
""" """Deserializes list or dict to model.
Deserializes list or dict to model.
:param data: dict, list. :param data: dict, list.
:param klass: class literal. :param klass: class literal.
:return: model object. :return: model object.
""" """
if not klass.swagger_types and not hasattr(klass, 'get_real_child_model'): if not klass.swagger_types and not hasattr(klass,
'get_real_child_model'):
return data return data
kwargs = {} kwargs = {}
if klass.swagger_types is not None: if klass.swagger_types is not None:
for attr, attr_type in iteritems(klass.swagger_types): for attr, attr_type in six.iteritems(klass.swagger_types):
if data is not None \ if (data is not None and
and klass.attribute_map[attr] in data \ klass.attribute_map[attr] in data and
and isinstance(data, (list, dict)): isinstance(data, (list, dict))):
value = data[klass.attribute_map[attr]] value = data[klass.attribute_map[attr]]
kwargs[attr] = self.__deserialize(value, attr_type) kwargs[attr] = self.__deserialize(value, attr_type)

View File

@ -17,7 +17,7 @@ Method | HTTP request | Description
{{{notes}}}{{/notes}} {{{notes}}}{{/notes}}
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -51,7 +51,7 @@ api_instance = {{{packageName}}}.{{{classname}}}()
{{/allParams}} {{/allParams}}
{{/hasAuthMethods}} {{/hasAuthMethods}}
try: try:
{{#summary}} # {{{.}}} {{#summary}} # {{{.}}}
{{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}} {{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}}
pprint(api_response){{/returnType}} pprint(api_response){{/returnType}}

View File

@ -4,30 +4,29 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import {{packageName}} import {{packageName}}
from {{apiPackage}}.{{classVarName}} import {{classname}} # noqa: E501
from {{packageName}}.rest import ApiException from {{packageName}}.rest import ApiException
from {{packageName}}.apis.{{classVarName}} import {{classname}}
class {{#operations}}Test{{classname}}(unittest.TestCase): class {{#operations}}Test{{classname}}(unittest.TestCase):
""" {{classname}} unit test stubs """ """{{classname}} unit test stubs"""
def setUp(self): def setUp(self):
self.api = {{packageName}}.apis.{{classVarName}}.{{classname}}() self.api = {{apiPackage}}.{{classVarName}}.{{classname}}() # noqa: E501
def tearDown(self): def tearDown(self):
pass pass
{{#operation}} {{#operation}}
def test_{{operationId}}(self): def test_{{operationId}}(self):
""" """Test case for {{{operationId}}}
Test case for {{{operationId}}}
{{{summary}}} {{#summary}}
{{{summary}}} # noqa: E501
{{/summary}}
""" """
pass pass

View File

@ -2,16 +2,15 @@
{{>partial_header}} {{>partial_header}}
import aiohttp
import io import io
import json import json
import ssl
import certifi
import logging import logging
import re import re
import ssl
import aiohttp
import certifi
# python 2 and python 3 compatibility library # python 2 and python 3 compatibility library
from six import PY3
from six.moves.urllib.parse import urlencode from six.moves.urllib.parse import urlencode
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -26,22 +25,18 @@ class RESTResponse(io.IOBase):
self.data = data self.data = data
def getheaders(self): def getheaders(self):
""" """Returns a CIMultiDictProxy of the response headers."""
Returns a CIMultiDictProxy of the response headers.
"""
return self.aiohttp_response.headers return self.aiohttp_response.headers
def getheader(self, name, default=None): def getheader(self, name, default=None):
""" """Returns a given response header."""
Returns a given response header.
"""
return self.aiohttp_response.headers.get(name, default) return self.aiohttp_response.headers.get(name, default)
class RESTClientObject: class RESTClientObject(object):
def __init__(self, configuration, pools_size=4, maxsize=4): def __init__(self, configuration, pools_size=4, maxsize=4):
# maxsize is the number of requests to host that are allowed in parallel # maxsize is number of requests to host that are allowed in parallel
# ca_certs vs cert_file vs key_file # ca_certs vs cert_file vs key_file
# http://stackoverflow.com/a/23957365/2985775 # http://stackoverflow.com/a/23957365/2985775
@ -53,6 +48,7 @@ class RESTClientObject:
ca_certs = certifi.where() ca_certs = certifi.where()
ssl_context = ssl.SSLContext() ssl_context = ssl.SSLContext()
ssl_context.load_verify_locations(cafile=ca_certs)
if configuration.cert_file: if configuration.cert_file:
ssl_context.load_cert_chain( ssl_context.load_cert_chain(
configuration.cert_file, keyfile=configuration.key_file configuration.cert_file, keyfile=configuration.key_file
@ -60,6 +56,7 @@ class RESTClientObject:
connector = aiohttp.TCPConnector( connector = aiohttp.TCPConnector(
limit=maxsize, limit=maxsize,
ssl_context=ssl_context,
verify_ssl=configuration.verify_ssl verify_ssl=configuration.verify_ssl
) )
@ -75,8 +72,10 @@ class RESTClientObject:
) )
async def request(self, method, url, query_params=None, headers=None, async def request(self, method, url, query_params=None, headers=None,
body=None, post_params=None, _preload_content=True, _request_timeout=None): body=None, post_params=None, _preload_content=True,
""" _request_timeout=None):
"""Execute request
:param method: http request method :param method: http request method
:param url: http request url :param url: http request url
:param query_params: query parameters in the url :param query_params: query parameters in the url
@ -85,12 +84,16 @@ class RESTClientObject:
:param post_params: request post parameters, :param post_params: request post parameters,
`application/x-www-form-urlencoded` `application/x-www-form-urlencoded`
and `multipart/form-data` and `multipart/form-data`
:param _preload_content: this is a non-applicable field for the AiohttpClient. :param _preload_content: this is a non-applicable field for
:param _request_timeout: timeout setting for this request. If one number provided, it will be total request the AiohttpClient.
timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
""" """
method = method.upper() method = method.upper()
assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', 'PATCH', 'OPTIONS'] assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
'PATCH', 'OPTIONS']
if post_params and body: if post_params and body:
raise ValueError( raise ValueError(
@ -118,7 +121,7 @@ class RESTClientObject:
if body is not None: if body is not None:
body = json.dumps(body) body = json.dumps(body)
args["data"] = body args["data"] = body
elif headers['Content-Type'] == 'application/x-www-form-urlencoded': elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
data = aiohttp.FormData() data = aiohttp.FormData()
for k, v in post_params.items(): for k, v in post_params.items():
data.add_field(k, v) data.add_field(k, v)
@ -132,8 +135,9 @@ class RESTClientObject:
args["data"] = body args["data"] = body
else: else:
# Cannot generate the request from given parameters # Cannot generate the request from given parameters
msg = """Cannot prepare a request message for provided arguments. msg = """Cannot prepare a request message for provided
Please check that your arguments match declared content type.""" arguments. Please check that your arguments match
declared content type."""
raise ApiException(status=0, reason=msg) raise ApiException(status=0, reason=msg)
else: else:
args["data"] = query_params args["data"] = query_params
@ -150,22 +154,25 @@ class RESTClientObject:
return r return r
async def GET(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): async def GET(self, url, headers=None, query_params=None,
_preload_content=True, _request_timeout=None):
return (await self.request("GET", url, return (await self.request("GET", url,
headers=headers, headers=headers,
_preload_content=_preload_content, _preload_content=_preload_content,
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
query_params=query_params)) query_params=query_params))
async def HEAD(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): async def HEAD(self, url, headers=None, query_params=None,
_preload_content=True, _request_timeout=None):
return (await self.request("HEAD", url, return (await self.request("HEAD", url,
headers=headers, headers=headers,
_preload_content=_preload_content, _preload_content=_preload_content,
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
query_params=query_params)) query_params=query_params))
async def OPTIONS(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, async def OPTIONS(self, url, headers=None, query_params=None,
_request_timeout=None): post_params=None, body=None, _preload_content=True,
_request_timeout=None):
return (await self.request("OPTIONS", url, return (await self.request("OPTIONS", url,
headers=headers, headers=headers,
query_params=query_params, query_params=query_params,
@ -174,7 +181,8 @@ class RESTClientObject:
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
body=body)) body=body))
async def DELETE(self, url, headers=None, query_params=None, body=None, _preload_content=True, _request_timeout=None): async def DELETE(self, url, headers=None, query_params=None, body=None,
_preload_content=True, _request_timeout=None):
return (await self.request("DELETE", url, return (await self.request("DELETE", url,
headers=headers, headers=headers,
query_params=query_params, query_params=query_params,
@ -182,8 +190,9 @@ class RESTClientObject:
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
body=body)) body=body))
async def POST(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, async def POST(self, url, headers=None, query_params=None,
_request_timeout=None): post_params=None, body=None, _preload_content=True,
_request_timeout=None):
return (await self.request("POST", url, return (await self.request("POST", url,
headers=headers, headers=headers,
query_params=query_params, query_params=query_params,
@ -192,8 +201,8 @@ class RESTClientObject:
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
body=body)) body=body))
async def PUT(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, async def PUT(self, url, headers=None, query_params=None, post_params=None,
_request_timeout=None): body=None, _preload_content=True, _request_timeout=None):
return (await self.request("PUT", url, return (await self.request("PUT", url,
headers=headers, headers=headers,
query_params=query_params, query_params=query_params,
@ -202,8 +211,9 @@ class RESTClientObject:
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
body=body)) body=body))
async def PATCH(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, async def PATCH(self, url, headers=None, query_params=None,
_request_timeout=None): post_params=None, body=None, _preload_content=True,
_request_timeout=None):
return (await self.request("PATCH", url, return (await self.request("PATCH", url,
headers=headers, headers=headers,
query_params=query_params, query_params=query_params,
@ -228,13 +238,11 @@ class ApiException(Exception):
self.headers = None self.headers = None
def __str__(self): def __str__(self):
""" """Custom error messages for exception"""
Custom error messages for exception error_message = "({0})\nReason: {1}\n".format(self.status, self.reason)
"""
error_message = "({0})\n"\
"Reason: {1}\n".format(self.status, self.reason)
if self.headers: if self.headers:
error_message += "HTTP response headers: {0}\n".format(self.headers) error_message += "HTTP response headers: {0}\n".format(
self.headers)
if self.body: if self.body:
error_message += "HTTP response body: {0}\n".format(self.body) error_message += "HTTP response body: {0}\n".format(self.body)

View File

@ -4,24 +4,23 @@
from __future__ import absolute_import from __future__ import absolute_import
import urllib3
import copy import copy
import logging import logging
import multiprocessing import multiprocessing
import sys import sys
import urllib3
from six import iteritems import six
from six import with_metaclass
from six.moves import http_client as httplib from six.moves import http_client as httplib
class TypeWithDefault(type): class TypeWithDefault(type):
def __init__(cls, name, bases, dct): def __init__(cls, name, bases, dct):
super(TypeWithDefault, cls).__init__(name, bases, dct) super(TypeWithDefault, cls).__init__(name, bases, dct)
cls._default = None cls._default = None
def __call__(cls): def __call__(cls):
if cls._default == None: if cls._default is None:
cls._default = type.__call__(cls) cls._default = type.__call__(cls)
return copy.copy(cls._default) return copy.copy(cls._default)
@ -29,17 +28,15 @@ class TypeWithDefault(type):
cls._default = copy.copy(default) cls._default = copy.copy(default)
class Configuration(with_metaclass(TypeWithDefault, object)): class Configuration(six.with_metaclass(TypeWithDefault, object)):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Ref: https://github.com/swagger-api/swagger-codegen Ref: https://github.com/swagger-api/swagger-codegen
Do not edit the class manually. Do not edit the class manually.
""" """
def __init__(self): def __init__(self):
""" """Constructor"""
Constructor
"""
# Default Base url # Default Base url
self.host = "{{{basePath}}}" self.host = "{{{basePath}}}"
# Temp file folder for downloading files # Temp file folder for downloading files
@ -74,7 +71,8 @@ class Configuration(with_metaclass(TypeWithDefault, object)):
self.debug = False self.debug = False
# SSL/TLS verification # SSL/TLS verification
# Set this to false to skip verifying SSL certificate when calling API from https server. # Set this to false to skip verifying SSL certificate when calling API
# from https server.
self.verify_ssl = True self.verify_ssl = True
# Set this to customize the certificate file to verify the peer. # Set this to customize the certificate file to verify the peer.
self.ssl_ca_cert = None self.ssl_ca_cert = None
@ -92,7 +90,6 @@ class Configuration(with_metaclass(TypeWithDefault, object)):
# cpu_count * 5 is used as default value to increase performance. # cpu_count * 5 is used as default value to increase performance.
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
# Proxy URL # Proxy URL
self.proxy = None self.proxy = None
# Safe chars for path_param # Safe chars for path_param
@ -102,8 +99,8 @@ class Configuration(with_metaclass(TypeWithDefault, object)):
def logger_file(self): def logger_file(self):
"""The logger file. """The logger file.
If the logger_file is None, then add stream handler and remove file handler. If the logger_file is None, then add stream handler and remove file
Otherwise, add file handler and remove stream handler. handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path. :param value: The logger_file path.
:type: str :type: str
@ -114,8 +111,8 @@ class Configuration(with_metaclass(TypeWithDefault, object)):
def logger_file(self, value): def logger_file(self, value):
"""The logger file. """The logger file.
If the logger_file is None, then add stream handler and remove file handler. If the logger_file is None, then add stream handler and remove file
Otherwise, add file handler and remove stream handler. handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path. :param value: The logger_file path.
:type: str :type: str
@ -126,7 +123,7 @@ class Configuration(with_metaclass(TypeWithDefault, object)):
# then add file handler and remove stream handler. # then add file handler and remove stream handler.
self.logger_file_handler = logging.FileHandler(self.__logger_file) self.logger_file_handler = logging.FileHandler(self.__logger_file)
self.logger_file_handler.setFormatter(self.logger_formatter) self.logger_file_handler.setFormatter(self.logger_formatter)
for _, logger in iteritems(self.logger): for _, logger in six.iteritems(self.logger):
logger.addHandler(self.logger_file_handler) logger.addHandler(self.logger_file_handler)
if self.logger_stream_handler: if self.logger_stream_handler:
logger.removeHandler(self.logger_stream_handler) logger.removeHandler(self.logger_stream_handler)
@ -135,7 +132,7 @@ class Configuration(with_metaclass(TypeWithDefault, object)):
# then add stream handler and remove file handler. # then add stream handler and remove file handler.
self.logger_stream_handler = logging.StreamHandler() self.logger_stream_handler = logging.StreamHandler()
self.logger_stream_handler.setFormatter(self.logger_formatter) self.logger_stream_handler.setFormatter(self.logger_formatter)
for _, logger in iteritems(self.logger): for _, logger in six.iteritems(self.logger):
logger.addHandler(self.logger_stream_handler) logger.addHandler(self.logger_stream_handler)
if self.logger_file_handler: if self.logger_file_handler:
logger.removeHandler(self.logger_file_handler) logger.removeHandler(self.logger_file_handler)
@ -159,14 +156,14 @@ class Configuration(with_metaclass(TypeWithDefault, object)):
self.__debug = value self.__debug = value
if self.__debug: if self.__debug:
# if debug status is True, turn on debug logging # if debug status is True, turn on debug logging
for _, logger in iteritems(self.logger): for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.DEBUG) logger.setLevel(logging.DEBUG)
# turn on httplib debug # turn on httplib debug
httplib.HTTPConnection.debuglevel = 1 httplib.HTTPConnection.debuglevel = 1
else: else:
# if debug status is False, turn off debug logging, # if debug status is False, turn off debug logging,
# setting log level to default `logging.WARNING` # setting log level to default `logging.WARNING`
for _, logger in iteritems(self.logger): for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.WARNING) logger.setLevel(logging.WARNING)
# turn off httplib debug # turn off httplib debug
httplib.HTTPConnection.debuglevel = 0 httplib.HTTPConnection.debuglevel = 0
@ -200,8 +197,9 @@ class Configuration(with_metaclass(TypeWithDefault, object)):
:param identifier: The identifier of apiKey. :param identifier: The identifier of apiKey.
:return: The token for api key authentication. :return: The token for api key authentication.
""" """
if self.api_key.get(identifier) and self.api_key_prefix.get(identifier): if (self.api_key.get(identifier) and
return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] self.api_key_prefix.get(identifier)):
return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501
elif self.api_key.get(identifier): elif self.api_key.get(identifier):
return self.api_key[identifier] return self.api_key[identifier]
@ -210,8 +208,9 @@ class Configuration(with_metaclass(TypeWithDefault, object)):
:return: The token for basic HTTP authentication. :return: The token for basic HTTP authentication.
""" """
return urllib3.util.make_headers(basic_auth=self.username + ':' + self.password)\ return urllib3.util.make_headers(
.get('authorization') basic_auth=self.username + ':' + self.password
).get('authorization')
def auth_settings(self): def auth_settings(self):
"""Gets Auth Settings dict for api client. """Gets Auth Settings dict for api client.

View File

@ -2,27 +2,31 @@
{{>partial_header}} {{>partial_header}}
import pprint
import re # noqa: F401
import six
{{#imports}}{{#-first}}
{{/-first}}
{{import}} # noqa: F401,E501
{{/imports}}
{{#models}} {{#models}}
{{#model}} {{#model}}
from pprint import pformat
from six import iteritems
import re
class {{classname}}(object): class {{classname}}(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """{{#allowableValues}}
{{#allowableValues}}
""" """
allowed enum values allowed enum values
""" """
{{#enumVars}} {{#enumVars}}
{{name}} = {{{value}}} {{name}} = {{{value}}}{{^-last}}
{{/enumVars}} {{/-last}}
{{/allowableValues}} {{/enumVars}}{{/allowableValues}}
""" """
Attributes: Attributes:
@ -32,96 +36,96 @@ class {{classname}}(object):
and the value is json key in definition. and the value is json key in definition.
""" """
swagger_types = { swagger_types = {
{{#vars}}'{{name}}': '{{{datatype}}}'{{#hasMore}}, {{#vars}}
{{/hasMore}}{{/vars}} '{{name}}': '{{{datatype}}}'{{#hasMore}},{{/hasMore}}
{{/vars}}
} }
attribute_map = { attribute_map = {
{{#vars}}'{{name}}': '{{baseName}}'{{#hasMore}}, {{#vars}}
{{/hasMore}}{{/vars}} '{{name}}': '{{baseName}}'{{#hasMore}},{{/hasMore}}
{{/vars}}
} }
{{#discriminator}} {{#discriminator}}
discriminator_value_class_map = { discriminator_value_class_map = {
{{#children}}'{{vendorExtensions.x-discriminator-value}}': '{{{classname}}}'{{^-last}}, {{#children}}'{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}': '{{{classname}}}'{{^-last}},
{{/-last}}{{/children}} {{/-last}}{{/children}}
} }
{{/discriminator}} {{/discriminator}}
def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}): def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}): # noqa: E501
""" """{{classname}} - a model defined in Swagger""" # noqa: E501
{{classname}} - a model defined in Swagger {{#vars}}{{#-first}}
""" {{/-first}}
{{#vars}}
self._{{name}} = None self._{{name}} = None
{{/vars}} {{/vars}}
self.discriminator = {{#discriminator}}'{{discriminator}}'{{/discriminator}}{{^discriminator}}None{{/discriminator}} self.discriminator = {{#discriminator}}'{{discriminator}}'{{/discriminator}}{{^discriminator}}None{{/discriminator}}
{{#vars}}{{#-first}}
{{#vars}} {{/-first}}
{{#required}} {{#required}}
self.{{name}} = {{name}} self.{{name}} = {{name}}
{{/required}} {{/required}}
{{^required}} {{^required}}
if {{name}} is not None: if {{name}} is not None:
self.{{name}} = {{name}} self.{{name}} = {{name}}
{{/required}} {{/required}}
{{/vars}} {{/vars}}
{{#vars}} {{#vars}}
@property @property
def {{name}}(self): def {{name}}(self):
""" """Gets the {{name}} of this {{classname}}. # noqa: E501
Gets the {{name}} of this {{classname}}.
{{#description}} {{#description}}
{{{description}}} {{{description}}} # noqa: E501
{{/description}} {{/description}}
:return: The {{name}} of this {{classname}}. :return: The {{name}} of this {{classname}}. # noqa: E501
:rtype: {{datatype}} :rtype: {{datatype}}
""" """
return self._{{name}} return self._{{name}}
@{{name}}.setter @{{name}}.setter
def {{name}}(self, {{name}}): def {{name}}(self, {{name}}):
""" """Sets the {{name}} of this {{classname}}.
Sets the {{name}} of this {{classname}}.
{{#description}} {{#description}}
{{{description}}} {{{description}}} # noqa: E501
{{/description}} {{/description}}
:param {{name}}: The {{name}} of this {{classname}}. :param {{name}}: The {{name}} of this {{classname}}. # noqa: E501
:type: {{datatype}} :type: {{datatype}}
""" """
{{#required}} {{#required}}
if {{name}} is None: if {{name}} is None:
raise ValueError("Invalid value for `{{name}}`, must not be `None`") raise ValueError("Invalid value for `{{name}}`, must not be `None`") # noqa: E501
{{/required}} {{/required}}
{{#isEnum}} {{#isEnum}}
{{#isContainer}} {{#isContainer}}
allowed_values = [{{#allowableValues}}{{#values}}{{#items.isString}}"{{/items.isString}}{{{this}}}{{#items.isString}}"{{/items.isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] allowed_values = [{{#allowableValues}}{{#values}}{{#items.isString}}"{{/items.isString}}{{{this}}}{{#items.isString}}"{{/items.isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501
{{#isListContainer}} {{#isListContainer}}
if not set({{{name}}}).issubset(set(allowed_values)): if not set({{{name}}}).issubset(set(allowed_values)):
raise ValueError( raise ValueError(
"Invalid values for `{{{name}}}` [{0}], must be a subset of [{1}]" "Invalid values for `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501
.format(", ".join(map(str, set({{{name}}})-set(allowed_values))), .format(", ".join(map(str, set({{{name}}}) - set(allowed_values))), # noqa: E501
", ".join(map(str, allowed_values))) ", ".join(map(str, allowed_values)))
) )
{{/isListContainer}} {{/isListContainer}}
{{#isMapContainer}} {{#isMapContainer}}
if not set({{{name}}}.keys()).issubset(set(allowed_values)): if not set({{{name}}}.keys()).issubset(set(allowed_values)):
raise ValueError( raise ValueError(
"Invalid keys in `{{{name}}}` [{0}], must be a subset of [{1}]" "Invalid keys in `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501
.format(", ".join(map(str, set({{{name}}}.keys())-set(allowed_values))), .format(", ".join(map(str, set({{{name}}}.keys()) - set(allowed_values))), # noqa: E501
", ".join(map(str, allowed_values))) ", ".join(map(str, allowed_values)))
) )
{{/isMapContainer}} {{/isMapContainer}}
{{/isContainer}} {{/isContainer}}
{{^isContainer}} {{^isContainer}}
allowed_values = [{{#allowableValues}}{{#values}}{{#isString}}"{{/isString}}{{{this}}}{{#isString}}"{{/isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] allowed_values = [{{#allowableValues}}{{#values}}{{#isString}}"{{/isString}}{{{this}}}{{#isString}}"{{/isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501
if {{{name}}} not in allowed_values: if {{{name}}} not in allowed_values:
raise ValueError( raise ValueError(
"Invalid value for `{{{name}}}` ({0}), must be one of {1}" "Invalid value for `{{{name}}}` ({0}), must be one of {1}" # noqa: E501
.format({{{name}}}, allowed_values) .format({{{name}}}, allowed_values)
) )
{{/isContainer}} {{/isContainer}}
@ -130,31 +134,31 @@ class {{classname}}(object):
{{#hasValidation}} {{#hasValidation}}
{{#maxLength}} {{#maxLength}}
if {{name}} is not None and len({{name}}) > {{maxLength}}: if {{name}} is not None and len({{name}}) > {{maxLength}}:
raise ValueError("Invalid value for `{{name}}`, length must be less than or equal to `{{maxLength}}`") raise ValueError("Invalid value for `{{name}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501
{{/maxLength}} {{/maxLength}}
{{#minLength}} {{#minLength}}
if {{name}} is not None and len({{name}}) < {{minLength}}: if {{name}} is not None and len({{name}}) < {{minLength}}:
raise ValueError("Invalid value for `{{name}}`, length must be greater than or equal to `{{minLength}}`") raise ValueError("Invalid value for `{{name}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501
{{/minLength}} {{/minLength}}
{{#maximum}} {{#maximum}}
if {{name}} is not None and {{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}: if {{name}} is not None and {{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}: # noqa: E501
raise ValueError("Invalid value for `{{name}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") raise ValueError("Invalid value for `{{name}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501
{{/maximum}} {{/maximum}}
{{#minimum}} {{#minimum}}
if {{name}} is not None and {{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}: if {{name}} is not None and {{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}: # noqa: E501
raise ValueError("Invalid value for `{{name}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") raise ValueError("Invalid value for `{{name}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501
{{/minimum}} {{/minimum}}
{{#pattern}} {{#pattern}}
if {{name}} is not None and not re.search('{{{vendorExtensions.x-regex}}}', {{name}}{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): if {{name}} is not None and not re.search('{{{vendorExtensions.x-regex}}}', {{name}}{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501
raise ValueError("Invalid value for `{{name}}`, must be a follow pattern or equal to `{{{pattern}}}`") raise ValueError("Invalid value for `{{name}}`, must be a follow pattern or equal to `{{{pattern}}}`") # noqa: E501
{{/pattern}} {{/pattern}}
{{#maxItems}} {{#maxItems}}
if {{name}} is not None and len({{name}}) > {{maxItems}}: if {{name}} is not None and len({{name}}) > {{maxItems}}:
raise ValueError("Invalid value for `{{name}}`, number of items must be less than or equal to `{{maxItems}}`") raise ValueError("Invalid value for `{{name}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501
{{/maxItems}} {{/maxItems}}
{{#minItems}} {{#minItems}}
if {{name}} is not None and len({{name}}) < {{minItems}}: if {{name}} is not None and len({{name}}) < {{minItems}}:
raise ValueError("Invalid value for `{{name}}`, number of items must be greater than or equal to `{{minItems}}`") raise ValueError("Invalid value for `{{name}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501
{{/minItems}} {{/minItems}}
{{/hasValidation}} {{/hasValidation}}
{{/isEnum}} {{/isEnum}}
@ -164,23 +168,16 @@ class {{classname}}(object):
{{/vars}} {{/vars}}
{{#discriminator}} {{#discriminator}}
def get_real_child_model(self, data): def get_real_child_model(self, data):
""" """Returns the real base class specified by the discriminator"""
Returns the real base class specified by the discriminator
"""
discriminator_value = data[self.discriminator].lower() discriminator_value = data[self.discriminator].lower()
if self.discriminator_value_class_map.has_key(discriminator_value): return self.discriminator_value_class_map.get(discriminator_value)
return self.discriminator_value_class_map[discriminator_value]
else:
return None
{{/discriminator}} {{/discriminator}}
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -201,30 +198,22 @@ class {{classname}}(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, {{classname}}): if not isinstance(other, {{classname}}):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other
{{/model}} {{/model}}
{{/models}} {{/models}}

View File

@ -4,19 +4,17 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
{{#models}} {{#models}}
{{#model}} {{#model}}
import {{packageName}} import {{packageName}}
from {{modelPackage}}.{{classFilename}} import {{classname}} # noqa: E501
from {{packageName}}.rest import ApiException from {{packageName}}.rest import ApiException
from {{packageName}}.models.{{classFilename}} import {{classname}}
class Test{{classname}}(unittest.TestCase): class Test{{classname}}(unittest.TestCase):
""" {{classname}} unit test stubs """ """{{classname}} unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -25,11 +23,9 @@ class Test{{classname}}(unittest.TestCase):
pass pass
def test{{classname}}(self): def test{{classname}}(self):
""" """Test {{classname}}"""
Test {{classname}}
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = {{packageName}}.models.{{classFilename}}.{{classname}}() # model = {{packageName}}.models.{{classFilename}}.{{classname}}() # noqa: E501
pass pass
{{/model}} {{/model}}

View File

@ -4,7 +4,7 @@
{{/appName}} {{/appName}}
{{#appDescription}} {{#appDescription}}
{{{appDescription}}} {{{appDescription}}} # noqa: E501
{{/appDescription}} {{/appDescription}}
{{#version}}OpenAPI spec version: {{{version}}}{{/version}} {{#version}}OpenAPI spec version: {{{version}}}{{/version}}

View File

@ -6,13 +6,13 @@ from __future__ import absolute_import
import io import io
import json import json
import ssl
import certifi
import logging import logging
import re import re
import ssl
import certifi
# python 2 and python 3 compatibility library # python 2 and python 3 compatibility library
from six import PY3 import six
from six.moves.urllib.parse import urlencode from six.moves.urllib.parse import urlencode
try: try:
@ -33,15 +33,11 @@ class RESTResponse(io.IOBase):
self.data = resp.data self.data = resp.data
def getheaders(self): def getheaders(self):
""" """Returns a dictionary of the response headers."""
Returns a dictionary of the response headers.
"""
return self.urllib3_response.getheaders() return self.urllib3_response.getheaders()
def getheader(self, name, default=None): def getheader(self, name, default=None):
""" """Returns a given response header."""
Returns a given response header.
"""
return self.urllib3_response.getheader(name, default) return self.urllib3_response.getheader(name, default)
@ -49,10 +45,10 @@ class RESTClientObject(object):
def __init__(self, configuration, pools_size=4, maxsize=None): def __init__(self, configuration, pools_size=4, maxsize=None):
# urllib3.PoolManager will pass all kw parameters to connectionpool # urllib3.PoolManager will pass all kw parameters to connectionpool
# https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501
# https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501
# maxsize is the number of requests to host that are allowed in parallel # maxsize is the number of requests to host that are allowed in parallel # noqa: E501
# Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501
# cert_reqs # cert_reqs
if configuration.verify_ssl: if configuration.verify_ssl:
@ -69,7 +65,7 @@ class RESTClientObject(object):
addition_pool_args = {} addition_pool_args = {}
if configuration.assert_hostname is not None: if configuration.assert_hostname is not None:
addition_pool_args['assert_hostname'] = configuration.assert_hostname addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
if maxsize is None: if maxsize is None:
if configuration.connection_pool_maxsize is not None: if configuration.connection_pool_maxsize is not None:
@ -101,8 +97,10 @@ class RESTClientObject(object):
) )
def request(self, method, url, query_params=None, headers=None, def request(self, method, url, query_params=None, headers=None,
body=None, post_params=None, _preload_content=True, _request_timeout=None): body=None, post_params=None, _preload_content=True,
""" _request_timeout=None):
"""Perform requests.
:param method: http request method :param method: http request method
:param url: http request url :param url: http request url
:param query_params: query parameters in the url :param query_params: query parameters in the url
@ -111,13 +109,17 @@ class RESTClientObject(object):
:param post_params: request post parameters, :param post_params: request post parameters,
`application/x-www-form-urlencoded` `application/x-www-form-urlencoded`
and `multipart/form-data` and `multipart/form-data`
:param _preload_content: if False, the urllib3.HTTPResponse object will be returned without :param _preload_content: if False, the urllib3.HTTPResponse object will
reading/decoding response data. Default is True. be returned without reading/decoding response
:param _request_timeout: timeout setting for this request. If one number provided, it will be total request data. Default is True.
timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
""" """
method = method.upper() method = method.upper()
assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', 'PATCH', 'OPTIONS'] assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
'PATCH', 'OPTIONS']
if post_params and body: if post_params and body:
raise ValueError( raise ValueError(
@ -129,10 +131,12 @@ class RESTClientObject(object):
timeout = None timeout = None
if _request_timeout: if _request_timeout:
if isinstance(_request_timeout, (int, ) if PY3 else (int, long)): if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821
timeout = urllib3.Timeout(total=_request_timeout) timeout = urllib3.Timeout(total=_request_timeout)
elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2: elif (isinstance(_request_timeout, tuple) and
timeout = urllib3.Timeout(connect=_request_timeout[0], read=_request_timeout[1]) len(_request_timeout) == 2):
timeout = urllib3.Timeout(
connect=_request_timeout[0], read=_request_timeout[1])
if 'Content-Type' not in headers: if 'Content-Type' not in headers:
headers['Content-Type'] = 'application/json' headers['Content-Type'] = 'application/json'
@ -146,42 +150,48 @@ class RESTClientObject(object):
request_body = None request_body = None
if body is not None: if body is not None:
request_body = json.dumps(body) request_body = json.dumps(body)
r = self.pool_manager.request(method, url, r = self.pool_manager.request(
body=request_body, method, url,
preload_content=_preload_content, body=request_body,
timeout=timeout, preload_content=_preload_content,
headers=headers) timeout=timeout,
elif headers['Content-Type'] == 'application/x-www-form-urlencoded': headers=headers)
r = self.pool_manager.request(method, url, elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
fields=post_params, r = self.pool_manager.request(
encode_multipart=False, method, url,
preload_content=_preload_content, fields=post_params,
timeout=timeout, encode_multipart=False,
headers=headers) preload_content=_preload_content,
timeout=timeout,
headers=headers)
elif headers['Content-Type'] == 'multipart/form-data': elif headers['Content-Type'] == 'multipart/form-data':
# must del headers['Content-Type'], or the correct Content-Type # must del headers['Content-Type'], or the correct
# which generated by urllib3 will be overwritten. # Content-Type which generated by urllib3 will be
# overwritten.
del headers['Content-Type'] del headers['Content-Type']
r = self.pool_manager.request(method, url, r = self.pool_manager.request(
fields=post_params, method, url,
encode_multipart=True, fields=post_params,
preload_content=_preload_content, encode_multipart=True,
timeout=timeout, preload_content=_preload_content,
headers=headers) timeout=timeout,
headers=headers)
# Pass a `string` parameter directly in the body to support # Pass a `string` parameter directly in the body to support
# other content types than Json when `body` argument is provided # other content types than Json when `body` argument is
# in serialized form # provided in serialized form
elif isinstance(body, str): elif isinstance(body, str):
request_body = body request_body = body
r = self.pool_manager.request(method, url, r = self.pool_manager.request(
body=request_body, method, url,
preload_content=_preload_content, body=request_body,
timeout=timeout, preload_content=_preload_content,
headers=headers) timeout=timeout,
headers=headers)
else: else:
# Cannot generate the request from given parameters # Cannot generate the request from given parameters
msg = """Cannot prepare a request message for provided arguments. msg = """Cannot prepare a request message for provided
Please check that your arguments match declared content type.""" arguments. Please check that your arguments match
declared content type."""
raise ApiException(status=0, reason=msg) raise ApiException(status=0, reason=msg)
# For `GET`, `HEAD` # For `GET`, `HEAD`
else: else:
@ -199,7 +209,7 @@ class RESTClientObject(object):
# In the python 3, the response.data is bytes. # In the python 3, the response.data is bytes.
# we need to decode it to string. # we need to decode it to string.
if PY3: if six.PY3:
r.data = r.data.decode('utf8') r.data = r.data.decode('utf8')
# log response body # log response body
@ -210,22 +220,24 @@ class RESTClientObject(object):
return r return r
def GET(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): def GET(self, url, headers=None, query_params=None, _preload_content=True,
_request_timeout=None):
return self.request("GET", url, return self.request("GET", url,
headers=headers, headers=headers,
_preload_content=_preload_content, _preload_content=_preload_content,
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
query_params=query_params) query_params=query_params)
def HEAD(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): def HEAD(self, url, headers=None, query_params=None, _preload_content=True,
_request_timeout=None):
return self.request("HEAD", url, return self.request("HEAD", url,
headers=headers, headers=headers,
_preload_content=_preload_content, _preload_content=_preload_content,
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
query_params=query_params) query_params=query_params)
def OPTIONS(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, def OPTIONS(self, url, headers=None, query_params=None, post_params=None,
_request_timeout=None): body=None, _preload_content=True, _request_timeout=None):
return self.request("OPTIONS", url, return self.request("OPTIONS", url,
headers=headers, headers=headers,
query_params=query_params, query_params=query_params,
@ -234,7 +246,8 @@ class RESTClientObject(object):
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
body=body) body=body)
def DELETE(self, url, headers=None, query_params=None, body=None, _preload_content=True, _request_timeout=None): def DELETE(self, url, headers=None, query_params=None, body=None,
_preload_content=True, _request_timeout=None):
return self.request("DELETE", url, return self.request("DELETE", url,
headers=headers, headers=headers,
query_params=query_params, query_params=query_params,
@ -242,8 +255,8 @@ class RESTClientObject(object):
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
body=body) body=body)
def POST(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, def POST(self, url, headers=None, query_params=None, post_params=None,
_request_timeout=None): body=None, _preload_content=True, _request_timeout=None):
return self.request("POST", url, return self.request("POST", url,
headers=headers, headers=headers,
query_params=query_params, query_params=query_params,
@ -252,8 +265,8 @@ class RESTClientObject(object):
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
body=body) body=body)
def PUT(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, def PUT(self, url, headers=None, query_params=None, post_params=None,
_request_timeout=None): body=None, _preload_content=True, _request_timeout=None):
return self.request("PUT", url, return self.request("PUT", url,
headers=headers, headers=headers,
query_params=query_params, query_params=query_params,
@ -262,8 +275,8 @@ class RESTClientObject(object):
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
body=body) body=body)
def PATCH(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, def PATCH(self, url, headers=None, query_params=None, post_params=None,
_request_timeout=None): body=None, _preload_content=True, _request_timeout=None):
return self.request("PATCH", url, return self.request("PATCH", url,
headers=headers, headers=headers,
query_params=query_params, query_params=query_params,
@ -288,13 +301,12 @@ class ApiException(Exception):
self.headers = None self.headers = None
def __str__(self): def __str__(self):
""" """Custom error messages for exception"""
Custom error messages for exception
"""
error_message = "({0})\n"\ error_message = "({0})\n"\
"Reason: {1}\n".format(self.status, self.reason) "Reason: {1}\n".format(self.status, self.reason)
if self.headers: if self.headers:
error_message += "HTTP response headers: {0}\n".format(self.headers) error_message += "HTTP response headers: {0}\n".format(
self.headers)
if self.body: if self.body:
error_message += "HTTP response body: {0}\n".format(self.body) error_message += "HTTP response body: {0}\n".format(self.body)

View File

@ -2,8 +2,7 @@
{{>partial_header}} {{>partial_header}}
import sys from setuptools import setup, find_packages # noqa: H301
from setuptools import setup, find_packages
NAME = "{{{projectName}}}" NAME = "{{{projectName}}}"
VERSION = "{{packageVersion}}" VERSION = "{{packageVersion}}"
@ -36,7 +35,7 @@ setup(
packages=find_packages(), packages=find_packages(),
include_package_data=True, include_package_data=True,
long_description="""\ long_description="""\
{{appDescription}} {{appDescription}} # noqa: E501
""" """
) )
{{/hasMore}} {{/hasMore}}

View File

@ -4,17 +4,16 @@
import io import io
import json import json
import ssl
import certifi
import logging import logging
import re import re
import ssl
import certifi
# python 2 and python 3 compatibility library
from six.moves.urllib.parse import urlencode
import tornado import tornado
import tornado.gen import tornado.gen
from tornado.httpclient import AsyncHTTPClient, HTTPRequest from tornado import httpclient
# python 2 and python 3 compatibility library
from six import PY3
from six.moves.urllib.parse import urlencode
from urllib3.filepost import encode_multipart_formdata from urllib3.filepost import encode_multipart_formdata
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -29,22 +28,18 @@ class RESTResponse(io.IOBase):
self.data = data self.data = data
def getheaders(self): def getheaders(self):
""" """Returns a CIMultiDictProxy of the response headers."""
Returns a CIMultiDictProxy of the response headers.
"""
return self.tornado_response.headers return self.tornado_response.headers
def getheader(self, name, default=None): def getheader(self, name, default=None):
""" """Returns a given response header."""
Returns a given response header.
"""
return self.tornado_response.headers.get(name, default) return self.tornado_response.headers.get(name, default)
class RESTClientObject: class RESTClientObject(object):
def __init__(self, configuration, pools_size=4, maxsize=4): def __init__(self, configuration, pools_size=4, maxsize=4):
# maxsize is the number of requests to host that are allowed in parallel # maxsize is number of requests to host that are allowed in parallel
# ca_certs vs cert_file vs key_file # ca_certs vs cert_file vs key_file
# http://stackoverflow.com/a/23957365/2985775 # http://stackoverflow.com/a/23957365/2985775
@ -55,9 +50,10 @@ class RESTClientObject:
# if not set certificate file, use Mozilla's root certificates. # if not set certificate file, use Mozilla's root certificates.
ca_certs = certifi.where() ca_certs = certifi.where()
self.ssl_context = ssl_context = ssl.SSLContext() self.ssl_context = ssl.SSLContext()
self.ssl_context.load_verify_locations(cafile=ca_certs)
if configuration.cert_file: if configuration.cert_file:
ssl_context.load_cert_chain( self.ssl_context.load_cert_chain(
configuration.cert_file, keyfile=configuration.key_file configuration.cert_file, keyfile=configuration.key_file
) )
@ -68,12 +64,14 @@ class RESTClientObject:
self.proxy_port = 80 self.proxy_port = 80
self.proxy_host = configuration.proxy self.proxy_host = configuration.proxy
self.pool_manager = AsyncHTTPClient() self.pool_manager = httpclient.AsyncHTTPClient()
@tornado.gen.coroutine @tornado.gen.coroutine
def request(self, method, url, query_params=None, headers=None, def request(self, method, url, query_params=None, headers=None, body=None,
body=None, post_params=None, _preload_content=True, _request_timeout=None): post_params=None, _preload_content=True,
""" _request_timeout=None):
"""Execute Request
:param method: http request method :param method: http request method
:param url: http request url :param url: http request url
:param query_params: query parameters in the url :param query_params: query parameters in the url
@ -82,19 +80,23 @@ class RESTClientObject:
:param post_params: request post parameters, :param post_params: request post parameters,
`application/x-www-form-urlencoded` `application/x-www-form-urlencoded`
and `multipart/form-data` and `multipart/form-data`
:param _preload_content: this is a non-applicable field for the AiohttpClient. :param _preload_content: this is a non-applicable field for
:param _request_timeout: timeout setting for this request. If one number provided, it will be total request the AiohttpClient.
timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
""" """
method = method.upper() method = method.upper()
assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', 'PATCH', 'OPTIONS'] assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
'PATCH', 'OPTIONS']
if post_params and body: if post_params and body:
raise ValueError( raise ValueError(
"body parameter cannot be used with post_params parameter." "body parameter cannot be used with post_params parameter."
) )
request = HTTPRequest(url) request = httpclient.HTTPRequest(url)
request.ssl_context = self.ssl_context request.ssl_context = self.ssl_context
request.proxy_host = self.proxy_host request.proxy_host = self.proxy_host
request.proxy_port = self.proxy_port request.proxy_port = self.proxy_port
@ -105,7 +107,6 @@ class RESTClientObject:
request.headers['Content-Type'] = 'application/json' request.headers['Content-Type'] = 'application/json'
request.request_timeout = _request_timeout or 5 * 60 request.request_timeout = _request_timeout or 5 * 60
post_params = post_params or {} post_params = post_params or {}
if query_params: if query_params:
@ -117,9 +118,8 @@ class RESTClientObject:
if body: if body:
body = json.dumps(body) body = json.dumps(body)
request.body = body request.body = body
elif headers['Content-Type'] == 'application/x-www-form-urlencoded': elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
request.body = urlencode(post_params) request.body = urlencode(post_params)
# TODO: transform to multipart form
elif headers['Content-Type'] == 'multipart/form-data': elif headers['Content-Type'] == 'multipart/form-data':
request.body = encode_multipart_formdata(post_params) request.body = encode_multipart_formdata(post_params)
# Pass a `bytes` parameter directly in the body to support # Pass a `bytes` parameter directly in the body to support
@ -129,8 +129,9 @@ class RESTClientObject:
request.body = body request.body = body
else: else:
# Cannot generate the request from given parameters # Cannot generate the request from given parameters
msg = """Cannot prepare a request message for provided arguments. msg = """Cannot prepare a request message for provided
Please check that your arguments match declared content type.""" arguments. Please check that your arguments match
declared content type."""
raise ApiException(status=0, reason=msg) raise ApiException(status=0, reason=msg)
r = yield self.pool_manager.fetch(request) r = yield self.pool_manager.fetch(request)
@ -142,40 +143,41 @@ class RESTClientObject:
if not 200 <= r.status <= 299: if not 200 <= r.status <= 299:
raise ApiException(http_resp=r) raise ApiException(http_resp=r)
return r
@tornado.gen.coroutine @tornado.gen.coroutine
def GET(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): def GET(self, url, headers=None, query_params=None, _preload_content=True,
_request_timeout=None):
result = yield self.request("GET", url, result = yield self.request("GET", url,
headers=headers, headers=headers,
_preload_content=_preload_content, _preload_content=_preload_content,
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
query_params=query_params) query_params=query_params)
raise tornado.gen.Return(result) raise tornado.gen.Return(result)
@tornado.gen.coroutine @tornado.gen.coroutine
def HEAD(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): def HEAD(self, url, headers=None, query_params=None, _preload_content=True,
_request_timeout=None):
result = yield self.request("HEAD", url, result = yield self.request("HEAD", url,
headers=headers, headers=headers,
_preload_content=_preload_content, _preload_content=_preload_content,
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
query_params=query_params) query_params=query_params)
raise tornado.gen.Return(result) raise tornado.gen.Return(result)
@tornado.gen.coroutine @tornado.gen.coroutine
def OPTIONS(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, def OPTIONS(self, url, headers=None, query_params=None, post_params=None,
_request_timeout=None): body=None, _preload_content=True, _request_timeout=None):
result = yield self.request("OPTIONS", url, result = yield self.request("OPTIONS", url,
headers=headers, headers=headers,
query_params=query_params, query_params=query_params,
post_params=post_params, post_params=post_params,
_preload_content=_preload_content, _preload_content=_preload_content,
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
body=body) body=body)
raise tornado.gen.Return(result) raise tornado.gen.Return(result)
@tornado.gen.coroutine @tornado.gen.coroutine
def DELETE(self, url, headers=None, query_params=None, body=None, _preload_content=True, _request_timeout=None): def DELETE(self, url, headers=None, query_params=None, body=None,
_preload_content=True, _request_timeout=None):
result = yield self.request("DELETE", url, result = yield self.request("DELETE", url,
headers=headers, headers=headers,
query_params=query_params, query_params=query_params,
@ -185,39 +187,39 @@ class RESTClientObject:
raise tornado.gen.Return(result) raise tornado.gen.Return(result)
@tornado.gen.coroutine @tornado.gen.coroutine
def POST(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, def POST(self, url, headers=None, query_params=None, post_params=None,
_request_timeout=None): body=None, _preload_content=True, _request_timeout=None):
result = yield self.request("POST", url, result = yield self.request("POST", url,
headers=headers, headers=headers,
query_params=query_params, query_params=query_params,
post_params=post_params, post_params=post_params,
_preload_content=_preload_content, _preload_content=_preload_content,
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
body=body) body=body)
raise tornado.gen.Return(result) raise tornado.gen.Return(result)
@tornado.gen.coroutine @tornado.gen.coroutine
def PUT(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, def PUT(self, url, headers=None, query_params=None, post_params=None,
_request_timeout=None): body=None, _preload_content=True, _request_timeout=None):
result = yield self.request("PUT", url, result = yield self.request("PUT", url,
headers=headers, headers=headers,
query_params=query_params, query_params=query_params,
post_params=post_params, post_params=post_params,
_preload_content=_preload_content, _preload_content=_preload_content,
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
body=body) body=body)
raise tornado.gen.Return(result) raise tornado.gen.Return(result)
@tornado.gen.coroutine @tornado.gen.coroutine
def PATCH(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, def PATCH(self, url, headers=None, query_params=None, post_params=None,
_request_timeout=None): body=None, _preload_content=True, _request_timeout=None):
result = yield self.request("PATCH", url, result = yield self.request("PATCH", url,
headers=headers, headers=headers,
query_params=query_params, query_params=query_params,
post_params=post_params, post_params=post_params,
_preload_content=_preload_content, _preload_content=_preload_content,
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
body=body) body=body)
raise tornado.gen.Return(result) raise tornado.gen.Return(result)
@ -236,13 +238,12 @@ class ApiException(Exception):
self.headers = None self.headers = None
def __str__(self): def __str__(self):
""" """Custom error messages for exception"""
Custom error messages for exception error_message = "({0})\nReason: {1}\n".format(
""" self.status, self.reason)
error_message = "({0})\n"\
"Reason: {1}\n".format(self.status, self.reason)
if self.headers: if self.headers:
error_message += "HTTP response headers: {0}\n".format(self.headers) error_message += "HTTP response headers: {0}\n".format(
self.headers)
if self.body: if self.body:
error_message += "HTTP response body: {0}\n".format(self.body) error_message += "HTTP response body: {0}\n".format(self.body)

View File

@ -77,6 +77,7 @@ Class | Method | HTTP request | Description
*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \&quot;client\&quot; model *FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \&quot;client\&quot; model
*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters *FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters
*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case
*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store

View File

@ -4,7 +4,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**map_property** | **dict(str, str)** | | [optional] **map_property** | **dict(str, str)** | | [optional]
**map_of_map_property** | [**dict(str, dict(str, str))**](dict.md) | | [optional] **map_of_map_property** | **dict(str, dict(str, str))** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -14,7 +14,7 @@ To test special tags
To test special tags To test special tags
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -26,7 +26,7 @@ from pprint import pprint
api_instance = petstore_api.AnotherFakeApi() api_instance = petstore_api.AnotherFakeApi()
body = petstore_api.Client() # Client | client model body = petstore_api.Client() # Client | client model
try: try:
# To test special tags # To test special tags
api_response = api_instance.test_special_tags(body) api_response = api_instance.test_special_tags(body)
pprint(api_response) pprint(api_response)

View File

@ -11,6 +11,7 @@ Method | HTTP request | Description
[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \&quot;client\&quot; model [**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \&quot;client\&quot; model
[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters [**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters
[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
@ -21,7 +22,7 @@ Method | HTTP request | Description
Test serialization of outer boolean types Test serialization of outer boolean types
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -33,7 +34,7 @@ from pprint import pprint
api_instance = petstore_api.FakeApi() api_instance = petstore_api.FakeApi()
body = petstore_api.OuterBoolean() # OuterBoolean | Input boolean as post body (optional) body = petstore_api.OuterBoolean() # OuterBoolean | Input boolean as post body (optional)
try: try:
api_response = api_instance.fake_outer_boolean_serialize(body=body) api_response = api_instance.fake_outer_boolean_serialize(body=body)
pprint(api_response) pprint(api_response)
except ApiException as e: except ApiException as e:
@ -68,7 +69,7 @@ No authorization required
Test serialization of object with outer number type Test serialization of object with outer number type
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -80,7 +81,7 @@ from pprint import pprint
api_instance = petstore_api.FakeApi() api_instance = petstore_api.FakeApi()
body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional)
try: try:
api_response = api_instance.fake_outer_composite_serialize(body=body) api_response = api_instance.fake_outer_composite_serialize(body=body)
pprint(api_response) pprint(api_response)
except ApiException as e: except ApiException as e:
@ -115,7 +116,7 @@ No authorization required
Test serialization of outer number types Test serialization of outer number types
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -127,7 +128,7 @@ from pprint import pprint
api_instance = petstore_api.FakeApi() api_instance = petstore_api.FakeApi()
body = petstore_api.OuterNumber() # OuterNumber | Input number as post body (optional) body = petstore_api.OuterNumber() # OuterNumber | Input number as post body (optional)
try: try:
api_response = api_instance.fake_outer_number_serialize(body=body) api_response = api_instance.fake_outer_number_serialize(body=body)
pprint(api_response) pprint(api_response)
except ApiException as e: except ApiException as e:
@ -162,7 +163,7 @@ No authorization required
Test serialization of outer string types Test serialization of outer string types
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -174,7 +175,7 @@ from pprint import pprint
api_instance = petstore_api.FakeApi() api_instance = petstore_api.FakeApi()
body = petstore_api.OuterString() # OuterString | Input string as post body (optional) body = petstore_api.OuterString() # OuterString | Input string as post body (optional)
try: try:
api_response = api_instance.fake_outer_string_serialize(body=body) api_response = api_instance.fake_outer_string_serialize(body=body)
pprint(api_response) pprint(api_response)
except ApiException as e: except ApiException as e:
@ -209,7 +210,7 @@ To test \"client\" model
To test \"client\" model To test \"client\" model
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -221,7 +222,7 @@ from pprint import pprint
api_instance = petstore_api.FakeApi() api_instance = petstore_api.FakeApi()
body = petstore_api.Client() # Client | client model body = petstore_api.Client() # Client | client model
try: try:
# To test \"client\" model # To test \"client\" model
api_response = api_instance.test_client_model(body) api_response = api_instance.test_client_model(body)
pprint(api_response) pprint(api_response)
@ -257,7 +258,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -287,7 +288,7 @@ date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional)
password = 'password_example' # str | None (optional) password = 'password_example' # str | None (optional)
param_callback = 'param_callback_example' # str | None (optional) param_callback = 'param_callback_example' # str | None (optional)
try: try:
# Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback)
except ApiException as e: except ApiException as e:
@ -335,7 +336,7 @@ To test enum parameters
To test enum parameters To test enum parameters
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -354,7 +355,7 @@ enum_query_string = '-efg' # str | Query parameter enum test (string) (optional)
enum_query_integer = 56 # int | Query parameter enum test (double) (optional) enum_query_integer = 56 # int | Query parameter enum test (double) (optional)
enum_query_double = 1.2 # float | Query parameter enum test (double) (optional) enum_query_double = 1.2 # float | Query parameter enum test (double) (optional)
try: try:
# To test enum parameters # To test enum parameters
api_instance.test_enum_parameters(enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string, enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double) api_instance.test_enum_parameters(enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string, enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double)
except ApiException as e: except ApiException as e:
@ -389,6 +390,53 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **test_inline_additional_properties**
> test_inline_additional_properties(param)
test inline additionalProperties
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = petstore_api.FakeApi()
param = NULL # object | request body
try:
# test inline additionalProperties
api_instance.test_inline_additional_properties(param)
except ApiException as e:
print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**param** | **object**| request body |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **test_json_form_data** # **test_json_form_data**
> test_json_form_data(param, param2) > test_json_form_data(param, param2)
@ -396,7 +444,7 @@ test json serialization of form data
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -409,7 +457,7 @@ api_instance = petstore_api.FakeApi()
param = 'param_example' # str | field1 param = 'param_example' # str | field1
param2 = 'param2_example' # str | field2 param2 = 'param2_example' # str | field2
try: try:
# test json serialization of form data # test json serialization of form data
api_instance.test_json_form_data(param, param2) api_instance.test_json_form_data(param, param2)
except ApiException as e: except ApiException as e:

View File

@ -12,7 +12,7 @@ Method | HTTP request | Description
To test class name in snake case To test class name in snake case
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -30,7 +30,7 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY'
api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration)) api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration))
body = petstore_api.Client() # Client | client model body = petstore_api.Client() # Client | client model
try: try:
# To test class name in snake case # To test class name in snake case
api_response = api_instance.test_classname(body) api_response = api_instance.test_classname(body)
pprint(api_response) pprint(api_response)

View File

@ -3,7 +3,7 @@
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**map_map_of_string** | [**dict(str, dict(str, str))**](dict.md) | | [optional] **map_map_of_string** | **dict(str, dict(str, str))** | | [optional]
**map_of_enum_string** | **dict(str, str)** | | [optional] **map_of_enum_string** | **dict(str, str)** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -21,7 +21,7 @@ Add a new pet to the store
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -37,7 +37,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration))
body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
try: try:
# Add a new pet to the store # Add a new pet to the store
api_instance.add_pet(body) api_instance.add_pet(body)
except ApiException as e: except ApiException as e:
@ -72,7 +72,7 @@ Deletes a pet
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -89,7 +89,7 @@ api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration))
pet_id = 789 # int | Pet id to delete pet_id = 789 # int | Pet id to delete
api_key = 'api_key_example' # str | (optional) api_key = 'api_key_example' # str | (optional)
try: try:
# Deletes a pet # Deletes a pet
api_instance.delete_pet(pet_id, api_key=api_key) api_instance.delete_pet(pet_id, api_key=api_key)
except ApiException as e: except ApiException as e:
@ -125,7 +125,7 @@ Finds Pets by status
Multiple status values can be provided with comma separated strings Multiple status values can be provided with comma separated strings
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -141,7 +141,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration))
status = ['status_example'] # list[str] | Status values that need to be considered for filter status = ['status_example'] # list[str] | Status values that need to be considered for filter
try: try:
# Finds Pets by status # Finds Pets by status
api_response = api_instance.find_pets_by_status(status) api_response = api_instance.find_pets_by_status(status)
pprint(api_response) pprint(api_response)
@ -177,7 +177,7 @@ Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -193,7 +193,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration))
tags = ['tags_example'] # list[str] | Tags to filter by tags = ['tags_example'] # list[str] | Tags to filter by
try: try:
# Finds Pets by tags # Finds Pets by tags
api_response = api_instance.find_pets_by_tags(tags) api_response = api_instance.find_pets_by_tags(tags)
pprint(api_response) pprint(api_response)
@ -229,7 +229,7 @@ Find pet by ID
Returns a single pet Returns a single pet
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -247,7 +247,7 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY'
api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration))
pet_id = 789 # int | ID of pet to return pet_id = 789 # int | ID of pet to return
try: try:
# Find pet by ID # Find pet by ID
api_response = api_instance.get_pet_by_id(pet_id) api_response = api_instance.get_pet_by_id(pet_id)
pprint(api_response) pprint(api_response)
@ -283,7 +283,7 @@ Update an existing pet
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -299,7 +299,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration))
body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
try: try:
# Update an existing pet # Update an existing pet
api_instance.update_pet(body) api_instance.update_pet(body)
except ApiException as e: except ApiException as e:
@ -334,7 +334,7 @@ Updates a pet in the store with form data
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -352,7 +352,7 @@ pet_id = 789 # int | ID of pet that needs to be updated
name = 'name_example' # str | Updated name of the pet (optional) name = 'name_example' # str | Updated name of the pet (optional)
status = 'status_example' # str | Updated status of the pet (optional) status = 'status_example' # str | Updated status of the pet (optional)
try: try:
# Updates a pet in the store with form data # Updates a pet in the store with form data
api_instance.update_pet_with_form(pet_id, name=name, status=status) api_instance.update_pet_with_form(pet_id, name=name, status=status)
except ApiException as e: except ApiException as e:
@ -389,7 +389,7 @@ uploads an image
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -407,7 +407,7 @@ pet_id = 789 # int | ID of pet to update
additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
file = '/path/to/file.txt' # file | file to upload (optional) file = '/path/to/file.txt' # file | file to upload (optional)
try: try:
# uploads an image # uploads an image
api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file)
pprint(api_response) pprint(api_response)

View File

@ -17,7 +17,7 @@ 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
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -29,7 +29,7 @@ from pprint import pprint
api_instance = petstore_api.StoreApi() api_instance = petstore_api.StoreApi()
order_id = 'order_id_example' # str | ID of the order that needs to be deleted order_id = 'order_id_example' # str | ID of the order that needs to be deleted
try: try:
# Delete purchase order by ID # Delete purchase order by ID
api_instance.delete_order(order_id) api_instance.delete_order(order_id)
except ApiException as e: except ApiException as e:
@ -64,7 +64,7 @@ Returns pet inventories by status
Returns a map of status codes to quantities Returns a map of status codes to quantities
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -81,7 +81,7 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY'
# create an instance of the API class # create an instance of the API class
api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration)) api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration))
try: try:
# Returns pet inventories by status # Returns pet inventories by status
api_response = api_instance.get_inventory() api_response = api_instance.get_inventory()
pprint(api_response) pprint(api_response)
@ -114,7 +114,7 @@ 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
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -126,7 +126,7 @@ from pprint import pprint
api_instance = petstore_api.StoreApi() api_instance = petstore_api.StoreApi()
order_id = 789 # int | ID of pet that needs to be fetched order_id = 789 # int | ID of pet that needs to be fetched
try: try:
# Find purchase order by ID # Find purchase order by ID
api_response = api_instance.get_order_by_id(order_id) api_response = api_instance.get_order_by_id(order_id)
pprint(api_response) pprint(api_response)
@ -162,7 +162,7 @@ Place an order for a pet
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -174,7 +174,7 @@ from pprint import pprint
api_instance = petstore_api.StoreApi() api_instance = petstore_api.StoreApi()
body = petstore_api.Order() # Order | order placed for purchasing the pet body = petstore_api.Order() # Order | order placed for purchasing the pet
try: try:
# Place an order for a pet # Place an order for a pet
api_response = api_instance.place_order(body) api_response = api_instance.place_order(body)
pprint(api_response) pprint(api_response)

View File

@ -21,7 +21,7 @@ Create user
This can only be done by the logged in user. This can only be done by the logged in user.
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -33,7 +33,7 @@ from pprint import pprint
api_instance = petstore_api.UserApi() api_instance = petstore_api.UserApi()
body = petstore_api.User() # User | Created user object body = petstore_api.User() # User | Created user object
try: try:
# Create user # Create user
api_instance.create_user(body) api_instance.create_user(body)
except ApiException as e: except ApiException as e:
@ -68,7 +68,7 @@ Creates list of users with given input array
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -80,7 +80,7 @@ from pprint import pprint
api_instance = petstore_api.UserApi() api_instance = petstore_api.UserApi()
body = [petstore_api.User()] # list[User] | List of user object body = [petstore_api.User()] # list[User] | List of user object
try: try:
# Creates list of users with given input array # Creates list of users with given input array
api_instance.create_users_with_array_input(body) api_instance.create_users_with_array_input(body)
except ApiException as e: except ApiException as e:
@ -115,7 +115,7 @@ Creates list of users with given input array
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -127,7 +127,7 @@ from pprint import pprint
api_instance = petstore_api.UserApi() api_instance = petstore_api.UserApi()
body = [petstore_api.User()] # list[User] | List of user object body = [petstore_api.User()] # list[User] | List of user object
try: try:
# Creates list of users with given input array # Creates list of users with given input array
api_instance.create_users_with_list_input(body) api_instance.create_users_with_list_input(body)
except ApiException as e: except ApiException as e:
@ -162,7 +162,7 @@ Delete user
This can only be done by the logged in user. This can only be done by the logged in user.
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -174,7 +174,7 @@ from pprint import pprint
api_instance = petstore_api.UserApi() api_instance = petstore_api.UserApi()
username = 'username_example' # str | The name that needs to be deleted username = 'username_example' # str | The name that needs to be deleted
try: try:
# Delete user # Delete user
api_instance.delete_user(username) api_instance.delete_user(username)
except ApiException as e: except ApiException as e:
@ -209,7 +209,7 @@ Get user by user name
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -221,7 +221,7 @@ from pprint import pprint
api_instance = petstore_api.UserApi() api_instance = petstore_api.UserApi()
username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing.
try: try:
# Get user by user name # Get user by user name
api_response = api_instance.get_user_by_name(username) api_response = api_instance.get_user_by_name(username)
pprint(api_response) pprint(api_response)
@ -257,7 +257,7 @@ Logs user into the system
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -270,7 +270,7 @@ api_instance = petstore_api.UserApi()
username = 'username_example' # str | The user name for login username = 'username_example' # str | The user name for login
password = 'password_example' # str | The password for login in clear text password = 'password_example' # str | The password for login in clear text
try: try:
# Logs user into the system # Logs user into the system
api_response = api_instance.login_user(username, password) api_response = api_instance.login_user(username, password)
pprint(api_response) pprint(api_response)
@ -307,7 +307,7 @@ Logs out current logged in user session
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -318,7 +318,7 @@ from pprint import pprint
# create an instance of the API class # create an instance of the API class
api_instance = petstore_api.UserApi() api_instance = petstore_api.UserApi()
try: try:
# Logs out current logged in user session # Logs out current logged in user session
api_instance.logout_user() api_instance.logout_user()
except ApiException as e: except ApiException as e:
@ -350,7 +350,7 @@ Updated user
This can only be done by the logged in user. This can only be done by the logged in user.
### Example ### Example
```python ```python
from __future__ import print_function from __future__ import print_function
import time import time
@ -363,7 +363,7 @@ api_instance = petstore_api.UserApi()
username = 'username_example' # str | name that need to be deleted username = 'username_example' # str | name that need to be deleted
body = petstore_api.User() # User | Updated user object body = petstore_api.User() # User | Updated user object
try: try:
# Updated user # Updated user
api_instance.update_user(username, body) api_instance.update_user(username, body)
except ApiException as e: except ApiException as e:

View File

@ -1,9 +1,11 @@
# coding: utf-8 # coding: utf-8
# flake8: noqa
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,53 +15,51 @@
from __future__ import absolute_import from __future__ import absolute_import
# import models into sdk package
from .models.additional_properties_class import AdditionalPropertiesClass
from .models.animal import Animal
from .models.animal_farm import AnimalFarm
from .models.api_response import ApiResponse
from .models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
from .models.array_of_number_only import ArrayOfNumberOnly
from .models.array_test import ArrayTest
from .models.capitalization import Capitalization
from .models.category import Category
from .models.class_model import ClassModel
from .models.client import Client
from .models.enum_arrays import EnumArrays
from .models.enum_class import EnumClass
from .models.enum_test import EnumTest
from .models.format_test import FormatTest
from .models.has_only_read_only import HasOnlyReadOnly
from .models.list import List
from .models.map_test import MapTest
from .models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
from .models.model_200_response import Model200Response
from .models.model_return import ModelReturn
from .models.name import Name
from .models.number_only import NumberOnly
from .models.order import Order
from .models.outer_boolean import OuterBoolean
from .models.outer_composite import OuterComposite
from .models.outer_enum import OuterEnum
from .models.outer_number import OuterNumber
from .models.outer_string import OuterString
from .models.pet import Pet
from .models.read_only_first import ReadOnlyFirst
from .models.special_model_name import SpecialModelName
from .models.tag import Tag
from .models.user import User
from .models.cat import Cat
from .models.dog import Dog
# import apis into sdk package # import apis into sdk package
from .apis.another_fake_api import AnotherFakeApi from petstore_api.api.another_fake_api import AnotherFakeApi
from .apis.fake_api import FakeApi from petstore_api.api.fake_api import FakeApi
from .apis.fake_classname_tags_123_api import FakeClassnameTags123Api from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api
from .apis.pet_api import PetApi from petstore_api.api.pet_api import PetApi
from .apis.store_api import StoreApi from petstore_api.api.store_api import StoreApi
from .apis.user_api import UserApi from petstore_api.api.user_api import UserApi
# import ApiClient # import ApiClient
from .api_client import ApiClient from petstore_api.api_client import ApiClient
from petstore_api.configuration import Configuration
from .configuration import Configuration # import models into sdk package
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
from petstore_api.models.animal import Animal
from petstore_api.models.animal_farm import AnimalFarm
from petstore_api.models.api_response import ApiResponse
from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
from petstore_api.models.array_test import ArrayTest
from petstore_api.models.capitalization import Capitalization
from petstore_api.models.category import Category
from petstore_api.models.class_model import ClassModel
from petstore_api.models.client import Client
from petstore_api.models.enum_arrays import EnumArrays
from petstore_api.models.enum_class import EnumClass
from petstore_api.models.enum_test import EnumTest
from petstore_api.models.format_test import FormatTest
from petstore_api.models.has_only_read_only import HasOnlyReadOnly
from petstore_api.models.list import List
from petstore_api.models.map_test import MapTest
from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
from petstore_api.models.model_200_response import Model200Response
from petstore_api.models.model_return import ModelReturn
from petstore_api.models.name import Name
from petstore_api.models.number_only import NumberOnly
from petstore_api.models.order import Order
from petstore_api.models.outer_boolean import OuterBoolean
from petstore_api.models.outer_composite import OuterComposite
from petstore_api.models.outer_enum import OuterEnum
from petstore_api.models.outer_number import OuterNumber
from petstore_api.models.outer_string import OuterString
from petstore_api.models.pet import Pet
from petstore_api.models.read_only_first import ReadOnlyFirst
from petstore_api.models.special_model_name import SpecialModelName
from petstore_api.models.tag import Tag
from petstore_api.models.user import User
from petstore_api.models.cat import Cat
from petstore_api.models.dog import Dog

View File

@ -0,0 +1,11 @@
from __future__ import absolute_import
# flake8: noqa
# import apis into api package
from petstore_api.api.another_fake_api import AnotherFakeApi
from petstore_api.api.fake_api import FakeApi
from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api
from petstore_api.api.pet_api import PetApi
from petstore_api.api.store_api import StoreApi
from petstore_api.api.user_api import UserApi

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,19 +13,17 @@
from __future__ import absolute_import from __future__ import absolute_import
import sys import re # noqa: F401
import os
import re
# python 2 and python 3 compatibility library # python 2 and python 3 compatibility library
from six import iteritems import six
from ..api_client import ApiClient from petstore_api.api_client import ApiClient
class AnotherFakeApi(object): class AnotherFakeApi(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen Ref: https://github.com/swagger-api/swagger-codegen
""" """
@ -35,10 +33,10 @@ class AnotherFakeApi(object):
api_client = ApiClient() api_client = ApiClient()
self.api_client = api_client self.api_client = api_client
def test_special_tags(self, body, **kwargs): def test_special_tags(self, body, **kwargs): # noqa: E501
""" """To test special tags # noqa: E501
To test special tags
To test special tags To test special tags # noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.test_special_tags(body, async=True) >>> thread = api.test_special_tags(body, async=True)
@ -52,15 +50,15 @@ class AnotherFakeApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.test_special_tags_with_http_info(body, **kwargs) return self.test_special_tags_with_http_info(body, **kwargs) # noqa: E501
else: else:
(data) = self.test_special_tags_with_http_info(body, **kwargs) (data) = self.test_special_tags_with_http_info(body, **kwargs) # noqa: E501
return data return data
def test_special_tags_with_http_info(self, body, **kwargs): def test_special_tags_with_http_info(self, body, **kwargs): # noqa: E501
""" """To test special tags # noqa: E501
To test special tags
To test special tags To test special tags # noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.test_special_tags_with_http_info(body, async=True) >>> thread = api.test_special_tags_with_http_info(body, async=True)
@ -73,14 +71,14 @@ class AnotherFakeApi(object):
returns the request thread. returns the request thread.
""" """
all_params = ['body'] all_params = ['body'] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -89,9 +87,9 @@ class AnotherFakeApi(object):
params[key] = val params[key] = val
del params['kwargs'] del params['kwargs']
# verify the required parameter 'body' is set # verify the required parameter 'body' is set
if ('body' not in params) or (params['body'] is None): if ('body' not in params or
raise ValueError("Missing the required parameter `body` when calling `test_special_tags`") params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `test_special_tags`") # noqa: E501
collection_formats = {} collection_formats = {}
@ -108,27 +106,28 @@ class AnotherFakeApi(object):
if 'body' in params: if 'body' in params:
body_params = params['body'] body_params = params['body']
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/json']) ['application/json']) # noqa: E501
# HTTP header `Content-Type` # HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
select_header_content_type(['application/json']) ['application/json']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = [] auth_settings = [] # noqa: E501
return self.api_client.call_api('/another-fake/dummy', 'PATCH', return self.api_client.call_api(
path_params, '/another-fake/dummy', 'PATCH',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type='Client', files=local_var_files,
auth_settings=auth_settings, response_type='Client', # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,19 +13,17 @@
from __future__ import absolute_import from __future__ import absolute_import
import sys import re # noqa: F401
import os
import re
# python 2 and python 3 compatibility library # python 2 and python 3 compatibility library
from six import iteritems import six
from ..api_client import ApiClient from petstore_api.api_client import ApiClient
class FakeClassnameTags123Api(object): class FakeClassnameTags123Api(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen Ref: https://github.com/swagger-api/swagger-codegen
""" """
@ -35,9 +33,9 @@ class FakeClassnameTags123Api(object):
api_client = ApiClient() api_client = ApiClient()
self.api_client = api_client self.api_client = api_client
def test_classname(self, body, **kwargs): def test_classname(self, body, **kwargs): # noqa: E501
""" """To test class name in snake case # noqa: E501
To test class name in snake case
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.test_classname(body, async=True) >>> thread = api.test_classname(body, async=True)
@ -51,14 +49,14 @@ class FakeClassnameTags123Api(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.test_classname_with_http_info(body, **kwargs) return self.test_classname_with_http_info(body, **kwargs) # noqa: E501
else: else:
(data) = self.test_classname_with_http_info(body, **kwargs) (data) = self.test_classname_with_http_info(body, **kwargs) # noqa: E501
return data return data
def test_classname_with_http_info(self, body, **kwargs): def test_classname_with_http_info(self, body, **kwargs): # noqa: E501
""" """To test class name in snake case # noqa: E501
To test class name in snake case
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.test_classname_with_http_info(body, async=True) >>> thread = api.test_classname_with_http_info(body, async=True)
@ -71,14 +69,14 @@ class FakeClassnameTags123Api(object):
returns the request thread. returns the request thread.
""" """
all_params = ['body'] all_params = ['body'] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -87,9 +85,9 @@ class FakeClassnameTags123Api(object):
params[key] = val params[key] = val
del params['kwargs'] del params['kwargs']
# verify the required parameter 'body' is set # verify the required parameter 'body' is set
if ('body' not in params) or (params['body'] is None): if ('body' not in params or
raise ValueError("Missing the required parameter `body` when calling `test_classname`") params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501
collection_formats = {} collection_formats = {}
@ -106,27 +104,28 @@ class FakeClassnameTags123Api(object):
if 'body' in params: if 'body' in params:
body_params = params['body'] body_params = params['body']
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/json']) ['application/json']) # noqa: E501
# HTTP header `Content-Type` # HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
select_header_content_type(['application/json']) ['application/json']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = ['api_key_query'] auth_settings = ['api_key_query'] # noqa: E501
return self.api_client.call_api('/fake_classname_test', 'PATCH', return self.api_client.call_api(
path_params, '/fake_classname_test', 'PATCH',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type='Client', files=local_var_files,
auth_settings=auth_settings, response_type='Client', # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,19 +13,17 @@
from __future__ import absolute_import from __future__ import absolute_import
import sys import re # noqa: F401
import os
import re
# python 2 and python 3 compatibility library # python 2 and python 3 compatibility library
from six import iteritems import six
from ..api_client import ApiClient from petstore_api.api_client import ApiClient
class PetApi(object): class PetApi(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen Ref: https://github.com/swagger-api/swagger-codegen
""" """
@ -35,10 +33,10 @@ class PetApi(object):
api_client = ApiClient() api_client = ApiClient()
self.api_client = api_client self.api_client = api_client
def add_pet(self, body, **kwargs): def add_pet(self, body, **kwargs): # noqa: E501
""" """Add a new pet to the store # noqa: E501
Add a new pet to the store
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.add_pet(body, async=True) >>> thread = api.add_pet(body, async=True)
@ -52,15 +50,15 @@ class PetApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.add_pet_with_http_info(body, **kwargs) return self.add_pet_with_http_info(body, **kwargs) # noqa: E501
else: else:
(data) = self.add_pet_with_http_info(body, **kwargs) (data) = self.add_pet_with_http_info(body, **kwargs) # noqa: E501
return data return data
def add_pet_with_http_info(self, body, **kwargs): def add_pet_with_http_info(self, body, **kwargs): # noqa: E501
""" """Add a new pet to the store # noqa: E501
Add a new pet to the store
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.add_pet_with_http_info(body, async=True) >>> thread = api.add_pet_with_http_info(body, async=True)
@ -73,14 +71,14 @@ class PetApi(object):
returns the request thread. returns the request thread.
""" """
all_params = ['body'] all_params = ['body'] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -89,9 +87,9 @@ class PetApi(object):
params[key] = val params[key] = val
del params['kwargs'] del params['kwargs']
# verify the required parameter 'body' is set # verify the required parameter 'body' is set
if ('body' not in params) or (params['body'] is None): if ('body' not in params or
raise ValueError("Missing the required parameter `body` when calling `add_pet`") params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `add_pet`") # noqa: E501
collection_formats = {} collection_formats = {}
@ -108,35 +106,36 @@ class PetApi(object):
if 'body' in params: if 'body' in params:
body_params = params['body'] body_params = params['body']
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/xml', 'application/json']) ['application/xml', 'application/json']) # noqa: E501
# HTTP header `Content-Type` # HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
select_header_content_type(['application/json', 'application/xml']) ['application/json', 'application/xml']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = ['petstore_auth'] auth_settings = ['petstore_auth'] # noqa: E501
return self.api_client.call_api('/pet', 'POST', return self.api_client.call_api(
path_params, '/pet', 'POST',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type=None, files=local_var_files,
auth_settings=auth_settings, response_type=None, # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def delete_pet(self, pet_id, **kwargs): def delete_pet(self, pet_id, **kwargs): # noqa: E501
""" """Deletes a pet # noqa: E501
Deletes a pet
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.delete_pet(pet_id, async=True) >>> thread = api.delete_pet(pet_id, async=True)
@ -151,15 +150,15 @@ class PetApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.delete_pet_with_http_info(pet_id, **kwargs) return self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501
else: else:
(data) = self.delete_pet_with_http_info(pet_id, **kwargs) (data) = self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501
return data return data
def delete_pet_with_http_info(self, pet_id, **kwargs): def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501
""" """Deletes a pet # noqa: E501
Deletes a pet
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.delete_pet_with_http_info(pet_id, async=True) >>> thread = api.delete_pet_with_http_info(pet_id, async=True)
@ -173,14 +172,14 @@ class PetApi(object):
returns the request thread. returns the request thread.
""" """
all_params = ['pet_id', 'api_key'] all_params = ['pet_id', 'api_key'] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -189,52 +188,53 @@ class PetApi(object):
params[key] = val params[key] = val
del params['kwargs'] del params['kwargs']
# verify the required parameter 'pet_id' is set # verify the required parameter 'pet_id' is set
if ('pet_id' not in params) or (params['pet_id'] is None): if ('pet_id' not in params or
raise ValueError("Missing the required parameter `pet_id` when calling `delete_pet`") params['pet_id'] is None):
raise ValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501
collection_formats = {} collection_formats = {}
path_params = {} path_params = {}
if 'pet_id' in params: if 'pet_id' in params:
path_params['petId'] = params['pet_id'] path_params['petId'] = params['pet_id'] # noqa: E501
query_params = [] query_params = []
header_params = {} header_params = {}
if 'api_key' in params: if 'api_key' in params:
header_params['api_key'] = params['api_key'] header_params['api_key'] = params['api_key'] # noqa: E501
form_params = [] form_params = []
local_var_files = {} local_var_files = {}
body_params = None body_params = None
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/xml', 'application/json']) ['application/xml', 'application/json']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = ['petstore_auth'] auth_settings = ['petstore_auth'] # noqa: E501
return self.api_client.call_api('/pet/{petId}', 'DELETE', return self.api_client.call_api(
path_params, '/pet/{petId}', 'DELETE',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type=None, files=local_var_files,
auth_settings=auth_settings, response_type=None, # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def find_pets_by_status(self, status, **kwargs): def find_pets_by_status(self, status, **kwargs): # noqa: E501
""" """Finds Pets by status # noqa: E501
Finds Pets by status
Multiple status values can be provided with comma separated strings Multiple status values can be provided with comma separated strings # noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.find_pets_by_status(status, async=True) >>> thread = api.find_pets_by_status(status, async=True)
@ -248,15 +248,15 @@ class PetApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.find_pets_by_status_with_http_info(status, **kwargs) return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501
else: else:
(data) = self.find_pets_by_status_with_http_info(status, **kwargs) (data) = self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501
return data return data
def find_pets_by_status_with_http_info(self, status, **kwargs): def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501
""" """Finds Pets by status # noqa: E501
Finds Pets by status
Multiple status values can be provided with comma separated strings Multiple status values can be provided with comma separated strings # noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.find_pets_by_status_with_http_info(status, async=True) >>> thread = api.find_pets_by_status_with_http_info(status, async=True)
@ -269,14 +269,14 @@ class PetApi(object):
returns the request thread. returns the request thread.
""" """
all_params = ['status'] all_params = ['status'] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -285,9 +285,9 @@ class PetApi(object):
params[key] = val params[key] = val
del params['kwargs'] del params['kwargs']
# verify the required parameter 'status' is set # verify the required parameter 'status' is set
if ('status' not in params) or (params['status'] is None): if ('status' not in params or
raise ValueError("Missing the required parameter `status` when calling `find_pets_by_status`") params['status'] is None):
raise ValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501
collection_formats = {} collection_formats = {}
@ -295,8 +295,8 @@ class PetApi(object):
query_params = [] query_params = []
if 'status' in params: if 'status' in params:
query_params.append(('status', params['status'])) query_params.append(('status', params['status'])) # noqa: E501
collection_formats['status'] = 'csv' collection_formats['status'] = 'csv' # noqa: E501
header_params = {} header_params = {}
@ -305,31 +305,32 @@ class PetApi(object):
body_params = None body_params = None
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/xml', 'application/json']) ['application/xml', 'application/json']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = ['petstore_auth'] auth_settings = ['petstore_auth'] # noqa: E501
return self.api_client.call_api('/pet/findByStatus', 'GET', return self.api_client.call_api(
path_params, '/pet/findByStatus', 'GET',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type='list[Pet]', files=local_var_files,
auth_settings=auth_settings, response_type='list[Pet]', # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def find_pets_by_tags(self, tags, **kwargs): def find_pets_by_tags(self, tags, **kwargs): # noqa: E501
""" """Finds Pets by tags # noqa: E501
Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.find_pets_by_tags(tags, async=True) >>> thread = api.find_pets_by_tags(tags, async=True)
@ -343,15 +344,15 @@ class PetApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.find_pets_by_tags_with_http_info(tags, **kwargs) return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501
else: else:
(data) = self.find_pets_by_tags_with_http_info(tags, **kwargs) (data) = self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501
return data return data
def find_pets_by_tags_with_http_info(self, tags, **kwargs): def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501
""" """Finds Pets by tags # noqa: E501
Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.find_pets_by_tags_with_http_info(tags, async=True) >>> thread = api.find_pets_by_tags_with_http_info(tags, async=True)
@ -364,14 +365,14 @@ class PetApi(object):
returns the request thread. returns the request thread.
""" """
all_params = ['tags'] all_params = ['tags'] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -380,9 +381,9 @@ class PetApi(object):
params[key] = val params[key] = val
del params['kwargs'] del params['kwargs']
# verify the required parameter 'tags' is set # verify the required parameter 'tags' is set
if ('tags' not in params) or (params['tags'] is None): if ('tags' not in params or
raise ValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") params['tags'] is None):
raise ValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501
collection_formats = {} collection_formats = {}
@ -390,8 +391,8 @@ class PetApi(object):
query_params = [] query_params = []
if 'tags' in params: if 'tags' in params:
query_params.append(('tags', params['tags'])) query_params.append(('tags', params['tags'])) # noqa: E501
collection_formats['tags'] = 'csv' collection_formats['tags'] = 'csv' # noqa: E501
header_params = {} header_params = {}
@ -400,31 +401,32 @@ class PetApi(object):
body_params = None body_params = None
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/xml', 'application/json']) ['application/xml', 'application/json']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = ['petstore_auth'] auth_settings = ['petstore_auth'] # noqa: E501
return self.api_client.call_api('/pet/findByTags', 'GET', return self.api_client.call_api(
path_params, '/pet/findByTags', 'GET',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type='list[Pet]', files=local_var_files,
auth_settings=auth_settings, response_type='list[Pet]', # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_pet_by_id(self, pet_id, **kwargs): def get_pet_by_id(self, pet_id, **kwargs): # noqa: E501
""" """Find pet by ID # noqa: E501
Find pet by ID
Returns a single pet Returns a single pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.get_pet_by_id(pet_id, async=True) >>> thread = api.get_pet_by_id(pet_id, async=True)
@ -438,15 +440,15 @@ class PetApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.get_pet_by_id_with_http_info(pet_id, **kwargs) return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501
else: else:
(data) = self.get_pet_by_id_with_http_info(pet_id, **kwargs) (data) = self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501
return data return data
def get_pet_by_id_with_http_info(self, pet_id, **kwargs): def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501
""" """Find pet by ID # noqa: E501
Find pet by ID
Returns a single pet Returns a single pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.get_pet_by_id_with_http_info(pet_id, async=True) >>> thread = api.get_pet_by_id_with_http_info(pet_id, async=True)
@ -459,14 +461,14 @@ class PetApi(object):
returns the request thread. returns the request thread.
""" """
all_params = ['pet_id'] all_params = ['pet_id'] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -475,15 +477,15 @@ class PetApi(object):
params[key] = val params[key] = val
del params['kwargs'] del params['kwargs']
# verify the required parameter 'pet_id' is set # verify the required parameter 'pet_id' is set
if ('pet_id' not in params) or (params['pet_id'] is None): if ('pet_id' not in params or
raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") params['pet_id'] is None):
raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501
collection_formats = {} collection_formats = {}
path_params = {} path_params = {}
if 'pet_id' in params: if 'pet_id' in params:
path_params['petId'] = params['pet_id'] path_params['petId'] = params['pet_id'] # noqa: E501
query_params = [] query_params = []
@ -494,31 +496,32 @@ class PetApi(object):
body_params = None body_params = None
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/xml', 'application/json']) ['application/xml', 'application/json']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = ['api_key'] auth_settings = ['api_key'] # noqa: E501
return self.api_client.call_api('/pet/{petId}', 'GET', return self.api_client.call_api(
path_params, '/pet/{petId}', 'GET',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type='Pet', files=local_var_files,
auth_settings=auth_settings, response_type='Pet', # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def update_pet(self, body, **kwargs): def update_pet(self, body, **kwargs): # noqa: E501
""" """Update an existing pet # noqa: E501
Update an existing pet
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.update_pet(body, async=True) >>> thread = api.update_pet(body, async=True)
@ -532,15 +535,15 @@ class PetApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.update_pet_with_http_info(body, **kwargs) return self.update_pet_with_http_info(body, **kwargs) # noqa: E501
else: else:
(data) = self.update_pet_with_http_info(body, **kwargs) (data) = self.update_pet_with_http_info(body, **kwargs) # noqa: E501
return data return data
def update_pet_with_http_info(self, body, **kwargs): def update_pet_with_http_info(self, body, **kwargs): # noqa: E501
""" """Update an existing pet # noqa: E501
Update an existing pet
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.update_pet_with_http_info(body, async=True) >>> thread = api.update_pet_with_http_info(body, async=True)
@ -553,14 +556,14 @@ class PetApi(object):
returns the request thread. returns the request thread.
""" """
all_params = ['body'] all_params = ['body'] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -569,9 +572,9 @@ class PetApi(object):
params[key] = val params[key] = val
del params['kwargs'] del params['kwargs']
# verify the required parameter 'body' is set # verify the required parameter 'body' is set
if ('body' not in params) or (params['body'] is None): if ('body' not in params or
raise ValueError("Missing the required parameter `body` when calling `update_pet`") params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `update_pet`") # noqa: E501
collection_formats = {} collection_formats = {}
@ -588,35 +591,36 @@ class PetApi(object):
if 'body' in params: if 'body' in params:
body_params = params['body'] body_params = params['body']
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/xml', 'application/json']) ['application/xml', 'application/json']) # noqa: E501
# HTTP header `Content-Type` # HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
select_header_content_type(['application/json', 'application/xml']) ['application/json', 'application/xml']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = ['petstore_auth'] auth_settings = ['petstore_auth'] # noqa: E501
return self.api_client.call_api('/pet', 'PUT', return self.api_client.call_api(
path_params, '/pet', 'PUT',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type=None, files=local_var_files,
auth_settings=auth_settings, response_type=None, # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def update_pet_with_form(self, pet_id, **kwargs): def update_pet_with_form(self, pet_id, **kwargs): # noqa: E501
""" """Updates a pet in the store with form data # noqa: E501
Updates a pet in the store with form data
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.update_pet_with_form(pet_id, async=True) >>> thread = api.update_pet_with_form(pet_id, async=True)
@ -632,15 +636,15 @@ class PetApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.update_pet_with_form_with_http_info(pet_id, **kwargs) return self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501
else: else:
(data) = self.update_pet_with_form_with_http_info(pet_id, **kwargs) (data) = self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501
return data return data
def update_pet_with_form_with_http_info(self, pet_id, **kwargs): def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501
""" """Updates a pet in the store with form data # noqa: E501
Updates a pet in the store with form data
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.update_pet_with_form_with_http_info(pet_id, async=True) >>> thread = api.update_pet_with_form_with_http_info(pet_id, async=True)
@ -655,14 +659,14 @@ class PetApi(object):
returns the request thread. returns the request thread.
""" """
all_params = ['pet_id', 'name', 'status'] all_params = ['pet_id', 'name', 'status'] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -671,15 +675,15 @@ class PetApi(object):
params[key] = val params[key] = val
del params['kwargs'] del params['kwargs']
# verify the required parameter 'pet_id' is set # verify the required parameter 'pet_id' is set
if ('pet_id' not in params) or (params['pet_id'] is None): if ('pet_id' not in params or
raise ValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") params['pet_id'] is None):
raise ValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501
collection_formats = {} collection_formats = {}
path_params = {} path_params = {}
if 'pet_id' in params: if 'pet_id' in params:
path_params['petId'] = params['pet_id'] path_params['petId'] = params['pet_id'] # noqa: E501
query_params = [] query_params = []
@ -688,41 +692,42 @@ class PetApi(object):
form_params = [] form_params = []
local_var_files = {} local_var_files = {}
if 'name' in params: if 'name' in params:
form_params.append(('name', params['name'])) form_params.append(('name', params['name'])) # noqa: E501
if 'status' in params: if 'status' in params:
form_params.append(('status', params['status'])) form_params.append(('status', params['status'])) # noqa: E501
body_params = None body_params = None
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/xml', 'application/json']) ['application/xml', 'application/json']) # noqa: E501
# HTTP header `Content-Type` # HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
select_header_content_type(['application/x-www-form-urlencoded']) ['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = ['petstore_auth'] auth_settings = ['petstore_auth'] # noqa: E501
return self.api_client.call_api('/pet/{petId}', 'POST', return self.api_client.call_api(
path_params, '/pet/{petId}', 'POST',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type=None, files=local_var_files,
auth_settings=auth_settings, response_type=None, # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def upload_file(self, pet_id, **kwargs): def upload_file(self, pet_id, **kwargs): # noqa: E501
""" """uploads an image # noqa: E501
uploads an image
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.upload_file(pet_id, async=True) >>> thread = api.upload_file(pet_id, async=True)
@ -738,15 +743,15 @@ class PetApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.upload_file_with_http_info(pet_id, **kwargs) return self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501
else: else:
(data) = self.upload_file_with_http_info(pet_id, **kwargs) (data) = self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501
return data return data
def upload_file_with_http_info(self, pet_id, **kwargs): def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501
""" """uploads an image # noqa: E501
uploads an image
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.upload_file_with_http_info(pet_id, async=True) >>> thread = api.upload_file_with_http_info(pet_id, async=True)
@ -761,14 +766,14 @@ class PetApi(object):
returns the request thread. returns the request thread.
""" """
all_params = ['pet_id', 'additional_metadata', 'file'] all_params = ['pet_id', 'additional_metadata', 'file'] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -777,15 +782,15 @@ class PetApi(object):
params[key] = val params[key] = val
del params['kwargs'] del params['kwargs']
# verify the required parameter 'pet_id' is set # verify the required parameter 'pet_id' is set
if ('pet_id' not in params) or (params['pet_id'] is None): if ('pet_id' not in params or
raise ValueError("Missing the required parameter `pet_id` when calling `upload_file`") params['pet_id'] is None):
raise ValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501
collection_formats = {} collection_formats = {}
path_params = {} path_params = {}
if 'pet_id' in params: if 'pet_id' in params:
path_params['petId'] = params['pet_id'] path_params['petId'] = params['pet_id'] # noqa: E501
query_params = [] query_params = []
@ -794,33 +799,34 @@ class PetApi(object):
form_params = [] form_params = []
local_var_files = {} local_var_files = {}
if 'additional_metadata' in params: if 'additional_metadata' in params:
form_params.append(('additionalMetadata', params['additional_metadata'])) form_params.append(('additionalMetadata', params['additional_metadata'])) # noqa: E501
if 'file' in params: if 'file' in params:
local_var_files['file'] = params['file'] local_var_files['file'] = params['file'] # noqa: E501
body_params = None body_params = None
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/json']) ['application/json']) # noqa: E501
# HTTP header `Content-Type` # HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
select_header_content_type(['multipart/form-data']) ['multipart/form-data']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = ['petstore_auth'] auth_settings = ['petstore_auth'] # noqa: E501
return self.api_client.call_api('/pet/{petId}/uploadImage', 'POST', return self.api_client.call_api(
path_params, '/pet/{petId}/uploadImage', 'POST',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type='ApiResponse', files=local_var_files,
auth_settings=auth_settings, response_type='ApiResponse', # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,19 +13,17 @@
from __future__ import absolute_import from __future__ import absolute_import
import sys import re # noqa: F401
import os
import re
# python 2 and python 3 compatibility library # python 2 and python 3 compatibility library
from six import iteritems import six
from ..api_client import ApiClient from petstore_api.api_client import ApiClient
class StoreApi(object): class StoreApi(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen Ref: https://github.com/swagger-api/swagger-codegen
""" """
@ -35,10 +33,10 @@ class StoreApi(object):
api_client = ApiClient() api_client = ApiClient()
self.api_client = api_client self.api_client = api_client
def delete_order(self, order_id, **kwargs): def delete_order(self, order_id, **kwargs): # noqa: E501
""" """Delete purchase order by ID # noqa: E501
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 # noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.delete_order(order_id, async=True) >>> thread = api.delete_order(order_id, async=True)
@ -52,15 +50,15 @@ class StoreApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.delete_order_with_http_info(order_id, **kwargs) return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501
else: else:
(data) = self.delete_order_with_http_info(order_id, **kwargs) (data) = self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501
return data return data
def delete_order_with_http_info(self, order_id, **kwargs): def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501
""" """Delete purchase order by ID # noqa: E501
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 # noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.delete_order_with_http_info(order_id, async=True) >>> thread = api.delete_order_with_http_info(order_id, async=True)
@ -73,14 +71,14 @@ class StoreApi(object):
returns the request thread. returns the request thread.
""" """
all_params = ['order_id'] all_params = ['order_id'] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -89,15 +87,15 @@ class StoreApi(object):
params[key] = val params[key] = val
del params['kwargs'] del params['kwargs']
# verify the required parameter 'order_id' is set # verify the required parameter 'order_id' is set
if ('order_id' not in params) or (params['order_id'] is None): if ('order_id' not in params or
raise ValueError("Missing the required parameter `order_id` when calling `delete_order`") params['order_id'] is None):
raise ValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501
collection_formats = {} collection_formats = {}
path_params = {} path_params = {}
if 'order_id' in params: if 'order_id' in params:
path_params['order_id'] = params['order_id'] path_params['order_id'] = params['order_id'] # noqa: E501
query_params = [] query_params = []
@ -108,31 +106,32 @@ class StoreApi(object):
body_params = None body_params = None
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/xml', 'application/json']) ['application/xml', 'application/json']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = [] auth_settings = [] # noqa: E501
return self.api_client.call_api('/store/order/{order_id}', 'DELETE', return self.api_client.call_api(
path_params, '/store/order/{order_id}', 'DELETE',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type=None, files=local_var_files,
auth_settings=auth_settings, response_type=None, # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_inventory(self, **kwargs): def get_inventory(self, **kwargs): # noqa: E501
""" """Returns pet inventories by status # noqa: E501
Returns pet inventories by status
Returns a map of status codes to quantities Returns a map of status codes to quantities # noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.get_inventory(async=True) >>> thread = api.get_inventory(async=True)
@ -145,15 +144,15 @@ class StoreApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.get_inventory_with_http_info(**kwargs) return self.get_inventory_with_http_info(**kwargs) # noqa: E501
else: else:
(data) = self.get_inventory_with_http_info(**kwargs) (data) = self.get_inventory_with_http_info(**kwargs) # noqa: E501
return data return data
def get_inventory_with_http_info(self, **kwargs): def get_inventory_with_http_info(self, **kwargs): # noqa: E501
""" """Returns pet inventories by status # noqa: E501
Returns pet inventories by status
Returns a map of status codes to quantities Returns a map of status codes to quantities # noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.get_inventory_with_http_info(async=True) >>> thread = api.get_inventory_with_http_info(async=True)
@ -165,14 +164,14 @@ class StoreApi(object):
returns the request thread. returns the request thread.
""" """
all_params = [] all_params = [] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -194,31 +193,32 @@ class StoreApi(object):
body_params = None body_params = None
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/json']) ['application/json']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = ['api_key'] auth_settings = ['api_key'] # noqa: E501
return self.api_client.call_api('/store/inventory', 'GET', return self.api_client.call_api(
path_params, '/store/inventory', 'GET',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type='dict(str, int)', files=local_var_files,
auth_settings=auth_settings, response_type='dict(str, int)', # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_order_by_id(self, order_id, **kwargs): def get_order_by_id(self, order_id, **kwargs): # noqa: E501
""" """Find purchase order by ID # noqa: E501
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 # noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.get_order_by_id(order_id, async=True) >>> thread = api.get_order_by_id(order_id, async=True)
@ -232,15 +232,15 @@ class StoreApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.get_order_by_id_with_http_info(order_id, **kwargs) return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501
else: else:
(data) = self.get_order_by_id_with_http_info(order_id, **kwargs) (data) = self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501
return data return data
def get_order_by_id_with_http_info(self, order_id, **kwargs): def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501
""" """Find purchase order by ID # noqa: E501
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 # noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.get_order_by_id_with_http_info(order_id, async=True) >>> thread = api.get_order_by_id_with_http_info(order_id, async=True)
@ -253,14 +253,14 @@ class StoreApi(object):
returns the request thread. returns the request thread.
""" """
all_params = ['order_id'] all_params = ['order_id'] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -269,19 +269,19 @@ class StoreApi(object):
params[key] = val params[key] = val
del params['kwargs'] del params['kwargs']
# verify the required parameter 'order_id' is set # verify the required parameter 'order_id' is set
if ('order_id' not in params) or (params['order_id'] is None): if ('order_id' not in params or
raise ValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") params['order_id'] is None):
raise ValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501
if 'order_id' in params and params['order_id'] > 5:
raise ValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`")
if 'order_id' in params and params['order_id'] < 1:
raise ValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`")
if 'order_id' in params and params['order_id'] > 5: # noqa: E501
raise ValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`") # noqa: E501
if 'order_id' in params and params['order_id'] < 1: # noqa: E501
raise ValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`") # noqa: E501
collection_formats = {} collection_formats = {}
path_params = {} path_params = {}
if 'order_id' in params: if 'order_id' in params:
path_params['order_id'] = params['order_id'] path_params['order_id'] = params['order_id'] # noqa: E501
query_params = [] query_params = []
@ -292,31 +292,32 @@ class StoreApi(object):
body_params = None body_params = None
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/xml', 'application/json']) ['application/xml', 'application/json']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = [] auth_settings = [] # noqa: E501
return self.api_client.call_api('/store/order/{order_id}', 'GET', return self.api_client.call_api(
path_params, '/store/order/{order_id}', 'GET',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type='Order', files=local_var_files,
auth_settings=auth_settings, response_type='Order', # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def place_order(self, body, **kwargs): def place_order(self, body, **kwargs): # noqa: E501
""" """Place an order for a pet # noqa: E501
Place an order for a pet
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.place_order(body, async=True) >>> thread = api.place_order(body, async=True)
@ -330,15 +331,15 @@ class StoreApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.place_order_with_http_info(body, **kwargs) return self.place_order_with_http_info(body, **kwargs) # noqa: E501
else: else:
(data) = self.place_order_with_http_info(body, **kwargs) (data) = self.place_order_with_http_info(body, **kwargs) # noqa: E501
return data return data
def place_order_with_http_info(self, body, **kwargs): def place_order_with_http_info(self, body, **kwargs): # noqa: E501
""" """Place an order for a pet # noqa: E501
Place an order for a pet
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.place_order_with_http_info(body, async=True) >>> thread = api.place_order_with_http_info(body, async=True)
@ -351,14 +352,14 @@ class StoreApi(object):
returns the request thread. returns the request thread.
""" """
all_params = ['body'] all_params = ['body'] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -367,9 +368,9 @@ class StoreApi(object):
params[key] = val params[key] = val
del params['kwargs'] del params['kwargs']
# verify the required parameter 'body' is set # verify the required parameter 'body' is set
if ('body' not in params) or (params['body'] is None): if ('body' not in params or
raise ValueError("Missing the required parameter `body` when calling `place_order`") params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `place_order`") # noqa: E501
collection_formats = {} collection_formats = {}
@ -386,23 +387,24 @@ class StoreApi(object):
if 'body' in params: if 'body' in params:
body_params = params['body'] body_params = params['body']
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/xml', 'application/json']) ['application/xml', 'application/json']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = [] auth_settings = [] # noqa: E501
return self.api_client.call_api('/store/order', 'POST', return self.api_client.call_api(
path_params, '/store/order', 'POST',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type='Order', files=local_var_files,
auth_settings=auth_settings, response_type='Order', # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,19 +13,17 @@
from __future__ import absolute_import from __future__ import absolute_import
import sys import re # noqa: F401
import os
import re
# python 2 and python 3 compatibility library # python 2 and python 3 compatibility library
from six import iteritems import six
from ..api_client import ApiClient from petstore_api.api_client import ApiClient
class UserApi(object): class UserApi(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen Ref: https://github.com/swagger-api/swagger-codegen
""" """
@ -35,10 +33,10 @@ class UserApi(object):
api_client = ApiClient() api_client = ApiClient()
self.api_client = api_client self.api_client = api_client
def create_user(self, body, **kwargs): def create_user(self, body, **kwargs): # noqa: E501
""" """Create user # noqa: E501
Create user
This can only be done by the logged in user. This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.create_user(body, async=True) >>> thread = api.create_user(body, async=True)
@ -52,15 +50,15 @@ class UserApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.create_user_with_http_info(body, **kwargs) return self.create_user_with_http_info(body, **kwargs) # noqa: E501
else: else:
(data) = self.create_user_with_http_info(body, **kwargs) (data) = self.create_user_with_http_info(body, **kwargs) # noqa: E501
return data return data
def create_user_with_http_info(self, body, **kwargs): def create_user_with_http_info(self, body, **kwargs): # noqa: E501
""" """Create user # noqa: E501
Create user
This can only be done by the logged in user. This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.create_user_with_http_info(body, async=True) >>> thread = api.create_user_with_http_info(body, async=True)
@ -73,14 +71,14 @@ class UserApi(object):
returns the request thread. returns the request thread.
""" """
all_params = ['body'] all_params = ['body'] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -89,9 +87,9 @@ class UserApi(object):
params[key] = val params[key] = val
del params['kwargs'] del params['kwargs']
# verify the required parameter 'body' is set # verify the required parameter 'body' is set
if ('body' not in params) or (params['body'] is None): if ('body' not in params or
raise ValueError("Missing the required parameter `body` when calling `create_user`") params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `create_user`") # noqa: E501
collection_formats = {} collection_formats = {}
@ -108,31 +106,32 @@ class UserApi(object):
if 'body' in params: if 'body' in params:
body_params = params['body'] body_params = params['body']
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/xml', 'application/json']) ['application/xml', 'application/json']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = [] auth_settings = [] # noqa: E501
return self.api_client.call_api('/user', 'POST', return self.api_client.call_api(
path_params, '/user', 'POST',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type=None, files=local_var_files,
auth_settings=auth_settings, response_type=None, # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def create_users_with_array_input(self, body, **kwargs): def create_users_with_array_input(self, body, **kwargs): # noqa: E501
""" """Creates list of users with given input array # noqa: E501
Creates list of users with given input array
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.create_users_with_array_input(body, async=True) >>> thread = api.create_users_with_array_input(body, async=True)
@ -146,15 +145,15 @@ class UserApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.create_users_with_array_input_with_http_info(body, **kwargs) return self.create_users_with_array_input_with_http_info(body, **kwargs) # noqa: E501
else: else:
(data) = self.create_users_with_array_input_with_http_info(body, **kwargs) (data) = self.create_users_with_array_input_with_http_info(body, **kwargs) # noqa: E501
return data return data
def create_users_with_array_input_with_http_info(self, body, **kwargs): def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: E501
""" """Creates list of users with given input array # noqa: E501
Creates list of users with given input array
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.create_users_with_array_input_with_http_info(body, async=True) >>> thread = api.create_users_with_array_input_with_http_info(body, async=True)
@ -167,14 +166,14 @@ class UserApi(object):
returns the request thread. returns the request thread.
""" """
all_params = ['body'] all_params = ['body'] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -183,9 +182,9 @@ class UserApi(object):
params[key] = val params[key] = val
del params['kwargs'] del params['kwargs']
# verify the required parameter 'body' is set # verify the required parameter 'body' is set
if ('body' not in params) or (params['body'] is None): if ('body' not in params or
raise ValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") # noqa: E501
collection_formats = {} collection_formats = {}
@ -202,31 +201,32 @@ class UserApi(object):
if 'body' in params: if 'body' in params:
body_params = params['body'] body_params = params['body']
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/xml', 'application/json']) ['application/xml', 'application/json']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = [] auth_settings = [] # noqa: E501
return self.api_client.call_api('/user/createWithArray', 'POST', return self.api_client.call_api(
path_params, '/user/createWithArray', 'POST',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type=None, files=local_var_files,
auth_settings=auth_settings, response_type=None, # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def create_users_with_list_input(self, body, **kwargs): def create_users_with_list_input(self, body, **kwargs): # noqa: E501
""" """Creates list of users with given input array # noqa: E501
Creates list of users with given input array
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.create_users_with_list_input(body, async=True) >>> thread = api.create_users_with_list_input(body, async=True)
@ -240,15 +240,15 @@ class UserApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.create_users_with_list_input_with_http_info(body, **kwargs) return self.create_users_with_list_input_with_http_info(body, **kwargs) # noqa: E501
else: else:
(data) = self.create_users_with_list_input_with_http_info(body, **kwargs) (data) = self.create_users_with_list_input_with_http_info(body, **kwargs) # noqa: E501
return data return data
def create_users_with_list_input_with_http_info(self, body, **kwargs): def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: E501
""" """Creates list of users with given input array # noqa: E501
Creates list of users with given input array
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.create_users_with_list_input_with_http_info(body, async=True) >>> thread = api.create_users_with_list_input_with_http_info(body, async=True)
@ -261,14 +261,14 @@ class UserApi(object):
returns the request thread. returns the request thread.
""" """
all_params = ['body'] all_params = ['body'] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -277,9 +277,9 @@ class UserApi(object):
params[key] = val params[key] = val
del params['kwargs'] del params['kwargs']
# verify the required parameter 'body' is set # verify the required parameter 'body' is set
if ('body' not in params) or (params['body'] is None): if ('body' not in params or
raise ValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") # noqa: E501
collection_formats = {} collection_formats = {}
@ -296,31 +296,32 @@ class UserApi(object):
if 'body' in params: if 'body' in params:
body_params = params['body'] body_params = params['body']
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/xml', 'application/json']) ['application/xml', 'application/json']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = [] auth_settings = [] # noqa: E501
return self.api_client.call_api('/user/createWithList', 'POST', return self.api_client.call_api(
path_params, '/user/createWithList', 'POST',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type=None, files=local_var_files,
auth_settings=auth_settings, response_type=None, # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def delete_user(self, username, **kwargs): def delete_user(self, username, **kwargs): # noqa: E501
""" """Delete user # noqa: E501
Delete user
This can only be done by the logged in user. This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.delete_user(username, async=True) >>> thread = api.delete_user(username, async=True)
@ -334,15 +335,15 @@ class UserApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.delete_user_with_http_info(username, **kwargs) return self.delete_user_with_http_info(username, **kwargs) # noqa: E501
else: else:
(data) = self.delete_user_with_http_info(username, **kwargs) (data) = self.delete_user_with_http_info(username, **kwargs) # noqa: E501
return data return data
def delete_user_with_http_info(self, username, **kwargs): def delete_user_with_http_info(self, username, **kwargs): # noqa: E501
""" """Delete user # noqa: E501
Delete user
This can only be done by the logged in user. This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.delete_user_with_http_info(username, async=True) >>> thread = api.delete_user_with_http_info(username, async=True)
@ -355,14 +356,14 @@ class UserApi(object):
returns the request thread. returns the request thread.
""" """
all_params = ['username'] all_params = ['username'] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -371,15 +372,15 @@ class UserApi(object):
params[key] = val params[key] = val
del params['kwargs'] del params['kwargs']
# verify the required parameter 'username' is set # verify the required parameter 'username' is set
if ('username' not in params) or (params['username'] is None): if ('username' not in params or
raise ValueError("Missing the required parameter `username` when calling `delete_user`") params['username'] is None):
raise ValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501
collection_formats = {} collection_formats = {}
path_params = {} path_params = {}
if 'username' in params: if 'username' in params:
path_params['username'] = params['username'] path_params['username'] = params['username'] # noqa: E501
query_params = [] query_params = []
@ -390,31 +391,32 @@ class UserApi(object):
body_params = None body_params = None
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/xml', 'application/json']) ['application/xml', 'application/json']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = [] auth_settings = [] # noqa: E501
return self.api_client.call_api('/user/{username}', 'DELETE', return self.api_client.call_api(
path_params, '/user/{username}', 'DELETE',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type=None, files=local_var_files,
auth_settings=auth_settings, response_type=None, # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_user_by_name(self, username, **kwargs): def get_user_by_name(self, username, **kwargs): # noqa: E501
""" """Get user by user name # noqa: E501
Get user by user name
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.get_user_by_name(username, async=True) >>> thread = api.get_user_by_name(username, async=True)
@ -428,15 +430,15 @@ class UserApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.get_user_by_name_with_http_info(username, **kwargs) return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501
else: else:
(data) = self.get_user_by_name_with_http_info(username, **kwargs) (data) = self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501
return data return data
def get_user_by_name_with_http_info(self, username, **kwargs): def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501
""" """Get user by user name # noqa: E501
Get user by user name
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.get_user_by_name_with_http_info(username, async=True) >>> thread = api.get_user_by_name_with_http_info(username, async=True)
@ -449,14 +451,14 @@ class UserApi(object):
returns the request thread. returns the request thread.
""" """
all_params = ['username'] all_params = ['username'] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -465,15 +467,15 @@ class UserApi(object):
params[key] = val params[key] = val
del params['kwargs'] del params['kwargs']
# verify the required parameter 'username' is set # verify the required parameter 'username' is set
if ('username' not in params) or (params['username'] is None): if ('username' not in params or
raise ValueError("Missing the required parameter `username` when calling `get_user_by_name`") params['username'] is None):
raise ValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501
collection_formats = {} collection_formats = {}
path_params = {} path_params = {}
if 'username' in params: if 'username' in params:
path_params['username'] = params['username'] path_params['username'] = params['username'] # noqa: E501
query_params = [] query_params = []
@ -484,31 +486,32 @@ class UserApi(object):
body_params = None body_params = None
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/xml', 'application/json']) ['application/xml', 'application/json']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = [] auth_settings = [] # noqa: E501
return self.api_client.call_api('/user/{username}', 'GET', return self.api_client.call_api(
path_params, '/user/{username}', 'GET',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type='User', files=local_var_files,
auth_settings=auth_settings, response_type='User', # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def login_user(self, username, password, **kwargs): def login_user(self, username, password, **kwargs): # noqa: E501
""" """Logs user into the system # noqa: E501
Logs user into the system
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.login_user(username, password, async=True) >>> thread = api.login_user(username, password, async=True)
@ -523,15 +526,15 @@ class UserApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.login_user_with_http_info(username, password, **kwargs) return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501
else: else:
(data) = self.login_user_with_http_info(username, password, **kwargs) (data) = self.login_user_with_http_info(username, password, **kwargs) # noqa: E501
return data return data
def login_user_with_http_info(self, username, password, **kwargs): def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501
""" """Logs user into the system # noqa: E501
Logs user into the system
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.login_user_with_http_info(username, password, async=True) >>> thread = api.login_user_with_http_info(username, password, async=True)
@ -545,14 +548,14 @@ class UserApi(object):
returns the request thread. returns the request thread.
""" """
all_params = ['username', 'password'] all_params = ['username', 'password'] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -561,12 +564,13 @@ class UserApi(object):
params[key] = val params[key] = val
del params['kwargs'] del params['kwargs']
# verify the required parameter 'username' is set # verify the required parameter 'username' is set
if ('username' not in params) or (params['username'] is None): if ('username' not in params or
raise ValueError("Missing the required parameter `username` when calling `login_user`") params['username'] is None):
raise ValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501
# verify the required parameter 'password' is set # verify the required parameter 'password' is set
if ('password' not in params) or (params['password'] is None): if ('password' not in params or
raise ValueError("Missing the required parameter `password` when calling `login_user`") params['password'] is None):
raise ValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501
collection_formats = {} collection_formats = {}
@ -574,9 +578,9 @@ class UserApi(object):
query_params = [] query_params = []
if 'username' in params: if 'username' in params:
query_params.append(('username', params['username'])) query_params.append(('username', params['username'])) # noqa: E501
if 'password' in params: if 'password' in params:
query_params.append(('password', params['password'])) query_params.append(('password', params['password'])) # noqa: E501
header_params = {} header_params = {}
@ -585,31 +589,32 @@ class UserApi(object):
body_params = None body_params = None
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/xml', 'application/json']) ['application/xml', 'application/json']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = [] auth_settings = [] # noqa: E501
return self.api_client.call_api('/user/login', 'GET', return self.api_client.call_api(
path_params, '/user/login', 'GET',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type='str', files=local_var_files,
auth_settings=auth_settings, response_type='str', # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def logout_user(self, **kwargs): def logout_user(self, **kwargs): # noqa: E501
""" """Logs out current logged in user session # noqa: E501
Logs out current logged in user session
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.logout_user(async=True) >>> thread = api.logout_user(async=True)
@ -622,15 +627,15 @@ class UserApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.logout_user_with_http_info(**kwargs) return self.logout_user_with_http_info(**kwargs) # noqa: E501
else: else:
(data) = self.logout_user_with_http_info(**kwargs) (data) = self.logout_user_with_http_info(**kwargs) # noqa: E501
return data return data
def logout_user_with_http_info(self, **kwargs): def logout_user_with_http_info(self, **kwargs): # noqa: E501
""" """Logs out current logged in user session # noqa: E501
Logs out current logged in user session
# noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.logout_user_with_http_info(async=True) >>> thread = api.logout_user_with_http_info(async=True)
@ -642,14 +647,14 @@ class UserApi(object):
returns the request thread. returns the request thread.
""" """
all_params = [] all_params = [] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -671,31 +676,32 @@ class UserApi(object):
body_params = None body_params = None
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/xml', 'application/json']) ['application/xml', 'application/json']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = [] auth_settings = [] # noqa: E501
return self.api_client.call_api('/user/logout', 'GET', return self.api_client.call_api(
path_params, '/user/logout', 'GET',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type=None, files=local_var_files,
auth_settings=auth_settings, response_type=None, # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def update_user(self, username, body, **kwargs): def update_user(self, username, body, **kwargs): # noqa: E501
""" """Updated user # noqa: E501
Updated user
This can only be done by the logged in user. This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.update_user(username, body, async=True) >>> thread = api.update_user(username, body, async=True)
@ -710,15 +716,15 @@ class UserApi(object):
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
if kwargs.get('async'): if kwargs.get('async'):
return self.update_user_with_http_info(username, body, **kwargs) return self.update_user_with_http_info(username, body, **kwargs) # noqa: E501
else: else:
(data) = self.update_user_with_http_info(username, body, **kwargs) (data) = self.update_user_with_http_info(username, body, **kwargs) # noqa: E501
return data return data
def update_user_with_http_info(self, username, body, **kwargs): def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501
""" """Updated user # noqa: E501
Updated user
This can only be done by the logged in user. This can only be done by the logged in user. # noqa: E501
This method makes a synchronous HTTP request by default. To make an This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True asynchronous HTTP request, please pass async=True
>>> thread = api.update_user_with_http_info(username, body, async=True) >>> thread = api.update_user_with_http_info(username, body, async=True)
@ -732,14 +738,14 @@ class UserApi(object):
returns the request thread. returns the request thread.
""" """
all_params = ['username', 'body'] all_params = ['username', 'body'] # noqa: E501
all_params.append('async') all_params.append('async')
all_params.append('_return_http_data_only') all_params.append('_return_http_data_only')
all_params.append('_preload_content') all_params.append('_preload_content')
all_params.append('_request_timeout') all_params.append('_request_timeout')
params = locals() params = locals()
for key, val in iteritems(params['kwargs']): for key, val in six.iteritems(params['kwargs']):
if key not in all_params: if key not in all_params:
raise TypeError( raise TypeError(
"Got an unexpected keyword argument '%s'" "Got an unexpected keyword argument '%s'"
@ -748,18 +754,19 @@ class UserApi(object):
params[key] = val params[key] = val
del params['kwargs'] del params['kwargs']
# verify the required parameter 'username' is set # verify the required parameter 'username' is set
if ('username' not in params) or (params['username'] is None): if ('username' not in params or
raise ValueError("Missing the required parameter `username` when calling `update_user`") params['username'] is None):
raise ValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501
# verify the required parameter 'body' is set # verify the required parameter 'body' is set
if ('body' not in params) or (params['body'] is None): if ('body' not in params or
raise ValueError("Missing the required parameter `body` when calling `update_user`") params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `update_user`") # noqa: E501
collection_formats = {} collection_formats = {}
path_params = {} path_params = {}
if 'username' in params: if 'username' in params:
path_params['username'] = params['username'] path_params['username'] = params['username'] # noqa: E501
query_params = [] query_params = []
@ -772,23 +779,24 @@ class UserApi(object):
if 'body' in params: if 'body' in params:
body_params = params['body'] body_params = params['body']
# HTTP header `Accept` # HTTP header `Accept`
header_params['Accept'] = self.api_client.\ header_params['Accept'] = self.api_client.select_header_accept(
select_header_accept(['application/xml', 'application/json']) ['application/xml', 'application/json']) # noqa: E501
# Authentication setting # Authentication setting
auth_settings = [] auth_settings = [] # noqa: E501
return self.api_client.call_api('/user/{username}', 'PUT', return self.api_client.call_api(
path_params, '/user/{username}', 'PUT',
query_params, path_params,
header_params, query_params,
body=body_params, header_params,
post_params=form_params, body=body_params,
files=local_var_files, post_params=form_params,
response_type=None, files=local_var_files,
auth_settings=auth_settings, response_type=None, # noqa: E501
async=params.get('async'), auth_settings=auth_settings,
_return_http_data_only=params.get('_return_http_data_only'), async=params.get('async'),
_preload_content=params.get('_preload_content', True), _return_http_data_only=params.get('_return_http_data_only'),
_request_timeout=params.get('_request_timeout'), _preload_content=params.get('_preload_content', True),
collection_formats=collection_formats) _request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)

View File

@ -2,7 +2,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,27 +11,25 @@
from __future__ import absolute_import from __future__ import absolute_import
import os import datetime
import re
import json import json
import mimetypes import mimetypes
import tempfile
from multiprocessing.pool import ThreadPool from multiprocessing.pool import ThreadPool
import os
from datetime import date, datetime import re
import tempfile
# python 2 and python 3 compatibility library # python 2 and python 3 compatibility library
from six import PY3, integer_types, iteritems, text_type import six
from six.moves.urllib.parse import quote from six.moves.urllib.parse import quote
from . import models from petstore_api.configuration import Configuration
from .configuration import Configuration import petstore_api.models
from .rest import ApiException, RESTClientObject from petstore_api import rest
class ApiClient(object): class ApiClient(object):
""" """Generic API client for Swagger client library builds.
Generic API client for Swagger client library builds.
Swagger generic API client. This client handles the client- Swagger generic API client. This client handles the client-
server communication, and is invariant across implementations. Specifics of server communication, and is invariant across implementations. Specifics of
@ -42,64 +40,63 @@ class ApiClient(object):
Ref: https://github.com/swagger-api/swagger-codegen Ref: https://github.com/swagger-api/swagger-codegen
Do not edit the class manually. Do not edit the class manually.
:param host: The base path for the server to call. :param configuration: .Configuration object for this client
:param header_name: a header to pass when making calls to the API. :param header_name: a header to pass when making calls to the API.
:param header_value: a header value to pass when making calls to the API. :param header_value: a header value to pass when making calls to
the API.
:param cookie: a cookie to include in the header when making calls
to the API
""" """
PRIMITIVE_TYPES = (float, bool, bytes, text_type) + integer_types PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types
NATIVE_TYPES_MAPPING = { NATIVE_TYPES_MAPPING = {
'int': int, 'int': int,
'long': int if PY3 else long, 'long': int if six.PY3 else long, # noqa: F821
'float': float, 'float': float,
'str': str, 'str': str,
'bool': bool, 'bool': bool,
'date': date, 'date': datetime.date,
'datetime': datetime, 'datetime': datetime.datetime,
'object': object, 'object': object,
} }
def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None): def __init__(self, configuration=None, header_name=None, header_value=None,
cookie=None):
if configuration is None: if configuration is None:
configuration = Configuration() configuration = Configuration()
self.configuration = configuration self.configuration = configuration
self.pool = ThreadPool() self.pool = ThreadPool()
self.rest_client = RESTClientObject(configuration) self.rest_client = rest.RESTClientObject(configuration)
self.default_headers = {} self.default_headers = {}
if header_name is not None: if header_name is not None:
self.default_headers[header_name] = header_value self.default_headers[header_name] = header_value
self.cookie = cookie self.cookie = cookie
# Set default User-Agent. # Set default User-Agent.
self.user_agent = 'Swagger-Codegen/1.0.0/python' self.user_agent = 'Swagger-Codegen/1.0.0/python'
def __del__(self): def __del__(self):
self.pool.close() self.pool.close()
self.pool.join() self.pool.join()
@property @property
def user_agent(self): def user_agent(self):
""" """User agent for this API client"""
Gets user agent.
"""
return self.default_headers['User-Agent'] return self.default_headers['User-Agent']
@user_agent.setter @user_agent.setter
def user_agent(self, value): def user_agent(self, value):
"""
Sets user agent.
"""
self.default_headers['User-Agent'] = value self.default_headers['User-Agent'] = value
def set_default_header(self, header_name, header_value): def set_default_header(self, header_name, header_value):
self.default_headers[header_name] = header_value self.default_headers[header_name] = header_value
async def __call_api(self, resource_path, method, async def __call_api(
path_params=None, query_params=None, header_params=None, self, resource_path, method, path_params=None,
body=None, post_params=None, files=None, query_params=None, header_params=None, body=None, post_params=None,
response_type=None, auth_settings=None, files=None, response_type=None, auth_settings=None,
_return_http_data_only=None, collection_formats=None, _preload_content=True, _return_http_data_only=None, collection_formats=None,
_request_timeout=None): _preload_content=True, _request_timeout=None):
config = self.configuration config = self.configuration
@ -121,7 +118,9 @@ class ApiClient(object):
for k, v in path_params: for k, v in path_params:
# specified safe chars, encode everything # specified safe chars, encode everything
resource_path = resource_path.replace( resource_path = resource_path.replace(
'{%s}' % k, quote(str(v), safe=config.safe_chars_for_path_param)) '{%s}' % k,
quote(str(v), safe=config.safe_chars_for_path_param)
)
# query parameters # query parameters
if query_params: if query_params:
@ -147,12 +146,11 @@ class ApiClient(object):
url = self.configuration.host + resource_path url = self.configuration.host + resource_path
# perform request and return response # perform request and return response
response_data = await self.request(method, url, response_data = await self.request(
query_params=query_params, method, url, query_params=query_params, headers=header_params,
headers=header_params, post_params=post_params, body=body,
post_params=post_params, body=body, _preload_content=_preload_content,
_preload_content=_preload_content, _request_timeout=_request_timeout)
_request_timeout=_request_timeout)
self.last_response = response_data self.last_response = response_data
@ -167,11 +165,11 @@ class ApiClient(object):
if _return_http_data_only: if _return_http_data_only:
return (return_data) return (return_data)
else: else:
return (return_data, response_data.status, response_data.getheaders()) return (return_data, response_data.status,
response_data.getheaders())
def sanitize_for_serialization(self, obj): def sanitize_for_serialization(self, obj):
""" """Builds a JSON POST object.
Builds a JSON POST object.
If obj is None, return None. If obj is None, return None.
If obj is str, int, long, float, bool, return directly. If obj is str, int, long, float, bool, return directly.
@ -194,7 +192,7 @@ class ApiClient(object):
elif isinstance(obj, tuple): elif isinstance(obj, tuple):
return tuple(self.sanitize_for_serialization(sub_obj) return tuple(self.sanitize_for_serialization(sub_obj)
for sub_obj in obj) for sub_obj in obj)
elif isinstance(obj, (datetime, date)): elif isinstance(obj, (datetime.datetime, datetime.date)):
return obj.isoformat() return obj.isoformat()
if isinstance(obj, dict): if isinstance(obj, dict):
@ -206,15 +204,14 @@ class ApiClient(object):
# Convert attribute name to json key in # Convert attribute name to json key in
# model definition for request. # model definition for request.
obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) obj_dict = {obj.attribute_map[attr]: getattr(obj, attr)
for attr, _ in iteritems(obj.swagger_types) for attr, _ in six.iteritems(obj.swagger_types)
if getattr(obj, attr) is not None} if getattr(obj, attr) is not None}
return {key: self.sanitize_for_serialization(val) return {key: self.sanitize_for_serialization(val)
for key, val in iteritems(obj_dict)} for key, val in six.iteritems(obj_dict)}
def deserialize(self, response, response_type): def deserialize(self, response, response_type):
""" """Deserializes response into an object.
Deserializes response into an object.
:param response: RESTResponse object to be deserialized. :param response: RESTResponse object to be deserialized.
:param response_type: class literal for :param response_type: class literal for
@ -236,8 +233,7 @@ class ApiClient(object):
return self.__deserialize(data, response_type) return self.__deserialize(data, response_type)
def __deserialize(self, data, klass): def __deserialize(self, data, klass):
""" """Deserializes dict, list, str into an object.
Deserializes dict, list, str into an object.
:param data: dict, list or str. :param data: dict, list or str.
:param klass: class literal, or string of class name. :param klass: class literal, or string of class name.
@ -256,21 +252,21 @@ class ApiClient(object):
if klass.startswith('dict('): if klass.startswith('dict('):
sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2) sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2)
return {k: self.__deserialize(v, sub_kls) return {k: self.__deserialize(v, sub_kls)
for k, v in iteritems(data)} for k, v in six.iteritems(data)}
# convert str to class # convert str to class
if klass in self.NATIVE_TYPES_MAPPING: if klass in self.NATIVE_TYPES_MAPPING:
klass = self.NATIVE_TYPES_MAPPING[klass] klass = self.NATIVE_TYPES_MAPPING[klass]
else: else:
klass = getattr(models, klass) klass = getattr(petstore_api.models, klass)
if klass in self.PRIMITIVE_TYPES: if klass in self.PRIMITIVE_TYPES:
return self.__deserialize_primitive(data, klass) return self.__deserialize_primitive(data, klass)
elif klass == object: elif klass == object:
return self.__deserialize_object(data) return self.__deserialize_object(data)
elif klass == date: elif klass == datetime.date:
return self.__deserialize_date(data) return self.__deserialize_date(data)
elif klass == datetime: elif klass == datetime.datetime:
return self.__deserialize_datatime(data) return self.__deserialize_datatime(data)
else: else:
return self.__deserialize_model(data, klass) return self.__deserialize_model(data, klass)
@ -279,10 +275,10 @@ class ApiClient(object):
path_params=None, query_params=None, header_params=None, path_params=None, query_params=None, header_params=None,
body=None, post_params=None, files=None, body=None, post_params=None, files=None,
response_type=None, auth_settings=None, async=None, response_type=None, auth_settings=None, async=None,
_return_http_data_only=None, collection_formats=None, _preload_content=True, _return_http_data_only=None, collection_formats=None,
_request_timeout=None): _preload_content=True, _request_timeout=None):
""" """Makes the HTTP request (synchronous) and returns deserialized data.
Makes the HTTP request (synchronous) and return the deserialized data.
To make an async request, set the async parameter. To make an async request, set the async parameter.
:param resource_path: Path to method endpoint. :param resource_path: Path to method endpoint.
@ -299,13 +295,17 @@ class ApiClient(object):
:param files dict: key -> filename, value -> filepath, :param files dict: key -> filename, value -> filepath,
for `multipart/form-data`. for `multipart/form-data`.
:param async bool: execute request asynchronously :param async bool: execute request asynchronously
:param _return_http_data_only: response data without head status code and headers :param _return_http_data_only: response data without head status code
and headers
:param collection_formats: dict of collection formats for path, query, :param collection_formats: dict of collection formats for path, query,
header, and post parameters. header, and post parameters.
:param _preload_content: if False, the urllib3.HTTPResponse object will be returned without :param _preload_content: if False, the urllib3.HTTPResponse object will
reading/decoding response data. Default is True. be returned without reading/decoding response
:param _request_timeout: timeout setting for this request. If one number provided, it will be total request data. Default is True.
timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:return: :return:
If async parameter is True, If async parameter is True,
the request will be called asynchronously. the request will be called asynchronously.
@ -318,22 +318,23 @@ class ApiClient(object):
path_params, query_params, header_params, path_params, query_params, header_params,
body, post_params, files, body, post_params, files,
response_type, auth_settings, response_type, auth_settings,
_return_http_data_only, collection_formats, _preload_content, _request_timeout) _return_http_data_only, collection_formats,
_preload_content, _request_timeout)
else: else:
thread = self.pool.apply_async(self.__call_api, (resource_path, method, thread = self.pool.apply_async(self.__call_api, (resource_path,
path_params, query_params, method, path_params, query_params,
header_params, body, header_params, body,
post_params, files, post_params, files,
response_type, auth_settings, response_type, auth_settings,
_return_http_data_only, _return_http_data_only,
collection_formats, _preload_content, _request_timeout)) collection_formats,
_preload_content, _request_timeout))
return thread return thread
def request(self, method, url, query_params=None, headers=None, def request(self, method, url, query_params=None, headers=None,
post_params=None, body=None, _preload_content=True, _request_timeout=None): post_params=None, body=None, _preload_content=True,
""" _request_timeout=None):
Makes the HTTP request using RESTClient. """Makes the HTTP request using RESTClient."""
"""
if method == "GET": if method == "GET":
return self.rest_client.GET(url, return self.rest_client.GET(url,
query_params=query_params, query_params=query_params,
@ -392,8 +393,7 @@ class ApiClient(object):
) )
def parameters_to_tuples(self, params, collection_formats): def parameters_to_tuples(self, params, collection_formats):
""" """Get parameters as list of tuples, formatting collections.
Get parameters as list of tuples, formatting collections.
:param params: Parameters as dict or list of two-tuples :param params: Parameters as dict or list of two-tuples
:param dict collection_formats: Parameter collection formats :param dict collection_formats: Parameter collection formats
@ -402,7 +402,7 @@ class ApiClient(object):
new_params = [] new_params = []
if collection_formats is None: if collection_formats is None:
collection_formats = {} collection_formats = {}
for k, v in iteritems(params) if isinstance(params, dict) else params: for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501
if k in collection_formats: if k in collection_formats:
collection_format = collection_formats[k] collection_format = collection_formats[k]
if collection_format == 'multi': if collection_format == 'multi':
@ -423,8 +423,7 @@ class ApiClient(object):
return new_params return new_params
def prepare_post_parameters(self, post_params=None, files=None): def prepare_post_parameters(self, post_params=None, files=None):
""" """Builds form parameters.
Builds form parameters.
:param post_params: Normal form parameters. :param post_params: Normal form parameters.
:param files: File parameters. :param files: File parameters.
@ -436,7 +435,7 @@ class ApiClient(object):
params = post_params params = post_params
if files: if files:
for k, v in iteritems(files): for k, v in six.iteritems(files):
if not v: if not v:
continue continue
file_names = v if type(v) is list else [v] file_names = v if type(v) is list else [v]
@ -444,15 +443,15 @@ class ApiClient(object):
with open(n, 'rb') as f: with open(n, 'rb') as f:
filename = os.path.basename(f.name) filename = os.path.basename(f.name)
filedata = f.read() filedata = f.read()
mimetype = mimetypes.\ mimetype = (mimetypes.guess_type(filename)[0] or
guess_type(filename)[0] or 'application/octet-stream' 'application/octet-stream')
params.append(tuple([k, tuple([filename, filedata, mimetype])])) params.append(
tuple([k, tuple([filename, filedata, mimetype])]))
return params return params
def select_header_accept(self, accepts): def select_header_accept(self, accepts):
""" """Returns `Accept` based on an array of accepts provided.
Returns `Accept` based on an array of accepts provided.
:param accepts: List of headers. :param accepts: List of headers.
:return: Accept (e.g. application/json). :return: Accept (e.g. application/json).
@ -468,8 +467,7 @@ class ApiClient(object):
return ', '.join(accepts) return ', '.join(accepts)
def select_header_content_type(self, content_types): def select_header_content_type(self, content_types):
""" """Returns `Content-Type` based on an array of content_types provided.
Returns `Content-Type` based on an array of content_types provided.
:param content_types: List of content-types. :param content_types: List of content-types.
:return: Content-Type (e.g. application/json). :return: Content-Type (e.g. application/json).
@ -485,8 +483,7 @@ class ApiClient(object):
return content_types[0] return content_types[0]
def update_params_for_auth(self, headers, querys, auth_settings): def update_params_for_auth(self, headers, querys, auth_settings):
""" """Updates header and query params based on authentication setting.
Updates header and query params based on authentication setting.
:param headers: Header parameters dict to be updated. :param headers: Header parameters dict to be updated.
:param querys: Query parameters tuple list to be updated. :param querys: Query parameters tuple list to be updated.
@ -510,7 +507,8 @@ class ApiClient(object):
) )
def __deserialize_file(self, response): def __deserialize_file(self, response):
""" """Deserializes body to file
Saves response body into a file in a temporary folder, Saves response body into a file in a temporary folder,
using the filename from the `Content-Disposition` header if provided. using the filename from the `Content-Disposition` header if provided.
@ -523,9 +521,8 @@ class ApiClient(object):
content_disposition = response.getheader("Content-Disposition") content_disposition = response.getheader("Content-Disposition")
if content_disposition: if content_disposition:
filename = re.\ filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?',
search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition).\ content_disposition).group(1)
group(1)
path = os.path.join(os.path.dirname(path), filename) path = os.path.join(os.path.dirname(path), filename)
with open(path, "w") as f: with open(path, "w") as f:
@ -534,8 +531,7 @@ class ApiClient(object):
return path return path
def __deserialize_primitive(self, data, klass): def __deserialize_primitive(self, data, klass):
""" """Deserializes string to primitive type.
Deserializes string to primitive type.
:param data: str. :param data: str.
:param klass: class literal. :param klass: class literal.
@ -545,21 +541,19 @@ class ApiClient(object):
try: try:
return klass(data) return klass(data)
except UnicodeEncodeError: except UnicodeEncodeError:
return unicode(data) return unicode(data) # noqa: F821
except TypeError: except TypeError:
return data return data
def __deserialize_object(self, value): def __deserialize_object(self, value):
""" """Return a original value.
Return a original value.
:return: object. :return: object.
""" """
return value return value
def __deserialize_date(self, string): def __deserialize_date(self, string):
""" """Deserializes string to date.
Deserializes string to date.
:param string: str. :param string: str.
:return: date. :return: date.
@ -570,14 +564,13 @@ class ApiClient(object):
except ImportError: except ImportError:
return string return string
except ValueError: except ValueError:
raise ApiException( raise rest.ApiException(
status=0, status=0,
reason="Failed to parse `{0}` into a date object".format(string) reason="Failed to parse `{0}` as date object".format(string)
) )
def __deserialize_datatime(self, string): def __deserialize_datatime(self, string):
""" """Deserializes string to datetime.
Deserializes string to datetime.
The string should be in iso8601 datetime format. The string should be in iso8601 datetime format.
@ -590,32 +583,32 @@ class ApiClient(object):
except ImportError: except ImportError:
return string return string
except ValueError: except ValueError:
raise ApiException( raise rest.ApiException(
status=0, status=0,
reason=( reason=(
"Failed to parse `{0}` into a datetime object" "Failed to parse `{0}` as datetime object"
.format(string) .format(string)
) )
) )
def __deserialize_model(self, data, klass): def __deserialize_model(self, data, klass):
""" """Deserializes list or dict to model.
Deserializes list or dict to model.
:param data: dict, list. :param data: dict, list.
:param klass: class literal. :param klass: class literal.
:return: model object. :return: model object.
""" """
if not klass.swagger_types and not hasattr(klass, 'get_real_child_model'): if not klass.swagger_types and not hasattr(klass,
'get_real_child_model'):
return data return data
kwargs = {} kwargs = {}
if klass.swagger_types is not None: if klass.swagger_types is not None:
for attr, attr_type in iteritems(klass.swagger_types): for attr, attr_type in six.iteritems(klass.swagger_types):
if data is not None \ if (data is not None and
and klass.attribute_map[attr] in data \ klass.attribute_map[attr] in data and
and isinstance(data, (list, dict)): isinstance(data, (list, dict))):
value = data[klass.attribute_map[attr]] value = data[klass.attribute_map[attr]]
kwargs[attr] = self.__deserialize(value, attr_type) kwargs[attr] = self.__deserialize(value, attr_type)

View File

@ -1,9 +0,0 @@
from __future__ import absolute_import
# import apis into api package
from .another_fake_api import AnotherFakeApi
from .fake_api import FakeApi
from .fake_classname_tags_123_api import FakeClassnameTags123Api
from .pet_api import PetApi
from .store_api import StoreApi
from .user_api import UserApi

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,24 +13,23 @@
from __future__ import absolute_import from __future__ import absolute_import
import urllib3
import copy import copy
import logging import logging
import multiprocessing import multiprocessing
import sys import sys
import urllib3
from six import iteritems import six
from six import with_metaclass
from six.moves import http_client as httplib from six.moves import http_client as httplib
class TypeWithDefault(type): class TypeWithDefault(type):
def __init__(cls, name, bases, dct): def __init__(cls, name, bases, dct):
super(TypeWithDefault, cls).__init__(name, bases, dct) super(TypeWithDefault, cls).__init__(name, bases, dct)
cls._default = None cls._default = None
def __call__(cls): def __call__(cls):
if cls._default == None: if cls._default is None:
cls._default = type.__call__(cls) cls._default = type.__call__(cls)
return copy.copy(cls._default) return copy.copy(cls._default)
@ -38,17 +37,15 @@ class TypeWithDefault(type):
cls._default = copy.copy(default) cls._default = copy.copy(default)
class Configuration(with_metaclass(TypeWithDefault, object)): class Configuration(six.with_metaclass(TypeWithDefault, object)):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Ref: https://github.com/swagger-api/swagger-codegen Ref: https://github.com/swagger-api/swagger-codegen
Do not edit the class manually. Do not edit the class manually.
""" """
def __init__(self): def __init__(self):
""" """Constructor"""
Constructor
"""
# Default Base url # Default Base url
self.host = "http://petstore.swagger.io:80/v2" self.host = "http://petstore.swagger.io:80/v2"
# Temp file folder for downloading files # Temp file folder for downloading files
@ -83,7 +80,8 @@ class Configuration(with_metaclass(TypeWithDefault, object)):
self.debug = False self.debug = False
# SSL/TLS verification # SSL/TLS verification
# Set this to false to skip verifying SSL certificate when calling API from https server. # Set this to false to skip verifying SSL certificate when calling API
# from https server.
self.verify_ssl = True self.verify_ssl = True
# Set this to customize the certificate file to verify the peer. # Set this to customize the certificate file to verify the peer.
self.ssl_ca_cert = None self.ssl_ca_cert = None
@ -101,7 +99,6 @@ class Configuration(with_metaclass(TypeWithDefault, object)):
# cpu_count * 5 is used as default value to increase performance. # cpu_count * 5 is used as default value to increase performance.
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
# Proxy URL # Proxy URL
self.proxy = None self.proxy = None
# Safe chars for path_param # Safe chars for path_param
@ -109,18 +106,22 @@ class Configuration(with_metaclass(TypeWithDefault, object)):
@property @property
def logger_file(self): def logger_file(self):
""" """The logger file.
Gets the logger_file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
""" """
return self.__logger_file return self.__logger_file
@logger_file.setter @logger_file.setter
def logger_file(self, value): def logger_file(self, value):
""" """The logger file.
Sets the logger_file.
If the logger_file is None, then add stream handler and remove file handler. If the logger_file is None, then add stream handler and remove file
Otherwise, add file handler and remove stream handler. handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path. :param value: The logger_file path.
:type: str :type: str
@ -131,7 +132,7 @@ class Configuration(with_metaclass(TypeWithDefault, object)):
# then add file handler and remove stream handler. # then add file handler and remove stream handler.
self.logger_file_handler = logging.FileHandler(self.__logger_file) self.logger_file_handler = logging.FileHandler(self.__logger_file)
self.logger_file_handler.setFormatter(self.logger_formatter) self.logger_file_handler.setFormatter(self.logger_formatter)
for _, logger in iteritems(self.logger): for _, logger in six.iteritems(self.logger):
logger.addHandler(self.logger_file_handler) logger.addHandler(self.logger_file_handler)
if self.logger_stream_handler: if self.logger_stream_handler:
logger.removeHandler(self.logger_stream_handler) logger.removeHandler(self.logger_stream_handler)
@ -140,22 +141,23 @@ class Configuration(with_metaclass(TypeWithDefault, object)):
# then add stream handler and remove file handler. # then add stream handler and remove file handler.
self.logger_stream_handler = logging.StreamHandler() self.logger_stream_handler = logging.StreamHandler()
self.logger_stream_handler.setFormatter(self.logger_formatter) self.logger_stream_handler.setFormatter(self.logger_formatter)
for _, logger in iteritems(self.logger): for _, logger in six.iteritems(self.logger):
logger.addHandler(self.logger_stream_handler) logger.addHandler(self.logger_stream_handler)
if self.logger_file_handler: if self.logger_file_handler:
logger.removeHandler(self.logger_file_handler) logger.removeHandler(self.logger_file_handler)
@property @property
def debug(self): def debug(self):
""" """Debug status
Gets the debug status.
:param value: The debug status, True or False.
:type: bool
""" """
return self.__debug return self.__debug
@debug.setter @debug.setter
def debug(self, value): def debug(self, value):
""" """Debug status
Sets the debug status.
:param value: The debug status, True or False. :param value: The debug status, True or False.
:type: bool :type: bool
@ -163,29 +165,32 @@ class Configuration(with_metaclass(TypeWithDefault, object)):
self.__debug = value self.__debug = value
if self.__debug: if self.__debug:
# if debug status is True, turn on debug logging # if debug status is True, turn on debug logging
for _, logger in iteritems(self.logger): for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.DEBUG) logger.setLevel(logging.DEBUG)
# turn on httplib debug # turn on httplib debug
httplib.HTTPConnection.debuglevel = 1 httplib.HTTPConnection.debuglevel = 1
else: else:
# if debug status is False, turn off debug logging, # if debug status is False, turn off debug logging,
# setting log level to default `logging.WARNING` # setting log level to default `logging.WARNING`
for _, logger in iteritems(self.logger): for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.WARNING) logger.setLevel(logging.WARNING)
# turn off httplib debug # turn off httplib debug
httplib.HTTPConnection.debuglevel = 0 httplib.HTTPConnection.debuglevel = 0
@property @property
def logger_format(self): def logger_format(self):
""" """The logger format.
Gets the logger_format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
""" """
return self.__logger_format return self.__logger_format
@logger_format.setter @logger_format.setter
def logger_format(self, value): def logger_format(self, value):
""" """The logger format.
Sets the logger_format.
The logger_formatter will be updated when sets logger_format. The logger_formatter will be updated when sets logger_format.
@ -196,29 +201,28 @@ class Configuration(with_metaclass(TypeWithDefault, object)):
self.logger_formatter = logging.Formatter(self.__logger_format) self.logger_formatter = logging.Formatter(self.__logger_format)
def get_api_key_with_prefix(self, identifier): def get_api_key_with_prefix(self, identifier):
""" """Gets API key (with prefix if set).
Gets API key (with prefix if set).
:param identifier: The identifier of apiKey. :param identifier: The identifier of apiKey.
:return: The token for api key authentication. :return: The token for api key authentication.
""" """
if self.api_key.get(identifier) and self.api_key_prefix.get(identifier): if (self.api_key.get(identifier) and
return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] self.api_key_prefix.get(identifier)):
return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501
elif self.api_key.get(identifier): elif self.api_key.get(identifier):
return self.api_key[identifier] return self.api_key[identifier]
def get_basic_auth_token(self): def get_basic_auth_token(self):
""" """Gets HTTP basic authentication header (string).
Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication. :return: The token for basic HTTP authentication.
""" """
return urllib3.util.make_headers(basic_auth=self.username + ':' + self.password)\ return urllib3.util.make_headers(
.get('authorization') basic_auth=self.username + ':' + self.password
).get('authorization')
def auth_settings(self): def auth_settings(self):
""" """Gets Auth Settings dict for api client.
Gets Auth Settings dict for api client.
:return: The Auth Settings information dict. :return: The Auth Settings information dict.
""" """
@ -256,8 +260,7 @@ class Configuration(with_metaclass(TypeWithDefault, object)):
} }
def to_debug_report(self): def to_debug_report(self):
""" """Gets the essential information for debugging.
Gets the essential information for debugging.
:return: The report for debugging. :return: The report for debugging.
""" """

View File

@ -1,9 +1,10 @@
# coding: utf-8 # coding: utf-8
# flake8: noqa
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -14,39 +15,39 @@
from __future__ import absolute_import from __future__ import absolute_import
# import models into model package # import models into model package
from .additional_properties_class import AdditionalPropertiesClass from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
from .animal import Animal from petstore_api.models.animal import Animal
from .animal_farm import AnimalFarm from petstore_api.models.animal_farm import AnimalFarm
from .api_response import ApiResponse from petstore_api.models.api_response import ApiResponse
from .array_of_array_of_number_only import ArrayOfArrayOfNumberOnly from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
from .array_of_number_only import ArrayOfNumberOnly from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
from .array_test import ArrayTest from petstore_api.models.array_test import ArrayTest
from .capitalization import Capitalization from petstore_api.models.capitalization import Capitalization
from .category import Category from petstore_api.models.category import Category
from .class_model import ClassModel from petstore_api.models.class_model import ClassModel
from .client import Client from petstore_api.models.client import Client
from .enum_arrays import EnumArrays from petstore_api.models.enum_arrays import EnumArrays
from .enum_class import EnumClass from petstore_api.models.enum_class import EnumClass
from .enum_test import EnumTest from petstore_api.models.enum_test import EnumTest
from .format_test import FormatTest from petstore_api.models.format_test import FormatTest
from .has_only_read_only import HasOnlyReadOnly from petstore_api.models.has_only_read_only import HasOnlyReadOnly
from .list import List from petstore_api.models.list import List
from .map_test import MapTest from petstore_api.models.map_test import MapTest
from .mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
from .model_200_response import Model200Response from petstore_api.models.model_200_response import Model200Response
from .model_return import ModelReturn from petstore_api.models.model_return import ModelReturn
from .name import Name from petstore_api.models.name import Name
from .number_only import NumberOnly from petstore_api.models.number_only import NumberOnly
from .order import Order from petstore_api.models.order import Order
from .outer_boolean import OuterBoolean from petstore_api.models.outer_boolean import OuterBoolean
from .outer_composite import OuterComposite from petstore_api.models.outer_composite import OuterComposite
from .outer_enum import OuterEnum from petstore_api.models.outer_enum import OuterEnum
from .outer_number import OuterNumber from petstore_api.models.outer_number import OuterNumber
from .outer_string import OuterString from petstore_api.models.outer_string import OuterString
from .pet import Pet from petstore_api.models.pet import Pet
from .read_only_first import ReadOnlyFirst from petstore_api.models.read_only_first import ReadOnlyFirst
from .special_model_name import SpecialModelName from petstore_api.models.special_model_name import SpecialModelName
from .tag import Tag from petstore_api.models.tag import Tag
from .user import User from petstore_api.models.user import User
from .cat import Cat from petstore_api.models.cat import Cat
from .dog import Dog from petstore_api.models.dog import Dog

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class AdditionalPropertiesClass(object): class AdditionalPropertiesClass(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -40,36 +40,34 @@ class AdditionalPropertiesClass(object):
'map_of_map_property': 'map_of_map_property' 'map_of_map_property': 'map_of_map_property'
} }
def __init__(self, map_property=None, map_of_map_property=None): def __init__(self, map_property=None, map_of_map_property=None): # noqa: E501
""" """AdditionalPropertiesClass - a model defined in Swagger""" # noqa: E501
AdditionalPropertiesClass - a model defined in Swagger
"""
self._map_property = None self._map_property = None
self._map_of_map_property = None self._map_of_map_property = None
self.discriminator = None self.discriminator = None
if map_property is not None: if map_property is not None:
self.map_property = map_property self.map_property = map_property
if map_of_map_property is not None: if map_of_map_property is not None:
self.map_of_map_property = map_of_map_property self.map_of_map_property = map_of_map_property
@property @property
def map_property(self): def map_property(self):
""" """Gets the map_property of this AdditionalPropertiesClass. # noqa: E501
Gets the map_property of this AdditionalPropertiesClass.
:return: The map_property of this AdditionalPropertiesClass.
:return: The map_property of this AdditionalPropertiesClass. # noqa: E501
:rtype: dict(str, str) :rtype: dict(str, str)
""" """
return self._map_property return self._map_property
@map_property.setter @map_property.setter
def map_property(self, map_property): def map_property(self, map_property):
""" """Sets the map_property of this AdditionalPropertiesClass.
Sets the map_property of this AdditionalPropertiesClass.
:param map_property: The map_property of this AdditionalPropertiesClass.
:param map_property: The map_property of this AdditionalPropertiesClass. # noqa: E501
:type: dict(str, str) :type: dict(str, str)
""" """
@ -77,32 +75,30 @@ class AdditionalPropertiesClass(object):
@property @property
def map_of_map_property(self): def map_of_map_property(self):
""" """Gets the map_of_map_property of this AdditionalPropertiesClass. # noqa: E501
Gets the map_of_map_property of this AdditionalPropertiesClass.
:return: The map_of_map_property of this AdditionalPropertiesClass.
:return: The map_of_map_property of this AdditionalPropertiesClass. # noqa: E501
:rtype: dict(str, dict(str, str)) :rtype: dict(str, dict(str, str))
""" """
return self._map_of_map_property return self._map_of_map_property
@map_of_map_property.setter @map_of_map_property.setter
def map_of_map_property(self, map_of_map_property): def map_of_map_property(self, map_of_map_property):
""" """Sets the map_of_map_property of this AdditionalPropertiesClass.
Sets the map_of_map_property of this AdditionalPropertiesClass.
:param map_of_map_property: The map_of_map_property of this AdditionalPropertiesClass.
:param map_of_map_property: The map_of_map_property of this AdditionalPropertiesClass. # noqa: E501
:type: dict(str, dict(str, str)) :type: dict(str, dict(str, str))
""" """
self._map_of_map_property = map_of_map_property self._map_of_map_property = map_of_map_property
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -123,28 +119,20 @@ class AdditionalPropertiesClass(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, AdditionalPropertiesClass): if not isinstance(other, AdditionalPropertiesClass):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class Animal(object): class Animal(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -41,14 +41,12 @@ class Animal(object):
} }
discriminator_value_class_map = { discriminator_value_class_map = {
'': 'Dog', 'Dog': 'Dog',
'': 'Cat' 'Cat': 'Cat'
} }
def __init__(self, class_name=None, color='red'): def __init__(self, class_name=None, color='red'): # noqa: E501
""" """Animal - a model defined in Swagger""" # noqa: E501
Animal - a model defined in Swagger
"""
self._class_name = None self._class_name = None
self._color = None self._color = None
@ -56,69 +54,62 @@ class Animal(object):
self.class_name = class_name self.class_name = class_name
if color is not None: if color is not None:
self.color = color self.color = color
@property @property
def class_name(self): def class_name(self):
""" """Gets the class_name of this Animal. # noqa: E501
Gets the class_name of this Animal.
:return: The class_name of this Animal.
:return: The class_name of this Animal. # noqa: E501
:rtype: str :rtype: str
""" """
return self._class_name return self._class_name
@class_name.setter @class_name.setter
def class_name(self, class_name): def class_name(self, class_name):
""" """Sets the class_name of this Animal.
Sets the class_name of this Animal.
:param class_name: The class_name of this Animal.
:param class_name: The class_name of this Animal. # noqa: E501
:type: str :type: str
""" """
if class_name is None: if class_name is None:
raise ValueError("Invalid value for `class_name`, must not be `None`") raise ValueError("Invalid value for `class_name`, must not be `None`") # noqa: E501
self._class_name = class_name self._class_name = class_name
@property @property
def color(self): def color(self):
""" """Gets the color of this Animal. # noqa: E501
Gets the color of this Animal.
:return: The color of this Animal.
:return: The color of this Animal. # noqa: E501
:rtype: str :rtype: str
""" """
return self._color return self._color
@color.setter @color.setter
def color(self, color): def color(self, color):
""" """Sets the color of this Animal.
Sets the color of this Animal.
:param color: The color of this Animal.
:param color: The color of this Animal. # noqa: E501
:type: str :type: str
""" """
self._color = color self._color = color
def get_real_child_model(self, data): def get_real_child_model(self, data):
""" """Returns the real base class specified by the discriminator"""
Returns the real base class specified by the discriminator
"""
discriminator_value = data[self.discriminator].lower() discriminator_value = data[self.discriminator].lower()
if self.discriminator_value_class_map.has_key(discriminator_value): return self.discriminator_value_class_map.get(discriminator_value)
return self.discriminator_value_class_map[discriminator_value]
else:
return None
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -139,28 +130,20 @@ class Animal(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, Animal): if not isinstance(other, Animal):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,20 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
from petstore_api.models.animal import Animal # noqa: F401,E501
class AnimalFarm(object): class AnimalFarm(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -31,28 +33,20 @@ class AnimalFarm(object):
and the value is json key in definition. and the value is json key in definition.
""" """
swagger_types = { swagger_types = {
} }
attribute_map = { attribute_map = {
} }
def __init__(self): def __init__(self): # noqa: E501
""" """AnimalFarm - a model defined in Swagger""" # noqa: E501
AnimalFarm - a model defined in Swagger
"""
self.discriminator = None self.discriminator = None
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -73,28 +67,20 @@ class AnimalFarm(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, AnimalFarm): if not isinstance(other, AnimalFarm):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class ApiResponse(object): class ApiResponse(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -42,10 +42,8 @@ class ApiResponse(object):
'message': 'message' 'message': 'message'
} }
def __init__(self, code=None, type=None, message=None): def __init__(self, code=None, type=None, message=None): # noqa: E501
""" """ApiResponse - a model defined in Swagger""" # noqa: E501
ApiResponse - a model defined in Swagger
"""
self._code = None self._code = None
self._type = None self._type = None
@ -53,28 +51,28 @@ class ApiResponse(object):
self.discriminator = None self.discriminator = None
if code is not None: if code is not None:
self.code = code self.code = code
if type is not None: if type is not None:
self.type = type self.type = type
if message is not None: if message is not None:
self.message = message self.message = message
@property @property
def code(self): def code(self):
""" """Gets the code of this ApiResponse. # noqa: E501
Gets the code of this ApiResponse.
:return: The code of this ApiResponse.
:return: The code of this ApiResponse. # noqa: E501
:rtype: int :rtype: int
""" """
return self._code return self._code
@code.setter @code.setter
def code(self, code): def code(self, code):
""" """Sets the code of this ApiResponse.
Sets the code of this ApiResponse.
:param code: The code of this ApiResponse.
:param code: The code of this ApiResponse. # noqa: E501
:type: int :type: int
""" """
@ -82,20 +80,20 @@ class ApiResponse(object):
@property @property
def type(self): def type(self):
""" """Gets the type of this ApiResponse. # noqa: E501
Gets the type of this ApiResponse.
:return: The type of this ApiResponse.
:return: The type of this ApiResponse. # noqa: E501
:rtype: str :rtype: str
""" """
return self._type return self._type
@type.setter @type.setter
def type(self, type): def type(self, type):
""" """Sets the type of this ApiResponse.
Sets the type of this ApiResponse.
:param type: The type of this ApiResponse.
:param type: The type of this ApiResponse. # noqa: E501
:type: str :type: str
""" """
@ -103,32 +101,30 @@ class ApiResponse(object):
@property @property
def message(self): def message(self):
""" """Gets the message of this ApiResponse. # noqa: E501
Gets the message of this ApiResponse.
:return: The message of this ApiResponse.
:return: The message of this ApiResponse. # noqa: E501
:rtype: str :rtype: str
""" """
return self._message return self._message
@message.setter @message.setter
def message(self, message): def message(self, message):
""" """Sets the message of this ApiResponse.
Sets the message of this ApiResponse.
:param message: The message of this ApiResponse.
:param message: The message of this ApiResponse. # noqa: E501
:type: str :type: str
""" """
self._message = message self._message = message
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -149,28 +145,20 @@ class ApiResponse(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, ApiResponse): if not isinstance(other, ApiResponse):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class ArrayOfArrayOfNumberOnly(object): class ArrayOfArrayOfNumberOnly(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -38,45 +38,41 @@ class ArrayOfArrayOfNumberOnly(object):
'array_array_number': 'ArrayArrayNumber' 'array_array_number': 'ArrayArrayNumber'
} }
def __init__(self, array_array_number=None): def __init__(self, array_array_number=None): # noqa: E501
""" """ArrayOfArrayOfNumberOnly - a model defined in Swagger""" # noqa: E501
ArrayOfArrayOfNumberOnly - a model defined in Swagger
"""
self._array_array_number = None self._array_array_number = None
self.discriminator = None self.discriminator = None
if array_array_number is not None: if array_array_number is not None:
self.array_array_number = array_array_number self.array_array_number = array_array_number
@property @property
def array_array_number(self): def array_array_number(self):
""" """Gets the array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501
Gets the array_array_number of this ArrayOfArrayOfNumberOnly.
:return: The array_array_number of this ArrayOfArrayOfNumberOnly.
:return: The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501
:rtype: list[list[float]] :rtype: list[list[float]]
""" """
return self._array_array_number return self._array_array_number
@array_array_number.setter @array_array_number.setter
def array_array_number(self, array_array_number): def array_array_number(self, array_array_number):
""" """Sets the array_array_number of this ArrayOfArrayOfNumberOnly.
Sets the array_array_number of this ArrayOfArrayOfNumberOnly.
:param array_array_number: The array_array_number of this ArrayOfArrayOfNumberOnly.
:param array_array_number: The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501
:type: list[list[float]] :type: list[list[float]]
""" """
self._array_array_number = array_array_number self._array_array_number = array_array_number
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -97,28 +93,20 @@ class ArrayOfArrayOfNumberOnly(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, ArrayOfArrayOfNumberOnly): if not isinstance(other, ArrayOfArrayOfNumberOnly):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class ArrayOfNumberOnly(object): class ArrayOfNumberOnly(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -38,45 +38,41 @@ class ArrayOfNumberOnly(object):
'array_number': 'ArrayNumber' 'array_number': 'ArrayNumber'
} }
def __init__(self, array_number=None): def __init__(self, array_number=None): # noqa: E501
""" """ArrayOfNumberOnly - a model defined in Swagger""" # noqa: E501
ArrayOfNumberOnly - a model defined in Swagger
"""
self._array_number = None self._array_number = None
self.discriminator = None self.discriminator = None
if array_number is not None: if array_number is not None:
self.array_number = array_number self.array_number = array_number
@property @property
def array_number(self): def array_number(self):
""" """Gets the array_number of this ArrayOfNumberOnly. # noqa: E501
Gets the array_number of this ArrayOfNumberOnly.
:return: The array_number of this ArrayOfNumberOnly.
:return: The array_number of this ArrayOfNumberOnly. # noqa: E501
:rtype: list[float] :rtype: list[float]
""" """
return self._array_number return self._array_number
@array_number.setter @array_number.setter
def array_number(self, array_number): def array_number(self, array_number):
""" """Sets the array_number of this ArrayOfNumberOnly.
Sets the array_number of this ArrayOfNumberOnly.
:param array_number: The array_number of this ArrayOfNumberOnly.
:param array_number: The array_number of this ArrayOfNumberOnly. # noqa: E501
:type: list[float] :type: list[float]
""" """
self._array_number = array_number self._array_number = array_number
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -97,28 +93,20 @@ class ArrayOfNumberOnly(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, ArrayOfNumberOnly): if not isinstance(other, ArrayOfNumberOnly):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,20 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: F401,E501
class ArrayTest(object): class ArrayTest(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -42,10 +44,8 @@ class ArrayTest(object):
'array_array_of_model': 'array_array_of_model' 'array_array_of_model': 'array_array_of_model'
} }
def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None): def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None): # noqa: E501
""" """ArrayTest - a model defined in Swagger""" # noqa: E501
ArrayTest - a model defined in Swagger
"""
self._array_of_string = None self._array_of_string = None
self._array_array_of_integer = None self._array_array_of_integer = None
@ -53,28 +53,28 @@ class ArrayTest(object):
self.discriminator = None self.discriminator = None
if array_of_string is not None: if array_of_string is not None:
self.array_of_string = array_of_string self.array_of_string = array_of_string
if array_array_of_integer is not None: if array_array_of_integer is not None:
self.array_array_of_integer = array_array_of_integer self.array_array_of_integer = array_array_of_integer
if array_array_of_model is not None: if array_array_of_model is not None:
self.array_array_of_model = array_array_of_model self.array_array_of_model = array_array_of_model
@property @property
def array_of_string(self): def array_of_string(self):
""" """Gets the array_of_string of this ArrayTest. # noqa: E501
Gets the array_of_string of this ArrayTest.
:return: The array_of_string of this ArrayTest.
:return: The array_of_string of this ArrayTest. # noqa: E501
:rtype: list[str] :rtype: list[str]
""" """
return self._array_of_string return self._array_of_string
@array_of_string.setter @array_of_string.setter
def array_of_string(self, array_of_string): def array_of_string(self, array_of_string):
""" """Sets the array_of_string of this ArrayTest.
Sets the array_of_string of this ArrayTest.
:param array_of_string: The array_of_string of this ArrayTest.
:param array_of_string: The array_of_string of this ArrayTest. # noqa: E501
:type: list[str] :type: list[str]
""" """
@ -82,20 +82,20 @@ class ArrayTest(object):
@property @property
def array_array_of_integer(self): def array_array_of_integer(self):
""" """Gets the array_array_of_integer of this ArrayTest. # noqa: E501
Gets the array_array_of_integer of this ArrayTest.
:return: The array_array_of_integer of this ArrayTest.
:return: The array_array_of_integer of this ArrayTest. # noqa: E501
:rtype: list[list[int]] :rtype: list[list[int]]
""" """
return self._array_array_of_integer return self._array_array_of_integer
@array_array_of_integer.setter @array_array_of_integer.setter
def array_array_of_integer(self, array_array_of_integer): def array_array_of_integer(self, array_array_of_integer):
""" """Sets the array_array_of_integer of this ArrayTest.
Sets the array_array_of_integer of this ArrayTest.
:param array_array_of_integer: The array_array_of_integer of this ArrayTest.
:param array_array_of_integer: The array_array_of_integer of this ArrayTest. # noqa: E501
:type: list[list[int]] :type: list[list[int]]
""" """
@ -103,32 +103,30 @@ class ArrayTest(object):
@property @property
def array_array_of_model(self): def array_array_of_model(self):
""" """Gets the array_array_of_model of this ArrayTest. # noqa: E501
Gets the array_array_of_model of this ArrayTest.
:return: The array_array_of_model of this ArrayTest.
:return: The array_array_of_model of this ArrayTest. # noqa: E501
:rtype: list[list[ReadOnlyFirst]] :rtype: list[list[ReadOnlyFirst]]
""" """
return self._array_array_of_model return self._array_array_of_model
@array_array_of_model.setter @array_array_of_model.setter
def array_array_of_model(self, array_array_of_model): def array_array_of_model(self, array_array_of_model):
""" """Sets the array_array_of_model of this ArrayTest.
Sets the array_array_of_model of this ArrayTest.
:param array_array_of_model: The array_array_of_model of this ArrayTest.
:param array_array_of_model: The array_array_of_model of this ArrayTest. # noqa: E501
:type: list[list[ReadOnlyFirst]] :type: list[list[ReadOnlyFirst]]
""" """
self._array_array_of_model = array_array_of_model self._array_array_of_model = array_array_of_model
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -149,28 +147,20 @@ class ArrayTest(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, ArrayTest): if not isinstance(other, ArrayTest):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class Capitalization(object): class Capitalization(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -48,10 +48,8 @@ class Capitalization(object):
'att_name': 'ATT_NAME' 'att_name': 'ATT_NAME'
} }
def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None): def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None): # noqa: E501
""" """Capitalization - a model defined in Swagger""" # noqa: E501
Capitalization - a model defined in Swagger
"""
self._small_camel = None self._small_camel = None
self._capital_camel = None self._capital_camel = None
@ -62,34 +60,34 @@ class Capitalization(object):
self.discriminator = None self.discriminator = None
if small_camel is not None: if small_camel is not None:
self.small_camel = small_camel self.small_camel = small_camel
if capital_camel is not None: if capital_camel is not None:
self.capital_camel = capital_camel self.capital_camel = capital_camel
if small_snake is not None: if small_snake is not None:
self.small_snake = small_snake self.small_snake = small_snake
if capital_snake is not None: if capital_snake is not None:
self.capital_snake = capital_snake self.capital_snake = capital_snake
if sca_eth_flow_points is not None: if sca_eth_flow_points is not None:
self.sca_eth_flow_points = sca_eth_flow_points self.sca_eth_flow_points = sca_eth_flow_points
if att_name is not None: if att_name is not None:
self.att_name = att_name self.att_name = att_name
@property @property
def small_camel(self): def small_camel(self):
""" """Gets the small_camel of this Capitalization. # noqa: E501
Gets the small_camel of this Capitalization.
:return: The small_camel of this Capitalization.
:return: The small_camel of this Capitalization. # noqa: E501
:rtype: str :rtype: str
""" """
return self._small_camel return self._small_camel
@small_camel.setter @small_camel.setter
def small_camel(self, small_camel): def small_camel(self, small_camel):
""" """Sets the small_camel of this Capitalization.
Sets the small_camel of this Capitalization.
:param small_camel: The small_camel of this Capitalization.
:param small_camel: The small_camel of this Capitalization. # noqa: E501
:type: str :type: str
""" """
@ -97,20 +95,20 @@ class Capitalization(object):
@property @property
def capital_camel(self): def capital_camel(self):
""" """Gets the capital_camel of this Capitalization. # noqa: E501
Gets the capital_camel of this Capitalization.
:return: The capital_camel of this Capitalization.
:return: The capital_camel of this Capitalization. # noqa: E501
:rtype: str :rtype: str
""" """
return self._capital_camel return self._capital_camel
@capital_camel.setter @capital_camel.setter
def capital_camel(self, capital_camel): def capital_camel(self, capital_camel):
""" """Sets the capital_camel of this Capitalization.
Sets the capital_camel of this Capitalization.
:param capital_camel: The capital_camel of this Capitalization.
:param capital_camel: The capital_camel of this Capitalization. # noqa: E501
:type: str :type: str
""" """
@ -118,20 +116,20 @@ class Capitalization(object):
@property @property
def small_snake(self): def small_snake(self):
""" """Gets the small_snake of this Capitalization. # noqa: E501
Gets the small_snake of this Capitalization.
:return: The small_snake of this Capitalization.
:return: The small_snake of this Capitalization. # noqa: E501
:rtype: str :rtype: str
""" """
return self._small_snake return self._small_snake
@small_snake.setter @small_snake.setter
def small_snake(self, small_snake): def small_snake(self, small_snake):
""" """Sets the small_snake of this Capitalization.
Sets the small_snake of this Capitalization.
:param small_snake: The small_snake of this Capitalization.
:param small_snake: The small_snake of this Capitalization. # noqa: E501
:type: str :type: str
""" """
@ -139,20 +137,20 @@ class Capitalization(object):
@property @property
def capital_snake(self): def capital_snake(self):
""" """Gets the capital_snake of this Capitalization. # noqa: E501
Gets the capital_snake of this Capitalization.
:return: The capital_snake of this Capitalization.
:return: The capital_snake of this Capitalization. # noqa: E501
:rtype: str :rtype: str
""" """
return self._capital_snake return self._capital_snake
@capital_snake.setter @capital_snake.setter
def capital_snake(self, capital_snake): def capital_snake(self, capital_snake):
""" """Sets the capital_snake of this Capitalization.
Sets the capital_snake of this Capitalization.
:param capital_snake: The capital_snake of this Capitalization.
:param capital_snake: The capital_snake of this Capitalization. # noqa: E501
:type: str :type: str
""" """
@ -160,20 +158,20 @@ class Capitalization(object):
@property @property
def sca_eth_flow_points(self): def sca_eth_flow_points(self):
""" """Gets the sca_eth_flow_points of this Capitalization. # noqa: E501
Gets the sca_eth_flow_points of this Capitalization.
:return: The sca_eth_flow_points of this Capitalization.
:return: The sca_eth_flow_points of this Capitalization. # noqa: E501
:rtype: str :rtype: str
""" """
return self._sca_eth_flow_points return self._sca_eth_flow_points
@sca_eth_flow_points.setter @sca_eth_flow_points.setter
def sca_eth_flow_points(self, sca_eth_flow_points): def sca_eth_flow_points(self, sca_eth_flow_points):
""" """Sets the sca_eth_flow_points of this Capitalization.
Sets the sca_eth_flow_points of this Capitalization.
:param sca_eth_flow_points: The sca_eth_flow_points of this Capitalization.
:param sca_eth_flow_points: The sca_eth_flow_points of this Capitalization. # noqa: E501
:type: str :type: str
""" """
@ -181,34 +179,32 @@ class Capitalization(object):
@property @property
def att_name(self): def att_name(self):
""" """Gets the att_name of this Capitalization. # noqa: E501
Gets the att_name of this Capitalization.
Name of the pet
:return: The att_name of this Capitalization. Name of the pet # noqa: E501
:return: The att_name of this Capitalization. # noqa: E501
:rtype: str :rtype: str
""" """
return self._att_name return self._att_name
@att_name.setter @att_name.setter
def att_name(self, att_name): def att_name(self, att_name):
""" """Sets the att_name of this Capitalization.
Sets the att_name of this Capitalization.
Name of the pet
:param att_name: The att_name of this Capitalization. Name of the pet # noqa: E501
:param att_name: The att_name of this Capitalization. # noqa: E501
:type: str :type: str
""" """
self._att_name = att_name self._att_name = att_name
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -229,28 +225,20 @@ class Capitalization(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, Capitalization): if not isinstance(other, Capitalization):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,20 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
from petstore_api.models.animal import Animal # noqa: F401,E501
class Cat(object): class Cat(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -38,45 +40,41 @@ class Cat(object):
'declawed': 'declawed' 'declawed': 'declawed'
} }
def __init__(self, declawed=None): def __init__(self, declawed=None): # noqa: E501
""" """Cat - a model defined in Swagger""" # noqa: E501
Cat - a model defined in Swagger
"""
self._declawed = None self._declawed = None
self.discriminator = None self.discriminator = None
if declawed is not None: if declawed is not None:
self.declawed = declawed self.declawed = declawed
@property @property
def declawed(self): def declawed(self):
""" """Gets the declawed of this Cat. # noqa: E501
Gets the declawed of this Cat.
:return: The declawed of this Cat.
:return: The declawed of this Cat. # noqa: E501
:rtype: bool :rtype: bool
""" """
return self._declawed return self._declawed
@declawed.setter @declawed.setter
def declawed(self, declawed): def declawed(self, declawed):
""" """Sets the declawed of this Cat.
Sets the declawed of this Cat.
:param declawed: The declawed of this Cat.
:param declawed: The declawed of this Cat. # noqa: E501
:type: bool :type: bool
""" """
self._declawed = declawed self._declawed = declawed
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -97,28 +95,20 @@ class Cat(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, Cat): if not isinstance(other, Cat):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class Category(object): class Category(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -40,36 +40,34 @@ class Category(object):
'name': 'name' 'name': 'name'
} }
def __init__(self, id=None, name=None): def __init__(self, id=None, name=None): # noqa: E501
""" """Category - a model defined in Swagger""" # noqa: E501
Category - a model defined in Swagger
"""
self._id = None self._id = None
self._name = None self._name = None
self.discriminator = None self.discriminator = None
if id is not None: if id is not None:
self.id = id self.id = id
if name is not None: if name is not None:
self.name = name self.name = name
@property @property
def id(self): def id(self):
""" """Gets the id of this Category. # noqa: E501
Gets the id of this Category.
:return: The id of this Category.
:return: The id of this Category. # noqa: E501
:rtype: int :rtype: int
""" """
return self._id return self._id
@id.setter @id.setter
def id(self, id): def id(self, id):
""" """Sets the id of this Category.
Sets the id of this Category.
:param id: The id of this Category.
:param id: The id of this Category. # noqa: E501
:type: int :type: int
""" """
@ -77,32 +75,30 @@ class Category(object):
@property @property
def name(self): def name(self):
""" """Gets the name of this Category. # noqa: E501
Gets the name of this Category.
:return: The name of this Category.
:return: The name of this Category. # noqa: E501
:rtype: str :rtype: str
""" """
return self._name return self._name
@name.setter @name.setter
def name(self, name): def name(self, name):
""" """Sets the name of this Category.
Sets the name of this Category.
:param name: The name of this Category.
:param name: The name of this Category. # noqa: E501
:type: str :type: str
""" """
self._name = name self._name = name
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -123,28 +119,20 @@ class Category(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, Category): if not isinstance(other, Category):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class ClassModel(object): class ClassModel(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -38,45 +38,41 @@ class ClassModel(object):
'_class': '_class' '_class': '_class'
} }
def __init__(self, _class=None): def __init__(self, _class=None): # noqa: E501
""" """ClassModel - a model defined in Swagger""" # noqa: E501
ClassModel - a model defined in Swagger
"""
self.__class = None self.__class = None
self.discriminator = None self.discriminator = None
if _class is not None: if _class is not None:
self._class = _class self._class = _class
@property @property
def _class(self): def _class(self):
""" """Gets the _class of this ClassModel. # noqa: E501
Gets the _class of this ClassModel.
:return: The _class of this ClassModel.
:return: The _class of this ClassModel. # noqa: E501
:rtype: str :rtype: str
""" """
return self.__class return self.__class
@_class.setter @_class.setter
def _class(self, _class): def _class(self, _class):
""" """Sets the _class of this ClassModel.
Sets the _class of this ClassModel.
:param _class: The _class of this ClassModel.
:param _class: The _class of this ClassModel. # noqa: E501
:type: str :type: str
""" """
self.__class = _class self.__class = _class
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -97,28 +93,20 @@ class ClassModel(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, ClassModel): if not isinstance(other, ClassModel):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class Client(object): class Client(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -38,45 +38,41 @@ class Client(object):
'client': 'client' 'client': 'client'
} }
def __init__(self, client=None): def __init__(self, client=None): # noqa: E501
""" """Client - a model defined in Swagger""" # noqa: E501
Client - a model defined in Swagger
"""
self._client = None self._client = None
self.discriminator = None self.discriminator = None
if client is not None: if client is not None:
self.client = client self.client = client
@property @property
def client(self): def client(self):
""" """Gets the client of this Client. # noqa: E501
Gets the client of this Client.
:return: The client of this Client.
:return: The client of this Client. # noqa: E501
:rtype: str :rtype: str
""" """
return self._client return self._client
@client.setter @client.setter
def client(self, client): def client(self, client):
""" """Sets the client of this Client.
Sets the client of this Client.
:param client: The client of this Client.
:param client: The client of this Client. # noqa: E501
:type: str :type: str
""" """
self._client = client self._client = client
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -97,28 +93,20 @@ class Client(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, Client): if not isinstance(other, Client):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,20 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
from petstore_api.models.animal import Animal # noqa: F401,E501
class Dog(object): class Dog(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -38,45 +40,41 @@ class Dog(object):
'breed': 'breed' 'breed': 'breed'
} }
def __init__(self, breed=None): def __init__(self, breed=None): # noqa: E501
""" """Dog - a model defined in Swagger""" # noqa: E501
Dog - a model defined in Swagger
"""
self._breed = None self._breed = None
self.discriminator = None self.discriminator = None
if breed is not None: if breed is not None:
self.breed = breed self.breed = breed
@property @property
def breed(self): def breed(self):
""" """Gets the breed of this Dog. # noqa: E501
Gets the breed of this Dog.
:return: The breed of this Dog.
:return: The breed of this Dog. # noqa: E501
:rtype: str :rtype: str
""" """
return self._breed return self._breed
@breed.setter @breed.setter
def breed(self, breed): def breed(self, breed):
""" """Sets the breed of this Dog.
Sets the breed of this Dog.
:param breed: The breed of this Dog.
:param breed: The breed of this Dog. # noqa: E501
:type: str :type: str
""" """
self._breed = breed self._breed = breed
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -97,28 +95,20 @@ class Dog(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, Dog): if not isinstance(other, Dog):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class EnumArrays(object): class EnumArrays(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -40,42 +40,40 @@ class EnumArrays(object):
'array_enum': 'array_enum' 'array_enum': 'array_enum'
} }
def __init__(self, just_symbol=None, array_enum=None): def __init__(self, just_symbol=None, array_enum=None): # noqa: E501
""" """EnumArrays - a model defined in Swagger""" # noqa: E501
EnumArrays - a model defined in Swagger
"""
self._just_symbol = None self._just_symbol = None
self._array_enum = None self._array_enum = None
self.discriminator = None self.discriminator = None
if just_symbol is not None: if just_symbol is not None:
self.just_symbol = just_symbol self.just_symbol = just_symbol
if array_enum is not None: if array_enum is not None:
self.array_enum = array_enum self.array_enum = array_enum
@property @property
def just_symbol(self): def just_symbol(self):
""" """Gets the just_symbol of this EnumArrays. # noqa: E501
Gets the just_symbol of this EnumArrays.
:return: The just_symbol of this EnumArrays.
:return: The just_symbol of this EnumArrays. # noqa: E501
:rtype: str :rtype: str
""" """
return self._just_symbol return self._just_symbol
@just_symbol.setter @just_symbol.setter
def just_symbol(self, just_symbol): def just_symbol(self, just_symbol):
""" """Sets the just_symbol of this EnumArrays.
Sets the just_symbol of this EnumArrays.
:param just_symbol: The just_symbol of this EnumArrays.
:param just_symbol: The just_symbol of this EnumArrays. # noqa: E501
:type: str :type: str
""" """
allowed_values = [">=", "$"] allowed_values = [">=", "$"] # noqa: E501
if just_symbol not in allowed_values: if just_symbol not in allowed_values:
raise ValueError( raise ValueError(
"Invalid value for `just_symbol` ({0}), must be one of {1}" "Invalid value for `just_symbol` ({0}), must be one of {1}" # noqa: E501
.format(just_symbol, allowed_values) .format(just_symbol, allowed_values)
) )
@ -83,39 +81,37 @@ class EnumArrays(object):
@property @property
def array_enum(self): def array_enum(self):
""" """Gets the array_enum of this EnumArrays. # noqa: E501
Gets the array_enum of this EnumArrays.
:return: The array_enum of this EnumArrays.
:return: The array_enum of this EnumArrays. # noqa: E501
:rtype: list[str] :rtype: list[str]
""" """
return self._array_enum return self._array_enum
@array_enum.setter @array_enum.setter
def array_enum(self, array_enum): def array_enum(self, array_enum):
""" """Sets the array_enum of this EnumArrays.
Sets the array_enum of this EnumArrays.
:param array_enum: The array_enum of this EnumArrays.
:param array_enum: The array_enum of this EnumArrays. # noqa: E501
:type: list[str] :type: list[str]
""" """
allowed_values = ["fish", "crab"] allowed_values = ["fish", "crab"] # noqa: E501
if not set(array_enum).issubset(set(allowed_values)): if not set(array_enum).issubset(set(allowed_values)):
raise ValueError( raise ValueError(
"Invalid values for `array_enum` [{0}], must be a subset of [{1}]" "Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501
.format(", ".join(map(str, set(array_enum)-set(allowed_values))), .format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501
", ".join(map(str, allowed_values))) ", ".join(map(str, allowed_values)))
) )
self._array_enum = array_enum self._array_enum = array_enum
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -136,28 +132,20 @@ class EnumArrays(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, EnumArrays): if not isinstance(other, EnumArrays):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,14 +11,15 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class EnumClass(object): class EnumClass(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
@ -37,28 +38,20 @@ class EnumClass(object):
and the value is json key in definition. and the value is json key in definition.
""" """
swagger_types = { swagger_types = {
} }
attribute_map = { attribute_map = {
} }
def __init__(self): def __init__(self): # noqa: E501
""" """EnumClass - a model defined in Swagger""" # noqa: E501
EnumClass - a model defined in Swagger
"""
self.discriminator = None self.discriminator = None
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -79,28 +72,20 @@ class EnumClass(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, EnumClass): if not isinstance(other, EnumClass):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,20 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
from petstore_api.models.outer_enum import OuterEnum # noqa: F401,E501
class EnumTest(object): class EnumTest(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -44,10 +46,8 @@ class EnumTest(object):
'outer_enum': 'outerEnum' 'outer_enum': 'outerEnum'
} }
def __init__(self, enum_string=None, enum_integer=None, enum_number=None, outer_enum=None): def __init__(self, enum_string=None, enum_integer=None, enum_number=None, outer_enum=None): # noqa: E501
""" """EnumTest - a model defined in Swagger""" # noqa: E501
EnumTest - a model defined in Swagger
"""
self._enum_string = None self._enum_string = None
self._enum_integer = None self._enum_integer = None
@ -56,36 +56,36 @@ class EnumTest(object):
self.discriminator = None self.discriminator = None
if enum_string is not None: if enum_string is not None:
self.enum_string = enum_string self.enum_string = enum_string
if enum_integer is not None: if enum_integer is not None:
self.enum_integer = enum_integer self.enum_integer = enum_integer
if enum_number is not None: if enum_number is not None:
self.enum_number = enum_number self.enum_number = enum_number
if outer_enum is not None: if outer_enum is not None:
self.outer_enum = outer_enum self.outer_enum = outer_enum
@property @property
def enum_string(self): def enum_string(self):
""" """Gets the enum_string of this EnumTest. # noqa: E501
Gets the enum_string of this EnumTest.
:return: The enum_string of this EnumTest.
:return: The enum_string of this EnumTest. # noqa: E501
:rtype: str :rtype: str
""" """
return self._enum_string return self._enum_string
@enum_string.setter @enum_string.setter
def enum_string(self, enum_string): def enum_string(self, enum_string):
""" """Sets the enum_string of this EnumTest.
Sets the enum_string of this EnumTest.
:param enum_string: The enum_string of this EnumTest.
:param enum_string: The enum_string of this EnumTest. # noqa: E501
:type: str :type: str
""" """
allowed_values = ["UPPER", "lower", ""] allowed_values = ["UPPER", "lower", ""] # noqa: E501
if enum_string not in allowed_values: if enum_string not in allowed_values:
raise ValueError( raise ValueError(
"Invalid value for `enum_string` ({0}), must be one of {1}" "Invalid value for `enum_string` ({0}), must be one of {1}" # noqa: E501
.format(enum_string, allowed_values) .format(enum_string, allowed_values)
) )
@ -93,26 +93,26 @@ class EnumTest(object):
@property @property
def enum_integer(self): def enum_integer(self):
""" """Gets the enum_integer of this EnumTest. # noqa: E501
Gets the enum_integer of this EnumTest.
:return: The enum_integer of this EnumTest.
:return: The enum_integer of this EnumTest. # noqa: E501
:rtype: int :rtype: int
""" """
return self._enum_integer return self._enum_integer
@enum_integer.setter @enum_integer.setter
def enum_integer(self, enum_integer): def enum_integer(self, enum_integer):
""" """Sets the enum_integer of this EnumTest.
Sets the enum_integer of this EnumTest.
:param enum_integer: The enum_integer of this EnumTest.
:param enum_integer: The enum_integer of this EnumTest. # noqa: E501
:type: int :type: int
""" """
allowed_values = [1, -1] allowed_values = [1, -1] # noqa: E501
if enum_integer not in allowed_values: if enum_integer not in allowed_values:
raise ValueError( raise ValueError(
"Invalid value for `enum_integer` ({0}), must be one of {1}" "Invalid value for `enum_integer` ({0}), must be one of {1}" # noqa: E501
.format(enum_integer, allowed_values) .format(enum_integer, allowed_values)
) )
@ -120,26 +120,26 @@ class EnumTest(object):
@property @property
def enum_number(self): def enum_number(self):
""" """Gets the enum_number of this EnumTest. # noqa: E501
Gets the enum_number of this EnumTest.
:return: The enum_number of this EnumTest.
:return: The enum_number of this EnumTest. # noqa: E501
:rtype: float :rtype: float
""" """
return self._enum_number return self._enum_number
@enum_number.setter @enum_number.setter
def enum_number(self, enum_number): def enum_number(self, enum_number):
""" """Sets the enum_number of this EnumTest.
Sets the enum_number of this EnumTest.
:param enum_number: The enum_number of this EnumTest.
:param enum_number: The enum_number of this EnumTest. # noqa: E501
:type: float :type: float
""" """
allowed_values = [1.1, -1.2] allowed_values = [1.1, -1.2] # noqa: E501
if enum_number not in allowed_values: if enum_number not in allowed_values:
raise ValueError( raise ValueError(
"Invalid value for `enum_number` ({0}), must be one of {1}" "Invalid value for `enum_number` ({0}), must be one of {1}" # noqa: E501
.format(enum_number, allowed_values) .format(enum_number, allowed_values)
) )
@ -147,32 +147,30 @@ class EnumTest(object):
@property @property
def outer_enum(self): def outer_enum(self):
""" """Gets the outer_enum of this EnumTest. # noqa: E501
Gets the outer_enum of this EnumTest.
:return: The outer_enum of this EnumTest.
:return: The outer_enum of this EnumTest. # noqa: E501
:rtype: OuterEnum :rtype: OuterEnum
""" """
return self._outer_enum return self._outer_enum
@outer_enum.setter @outer_enum.setter
def outer_enum(self, outer_enum): def outer_enum(self, outer_enum):
""" """Sets the outer_enum of this EnumTest.
Sets the outer_enum of this EnumTest.
:param outer_enum: The outer_enum of this EnumTest.
:param outer_enum: The outer_enum of this EnumTest. # noqa: E501
:type: OuterEnum :type: OuterEnum
""" """
self._outer_enum = outer_enum self._outer_enum = outer_enum
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -193,28 +191,20 @@ class EnumTest(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, EnumTest): if not isinstance(other, EnumTest):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class FormatTest(object): class FormatTest(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -62,10 +62,8 @@ class FormatTest(object):
'password': 'password' 'password': 'password'
} }
def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None): def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None): # noqa: E501
""" """FormatTest - a model defined in Swagger""" # noqa: E501
FormatTest - a model defined in Swagger
"""
self._integer = None self._integer = None
self._int32 = None self._int32 = None
@ -83,94 +81,94 @@ class FormatTest(object):
self.discriminator = None self.discriminator = None
if integer is not None: if integer is not None:
self.integer = integer self.integer = integer
if int32 is not None: if int32 is not None:
self.int32 = int32 self.int32 = int32
if int64 is not None: if int64 is not None:
self.int64 = int64 self.int64 = int64
self.number = number self.number = number
if float is not None: if float is not None:
self.float = float self.float = float
if double is not None: if double is not None:
self.double = double self.double = double
if string is not None: if string is not None:
self.string = string self.string = string
self.byte = byte self.byte = byte
if binary is not None: if binary is not None:
self.binary = binary self.binary = binary
self.date = date self.date = date
if date_time is not None: if date_time is not None:
self.date_time = date_time self.date_time = date_time
if uuid is not None: if uuid is not None:
self.uuid = uuid self.uuid = uuid
self.password = password self.password = password
@property @property
def integer(self): def integer(self):
""" """Gets the integer of this FormatTest. # noqa: E501
Gets the integer of this FormatTest.
:return: The integer of this FormatTest.
:return: The integer of this FormatTest. # noqa: E501
:rtype: int :rtype: int
""" """
return self._integer return self._integer
@integer.setter @integer.setter
def integer(self, integer): def integer(self, integer):
""" """Sets the integer of this FormatTest.
Sets the integer of this FormatTest.
:param integer: The integer of this FormatTest.
:param integer: The integer of this FormatTest. # noqa: E501
:type: int :type: int
""" """
if integer is not None and integer > 100: if integer is not None and integer > 100: # noqa: E501
raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100`") raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100`") # noqa: E501
if integer is not None and integer < 10: if integer is not None and integer < 10: # noqa: E501
raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") # noqa: E501
self._integer = integer self._integer = integer
@property @property
def int32(self): def int32(self):
""" """Gets the int32 of this FormatTest. # noqa: E501
Gets the int32 of this FormatTest.
:return: The int32 of this FormatTest.
:return: The int32 of this FormatTest. # noqa: E501
:rtype: int :rtype: int
""" """
return self._int32 return self._int32
@int32.setter @int32.setter
def int32(self, int32): def int32(self, int32):
""" """Sets the int32 of this FormatTest.
Sets the int32 of this FormatTest.
:param int32: The int32 of this FormatTest.
:param int32: The int32 of this FormatTest. # noqa: E501
:type: int :type: int
""" """
if int32 is not None and int32 > 200: if int32 is not None and int32 > 200: # noqa: E501
raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200`") raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200`") # noqa: E501
if int32 is not None and int32 < 20: if int32 is not None and int32 < 20: # noqa: E501
raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") # noqa: E501
self._int32 = int32 self._int32 = int32
@property @property
def int64(self): def int64(self):
""" """Gets the int64 of this FormatTest. # noqa: E501
Gets the int64 of this FormatTest.
:return: The int64 of this FormatTest.
:return: The int64 of this FormatTest. # noqa: E501
:rtype: int :rtype: int
""" """
return self._int64 return self._int64
@int64.setter @int64.setter
def int64(self, int64): def int64(self, int64):
""" """Sets the int64 of this FormatTest.
Sets the int64 of this FormatTest.
:param int64: The int64 of this FormatTest.
:param int64: The int64 of this FormatTest. # noqa: E501
:type: int :type: int
""" """
@ -178,145 +176,145 @@ class FormatTest(object):
@property @property
def number(self): def number(self):
""" """Gets the number of this FormatTest. # noqa: E501
Gets the number of this FormatTest.
:return: The number of this FormatTest.
:return: The number of this FormatTest. # noqa: E501
:rtype: float :rtype: float
""" """
return self._number return self._number
@number.setter @number.setter
def number(self, number): def number(self, number):
""" """Sets the number of this FormatTest.
Sets the number of this FormatTest.
:param number: The number of this FormatTest.
:param number: The number of this FormatTest. # noqa: E501
:type: float :type: float
""" """
if number is None: if number is None:
raise ValueError("Invalid value for `number`, must not be `None`") raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501
if number is not None and number > 543.2: if number is not None and number > 543.2: # noqa: E501
raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`") raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`") # noqa: E501
if number is not None and number < 32.1: if number is not None and number < 32.1: # noqa: E501
raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") # noqa: E501
self._number = number self._number = number
@property @property
def float(self): def float(self):
""" """Gets the float of this FormatTest. # noqa: E501
Gets the float of this FormatTest.
:return: The float of this FormatTest.
:return: The float of this FormatTest. # noqa: E501
:rtype: float :rtype: float
""" """
return self._float return self._float
@float.setter @float.setter
def float(self, float): def float(self, float):
""" """Sets the float of this FormatTest.
Sets the float of this FormatTest.
:param float: The float of this FormatTest.
:param float: The float of this FormatTest. # noqa: E501
:type: float :type: float
""" """
if float is not None and float > 987.6: if float is not None and float > 987.6: # noqa: E501
raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") # noqa: E501
if float is not None and float < 54.3: if float is not None and float < 54.3: # noqa: E501
raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") # noqa: E501
self._float = float self._float = float
@property @property
def double(self): def double(self):
""" """Gets the double of this FormatTest. # noqa: E501
Gets the double of this FormatTest.
:return: The double of this FormatTest.
:return: The double of this FormatTest. # noqa: E501
:rtype: float :rtype: float
""" """
return self._double return self._double
@double.setter @double.setter
def double(self, double): def double(self, double):
""" """Sets the double of this FormatTest.
Sets the double of this FormatTest.
:param double: The double of this FormatTest.
:param double: The double of this FormatTest. # noqa: E501
:type: float :type: float
""" """
if double is not None and double > 123.4: if double is not None and double > 123.4: # noqa: E501
raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`") raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`") # noqa: E501
if double is not None and double < 67.8: if double is not None and double < 67.8: # noqa: E501
raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") # noqa: E501
self._double = double self._double = double
@property @property
def string(self): def string(self):
""" """Gets the string of this FormatTest. # noqa: E501
Gets the string of this FormatTest.
:return: The string of this FormatTest.
:return: The string of this FormatTest. # noqa: E501
:rtype: str :rtype: str
""" """
return self._string return self._string
@string.setter @string.setter
def string(self, string): def string(self, string):
""" """Sets the string of this FormatTest.
Sets the string of this FormatTest.
:param string: The string of this FormatTest.
:param string: The string of this FormatTest. # noqa: E501
:type: str :type: str
""" """
if string is not None and not re.search('[a-z]', string, flags=re.IGNORECASE): if string is not None and not re.search('[a-z]', string, flags=re.IGNORECASE): # noqa: E501
raise ValueError("Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") raise ValueError("Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501
self._string = string self._string = string
@property @property
def byte(self): def byte(self):
""" """Gets the byte of this FormatTest. # noqa: E501
Gets the byte of this FormatTest.
:return: The byte of this FormatTest.
:return: The byte of this FormatTest. # noqa: E501
:rtype: str :rtype: str
""" """
return self._byte return self._byte
@byte.setter @byte.setter
def byte(self, byte): def byte(self, byte):
""" """Sets the byte of this FormatTest.
Sets the byte of this FormatTest.
:param byte: The byte of this FormatTest.
:param byte: The byte of this FormatTest. # noqa: E501
:type: str :type: str
""" """
if byte is None: if byte is None:
raise ValueError("Invalid value for `byte`, must not be `None`") raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501
if byte is not None and not re.search('^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte): if byte is not None and not re.search('^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte): # noqa: E501
raise ValueError("Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") raise ValueError("Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501
self._byte = byte self._byte = byte
@property @property
def binary(self): def binary(self):
""" """Gets the binary of this FormatTest. # noqa: E501
Gets the binary of this FormatTest.
:return: The binary of this FormatTest.
:return: The binary of this FormatTest. # noqa: E501
:rtype: str :rtype: str
""" """
return self._binary return self._binary
@binary.setter @binary.setter
def binary(self, binary): def binary(self, binary):
""" """Sets the binary of this FormatTest.
Sets the binary of this FormatTest.
:param binary: The binary of this FormatTest.
:param binary: The binary of this FormatTest. # noqa: E501
:type: str :type: str
""" """
@ -324,43 +322,43 @@ class FormatTest(object):
@property @property
def date(self): def date(self):
""" """Gets the date of this FormatTest. # noqa: E501
Gets the date of this FormatTest.
:return: The date of this FormatTest.
:return: The date of this FormatTest. # noqa: E501
:rtype: date :rtype: date
""" """
return self._date return self._date
@date.setter @date.setter
def date(self, date): def date(self, date):
""" """Sets the date of this FormatTest.
Sets the date of this FormatTest.
:param date: The date of this FormatTest.
:param date: The date of this FormatTest. # noqa: E501
:type: date :type: date
""" """
if date is None: if date is None:
raise ValueError("Invalid value for `date`, must not be `None`") raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501
self._date = date self._date = date
@property @property
def date_time(self): def date_time(self):
""" """Gets the date_time of this FormatTest. # noqa: E501
Gets the date_time of this FormatTest.
:return: The date_time of this FormatTest.
:return: The date_time of this FormatTest. # noqa: E501
:rtype: datetime :rtype: datetime
""" """
return self._date_time return self._date_time
@date_time.setter @date_time.setter
def date_time(self, date_time): def date_time(self, date_time):
""" """Sets the date_time of this FormatTest.
Sets the date_time of this FormatTest.
:param date_time: The date_time of this FormatTest.
:param date_time: The date_time of this FormatTest. # noqa: E501
:type: datetime :type: datetime
""" """
@ -368,20 +366,20 @@ class FormatTest(object):
@property @property
def uuid(self): def uuid(self):
""" """Gets the uuid of this FormatTest. # noqa: E501
Gets the uuid of this FormatTest.
:return: The uuid of this FormatTest.
:return: The uuid of this FormatTest. # noqa: E501
:rtype: str :rtype: str
""" """
return self._uuid return self._uuid
@uuid.setter @uuid.setter
def uuid(self, uuid): def uuid(self, uuid):
""" """Sets the uuid of this FormatTest.
Sets the uuid of this FormatTest.
:param uuid: The uuid of this FormatTest.
:param uuid: The uuid of this FormatTest. # noqa: E501
:type: str :type: str
""" """
@ -389,38 +387,36 @@ class FormatTest(object):
@property @property
def password(self): def password(self):
""" """Gets the password of this FormatTest. # noqa: E501
Gets the password of this FormatTest.
:return: The password of this FormatTest.
:return: The password of this FormatTest. # noqa: E501
:rtype: str :rtype: str
""" """
return self._password return self._password
@password.setter @password.setter
def password(self, password): def password(self, password):
""" """Sets the password of this FormatTest.
Sets the password of this FormatTest.
:param password: The password of this FormatTest.
:param password: The password of this FormatTest. # noqa: E501
:type: str :type: str
""" """
if password is None: if password is None:
raise ValueError("Invalid value for `password`, must not be `None`") raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501
if password is not None and len(password) > 64: if password is not None and len(password) > 64:
raise ValueError("Invalid value for `password`, length must be less than or equal to `64`") raise ValueError("Invalid value for `password`, length must be less than or equal to `64`") # noqa: E501
if password is not None and len(password) < 10: if password is not None and len(password) < 10:
raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`") raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`") # noqa: E501
self._password = password self._password = password
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -441,28 +437,20 @@ class FormatTest(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, FormatTest): if not isinstance(other, FormatTest):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class HasOnlyReadOnly(object): class HasOnlyReadOnly(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -40,36 +40,34 @@ class HasOnlyReadOnly(object):
'foo': 'foo' 'foo': 'foo'
} }
def __init__(self, bar=None, foo=None): def __init__(self, bar=None, foo=None): # noqa: E501
""" """HasOnlyReadOnly - a model defined in Swagger""" # noqa: E501
HasOnlyReadOnly - a model defined in Swagger
"""
self._bar = None self._bar = None
self._foo = None self._foo = None
self.discriminator = None self.discriminator = None
if bar is not None: if bar is not None:
self.bar = bar self.bar = bar
if foo is not None: if foo is not None:
self.foo = foo self.foo = foo
@property @property
def bar(self): def bar(self):
""" """Gets the bar of this HasOnlyReadOnly. # noqa: E501
Gets the bar of this HasOnlyReadOnly.
:return: The bar of this HasOnlyReadOnly.
:return: The bar of this HasOnlyReadOnly. # noqa: E501
:rtype: str :rtype: str
""" """
return self._bar return self._bar
@bar.setter @bar.setter
def bar(self, bar): def bar(self, bar):
""" """Sets the bar of this HasOnlyReadOnly.
Sets the bar of this HasOnlyReadOnly.
:param bar: The bar of this HasOnlyReadOnly.
:param bar: The bar of this HasOnlyReadOnly. # noqa: E501
:type: str :type: str
""" """
@ -77,32 +75,30 @@ class HasOnlyReadOnly(object):
@property @property
def foo(self): def foo(self):
""" """Gets the foo of this HasOnlyReadOnly. # noqa: E501
Gets the foo of this HasOnlyReadOnly.
:return: The foo of this HasOnlyReadOnly.
:return: The foo of this HasOnlyReadOnly. # noqa: E501
:rtype: str :rtype: str
""" """
return self._foo return self._foo
@foo.setter @foo.setter
def foo(self, foo): def foo(self, foo):
""" """Sets the foo of this HasOnlyReadOnly.
Sets the foo of this HasOnlyReadOnly.
:param foo: The foo of this HasOnlyReadOnly.
:param foo: The foo of this HasOnlyReadOnly. # noqa: E501
:type: str :type: str
""" """
self._foo = foo self._foo = foo
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -123,28 +119,20 @@ class HasOnlyReadOnly(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, HasOnlyReadOnly): if not isinstance(other, HasOnlyReadOnly):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class List(object): class List(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -38,45 +38,41 @@ class List(object):
'_123_list': '123-list' '_123_list': '123-list'
} }
def __init__(self, _123_list=None): def __init__(self, _123_list=None): # noqa: E501
""" """List - a model defined in Swagger""" # noqa: E501
List - a model defined in Swagger
"""
self.__123_list = None self.__123_list = None
self.discriminator = None self.discriminator = None
if _123_list is not None: if _123_list is not None:
self._123_list = _123_list self._123_list = _123_list
@property @property
def _123_list(self): def _123_list(self):
""" """Gets the _123_list of this List. # noqa: E501
Gets the _123_list of this List.
:return: The _123_list of this List.
:return: The _123_list of this List. # noqa: E501
:rtype: str :rtype: str
""" """
return self.__123_list return self.__123_list
@_123_list.setter @_123_list.setter
def _123_list(self, _123_list): def _123_list(self, _123_list):
""" """Sets the _123_list of this List.
Sets the _123_list of this List.
:param _123_list: The _123_list of this List.
:param _123_list: The _123_list of this List. # noqa: E501
:type: str :type: str
""" """
self.__123_list = _123_list self.__123_list = _123_list
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -97,28 +93,20 @@ class List(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, List): if not isinstance(other, List):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class MapTest(object): class MapTest(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -40,36 +40,34 @@ class MapTest(object):
'map_of_enum_string': 'map_of_enum_string' 'map_of_enum_string': 'map_of_enum_string'
} }
def __init__(self, map_map_of_string=None, map_of_enum_string=None): def __init__(self, map_map_of_string=None, map_of_enum_string=None): # noqa: E501
""" """MapTest - a model defined in Swagger""" # noqa: E501
MapTest - a model defined in Swagger
"""
self._map_map_of_string = None self._map_map_of_string = None
self._map_of_enum_string = None self._map_of_enum_string = None
self.discriminator = None self.discriminator = None
if map_map_of_string is not None: if map_map_of_string is not None:
self.map_map_of_string = map_map_of_string self.map_map_of_string = map_map_of_string
if map_of_enum_string is not None: if map_of_enum_string is not None:
self.map_of_enum_string = map_of_enum_string self.map_of_enum_string = map_of_enum_string
@property @property
def map_map_of_string(self): def map_map_of_string(self):
""" """Gets the map_map_of_string of this MapTest. # noqa: E501
Gets the map_map_of_string of this MapTest.
:return: The map_map_of_string of this MapTest.
:return: The map_map_of_string of this MapTest. # noqa: E501
:rtype: dict(str, dict(str, str)) :rtype: dict(str, dict(str, str))
""" """
return self._map_map_of_string return self._map_map_of_string
@map_map_of_string.setter @map_map_of_string.setter
def map_map_of_string(self, map_map_of_string): def map_map_of_string(self, map_map_of_string):
""" """Sets the map_map_of_string of this MapTest.
Sets the map_map_of_string of this MapTest.
:param map_map_of_string: The map_map_of_string of this MapTest.
:param map_map_of_string: The map_map_of_string of this MapTest. # noqa: E501
:type: dict(str, dict(str, str)) :type: dict(str, dict(str, str))
""" """
@ -77,39 +75,37 @@ class MapTest(object):
@property @property
def map_of_enum_string(self): def map_of_enum_string(self):
""" """Gets the map_of_enum_string of this MapTest. # noqa: E501
Gets the map_of_enum_string of this MapTest.
:return: The map_of_enum_string of this MapTest.
:return: The map_of_enum_string of this MapTest. # noqa: E501
:rtype: dict(str, str) :rtype: dict(str, str)
""" """
return self._map_of_enum_string return self._map_of_enum_string
@map_of_enum_string.setter @map_of_enum_string.setter
def map_of_enum_string(self, map_of_enum_string): def map_of_enum_string(self, map_of_enum_string):
""" """Sets the map_of_enum_string of this MapTest.
Sets the map_of_enum_string of this MapTest.
:param map_of_enum_string: The map_of_enum_string of this MapTest.
:param map_of_enum_string: The map_of_enum_string of this MapTest. # noqa: E501
:type: dict(str, str) :type: dict(str, str)
""" """
allowed_values = ["UPPER", "lower"] allowed_values = ["UPPER", "lower"] # noqa: E501
if not set(map_of_enum_string.keys()).issubset(set(allowed_values)): if not set(map_of_enum_string.keys()).issubset(set(allowed_values)):
raise ValueError( raise ValueError(
"Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" "Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501
.format(", ".join(map(str, set(map_of_enum_string.keys())-set(allowed_values))), .format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501
", ".join(map(str, allowed_values))) ", ".join(map(str, allowed_values)))
) )
self._map_of_enum_string = map_of_enum_string self._map_of_enum_string = map_of_enum_string
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -130,28 +126,20 @@ class MapTest(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, MapTest): if not isinstance(other, MapTest):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,20 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
from petstore_api.models.animal import Animal # noqa: F401,E501
class MixedPropertiesAndAdditionalPropertiesClass(object): class MixedPropertiesAndAdditionalPropertiesClass(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -42,10 +44,8 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
'map': 'map' 'map': 'map'
} }
def __init__(self, uuid=None, date_time=None, map=None): def __init__(self, uuid=None, date_time=None, map=None): # noqa: E501
""" """MixedPropertiesAndAdditionalPropertiesClass - a model defined in Swagger""" # noqa: E501
MixedPropertiesAndAdditionalPropertiesClass - a model defined in Swagger
"""
self._uuid = None self._uuid = None
self._date_time = None self._date_time = None
@ -53,28 +53,28 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
self.discriminator = None self.discriminator = None
if uuid is not None: if uuid is not None:
self.uuid = uuid self.uuid = uuid
if date_time is not None: if date_time is not None:
self.date_time = date_time self.date_time = date_time
if map is not None: if map is not None:
self.map = map self.map = map
@property @property
def uuid(self): def uuid(self):
""" """Gets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
Gets the uuid of this MixedPropertiesAndAdditionalPropertiesClass.
:return: The uuid of this MixedPropertiesAndAdditionalPropertiesClass.
:return: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
:rtype: str :rtype: str
""" """
return self._uuid return self._uuid
@uuid.setter @uuid.setter
def uuid(self, uuid): def uuid(self, uuid):
""" """Sets the uuid of this MixedPropertiesAndAdditionalPropertiesClass.
Sets the uuid of this MixedPropertiesAndAdditionalPropertiesClass.
:param uuid: The uuid of this MixedPropertiesAndAdditionalPropertiesClass.
:param uuid: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
:type: str :type: str
""" """
@ -82,20 +82,20 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
@property @property
def date_time(self): def date_time(self):
""" """Gets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
Gets the date_time of this MixedPropertiesAndAdditionalPropertiesClass.
:return: The date_time of this MixedPropertiesAndAdditionalPropertiesClass.
:return: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
:rtype: datetime :rtype: datetime
""" """
return self._date_time return self._date_time
@date_time.setter @date_time.setter
def date_time(self, date_time): def date_time(self, date_time):
""" """Sets the date_time of this MixedPropertiesAndAdditionalPropertiesClass.
Sets the date_time of this MixedPropertiesAndAdditionalPropertiesClass.
:param date_time: The date_time of this MixedPropertiesAndAdditionalPropertiesClass.
:param date_time: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
:type: datetime :type: datetime
""" """
@ -103,32 +103,30 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
@property @property
def map(self): def map(self):
""" """Gets the map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
Gets the map of this MixedPropertiesAndAdditionalPropertiesClass.
:return: The map of this MixedPropertiesAndAdditionalPropertiesClass.
:return: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
:rtype: dict(str, Animal) :rtype: dict(str, Animal)
""" """
return self._map return self._map
@map.setter @map.setter
def map(self, map): def map(self, map):
""" """Sets the map of this MixedPropertiesAndAdditionalPropertiesClass.
Sets the map of this MixedPropertiesAndAdditionalPropertiesClass.
:param map: The map of this MixedPropertiesAndAdditionalPropertiesClass.
:param map: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
:type: dict(str, Animal) :type: dict(str, Animal)
""" """
self._map = map self._map = map
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -149,28 +147,20 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class Model200Response(object): class Model200Response(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -40,36 +40,34 @@ class Model200Response(object):
'_class': 'class' '_class': 'class'
} }
def __init__(self, name=None, _class=None): def __init__(self, name=None, _class=None): # noqa: E501
""" """Model200Response - a model defined in Swagger""" # noqa: E501
Model200Response - a model defined in Swagger
"""
self._name = None self._name = None
self.__class = None self.__class = None
self.discriminator = None self.discriminator = None
if name is not None: if name is not None:
self.name = name self.name = name
if _class is not None: if _class is not None:
self._class = _class self._class = _class
@property @property
def name(self): def name(self):
""" """Gets the name of this Model200Response. # noqa: E501
Gets the name of this Model200Response.
:return: The name of this Model200Response.
:return: The name of this Model200Response. # noqa: E501
:rtype: int :rtype: int
""" """
return self._name return self._name
@name.setter @name.setter
def name(self, name): def name(self, name):
""" """Sets the name of this Model200Response.
Sets the name of this Model200Response.
:param name: The name of this Model200Response.
:param name: The name of this Model200Response. # noqa: E501
:type: int :type: int
""" """
@ -77,32 +75,30 @@ class Model200Response(object):
@property @property
def _class(self): def _class(self):
""" """Gets the _class of this Model200Response. # noqa: E501
Gets the _class of this Model200Response.
:return: The _class of this Model200Response.
:return: The _class of this Model200Response. # noqa: E501
:rtype: str :rtype: str
""" """
return self.__class return self.__class
@_class.setter @_class.setter
def _class(self, _class): def _class(self, _class):
""" """Sets the _class of this Model200Response.
Sets the _class of this Model200Response.
:param _class: The _class of this Model200Response.
:param _class: The _class of this Model200Response. # noqa: E501
:type: str :type: str
""" """
self.__class = _class self.__class = _class
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -123,28 +119,20 @@ class Model200Response(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, Model200Response): if not isinstance(other, Model200Response):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class ModelReturn(object): class ModelReturn(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -38,45 +38,41 @@ class ModelReturn(object):
'_return': 'return' '_return': 'return'
} }
def __init__(self, _return=None): def __init__(self, _return=None): # noqa: E501
""" """ModelReturn - a model defined in Swagger""" # noqa: E501
ModelReturn - a model defined in Swagger
"""
self.__return = None self.__return = None
self.discriminator = None self.discriminator = None
if _return is not None: if _return is not None:
self._return = _return self._return = _return
@property @property
def _return(self): def _return(self):
""" """Gets the _return of this ModelReturn. # noqa: E501
Gets the _return of this ModelReturn.
:return: The _return of this ModelReturn.
:return: The _return of this ModelReturn. # noqa: E501
:rtype: int :rtype: int
""" """
return self.__return return self.__return
@_return.setter @_return.setter
def _return(self, _return): def _return(self, _return):
""" """Sets the _return of this ModelReturn.
Sets the _return of this ModelReturn.
:param _return: The _return of this ModelReturn.
:param _return: The _return of this ModelReturn. # noqa: E501
:type: int :type: int
""" """
self.__return = _return self.__return = _return
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -97,28 +93,20 @@ class ModelReturn(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, ModelReturn): if not isinstance(other, ModelReturn):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class Name(object): class Name(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -44,10 +44,8 @@ class Name(object):
'_123_number': '123Number' '_123_number': '123Number'
} }
def __init__(self, name=None, snake_case=None, _property=None, _123_number=None): def __init__(self, name=None, snake_case=None, _property=None, _123_number=None): # noqa: E501
""" """Name - a model defined in Swagger""" # noqa: E501
Name - a model defined in Swagger
"""
self._name = None self._name = None
self._snake_case = None self._snake_case = None
@ -57,51 +55,51 @@ class Name(object):
self.name = name self.name = name
if snake_case is not None: if snake_case is not None:
self.snake_case = snake_case self.snake_case = snake_case
if _property is not None: if _property is not None:
self._property = _property self._property = _property
if _123_number is not None: if _123_number is not None:
self._123_number = _123_number self._123_number = _123_number
@property @property
def name(self): def name(self):
""" """Gets the name of this Name. # noqa: E501
Gets the name of this Name.
:return: The name of this Name.
:return: The name of this Name. # noqa: E501
:rtype: int :rtype: int
""" """
return self._name return self._name
@name.setter @name.setter
def name(self, name): def name(self, name):
""" """Sets the name of this Name.
Sets the name of this Name.
:param name: The name of this Name.
:param name: The name of this Name. # noqa: E501
:type: int :type: int
""" """
if name is None: if name is None:
raise ValueError("Invalid value for `name`, must not be `None`") raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
self._name = name self._name = name
@property @property
def snake_case(self): def snake_case(self):
""" """Gets the snake_case of this Name. # noqa: E501
Gets the snake_case of this Name.
:return: The snake_case of this Name.
:return: The snake_case of this Name. # noqa: E501
:rtype: int :rtype: int
""" """
return self._snake_case return self._snake_case
@snake_case.setter @snake_case.setter
def snake_case(self, snake_case): def snake_case(self, snake_case):
""" """Sets the snake_case of this Name.
Sets the snake_case of this Name.
:param snake_case: The snake_case of this Name.
:param snake_case: The snake_case of this Name. # noqa: E501
:type: int :type: int
""" """
@ -109,20 +107,20 @@ class Name(object):
@property @property
def _property(self): def _property(self):
""" """Gets the _property of this Name. # noqa: E501
Gets the _property of this Name.
:return: The _property of this Name.
:return: The _property of this Name. # noqa: E501
:rtype: str :rtype: str
""" """
return self.__property return self.__property
@_property.setter @_property.setter
def _property(self, _property): def _property(self, _property):
""" """Sets the _property of this Name.
Sets the _property of this Name.
:param _property: The _property of this Name.
:param _property: The _property of this Name. # noqa: E501
:type: str :type: str
""" """
@ -130,32 +128,30 @@ class Name(object):
@property @property
def _123_number(self): def _123_number(self):
""" """Gets the _123_number of this Name. # noqa: E501
Gets the _123_number of this Name.
:return: The _123_number of this Name.
:return: The _123_number of this Name. # noqa: E501
:rtype: int :rtype: int
""" """
return self.__123_number return self.__123_number
@_123_number.setter @_123_number.setter
def _123_number(self, _123_number): def _123_number(self, _123_number):
""" """Sets the _123_number of this Name.
Sets the _123_number of this Name.
:param _123_number: The _123_number of this Name.
:param _123_number: The _123_number of this Name. # noqa: E501
:type: int :type: int
""" """
self.__123_number = _123_number self.__123_number = _123_number
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -176,28 +172,20 @@ class Name(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, Name): if not isinstance(other, Name):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class NumberOnly(object): class NumberOnly(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -38,45 +38,41 @@ class NumberOnly(object):
'just_number': 'JustNumber' 'just_number': 'JustNumber'
} }
def __init__(self, just_number=None): def __init__(self, just_number=None): # noqa: E501
""" """NumberOnly - a model defined in Swagger""" # noqa: E501
NumberOnly - a model defined in Swagger
"""
self._just_number = None self._just_number = None
self.discriminator = None self.discriminator = None
if just_number is not None: if just_number is not None:
self.just_number = just_number self.just_number = just_number
@property @property
def just_number(self): def just_number(self):
""" """Gets the just_number of this NumberOnly. # noqa: E501
Gets the just_number of this NumberOnly.
:return: The just_number of this NumberOnly.
:return: The just_number of this NumberOnly. # noqa: E501
:rtype: float :rtype: float
""" """
return self._just_number return self._just_number
@just_number.setter @just_number.setter
def just_number(self, just_number): def just_number(self, just_number):
""" """Sets the just_number of this NumberOnly.
Sets the just_number of this NumberOnly.
:param just_number: The just_number of this NumberOnly.
:param just_number: The just_number of this NumberOnly. # noqa: E501
:type: float :type: float
""" """
self._just_number = just_number self._just_number = just_number
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -97,28 +93,20 @@ class NumberOnly(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, NumberOnly): if not isinstance(other, NumberOnly):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class Order(object): class Order(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -48,10 +48,8 @@ class Order(object):
'complete': 'complete' 'complete': 'complete'
} }
def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False): def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False): # noqa: E501
""" """Order - a model defined in Swagger""" # noqa: E501
Order - a model defined in Swagger
"""
self._id = None self._id = None
self._pet_id = None self._pet_id = None
@ -62,34 +60,34 @@ class Order(object):
self.discriminator = None self.discriminator = None
if id is not None: if id is not None:
self.id = id self.id = id
if pet_id is not None: if pet_id is not None:
self.pet_id = pet_id self.pet_id = pet_id
if quantity is not None: if quantity is not None:
self.quantity = quantity self.quantity = quantity
if ship_date is not None: if ship_date is not None:
self.ship_date = ship_date self.ship_date = ship_date
if status is not None: if status is not None:
self.status = status self.status = status
if complete is not None: if complete is not None:
self.complete = complete self.complete = complete
@property @property
def id(self): def id(self):
""" """Gets the id of this Order. # noqa: E501
Gets the id of this Order.
:return: The id of this Order.
:return: The id of this Order. # noqa: E501
:rtype: int :rtype: int
""" """
return self._id return self._id
@id.setter @id.setter
def id(self, id): def id(self, id):
""" """Sets the id of this Order.
Sets the id of this Order.
:param id: The id of this Order.
:param id: The id of this Order. # noqa: E501
:type: int :type: int
""" """
@ -97,20 +95,20 @@ class Order(object):
@property @property
def pet_id(self): def pet_id(self):
""" """Gets the pet_id of this Order. # noqa: E501
Gets the pet_id of this Order.
:return: The pet_id of this Order.
:return: The pet_id of this Order. # noqa: E501
:rtype: int :rtype: int
""" """
return self._pet_id return self._pet_id
@pet_id.setter @pet_id.setter
def pet_id(self, pet_id): def pet_id(self, pet_id):
""" """Sets the pet_id of this Order.
Sets the pet_id of this Order.
:param pet_id: The pet_id of this Order.
:param pet_id: The pet_id of this Order. # noqa: E501
:type: int :type: int
""" """
@ -118,20 +116,20 @@ class Order(object):
@property @property
def quantity(self): def quantity(self):
""" """Gets the quantity of this Order. # noqa: E501
Gets the quantity of this Order.
:return: The quantity of this Order.
:return: The quantity of this Order. # noqa: E501
:rtype: int :rtype: int
""" """
return self._quantity return self._quantity
@quantity.setter @quantity.setter
def quantity(self, quantity): def quantity(self, quantity):
""" """Sets the quantity of this Order.
Sets the quantity of this Order.
:param quantity: The quantity of this Order.
:param quantity: The quantity of this Order. # noqa: E501
:type: int :type: int
""" """
@ -139,20 +137,20 @@ class Order(object):
@property @property
def ship_date(self): def ship_date(self):
""" """Gets the ship_date of this Order. # noqa: E501
Gets the ship_date of this Order.
:return: The ship_date of this Order.
:return: The ship_date of this Order. # noqa: E501
:rtype: datetime :rtype: datetime
""" """
return self._ship_date return self._ship_date
@ship_date.setter @ship_date.setter
def ship_date(self, ship_date): def ship_date(self, ship_date):
""" """Sets the ship_date of this Order.
Sets the ship_date of this Order.
:param ship_date: The ship_date of this Order.
:param ship_date: The ship_date of this Order. # noqa: E501
:type: datetime :type: datetime
""" """
@ -160,28 +158,28 @@ class Order(object):
@property @property
def status(self): def status(self):
""" """Gets the status of this Order. # noqa: E501
Gets the status of this Order.
Order Status
:return: The status of this Order. Order Status # noqa: E501
:return: The status of this Order. # noqa: E501
:rtype: str :rtype: str
""" """
return self._status return self._status
@status.setter @status.setter
def status(self, status): def status(self, status):
""" """Sets the status of this Order.
Sets the status of this Order.
Order Status
:param status: The status of this Order. Order Status # noqa: E501
:param status: The status of this Order. # noqa: E501
:type: str :type: str
""" """
allowed_values = ["placed", "approved", "delivered"] allowed_values = ["placed", "approved", "delivered"] # noqa: E501
if status not in allowed_values: if status not in allowed_values:
raise ValueError( raise ValueError(
"Invalid value for `status` ({0}), must be one of {1}" "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501
.format(status, allowed_values) .format(status, allowed_values)
) )
@ -189,32 +187,30 @@ class Order(object):
@property @property
def complete(self): def complete(self):
""" """Gets the complete of this Order. # noqa: E501
Gets the complete of this Order.
:return: The complete of this Order.
:return: The complete of this Order. # noqa: E501
:rtype: bool :rtype: bool
""" """
return self._complete return self._complete
@complete.setter @complete.setter
def complete(self, complete): def complete(self, complete):
""" """Sets the complete of this Order.
Sets the complete of this Order.
:param complete: The complete of this Order.
:param complete: The complete of this Order. # noqa: E501
:type: bool :type: bool
""" """
self._complete = complete self._complete = complete
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -235,28 +231,20 @@ class Order(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, Order): if not isinstance(other, Order):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class OuterBoolean(object): class OuterBoolean(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -31,28 +31,20 @@ class OuterBoolean(object):
and the value is json key in definition. and the value is json key in definition.
""" """
swagger_types = { swagger_types = {
} }
attribute_map = { attribute_map = {
} }
def __init__(self): def __init__(self): # noqa: E501
""" """OuterBoolean - a model defined in Swagger""" # noqa: E501
OuterBoolean - a model defined in Swagger
"""
self.discriminator = None self.discriminator = None
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -73,28 +65,20 @@ class OuterBoolean(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, OuterBoolean): if not isinstance(other, OuterBoolean):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,22 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
from petstore_api.models.outer_boolean import OuterBoolean # noqa: F401,E501
from petstore_api.models.outer_number import OuterNumber # noqa: F401,E501
from petstore_api.models.outer_string import OuterString # noqa: F401,E501
class OuterComposite(object): class OuterComposite(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -42,10 +46,8 @@ class OuterComposite(object):
'my_boolean': 'my_boolean' 'my_boolean': 'my_boolean'
} }
def __init__(self, my_number=None, my_string=None, my_boolean=None): def __init__(self, my_number=None, my_string=None, my_boolean=None): # noqa: E501
""" """OuterComposite - a model defined in Swagger""" # noqa: E501
OuterComposite - a model defined in Swagger
"""
self._my_number = None self._my_number = None
self._my_string = None self._my_string = None
@ -53,28 +55,28 @@ class OuterComposite(object):
self.discriminator = None self.discriminator = None
if my_number is not None: if my_number is not None:
self.my_number = my_number self.my_number = my_number
if my_string is not None: if my_string is not None:
self.my_string = my_string self.my_string = my_string
if my_boolean is not None: if my_boolean is not None:
self.my_boolean = my_boolean self.my_boolean = my_boolean
@property @property
def my_number(self): def my_number(self):
""" """Gets the my_number of this OuterComposite. # noqa: E501
Gets the my_number of this OuterComposite.
:return: The my_number of this OuterComposite.
:return: The my_number of this OuterComposite. # noqa: E501
:rtype: OuterNumber :rtype: OuterNumber
""" """
return self._my_number return self._my_number
@my_number.setter @my_number.setter
def my_number(self, my_number): def my_number(self, my_number):
""" """Sets the my_number of this OuterComposite.
Sets the my_number of this OuterComposite.
:param my_number: The my_number of this OuterComposite.
:param my_number: The my_number of this OuterComposite. # noqa: E501
:type: OuterNumber :type: OuterNumber
""" """
@ -82,20 +84,20 @@ class OuterComposite(object):
@property @property
def my_string(self): def my_string(self):
""" """Gets the my_string of this OuterComposite. # noqa: E501
Gets the my_string of this OuterComposite.
:return: The my_string of this OuterComposite.
:return: The my_string of this OuterComposite. # noqa: E501
:rtype: OuterString :rtype: OuterString
""" """
return self._my_string return self._my_string
@my_string.setter @my_string.setter
def my_string(self, my_string): def my_string(self, my_string):
""" """Sets the my_string of this OuterComposite.
Sets the my_string of this OuterComposite.
:param my_string: The my_string of this OuterComposite.
:param my_string: The my_string of this OuterComposite. # noqa: E501
:type: OuterString :type: OuterString
""" """
@ -103,32 +105,30 @@ class OuterComposite(object):
@property @property
def my_boolean(self): def my_boolean(self):
""" """Gets the my_boolean of this OuterComposite. # noqa: E501
Gets the my_boolean of this OuterComposite.
:return: The my_boolean of this OuterComposite.
:return: The my_boolean of this OuterComposite. # noqa: E501
:rtype: OuterBoolean :rtype: OuterBoolean
""" """
return self._my_boolean return self._my_boolean
@my_boolean.setter @my_boolean.setter
def my_boolean(self, my_boolean): def my_boolean(self, my_boolean):
""" """Sets the my_boolean of this OuterComposite.
Sets the my_boolean of this OuterComposite.
:param my_boolean: The my_boolean of this OuterComposite.
:param my_boolean: The my_boolean of this OuterComposite. # noqa: E501
:type: OuterBoolean :type: OuterBoolean
""" """
self._my_boolean = my_boolean self._my_boolean = my_boolean
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -149,28 +149,20 @@ class OuterComposite(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, OuterComposite): if not isinstance(other, OuterComposite):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,14 +11,15 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class OuterEnum(object): class OuterEnum(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
@ -37,28 +38,20 @@ class OuterEnum(object):
and the value is json key in definition. and the value is json key in definition.
""" """
swagger_types = { swagger_types = {
} }
attribute_map = { attribute_map = {
} }
def __init__(self): def __init__(self): # noqa: E501
""" """OuterEnum - a model defined in Swagger""" # noqa: E501
OuterEnum - a model defined in Swagger
"""
self.discriminator = None self.discriminator = None
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -79,28 +72,20 @@ class OuterEnum(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, OuterEnum): if not isinstance(other, OuterEnum):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class OuterNumber(object): class OuterNumber(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -31,28 +31,20 @@ class OuterNumber(object):
and the value is json key in definition. and the value is json key in definition.
""" """
swagger_types = { swagger_types = {
} }
attribute_map = { attribute_map = {
} }
def __init__(self): def __init__(self): # noqa: E501
""" """OuterNumber - a model defined in Swagger""" # noqa: E501
OuterNumber - a model defined in Swagger
"""
self.discriminator = None self.discriminator = None
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -73,28 +65,20 @@ class OuterNumber(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, OuterNumber): if not isinstance(other, OuterNumber):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class OuterString(object): class OuterString(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -31,28 +31,20 @@ class OuterString(object):
and the value is json key in definition. and the value is json key in definition.
""" """
swagger_types = { swagger_types = {
} }
attribute_map = { attribute_map = {
} }
def __init__(self): def __init__(self): # noqa: E501
""" """OuterString - a model defined in Swagger""" # noqa: E501
OuterString - a model defined in Swagger
"""
self.discriminator = None self.discriminator = None
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -73,28 +65,20 @@ class OuterString(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, OuterString): if not isinstance(other, OuterString):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,21 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
from petstore_api.models.category import Category # noqa: F401,E501
from petstore_api.models.tag import Tag # noqa: F401,E501
class Pet(object): class Pet(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -48,10 +51,8 @@ class Pet(object):
'status': 'status' 'status': 'status'
} }
def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None): def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None): # noqa: E501
""" """Pet - a model defined in Swagger""" # noqa: E501
Pet - a model defined in Swagger
"""
self._id = None self._id = None
self._category = None self._category = None
@ -62,32 +63,32 @@ class Pet(object):
self.discriminator = None self.discriminator = None
if id is not None: if id is not None:
self.id = id self.id = id
if category is not None: if category is not None:
self.category = category self.category = category
self.name = name self.name = name
self.photo_urls = photo_urls self.photo_urls = photo_urls
if tags is not None: if tags is not None:
self.tags = tags self.tags = tags
if status is not None: if status is not None:
self.status = status self.status = status
@property @property
def id(self): def id(self):
""" """Gets the id of this Pet. # noqa: E501
Gets the id of this Pet.
:return: The id of this Pet.
:return: The id of this Pet. # noqa: E501
:rtype: int :rtype: int
""" """
return self._id return self._id
@id.setter @id.setter
def id(self, id): def id(self, id):
""" """Sets the id of this Pet.
Sets the id of this Pet.
:param id: The id of this Pet.
:param id: The id of this Pet. # noqa: E501
:type: int :type: int
""" """
@ -95,20 +96,20 @@ class Pet(object):
@property @property
def category(self): def category(self):
""" """Gets the category of this Pet. # noqa: E501
Gets the category of this Pet.
:return: The category of this Pet.
:return: The category of this Pet. # noqa: E501
:rtype: Category :rtype: Category
""" """
return self._category return self._category
@category.setter @category.setter
def category(self, category): def category(self, category):
""" """Sets the category of this Pet.
Sets the category of this Pet.
:param category: The category of this Pet.
:param category: The category of this Pet. # noqa: E501
:type: Category :type: Category
""" """
@ -116,66 +117,66 @@ class Pet(object):
@property @property
def name(self): def name(self):
""" """Gets the name of this Pet. # noqa: E501
Gets the name of this Pet.
:return: The name of this Pet.
:return: The name of this Pet. # noqa: E501
:rtype: str :rtype: str
""" """
return self._name return self._name
@name.setter @name.setter
def name(self, name): def name(self, name):
""" """Sets the name of this Pet.
Sets the name of this Pet.
:param name: The name of this Pet.
:param name: The name of this Pet. # noqa: E501
:type: str :type: str
""" """
if name is None: if name is None:
raise ValueError("Invalid value for `name`, must not be `None`") raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
self._name = name self._name = name
@property @property
def photo_urls(self): def photo_urls(self):
""" """Gets the photo_urls of this Pet. # noqa: E501
Gets the photo_urls of this Pet.
:return: The photo_urls of this Pet.
:return: The photo_urls of this Pet. # noqa: E501
:rtype: list[str] :rtype: list[str]
""" """
return self._photo_urls return self._photo_urls
@photo_urls.setter @photo_urls.setter
def photo_urls(self, photo_urls): def photo_urls(self, photo_urls):
""" """Sets the photo_urls of this Pet.
Sets the photo_urls of this Pet.
:param photo_urls: The photo_urls of this Pet.
:param photo_urls: The photo_urls of this Pet. # noqa: E501
:type: list[str] :type: list[str]
""" """
if photo_urls is None: if photo_urls is None:
raise ValueError("Invalid value for `photo_urls`, must not be `None`") raise ValueError("Invalid value for `photo_urls`, must not be `None`") # noqa: E501
self._photo_urls = photo_urls self._photo_urls = photo_urls
@property @property
def tags(self): def tags(self):
""" """Gets the tags of this Pet. # noqa: E501
Gets the tags of this Pet.
:return: The tags of this Pet.
:return: The tags of this Pet. # noqa: E501
:rtype: list[Tag] :rtype: list[Tag]
""" """
return self._tags return self._tags
@tags.setter @tags.setter
def tags(self, tags): def tags(self, tags):
""" """Sets the tags of this Pet.
Sets the tags of this Pet.
:param tags: The tags of this Pet.
:param tags: The tags of this Pet. # noqa: E501
:type: list[Tag] :type: list[Tag]
""" """
@ -183,40 +184,38 @@ class Pet(object):
@property @property
def status(self): def status(self):
""" """Gets the status of this Pet. # noqa: E501
Gets the status of this Pet.
pet status in the store
:return: The status of this Pet. pet status in the store # noqa: E501
:return: The status of this Pet. # noqa: E501
:rtype: str :rtype: str
""" """
return self._status return self._status
@status.setter @status.setter
def status(self, status): def status(self, status):
""" """Sets the status of this Pet.
Sets the status of this Pet.
pet status in the store
:param status: The status of this Pet. pet status in the store # noqa: E501
:param status: The status of this Pet. # noqa: E501
:type: str :type: str
""" """
allowed_values = ["available", "pending", "sold"] allowed_values = ["available", "pending", "sold"] # noqa: E501
if status not in allowed_values: if status not in allowed_values:
raise ValueError( raise ValueError(
"Invalid value for `status` ({0}), must be one of {1}" "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501
.format(status, allowed_values) .format(status, allowed_values)
) )
self._status = status self._status = status
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -237,28 +236,20 @@ class Pet(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, Pet): if not isinstance(other, Pet):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class ReadOnlyFirst(object): class ReadOnlyFirst(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -40,36 +40,34 @@ class ReadOnlyFirst(object):
'baz': 'baz' 'baz': 'baz'
} }
def __init__(self, bar=None, baz=None): def __init__(self, bar=None, baz=None): # noqa: E501
""" """ReadOnlyFirst - a model defined in Swagger""" # noqa: E501
ReadOnlyFirst - a model defined in Swagger
"""
self._bar = None self._bar = None
self._baz = None self._baz = None
self.discriminator = None self.discriminator = None
if bar is not None: if bar is not None:
self.bar = bar self.bar = bar
if baz is not None: if baz is not None:
self.baz = baz self.baz = baz
@property @property
def bar(self): def bar(self):
""" """Gets the bar of this ReadOnlyFirst. # noqa: E501
Gets the bar of this ReadOnlyFirst.
:return: The bar of this ReadOnlyFirst.
:return: The bar of this ReadOnlyFirst. # noqa: E501
:rtype: str :rtype: str
""" """
return self._bar return self._bar
@bar.setter @bar.setter
def bar(self, bar): def bar(self, bar):
""" """Sets the bar of this ReadOnlyFirst.
Sets the bar of this ReadOnlyFirst.
:param bar: The bar of this ReadOnlyFirst.
:param bar: The bar of this ReadOnlyFirst. # noqa: E501
:type: str :type: str
""" """
@ -77,32 +75,30 @@ class ReadOnlyFirst(object):
@property @property
def baz(self): def baz(self):
""" """Gets the baz of this ReadOnlyFirst. # noqa: E501
Gets the baz of this ReadOnlyFirst.
:return: The baz of this ReadOnlyFirst.
:return: The baz of this ReadOnlyFirst. # noqa: E501
:rtype: str :rtype: str
""" """
return self._baz return self._baz
@baz.setter @baz.setter
def baz(self, baz): def baz(self, baz):
""" """Sets the baz of this ReadOnlyFirst.
Sets the baz of this ReadOnlyFirst.
:param baz: The baz of this ReadOnlyFirst.
:param baz: The baz of this ReadOnlyFirst. # noqa: E501
:type: str :type: str
""" """
self._baz = baz self._baz = baz
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -123,28 +119,20 @@ class ReadOnlyFirst(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, ReadOnlyFirst): if not isinstance(other, ReadOnlyFirst):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class SpecialModelName(object): class SpecialModelName(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -38,45 +38,41 @@ class SpecialModelName(object):
'special_property_name': '$special[property.name]' 'special_property_name': '$special[property.name]'
} }
def __init__(self, special_property_name=None): def __init__(self, special_property_name=None): # noqa: E501
""" """SpecialModelName - a model defined in Swagger""" # noqa: E501
SpecialModelName - a model defined in Swagger
"""
self._special_property_name = None self._special_property_name = None
self.discriminator = None self.discriminator = None
if special_property_name is not None: if special_property_name is not None:
self.special_property_name = special_property_name self.special_property_name = special_property_name
@property @property
def special_property_name(self): def special_property_name(self):
""" """Gets the special_property_name of this SpecialModelName. # noqa: E501
Gets the special_property_name of this SpecialModelName.
:return: The special_property_name of this SpecialModelName.
:return: The special_property_name of this SpecialModelName. # noqa: E501
:rtype: int :rtype: int
""" """
return self._special_property_name return self._special_property_name
@special_property_name.setter @special_property_name.setter
def special_property_name(self, special_property_name): def special_property_name(self, special_property_name):
""" """Sets the special_property_name of this SpecialModelName.
Sets the special_property_name of this SpecialModelName.
:param special_property_name: The special_property_name of this SpecialModelName.
:param special_property_name: The special_property_name of this SpecialModelName. # noqa: E501
:type: int :type: int
""" """
self._special_property_name = special_property_name self._special_property_name = special_property_name
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -97,28 +93,20 @@ class SpecialModelName(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, SpecialModelName): if not isinstance(other, SpecialModelName):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class Tag(object): class Tag(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -40,36 +40,34 @@ class Tag(object):
'name': 'name' 'name': 'name'
} }
def __init__(self, id=None, name=None): def __init__(self, id=None, name=None): # noqa: E501
""" """Tag - a model defined in Swagger""" # noqa: E501
Tag - a model defined in Swagger
"""
self._id = None self._id = None
self._name = None self._name = None
self.discriminator = None self.discriminator = None
if id is not None: if id is not None:
self.id = id self.id = id
if name is not None: if name is not None:
self.name = name self.name = name
@property @property
def id(self): def id(self):
""" """Gets the id of this Tag. # noqa: E501
Gets the id of this Tag.
:return: The id of this Tag.
:return: The id of this Tag. # noqa: E501
:rtype: int :rtype: int
""" """
return self._id return self._id
@id.setter @id.setter
def id(self, id): def id(self, id):
""" """Sets the id of this Tag.
Sets the id of this Tag.
:param id: The id of this Tag.
:param id: The id of this Tag. # noqa: E501
:type: int :type: int
""" """
@ -77,32 +75,30 @@ class Tag(object):
@property @property
def name(self): def name(self):
""" """Gets the name of this Tag. # noqa: E501
Gets the name of this Tag.
:return: The name of this Tag.
:return: The name of this Tag. # noqa: E501
:rtype: str :rtype: str
""" """
return self._name return self._name
@name.setter @name.setter
def name(self, name): def name(self, name):
""" """Sets the name of this Tag.
Sets the name of this Tag.
:param name: The name of this Tag.
:param name: The name of this Tag. # noqa: E501
:type: str :type: str
""" """
self._name = name self._name = name
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -123,28 +119,20 @@ class Tag(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, Tag): if not isinstance(other, Tag):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,18 +11,18 @@
""" """
from pprint import pformat import pprint
from six import iteritems import re # noqa: F401
import re
import six
class User(object): class User(object):
""" """NOTE: This class is auto generated by the swagger code generator program.
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
""" """
Attributes: Attributes:
swagger_types (dict): The key is attribute name swagger_types (dict): The key is attribute name
@ -52,10 +52,8 @@ class User(object):
'user_status': 'userStatus' 'user_status': 'userStatus'
} }
def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None): def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None): # noqa: E501
""" """User - a model defined in Swagger""" # noqa: E501
User - a model defined in Swagger
"""
self._id = None self._id = None
self._username = None self._username = None
@ -68,38 +66,38 @@ class User(object):
self.discriminator = None self.discriminator = None
if id is not None: if id is not None:
self.id = id self.id = id
if username is not None: if username is not None:
self.username = username self.username = username
if first_name is not None: if first_name is not None:
self.first_name = first_name self.first_name = first_name
if last_name is not None: if last_name is not None:
self.last_name = last_name self.last_name = last_name
if email is not None: if email is not None:
self.email = email self.email = email
if password is not None: if password is not None:
self.password = password self.password = password
if phone is not None: if phone is not None:
self.phone = phone self.phone = phone
if user_status is not None: if user_status is not None:
self.user_status = user_status self.user_status = user_status
@property @property
def id(self): def id(self):
""" """Gets the id of this User. # noqa: E501
Gets the id of this User.
:return: The id of this User.
:return: The id of this User. # noqa: E501
:rtype: int :rtype: int
""" """
return self._id return self._id
@id.setter @id.setter
def id(self, id): def id(self, id):
""" """Sets the id of this User.
Sets the id of this User.
:param id: The id of this User.
:param id: The id of this User. # noqa: E501
:type: int :type: int
""" """
@ -107,20 +105,20 @@ class User(object):
@property @property
def username(self): def username(self):
""" """Gets the username of this User. # noqa: E501
Gets the username of this User.
:return: The username of this User.
:return: The username of this User. # noqa: E501
:rtype: str :rtype: str
""" """
return self._username return self._username
@username.setter @username.setter
def username(self, username): def username(self, username):
""" """Sets the username of this User.
Sets the username of this User.
:param username: The username of this User.
:param username: The username of this User. # noqa: E501
:type: str :type: str
""" """
@ -128,20 +126,20 @@ class User(object):
@property @property
def first_name(self): def first_name(self):
""" """Gets the first_name of this User. # noqa: E501
Gets the first_name of this User.
:return: The first_name of this User.
:return: The first_name of this User. # noqa: E501
:rtype: str :rtype: str
""" """
return self._first_name return self._first_name
@first_name.setter @first_name.setter
def first_name(self, first_name): def first_name(self, first_name):
""" """Sets the first_name of this User.
Sets the first_name of this User.
:param first_name: The first_name of this User.
:param first_name: The first_name of this User. # noqa: E501
:type: str :type: str
""" """
@ -149,20 +147,20 @@ class User(object):
@property @property
def last_name(self): def last_name(self):
""" """Gets the last_name of this User. # noqa: E501
Gets the last_name of this User.
:return: The last_name of this User.
:return: The last_name of this User. # noqa: E501
:rtype: str :rtype: str
""" """
return self._last_name return self._last_name
@last_name.setter @last_name.setter
def last_name(self, last_name): def last_name(self, last_name):
""" """Sets the last_name of this User.
Sets the last_name of this User.
:param last_name: The last_name of this User.
:param last_name: The last_name of this User. # noqa: E501
:type: str :type: str
""" """
@ -170,20 +168,20 @@ class User(object):
@property @property
def email(self): def email(self):
""" """Gets the email of this User. # noqa: E501
Gets the email of this User.
:return: The email of this User.
:return: The email of this User. # noqa: E501
:rtype: str :rtype: str
""" """
return self._email return self._email
@email.setter @email.setter
def email(self, email): def email(self, email):
""" """Sets the email of this User.
Sets the email of this User.
:param email: The email of this User.
:param email: The email of this User. # noqa: E501
:type: str :type: str
""" """
@ -191,20 +189,20 @@ class User(object):
@property @property
def password(self): def password(self):
""" """Gets the password of this User. # noqa: E501
Gets the password of this User.
:return: The password of this User.
:return: The password of this User. # noqa: E501
:rtype: str :rtype: str
""" """
return self._password return self._password
@password.setter @password.setter
def password(self, password): def password(self, password):
""" """Sets the password of this User.
Sets the password of this User.
:param password: The password of this User.
:param password: The password of this User. # noqa: E501
:type: str :type: str
""" """
@ -212,20 +210,20 @@ class User(object):
@property @property
def phone(self): def phone(self):
""" """Gets the phone of this User. # noqa: E501
Gets the phone of this User.
:return: The phone of this User.
:return: The phone of this User. # noqa: E501
:rtype: str :rtype: str
""" """
return self._phone return self._phone
@phone.setter @phone.setter
def phone(self, phone): def phone(self, phone):
""" """Sets the phone of this User.
Sets the phone of this User.
:param phone: The phone of this User.
:param phone: The phone of this User. # noqa: E501
:type: str :type: str
""" """
@ -233,34 +231,32 @@ class User(object):
@property @property
def user_status(self): def user_status(self):
""" """Gets the user_status of this User. # noqa: E501
Gets the user_status of this User.
User Status
:return: The user_status of this User. User Status # noqa: E501
:return: The user_status of this User. # noqa: E501
:rtype: int :rtype: int
""" """
return self._user_status return self._user_status
@user_status.setter @user_status.setter
def user_status(self, user_status): def user_status(self, user_status):
""" """Sets the user_status of this User.
Sets the user_status of this User.
User Status
:param user_status: The user_status of this User. User Status # noqa: E501
:param user_status: The user_status of this User. # noqa: E501
:type: int :type: int
""" """
self._user_status = user_status self._user_status = user_status
def to_dict(self): def to_dict(self):
""" """Returns the model properties as a dict"""
Returns the model properties as a dict
"""
result = {} result = {}
for attr, _ in iteritems(self.swagger_types): for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, list): if isinstance(value, list):
result[attr] = list(map( result[attr] = list(map(
@ -281,28 +277,20 @@ class User(object):
return result return result
def to_str(self): def to_str(self):
""" """Returns the string representation of the model"""
Returns the string representation of the model return pprint.pformat(self.to_dict())
"""
return pformat(self.to_dict())
def __repr__(self): def __repr__(self):
""" """For `print` and `pprint`"""
For `print` and `pprint`
"""
return self.to_str() return self.to_str()
def __eq__(self, other): def __eq__(self, other):
""" """Returns true if both objects are equal"""
Returns true if both objects are equal
"""
if not isinstance(other, User): if not isinstance(other, User):
return False return False
return self.__dict__ == other.__dict__ return self.__dict__ == other.__dict__
def __ne__(self, other): def __ne__(self, other):
""" """Returns true if both objects are not equal"""
Returns true if both objects are not equal
"""
return not self == other return not self == other

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,16 +11,15 @@
""" """
import aiohttp
import io import io
import json import json
import ssl
import certifi
import logging import logging
import re import re
import ssl
import aiohttp
import certifi
# python 2 and python 3 compatibility library # python 2 and python 3 compatibility library
from six import PY3
from six.moves.urllib.parse import urlencode from six.moves.urllib.parse import urlencode
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -35,22 +34,18 @@ class RESTResponse(io.IOBase):
self.data = data self.data = data
def getheaders(self): def getheaders(self):
""" """Returns a CIMultiDictProxy of the response headers."""
Returns a CIMultiDictProxy of the response headers.
"""
return self.aiohttp_response.headers return self.aiohttp_response.headers
def getheader(self, name, default=None): def getheader(self, name, default=None):
""" """Returns a given response header."""
Returns a given response header.
"""
return self.aiohttp_response.headers.get(name, default) return self.aiohttp_response.headers.get(name, default)
class RESTClientObject: class RESTClientObject(object):
def __init__(self, configuration, pools_size=4, maxsize=4): def __init__(self, configuration, pools_size=4, maxsize=4):
# maxsize is the number of requests to host that are allowed in parallel # maxsize is number of requests to host that are allowed in parallel
# ca_certs vs cert_file vs key_file # ca_certs vs cert_file vs key_file
# http://stackoverflow.com/a/23957365/2985775 # http://stackoverflow.com/a/23957365/2985775
@ -62,6 +57,7 @@ class RESTClientObject:
ca_certs = certifi.where() ca_certs = certifi.where()
ssl_context = ssl.SSLContext() ssl_context = ssl.SSLContext()
ssl_context.load_verify_locations(cafile=ca_certs)
if configuration.cert_file: if configuration.cert_file:
ssl_context.load_cert_chain( ssl_context.load_cert_chain(
configuration.cert_file, keyfile=configuration.key_file configuration.cert_file, keyfile=configuration.key_file
@ -69,6 +65,7 @@ class RESTClientObject:
connector = aiohttp.TCPConnector( connector = aiohttp.TCPConnector(
limit=maxsize, limit=maxsize,
ssl_context=ssl_context,
verify_ssl=configuration.verify_ssl verify_ssl=configuration.verify_ssl
) )
@ -84,8 +81,10 @@ class RESTClientObject:
) )
async def request(self, method, url, query_params=None, headers=None, async def request(self, method, url, query_params=None, headers=None,
body=None, post_params=None, _preload_content=True, _request_timeout=None): body=None, post_params=None, _preload_content=True,
""" _request_timeout=None):
"""Execute request
:param method: http request method :param method: http request method
:param url: http request url :param url: http request url
:param query_params: query parameters in the url :param query_params: query parameters in the url
@ -94,12 +93,16 @@ class RESTClientObject:
:param post_params: request post parameters, :param post_params: request post parameters,
`application/x-www-form-urlencoded` `application/x-www-form-urlencoded`
and `multipart/form-data` and `multipart/form-data`
:param _preload_content: this is a non-applicable field for the AiohttpClient. :param _preload_content: this is a non-applicable field for
:param _request_timeout: timeout setting for this request. If one number provided, it will be total request the AiohttpClient.
timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
""" """
method = method.upper() method = method.upper()
assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', 'PATCH', 'OPTIONS'] assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
'PATCH', 'OPTIONS']
if post_params and body: if post_params and body:
raise ValueError( raise ValueError(
@ -127,7 +130,7 @@ class RESTClientObject:
if body is not None: if body is not None:
body = json.dumps(body) body = json.dumps(body)
args["data"] = body args["data"] = body
elif headers['Content-Type'] == 'application/x-www-form-urlencoded': elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
data = aiohttp.FormData() data = aiohttp.FormData()
for k, v in post_params.items(): for k, v in post_params.items():
data.add_field(k, v) data.add_field(k, v)
@ -141,8 +144,9 @@ class RESTClientObject:
args["data"] = body args["data"] = body
else: else:
# Cannot generate the request from given parameters # Cannot generate the request from given parameters
msg = """Cannot prepare a request message for provided arguments. msg = """Cannot prepare a request message for provided
Please check that your arguments match declared content type.""" arguments. Please check that your arguments match
declared content type."""
raise ApiException(status=0, reason=msg) raise ApiException(status=0, reason=msg)
else: else:
args["data"] = query_params args["data"] = query_params
@ -159,22 +163,25 @@ class RESTClientObject:
return r return r
async def GET(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): async def GET(self, url, headers=None, query_params=None,
_preload_content=True, _request_timeout=None):
return (await self.request("GET", url, return (await self.request("GET", url,
headers=headers, headers=headers,
_preload_content=_preload_content, _preload_content=_preload_content,
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
query_params=query_params)) query_params=query_params))
async def HEAD(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): async def HEAD(self, url, headers=None, query_params=None,
_preload_content=True, _request_timeout=None):
return (await self.request("HEAD", url, return (await self.request("HEAD", url,
headers=headers, headers=headers,
_preload_content=_preload_content, _preload_content=_preload_content,
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
query_params=query_params)) query_params=query_params))
async def OPTIONS(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, async def OPTIONS(self, url, headers=None, query_params=None,
_request_timeout=None): post_params=None, body=None, _preload_content=True,
_request_timeout=None):
return (await self.request("OPTIONS", url, return (await self.request("OPTIONS", url,
headers=headers, headers=headers,
query_params=query_params, query_params=query_params,
@ -183,7 +190,8 @@ class RESTClientObject:
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
body=body)) body=body))
async def DELETE(self, url, headers=None, query_params=None, body=None, _preload_content=True, _request_timeout=None): async def DELETE(self, url, headers=None, query_params=None, body=None,
_preload_content=True, _request_timeout=None):
return (await self.request("DELETE", url, return (await self.request("DELETE", url,
headers=headers, headers=headers,
query_params=query_params, query_params=query_params,
@ -191,8 +199,9 @@ class RESTClientObject:
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
body=body)) body=body))
async def POST(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, async def POST(self, url, headers=None, query_params=None,
_request_timeout=None): post_params=None, body=None, _preload_content=True,
_request_timeout=None):
return (await self.request("POST", url, return (await self.request("POST", url,
headers=headers, headers=headers,
query_params=query_params, query_params=query_params,
@ -201,8 +210,8 @@ class RESTClientObject:
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
body=body)) body=body))
async def PUT(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, async def PUT(self, url, headers=None, query_params=None, post_params=None,
_request_timeout=None): body=None, _preload_content=True, _request_timeout=None):
return (await self.request("PUT", url, return (await self.request("PUT", url,
headers=headers, headers=headers,
query_params=query_params, query_params=query_params,
@ -211,8 +220,9 @@ class RESTClientObject:
_request_timeout=_request_timeout, _request_timeout=_request_timeout,
body=body)) body=body))
async def PATCH(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, async def PATCH(self, url, headers=None, query_params=None,
_request_timeout=None): post_params=None, body=None, _preload_content=True,
_request_timeout=None):
return (await self.request("PATCH", url, return (await self.request("PATCH", url,
headers=headers, headers=headers,
query_params=query_params, query_params=query_params,
@ -237,13 +247,11 @@ class ApiException(Exception):
self.headers = None self.headers = None
def __str__(self): def __str__(self):
""" """Custom error messages for exception"""
Custom error messages for exception error_message = "({0})\nReason: {1}\n".format(self.status, self.reason)
"""
error_message = "({0})\n"\
"Reason: {1}\n".format(self.status, self.reason)
if self.headers: if self.headers:
error_message += "HTTP response headers: {0}\n".format(self.headers) error_message += "HTTP response headers: {0}\n".format(
self.headers)
if self.body: if self.body:
error_message += "HTTP response body: {0}\n".format(self.body) error_message += "HTTP response body: {0}\n".format(self.body)

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -11,8 +11,7 @@
""" """
import sys from setuptools import setup, find_packages # noqa: H301
from setuptools import setup, find_packages
NAME = "petstore-api" NAME = "petstore-api"
VERSION = "1.0.0" VERSION = "1.0.0"
@ -37,6 +36,6 @@ setup(
packages=find_packages(), packages=find_packages(),
include_package_data=True, include_package_data=True,
long_description="""\ long_description="""\
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \&quot; \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \&quot; \\ # noqa: E501
""" """
) )

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
class TestAdditionalPropertiesClass(unittest.TestCase): class TestAdditionalPropertiesClass(unittest.TestCase):
""" AdditionalPropertiesClass unit test stubs """ """AdditionalPropertiesClass unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestAdditionalPropertiesClass(unittest.TestCase):
pass pass
def testAdditionalPropertiesClass(self): def testAdditionalPropertiesClass(self):
""" """Test AdditionalPropertiesClass"""
Test AdditionalPropertiesClass
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.animal import Animal # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.animal import Animal
class TestAnimal(unittest.TestCase): class TestAnimal(unittest.TestCase):
""" Animal unit test stubs """ """Animal unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestAnimal(unittest.TestCase):
pass pass
def testAnimal(self): def testAnimal(self):
""" """Test Animal"""
Test Animal
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.animal.Animal() # model = petstore_api.models.animal.Animal() # noqa: E501
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.animal_farm import AnimalFarm # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.animal_farm import AnimalFarm
class TestAnimalFarm(unittest.TestCase): class TestAnimalFarm(unittest.TestCase):
""" AnimalFarm unit test stubs """ """AnimalFarm unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestAnimalFarm(unittest.TestCase):
pass pass
def testAnimalFarm(self): def testAnimalFarm(self):
""" """Test AnimalFarm"""
Test AnimalFarm
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.animal_farm.AnimalFarm() # model = petstore_api.models.animal_farm.AnimalFarm() # noqa: E501
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,29 +13,26 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.apis.another_fake_api import AnotherFakeApi
class TestAnotherFakeApi(unittest.TestCase): class TestAnotherFakeApi(unittest.TestCase):
""" AnotherFakeApi unit test stubs """ """AnotherFakeApi unit test stubs"""
def setUp(self): def setUp(self):
self.api = petstore_api.apis.another_fake_api.AnotherFakeApi() self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501
def tearDown(self): def tearDown(self):
pass pass
def test_test_special_tags(self): def test_test_special_tags(self):
""" """Test case for test_special_tags
Test case for test_special_tags
To test special tags To test special tags # noqa: E501
""" """
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.api_response import ApiResponse # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.api_response import ApiResponse
class TestApiResponse(unittest.TestCase): class TestApiResponse(unittest.TestCase):
""" ApiResponse unit test stubs """ """ApiResponse unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestApiResponse(unittest.TestCase):
pass pass
def testApiResponse(self): def testApiResponse(self):
""" """Test ApiResponse"""
Test ApiResponse
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.api_response.ApiResponse() # model = petstore_api.models.api_response.ApiResponse() # noqa: E501
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
class TestArrayOfArrayOfNumberOnly(unittest.TestCase): class TestArrayOfArrayOfNumberOnly(unittest.TestCase):
""" ArrayOfArrayOfNumberOnly unit test stubs """ """ArrayOfArrayOfNumberOnly unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestArrayOfArrayOfNumberOnly(unittest.TestCase):
pass pass
def testArrayOfArrayOfNumberOnly(self): def testArrayOfArrayOfNumberOnly(self):
""" """Test ArrayOfArrayOfNumberOnly"""
Test ArrayOfArrayOfNumberOnly
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # noqa: E501
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
class TestArrayOfNumberOnly(unittest.TestCase): class TestArrayOfNumberOnly(unittest.TestCase):
""" ArrayOfNumberOnly unit test stubs """ """ArrayOfNumberOnly unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestArrayOfNumberOnly(unittest.TestCase):
pass pass
def testArrayOfNumberOnly(self): def testArrayOfNumberOnly(self):
""" """Test ArrayOfNumberOnly"""
Test ArrayOfNumberOnly
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() # model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() # noqa: E501
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.array_test import ArrayTest # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.array_test import ArrayTest
class TestArrayTest(unittest.TestCase): class TestArrayTest(unittest.TestCase):
""" ArrayTest unit test stubs """ """ArrayTest unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestArrayTest(unittest.TestCase):
pass pass
def testArrayTest(self): def testArrayTest(self):
""" """Test ArrayTest"""
Test ArrayTest
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.array_test.ArrayTest() # model = petstore_api.models.array_test.ArrayTest() # noqa: E501
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.capitalization import Capitalization # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.capitalization import Capitalization
class TestCapitalization(unittest.TestCase): class TestCapitalization(unittest.TestCase):
""" Capitalization unit test stubs """ """Capitalization unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestCapitalization(unittest.TestCase):
pass pass
def testCapitalization(self): def testCapitalization(self):
""" """Test Capitalization"""
Test Capitalization
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.capitalization.Capitalization() # model = petstore_api.models.capitalization.Capitalization() # noqa: E501
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.cat import Cat # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.cat import Cat
class TestCat(unittest.TestCase): class TestCat(unittest.TestCase):
""" Cat unit test stubs """ """Cat unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestCat(unittest.TestCase):
pass pass
def testCat(self): def testCat(self):
""" """Test Cat"""
Test Cat
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.cat.Cat() # model = petstore_api.models.cat.Cat() # noqa: E501
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.category import Category # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.category import Category
class TestCategory(unittest.TestCase): class TestCategory(unittest.TestCase):
""" Category unit test stubs """ """Category unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestCategory(unittest.TestCase):
pass pass
def testCategory(self): def testCategory(self):
""" """Test Category"""
Test Category
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.category.Category() # model = petstore_api.models.category.Category() # noqa: E501
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.class_model import ClassModel # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.class_model import ClassModel
class TestClassModel(unittest.TestCase): class TestClassModel(unittest.TestCase):
""" ClassModel unit test stubs """ """ClassModel unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestClassModel(unittest.TestCase):
pass pass
def testClassModel(self): def testClassModel(self):
""" """Test ClassModel"""
Test ClassModel
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.class_model.ClassModel() # model = petstore_api.models.class_model.ClassModel() # noqa: E501
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.client import Client # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.client import Client
class TestClient(unittest.TestCase): class TestClient(unittest.TestCase):
""" Client unit test stubs """ """Client unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestClient(unittest.TestCase):
pass pass
def testClient(self): def testClient(self):
""" """Test Client"""
Test Client
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.client.Client() # model = petstore_api.models.client.Client() # noqa: E501
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.dog import Dog # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.dog import Dog
class TestDog(unittest.TestCase): class TestDog(unittest.TestCase):
""" Dog unit test stubs """ """Dog unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestDog(unittest.TestCase):
pass pass
def testDog(self): def testDog(self):
""" """Test Dog"""
Test Dog
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.dog.Dog() # model = petstore_api.models.dog.Dog() # noqa: E501
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.enum_arrays import EnumArrays # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.enum_arrays import EnumArrays
class TestEnumArrays(unittest.TestCase): class TestEnumArrays(unittest.TestCase):
""" EnumArrays unit test stubs """ """EnumArrays unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestEnumArrays(unittest.TestCase):
pass pass
def testEnumArrays(self): def testEnumArrays(self):
""" """Test EnumArrays"""
Test EnumArrays
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.enum_arrays.EnumArrays() # model = petstore_api.models.enum_arrays.EnumArrays() # noqa: E501
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.enum_class import EnumClass # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.enum_class import EnumClass
class TestEnumClass(unittest.TestCase): class TestEnumClass(unittest.TestCase):
""" EnumClass unit test stubs """ """EnumClass unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestEnumClass(unittest.TestCase):
pass pass
def testEnumClass(self): def testEnumClass(self):
""" """Test EnumClass"""
Test EnumClass
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.enum_class.EnumClass() # model = petstore_api.models.enum_class.EnumClass() # noqa: E501
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.enum_test import EnumTest # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.enum_test import EnumTest
class TestEnumTest(unittest.TestCase): class TestEnumTest(unittest.TestCase):
""" EnumTest unit test stubs """ """EnumTest unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestEnumTest(unittest.TestCase):
pass pass
def testEnumTest(self): def testEnumTest(self):
""" """Test EnumTest"""
Test EnumTest
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.enum_test.EnumTest() # model = petstore_api.models.enum_test.EnumTest() # noqa: E501
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,85 +13,78 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.api.fake_api import FakeApi # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.apis.fake_api import FakeApi
class TestFakeApi(unittest.TestCase): class TestFakeApi(unittest.TestCase):
""" FakeApi unit test stubs """ """FakeApi unit test stubs"""
def setUp(self): def setUp(self):
self.api = petstore_api.apis.fake_api.FakeApi() self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501
def tearDown(self): def tearDown(self):
pass pass
def test_fake_outer_boolean_serialize(self): def test_fake_outer_boolean_serialize(self):
""" """Test case for fake_outer_boolean_serialize
Test case for fake_outer_boolean_serialize
""" """
pass pass
def test_fake_outer_composite_serialize(self): def test_fake_outer_composite_serialize(self):
""" """Test case for fake_outer_composite_serialize
Test case for fake_outer_composite_serialize
""" """
pass pass
def test_fake_outer_number_serialize(self): def test_fake_outer_number_serialize(self):
""" """Test case for fake_outer_number_serialize
Test case for fake_outer_number_serialize
""" """
pass pass
def test_fake_outer_string_serialize(self): def test_fake_outer_string_serialize(self):
""" """Test case for fake_outer_string_serialize
Test case for fake_outer_string_serialize
""" """
pass pass
def test_test_client_model(self): def test_test_client_model(self):
""" """Test case for test_client_model
Test case for test_client_model
To test \"client\" model To test \"client\" model # noqa: E501
""" """
pass pass
def test_test_endpoint_parameters(self): def test_test_endpoint_parameters(self):
""" """Test case for test_endpoint_parameters
Test case for test_endpoint_parameters
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
""" """
pass pass
def test_test_enum_parameters(self): def test_test_enum_parameters(self):
""" """Test case for test_enum_parameters
Test case for test_enum_parameters
To test enum parameters To test enum parameters # noqa: E501
"""
pass
def test_test_inline_additional_properties(self):
"""Test case for test_inline_additional_properties
test inline additionalProperties # noqa: E501
""" """
pass pass
def test_test_json_form_data(self): def test_test_json_form_data(self):
""" """Test case for test_json_form_data
Test case for test_json_form_data
test json serialization of form data test json serialization of form data # noqa: E501
""" """
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,29 +13,26 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.apis.fake_classname_tags_123_api import FakeClassnameTags123Api
class TestFakeClassnameTags123Api(unittest.TestCase): class TestFakeClassnameTags123Api(unittest.TestCase):
""" FakeClassnameTags123Api unit test stubs """ """FakeClassnameTags123Api unit test stubs"""
def setUp(self): def setUp(self):
self.api = petstore_api.apis.fake_classname_tags_123_api.FakeClassnameTags123Api() self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501
def tearDown(self): def tearDown(self):
pass pass
def test_test_classname(self): def test_test_classname(self):
""" """Test case for test_classname
Test case for test_classname
To test class name in snake case To test class name in snake case # noqa: E501
""" """
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.format_test import FormatTest # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.format_test import FormatTest
class TestFormatTest(unittest.TestCase): class TestFormatTest(unittest.TestCase):
""" FormatTest unit test stubs """ """FormatTest unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestFormatTest(unittest.TestCase):
pass pass
def testFormatTest(self): def testFormatTest(self):
""" """Test FormatTest"""
Test FormatTest
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.format_test.FormatTest() # model = petstore_api.models.format_test.FormatTest() # noqa: E501
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.has_only_read_only import HasOnlyReadOnly
class TestHasOnlyReadOnly(unittest.TestCase): class TestHasOnlyReadOnly(unittest.TestCase):
""" HasOnlyReadOnly unit test stubs """ """HasOnlyReadOnly unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestHasOnlyReadOnly(unittest.TestCase):
pass pass
def testHasOnlyReadOnly(self): def testHasOnlyReadOnly(self):
""" """Test HasOnlyReadOnly"""
Test HasOnlyReadOnly
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() # model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() # noqa: E501
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.list import List # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.list import List
class TestList(unittest.TestCase): class TestList(unittest.TestCase):
""" List unit test stubs """ """List unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestList(unittest.TestCase):
pass pass
def testList(self): def testList(self):
""" """Test List"""
Test List
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.list.List() # model = petstore_api.models.list.List() # noqa: E501
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.map_test import MapTest # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.map_test import MapTest
class TestMapTest(unittest.TestCase): class TestMapTest(unittest.TestCase):
""" MapTest unit test stubs """ """MapTest unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestMapTest(unittest.TestCase):
pass pass
def testMapTest(self): def testMapTest(self):
""" """Test MapTest"""
Test MapTest
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.map_test.MapTest() # model = petstore_api.models.map_test.MapTest() # noqa: E501
pass pass

View File

@ -3,7 +3,7 @@
""" """
Swagger Petstore Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0 OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io Contact: apiteam@swagger.io
@ -13,17 +13,15 @@
from __future__ import absolute_import from __future__ import absolute_import
import os
import sys
import unittest import unittest
import petstore_api import petstore_api
from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase):
""" MixedPropertiesAndAdditionalPropertiesClass unit test stubs """ """MixedPropertiesAndAdditionalPropertiesClass unit test stubs"""
def setUp(self): def setUp(self):
pass pass
@ -32,11 +30,9 @@ class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase):
pass pass
def testMixedPropertiesAndAdditionalPropertiesClass(self): def testMixedPropertiesAndAdditionalPropertiesClass(self):
""" """Test MixedPropertiesAndAdditionalPropertiesClass"""
Test MixedPropertiesAndAdditionalPropertiesClass
"""
# FIXME: construct object with mandatory attributes with example values # FIXME: construct object with mandatory attributes with example values
#model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501
pass pass

Some files were not shown because too many files have changed in this diff Show More