diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java index 9a60d1a48b4..0954957f19f 100755 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java @@ -67,6 +67,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig languageSpecificPrimitives.add("int"); languageSpecificPrimitives.add("float"); languageSpecificPrimitives.add("list"); + languageSpecificPrimitives.add("dict"); languageSpecificPrimitives.add("bool"); languageSpecificPrimitives.add("str"); languageSpecificPrimitives.add("datetime"); @@ -189,21 +190,16 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig 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("tox.mustache", "", "tox.ini")); supportingFiles.add(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt")); supportingFiles.add(new SupportingFile("requirements.mustache", "", "requirements.txt")); - supportingFiles.add(new SupportingFile("configuration.mustache", swaggerFolder, "configuration.py")); - supportingFiles.add(new SupportingFile("__init__package.mustache", swaggerFolder, "__init__.py")); - supportingFiles.add(new SupportingFile("__init__model.mustache", modelPackage, "__init__.py")); - supportingFiles.add(new SupportingFile("__init__api.mustache", apiPackage, "__init__.py")); + supportingFiles.add(new SupportingFile("configuration.mustache", packageName, "configuration.py")); + supportingFiles.add(new SupportingFile("__init__package.mustache", packageName, "__init__.py")); + supportingFiles.add(new SupportingFile("__init__model.mustache", packageName + File.separatorChar + modelPackage, "__init__.py")); + supportingFiles.add(new SupportingFile("__init__api.mustache", packageName + File.separatorChar + apiPackage, "__init__.py")); if(Boolean.FALSE.equals(excludeTests)) { 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("travis.mustache", "", ".travis.yml")); 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())) { - supportingFiles.add(new SupportingFile("asyncio/rest.mustache", swaggerFolder, "rest.py")); + supportingFiles.add(new SupportingFile("asyncio/rest.mustache", packageName, "rest.py")); additionalProperties.put("asyncio", "true"); } 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"); } 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) { 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 public Map postProcessModels(Map objs) { // process enum in models diff --git a/modules/swagger-codegen/src/main/resources/flaskConnexion/model.mustache b/modules/swagger-codegen/src/main/resources/flaskConnexion/model.mustache index 44bb954db2f..ba289ef4f8c 100644 --- a/modules/swagger-codegen/src/main/resources/flaskConnexion/model.mustache +++ b/modules/swagger-codegen/src/main/resources/flaskConnexion/model.mustache @@ -6,7 +6,7 @@ from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from {{modelPackage}}.base_model_ import Model -{{#imports}}{{import}} # noqa: E501 +{{#imports}}{{import}} # noqa: F401,E501 {{/imports}} from {{packageName}} import util @@ -94,7 +94,7 @@ class {{classname}}(Model): if not set({{{name}}}).issubset(set(allowed_values)): raise ValueError( "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))) ) {{/isListContainer}} @@ -102,7 +102,7 @@ class {{classname}}(Model): if not set({{{name}}}.keys()).issubset(set(allowed_values)): raise ValueError( "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))) ) {{/isMapContainer}} diff --git a/modules/swagger-codegen/src/main/resources/python/__init__api.mustache b/modules/swagger-codegen/src/main/resources/python/__init__api.mustache index 989a5ea8382..db658a10fa8 100644 --- a/modules/swagger-codegen/src/main/resources/python/__init__api.mustache +++ b/modules/swagger-codegen/src/main/resources/python/__init__api.mustache @@ -1,8 +1,7 @@ from __future__ import absolute_import +# flake8: noqa + # import apis into api package -{{#apiInfo}} -{{#apis}} -from .{{classVarName}} import {{classname}} -{{/apis}} -{{/apiInfo}} +{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classVarName}} import {{classname}} +{{/apis}}{{/apiInfo}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/python/__init__model.mustache b/modules/swagger-codegen/src/main/resources/python/__init__model.mustache index 1a9eaf62794..2266b3d17f4 100644 --- a/modules/swagger-codegen/src/main/resources/python/__init__model.mustache +++ b/modules/swagger-codegen/src/main/resources/python/__init__model.mustache @@ -1,9 +1,10 @@ # coding: utf-8 +# flake8: noqa {{>partial_header}} from __future__ import absolute_import # import models into model package -{{#models}}{{#model}}from .{{classFilename}} import {{classname}}{{/model}} +{{#models}}{{#model}}from {{modelPackage}}.{{classFilename}} import {{classname}}{{/model}} {{/models}} diff --git a/modules/swagger-codegen/src/main/resources/python/__init__package.mustache b/modules/swagger-codegen/src/main/resources/python/__init__package.mustache index 2289de872ef..cd42506f540 100644 --- a/modules/swagger-codegen/src/main/resources/python/__init__package.mustache +++ b/modules/swagger-codegen/src/main/resources/python/__init__package.mustache @@ -1,16 +1,17 @@ # coding: utf-8 +# flake8: noqa + {{>partial_header}} from __future__ import absolute_import -# import models into sdk package -{{#models}}{{#model}}from .models.{{classFilename}} import {{classname}} -{{/model}}{{/models}} # import apis into sdk package -{{#apiInfo}}{{#apis}}from .apis.{{classVarName}} import {{classname}} +{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classVarName}} import {{classname}} {{/apis}}{{/apiInfo}} # import ApiClient -from .api_client import ApiClient - -from .configuration import Configuration +from {{packageName}}.api_client import ApiClient +from {{packageName}}.configuration import Configuration +# import models into sdk package +{{#models}}{{#model}}from {{modelPackage}}.{{classFilename}} import {{classname}} +{{/model}}{{/models}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/python/api.mustache b/modules/swagger-codegen/src/main/resources/python/api.mustache index 354bb6fd66b..a65946f578d 100644 --- a/modules/swagger-codegen/src/main/resources/python/api.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api.mustache @@ -4,20 +4,18 @@ from __future__ import absolute_import -import sys -import os -import re +import re # noqa: F401 # 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}} 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. Ref: https://github.com/swagger-api/swagger-codegen """ @@ -28,13 +26,11 @@ class {{classname}}(object): self.api_client = api_client {{#operation}} - def {{operationId}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): - """ -{{#summary}} - {{{summary}}} -{{/summary}} + def {{operationId}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): # noqa: E501 + """{{#summary}}{{.}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 + {{#notes}} - {{{notes}}} + {{{notes}}} # noqa: E501 {{/notes}} This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True @@ -56,18 +52,16 @@ class {{classname}}(object): """ kwargs['_return_http_data_only'] = True 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: - (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 - def {{operationId}}_with_http_info(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): - """ -{{#summary}} - {{{summary}}} -{{/summary}} + def {{operationId}}_with_http_info(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): # noqa: E501 + """{{#summary}}{{.}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 + {{#notes}} - {{{notes}}} + {{{notes}}} # noqa: E501 {{/notes}} This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True @@ -88,14 +82,14 @@ class {{classname}}(object): 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('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -106,44 +100,48 @@ class {{classname}}(object): {{#allParams}} {{#required}} # verify the required parameter '{{paramName}}' is set - if ('{{paramName}}' not in params) or (params['{{paramName}}'] is None): - raise ValueError("Missing the required parameter `{{paramName}}` when calling `{{operationId}}`") + if ('{{paramName}}' not in params or + params['{{paramName}}'] is None): + raise ValueError("Missing the required parameter `{{paramName}}` when calling `{{operationId}}`") # noqa: E501 {{/required}} {{/allParams}} {{#allParams}} {{#hasValidation}} {{#maxLength}} - if '{{paramName}}' in params and len(params['{{paramName}}']) > {{maxLength}}: - raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be less than or equal to `{{maxLength}}`") + if ('{{paramName}}' in params and + 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}} {{#minLength}} - if '{{paramName}}' in params and len(params['{{paramName}}']) < {{minLength}}: - raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be greater than or equal to `{{minLength}}`") + if ('{{paramName}}' in params and + 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}} {{#maximum}} - if '{{paramName}}' in params and params['{{paramName}}'] >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}: - raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/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}}`") # noqa: E501 {{/maximum}} {{#minimum}} - if '{{paramName}}' in params and params['{{paramName}}'] <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}: - raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/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}}`") # noqa: E501 {{/minimum}} {{#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}}): - raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must conform to the 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}}): # noqa: E501 + raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must conform to the pattern `{{{pattern}}}`") # noqa: E501 {{/pattern}} {{#maxItems}} - if '{{paramName}}' in params and 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}}`") + if ('{{paramName}}' in params and + 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}} {{#minItems}} - if '{{paramName}}' in params and 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}}`") + if ('{{paramName}}' in params and + 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}} {{/hasValidation}} {{#-last}} - {{/-last}} {{/allParams}} collection_formats = {} @@ -151,30 +149,30 @@ class {{classname}}(object): path_params = {} {{#pathParams}} if '{{paramName}}' in params: - path_params['{{baseName}}'] = params['{{paramName}}']{{#isListContainer}} - collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} + path_params['{{baseName}}'] = params['{{paramName}}']{{#isListContainer}} # noqa: E501 + collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501 {{/pathParams}} query_params = [] {{#queryParams}} if '{{paramName}}' in params: - query_params.append(('{{baseName}}', params['{{paramName}}'])){{#isListContainer}} - collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} + query_params.append(('{{baseName}}', params['{{paramName}}'])){{#isListContainer}} # noqa: E501 + collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501 {{/queryParams}} header_params = {} {{#headerParams}} if '{{paramName}}' in params: - header_params['{{baseName}}'] = params['{{paramName}}']{{#isListContainer}} - collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} + header_params['{{baseName}}'] = params['{{paramName}}']{{#isListContainer}} # noqa: E501 + collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501 {{/headerParams}} form_params = [] local_var_files = {} {{#formParams}} if '{{paramName}}' in params: - {{#notFile}}form_params.append(('{{baseName}}', params['{{paramName}}'])){{/notFile}}{{#isFile}}local_var_files['{{baseName}}'] = params['{{paramName}}']{{/isFile}}{{#isListContainer}} - collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/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}} # noqa: E501 {{/formParams}} body_params = None @@ -184,32 +182,33 @@ class {{classname}}(object): {{/bodyParam}} {{#hasProduces}} # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept([{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]) + header_params['Accept'] = self.api_client.select_header_accept( + [{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]) # noqa: E501 {{/hasProduces}} {{#hasConsumes}} # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type([{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + [{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]) # noqa: E501 {{/hasConsumes}} # 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}}', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type={{#returnType}}'{{returnType}}'{{/returnType}}{{^returnType}}None{{/returnType}}, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '{{{path}}}', '{{httpMethod}}', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type={{#returnType}}'{{returnType}}'{{/returnType}}{{^returnType}}None{{/returnType}}, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) {{/operation}} {{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/python/api_client.mustache b/modules/swagger-codegen/src/main/resources/python/api_client.mustache index 576ff74c146..733758e6f4c 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_client.mustache @@ -2,30 +2,28 @@ {{>partial_header}} from __future__ import absolute_import -import os -import re +import datetime import json import mimetypes +from multiprocessing.pool import ThreadPool +import os +import re import tempfile + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote {{#tornado}} import tornado.gen {{/tornado}} -from multiprocessing.pool import ThreadPool -from datetime import date, datetime - -# python 2 and python 3 compatibility library -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 +from {{packageName}}.configuration import Configuration +import {{modelPackage}} +from {{packageName}} import rest 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- server communication, and is invariant across implementations. Specifics of @@ -38,38 +36,39 @@ class ApiClient(object): :param configuration: .Configuration object for this client :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. - :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 """ - PRIMITIVE_TYPES = (float, bool, bytes, text_type) + integer_types + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types NATIVE_TYPES_MAPPING = { 'int': int, - 'long': int if PY3 else long, + 'long': int if six.PY3 else long, # noqa: F821 'float': float, 'str': str, 'bool': bool, - 'date': date, - 'datetime': datetime, + 'date': datetime.date, + 'datetime': datetime.datetime, '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: configuration = Configuration() self.configuration = configuration self.pool = ThreadPool() - self.rest_client = RESTClientObject(configuration) + self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} if header_name is not None: self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. self.user_agent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{packageVersion}}}/python{{/httpUserAgent}}' - + def __del__(self): self.pool.close() self.pool.join() @@ -89,12 +88,12 @@ class ApiClient(object): {{#tornado}} @tornado.gen.coroutine {{/tornado}} - {{#asyncio}}async {{/asyncio}}def __call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_type=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, _preload_content=True, - _request_timeout=None): + {{#asyncio}}async {{/asyncio}}def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): config = self.configuration @@ -116,7 +115,9 @@ class ApiClient(object): for k, v in path_params: # specified safe chars, encode everything 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 if query_params: @@ -142,14 +143,14 @@ class ApiClient(object): url = self.configuration.host + resource_path # perform request and return response - response_data = {{#asyncio}}await {{/asyncio}}{{#tornado}}yield {{/tornado}}self.request(method, url, - query_params=query_params, - headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + response_data = {{#asyncio}}await {{/asyncio}}{{#tornado}}yield {{/tornado}}self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) self.last_response = response_data +{{^tornado}} return_data = response_data if _preload_content: @@ -162,11 +163,12 @@ class ApiClient(object): if _return_http_data_only: return (return_data) 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): - """ - Builds a JSON POST object. + """Builds a JSON POST object. If obj is None, return None. If obj is str, int, long, float, bool, return directly. @@ -189,7 +191,7 @@ class ApiClient(object): elif isinstance(obj, tuple): return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) - elif isinstance(obj, (datetime, date)): + elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() if isinstance(obj, dict): @@ -201,15 +203,14 @@ class ApiClient(object): # Convert attribute name to json key in # model definition for request. 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} 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): - """ - Deserializes response into an object. + """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for @@ -231,8 +232,7 @@ class ApiClient(object): return self.__deserialize(data, response_type) 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 klass: class literal, or string of class name. @@ -251,21 +251,21 @@ class ApiClient(object): if klass.startswith('dict('): sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2) return {k: self.__deserialize(v, sub_kls) - for k, v in iteritems(data)} + for k, v in six.iteritems(data)} # convert str to class if klass in self.NATIVE_TYPES_MAPPING: klass = self.NATIVE_TYPES_MAPPING[klass] else: - klass = getattr(models, klass) + klass = getattr({{modelPackage}}, klass) if klass in self.PRIMITIVE_TYPES: return self.__deserialize_primitive(data, klass) elif klass == object: return self.__deserialize_object(data) - elif klass == date: + elif klass == datetime.date: return self.__deserialize_date(data) - elif klass == datetime: + elif klass == datetime.datetime: return self.__deserialize_datatime(data) else: return self.__deserialize_model(data, klass) @@ -274,10 +274,10 @@ class ApiClient(object): path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, response_type=None, auth_settings=None, async=None, - _return_http_data_only=None, collection_formats=None, _preload_content=True, - _request_timeout=None): - """ - Makes the HTTP request (synchronous) and return the deserialized data. + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + To make an async request, set the async parameter. :param resource_path: Path to method endpoint. @@ -294,13 +294,17 @@ class ApiClient(object): :param files dict: key -> filename, value -> filepath, for `multipart/form-data`. :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, header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without - reading/decoding response data. Default is True. - :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. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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: If async parameter is True, the request will be called asynchronously. @@ -313,22 +317,23 @@ class ApiClient(object): path_params, query_params, header_params, body, post_params, files, 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: - thread = self.pool.apply_async(self.__call_api, (resource_path, method, - path_params, query_params, + thread = self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, header_params, body, post_params, files, response_type, auth_settings, _return_http_data_only, - collection_formats, _preload_content, _request_timeout)) + collection_formats, + _preload_content, _request_timeout)) return thread def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, _request_timeout=None): - """ - Makes the HTTP request using RESTClient. - """ + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" if method == "GET": return self.rest_client.GET(url, query_params=query_params, @@ -387,8 +392,7 @@ class ApiClient(object): ) 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 dict collection_formats: Parameter collection formats @@ -397,7 +401,7 @@ class ApiClient(object): new_params = [] if collection_formats is None: 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: collection_format = collection_formats[k] if collection_format == 'multi': @@ -418,8 +422,7 @@ class ApiClient(object): return new_params def prepare_post_parameters(self, post_params=None, files=None): - """ - Builds form parameters. + """Builds form parameters. :param post_params: Normal form parameters. :param files: File parameters. @@ -431,7 +434,7 @@ class ApiClient(object): params = post_params if files: - for k, v in iteritems(files): + for k, v in six.iteritems(files): if not v: continue file_names = v if type(v) is list else [v] @@ -439,15 +442,15 @@ class ApiClient(object): with open(n, 'rb') as f: filename = os.path.basename(f.name) filedata = f.read() - mimetype = mimetypes.\ - guess_type(filename)[0] or 'application/octet-stream' - params.append(tuple([k, tuple([filename, filedata, mimetype])])) + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) return params 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. :return: Accept (e.g. application/json). @@ -463,8 +466,7 @@ class ApiClient(object): return ', '.join(accepts) 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. :return: Content-Type (e.g. application/json). @@ -480,8 +482,7 @@ class ApiClient(object): return content_types[0] 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 querys: Query parameters tuple list to be updated. @@ -505,7 +506,8 @@ class ApiClient(object): ) def __deserialize_file(self, response): - """ + """Deserializes body to file + Saves response body into a file in a temporary folder, using the filename from the `Content-Disposition` header if provided. @@ -518,9 +520,8 @@ class ApiClient(object): content_disposition = response.getheader("Content-Disposition") if content_disposition: - filename = re.\ - search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition).\ - group(1) + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) path = os.path.join(os.path.dirname(path), filename) with open(path, "w") as f: @@ -529,8 +530,7 @@ class ApiClient(object): return path def __deserialize_primitive(self, data, klass): - """ - Deserializes string to primitive type. + """Deserializes string to primitive type. :param data: str. :param klass: class literal. @@ -540,21 +540,19 @@ class ApiClient(object): try: return klass(data) except UnicodeEncodeError: - return unicode(data) + return unicode(data) # noqa: F821 except TypeError: return data def __deserialize_object(self, value): - """ - Return a original value. + """Return a original value. :return: object. """ return value def __deserialize_date(self, string): - """ - Deserializes string to date. + """Deserializes string to date. :param string: str. :return: date. @@ -565,14 +563,13 @@ class ApiClient(object): except ImportError: return string except ValueError: - raise ApiException( + raise rest.ApiException( 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): - """ - Deserializes string to datetime. + """Deserializes string to datetime. The string should be in iso8601 datetime format. @@ -585,32 +582,32 @@ class ApiClient(object): except ImportError: return string except ValueError: - raise ApiException( + raise rest.ApiException( status=0, reason=( - "Failed to parse `{0}` into a datetime object" + "Failed to parse `{0}` as datetime object" .format(string) ) ) def __deserialize_model(self, data, klass): - """ - Deserializes list or dict to model. + """Deserializes list or dict to model. :param data: dict, list. :param klass: class literal. :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 kwargs = {} if klass.swagger_types is not None: - for attr, attr_type in iteritems(klass.swagger_types): - if data is not None \ - and klass.attribute_map[attr] in data \ - and isinstance(data, (list, dict)): + for attr, attr_type in six.iteritems(klass.swagger_types): + if (data is not None and + klass.attribute_map[attr] in data and + isinstance(data, (list, dict))): value = data[klass.attribute_map[attr]] kwargs[attr] = self.__deserialize(value, attr_type) diff --git a/modules/swagger-codegen/src/main/resources/python/api_doc.mustache b/modules/swagger-codegen/src/main/resources/python/api_doc.mustache index a496f63bfd1..32c26d929d1 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_doc.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_doc.mustache @@ -17,7 +17,7 @@ Method | HTTP request | Description {{{notes}}}{{/notes}} -### Example +### Example ```python from __future__ import print_function import time @@ -51,7 +51,7 @@ api_instance = {{{packageName}}}.{{{classname}}}() {{/allParams}} {{/hasAuthMethods}} -try: +try: {{#summary}} # {{{.}}} {{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}} pprint(api_response){{/returnType}} diff --git a/modules/swagger-codegen/src/main/resources/python/api_test.mustache b/modules/swagger-codegen/src/main/resources/python/api_test.mustache index f0f07f7189e..90fafc15f33 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_test.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_test.mustache @@ -4,30 +4,29 @@ from __future__ import absolute_import -import os -import sys import unittest import {{packageName}} +from {{apiPackage}}.{{classVarName}} import {{classname}} # noqa: E501 from {{packageName}}.rest import ApiException -from {{packageName}}.apis.{{classVarName}} import {{classname}} class {{#operations}}Test{{classname}}(unittest.TestCase): - """ {{classname}} unit test stubs """ + """{{classname}} unit test stubs""" def setUp(self): - self.api = {{packageName}}.apis.{{classVarName}}.{{classname}}() + self.api = {{apiPackage}}.{{classVarName}}.{{classname}}() # noqa: E501 def tearDown(self): pass {{#operation}} def test_{{operationId}}(self): - """ - Test case for {{{operationId}}} + """Test case for {{{operationId}}} - {{{summary}}} +{{#summary}} + {{{summary}}} # noqa: E501 +{{/summary}} """ pass diff --git a/modules/swagger-codegen/src/main/resources/python/asyncio/rest.mustache b/modules/swagger-codegen/src/main/resources/python/asyncio/rest.mustache index e0247056944..986902f56d0 100644 --- a/modules/swagger-codegen/src/main/resources/python/asyncio/rest.mustache +++ b/modules/swagger-codegen/src/main/resources/python/asyncio/rest.mustache @@ -2,16 +2,15 @@ {{>partial_header}} -import aiohttp import io import json -import ssl -import certifi import logging import re +import ssl +import aiohttp +import certifi # python 2 and python 3 compatibility library -from six import PY3 from six.moves.urllib.parse import urlencode logger = logging.getLogger(__name__) @@ -26,22 +25,18 @@ class RESTResponse(io.IOBase): self.data = data def getheaders(self): - """ - Returns a CIMultiDictProxy of the response headers. - """ + """Returns a CIMultiDictProxy of the response headers.""" return self.aiohttp_response.headers def getheader(self, name, default=None): - """ - Returns a given response header. - """ + """Returns a given response header.""" return self.aiohttp_response.headers.get(name, default) -class RESTClientObject: +class RESTClientObject(object): 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 # http://stackoverflow.com/a/23957365/2985775 @@ -53,6 +48,7 @@ class RESTClientObject: ca_certs = certifi.where() ssl_context = ssl.SSLContext() + ssl_context.load_verify_locations(cafile=ca_certs) if configuration.cert_file: ssl_context.load_cert_chain( configuration.cert_file, keyfile=configuration.key_file @@ -60,6 +56,7 @@ class RESTClientObject: connector = aiohttp.TCPConnector( limit=maxsize, + ssl_context=ssl_context, verify_ssl=configuration.verify_ssl ) @@ -75,8 +72,10 @@ class RESTClientObject: ) 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 url: http request url :param query_params: query parameters in the url @@ -85,12 +84,16 @@ class RESTClientObject: :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: this is a non-applicable field for the AiohttpClient. - :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. + :param _preload_content: this is a non-applicable field for + the AiohttpClient. + :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() - 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: raise ValueError( @@ -118,7 +121,7 @@ class RESTClientObject: if body is not None: body = json.dumps(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() for k, v in post_params.items(): data.add_field(k, v) @@ -132,8 +135,9 @@ class RESTClientObject: args["data"] = body else: # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided arguments. - Please check that your arguments match declared content type.""" + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" raise ApiException(status=0, reason=msg) else: args["data"] = query_params @@ -150,22 +154,25 @@ class RESTClientObject: 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, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params)) + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + 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, headers=headers, _preload_content=_preload_content, _request_timeout=_request_timeout, query_params=query_params)) - async def OPTIONS(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + async def OPTIONS(self, url, headers=None, query_params=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): return (await self.request("OPTIONS", url, headers=headers, query_params=query_params, @@ -174,7 +181,8 @@ class RESTClientObject: _request_timeout=_request_timeout, 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, headers=headers, query_params=query_params, @@ -182,8 +190,9 @@ class RESTClientObject: _request_timeout=_request_timeout, body=body)) - async def POST(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + async def POST(self, url, headers=None, query_params=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): return (await self.request("POST", url, headers=headers, query_params=query_params, @@ -192,8 +201,8 @@ class RESTClientObject: _request_timeout=_request_timeout, body=body)) - async def PUT(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + async def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): return (await self.request("PUT", url, headers=headers, query_params=query_params, @@ -202,8 +211,9 @@ class RESTClientObject: _request_timeout=_request_timeout, body=body)) - async def PATCH(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + async def PATCH(self, url, headers=None, query_params=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): return (await self.request("PATCH", url, headers=headers, query_params=query_params, @@ -228,13 +238,11 @@ class ApiException(Exception): self.headers = None def __str__(self): - """ - Custom error messages for exception - """ - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) + """Custom error messages for exception""" + error_message = "({0})\nReason: {1}\n".format(self.status, self.reason) 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: error_message += "HTTP response body: {0}\n".format(self.body) diff --git a/modules/swagger-codegen/src/main/resources/python/configuration.mustache b/modules/swagger-codegen/src/main/resources/python/configuration.mustache index 076f7401b57..84e6ad4d208 100644 --- a/modules/swagger-codegen/src/main/resources/python/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/python/configuration.mustache @@ -4,24 +4,23 @@ from __future__ import absolute_import -import urllib3 - import copy import logging import multiprocessing import sys +import urllib3 -from six import iteritems -from six import with_metaclass +import six from six.moves import http_client as httplib + class TypeWithDefault(type): def __init__(cls, name, bases, dct): super(TypeWithDefault, cls).__init__(name, bases, dct) cls._default = None def __call__(cls): - if cls._default == None: + if cls._default is None: cls._default = type.__call__(cls) return copy.copy(cls._default) @@ -29,17 +28,15 @@ class TypeWithDefault(type): cls._default = copy.copy(default) -class Configuration(with_metaclass(TypeWithDefault, object)): - """ - NOTE: This class is auto generated by the swagger code generator program. +class Configuration(six.with_metaclass(TypeWithDefault, object)): + """NOTE: This class is auto generated by the swagger code generator program. + Ref: https://github.com/swagger-api/swagger-codegen Do not edit the class manually. """ def __init__(self): - """ - Constructor - """ + """Constructor""" # Default Base url self.host = "{{{basePath}}}" # Temp file folder for downloading files @@ -74,7 +71,8 @@ class Configuration(with_metaclass(TypeWithDefault, object)): self.debug = False # 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 # Set this to customize the certificate file to verify the peer. 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. self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - # Proxy URL self.proxy = None # Safe chars for path_param @@ -102,8 +99,8 @@ class Configuration(with_metaclass(TypeWithDefault, object)): def logger_file(self): """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. + 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 @@ -114,8 +111,8 @@ class Configuration(with_metaclass(TypeWithDefault, object)): def logger_file(self, value): """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. + 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 @@ -126,7 +123,7 @@ class Configuration(with_metaclass(TypeWithDefault, object)): # then add file handler and remove stream handler. self.logger_file_handler = logging.FileHandler(self.__logger_file) 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) if 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. self.logger_stream_handler = logging.StreamHandler() 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) if self.logger_file_handler: logger.removeHandler(self.logger_file_handler) @@ -159,14 +156,14 @@ class Configuration(with_metaclass(TypeWithDefault, object)): self.__debug = value if self.__debug: # 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) # turn on httplib debug httplib.HTTPConnection.debuglevel = 1 else: # if debug status is False, turn off debug logging, # setting log level to default `logging.WARNING` - for _, logger in iteritems(self.logger): + for _, logger in six.iteritems(self.logger): logger.setLevel(logging.WARNING) # turn off httplib debug httplib.HTTPConnection.debuglevel = 0 @@ -200,8 +197,9 @@ class Configuration(with_metaclass(TypeWithDefault, object)): :param identifier: The identifier of apiKey. :return: The token for api key authentication. """ - if self.api_key.get(identifier) and self.api_key_prefix.get(identifier): - return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] + if (self.api_key.get(identifier) and + self.api_key_prefix.get(identifier)): + return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 elif self.api_key.get(identifier): return self.api_key[identifier] @@ -210,8 +208,9 @@ class Configuration(with_metaclass(TypeWithDefault, object)): :return: The token for basic HTTP authentication. """ - return urllib3.util.make_headers(basic_auth=self.username + ':' + self.password)\ - .get('authorization') + return urllib3.util.make_headers( + basic_auth=self.username + ':' + self.password + ).get('authorization') def auth_settings(self): """Gets Auth Settings dict for api client. diff --git a/modules/swagger-codegen/src/main/resources/python/model.mustache b/modules/swagger-codegen/src/main/resources/python/model.mustache index 04b2dde376f..5668793b3f6 100644 --- a/modules/swagger-codegen/src/main/resources/python/model.mustache +++ b/modules/swagger-codegen/src/main/resources/python/model.mustache @@ -2,27 +2,31 @@ {{>partial_header}} +import pprint +import re # noqa: F401 + +import six +{{#imports}}{{#-first}} +{{/-first}} +{{import}} # noqa: F401,E501 +{{/imports}} + + {{#models}} {{#model}} -from pprint import pformat -from six import iteritems -import re - - class {{classname}}(object): - """ - NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - """ + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """{{#allowableValues}} -{{#allowableValues}} """ allowed enum values """ {{#enumVars}} - {{name}} = {{{value}}} -{{/enumVars}} -{{/allowableValues}} + {{name}} = {{{value}}}{{^-last}} +{{/-last}} +{{/enumVars}}{{/allowableValues}} """ Attributes: @@ -32,96 +36,96 @@ class {{classname}}(object): and the value is json key in definition. """ swagger_types = { - {{#vars}}'{{name}}': '{{{datatype}}}'{{#hasMore}}, - {{/hasMore}}{{/vars}} +{{#vars}} + '{{name}}': '{{{datatype}}}'{{#hasMore}},{{/hasMore}} +{{/vars}} } attribute_map = { - {{#vars}}'{{name}}': '{{baseName}}'{{#hasMore}}, - {{/hasMore}}{{/vars}} +{{#vars}} + '{{name}}': '{{baseName}}'{{#hasMore}},{{/hasMore}} +{{/vars}} } {{#discriminator}} 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}} } {{/discriminator}} - def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}): - """ - {{classname}} - a model defined in Swagger - """ - -{{#vars}} + def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}): # noqa: E501 + """{{classname}} - a model defined in Swagger""" # noqa: E501 +{{#vars}}{{#-first}} +{{/-first}} self._{{name}} = None {{/vars}} self.discriminator = {{#discriminator}}'{{discriminator}}'{{/discriminator}}{{^discriminator}}None{{/discriminator}} - -{{#vars}} +{{#vars}}{{#-first}} +{{/-first}} {{#required}} self.{{name}} = {{name}} {{/required}} {{^required}} if {{name}} is not None: - self.{{name}} = {{name}} + self.{{name}} = {{name}} {{/required}} {{/vars}} {{#vars}} @property def {{name}}(self): - """ - Gets the {{name}} of this {{classname}}. + """Gets the {{name}} of this {{classname}}. # noqa: E501 + {{#description}} - {{{description}}} + {{{description}}} # noqa: E501 {{/description}} - :return: The {{name}} of this {{classname}}. + :return: The {{name}} of this {{classname}}. # noqa: E501 :rtype: {{datatype}} """ return self._{{name}} @{{name}}.setter def {{name}}(self, {{name}}): - """ - Sets the {{name}} of this {{classname}}. + """Sets the {{name}} of this {{classname}}. + {{#description}} - {{{description}}} + {{{description}}} # noqa: E501 {{/description}} - :param {{name}}: The {{name}} of this {{classname}}. + :param {{name}}: The {{name}} of this {{classname}}. # noqa: E501 :type: {{datatype}} """ {{#required}} 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}} {{#isEnum}} {{#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}} if not set({{{name}}}).issubset(set(allowed_values)): raise ValueError( - "Invalid values for `{{{name}}}` [{0}], must be a subset of [{1}]" - .format(", ".join(map(str, set({{{name}}})-set(allowed_values))), + "Invalid values for `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set({{{name}}}) - set(allowed_values))), # noqa: E501 ", ".join(map(str, allowed_values))) ) {{/isListContainer}} {{#isMapContainer}} if not set({{{name}}}.keys()).issubset(set(allowed_values)): raise ValueError( - "Invalid keys in `{{{name}}}` [{0}], must be a subset of [{1}]" - .format(", ".join(map(str, set({{{name}}}.keys())-set(allowed_values))), + "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 ", ".join(map(str, allowed_values))) ) {{/isMapContainer}} {{/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: 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) ) {{/isContainer}} @@ -130,31 +134,31 @@ class {{classname}}(object): {{#hasValidation}} {{#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}} {{#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}} {{#maximum}} - if {{name}} is not None and {{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}: - raise ValueError("Invalid value for `{{name}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/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}}`") # noqa: E501 {{/maximum}} {{#minimum}} - if {{name}} is not None and {{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}: - raise ValueError("Invalid value for `{{name}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/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}}`") # noqa: E501 {{/minimum}} {{#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}}): - raise ValueError("Invalid value for `{{name}}`, must be a follow pattern or equal to `{{{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}}): # noqa: E501 + raise ValueError("Invalid value for `{{name}}`, must be a follow pattern or equal to `{{{pattern}}}`") # noqa: E501 {{/pattern}} {{#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}} {{#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}} {{/hasValidation}} {{/isEnum}} @@ -164,23 +168,16 @@ class {{classname}}(object): {{/vars}} {{#discriminator}} 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() - if self.discriminator_value_class_map.has_key(discriminator_value): - return self.discriminator_value_class_map[discriminator_value] - else: - return None + return self.discriminator_value_class_map.get(discriminator_value) {{/discriminator}} def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -201,30 +198,22 @@ class {{classname}}(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, {{classname}}): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other {{/model}} {{/models}} diff --git a/modules/swagger-codegen/src/main/resources/python/model_test.mustache b/modules/swagger-codegen/src/main/resources/python/model_test.mustache index 5f1b116b776..765e4f9c2c0 100644 --- a/modules/swagger-codegen/src/main/resources/python/model_test.mustache +++ b/modules/swagger-codegen/src/main/resources/python/model_test.mustache @@ -4,19 +4,17 @@ from __future__ import absolute_import -import os -import sys import unittest {{#models}} {{#model}} import {{packageName}} +from {{modelPackage}}.{{classFilename}} import {{classname}} # noqa: E501 from {{packageName}}.rest import ApiException -from {{packageName}}.models.{{classFilename}} import {{classname}} class Test{{classname}}(unittest.TestCase): - """ {{classname}} unit test stubs """ + """{{classname}} unit test stubs""" def setUp(self): pass @@ -25,11 +23,9 @@ class Test{{classname}}(unittest.TestCase): pass def test{{classname}}(self): - """ - Test {{classname}} - """ + """Test {{classname}}""" # FIXME: construct object with mandatory attributes with example values - #model = {{packageName}}.models.{{classFilename}}.{{classname}}() + # model = {{packageName}}.models.{{classFilename}}.{{classname}}() # noqa: E501 pass {{/model}} diff --git a/modules/swagger-codegen/src/main/resources/python/partial_header.mustache b/modules/swagger-codegen/src/main/resources/python/partial_header.mustache index b0c8ebed3ca..513ad04cdbd 100644 --- a/modules/swagger-codegen/src/main/resources/python/partial_header.mustache +++ b/modules/swagger-codegen/src/main/resources/python/partial_header.mustache @@ -4,7 +4,7 @@ {{/appName}} {{#appDescription}} - {{{appDescription}}} + {{{appDescription}}} # noqa: E501 {{/appDescription}} {{#version}}OpenAPI spec version: {{{version}}}{{/version}} diff --git a/modules/swagger-codegen/src/main/resources/python/rest.mustache b/modules/swagger-codegen/src/main/resources/python/rest.mustache index aa92c7eba73..ff9b019dc58 100644 --- a/modules/swagger-codegen/src/main/resources/python/rest.mustache +++ b/modules/swagger-codegen/src/main/resources/python/rest.mustache @@ -6,13 +6,13 @@ from __future__ import absolute_import import io import json -import ssl -import certifi import logging import re +import ssl +import certifi # python 2 and python 3 compatibility library -from six import PY3 +import six from six.moves.urllib.parse import urlencode try: @@ -33,15 +33,11 @@ class RESTResponse(io.IOBase): self.data = resp.data def getheaders(self): - """ - Returns a dictionary of the response headers. - """ + """Returns a dictionary of the response headers.""" return self.urllib3_response.getheaders() def getheader(self, name, default=None): - """ - Returns a given response header. - """ + """Returns a given response header.""" return self.urllib3_response.getheader(name, default) @@ -49,10 +45,10 @@ class RESTClientObject(object): def __init__(self, configuration, pools_size=4, maxsize=None): # 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/connectionpool.py#L680 - # maxsize is the number of requests to host that are allowed in parallel - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # 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 # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 # cert_reqs if configuration.verify_ssl: @@ -69,7 +65,7 @@ class RESTClientObject(object): addition_pool_args = {} 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 configuration.connection_pool_maxsize is not None: @@ -101,8 +97,10 @@ class RESTClientObject(object): ) 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 url: http request url :param query_params: query parameters in the url @@ -111,13 +109,17 @@ class RESTClientObject(object): :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without - reading/decoding response data. Default is True. - :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. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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() - 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: raise ValueError( @@ -129,10 +131,12 @@ class RESTClientObject(object): timeout = None 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) - elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2: - timeout = urllib3.Timeout(connect=_request_timeout[0], read=_request_timeout[1]) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) if 'Content-Type' not in headers: headers['Content-Type'] = 'application/json' @@ -146,42 +150,48 @@ class RESTClientObject(object): request_body = None if body is not None: request_body = json.dumps(body) - r = self.pool_manager.request(method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': - r = self.pool_manager.request(method, url, - fields=post_params, - encode_multipart=False, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct Content-Type - # which generated by urllib3 will be overwritten. + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. del headers['Content-Type'] - r = self.pool_manager.request(method, url, - fields=post_params, - encode_multipart=True, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is provided - # in serialized form + # other content types than Json when `body` argument is + # provided in serialized form elif isinstance(body, str): request_body = body - r = self.pool_manager.request(method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) else: # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided arguments. - Please check that your arguments match declared content type.""" + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: @@ -199,7 +209,7 @@ class RESTClientObject(object): # In the python 3, the response.data is bytes. # we need to decode it to string. - if PY3: + if six.PY3: r.data = r.data.decode('utf8') # log response body @@ -210,22 +220,24 @@ class RESTClientObject(object): 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, headers=headers, _preload_content=_preload_content, _request_timeout=_request_timeout, 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, headers=headers, _preload_content=_preload_content, _request_timeout=_request_timeout, query_params=query_params) - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): return self.request("OPTIONS", url, headers=headers, query_params=query_params, @@ -234,7 +246,8 @@ class RESTClientObject(object): _request_timeout=_request_timeout, 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, headers=headers, query_params=query_params, @@ -242,8 +255,8 @@ class RESTClientObject(object): _request_timeout=_request_timeout, body=body) - def POST(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): return self.request("POST", url, headers=headers, query_params=query_params, @@ -252,8 +265,8 @@ class RESTClientObject(object): _request_timeout=_request_timeout, body=body) - def PUT(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): return self.request("PUT", url, headers=headers, query_params=query_params, @@ -262,8 +275,8 @@ class RESTClientObject(object): _request_timeout=_request_timeout, body=body) - def PATCH(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): return self.request("PATCH", url, headers=headers, query_params=query_params, @@ -288,13 +301,12 @@ class ApiException(Exception): self.headers = None def __str__(self): - """ - Custom error messages for exception - """ + """Custom error messages for exception""" error_message = "({0})\n"\ "Reason: {1}\n".format(self.status, self.reason) 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: error_message += "HTTP response body: {0}\n".format(self.body) diff --git a/modules/swagger-codegen/src/main/resources/python/setup.mustache b/modules/swagger-codegen/src/main/resources/python/setup.mustache index 4fe9e64b889..e7107e9be94 100644 --- a/modules/swagger-codegen/src/main/resources/python/setup.mustache +++ b/modules/swagger-codegen/src/main/resources/python/setup.mustache @@ -2,8 +2,7 @@ {{>partial_header}} -import sys -from setuptools import setup, find_packages +from setuptools import setup, find_packages # noqa: H301 NAME = "{{{projectName}}}" VERSION = "{{packageVersion}}" @@ -36,7 +35,7 @@ setup( packages=find_packages(), include_package_data=True, long_description="""\ - {{appDescription}} + {{appDescription}} # noqa: E501 """ ) {{/hasMore}} diff --git a/modules/swagger-codegen/src/main/resources/python/tornado/rest.mustache b/modules/swagger-codegen/src/main/resources/python/tornado/rest.mustache index 709edee07f3..ef5fb834742 100644 --- a/modules/swagger-codegen/src/main/resources/python/tornado/rest.mustache +++ b/modules/swagger-codegen/src/main/resources/python/tornado/rest.mustache @@ -4,17 +4,16 @@ import io import json -import ssl -import certifi import logging import re +import ssl + +import certifi +# python 2 and python 3 compatibility library +from six.moves.urllib.parse import urlencode import tornado import tornado.gen -from tornado.httpclient import AsyncHTTPClient, HTTPRequest - -# python 2 and python 3 compatibility library -from six import PY3 -from six.moves.urllib.parse import urlencode +from tornado import httpclient from urllib3.filepost import encode_multipart_formdata logger = logging.getLogger(__name__) @@ -29,22 +28,18 @@ class RESTResponse(io.IOBase): self.data = data def getheaders(self): - """ - Returns a CIMultiDictProxy of the response headers. - """ + """Returns a CIMultiDictProxy of the response headers.""" return self.tornado_response.headers def getheader(self, name, default=None): - """ - Returns a given response header. - """ + """Returns a given response header.""" return self.tornado_response.headers.get(name, default) -class RESTClientObject: +class RESTClientObject(object): 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 # http://stackoverflow.com/a/23957365/2985775 @@ -55,9 +50,10 @@ class RESTClientObject: # if not set certificate file, use Mozilla's root certificates. 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: - ssl_context.load_cert_chain( + self.ssl_context.load_cert_chain( configuration.cert_file, keyfile=configuration.key_file ) @@ -68,12 +64,14 @@ class RESTClientObject: self.proxy_port = 80 self.proxy_host = configuration.proxy - self.pool_manager = AsyncHTTPClient() + self.pool_manager = httpclient.AsyncHTTPClient() @tornado.gen.coroutine - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, _request_timeout=None): - """ + def request(self, method, url, query_params=None, headers=None, body=None, + post_params=None, _preload_content=True, + _request_timeout=None): + """Execute Request + :param method: http request method :param url: http request url :param query_params: query parameters in the url @@ -82,19 +80,23 @@ class RESTClientObject: :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: this is a non-applicable field for the AiohttpClient. - :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. + :param _preload_content: this is a non-applicable field for + the AiohttpClient. + :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() - 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: raise ValueError( "body parameter cannot be used with post_params parameter." ) - request = HTTPRequest(url) + request = httpclient.HTTPRequest(url) request.ssl_context = self.ssl_context request.proxy_host = self.proxy_host request.proxy_port = self.proxy_port @@ -105,7 +107,6 @@ class RESTClientObject: request.headers['Content-Type'] = 'application/json' request.request_timeout = _request_timeout or 5 * 60 - post_params = post_params or {} if query_params: @@ -117,9 +118,8 @@ class RESTClientObject: if body: body = json.dumps(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) - # TODO: transform to multipart form elif headers['Content-Type'] == 'multipart/form-data': request.body = encode_multipart_formdata(post_params) # Pass a `bytes` parameter directly in the body to support @@ -129,8 +129,9 @@ class RESTClientObject: request.body = body else: # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided arguments. - Please check that your arguments match declared content type.""" + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" raise ApiException(status=0, reason=msg) r = yield self.pool_manager.fetch(request) @@ -142,40 +143,41 @@ class RESTClientObject: if not 200 <= r.status <= 299: raise ApiException(http_resp=r) - return r - @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, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) raise tornado.gen.Return(result) @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, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) raise tornado.gen.Return(result) @tornado.gen.coroutine - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): result = yield self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) raise tornado.gen.Return(result) @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, headers=headers, query_params=query_params, @@ -185,39 +187,39 @@ class RESTClientObject: raise tornado.gen.Return(result) @tornado.gen.coroutine - def POST(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): result = yield self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) raise tornado.gen.Return(result) @tornado.gen.coroutine - def PUT(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): result = yield self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) raise tornado.gen.Return(result) @tornado.gen.coroutine - def PATCH(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): result = yield self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) raise tornado.gen.Return(result) @@ -236,13 +238,12 @@ class ApiException(Exception): self.headers = None def __str__(self): - """ - Custom error messages for exception - """ - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) + """Custom error messages for exception""" + error_message = "({0})\nReason: {1}\n".format( + self.status, self.reason) 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: error_message += "HTTP response body: {0}\n".format(self.body) diff --git a/samples/client/petstore/python-asyncio/README.md b/samples/client/petstore/python-asyncio/README.md index 87f80990fc5..a49d99c556c 100644 --- a/samples/client/petstore/python-asyncio/README.md +++ b/samples/client/petstore/python-asyncio/README.md @@ -77,6 +77,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model *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_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 *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 diff --git a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesClass.md index ea12f270f02..796a789d4c4 100644 --- a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesClass.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **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) diff --git a/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md b/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md index b78fcf86f43..3d70f7a2875 100644 --- a/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md @@ -14,7 +14,7 @@ To test special tags To test special tags -### Example +### Example ```python from __future__ import print_function import time @@ -26,7 +26,7 @@ from pprint import pprint api_instance = petstore_api.AnotherFakeApi() body = petstore_api.Client() # Client | client model -try: +try: # To test special tags api_response = api_instance.test_special_tags(body) pprint(api_response) diff --git a/samples/client/petstore/python-asyncio/docs/FakeApi.md b/samples/client/petstore/python-asyncio/docs/FakeApi.md index eb669540e53..b910ba2b464 100644 --- a/samples/client/petstore/python-asyncio/docs/FakeApi.md +++ b/samples/client/petstore/python-asyncio/docs/FakeApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model [**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_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 @@ -21,7 +22,7 @@ Method | HTTP request | Description Test serialization of outer boolean types -### Example +### Example ```python from __future__ import print_function import time @@ -33,7 +34,7 @@ from pprint import pprint api_instance = petstore_api.FakeApi() body = petstore_api.OuterBoolean() # OuterBoolean | Input boolean as post body (optional) -try: +try: api_response = api_instance.fake_outer_boolean_serialize(body=body) pprint(api_response) except ApiException as e: @@ -68,7 +69,7 @@ No authorization required Test serialization of object with outer number type -### Example +### Example ```python from __future__ import print_function import time @@ -80,7 +81,7 @@ from pprint import pprint api_instance = petstore_api.FakeApi() body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) -try: +try: api_response = api_instance.fake_outer_composite_serialize(body=body) pprint(api_response) except ApiException as e: @@ -115,7 +116,7 @@ No authorization required Test serialization of outer number types -### Example +### Example ```python from __future__ import print_function import time @@ -127,7 +128,7 @@ from pprint import pprint api_instance = petstore_api.FakeApi() body = petstore_api.OuterNumber() # OuterNumber | Input number as post body (optional) -try: +try: api_response = api_instance.fake_outer_number_serialize(body=body) pprint(api_response) except ApiException as e: @@ -162,7 +163,7 @@ No authorization required Test serialization of outer string types -### Example +### Example ```python from __future__ import print_function import time @@ -174,7 +175,7 @@ from pprint import pprint api_instance = petstore_api.FakeApi() body = petstore_api.OuterString() # OuterString | Input string as post body (optional) -try: +try: api_response = api_instance.fake_outer_string_serialize(body=body) pprint(api_response) except ApiException as e: @@ -209,7 +210,7 @@ To test \"client\" model To test \"client\" model -### Example +### Example ```python from __future__ import print_function import time @@ -221,7 +222,7 @@ from pprint import pprint api_instance = petstore_api.FakeApi() body = petstore_api.Client() # Client | client model -try: +try: # To test \"client\" model api_response = api_instance.test_client_model(body) pprint(api_response) @@ -257,7 +258,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -### Example +### Example ```python from __future__ import print_function import time @@ -287,7 +288,7 @@ date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) password = 'password_example' # str | None (optional) param_callback = 'param_callback_example' # str | None (optional) -try: +try: # 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) except ApiException as e: @@ -335,7 +336,7 @@ To test enum parameters To test enum parameters -### Example +### Example ```python from __future__ import print_function 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_double = 1.2 # float | Query parameter enum test (double) (optional) -try: +try: # 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) 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) +# **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(param, param2) @@ -396,7 +444,7 @@ test json serialization of form data -### Example +### Example ```python from __future__ import print_function import time @@ -409,7 +457,7 @@ api_instance = petstore_api.FakeApi() param = 'param_example' # str | field1 param2 = 'param2_example' # str | field2 -try: +try: # test json serialization of form data api_instance.test_json_form_data(param, param2) except ApiException as e: diff --git a/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md index a103a4ee327..2546c09ca4a 100644 --- a/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md @@ -12,7 +12,7 @@ Method | HTTP request | Description To test class name in snake case -### Example +### Example ```python from __future__ import print_function import time @@ -30,7 +30,7 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY' api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration)) body = petstore_api.Client() # Client | client model -try: +try: # To test class name in snake case api_response = api_instance.test_classname(body) pprint(api_response) diff --git a/samples/client/petstore/python-asyncio/docs/MapTest.md b/samples/client/petstore/python-asyncio/docs/MapTest.md index 63cdab0374a..68844755d42 100644 --- a/samples/client/petstore/python-asyncio/docs/MapTest.md +++ b/samples/client/petstore/python-asyncio/docs/MapTest.md @@ -3,7 +3,7 @@ ## Properties 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] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-asyncio/docs/PetApi.md b/samples/client/petstore/python-asyncio/docs/PetApi.md index 74c6a5196fd..53b9158e699 100644 --- a/samples/client/petstore/python-asyncio/docs/PetApi.md +++ b/samples/client/petstore/python-asyncio/docs/PetApi.md @@ -21,7 +21,7 @@ Add a new pet to the store -### Example +### Example ```python from __future__ import print_function import time @@ -37,7 +37,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store -try: +try: # Add a new pet to the store api_instance.add_pet(body) except ApiException as e: @@ -72,7 +72,7 @@ Deletes a pet -### Example +### Example ```python from __future__ import print_function import time @@ -89,7 +89,7 @@ api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) pet_id = 789 # int | Pet id to delete api_key = 'api_key_example' # str | (optional) -try: +try: # Deletes a pet api_instance.delete_pet(pet_id, api_key=api_key) except ApiException as e: @@ -125,7 +125,7 @@ Finds Pets by status Multiple status values can be provided with comma separated strings -### Example +### Example ```python from __future__ import print_function import time @@ -141,7 +141,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) status = ['status_example'] # list[str] | Status values that need to be considered for filter -try: +try: # Finds Pets by status api_response = api_instance.find_pets_by_status(status) 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. -### Example +### Example ```python from __future__ import print_function import time @@ -193,7 +193,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) tags = ['tags_example'] # list[str] | Tags to filter by -try: +try: # Finds Pets by tags api_response = api_instance.find_pets_by_tags(tags) pprint(api_response) @@ -229,7 +229,7 @@ Find pet by ID Returns a single pet -### Example +### Example ```python from __future__ import print_function import time @@ -247,7 +247,7 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY' api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) pet_id = 789 # int | ID of pet to return -try: +try: # Find pet by ID api_response = api_instance.get_pet_by_id(pet_id) pprint(api_response) @@ -283,7 +283,7 @@ Update an existing pet -### Example +### Example ```python from __future__ import print_function import time @@ -299,7 +299,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store -try: +try: # Update an existing pet api_instance.update_pet(body) except ApiException as e: @@ -334,7 +334,7 @@ Updates a pet in the store with form data -### Example +### Example ```python from __future__ import print_function 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) status = 'status_example' # str | Updated status of the pet (optional) -try: +try: # Updates a pet in the store with form data api_instance.update_pet_with_form(pet_id, name=name, status=status) except ApiException as e: @@ -389,7 +389,7 @@ uploads an image -### Example +### Example ```python from __future__ import print_function 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) file = '/path/to/file.txt' # file | file to upload (optional) -try: +try: # uploads an image api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) pprint(api_response) diff --git a/samples/client/petstore/python-asyncio/docs/StoreApi.md b/samples/client/petstore/python-asyncio/docs/StoreApi.md index a75113975ef..6cbb6b45145 100644 --- a/samples/client/petstore/python-asyncio/docs/StoreApi.md +++ b/samples/client/petstore/python-asyncio/docs/StoreApi.md @@ -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 -### Example +### Example ```python from __future__ import print_function import time @@ -29,7 +29,7 @@ from pprint import pprint api_instance = petstore_api.StoreApi() order_id = 'order_id_example' # str | ID of the order that needs to be deleted -try: +try: # Delete purchase order by ID api_instance.delete_order(order_id) except ApiException as e: @@ -64,7 +64,7 @@ Returns pet inventories by status Returns a map of status codes to quantities -### Example +### Example ```python from __future__ import print_function import time @@ -81,7 +81,7 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration)) -try: +try: # Returns pet inventories by status api_response = api_instance.get_inventory() 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 -### Example +### Example ```python from __future__ import print_function import time @@ -126,7 +126,7 @@ from pprint import pprint api_instance = petstore_api.StoreApi() order_id = 789 # int | ID of pet that needs to be fetched -try: +try: # Find purchase order by ID api_response = api_instance.get_order_by_id(order_id) pprint(api_response) @@ -162,7 +162,7 @@ Place an order for a pet -### Example +### Example ```python from __future__ import print_function import time @@ -174,7 +174,7 @@ from pprint import pprint api_instance = petstore_api.StoreApi() body = petstore_api.Order() # Order | order placed for purchasing the pet -try: +try: # Place an order for a pet api_response = api_instance.place_order(body) pprint(api_response) diff --git a/samples/client/petstore/python-asyncio/docs/UserApi.md b/samples/client/petstore/python-asyncio/docs/UserApi.md index 5b73179dce3..969485595ae 100644 --- a/samples/client/petstore/python-asyncio/docs/UserApi.md +++ b/samples/client/petstore/python-asyncio/docs/UserApi.md @@ -21,7 +21,7 @@ Create user This can only be done by the logged in user. -### Example +### Example ```python from __future__ import print_function import time @@ -33,7 +33,7 @@ from pprint import pprint api_instance = petstore_api.UserApi() body = petstore_api.User() # User | Created user object -try: +try: # Create user api_instance.create_user(body) except ApiException as e: @@ -68,7 +68,7 @@ Creates list of users with given input array -### Example +### Example ```python from __future__ import print_function import time @@ -80,7 +80,7 @@ from pprint import pprint api_instance = petstore_api.UserApi() body = [petstore_api.User()] # list[User] | List of user object -try: +try: # Creates list of users with given input array api_instance.create_users_with_array_input(body) except ApiException as e: @@ -115,7 +115,7 @@ Creates list of users with given input array -### Example +### Example ```python from __future__ import print_function import time @@ -127,7 +127,7 @@ from pprint import pprint api_instance = petstore_api.UserApi() body = [petstore_api.User()] # list[User] | List of user object -try: +try: # Creates list of users with given input array api_instance.create_users_with_list_input(body) except ApiException as e: @@ -162,7 +162,7 @@ Delete user This can only be done by the logged in user. -### Example +### Example ```python from __future__ import print_function import time @@ -174,7 +174,7 @@ from pprint import pprint api_instance = petstore_api.UserApi() username = 'username_example' # str | The name that needs to be deleted -try: +try: # Delete user api_instance.delete_user(username) except ApiException as e: @@ -209,7 +209,7 @@ Get user by user name -### Example +### Example ```python from __future__ import print_function import time @@ -221,7 +221,7 @@ from pprint import pprint api_instance = petstore_api.UserApi() username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. -try: +try: # Get user by user name api_response = api_instance.get_user_by_name(username) pprint(api_response) @@ -257,7 +257,7 @@ Logs user into the system -### Example +### Example ```python from __future__ import print_function import time @@ -270,7 +270,7 @@ api_instance = petstore_api.UserApi() username = 'username_example' # str | The user name for login password = 'password_example' # str | The password for login in clear text -try: +try: # Logs user into the system api_response = api_instance.login_user(username, password) pprint(api_response) @@ -307,7 +307,7 @@ Logs out current logged in user session -### Example +### Example ```python from __future__ import print_function import time @@ -318,7 +318,7 @@ from pprint import pprint # create an instance of the API class api_instance = petstore_api.UserApi() -try: +try: # Logs out current logged in user session api_instance.logout_user() except ApiException as e: @@ -350,7 +350,7 @@ Updated user This can only be done by the logged in user. -### Example +### Example ```python from __future__ import print_function import time @@ -363,7 +363,7 @@ api_instance = petstore_api.UserApi() username = 'username_example' # str | name that need to be deleted body = petstore_api.User() # User | Updated user object -try: +try: # Updated user api_instance.update_user(username, body) except ApiException as e: diff --git a/samples/client/petstore/python-asyncio/petstore_api/__init__.py b/samples/client/petstore/python-asyncio/petstore_api/__init__.py index cad09e2691c..c368867dd11 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/__init__.py +++ b/samples/client/petstore/python-asyncio/petstore_api/__init__.py @@ -1,9 +1,11 @@ # coding: utf-8 +# flake8: noqa + """ 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 Contact: apiteam@swagger.io @@ -13,53 +15,51 @@ 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 -from .apis.another_fake_api import AnotherFakeApi -from .apis.fake_api import FakeApi -from .apis.fake_classname_tags_123_api import FakeClassnameTags123Api -from .apis.pet_api import PetApi -from .apis.store_api import StoreApi -from .apis.user_api import UserApi +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 # import ApiClient -from .api_client import ApiClient - -from .configuration import Configuration +from petstore_api.api_client import ApiClient +from petstore_api.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 diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/__init__.py b/samples/client/petstore/python-asyncio/petstore_api/api/__init__.py new file mode 100644 index 00000000000..74496adb5a2 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/api/__init__.py @@ -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 diff --git a/samples/client/petstore/python-tornado/petstore_api/apis/another_fake_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/another_fake_api.py similarity index 59% rename from samples/client/petstore/python-tornado/petstore_api/apis/another_fake_api.py rename to samples/client/petstore/python-asyncio/petstore_api/api/another_fake_api.py index 8fb991ff3df..0096dad1a37 100644 --- a/samples/client/petstore/python-tornado/petstore_api/apis/another_fake_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/another_fake_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,19 +13,17 @@ from __future__ import absolute_import -import sys -import os -import re +import re # noqa: F401 # 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): - """ - 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. Ref: https://github.com/swagger-api/swagger-codegen """ @@ -35,10 +33,10 @@ class AnotherFakeApi(object): api_client = ApiClient() self.api_client = api_client - def test_special_tags(self, body, **kwargs): - """ - To test special tags - To test special tags + def test_special_tags(self, body, **kwargs): # noqa: E501 + """To test special tags # noqa: E501 + + To test special tags # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_special_tags(body, async=True) @@ -52,15 +50,15 @@ class AnotherFakeApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.test_special_tags_with_http_info(body, **kwargs) + (data) = self.test_special_tags_with_http_info(body, **kwargs) # noqa: E501 return data - def test_special_tags_with_http_info(self, body, **kwargs): - """ - To test special tags - To test special tags + def test_special_tags_with_http_info(self, body, **kwargs): # noqa: E501 + """To test special tags # noqa: E501 + + To test special tags # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_special_tags_with_http_info(body, async=True) @@ -73,14 +71,14 @@ class AnotherFakeApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -89,9 +87,9 @@ class AnotherFakeApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `test_special_tags`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_special_tags`") # noqa: E501 collection_formats = {} @@ -108,27 +106,28 @@ class AnotherFakeApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/another-fake/dummy', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Client', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/another-fake/dummy', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python/petstore_api/apis/fake_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py similarity index 61% rename from samples/client/petstore/python/petstore_api/apis/fake_api.py rename to samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py index cadbc20004c..4c52ee51647 100644 --- a/samples/client/petstore/python/petstore_api/apis/fake_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,19 +13,17 @@ from __future__ import absolute_import -import sys -import os -import re +import re # noqa: F401 # 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 FakeApi(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. Ref: https://github.com/swagger-api/swagger-codegen """ @@ -35,9 +33,10 @@ class FakeApi(object): api_client = ApiClient() self.api_client = api_client - def fake_outer_boolean_serialize(self, **kwargs): - """ - Test serialization of outer boolean types + def fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 + """fake_outer_boolean_serialize # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_boolean_serialize(async=True) @@ -51,14 +50,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.fake_outer_boolean_serialize_with_http_info(**kwargs) + return self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.fake_outer_boolean_serialize_with_http_info(**kwargs) + (data) = self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501 return data - def fake_outer_boolean_serialize_with_http_info(self, **kwargs): - """ - Test serialization of outer boolean types + def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 + """fake_outer_boolean_serialize # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_boolean_serialize_with_http_info(async=True) @@ -71,14 +71,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -87,7 +87,6 @@ class FakeApi(object): params[key] = val del params['kwargs'] - collection_formats = {} path_params = {} @@ -103,26 +102,28 @@ class FakeApi(object): if 'body' in params: body_params = params['body'] # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake/outer/boolean', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='OuterBoolean', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake/outer/boolean', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterBoolean', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def fake_outer_composite_serialize(self, **kwargs): - """ - Test serialization of object with outer number type + def fake_outer_composite_serialize(self, **kwargs): # noqa: E501 + """fake_outer_composite_serialize # noqa: E501 + + Test serialization of object with outer number type # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_composite_serialize(async=True) @@ -136,14 +137,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.fake_outer_composite_serialize_with_http_info(**kwargs) + return self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.fake_outer_composite_serialize_with_http_info(**kwargs) + (data) = self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501 return data - def fake_outer_composite_serialize_with_http_info(self, **kwargs): - """ - Test serialization of object with outer number type + def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 + """fake_outer_composite_serialize # noqa: E501 + + Test serialization of object with outer number type # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_composite_serialize_with_http_info(async=True) @@ -156,14 +158,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -172,7 +174,6 @@ class FakeApi(object): params[key] = val del params['kwargs'] - collection_formats = {} path_params = {} @@ -188,26 +189,28 @@ class FakeApi(object): if 'body' in params: body_params = params['body'] # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake/outer/composite', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='OuterComposite', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake/outer/composite', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterComposite', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def fake_outer_number_serialize(self, **kwargs): - """ - Test serialization of outer number types + def fake_outer_number_serialize(self, **kwargs): # noqa: E501 + """fake_outer_number_serialize # noqa: E501 + + Test serialization of outer number types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_number_serialize(async=True) @@ -221,14 +224,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.fake_outer_number_serialize_with_http_info(**kwargs) + return self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.fake_outer_number_serialize_with_http_info(**kwargs) + (data) = self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501 return data - def fake_outer_number_serialize_with_http_info(self, **kwargs): - """ - Test serialization of outer number types + def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 + """fake_outer_number_serialize # noqa: E501 + + Test serialization of outer number types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_number_serialize_with_http_info(async=True) @@ -241,14 +245,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -257,7 +261,6 @@ class FakeApi(object): params[key] = val del params['kwargs'] - collection_formats = {} path_params = {} @@ -273,26 +276,28 @@ class FakeApi(object): if 'body' in params: body_params = params['body'] # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake/outer/number', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='OuterNumber', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake/outer/number', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterNumber', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def fake_outer_string_serialize(self, **kwargs): - """ - Test serialization of outer string types + def fake_outer_string_serialize(self, **kwargs): # noqa: E501 + """fake_outer_string_serialize # noqa: E501 + + Test serialization of outer string types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_string_serialize(async=True) @@ -306,14 +311,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.fake_outer_string_serialize_with_http_info(**kwargs) + return self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.fake_outer_string_serialize_with_http_info(**kwargs) + (data) = self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501 return data - def fake_outer_string_serialize_with_http_info(self, **kwargs): - """ - Test serialization of outer string types + def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 + """fake_outer_string_serialize # noqa: E501 + + Test serialization of outer string types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_string_serialize_with_http_info(async=True) @@ -326,14 +332,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -342,7 +348,6 @@ class FakeApi(object): params[key] = val del params['kwargs'] - collection_formats = {} path_params = {} @@ -358,27 +363,28 @@ class FakeApi(object): if 'body' in params: body_params = params['body'] # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake/outer/string', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='OuterString', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake/outer/string', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterString', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def test_client_model(self, body, **kwargs): - """ - To test \"client\" model - To test \"client\" model + def test_client_model(self, body, **kwargs): # noqa: E501 + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_client_model(body, async=True) @@ -392,15 +398,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.test_client_model_with_http_info(body, **kwargs) + return self.test_client_model_with_http_info(body, **kwargs) # noqa: E501 else: - (data) = self.test_client_model_with_http_info(body, **kwargs) + (data) = self.test_client_model_with_http_info(body, **kwargs) # noqa: E501 return data - def test_client_model_with_http_info(self, body, **kwargs): - """ - To test \"client\" model - To test \"client\" model + def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_client_model_with_http_info(body, async=True) @@ -413,14 +419,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -429,9 +435,9 @@ class FakeApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `test_client_model`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_client_model`") # noqa: E501 collection_formats = {} @@ -448,35 +454,36 @@ class FakeApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Client', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): - """ - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + def test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async=True) @@ -503,15 +510,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) + return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501 else: - (data) = self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) + (data) = self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501 return data - def test_endpoint_parameters_with_http_info(self, number, double, pattern_without_delimiter, byte, **kwargs): - """ - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + def test_endpoint_parameters_with_http_info(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async=True) @@ -537,14 +544,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['number', 'double', 'pattern_without_delimiter', 'byte', 'integer', 'int32', 'int64', 'float', 'string', 'binary', 'date', 'date_time', 'password', 'param_callback'] + all_params = ['number', 'double', 'pattern_without_delimiter', 'byte', 'integer', 'int32', 'int64', 'float', 'string', 'binary', 'date', 'date_time', 'password', 'param_callback'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -553,45 +560,50 @@ class FakeApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'number' is set - if ('number' not in params) or (params['number'] is None): - raise ValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") + if ('number' not in params or + params['number'] is None): + raise ValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'double' is set - if ('double' not in params) or (params['double'] is None): - raise ValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") + if ('double' not in params or + params['double'] is None): + raise ValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'pattern_without_delimiter' is set - if ('pattern_without_delimiter' not in params) or (params['pattern_without_delimiter'] is None): - raise ValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") + if ('pattern_without_delimiter' not in params or + params['pattern_without_delimiter'] is None): + raise ValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'byte' is set - if ('byte' not in params) or (params['byte'] is None): - raise ValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") - - if 'number' in params and params['number'] > 543.2: - raise ValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") - if 'number' in params and params['number'] < 32.1: - raise ValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") - if 'double' in params and params['double'] > 123.4: - raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") - if 'double' in params and params['double'] < 67.8: - raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") - if 'pattern_without_delimiter' in params and not re.search('^[A-Z].*', params['pattern_without_delimiter']): - raise ValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") - if 'integer' in params and params['integer'] > 100: - raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") - if 'integer' in params and params['integer'] < 10: - raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") - if 'int32' in params and params['int32'] > 200: - raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") - if 'int32' in params and params['int32'] < 20: - raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") - if 'float' in params and params['float'] > 987.6: - raise ValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") - if 'string' in params and not re.search('[a-z]', params['string'], flags=re.IGNORECASE): - raise ValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") - if 'password' in params and len(params['password']) > 64: - raise ValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") - if 'password' in params and len(params['password']) < 10: - raise ValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") + if ('byte' not in params or + params['byte'] is None): + raise ValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501 + if 'number' in params and params['number'] > 543.2: # noqa: E501 + raise ValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") # noqa: E501 + if 'number' in params and params['number'] < 32.1: # noqa: E501 + raise ValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") # noqa: E501 + if 'double' in params and params['double'] > 123.4: # noqa: E501 + raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") # noqa: E501 + if 'double' in params and params['double'] < 67.8: # noqa: E501 + raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") # noqa: E501 + if 'pattern_without_delimiter' in params and not re.search('^[A-Z].*', params['pattern_without_delimiter']): # noqa: E501 + raise ValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") # noqa: E501 + if 'integer' in params and params['integer'] > 100: # noqa: E501 + raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") # noqa: E501 + if 'integer' in params and params['integer'] < 10: # noqa: E501 + raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") # noqa: E501 + if 'int32' in params and params['int32'] > 200: # noqa: E501 + raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") # noqa: E501 + if 'int32' in params and params['int32'] < 20: # noqa: E501 + raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") # noqa: E501 + if 'float' in params and params['float'] > 987.6: # noqa: E501 + raise ValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501 + if 'string' in params and not re.search('[a-z]', params['string'], flags=re.IGNORECASE): # noqa: E501 + raise ValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") # noqa: E501 + if ('password' in params and + len(params['password']) > 64): + raise ValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") # noqa: E501 + if ('password' in params and + len(params['password']) < 10): + raise ValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") # noqa: E501 collection_formats = {} path_params = {} @@ -603,65 +615,66 @@ class FakeApi(object): form_params = [] local_var_files = {} if 'integer' in params: - form_params.append(('integer', params['integer'])) + form_params.append(('integer', params['integer'])) # noqa: E501 if 'int32' in params: - form_params.append(('int32', params['int32'])) + form_params.append(('int32', params['int32'])) # noqa: E501 if 'int64' in params: - form_params.append(('int64', params['int64'])) + form_params.append(('int64', params['int64'])) # noqa: E501 if 'number' in params: - form_params.append(('number', params['number'])) + form_params.append(('number', params['number'])) # noqa: E501 if 'float' in params: - form_params.append(('float', params['float'])) + form_params.append(('float', params['float'])) # noqa: E501 if 'double' in params: - form_params.append(('double', params['double'])) + form_params.append(('double', params['double'])) # noqa: E501 if 'string' in params: - form_params.append(('string', params['string'])) + form_params.append(('string', params['string'])) # noqa: E501 if 'pattern_without_delimiter' in params: - form_params.append(('pattern_without_delimiter', params['pattern_without_delimiter'])) + form_params.append(('pattern_without_delimiter', params['pattern_without_delimiter'])) # noqa: E501 if 'byte' in params: - form_params.append(('byte', params['byte'])) + form_params.append(('byte', params['byte'])) # noqa: E501 if 'binary' in params: - form_params.append(('binary', params['binary'])) + form_params.append(('binary', params['binary'])) # noqa: E501 if 'date' in params: - form_params.append(('date', params['date'])) + form_params.append(('date', params['date'])) # noqa: E501 if 'date_time' in params: - form_params.append(('dateTime', params['date_time'])) + form_params.append(('dateTime', params['date_time'])) # noqa: E501 if 'password' in params: - form_params.append(('password', params['password'])) + form_params.append(('password', params['password'])) # noqa: E501 if 'param_callback' in params: - form_params.append(('callback', params['param_callback'])) + form_params.append(('callback', params['param_callback'])) # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml; charset=utf-8', 'application/json; charset=utf-8']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml; charset=utf-8', 'application/json; charset=utf-8']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/xml; charset=utf-8', 'application/json; charset=utf-8']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/xml; charset=utf-8', 'application/json; charset=utf-8']) # noqa: E501 # Authentication setting - auth_settings = ['http_basic_test'] + auth_settings = ['http_basic_test'] # noqa: E501 - return self.api_client.call_api('/fake', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def test_enum_parameters(self, **kwargs): - """ - To test enum parameters - To test enum parameters + def test_enum_parameters(self, **kwargs): # noqa: E501 + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_enum_parameters(async=True) @@ -682,15 +695,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.test_enum_parameters_with_http_info(**kwargs) + return self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.test_enum_parameters_with_http_info(**kwargs) + (data) = self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501 return data - def test_enum_parameters_with_http_info(self, **kwargs): - """ - To test enum parameters - To test enum parameters + def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_enum_parameters_with_http_info(async=True) @@ -710,14 +723,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['enum_form_string_array', 'enum_form_string', 'enum_header_string_array', 'enum_header_string', 'enum_query_string_array', 'enum_query_string', 'enum_query_integer', 'enum_query_double'] + all_params = ['enum_form_string_array', 'enum_form_string', 'enum_header_string_array', 'enum_header_string', 'enum_query_string_array', 'enum_query_string', 'enum_query_integer', 'enum_query_double'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -726,68 +739,68 @@ class FakeApi(object): params[key] = val del params['kwargs'] - collection_formats = {} path_params = {} query_params = [] if 'enum_query_string_array' in params: - query_params.append(('enum_query_string_array', params['enum_query_string_array'])) - collection_formats['enum_query_string_array'] = 'csv' + query_params.append(('enum_query_string_array', params['enum_query_string_array'])) # noqa: E501 + collection_formats['enum_query_string_array'] = 'csv' # noqa: E501 if 'enum_query_string' in params: - query_params.append(('enum_query_string', params['enum_query_string'])) + query_params.append(('enum_query_string', params['enum_query_string'])) # noqa: E501 if 'enum_query_integer' in params: - query_params.append(('enum_query_integer', params['enum_query_integer'])) + query_params.append(('enum_query_integer', params['enum_query_integer'])) # noqa: E501 header_params = {} if 'enum_header_string_array' in params: - header_params['enum_header_string_array'] = params['enum_header_string_array'] - collection_formats['enum_header_string_array'] = 'csv' + header_params['enum_header_string_array'] = params['enum_header_string_array'] # noqa: E501 + collection_formats['enum_header_string_array'] = 'csv' # noqa: E501 if 'enum_header_string' in params: - header_params['enum_header_string'] = params['enum_header_string'] + header_params['enum_header_string'] = params['enum_header_string'] # noqa: E501 form_params = [] local_var_files = {} if 'enum_form_string_array' in params: - form_params.append(('enum_form_string_array', params['enum_form_string_array'])) - collection_formats['enum_form_string_array'] = 'csv' + form_params.append(('enum_form_string_array', params['enum_form_string_array'])) # noqa: E501 + collection_formats['enum_form_string_array'] = 'csv' # noqa: E501 if 'enum_form_string' in params: - form_params.append(('enum_form_string', params['enum_form_string'])) + form_params.append(('enum_form_string', params['enum_form_string'])) # noqa: E501 if 'enum_query_double' in params: - form_params.append(('enum_query_double', params['enum_query_double'])) + form_params.append(('enum_query_double', params['enum_query_double'])) # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['*/*']) + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['*/*']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['*/*']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def test_inline_additional_properties(self, param, **kwargs): - """ - test inline additionalProperties - + def test_inline_additional_properties(self, param, **kwargs): # noqa: E501 + """test inline additionalProperties # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_inline_additional_properties(param, async=True) @@ -801,15 +814,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.test_inline_additional_properties_with_http_info(param, **kwargs) + return self.test_inline_additional_properties_with_http_info(param, **kwargs) # noqa: E501 else: - (data) = self.test_inline_additional_properties_with_http_info(param, **kwargs) + (data) = self.test_inline_additional_properties_with_http_info(param, **kwargs) # noqa: E501 return data - def test_inline_additional_properties_with_http_info(self, param, **kwargs): - """ - test inline additionalProperties - + def test_inline_additional_properties_with_http_info(self, param, **kwargs): # noqa: E501 + """test inline additionalProperties # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_inline_additional_properties_with_http_info(param, async=True) @@ -822,14 +835,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['param'] + all_params = ['param'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -838,9 +851,9 @@ class FakeApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'param' is set - if ('param' not in params) or (params['param'] is None): - raise ValueError("Missing the required parameter `param` when calling `test_inline_additional_properties`") - + if ('param' not in params or + params['param'] is None): + raise ValueError("Missing the required parameter `param` when calling `test_inline_additional_properties`") # noqa: E501 collection_formats = {} @@ -857,31 +870,32 @@ class FakeApi(object): if 'param' in params: body_params = params['param'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake/inline-additionalProperties', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake/inline-additionalProperties', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def test_json_form_data(self, param, param2, **kwargs): - """ - test json serialization of form data - + def test_json_form_data(self, param, param2, **kwargs): # noqa: E501 + """test json serialization of form data # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_json_form_data(param, param2, async=True) @@ -896,15 +910,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.test_json_form_data_with_http_info(param, param2, **kwargs) + return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501 else: - (data) = self.test_json_form_data_with_http_info(param, param2, **kwargs) + (data) = self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501 return data - def test_json_form_data_with_http_info(self, param, param2, **kwargs): - """ - test json serialization of form data - + def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: E501 + """test json serialization of form data # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_json_form_data_with_http_info(param, param2, async=True) @@ -918,14 +932,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['param', 'param2'] + all_params = ['param', 'param2'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -934,12 +948,13 @@ class FakeApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'param' is set - if ('param' not in params) or (params['param'] is None): - raise ValueError("Missing the required parameter `param` when calling `test_json_form_data`") + if ('param' not in params or + params['param'] is None): + raise ValueError("Missing the required parameter `param` when calling `test_json_form_data`") # noqa: E501 # verify the required parameter 'param2' is set - if ('param2' not in params) or (params['param2'] is None): - raise ValueError("Missing the required parameter `param2` when calling `test_json_form_data`") - + if ('param2' not in params or + params['param2'] is None): + raise ValueError("Missing the required parameter `param2` when calling `test_json_form_data`") # noqa: E501 collection_formats = {} @@ -952,29 +967,30 @@ class FakeApi(object): form_params = [] local_var_files = {} if 'param' in params: - form_params.append(('param', params['param'])) + form_params.append(('param', params['param'])) # noqa: E501 if 'param2' in params: - form_params.append(('param2', params['param2'])) + form_params.append(('param2', params['param2'])) # noqa: E501 body_params = None # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake/jsonFormData', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake/jsonFormData', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python/petstore_api/apis/fake_classname_tags_123_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags_123_api.py similarity index 60% rename from samples/client/petstore/python/petstore_api/apis/fake_classname_tags_123_api.py rename to samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags_123_api.py index da75ad3cccd..6b6606dc096 100644 --- a/samples/client/petstore/python/petstore_api/apis/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags_123_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,19 +13,17 @@ from __future__ import absolute_import -import sys -import os -import re +import re # noqa: F401 # 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): - """ - 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. Ref: https://github.com/swagger-api/swagger-codegen """ @@ -35,9 +33,9 @@ class FakeClassnameTags123Api(object): api_client = ApiClient() self.api_client = api_client - def test_classname(self, body, **kwargs): - """ - To test class name in snake case + def test_classname(self, body, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_classname(body, async=True) @@ -51,14 +49,14 @@ class FakeClassnameTags123Api(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.test_classname_with_http_info(body, **kwargs) + (data) = self.test_classname_with_http_info(body, **kwargs) # noqa: E501 return data - def test_classname_with_http_info(self, body, **kwargs): - """ - To test class name in snake case + def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_classname_with_http_info(body, async=True) @@ -71,14 +69,14 @@ class FakeClassnameTags123Api(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -87,9 +85,9 @@ class FakeClassnameTags123Api(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `test_classname`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501 collection_formats = {} @@ -106,27 +104,28 @@ class FakeClassnameTags123Api(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['api_key_query'] + auth_settings = ['api_key_query'] # noqa: E501 - return self.api_client.call_api('/fake_classname_test', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Client', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake_classname_test', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-asyncio/petstore_api/apis/pet_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py similarity index 57% rename from samples/client/petstore/python-asyncio/petstore_api/apis/pet_api.py rename to samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py index 51b6ce82540..ff1026f3fae 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/apis/pet_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,19 +13,17 @@ from __future__ import absolute_import -import sys -import os -import re +import re # noqa: F401 # 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): - """ - 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. Ref: https://github.com/swagger-api/swagger-codegen """ @@ -35,10 +33,10 @@ class PetApi(object): api_client = ApiClient() self.api_client = api_client - def add_pet(self, body, **kwargs): - """ - Add a new pet to the store - + def add_pet(self, body, **kwargs): # noqa: E501 + """Add a new pet to the store # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.add_pet(body, async=True) @@ -52,15 +50,15 @@ class PetApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.add_pet_with_http_info(body, **kwargs) + (data) = self.add_pet_with_http_info(body, **kwargs) # noqa: E501 return data - def add_pet_with_http_info(self, body, **kwargs): - """ - Add a new pet to the store - + def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 + """Add a new pet to the store # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.add_pet_with_http_info(body, async=True) @@ -73,14 +71,14 @@ class PetApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -89,9 +87,9 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `add_pet`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_pet`") # noqa: E501 collection_formats = {} @@ -108,35 +106,36 @@ class PetApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json', 'application/xml']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json', 'application/xml']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def delete_pet(self, pet_id, **kwargs): - """ - Deletes a pet - + def delete_pet(self, pet_id, **kwargs): # noqa: E501 + """Deletes a pet # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.delete_pet(pet_id, async=True) @@ -151,15 +150,15 @@ class PetApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.delete_pet_with_http_info(pet_id, **kwargs) + (data) = self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501 return data - def delete_pet_with_http_info(self, pet_id, **kwargs): - """ - Deletes a pet - + def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 + """Deletes a pet # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.delete_pet_with_http_info(pet_id, async=True) @@ -173,14 +172,14 @@ class PetApi(object): 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('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -189,52 +188,53 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in params) or (params['pet_id'] is None): - raise ValueError("Missing the required parameter `pet_id` when calling `delete_pet`") - + if ('pet_id' not in params or + params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501 collection_formats = {} path_params = {} if 'pet_id' in params: - path_params['petId'] = params['pet_id'] + path_params['petId'] = params['pet_id'] # noqa: E501 query_params = [] header_params = {} if 'api_key' in params: - header_params['api_key'] = params['api_key'] + header_params['api_key'] = params['api_key'] # noqa: E501 form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet/{petId}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet/{petId}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def find_pets_by_status(self, status, **kwargs): - """ - Finds Pets by status - Multiple status values can be provided with comma separated strings + def find_pets_by_status(self, status, **kwargs): # noqa: E501 + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.find_pets_by_status(status, async=True) @@ -248,15 +248,15 @@ class PetApi(object): """ kwargs['_return_http_data_only'] = True 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: - (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 - def find_pets_by_status_with_http_info(self, status, **kwargs): - """ - Finds Pets by status - Multiple status values can be provided with comma separated strings + def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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. """ - all_params = ['status'] + all_params = ['status'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -285,9 +285,9 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'status' is set - if ('status' not in params) or (params['status'] is None): - raise ValueError("Missing the required parameter `status` when calling `find_pets_by_status`") - + if ('status' not in params or + params['status'] is None): + raise ValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501 collection_formats = {} @@ -295,8 +295,8 @@ class PetApi(object): query_params = [] if 'status' in params: - query_params.append(('status', params['status'])) - collection_formats['status'] = 'csv' + query_params.append(('status', params['status'])) # noqa: E501 + collection_formats['status'] = 'csv' # noqa: E501 header_params = {} @@ -305,31 +305,32 @@ class PetApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet/findByStatus', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[Pet]', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet/findByStatus', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Pet]', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def find_pets_by_tags(self, tags, **kwargs): - """ - Finds Pets by tags - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + def find_pets_by_tags(self, tags, **kwargs): # noqa: E501 + """Finds Pets by tags # noqa: E501 + + 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 asynchronous HTTP request, please pass async=True >>> thread = api.find_pets_by_tags(tags, async=True) @@ -343,15 +344,15 @@ class PetApi(object): """ kwargs['_return_http_data_only'] = True 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: - (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 - def find_pets_by_tags_with_http_info(self, tags, **kwargs): - """ - Finds Pets by tags - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 + """Finds Pets by tags # noqa: E501 + + 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 asynchronous HTTP request, please pass 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. """ - all_params = ['tags'] + all_params = ['tags'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -380,9 +381,9 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'tags' is set - if ('tags' not in params) or (params['tags'] is None): - raise ValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") - + if ('tags' not in params or + params['tags'] is None): + raise ValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501 collection_formats = {} @@ -390,8 +391,8 @@ class PetApi(object): query_params = [] if 'tags' in params: - query_params.append(('tags', params['tags'])) - collection_formats['tags'] = 'csv' + query_params.append(('tags', params['tags'])) # noqa: E501 + collection_formats['tags'] = 'csv' # noqa: E501 header_params = {} @@ -400,31 +401,32 @@ class PetApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet/findByTags', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[Pet]', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet/findByTags', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Pet]', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def get_pet_by_id(self, pet_id, **kwargs): - """ - Find pet by ID - Returns a single pet + def get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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 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: - (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 - def get_pet_by_id_with_http_info(self, pet_id, **kwargs): - """ - Find pet by ID - Returns a single pet + def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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. """ - all_params = ['pet_id'] + all_params = ['pet_id'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -475,15 +477,15 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in params) or (params['pet_id'] is None): - raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") - + if ('pet_id' not in params or + params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501 collection_formats = {} path_params = {} if 'pet_id' in params: - path_params['petId'] = params['pet_id'] + path_params['petId'] = params['pet_id'] # noqa: E501 query_params = [] @@ -494,31 +496,32 @@ class PetApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = ['api_key'] + auth_settings = ['api_key'] # noqa: E501 - return self.api_client.call_api('/pet/{petId}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Pet', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet/{petId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Pet', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def update_pet(self, body, **kwargs): - """ - Update an existing pet - + def update_pet(self, body, **kwargs): # noqa: E501 + """Update an existing pet # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.update_pet(body, async=True) @@ -532,15 +535,15 @@ class PetApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.update_pet_with_http_info(body, **kwargs) + (data) = self.update_pet_with_http_info(body, **kwargs) # noqa: E501 return data - def update_pet_with_http_info(self, body, **kwargs): - """ - Update an existing pet - + def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 + """Update an existing pet # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.update_pet_with_http_info(body, async=True) @@ -553,14 +556,14 @@ class PetApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -569,9 +572,9 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_pet`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_pet`") # noqa: E501 collection_formats = {} @@ -588,35 +591,36 @@ class PetApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json', 'application/xml']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json', 'application/xml']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def update_pet_with_form(self, pet_id, **kwargs): - """ - Updates a pet in the store with form data - + def update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 + """Updates a pet in the store with form data # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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 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: - (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 - def update_pet_with_form_with_http_info(self, pet_id, **kwargs): - """ - Updates a pet in the store with form data - + 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 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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. """ - all_params = ['pet_id', 'name', 'status'] + all_params = ['pet_id', 'name', 'status'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -671,15 +675,15 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in params) or (params['pet_id'] is None): - raise ValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") - + if ('pet_id' not in params or + params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501 collection_formats = {} path_params = {} if 'pet_id' in params: - path_params['petId'] = params['pet_id'] + path_params['petId'] = params['pet_id'] # noqa: E501 query_params = [] @@ -688,41 +692,42 @@ class PetApi(object): form_params = [] local_var_files = {} if 'name' in params: - form_params.append(('name', params['name'])) + form_params.append(('name', params['name'])) # noqa: E501 if 'status' in params: - form_params.append(('status', params['status'])) + form_params.append(('status', params['status'])) # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/x-www-form-urlencoded']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/x-www-form-urlencoded']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet/{petId}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet/{petId}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def upload_file(self, pet_id, **kwargs): - """ - uploads an image - + def upload_file(self, pet_id, **kwargs): # noqa: E501 + """uploads an image # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.upload_file(pet_id, async=True) @@ -738,15 +743,15 @@ class PetApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.upload_file_with_http_info(pet_id, **kwargs) + (data) = self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501 return data - def upload_file_with_http_info(self, pet_id, **kwargs): - """ - uploads an image - + def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 + """uploads an image # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.upload_file_with_http_info(pet_id, async=True) @@ -761,14 +766,14 @@ class PetApi(object): 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('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -777,15 +782,15 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in params) or (params['pet_id'] is None): - raise ValueError("Missing the required parameter `pet_id` when calling `upload_file`") - + if ('pet_id' not in params or + params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501 collection_formats = {} path_params = {} if 'pet_id' in params: - path_params['petId'] = params['pet_id'] + path_params['petId'] = params['pet_id'] # noqa: E501 query_params = [] @@ -794,33 +799,34 @@ class PetApi(object): form_params = [] local_var_files = {} 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: - local_var_files['file'] = params['file'] + local_var_files['file'] = params['file'] # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['multipart/form-data']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['multipart/form-data']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet/{petId}/uploadImage', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ApiResponse', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet/{petId}/uploadImage', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ApiResponse', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-asyncio/petstore_api/apis/store_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py similarity index 57% rename from samples/client/petstore/python-asyncio/petstore_api/apis/store_api.py rename to samples/client/petstore/python-asyncio/petstore_api/api/store_api.py index e9d9599c363..ebb9a4eb27a 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/apis/store_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,19 +13,17 @@ from __future__ import absolute_import -import sys -import os -import re +import re # noqa: F401 # 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): - """ - 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. Ref: https://github.com/swagger-api/swagger-codegen """ @@ -35,10 +33,10 @@ class StoreApi(object): api_client = ApiClient() self.api_client = api_client - def delete_order(self, order_id, **kwargs): - """ - Delete purchase order by ID - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + def delete_order(self, order_id, **kwargs): # noqa: E501 + """Delete purchase order by ID # noqa: E501 + + 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 asynchronous HTTP request, please pass async=True >>> thread = api.delete_order(order_id, async=True) @@ -52,15 +50,15 @@ class StoreApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.delete_order_with_http_info(order_id, **kwargs) + (data) = self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501 return data - def delete_order_with_http_info(self, order_id, **kwargs): - """ - Delete purchase order by ID - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Delete purchase order by ID # noqa: E501 + + 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 asynchronous HTTP request, please pass async=True >>> thread = api.delete_order_with_http_info(order_id, async=True) @@ -73,14 +71,14 @@ class StoreApi(object): returns the request thread. """ - all_params = ['order_id'] + all_params = ['order_id'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -89,15 +87,15 @@ class StoreApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'order_id' is set - if ('order_id' not in params) or (params['order_id'] is None): - raise ValueError("Missing the required parameter `order_id` when calling `delete_order`") - + if ('order_id' not in params or + params['order_id'] is None): + raise ValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501 collection_formats = {} path_params = {} if 'order_id' in params: - path_params['order_id'] = params['order_id'] + path_params['order_id'] = params['order_id'] # noqa: E501 query_params = [] @@ -108,31 +106,32 @@ class StoreApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/store/order/{order_id}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/store/order/{order_id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def get_inventory(self, **kwargs): - """ - Returns pet inventories by status - Returns a map of status codes to quantities + def get_inventory(self, **kwargs): # noqa: E501 + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.get_inventory(async=True) @@ -145,15 +144,15 @@ class StoreApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_inventory_with_http_info(**kwargs) + return self.get_inventory_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.get_inventory_with_http_info(**kwargs) + (data) = self.get_inventory_with_http_info(**kwargs) # noqa: E501 return data - def get_inventory_with_http_info(self, **kwargs): - """ - Returns pet inventories by status - Returns a map of status codes to quantities + def get_inventory_with_http_info(self, **kwargs): # noqa: E501 + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.get_inventory_with_http_info(async=True) @@ -165,14 +164,14 @@ class StoreApi(object): returns the request thread. """ - all_params = [] + all_params = [] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -194,31 +193,32 @@ class StoreApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['api_key'] + auth_settings = ['api_key'] # noqa: E501 - return self.api_client.call_api('/store/inventory', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='dict(str, int)', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/store/inventory', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, int)', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def get_order_by_id(self, order_id, **kwargs): - """ - Find purchase order by ID - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + def get_order_by_id(self, order_id, **kwargs): # noqa: E501 + """Find purchase order by ID # noqa: E501 + + 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 asynchronous HTTP request, please pass 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 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: - (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 - def get_order_by_id_with_http_info(self, order_id, **kwargs): - """ - Find purchase order by ID - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Find purchase order by ID # noqa: E501 + + 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 asynchronous HTTP request, please pass 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. """ - all_params = ['order_id'] + all_params = ['order_id'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -269,19 +269,19 @@ class StoreApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'order_id' is set - if ('order_id' not in params) or (params['order_id'] is None): - raise ValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") - - 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' not in params or + 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: # 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 = {} path_params = {} if 'order_id' in params: - path_params['order_id'] = params['order_id'] + path_params['order_id'] = params['order_id'] # noqa: E501 query_params = [] @@ -292,31 +292,32 @@ class StoreApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/store/order/{order_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Order', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/store/order/{order_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Order', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def place_order(self, body, **kwargs): - """ - Place an order for a pet - + def place_order(self, body, **kwargs): # noqa: E501 + """Place an order for a pet # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.place_order(body, async=True) @@ -330,15 +331,15 @@ class StoreApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.place_order_with_http_info(body, **kwargs) + (data) = self.place_order_with_http_info(body, **kwargs) # noqa: E501 return data - def place_order_with_http_info(self, body, **kwargs): - """ - Place an order for a pet - + def place_order_with_http_info(self, body, **kwargs): # noqa: E501 + """Place an order for a pet # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.place_order_with_http_info(body, async=True) @@ -351,14 +352,14 @@ class StoreApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -367,9 +368,9 @@ class StoreApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `place_order`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `place_order`") # noqa: E501 collection_formats = {} @@ -386,23 +387,24 @@ class StoreApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/store/order', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Order', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/store/order', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Order', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python/petstore_api/apis/user_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/user_api.py similarity index 57% rename from samples/client/petstore/python/petstore_api/apis/user_api.py rename to samples/client/petstore/python-asyncio/petstore_api/api/user_api.py index ffdad2dd60f..89949844aa1 100644 --- a/samples/client/petstore/python/petstore_api/apis/user_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/user_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,19 +13,17 @@ from __future__ import absolute_import -import sys -import os -import re +import re # noqa: F401 # 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): - """ - 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. Ref: https://github.com/swagger-api/swagger-codegen """ @@ -35,10 +33,10 @@ class UserApi(object): api_client = ApiClient() self.api_client = api_client - def create_user(self, body, **kwargs): - """ - Create user - This can only be done by the logged in user. + def create_user(self, body, **kwargs): # noqa: E501 + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.create_user(body, async=True) @@ -52,15 +50,15 @@ class UserApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.create_user_with_http_info(body, **kwargs) + (data) = self.create_user_with_http_info(body, **kwargs) # noqa: E501 return data - def create_user_with_http_info(self, body, **kwargs): - """ - Create user - This can only be done by the logged in user. + def create_user_with_http_info(self, body, **kwargs): # noqa: E501 + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.create_user_with_http_info(body, async=True) @@ -73,14 +71,14 @@ class UserApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -89,9 +87,9 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_user`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_user`") # noqa: E501 collection_formats = {} @@ -108,31 +106,32 @@ class UserApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def create_users_with_array_input(self, body, **kwargs): - """ - Creates list of users with given input array - + def create_users_with_array_input(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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 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: - (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 - def create_users_with_array_input_with_http_info(self, body, **kwargs): - """ - Creates list of users with given input array - + def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -183,9 +182,9 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") # noqa: E501 collection_formats = {} @@ -202,31 +201,32 @@ class UserApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/createWithArray', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/createWithArray', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def create_users_with_list_input(self, body, **kwargs): - """ - Creates list of users with given input array - + def create_users_with_list_input(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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 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: - (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 - def create_users_with_list_input_with_http_info(self, body, **kwargs): - """ - Creates list of users with given input array - + def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -277,9 +277,9 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") # noqa: E501 collection_formats = {} @@ -296,31 +296,32 @@ class UserApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/createWithList', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/createWithList', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def delete_user(self, username, **kwargs): - """ - Delete user - This can only be done by the logged in user. + def delete_user(self, username, **kwargs): # noqa: E501 + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.delete_user(username, async=True) @@ -334,15 +335,15 @@ class UserApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.delete_user_with_http_info(username, **kwargs) + (data) = self.delete_user_with_http_info(username, **kwargs) # noqa: E501 return data - def delete_user_with_http_info(self, username, **kwargs): - """ - Delete user - This can only be done by the logged in user. + def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.delete_user_with_http_info(username, async=True) @@ -355,14 +356,14 @@ class UserApi(object): returns the request thread. """ - all_params = ['username'] + all_params = ['username'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -371,15 +372,15 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in params) or (params['username'] is None): - raise ValueError("Missing the required parameter `username` when calling `delete_user`") - + if ('username' not in params or + params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501 collection_formats = {} path_params = {} if 'username' in params: - path_params['username'] = params['username'] + path_params['username'] = params['username'] # noqa: E501 query_params = [] @@ -390,31 +391,32 @@ class UserApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/{username}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/{username}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def get_user_by_name(self, username, **kwargs): - """ - Get user by user name - + def get_user_by_name(self, username, **kwargs): # noqa: E501 + """Get user by user name # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.get_user_by_name(username, async=True) @@ -428,15 +430,15 @@ class UserApi(object): """ kwargs['_return_http_data_only'] = True 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: - (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 - def get_user_by_name_with_http_info(self, username, **kwargs): - """ - Get user by user name - + def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 + """Get user by user name # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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. """ - all_params = ['username'] + all_params = ['username'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -465,15 +467,15 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in params) or (params['username'] is None): - raise ValueError("Missing the required parameter `username` when calling `get_user_by_name`") - + if ('username' not in params or + params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501 collection_formats = {} path_params = {} if 'username' in params: - path_params['username'] = params['username'] + path_params['username'] = params['username'] # noqa: E501 query_params = [] @@ -484,31 +486,32 @@ class UserApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/{username}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='User', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/{username}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='User', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def login_user(self, username, password, **kwargs): - """ - Logs user into the system - + def login_user(self, username, password, **kwargs): # noqa: E501 + """Logs user into the system # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.login_user(username, password, async=True) @@ -523,15 +526,15 @@ class UserApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.login_user_with_http_info(username, password, **kwargs) + (data) = self.login_user_with_http_info(username, password, **kwargs) # noqa: E501 return data - def login_user_with_http_info(self, username, password, **kwargs): - """ - Logs user into the system - + def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 + """Logs user into the system # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.login_user_with_http_info(username, password, async=True) @@ -545,14 +548,14 @@ class UserApi(object): returns the request thread. """ - all_params = ['username', 'password'] + all_params = ['username', 'password'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -561,12 +564,13 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in params) or (params['username'] is None): - raise ValueError("Missing the required parameter `username` when calling `login_user`") + if ('username' not in params or + params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501 # verify the required parameter 'password' is set - if ('password' not in params) or (params['password'] is None): - raise ValueError("Missing the required parameter `password` when calling `login_user`") - + if ('password' not in params or + params['password'] is None): + raise ValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501 collection_formats = {} @@ -574,9 +578,9 @@ class UserApi(object): query_params = [] if 'username' in params: - query_params.append(('username', params['username'])) + query_params.append(('username', params['username'])) # noqa: E501 if 'password' in params: - query_params.append(('password', params['password'])) + query_params.append(('password', params['password'])) # noqa: E501 header_params = {} @@ -585,31 +589,32 @@ class UserApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/login', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='str', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/login', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def logout_user(self, **kwargs): - """ - Logs out current logged in user session - + def logout_user(self, **kwargs): # noqa: E501 + """Logs out current logged in user session # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.logout_user(async=True) @@ -622,15 +627,15 @@ class UserApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.logout_user_with_http_info(**kwargs) + return self.logout_user_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.logout_user_with_http_info(**kwargs) + (data) = self.logout_user_with_http_info(**kwargs) # noqa: E501 return data - def logout_user_with_http_info(self, **kwargs): - """ - Logs out current logged in user session - + def logout_user_with_http_info(self, **kwargs): # noqa: E501 + """Logs out current logged in user session # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.logout_user_with_http_info(async=True) @@ -642,14 +647,14 @@ class UserApi(object): returns the request thread. """ - all_params = [] + all_params = [] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -671,31 +676,32 @@ class UserApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/logout', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/logout', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def update_user(self, username, body, **kwargs): - """ - Updated user - This can only be done by the logged in user. + def update_user(self, username, body, **kwargs): # noqa: E501 + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.update_user(username, body, async=True) @@ -710,15 +716,15 @@ class UserApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.update_user_with_http_info(username, body, **kwargs) + (data) = self.update_user_with_http_info(username, body, **kwargs) # noqa: E501 return data - def update_user_with_http_info(self, username, body, **kwargs): - """ - Updated user - This can only be done by the logged in user. + def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501 + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.update_user_with_http_info(username, body, async=True) @@ -732,14 +738,14 @@ class UserApi(object): returns the request thread. """ - all_params = ['username', 'body'] + all_params = ['username', 'body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -748,18 +754,19 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in params) or (params['username'] is None): - raise ValueError("Missing the required parameter `username` when calling `update_user`") + if ('username' not in params or + params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501 # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_user`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_user`") # noqa: E501 collection_formats = {} path_params = {} if 'username' in params: - path_params['username'] = params['username'] + path_params['username'] = params['username'] # noqa: E501 query_params = [] @@ -772,23 +779,24 @@ class UserApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/{username}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/{username}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-asyncio/petstore_api/api_client.py b/samples/client/petstore/python-asyncio/petstore_api/api_client.py index 9f265a7f94a..da27294c22f 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api_client.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api_client.py @@ -2,7 +2,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,27 +11,25 @@ from __future__ import absolute_import -import os -import re +import datetime import json import mimetypes -import tempfile from multiprocessing.pool import ThreadPool - -from datetime import date, datetime +import os +import re +import tempfile # 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 . import models -from .configuration import Configuration -from .rest import ApiException, RESTClientObject +from petstore_api.configuration import Configuration +import petstore_api.models +from petstore_api import rest 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- server communication, and is invariant across implementations. Specifics of @@ -42,64 +40,63 @@ class ApiClient(object): Ref: https://github.com/swagger-api/swagger-codegen 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_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 = { 'int': int, - 'long': int if PY3 else long, + 'long': int if six.PY3 else long, # noqa: F821 'float': float, 'str': str, 'bool': bool, - 'date': date, - 'datetime': datetime, + 'date': datetime.date, + 'datetime': datetime.datetime, '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: configuration = Configuration() self.configuration = configuration self.pool = ThreadPool() - self.rest_client = RESTClientObject(configuration) + self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} if header_name is not None: self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. self.user_agent = 'Swagger-Codegen/1.0.0/python' - + def __del__(self): self.pool.close() self.pool.join() @property def user_agent(self): - """ - Gets user agent. - """ + """User agent for this API client""" return self.default_headers['User-Agent'] @user_agent.setter def user_agent(self, value): - """ - Sets user agent. - """ self.default_headers['User-Agent'] = value def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value - async def __call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_type=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, _preload_content=True, - _request_timeout=None): + async def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): config = self.configuration @@ -121,7 +118,9 @@ class ApiClient(object): for k, v in path_params: # specified safe chars, encode everything 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 if query_params: @@ -147,12 +146,11 @@ class ApiClient(object): url = self.configuration.host + resource_path # perform request and return response - response_data = await self.request(method, url, - query_params=query_params, - headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + response_data = await self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) self.last_response = response_data @@ -167,11 +165,11 @@ class ApiClient(object): if _return_http_data_only: return (return_data) 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): - """ - Builds a JSON POST object. + """Builds a JSON POST object. If obj is None, return None. If obj is str, int, long, float, bool, return directly. @@ -194,7 +192,7 @@ class ApiClient(object): elif isinstance(obj, tuple): return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) - elif isinstance(obj, (datetime, date)): + elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() if isinstance(obj, dict): @@ -206,15 +204,14 @@ class ApiClient(object): # Convert attribute name to json key in # model definition for request. 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} 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): - """ - Deserializes response into an object. + """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for @@ -236,8 +233,7 @@ class ApiClient(object): return self.__deserialize(data, response_type) 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 klass: class literal, or string of class name. @@ -256,21 +252,21 @@ class ApiClient(object): if klass.startswith('dict('): sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2) return {k: self.__deserialize(v, sub_kls) - for k, v in iteritems(data)} + for k, v in six.iteritems(data)} # convert str to class if klass in self.NATIVE_TYPES_MAPPING: klass = self.NATIVE_TYPES_MAPPING[klass] else: - klass = getattr(models, klass) + klass = getattr(petstore_api.models, klass) if klass in self.PRIMITIVE_TYPES: return self.__deserialize_primitive(data, klass) elif klass == object: return self.__deserialize_object(data) - elif klass == date: + elif klass == datetime.date: return self.__deserialize_date(data) - elif klass == datetime: + elif klass == datetime.datetime: return self.__deserialize_datatime(data) else: return self.__deserialize_model(data, klass) @@ -279,10 +275,10 @@ class ApiClient(object): path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, response_type=None, auth_settings=None, async=None, - _return_http_data_only=None, collection_formats=None, _preload_content=True, - _request_timeout=None): - """ - Makes the HTTP request (synchronous) and return the deserialized data. + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + To make an async request, set the async parameter. :param resource_path: Path to method endpoint. @@ -299,13 +295,17 @@ class ApiClient(object): :param files dict: key -> filename, value -> filepath, for `multipart/form-data`. :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, header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without - reading/decoding response data. Default is True. - :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. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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: If async parameter is True, the request will be called asynchronously. @@ -318,22 +318,23 @@ class ApiClient(object): path_params, query_params, header_params, body, post_params, files, 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: - thread = self.pool.apply_async(self.__call_api, (resource_path, method, - path_params, query_params, + thread = self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, header_params, body, post_params, files, response_type, auth_settings, _return_http_data_only, - collection_formats, _preload_content, _request_timeout)) + collection_formats, + _preload_content, _request_timeout)) return thread def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, _request_timeout=None): - """ - Makes the HTTP request using RESTClient. - """ + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" if method == "GET": return self.rest_client.GET(url, query_params=query_params, @@ -392,8 +393,7 @@ class ApiClient(object): ) 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 dict collection_formats: Parameter collection formats @@ -402,7 +402,7 @@ class ApiClient(object): new_params = [] if collection_formats is None: 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: collection_format = collection_formats[k] if collection_format == 'multi': @@ -423,8 +423,7 @@ class ApiClient(object): return new_params def prepare_post_parameters(self, post_params=None, files=None): - """ - Builds form parameters. + """Builds form parameters. :param post_params: Normal form parameters. :param files: File parameters. @@ -436,7 +435,7 @@ class ApiClient(object): params = post_params if files: - for k, v in iteritems(files): + for k, v in six.iteritems(files): if not v: continue file_names = v if type(v) is list else [v] @@ -444,15 +443,15 @@ class ApiClient(object): with open(n, 'rb') as f: filename = os.path.basename(f.name) filedata = f.read() - mimetype = mimetypes.\ - guess_type(filename)[0] or 'application/octet-stream' - params.append(tuple([k, tuple([filename, filedata, mimetype])])) + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) return params 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. :return: Accept (e.g. application/json). @@ -468,8 +467,7 @@ class ApiClient(object): return ', '.join(accepts) 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. :return: Content-Type (e.g. application/json). @@ -485,8 +483,7 @@ class ApiClient(object): return content_types[0] 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 querys: Query parameters tuple list to be updated. @@ -510,7 +507,8 @@ class ApiClient(object): ) def __deserialize_file(self, response): - """ + """Deserializes body to file + Saves response body into a file in a temporary folder, using the filename from the `Content-Disposition` header if provided. @@ -523,9 +521,8 @@ class ApiClient(object): content_disposition = response.getheader("Content-Disposition") if content_disposition: - filename = re.\ - search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition).\ - group(1) + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) path = os.path.join(os.path.dirname(path), filename) with open(path, "w") as f: @@ -534,8 +531,7 @@ class ApiClient(object): return path def __deserialize_primitive(self, data, klass): - """ - Deserializes string to primitive type. + """Deserializes string to primitive type. :param data: str. :param klass: class literal. @@ -545,21 +541,19 @@ class ApiClient(object): try: return klass(data) except UnicodeEncodeError: - return unicode(data) + return unicode(data) # noqa: F821 except TypeError: return data def __deserialize_object(self, value): - """ - Return a original value. + """Return a original value. :return: object. """ return value def __deserialize_date(self, string): - """ - Deserializes string to date. + """Deserializes string to date. :param string: str. :return: date. @@ -570,14 +564,13 @@ class ApiClient(object): except ImportError: return string except ValueError: - raise ApiException( + raise rest.ApiException( 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): - """ - Deserializes string to datetime. + """Deserializes string to datetime. The string should be in iso8601 datetime format. @@ -590,32 +583,32 @@ class ApiClient(object): except ImportError: return string except ValueError: - raise ApiException( + raise rest.ApiException( status=0, reason=( - "Failed to parse `{0}` into a datetime object" + "Failed to parse `{0}` as datetime object" .format(string) ) ) def __deserialize_model(self, data, klass): - """ - Deserializes list or dict to model. + """Deserializes list or dict to model. :param data: dict, list. :param klass: class literal. :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 kwargs = {} if klass.swagger_types is not None: - for attr, attr_type in iteritems(klass.swagger_types): - if data is not None \ - and klass.attribute_map[attr] in data \ - and isinstance(data, (list, dict)): + for attr, attr_type in six.iteritems(klass.swagger_types): + if (data is not None and + klass.attribute_map[attr] in data and + isinstance(data, (list, dict))): value = data[klass.attribute_map[attr]] kwargs[attr] = self.__deserialize(value, attr_type) diff --git a/samples/client/petstore/python-asyncio/petstore_api/apis/__init__.py b/samples/client/petstore/python-asyncio/petstore_api/apis/__init__.py deleted file mode 100644 index b4b975ca8e0..00000000000 --- a/samples/client/petstore/python-asyncio/petstore_api/apis/__init__.py +++ /dev/null @@ -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 diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index 29bf22034aa..f6273cf28cc 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,24 +13,23 @@ from __future__ import absolute_import -import urllib3 - import copy import logging import multiprocessing import sys +import urllib3 -from six import iteritems -from six import with_metaclass +import six from six.moves import http_client as httplib + class TypeWithDefault(type): def __init__(cls, name, bases, dct): super(TypeWithDefault, cls).__init__(name, bases, dct) cls._default = None def __call__(cls): - if cls._default == None: + if cls._default is None: cls._default = type.__call__(cls) return copy.copy(cls._default) @@ -38,17 +37,15 @@ class TypeWithDefault(type): cls._default = copy.copy(default) -class Configuration(with_metaclass(TypeWithDefault, object)): - """ - NOTE: This class is auto generated by the swagger code generator program. +class Configuration(six.with_metaclass(TypeWithDefault, object)): + """NOTE: This class is auto generated by the swagger code generator program. + Ref: https://github.com/swagger-api/swagger-codegen Do not edit the class manually. """ def __init__(self): - """ - Constructor - """ + """Constructor""" # Default Base url self.host = "http://petstore.swagger.io:80/v2" # Temp file folder for downloading files @@ -83,7 +80,8 @@ class Configuration(with_metaclass(TypeWithDefault, object)): self.debug = False # 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 # Set this to customize the certificate file to verify the peer. 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. self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - # Proxy URL self.proxy = None # Safe chars for path_param @@ -109,18 +106,22 @@ class Configuration(with_metaclass(TypeWithDefault, object)): @property def logger_file(self): - """ - Gets the logger_file. + """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 @logger_file.setter def logger_file(self, value): - """ - Sets the logger_file. + """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. + 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 @@ -131,7 +132,7 @@ class Configuration(with_metaclass(TypeWithDefault, object)): # then add file handler and remove stream handler. self.logger_file_handler = logging.FileHandler(self.__logger_file) 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) if 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. self.logger_stream_handler = logging.StreamHandler() 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) if self.logger_file_handler: logger.removeHandler(self.logger_file_handler) @property def debug(self): - """ - Gets the debug status. + """Debug status + + :param value: The debug status, True or False. + :type: bool """ return self.__debug @debug.setter def debug(self, value): - """ - Sets the debug status. + """Debug status :param value: The debug status, True or False. :type: bool @@ -163,29 +165,32 @@ class Configuration(with_metaclass(TypeWithDefault, object)): self.__debug = value if self.__debug: # 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) # turn on httplib debug httplib.HTTPConnection.debuglevel = 1 else: # if debug status is False, turn off debug logging, # setting log level to default `logging.WARNING` - for _, logger in iteritems(self.logger): + for _, logger in six.iteritems(self.logger): logger.setLevel(logging.WARNING) # turn off httplib debug httplib.HTTPConnection.debuglevel = 0 @property def logger_format(self): - """ - Gets the logger_format. + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str """ return self.__logger_format @logger_format.setter def logger_format(self, value): - """ - Sets the logger_format. + """The 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) 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. :return: The token for api key authentication. """ - if self.api_key.get(identifier) and self.api_key_prefix.get(identifier): - return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] + if (self.api_key.get(identifier) and + self.api_key_prefix.get(identifier)): + return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 elif self.api_key.get(identifier): return self.api_key[identifier] 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 urllib3.util.make_headers(basic_auth=self.username + ':' + self.password)\ - .get('authorization') + return urllib3.util.make_headers( + basic_auth=self.username + ':' + self.password + ).get('authorization') def auth_settings(self): - """ - Gets Auth Settings dict for api client. + """Gets Auth Settings dict for api client. :return: The Auth Settings information dict. """ @@ -256,8 +260,7 @@ class Configuration(with_metaclass(TypeWithDefault, object)): } def to_debug_report(self): - """ - Gets the essential information for debugging. + """Gets the essential information for debugging. :return: The report for debugging. """ diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/__init__.py b/samples/client/petstore/python-asyncio/petstore_api/models/__init__.py index 21b5d20fa3c..7b339102f9b 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/__init__.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/__init__.py @@ -1,9 +1,10 @@ # coding: utf-8 +# flake8: noqa """ 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 Contact: apiteam@swagger.io @@ -14,39 +15,39 @@ from __future__ import absolute_import # import models into model package -from .additional_properties_class import AdditionalPropertiesClass -from .animal import Animal -from .animal_farm import AnimalFarm -from .api_response import ApiResponse -from .array_of_array_of_number_only import ArrayOfArrayOfNumberOnly -from .array_of_number_only import ArrayOfNumberOnly -from .array_test import ArrayTest -from .capitalization import Capitalization -from .category import Category -from .class_model import ClassModel -from .client import Client -from .enum_arrays import EnumArrays -from .enum_class import EnumClass -from .enum_test import EnumTest -from .format_test import FormatTest -from .has_only_read_only import HasOnlyReadOnly -from .list import List -from .map_test import MapTest -from .mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass -from .model_200_response import Model200Response -from .model_return import ModelReturn -from .name import Name -from .number_only import NumberOnly -from .order import Order -from .outer_boolean import OuterBoolean -from .outer_composite import OuterComposite -from .outer_enum import OuterEnum -from .outer_number import OuterNumber -from .outer_string import OuterString -from .pet import Pet -from .read_only_first import ReadOnlyFirst -from .special_model_name import SpecialModelName -from .tag import Tag -from .user import User -from .cat import Cat -from .dog import Dog +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 diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_class.py index a5329b411cd..03dbe975f1b 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_class.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_class.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class AdditionalPropertiesClass(object): 'map_of_map_property': 'map_of_map_property' } - def __init__(self, map_property=None, map_of_map_property=None): - """ - AdditionalPropertiesClass - a model defined in Swagger - """ + def __init__(self, map_property=None, map_of_map_property=None): # noqa: E501 + """AdditionalPropertiesClass - a model defined in Swagger""" # noqa: E501 self._map_property = None self._map_of_map_property = None self.discriminator = 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: - self.map_of_map_property = map_of_map_property + self.map_of_map_property = map_of_map_property @property def map_property(self): - """ - Gets the map_property of this AdditionalPropertiesClass. + """Gets the map_property of this AdditionalPropertiesClass. # noqa: E501 - :return: The map_property of this AdditionalPropertiesClass. + + :return: The map_property of this AdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, str) """ return self._map_property @map_property.setter 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) """ @@ -77,32 +75,30 @@ class AdditionalPropertiesClass(object): @property def map_of_map_property(self): - """ - Gets the map_of_map_property of this AdditionalPropertiesClass. + """Gets the map_of_map_property of this AdditionalPropertiesClass. # noqa: E501 - :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)) """ return self._map_of_map_property @map_of_map_property.setter 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)) """ self._map_of_map_property = map_of_map_property def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -123,28 +119,20 @@ class AdditionalPropertiesClass(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, AdditionalPropertiesClass): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/animal.py b/samples/client/petstore/python-asyncio/petstore_api/models/animal.py index 13d8276713d..390ac83905e 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/animal.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/animal.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -41,14 +41,12 @@ class Animal(object): } discriminator_value_class_map = { - '': 'Dog', - '': 'Cat' + 'Dog': 'Dog', + 'Cat': 'Cat' } - def __init__(self, class_name=None, color='red'): - """ - Animal - a model defined in Swagger - """ + def __init__(self, class_name=None, color='red'): # noqa: E501 + """Animal - a model defined in Swagger""" # noqa: E501 self._class_name = None self._color = None @@ -56,69 +54,62 @@ class Animal(object): self.class_name = class_name if color is not None: - self.color = color + self.color = color @property def class_name(self): - """ - Gets the class_name of this Animal. + """Gets the class_name of this Animal. # noqa: E501 - :return: The class_name of this Animal. + + :return: The class_name of this Animal. # noqa: E501 :rtype: str """ return self._class_name @class_name.setter 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 """ 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 @property def color(self): - """ - Gets the color of this Animal. + """Gets the color of this Animal. # noqa: E501 - :return: The color of this Animal. + + :return: The color of this Animal. # noqa: E501 :rtype: str """ return self._color @color.setter 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 """ self._color = color 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() - if self.discriminator_value_class_map.has_key(discriminator_value): - return self.discriminator_value_class_map[discriminator_value] - else: - return None + return self.discriminator_value_class_map.get(discriminator_value) def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -139,28 +130,20 @@ class Animal(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Animal): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/animal_farm.py b/samples/client/petstore/python-asyncio/petstore_api/models/animal_farm.py index fa47d63f881..6371257286e 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/animal_farm.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/animal_farm.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,20 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six + +from petstore_api.models.animal import Animal # noqa: F401,E501 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,28 +33,20 @@ class AnimalFarm(object): and the value is json key in definition. """ swagger_types = { - } attribute_map = { - } - def __init__(self): - """ - AnimalFarm - a model defined in Swagger - """ - + def __init__(self): # noqa: E501 + """AnimalFarm - a model defined in Swagger""" # noqa: E501 self.discriminator = None - def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -73,28 +67,20 @@ class AnimalFarm(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, AnimalFarm): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/api_response.py b/samples/client/petstore/python-asyncio/petstore_api/models/api_response.py index b2d784d8020..45c4831bb10 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/api_response.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/api_response.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +42,8 @@ class ApiResponse(object): 'message': 'message' } - def __init__(self, code=None, type=None, message=None): - """ - ApiResponse - a model defined in Swagger - """ + def __init__(self, code=None, type=None, message=None): # noqa: E501 + """ApiResponse - a model defined in Swagger""" # noqa: E501 self._code = None self._type = None @@ -53,28 +51,28 @@ class ApiResponse(object): self.discriminator = None if code is not None: - self.code = code + self.code = code if type is not None: - self.type = type + self.type = type if message is not None: - self.message = message + self.message = message @property def code(self): - """ - Gets the code of this ApiResponse. + """Gets the code of this ApiResponse. # noqa: E501 - :return: The code of this ApiResponse. + + :return: The code of this ApiResponse. # noqa: E501 :rtype: int """ return self._code @code.setter 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 """ @@ -82,20 +80,20 @@ class ApiResponse(object): @property def type(self): - """ - Gets the type of this ApiResponse. + """Gets the type of this ApiResponse. # noqa: E501 - :return: The type of this ApiResponse. + + :return: The type of this ApiResponse. # noqa: E501 :rtype: str """ return self._type @type.setter 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 """ @@ -103,32 +101,30 @@ class ApiResponse(object): @property def message(self): - """ - Gets the message of this ApiResponse. + """Gets the message of this ApiResponse. # noqa: E501 - :return: The message of this ApiResponse. + + :return: The message of this ApiResponse. # noqa: E501 :rtype: str """ return self._message @message.setter 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 """ self._message = message def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -149,28 +145,20 @@ class ApiResponse(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ApiResponse): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/array_of_array_of_number_only.py b/samples/client/petstore/python-asyncio/petstore_api/models/array_of_array_of_number_only.py index 0792f5a8a23..c6b363f19d8 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/array_of_array_of_number_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class ArrayOfArrayOfNumberOnly(object): 'array_array_number': 'ArrayArrayNumber' } - def __init__(self, array_array_number=None): - """ - ArrayOfArrayOfNumberOnly - a model defined in Swagger - """ + def __init__(self, array_array_number=None): # noqa: E501 + """ArrayOfArrayOfNumberOnly - a model defined in Swagger""" # noqa: E501 self._array_array_number = None self.discriminator = None if array_array_number is not None: - self.array_array_number = array_array_number + self.array_array_number = array_array_number @property def array_array_number(self): - """ - Gets the array_array_number of this ArrayOfArrayOfNumberOnly. + """Gets the array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 - :return: The array_array_number of this ArrayOfArrayOfNumberOnly. + + :return: The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 :rtype: list[list[float]] """ return self._array_array_number @array_array_number.setter 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]] """ self._array_array_number = array_array_number def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class ArrayOfArrayOfNumberOnly(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ArrayOfArrayOfNumberOnly): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/array_of_number_only.py b/samples/client/petstore/python-asyncio/petstore_api/models/array_of_number_only.py index 9d00e1b37a2..240362696cd 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/array_of_number_only.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/array_of_number_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class ArrayOfNumberOnly(object): 'array_number': 'ArrayNumber' } - def __init__(self, array_number=None): - """ - ArrayOfNumberOnly - a model defined in Swagger - """ + def __init__(self, array_number=None): # noqa: E501 + """ArrayOfNumberOnly - a model defined in Swagger""" # noqa: E501 self._array_number = None self.discriminator = None if array_number is not None: - self.array_number = array_number + self.array_number = array_number @property def array_number(self): - """ - Gets the array_number of this ArrayOfNumberOnly. + """Gets the array_number of this ArrayOfNumberOnly. # noqa: E501 - :return: The array_number of this ArrayOfNumberOnly. + + :return: The array_number of this ArrayOfNumberOnly. # noqa: E501 :rtype: list[float] """ return self._array_number @array_number.setter 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] """ self._array_number = array_number def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class ArrayOfNumberOnly(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ArrayOfNumberOnly): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/array_test.py b/samples/client/petstore/python-asyncio/petstore_api/models/array_test.py index ac3079087c8..c5cd6bfe159 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/array_test.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/array_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,20 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six + +from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: F401,E501 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +44,8 @@ class ArrayTest(object): '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): - """ - ArrayTest - a model defined in Swagger - """ + 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 self._array_of_string = None self._array_array_of_integer = None @@ -53,28 +53,28 @@ class ArrayTest(object): self.discriminator = 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: - 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: - self.array_array_of_model = array_array_of_model + self.array_array_of_model = array_array_of_model @property def array_of_string(self): - """ - Gets the array_of_string of this ArrayTest. + """Gets the array_of_string of this ArrayTest. # noqa: E501 - :return: The array_of_string of this ArrayTest. + + :return: The array_of_string of this ArrayTest. # noqa: E501 :rtype: list[str] """ return self._array_of_string @array_of_string.setter 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] """ @@ -82,20 +82,20 @@ class ArrayTest(object): @property def array_array_of_integer(self): - """ - Gets the array_array_of_integer of this ArrayTest. + """Gets the array_array_of_integer of this ArrayTest. # noqa: E501 - :return: The array_array_of_integer of this ArrayTest. + + :return: The array_array_of_integer of this ArrayTest. # noqa: E501 :rtype: list[list[int]] """ return self._array_array_of_integer @array_array_of_integer.setter 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]] """ @@ -103,32 +103,30 @@ class ArrayTest(object): @property def array_array_of_model(self): - """ - Gets the array_array_of_model of this ArrayTest. + """Gets the array_array_of_model of this ArrayTest. # noqa: E501 - :return: The array_array_of_model of this ArrayTest. + + :return: The array_array_of_model of this ArrayTest. # noqa: E501 :rtype: list[list[ReadOnlyFirst]] """ return self._array_array_of_model @array_array_of_model.setter 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]] """ self._array_array_of_model = array_array_of_model def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -149,28 +147,20 @@ class ArrayTest(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ArrayTest): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/capitalization.py b/samples/client/petstore/python-asyncio/petstore_api/models/capitalization.py index c9be6ed4d15..309642bdeff 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/capitalization.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/capitalization.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -48,10 +48,8 @@ class Capitalization(object): '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): - """ - Capitalization - a model defined in Swagger - """ + 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 self._small_camel = None self._capital_camel = None @@ -62,34 +60,34 @@ class Capitalization(object): self.discriminator = None if small_camel is not None: - self.small_camel = small_camel + self.small_camel = small_camel if capital_camel is not None: - self.capital_camel = capital_camel + self.capital_camel = capital_camel if small_snake is not None: - self.small_snake = small_snake + self.small_snake = small_snake if capital_snake is not None: - self.capital_snake = capital_snake + self.capital_snake = capital_snake 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: - self.att_name = att_name + self.att_name = att_name @property def small_camel(self): - """ - Gets the small_camel of this Capitalization. + """Gets the small_camel of this Capitalization. # noqa: E501 - :return: The small_camel of this Capitalization. + + :return: The small_camel of this Capitalization. # noqa: E501 :rtype: str """ return self._small_camel @small_camel.setter 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 """ @@ -97,20 +95,20 @@ class Capitalization(object): @property def capital_camel(self): - """ - Gets the capital_camel of this Capitalization. + """Gets the capital_camel of this Capitalization. # noqa: E501 - :return: The capital_camel of this Capitalization. + + :return: The capital_camel of this Capitalization. # noqa: E501 :rtype: str """ return self._capital_camel @capital_camel.setter 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 """ @@ -118,20 +116,20 @@ class Capitalization(object): @property def small_snake(self): - """ - Gets the small_snake of this Capitalization. + """Gets the small_snake of this Capitalization. # noqa: E501 - :return: The small_snake of this Capitalization. + + :return: The small_snake of this Capitalization. # noqa: E501 :rtype: str """ return self._small_snake @small_snake.setter 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 """ @@ -139,20 +137,20 @@ class Capitalization(object): @property def capital_snake(self): - """ - Gets the capital_snake of this Capitalization. + """Gets the capital_snake of this Capitalization. # noqa: E501 - :return: The capital_snake of this Capitalization. + + :return: The capital_snake of this Capitalization. # noqa: E501 :rtype: str """ return self._capital_snake @capital_snake.setter 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 """ @@ -160,20 +158,20 @@ class Capitalization(object): @property def sca_eth_flow_points(self): - """ - Gets the sca_eth_flow_points of this Capitalization. + """Gets the sca_eth_flow_points of this Capitalization. # noqa: E501 - :return: The sca_eth_flow_points of this Capitalization. + + :return: The sca_eth_flow_points of this Capitalization. # noqa: E501 :rtype: str """ return self._sca_eth_flow_points @sca_eth_flow_points.setter 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 """ @@ -181,34 +179,32 @@ class Capitalization(object): @property def att_name(self): - """ - Gets the att_name of this Capitalization. - Name of the pet + """Gets the att_name of this Capitalization. # noqa: E501 - :return: The att_name of this Capitalization. + Name of the pet # noqa: E501 + + :return: The att_name of this Capitalization. # noqa: E501 :rtype: str """ return self._att_name @att_name.setter def att_name(self, att_name): - """ - Sets the att_name of this Capitalization. - Name of the pet + """Sets the att_name of this Capitalization. - :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 """ self._att_name = att_name def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -229,28 +225,20 @@ class Capitalization(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Capitalization): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/cat.py b/samples/client/petstore/python-asyncio/petstore_api/models/cat.py index 76dfdc0e5b1..526d3e2aaf5 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/cat.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/cat.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,20 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six + +from petstore_api.models.animal import Animal # noqa: F401,E501 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +40,41 @@ class Cat(object): 'declawed': 'declawed' } - def __init__(self, declawed=None): - """ - Cat - a model defined in Swagger - """ + def __init__(self, declawed=None): # noqa: E501 + """Cat - a model defined in Swagger""" # noqa: E501 self._declawed = None self.discriminator = None if declawed is not None: - self.declawed = declawed + self.declawed = declawed @property def declawed(self): - """ - Gets the declawed of this Cat. + """Gets the declawed of this Cat. # noqa: E501 - :return: The declawed of this Cat. + + :return: The declawed of this Cat. # noqa: E501 :rtype: bool """ return self._declawed @declawed.setter 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 """ self._declawed = declawed def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +95,20 @@ class Cat(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Cat): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/category.py b/samples/client/petstore/python-asyncio/petstore_api/models/category.py index 859283a3f77..02d393af888 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/category.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/category.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class Category(object): 'name': 'name' } - def __init__(self, id=None, name=None): - """ - Category - a model defined in Swagger - """ + def __init__(self, id=None, name=None): # noqa: E501 + """Category - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None self.discriminator = None if id is not None: - self.id = id + self.id = id if name is not None: - self.name = name + self.name = name @property def id(self): - """ - Gets the id of this Category. + """Gets the id of this Category. # noqa: E501 - :return: The id of this Category. + + :return: The id of this Category. # noqa: E501 :rtype: int """ return self._id @id.setter 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 """ @@ -77,32 +75,30 @@ class Category(object): @property def name(self): - """ - Gets the name of this Category. + """Gets the name of this Category. # noqa: E501 - :return: The name of this Category. + + :return: The name of this Category. # noqa: E501 :rtype: str """ return self._name @name.setter 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 """ self._name = name def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -123,28 +119,20 @@ class Category(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Category): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/class_model.py b/samples/client/petstore/python-asyncio/petstore_api/models/class_model.py index 7b39d38abe9..4bcb19b8dc2 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/class_model.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/class_model.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class ClassModel(object): '_class': '_class' } - def __init__(self, _class=None): - """ - ClassModel - a model defined in Swagger - """ + def __init__(self, _class=None): # noqa: E501 + """ClassModel - a model defined in Swagger""" # noqa: E501 self.__class = None self.discriminator = None if _class is not None: - self._class = _class + self._class = _class @property def _class(self): - """ - Gets the _class of this ClassModel. + """Gets the _class of this ClassModel. # noqa: E501 - :return: The _class of this ClassModel. + + :return: The _class of this ClassModel. # noqa: E501 :rtype: str """ return self.__class @_class.setter 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 """ self.__class = _class def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class ClassModel(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ClassModel): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/client.py b/samples/client/petstore/python-asyncio/petstore_api/models/client.py index 395f77913cc..e267fed6d8c 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/client.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/client.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class Client(object): 'client': 'client' } - def __init__(self, client=None): - """ - Client - a model defined in Swagger - """ + def __init__(self, client=None): # noqa: E501 + """Client - a model defined in Swagger""" # noqa: E501 self._client = None self.discriminator = None if client is not None: - self.client = client + self.client = client @property def client(self): - """ - Gets the client of this Client. + """Gets the client of this Client. # noqa: E501 - :return: The client of this Client. + + :return: The client of this Client. # noqa: E501 :rtype: str """ return self._client @client.setter 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 """ self._client = client def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class Client(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Client): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/dog.py b/samples/client/petstore/python-asyncio/petstore_api/models/dog.py index 3c159ad0d6f..34aac6aaad4 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/dog.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/dog.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,20 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six + +from petstore_api.models.animal import Animal # noqa: F401,E501 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +40,41 @@ class Dog(object): 'breed': 'breed' } - def __init__(self, breed=None): - """ - Dog - a model defined in Swagger - """ + def __init__(self, breed=None): # noqa: E501 + """Dog - a model defined in Swagger""" # noqa: E501 self._breed = None self.discriminator = None if breed is not None: - self.breed = breed + self.breed = breed @property def breed(self): - """ - Gets the breed of this Dog. + """Gets the breed of this Dog. # noqa: E501 - :return: The breed of this Dog. + + :return: The breed of this Dog. # noqa: E501 :rtype: str """ return self._breed @breed.setter 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 """ self._breed = breed def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +95,20 @@ class Dog(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Dog): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/enum_arrays.py b/samples/client/petstore/python-asyncio/petstore_api/models/enum_arrays.py index 893085ea235..d02be298d2f 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/enum_arrays.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/enum_arrays.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,42 +40,40 @@ class EnumArrays(object): 'array_enum': 'array_enum' } - def __init__(self, just_symbol=None, array_enum=None): - """ - EnumArrays - a model defined in Swagger - """ + def __init__(self, just_symbol=None, array_enum=None): # noqa: E501 + """EnumArrays - a model defined in Swagger""" # noqa: E501 self._just_symbol = None self._array_enum = None self.discriminator = None if just_symbol is not None: - self.just_symbol = just_symbol + self.just_symbol = just_symbol if array_enum is not None: - self.array_enum = array_enum + self.array_enum = array_enum @property def just_symbol(self): - """ - Gets the just_symbol of this EnumArrays. + """Gets the just_symbol of this EnumArrays. # noqa: E501 - :return: The just_symbol of this EnumArrays. + + :return: The just_symbol of this EnumArrays. # noqa: E501 :rtype: str """ return self._just_symbol @just_symbol.setter 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 """ - allowed_values = [">=", "$"] + allowed_values = [">=", "$"] # noqa: E501 if just_symbol not in allowed_values: 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) ) @@ -83,39 +81,37 @@ class EnumArrays(object): @property def array_enum(self): - """ - Gets the array_enum of this EnumArrays. + """Gets the array_enum of this EnumArrays. # noqa: E501 - :return: The array_enum of this EnumArrays. + + :return: The array_enum of this EnumArrays. # noqa: E501 :rtype: list[str] """ return self._array_enum @array_enum.setter 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] """ - allowed_values = ["fish", "crab"] + allowed_values = ["fish", "crab"] # noqa: E501 if not set(array_enum).issubset(set(allowed_values)): raise ValueError( - "Invalid values for `array_enum` [{0}], must be a subset of [{1}]" - .format(", ".join(map(str, set(array_enum)-set(allowed_values))), + "Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501 ", ".join(map(str, allowed_values))) ) self._array_enum = array_enum def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -136,28 +132,20 @@ class EnumArrays(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, EnumArrays): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/enum_class.py b/samples/client/petstore/python-asyncio/petstore_api/models/enum_class.py index d9e0b771a7d..e4721545e83 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/enum_class.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/enum_class.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,14 +11,15 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ @@ -37,28 +38,20 @@ class EnumClass(object): and the value is json key in definition. """ swagger_types = { - } attribute_map = { - } - def __init__(self): - """ - EnumClass - a model defined in Swagger - """ - + def __init__(self): # noqa: E501 + """EnumClass - a model defined in Swagger""" # noqa: E501 self.discriminator = None - def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -79,28 +72,20 @@ class EnumClass(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, EnumClass): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/enum_test.py b/samples/client/petstore/python-asyncio/petstore_api/models/enum_test.py index 6d7caa1f4bc..1bb234764ab 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/enum_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,20 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six + +from petstore_api.models.outer_enum import OuterEnum # noqa: F401,E501 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,10 +46,8 @@ class EnumTest(object): 'outer_enum': 'outerEnum' } - def __init__(self, enum_string=None, enum_integer=None, enum_number=None, outer_enum=None): - """ - EnumTest - a model defined in Swagger - """ + 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 self._enum_string = None self._enum_integer = None @@ -56,36 +56,36 @@ class EnumTest(object): self.discriminator = None if enum_string is not None: - self.enum_string = enum_string + self.enum_string = enum_string if enum_integer is not None: - self.enum_integer = enum_integer + self.enum_integer = enum_integer if enum_number is not None: - self.enum_number = enum_number + self.enum_number = enum_number if outer_enum is not None: - self.outer_enum = outer_enum + self.outer_enum = outer_enum @property def enum_string(self): - """ - Gets the enum_string of this EnumTest. + """Gets the enum_string of this EnumTest. # noqa: E501 - :return: The enum_string of this EnumTest. + + :return: The enum_string of this EnumTest. # noqa: E501 :rtype: str """ return self._enum_string @enum_string.setter 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 """ - allowed_values = ["UPPER", "lower", ""] + allowed_values = ["UPPER", "lower", ""] # noqa: E501 if enum_string not in allowed_values: 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) ) @@ -93,26 +93,26 @@ class EnumTest(object): @property def enum_integer(self): - """ - Gets the enum_integer of this EnumTest. + """Gets the enum_integer of this EnumTest. # noqa: E501 - :return: The enum_integer of this EnumTest. + + :return: The enum_integer of this EnumTest. # noqa: E501 :rtype: int """ return self._enum_integer @enum_integer.setter 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 """ - allowed_values = [1, -1] + allowed_values = [1, -1] # noqa: E501 if enum_integer not in allowed_values: 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) ) @@ -120,26 +120,26 @@ class EnumTest(object): @property def enum_number(self): - """ - Gets the enum_number of this EnumTest. + """Gets the enum_number of this EnumTest. # noqa: E501 - :return: The enum_number of this EnumTest. + + :return: The enum_number of this EnumTest. # noqa: E501 :rtype: float """ return self._enum_number @enum_number.setter 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 """ - allowed_values = [1.1, -1.2] + allowed_values = [1.1, -1.2] # noqa: E501 if enum_number not in allowed_values: 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) ) @@ -147,32 +147,30 @@ class EnumTest(object): @property def outer_enum(self): - """ - Gets the outer_enum of this EnumTest. + """Gets the outer_enum of this EnumTest. # noqa: E501 - :return: The outer_enum of this EnumTest. + + :return: The outer_enum of this EnumTest. # noqa: E501 :rtype: OuterEnum """ return self._outer_enum @outer_enum.setter 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 """ self._outer_enum = outer_enum def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -193,28 +191,20 @@ class EnumTest(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, EnumTest): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/format_test.py b/samples/client/petstore/python-asyncio/petstore_api/models/format_test.py index 139d1733b35..7974d732fda 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/format_test.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/format_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -62,10 +62,8 @@ class FormatTest(object): '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): - """ - FormatTest - a model defined in Swagger - """ + 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 self._integer = None self._int32 = None @@ -83,94 +81,94 @@ class FormatTest(object): self.discriminator = None if integer is not None: - self.integer = integer + self.integer = integer if int32 is not None: - self.int32 = int32 + self.int32 = int32 if int64 is not None: - self.int64 = int64 + self.int64 = int64 self.number = number if float is not None: - self.float = float + self.float = float if double is not None: - self.double = double + self.double = double if string is not None: - self.string = string + self.string = string self.byte = byte if binary is not None: - self.binary = binary + self.binary = binary self.date = date if date_time is not None: - self.date_time = date_time + self.date_time = date_time if uuid is not None: - self.uuid = uuid + self.uuid = uuid self.password = password @property def integer(self): - """ - Gets the integer of this FormatTest. + """Gets the integer of this FormatTest. # noqa: E501 - :return: The integer of this FormatTest. + + :return: The integer of this FormatTest. # noqa: E501 :rtype: int """ return self._integer @integer.setter 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 """ - if integer is not None and integer > 100: - raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100`") - if integer is not None and integer < 10: - raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") + 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`") # noqa: E501 + 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`") # noqa: E501 self._integer = integer @property def int32(self): - """ - Gets the int32 of this FormatTest. + """Gets the int32 of this FormatTest. # noqa: E501 - :return: The int32 of this FormatTest. + + :return: The int32 of this FormatTest. # noqa: E501 :rtype: int """ return self._int32 @int32.setter 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 """ - if int32 is not None and int32 > 200: - raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200`") - if int32 is not None and int32 < 20: - raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") + 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`") # noqa: E501 + 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`") # noqa: E501 self._int32 = int32 @property def int64(self): - """ - Gets the int64 of this FormatTest. + """Gets the int64 of this FormatTest. # noqa: E501 - :return: The int64 of this FormatTest. + + :return: The int64 of this FormatTest. # noqa: E501 :rtype: int """ return self._int64 @int64.setter 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 """ @@ -178,145 +176,145 @@ class FormatTest(object): @property def number(self): - """ - Gets the number of this FormatTest. + """Gets the number of this FormatTest. # noqa: E501 - :return: The number of this FormatTest. + + :return: The number of this FormatTest. # noqa: E501 :rtype: float """ return self._number @number.setter 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 """ if number is None: - raise ValueError("Invalid value for `number`, must not be `None`") - if number is not None and number > 543.2: - raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`") - if number is not None and number < 32.1: - raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") + raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501 + 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`") # noqa: E501 + 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`") # noqa: E501 self._number = number @property def float(self): - """ - Gets the float of this FormatTest. + """Gets the float of this FormatTest. # noqa: E501 - :return: The float of this FormatTest. + + :return: The float of this FormatTest. # noqa: E501 :rtype: float """ return self._float @float.setter 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 """ - if float is not None and float > 987.6: - raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") - if float is not None and float < 54.3: - raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") + 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`") # noqa: E501 + 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`") # noqa: E501 self._float = float @property def double(self): - """ - Gets the double of this FormatTest. + """Gets the double of this FormatTest. # noqa: E501 - :return: The double of this FormatTest. + + :return: The double of this FormatTest. # noqa: E501 :rtype: float """ return self._double @double.setter 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 """ - if double is not None and double > 123.4: - raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`") - if double is not None and double < 67.8: - raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") + 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`") # noqa: E501 + 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`") # noqa: E501 self._double = double @property def string(self): - """ - Gets the string of this FormatTest. + """Gets the string of this FormatTest. # noqa: E501 - :return: The string of this FormatTest. + + :return: The string of this FormatTest. # noqa: E501 :rtype: str """ return self._string @string.setter 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 """ - if string is not None and not re.search('[a-z]', string, flags=re.IGNORECASE): - raise ValueError("Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") + 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`") # noqa: E501 self._string = string @property def byte(self): - """ - Gets the byte of this FormatTest. + """Gets the byte of this FormatTest. # noqa: E501 - :return: The byte of this FormatTest. + + :return: The byte of this FormatTest. # noqa: E501 :rtype: str """ return self._byte @byte.setter 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 """ if byte is None: - raise ValueError("Invalid value for `byte`, must not be `None`") - 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): - 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 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): # 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}=)?$/`") # noqa: E501 self._byte = byte @property def binary(self): - """ - Gets the binary of this FormatTest. + """Gets the binary of this FormatTest. # noqa: E501 - :return: The binary of this FormatTest. + + :return: The binary of this FormatTest. # noqa: E501 :rtype: str """ return self._binary @binary.setter 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 """ @@ -324,43 +322,43 @@ class FormatTest(object): @property def date(self): - """ - Gets the date of this FormatTest. + """Gets the date of this FormatTest. # noqa: E501 - :return: The date of this FormatTest. + + :return: The date of this FormatTest. # noqa: E501 :rtype: date """ return self._date @date.setter 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 """ 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 @property def date_time(self): - """ - Gets the date_time of this FormatTest. + """Gets the date_time of this FormatTest. # noqa: E501 - :return: The date_time of this FormatTest. + + :return: The date_time of this FormatTest. # noqa: E501 :rtype: datetime """ return self._date_time @date_time.setter 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 """ @@ -368,20 +366,20 @@ class FormatTest(object): @property def uuid(self): - """ - Gets the uuid of this FormatTest. + """Gets the uuid of this FormatTest. # noqa: E501 - :return: The uuid of this FormatTest. + + :return: The uuid of this FormatTest. # noqa: E501 :rtype: str """ return self._uuid @uuid.setter 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 """ @@ -389,38 +387,36 @@ class FormatTest(object): @property def password(self): - """ - Gets the password of this FormatTest. + """Gets the password of this FormatTest. # noqa: E501 - :return: The password of this FormatTest. + + :return: The password of this FormatTest. # noqa: E501 :rtype: str """ return self._password @password.setter 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 """ 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: - 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: - 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 def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -441,28 +437,20 @@ class FormatTest(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, FormatTest): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/has_only_read_only.py b/samples/client/petstore/python-asyncio/petstore_api/models/has_only_read_only.py index da0c14ec5b1..3c93eb30996 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/has_only_read_only.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/has_only_read_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class HasOnlyReadOnly(object): 'foo': 'foo' } - def __init__(self, bar=None, foo=None): - """ - HasOnlyReadOnly - a model defined in Swagger - """ + def __init__(self, bar=None, foo=None): # noqa: E501 + """HasOnlyReadOnly - a model defined in Swagger""" # noqa: E501 self._bar = None self._foo = None self.discriminator = None if bar is not None: - self.bar = bar + self.bar = bar if foo is not None: - self.foo = foo + self.foo = foo @property def bar(self): - """ - Gets the bar of this HasOnlyReadOnly. + """Gets the bar of this HasOnlyReadOnly. # noqa: E501 - :return: The bar of this HasOnlyReadOnly. + + :return: The bar of this HasOnlyReadOnly. # noqa: E501 :rtype: str """ return self._bar @bar.setter 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 """ @@ -77,32 +75,30 @@ class HasOnlyReadOnly(object): @property def foo(self): - """ - Gets the foo of this HasOnlyReadOnly. + """Gets the foo of this HasOnlyReadOnly. # noqa: E501 - :return: The foo of this HasOnlyReadOnly. + + :return: The foo of this HasOnlyReadOnly. # noqa: E501 :rtype: str """ return self._foo @foo.setter 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 """ self._foo = foo def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -123,28 +119,20 @@ class HasOnlyReadOnly(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, HasOnlyReadOnly): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/list.py b/samples/client/petstore/python-asyncio/petstore_api/models/list.py index 2ac0e51fb12..fbe30e6d01e 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/list.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/list.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class List(object): '_123_list': '123-list' } - def __init__(self, _123_list=None): - """ - List - a model defined in Swagger - """ + def __init__(self, _123_list=None): # noqa: E501 + """List - a model defined in Swagger""" # noqa: E501 self.__123_list = None self.discriminator = None if _123_list is not None: - self._123_list = _123_list + self._123_list = _123_list @property def _123_list(self): - """ - Gets the _123_list of this List. + """Gets the _123_list of this List. # noqa: E501 - :return: The _123_list of this List. + + :return: The _123_list of this List. # noqa: E501 :rtype: str """ return self.__123_list @_123_list.setter 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 """ self.__123_list = _123_list def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class List(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, List): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/map_test.py b/samples/client/petstore/python-asyncio/petstore_api/models/map_test.py index 3cb936e0db8..374c0661ba5 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/map_test.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/map_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class MapTest(object): 'map_of_enum_string': 'map_of_enum_string' } - def __init__(self, map_map_of_string=None, map_of_enum_string=None): - """ - MapTest - a model defined in Swagger - """ + def __init__(self, map_map_of_string=None, map_of_enum_string=None): # noqa: E501 + """MapTest - a model defined in Swagger""" # noqa: E501 self._map_map_of_string = None self._map_of_enum_string = None self.discriminator = 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: - self.map_of_enum_string = map_of_enum_string + self.map_of_enum_string = map_of_enum_string @property def map_map_of_string(self): - """ - Gets the map_map_of_string of this MapTest. + """Gets the map_map_of_string of this MapTest. # noqa: E501 - :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)) """ return self._map_map_of_string @map_map_of_string.setter 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)) """ @@ -77,39 +75,37 @@ class MapTest(object): @property def map_of_enum_string(self): - """ - Gets the map_of_enum_string of this MapTest. + """Gets the map_of_enum_string of this MapTest. # noqa: E501 - :return: The map_of_enum_string of this MapTest. + + :return: The map_of_enum_string of this MapTest. # noqa: E501 :rtype: dict(str, str) """ return self._map_of_enum_string @map_of_enum_string.setter 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) """ - allowed_values = ["UPPER", "lower"] + allowed_values = ["UPPER", "lower"] # noqa: E501 if not set(map_of_enum_string.keys()).issubset(set(allowed_values)): raise ValueError( - "Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" - .format(", ".join(map(str, set(map_of_enum_string.keys())-set(allowed_values))), + "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))), # noqa: E501 ", ".join(map(str, allowed_values))) ) self._map_of_enum_string = map_of_enum_string def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -130,28 +126,20 @@ class MapTest(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, MapTest): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-asyncio/petstore_api/models/mixed_properties_and_additional_properties_class.py index 4b773deacef..dba1f261352 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,20 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six + +from petstore_api.models.animal import Animal # noqa: F401,E501 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +44,8 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): 'map': 'map' } - def __init__(self, uuid=None, date_time=None, map=None): - """ - MixedPropertiesAndAdditionalPropertiesClass - a model defined in Swagger - """ + def __init__(self, uuid=None, date_time=None, map=None): # noqa: E501 + """MixedPropertiesAndAdditionalPropertiesClass - a model defined in Swagger""" # noqa: E501 self._uuid = None self._date_time = None @@ -53,28 +53,28 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): self.discriminator = None if uuid is not None: - self.uuid = uuid + self.uuid = uuid if date_time is not None: - self.date_time = date_time + self.date_time = date_time if map is not None: - self.map = map + self.map = map @property def uuid(self): - """ - Gets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. + """Gets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :return: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. + + :return: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 :rtype: str """ return self._uuid @uuid.setter 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 """ @@ -82,20 +82,20 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): @property def date_time(self): - """ - Gets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. + """Gets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :return: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. + + :return: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 :rtype: datetime """ return self._date_time @date_time.setter 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 """ @@ -103,32 +103,30 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): @property def map(self): - """ - Gets the map of this MixedPropertiesAndAdditionalPropertiesClass. + """Gets the map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :return: The map of this MixedPropertiesAndAdditionalPropertiesClass. + + :return: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, Animal) """ return self._map @map.setter 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) """ self._map = map def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -149,28 +147,20 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/model_200_response.py b/samples/client/petstore/python-asyncio/petstore_api/models/model_200_response.py index 2b6aeb090c0..60f9c96a676 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/model_200_response.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/model_200_response.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class Model200Response(object): '_class': 'class' } - def __init__(self, name=None, _class=None): - """ - Model200Response - a model defined in Swagger - """ + def __init__(self, name=None, _class=None): # noqa: E501 + """Model200Response - a model defined in Swagger""" # noqa: E501 self._name = None self.__class = None self.discriminator = None if name is not None: - self.name = name + self.name = name if _class is not None: - self._class = _class + self._class = _class @property def name(self): - """ - Gets the name of this Model200Response. + """Gets the name of this Model200Response. # noqa: E501 - :return: The name of this Model200Response. + + :return: The name of this Model200Response. # noqa: E501 :rtype: int """ return self._name @name.setter 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 """ @@ -77,32 +75,30 @@ class Model200Response(object): @property def _class(self): - """ - Gets the _class of this Model200Response. + """Gets the _class of this Model200Response. # noqa: E501 - :return: The _class of this Model200Response. + + :return: The _class of this Model200Response. # noqa: E501 :rtype: str """ return self.__class @_class.setter 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 """ self.__class = _class def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -123,28 +119,20 @@ class Model200Response(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Model200Response): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/model_return.py b/samples/client/petstore/python-asyncio/petstore_api/models/model_return.py index a2160d21dd1..c9d8b5682aa 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/model_return.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/model_return.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class ModelReturn(object): '_return': 'return' } - def __init__(self, _return=None): - """ - ModelReturn - a model defined in Swagger - """ + def __init__(self, _return=None): # noqa: E501 + """ModelReturn - a model defined in Swagger""" # noqa: E501 self.__return = None self.discriminator = None if _return is not None: - self._return = _return + self._return = _return @property def _return(self): - """ - Gets the _return of this ModelReturn. + """Gets the _return of this ModelReturn. # noqa: E501 - :return: The _return of this ModelReturn. + + :return: The _return of this ModelReturn. # noqa: E501 :rtype: int """ return self.__return @_return.setter 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 """ self.__return = _return def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class ModelReturn(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ModelReturn): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/name.py b/samples/client/petstore/python-asyncio/petstore_api/models/name.py index 52b51890dde..cbfbddeb1ab 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/name.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/name.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,10 +44,8 @@ class Name(object): '_123_number': '123Number' } - def __init__(self, name=None, snake_case=None, _property=None, _123_number=None): - """ - Name - a model defined in Swagger - """ + def __init__(self, name=None, snake_case=None, _property=None, _123_number=None): # noqa: E501 + """Name - a model defined in Swagger""" # noqa: E501 self._name = None self._snake_case = None @@ -57,51 +55,51 @@ class Name(object): self.name = name if snake_case is not None: - self.snake_case = snake_case + self.snake_case = snake_case if _property is not None: - self._property = _property + self._property = _property if _123_number is not None: - self._123_number = _123_number + self._123_number = _123_number @property def name(self): - """ - Gets the name of this Name. + """Gets the name of this Name. # noqa: E501 - :return: The name of this Name. + + :return: The name of this Name. # noqa: E501 :rtype: int """ return self._name @name.setter 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 """ 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 @property def snake_case(self): - """ - Gets the snake_case of this Name. + """Gets the snake_case of this Name. # noqa: E501 - :return: The snake_case of this Name. + + :return: The snake_case of this Name. # noqa: E501 :rtype: int """ return self._snake_case @snake_case.setter 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 """ @@ -109,20 +107,20 @@ class Name(object): @property def _property(self): - """ - Gets the _property of this Name. + """Gets the _property of this Name. # noqa: E501 - :return: The _property of this Name. + + :return: The _property of this Name. # noqa: E501 :rtype: str """ return self.__property @_property.setter 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 """ @@ -130,32 +128,30 @@ class Name(object): @property def _123_number(self): - """ - Gets the _123_number of this Name. + """Gets the _123_number of this Name. # noqa: E501 - :return: The _123_number of this Name. + + :return: The _123_number of this Name. # noqa: E501 :rtype: int """ return self.__123_number @_123_number.setter 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 """ self.__123_number = _123_number def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -176,28 +172,20 @@ class Name(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Name): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/number_only.py b/samples/client/petstore/python-asyncio/petstore_api/models/number_only.py index b0e279b53a5..b96321109b9 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/number_only.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/number_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class NumberOnly(object): 'just_number': 'JustNumber' } - def __init__(self, just_number=None): - """ - NumberOnly - a model defined in Swagger - """ + def __init__(self, just_number=None): # noqa: E501 + """NumberOnly - a model defined in Swagger""" # noqa: E501 self._just_number = None self.discriminator = None if just_number is not None: - self.just_number = just_number + self.just_number = just_number @property def just_number(self): - """ - Gets the just_number of this NumberOnly. + """Gets the just_number of this NumberOnly. # noqa: E501 - :return: The just_number of this NumberOnly. + + :return: The just_number of this NumberOnly. # noqa: E501 :rtype: float """ return self._just_number @just_number.setter 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 """ self._just_number = just_number def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class NumberOnly(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, NumberOnly): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/order.py b/samples/client/petstore/python-asyncio/petstore_api/models/order.py index 52c7b6c227e..6636542e941 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/order.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/order.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -48,10 +48,8 @@ class Order(object): 'complete': 'complete' } - def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False): - """ - Order - a model defined in Swagger - """ + 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 self._id = None self._pet_id = None @@ -62,34 +60,34 @@ class Order(object): self.discriminator = None if id is not None: - self.id = id + self.id = id if pet_id is not None: - self.pet_id = pet_id + self.pet_id = pet_id if quantity is not None: - self.quantity = quantity + self.quantity = quantity if ship_date is not None: - self.ship_date = ship_date + self.ship_date = ship_date if status is not None: - self.status = status + self.status = status if complete is not None: - self.complete = complete + self.complete = complete @property def id(self): - """ - Gets the id of this Order. + """Gets the id of this Order. # noqa: E501 - :return: The id of this Order. + + :return: The id of this Order. # noqa: E501 :rtype: int """ return self._id @id.setter 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 """ @@ -97,20 +95,20 @@ class Order(object): @property def pet_id(self): - """ - Gets the pet_id of this Order. + """Gets the pet_id of this Order. # noqa: E501 - :return: The pet_id of this Order. + + :return: The pet_id of this Order. # noqa: E501 :rtype: int """ return self._pet_id @pet_id.setter 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 """ @@ -118,20 +116,20 @@ class Order(object): @property def quantity(self): - """ - Gets the quantity of this Order. + """Gets the quantity of this Order. # noqa: E501 - :return: The quantity of this Order. + + :return: The quantity of this Order. # noqa: E501 :rtype: int """ return self._quantity @quantity.setter 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 """ @@ -139,20 +137,20 @@ class Order(object): @property def ship_date(self): - """ - Gets the ship_date of this Order. + """Gets the ship_date of this Order. # noqa: E501 - :return: The ship_date of this Order. + + :return: The ship_date of this Order. # noqa: E501 :rtype: datetime """ return self._ship_date @ship_date.setter 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 """ @@ -160,28 +158,28 @@ class Order(object): @property def status(self): - """ - Gets the status of this Order. - Order Status + """Gets the status of this Order. # noqa: E501 - :return: The status of this Order. + Order Status # noqa: E501 + + :return: The status of this Order. # noqa: E501 :rtype: str """ return self._status @status.setter def status(self, status): - """ - Sets the status of this Order. - Order Status + """Sets the status of this Order. - :param status: The status of this Order. + Order Status # noqa: E501 + + :param status: The status of this Order. # noqa: E501 :type: str """ - allowed_values = ["placed", "approved", "delivered"] + allowed_values = ["placed", "approved", "delivered"] # noqa: E501 if status not in allowed_values: 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) ) @@ -189,32 +187,30 @@ class Order(object): @property def complete(self): - """ - Gets the complete of this Order. + """Gets the complete of this Order. # noqa: E501 - :return: The complete of this Order. + + :return: The complete of this Order. # noqa: E501 :rtype: bool """ return self._complete @complete.setter 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 """ self._complete = complete def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -235,28 +231,20 @@ class Order(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Order): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/outer_boolean.py b/samples/client/petstore/python-asyncio/petstore_api/models/outer_boolean.py index aa9aee11973..9b3aebd3608 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/outer_boolean.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/outer_boolean.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,28 +31,20 @@ class OuterBoolean(object): and the value is json key in definition. """ swagger_types = { - } attribute_map = { - } - def __init__(self): - """ - OuterBoolean - a model defined in Swagger - """ - + def __init__(self): # noqa: E501 + """OuterBoolean - a model defined in Swagger""" # noqa: E501 self.discriminator = None - def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -73,28 +65,20 @@ class OuterBoolean(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, OuterBoolean): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/outer_composite.py b/samples/client/petstore/python-asyncio/petstore_api/models/outer_composite.py index 81611c17688..19775255e4e 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/outer_composite.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/outer_composite.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,22 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +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): - """ - 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +46,8 @@ class OuterComposite(object): 'my_boolean': 'my_boolean' } - def __init__(self, my_number=None, my_string=None, my_boolean=None): - """ - OuterComposite - a model defined in Swagger - """ + def __init__(self, my_number=None, my_string=None, my_boolean=None): # noqa: E501 + """OuterComposite - a model defined in Swagger""" # noqa: E501 self._my_number = None self._my_string = None @@ -53,28 +55,28 @@ class OuterComposite(object): self.discriminator = None if my_number is not None: - self.my_number = my_number + self.my_number = my_number if my_string is not None: - self.my_string = my_string + self.my_string = my_string if my_boolean is not None: - self.my_boolean = my_boolean + self.my_boolean = my_boolean @property def my_number(self): - """ - Gets the my_number of this OuterComposite. + """Gets the my_number of this OuterComposite. # noqa: E501 - :return: The my_number of this OuterComposite. + + :return: The my_number of this OuterComposite. # noqa: E501 :rtype: OuterNumber """ return self._my_number @my_number.setter 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 """ @@ -82,20 +84,20 @@ class OuterComposite(object): @property def my_string(self): - """ - Gets the my_string of this OuterComposite. + """Gets the my_string of this OuterComposite. # noqa: E501 - :return: The my_string of this OuterComposite. + + :return: The my_string of this OuterComposite. # noqa: E501 :rtype: OuterString """ return self._my_string @my_string.setter 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 """ @@ -103,32 +105,30 @@ class OuterComposite(object): @property def my_boolean(self): - """ - Gets the my_boolean of this OuterComposite. + """Gets the my_boolean of this OuterComposite. # noqa: E501 - :return: The my_boolean of this OuterComposite. + + :return: The my_boolean of this OuterComposite. # noqa: E501 :rtype: OuterBoolean """ return self._my_boolean @my_boolean.setter 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 """ self._my_boolean = my_boolean def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -149,28 +149,20 @@ class OuterComposite(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, OuterComposite): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/outer_enum.py b/samples/client/petstore/python-asyncio/petstore_api/models/outer_enum.py index 8772472c655..5ee1e49a587 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/outer_enum.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/outer_enum.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,14 +11,15 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ @@ -37,28 +38,20 @@ class OuterEnum(object): and the value is json key in definition. """ swagger_types = { - } attribute_map = { - } - def __init__(self): - """ - OuterEnum - a model defined in Swagger - """ - + def __init__(self): # noqa: E501 + """OuterEnum - a model defined in Swagger""" # noqa: E501 self.discriminator = None - def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -79,28 +72,20 @@ class OuterEnum(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, OuterEnum): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/outer_number.py b/samples/client/petstore/python-asyncio/petstore_api/models/outer_number.py index 04c44923fb0..a35587be65e 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/outer_number.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/outer_number.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,28 +31,20 @@ class OuterNumber(object): and the value is json key in definition. """ swagger_types = { - } attribute_map = { - } - def __init__(self): - """ - OuterNumber - a model defined in Swagger - """ - + def __init__(self): # noqa: E501 + """OuterNumber - a model defined in Swagger""" # noqa: E501 self.discriminator = None - def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -73,28 +65,20 @@ class OuterNumber(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, OuterNumber): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/outer_string.py b/samples/client/petstore/python-asyncio/petstore_api/models/outer_string.py index fd2d7c7623e..736edacd1bc 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/outer_string.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/outer_string.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,28 +31,20 @@ class OuterString(object): and the value is json key in definition. """ swagger_types = { - } attribute_map = { - } - def __init__(self): - """ - OuterString - a model defined in Swagger - """ - + def __init__(self): # noqa: E501 + """OuterString - a model defined in Swagger""" # noqa: E501 self.discriminator = None - def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -73,28 +65,20 @@ class OuterString(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, OuterString): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/pet.py b/samples/client/petstore/python-asyncio/petstore_api/models/pet.py index e1afa26f785..81b2bb617f9 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/pet.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/pet.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,21 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +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): - """ - 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -48,10 +51,8 @@ class Pet(object): 'status': 'status' } - def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None): - """ - Pet - a model defined in Swagger - """ + 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 self._id = None self._category = None @@ -62,32 +63,32 @@ class Pet(object): self.discriminator = None if id is not None: - self.id = id + self.id = id if category is not None: - self.category = category + self.category = category self.name = name self.photo_urls = photo_urls if tags is not None: - self.tags = tags + self.tags = tags if status is not None: - self.status = status + self.status = status @property def id(self): - """ - Gets the id of this Pet. + """Gets the id of this Pet. # noqa: E501 - :return: The id of this Pet. + + :return: The id of this Pet. # noqa: E501 :rtype: int """ return self._id @id.setter 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 """ @@ -95,20 +96,20 @@ class Pet(object): @property def category(self): - """ - Gets the category of this Pet. + """Gets the category of this Pet. # noqa: E501 - :return: The category of this Pet. + + :return: The category of this Pet. # noqa: E501 :rtype: Category """ return self._category @category.setter 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 """ @@ -116,66 +117,66 @@ class Pet(object): @property def name(self): - """ - Gets the name of this Pet. + """Gets the name of this Pet. # noqa: E501 - :return: The name of this Pet. + + :return: The name of this Pet. # noqa: E501 :rtype: str """ return self._name @name.setter 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 """ 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 @property def photo_urls(self): - """ - Gets the photo_urls of this Pet. + """Gets the photo_urls of this Pet. # noqa: E501 - :return: The photo_urls of this Pet. + + :return: The photo_urls of this Pet. # noqa: E501 :rtype: list[str] """ return self._photo_urls @photo_urls.setter 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] """ 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 @property def tags(self): - """ - Gets the tags of this Pet. + """Gets the tags of this Pet. # noqa: E501 - :return: The tags of this Pet. + + :return: The tags of this Pet. # noqa: E501 :rtype: list[Tag] """ return self._tags @tags.setter 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] """ @@ -183,40 +184,38 @@ class Pet(object): @property def status(self): - """ - Gets the status of this Pet. - pet status in the store + """Gets the status of this Pet. # noqa: E501 - :return: The status of this Pet. + pet status in the store # noqa: E501 + + :return: The status of this Pet. # noqa: E501 :rtype: str """ return self._status @status.setter def status(self, status): - """ - Sets the status of this Pet. - pet status in the store + """Sets the status of this Pet. - :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 """ - allowed_values = ["available", "pending", "sold"] + allowed_values = ["available", "pending", "sold"] # noqa: E501 if status not in allowed_values: 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) ) self._status = status def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -237,28 +236,20 @@ class Pet(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Pet): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/read_only_first.py b/samples/client/petstore/python-asyncio/petstore_api/models/read_only_first.py index a26d1f33c87..106463077e8 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/read_only_first.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/read_only_first.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class ReadOnlyFirst(object): 'baz': 'baz' } - def __init__(self, bar=None, baz=None): - """ - ReadOnlyFirst - a model defined in Swagger - """ + def __init__(self, bar=None, baz=None): # noqa: E501 + """ReadOnlyFirst - a model defined in Swagger""" # noqa: E501 self._bar = None self._baz = None self.discriminator = None if bar is not None: - self.bar = bar + self.bar = bar if baz is not None: - self.baz = baz + self.baz = baz @property def bar(self): - """ - Gets the bar of this ReadOnlyFirst. + """Gets the bar of this ReadOnlyFirst. # noqa: E501 - :return: The bar of this ReadOnlyFirst. + + :return: The bar of this ReadOnlyFirst. # noqa: E501 :rtype: str """ return self._bar @bar.setter 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 """ @@ -77,32 +75,30 @@ class ReadOnlyFirst(object): @property def baz(self): - """ - Gets the baz of this ReadOnlyFirst. + """Gets the baz of this ReadOnlyFirst. # noqa: E501 - :return: The baz of this ReadOnlyFirst. + + :return: The baz of this ReadOnlyFirst. # noqa: E501 :rtype: str """ return self._baz @baz.setter 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 """ self._baz = baz def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -123,28 +119,20 @@ class ReadOnlyFirst(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ReadOnlyFirst): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/special_model_name.py b/samples/client/petstore/python-asyncio/petstore_api/models/special_model_name.py index 6be888fb9e3..a31b8db66e2 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/special_model_name.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/special_model_name.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class SpecialModelName(object): 'special_property_name': '$special[property.name]' } - def __init__(self, special_property_name=None): - """ - SpecialModelName - a model defined in Swagger - """ + def __init__(self, special_property_name=None): # noqa: E501 + """SpecialModelName - a model defined in Swagger""" # noqa: E501 self._special_property_name = None self.discriminator = None if special_property_name is not None: - self.special_property_name = special_property_name + self.special_property_name = special_property_name @property def special_property_name(self): - """ - Gets the special_property_name of this SpecialModelName. + """Gets the special_property_name of this SpecialModelName. # noqa: E501 - :return: The special_property_name of this SpecialModelName. + + :return: The special_property_name of this SpecialModelName. # noqa: E501 :rtype: int """ return self._special_property_name @special_property_name.setter 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 """ self._special_property_name = special_property_name def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class SpecialModelName(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, SpecialModelName): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/tag.py b/samples/client/petstore/python-asyncio/petstore_api/models/tag.py index d59a490a07d..b486a672b88 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/tag.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/tag.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class Tag(object): 'name': 'name' } - def __init__(self, id=None, name=None): - """ - Tag - a model defined in Swagger - """ + def __init__(self, id=None, name=None): # noqa: E501 + """Tag - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None self.discriminator = None if id is not None: - self.id = id + self.id = id if name is not None: - self.name = name + self.name = name @property def id(self): - """ - Gets the id of this Tag. + """Gets the id of this Tag. # noqa: E501 - :return: The id of this Tag. + + :return: The id of this Tag. # noqa: E501 :rtype: int """ return self._id @id.setter 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 """ @@ -77,32 +75,30 @@ class Tag(object): @property def name(self): - """ - Gets the name of this Tag. + """Gets the name of this Tag. # noqa: E501 - :return: The name of this Tag. + + :return: The name of this Tag. # noqa: E501 :rtype: str """ return self._name @name.setter 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 """ self._name = name def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -123,28 +119,20 @@ class Tag(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Tag): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/user.py b/samples/client/petstore/python-asyncio/petstore_api/models/user.py index 21993e90521..c9fe0072a9c 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/user.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/user.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -52,10 +52,8 @@ class User(object): '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): - """ - User - a model defined in Swagger - """ + 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 self._id = None self._username = None @@ -68,38 +66,38 @@ class User(object): self.discriminator = None if id is not None: - self.id = id + self.id = id if username is not None: - self.username = username + self.username = username if first_name is not None: - self.first_name = first_name + self.first_name = first_name if last_name is not None: - self.last_name = last_name + self.last_name = last_name if email is not None: - self.email = email + self.email = email if password is not None: - self.password = password + self.password = password if phone is not None: - self.phone = phone + self.phone = phone if user_status is not None: - self.user_status = user_status + self.user_status = user_status @property def id(self): - """ - Gets the id of this User. + """Gets the id of this User. # noqa: E501 - :return: The id of this User. + + :return: The id of this User. # noqa: E501 :rtype: int """ return self._id @id.setter 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 """ @@ -107,20 +105,20 @@ class User(object): @property def username(self): - """ - Gets the username of this User. + """Gets the username of this User. # noqa: E501 - :return: The username of this User. + + :return: The username of this User. # noqa: E501 :rtype: str """ return self._username @username.setter 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 """ @@ -128,20 +126,20 @@ class User(object): @property def first_name(self): - """ - Gets the first_name of this User. + """Gets the first_name of this User. # noqa: E501 - :return: The first_name of this User. + + :return: The first_name of this User. # noqa: E501 :rtype: str """ return self._first_name @first_name.setter 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 """ @@ -149,20 +147,20 @@ class User(object): @property def last_name(self): - """ - Gets the last_name of this User. + """Gets the last_name of this User. # noqa: E501 - :return: The last_name of this User. + + :return: The last_name of this User. # noqa: E501 :rtype: str """ return self._last_name @last_name.setter 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 """ @@ -170,20 +168,20 @@ class User(object): @property def email(self): - """ - Gets the email of this User. + """Gets the email of this User. # noqa: E501 - :return: The email of this User. + + :return: The email of this User. # noqa: E501 :rtype: str """ return self._email @email.setter 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 """ @@ -191,20 +189,20 @@ class User(object): @property def password(self): - """ - Gets the password of this User. + """Gets the password of this User. # noqa: E501 - :return: The password of this User. + + :return: The password of this User. # noqa: E501 :rtype: str """ return self._password @password.setter 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 """ @@ -212,20 +210,20 @@ class User(object): @property def phone(self): - """ - Gets the phone of this User. + """Gets the phone of this User. # noqa: E501 - :return: The phone of this User. + + :return: The phone of this User. # noqa: E501 :rtype: str """ return self._phone @phone.setter 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 """ @@ -233,34 +231,32 @@ class User(object): @property def user_status(self): - """ - Gets the user_status of this User. - User Status + """Gets the user_status of this User. # noqa: E501 - :return: The user_status of this User. + User Status # noqa: E501 + + :return: The user_status of this User. # noqa: E501 :rtype: int """ return self._user_status @user_status.setter def user_status(self, user_status): - """ - Sets the user_status of this User. - User Status + """Sets the user_status of this User. - :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 """ self._user_status = user_status def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -281,28 +277,20 @@ class User(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, User): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/rest.py b/samples/client/petstore/python-asyncio/petstore_api/rest.py index 8cb130e035b..497882aaa9f 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/rest.py +++ b/samples/client/petstore/python-asyncio/petstore_api/rest.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,16 +11,15 @@ """ -import aiohttp import io import json -import ssl -import certifi import logging import re +import ssl +import aiohttp +import certifi # python 2 and python 3 compatibility library -from six import PY3 from six.moves.urllib.parse import urlencode logger = logging.getLogger(__name__) @@ -35,22 +34,18 @@ class RESTResponse(io.IOBase): self.data = data def getheaders(self): - """ - Returns a CIMultiDictProxy of the response headers. - """ + """Returns a CIMultiDictProxy of the response headers.""" return self.aiohttp_response.headers def getheader(self, name, default=None): - """ - Returns a given response header. - """ + """Returns a given response header.""" return self.aiohttp_response.headers.get(name, default) -class RESTClientObject: +class RESTClientObject(object): 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 # http://stackoverflow.com/a/23957365/2985775 @@ -62,6 +57,7 @@ class RESTClientObject: ca_certs = certifi.where() ssl_context = ssl.SSLContext() + ssl_context.load_verify_locations(cafile=ca_certs) if configuration.cert_file: ssl_context.load_cert_chain( configuration.cert_file, keyfile=configuration.key_file @@ -69,6 +65,7 @@ class RESTClientObject: connector = aiohttp.TCPConnector( limit=maxsize, + ssl_context=ssl_context, verify_ssl=configuration.verify_ssl ) @@ -84,8 +81,10 @@ class RESTClientObject: ) 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 url: http request url :param query_params: query parameters in the url @@ -94,12 +93,16 @@ class RESTClientObject: :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: this is a non-applicable field for the AiohttpClient. - :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. + :param _preload_content: this is a non-applicable field for + the AiohttpClient. + :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() - 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: raise ValueError( @@ -127,7 +130,7 @@ class RESTClientObject: if body is not None: body = json.dumps(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() for k, v in post_params.items(): data.add_field(k, v) @@ -141,8 +144,9 @@ class RESTClientObject: args["data"] = body else: # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided arguments. - Please check that your arguments match declared content type.""" + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" raise ApiException(status=0, reason=msg) else: args["data"] = query_params @@ -159,22 +163,25 @@ class RESTClientObject: 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, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params)) + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + 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, headers=headers, _preload_content=_preload_content, _request_timeout=_request_timeout, query_params=query_params)) - async def OPTIONS(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + async def OPTIONS(self, url, headers=None, query_params=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): return (await self.request("OPTIONS", url, headers=headers, query_params=query_params, @@ -183,7 +190,8 @@ class RESTClientObject: _request_timeout=_request_timeout, 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, headers=headers, query_params=query_params, @@ -191,8 +199,9 @@ class RESTClientObject: _request_timeout=_request_timeout, body=body)) - async def POST(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + async def POST(self, url, headers=None, query_params=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): return (await self.request("POST", url, headers=headers, query_params=query_params, @@ -201,8 +210,8 @@ class RESTClientObject: _request_timeout=_request_timeout, body=body)) - async def PUT(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + async def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): return (await self.request("PUT", url, headers=headers, query_params=query_params, @@ -211,8 +220,9 @@ class RESTClientObject: _request_timeout=_request_timeout, body=body)) - async def PATCH(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + async def PATCH(self, url, headers=None, query_params=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): return (await self.request("PATCH", url, headers=headers, query_params=query_params, @@ -237,13 +247,11 @@ class ApiException(Exception): self.headers = None def __str__(self): - """ - Custom error messages for exception - """ - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) + """Custom error messages for exception""" + error_message = "({0})\nReason: {1}\n".format(self.status, self.reason) 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: error_message += "HTTP response body: {0}\n".format(self.body) diff --git a/samples/client/petstore/python-asyncio/setup.py b/samples/client/petstore/python-asyncio/setup.py index b04ac0abe10..30a70401fbc 100644 --- a/samples/client/petstore/python-asyncio/setup.py +++ b/samples/client/petstore/python-asyncio/setup.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,8 +11,7 @@ """ -import sys -from setuptools import setup, find_packages +from setuptools import setup, find_packages # noqa: H301 NAME = "petstore-api" VERSION = "1.0.0" @@ -37,6 +36,6 @@ setup( packages=find_packages(), include_package_data=True, 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: \" \\ + 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 """ ) diff --git a/samples/client/petstore/python-asyncio/test/test_additional_properties_class.py b/samples/client/petstore/python-asyncio/test/test_additional_properties_class.py index e90e5f92efc..77ccb73b028 100644 --- a/samples/client/petstore/python-asyncio/test/test_additional_properties_class.py +++ b/samples/client/petstore/python-asyncio/test/test_additional_properties_class.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass class TestAdditionalPropertiesClass(unittest.TestCase): - """ AdditionalPropertiesClass unit test stubs """ + """AdditionalPropertiesClass unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestAdditionalPropertiesClass(unittest.TestCase): pass def testAdditionalPropertiesClass(self): - """ - Test AdditionalPropertiesClass - """ + """Test AdditionalPropertiesClass""" # 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 diff --git a/samples/client/petstore/python-asyncio/test/test_animal.py b/samples/client/petstore/python-asyncio/test/test_animal.py index c675d583ccc..eb5f7cb930e 100644 --- a/samples/client/petstore/python-asyncio/test/test_animal.py +++ b/samples/client/petstore/python-asyncio/test/test_animal.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.animal import Animal # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.animal import Animal class TestAnimal(unittest.TestCase): - """ Animal unit test stubs """ + """Animal unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestAnimal(unittest.TestCase): pass def testAnimal(self): - """ - Test Animal - """ + """Test Animal""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.animal.Animal() + # model = petstore_api.models.animal.Animal() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_animal_farm.py b/samples/client/petstore/python-asyncio/test/test_animal_farm.py index e459318a948..8f79946fa73 100644 --- a/samples/client/petstore/python-asyncio/test/test_animal_farm.py +++ b/samples/client/petstore/python-asyncio/test/test_animal_farm.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.animal_farm import AnimalFarm # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.animal_farm import AnimalFarm class TestAnimalFarm(unittest.TestCase): - """ AnimalFarm unit test stubs """ + """AnimalFarm unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestAnimalFarm(unittest.TestCase): pass def testAnimalFarm(self): - """ - Test AnimalFarm - """ + """Test AnimalFarm""" # 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 diff --git a/samples/client/petstore/python-asyncio/test/test_another_fake_api.py b/samples/client/petstore/python-asyncio/test/test_another_fake_api.py index 9f562fe1134..c294aa90359 100644 --- a/samples/client/petstore/python-asyncio/test/test_another_fake_api.py +++ b/samples/client/petstore/python-asyncio/test/test_another_fake_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,29 +13,26 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.apis.another_fake_api import AnotherFakeApi class TestAnotherFakeApi(unittest.TestCase): - """ AnotherFakeApi unit test stubs """ + """AnotherFakeApi unit test stubs""" 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): pass 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 diff --git a/samples/client/petstore/python-asyncio/test/test_api_response.py b/samples/client/petstore/python-asyncio/test/test_api_response.py index 928af048b43..97ed978a5f6 100644 --- a/samples/client/petstore/python-asyncio/test/test_api_response.py +++ b/samples/client/petstore/python-asyncio/test/test_api_response.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.api_response import ApiResponse # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.api_response import ApiResponse class TestApiResponse(unittest.TestCase): - """ ApiResponse unit test stubs """ + """ApiResponse unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestApiResponse(unittest.TestCase): pass def testApiResponse(self): - """ - Test ApiResponse - """ + """Test ApiResponse""" # 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 diff --git a/samples/client/petstore/python-asyncio/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python-asyncio/test/test_array_of_array_of_number_only.py index 740e45cbafd..b617ed2cd3e 100644 --- a/samples/client/petstore/python-asyncio/test/test_array_of_array_of_number_only.py +++ b/samples/client/petstore/python-asyncio/test/test_array_of_array_of_number_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest 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.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly class TestArrayOfArrayOfNumberOnly(unittest.TestCase): - """ ArrayOfArrayOfNumberOnly unit test stubs """ + """ArrayOfArrayOfNumberOnly unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestArrayOfArrayOfNumberOnly(unittest.TestCase): pass def testArrayOfArrayOfNumberOnly(self): - """ - Test ArrayOfArrayOfNumberOnly - """ + """Test ArrayOfArrayOfNumberOnly""" # 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 diff --git a/samples/client/petstore/python-asyncio/test/test_array_of_number_only.py b/samples/client/petstore/python-asyncio/test/test_array_of_number_only.py index 6da67a490b6..7439364c7b1 100644 --- a/samples/client/petstore/python-asyncio/test/test_array_of_number_only.py +++ b/samples/client/petstore/python-asyncio/test/test_array_of_number_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly class TestArrayOfNumberOnly(unittest.TestCase): - """ ArrayOfNumberOnly unit test stubs """ + """ArrayOfNumberOnly unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestArrayOfNumberOnly(unittest.TestCase): pass def testArrayOfNumberOnly(self): - """ - Test ArrayOfNumberOnly - """ + """Test ArrayOfNumberOnly""" # 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 diff --git a/samples/client/petstore/python-asyncio/test/test_array_test.py b/samples/client/petstore/python-asyncio/test/test_array_test.py index dcf8cc111c0..d7feb2ac8f4 100644 --- a/samples/client/petstore/python-asyncio/test/test_array_test.py +++ b/samples/client/petstore/python-asyncio/test/test_array_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.array_test import ArrayTest # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.array_test import ArrayTest class TestArrayTest(unittest.TestCase): - """ ArrayTest unit test stubs """ + """ArrayTest unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestArrayTest(unittest.TestCase): pass def testArrayTest(self): - """ - Test ArrayTest - """ + """Test ArrayTest""" # 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 diff --git a/samples/client/petstore/python-asyncio/test/test_capitalization.py b/samples/client/petstore/python-asyncio/test/test_capitalization.py index 4ea6d2e3fd0..4ac874e817c 100644 --- a/samples/client/petstore/python-asyncio/test/test_capitalization.py +++ b/samples/client/petstore/python-asyncio/test/test_capitalization.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.capitalization import Capitalization # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.capitalization import Capitalization class TestCapitalization(unittest.TestCase): - """ Capitalization unit test stubs """ + """Capitalization unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestCapitalization(unittest.TestCase): pass def testCapitalization(self): - """ - Test Capitalization - """ + """Test Capitalization""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.capitalization.Capitalization() + # model = petstore_api.models.capitalization.Capitalization() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_cat.py b/samples/client/petstore/python-asyncio/test/test_cat.py index 9d9fbc50ab3..370f1081383 100644 --- a/samples/client/petstore/python-asyncio/test/test_cat.py +++ b/samples/client/petstore/python-asyncio/test/test_cat.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.cat import Cat # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.cat import Cat class TestCat(unittest.TestCase): - """ Cat unit test stubs """ + """Cat unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestCat(unittest.TestCase): pass def testCat(self): - """ - Test Cat - """ + """Test Cat""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.cat.Cat() + # model = petstore_api.models.cat.Cat() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_category.py b/samples/client/petstore/python-asyncio/test/test_category.py index 6ded8f0f1ac..7a9e40a1f65 100644 --- a/samples/client/petstore/python-asyncio/test/test_category.py +++ b/samples/client/petstore/python-asyncio/test/test_category.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.category import Category # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.category import Category class TestCategory(unittest.TestCase): - """ Category unit test stubs """ + """Category unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestCategory(unittest.TestCase): pass def testCategory(self): - """ - Test Category - """ + """Test Category""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.category.Category() + # model = petstore_api.models.category.Category() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_class_model.py b/samples/client/petstore/python-asyncio/test/test_class_model.py index 85d56bbe52a..a42127abf50 100644 --- a/samples/client/petstore/python-asyncio/test/test_class_model.py +++ b/samples/client/petstore/python-asyncio/test/test_class_model.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.class_model import ClassModel # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.class_model import ClassModel class TestClassModel(unittest.TestCase): - """ ClassModel unit test stubs """ + """ClassModel unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestClassModel(unittest.TestCase): pass def testClassModel(self): - """ - Test ClassModel - """ + """Test ClassModel""" # 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 diff --git a/samples/client/petstore/python-asyncio/test/test_client.py b/samples/client/petstore/python-asyncio/test/test_client.py index 363ced2923c..81df726dbfc 100644 --- a/samples/client/petstore/python-asyncio/test/test_client.py +++ b/samples/client/petstore/python-asyncio/test/test_client.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.client import Client # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.client import Client class TestClient(unittest.TestCase): - """ Client unit test stubs """ + """Client unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestClient(unittest.TestCase): pass def testClient(self): - """ - Test Client - """ + """Test Client""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.client.Client() + # model = petstore_api.models.client.Client() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_dog.py b/samples/client/petstore/python-asyncio/test/test_dog.py index b0428646591..ae13869b99f 100644 --- a/samples/client/petstore/python-asyncio/test/test_dog.py +++ b/samples/client/petstore/python-asyncio/test/test_dog.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.dog import Dog # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.dog import Dog class TestDog(unittest.TestCase): - """ Dog unit test stubs """ + """Dog unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestDog(unittest.TestCase): pass def testDog(self): - """ - Test Dog - """ + """Test Dog""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.dog.Dog() + # model = petstore_api.models.dog.Dog() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_enum_arrays.py b/samples/client/petstore/python-asyncio/test/test_enum_arrays.py index 2803f17aede..144e48883e5 100644 --- a/samples/client/petstore/python-asyncio/test/test_enum_arrays.py +++ b/samples/client/petstore/python-asyncio/test/test_enum_arrays.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.enum_arrays import EnumArrays # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.enum_arrays import EnumArrays class TestEnumArrays(unittest.TestCase): - """ EnumArrays unit test stubs """ + """EnumArrays unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestEnumArrays(unittest.TestCase): pass def testEnumArrays(self): - """ - Test EnumArrays - """ + """Test EnumArrays""" # 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 diff --git a/samples/client/petstore/python-asyncio/test/test_enum_class.py b/samples/client/petstore/python-asyncio/test/test_enum_class.py index f673e741f84..a47581d2820 100644 --- a/samples/client/petstore/python-asyncio/test/test_enum_class.py +++ b/samples/client/petstore/python-asyncio/test/test_enum_class.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.enum_class import EnumClass # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.enum_class import EnumClass class TestEnumClass(unittest.TestCase): - """ EnumClass unit test stubs """ + """EnumClass unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestEnumClass(unittest.TestCase): pass def testEnumClass(self): - """ - Test EnumClass - """ + """Test EnumClass""" # 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 diff --git a/samples/client/petstore/python-asyncio/test/test_enum_test.py b/samples/client/petstore/python-asyncio/test/test_enum_test.py index e27c0107fd2..7487efe9fa1 100644 --- a/samples/client/petstore/python-asyncio/test/test_enum_test.py +++ b/samples/client/petstore/python-asyncio/test/test_enum_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.enum_test import EnumTest # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.enum_test import EnumTest class TestEnumTest(unittest.TestCase): - """ EnumTest unit test stubs """ + """EnumTest unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestEnumTest(unittest.TestCase): pass def testEnumTest(self): - """ - Test EnumTest - """ + """Test EnumTest""" # 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 diff --git a/samples/client/petstore/python-asyncio/test/test_fake_api.py b/samples/client/petstore/python-asyncio/test/test_fake_api.py index 55a02cf899c..00473d4a13b 100644 --- a/samples/client/petstore/python-asyncio/test/test_fake_api.py +++ b/samples/client/petstore/python-asyncio/test/test_fake_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,85 +13,78 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.api.fake_api import FakeApi # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.apis.fake_api import FakeApi class TestFakeApi(unittest.TestCase): - """ FakeApi unit test stubs """ + """FakeApi unit test stubs""" def setUp(self): - self.api = petstore_api.apis.fake_api.FakeApi() + self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501 def tearDown(self): pass def test_fake_outer_boolean_serialize(self): - """ - Test case for fake_outer_boolean_serialize + """Test case for fake_outer_boolean_serialize - """ pass def test_fake_outer_composite_serialize(self): - """ - Test case for fake_outer_composite_serialize + """Test case for fake_outer_composite_serialize - """ pass def test_fake_outer_number_serialize(self): - """ - Test case for fake_outer_number_serialize + """Test case for fake_outer_number_serialize - """ pass def test_fake_outer_string_serialize(self): - """ - Test case for fake_outer_string_serialize + """Test case for fake_outer_string_serialize - """ pass 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 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 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 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 diff --git a/samples/client/petstore/python-asyncio/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python-asyncio/test/test_fake_classname_tags_123_api.py index 7a11a2378bf..8f40062a929 100644 --- a/samples/client/petstore/python-asyncio/test/test_fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-asyncio/test/test_fake_classname_tags_123_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,29 +13,26 @@ from __future__ import absolute_import -import os -import sys import unittest 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.apis.fake_classname_tags_123_api import FakeClassnameTags123Api class TestFakeClassnameTags123Api(unittest.TestCase): - """ FakeClassnameTags123Api unit test stubs """ + """FakeClassnameTags123Api unit test stubs""" 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): pass 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 diff --git a/samples/client/petstore/python-asyncio/test/test_format_test.py b/samples/client/petstore/python-asyncio/test/test_format_test.py index ad028c0b431..59809b9f442 100644 --- a/samples/client/petstore/python-asyncio/test/test_format_test.py +++ b/samples/client/petstore/python-asyncio/test/test_format_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.format_test import FormatTest # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.format_test import FormatTest class TestFormatTest(unittest.TestCase): - """ FormatTest unit test stubs """ + """FormatTest unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestFormatTest(unittest.TestCase): pass def testFormatTest(self): - """ - Test FormatTest - """ + """Test FormatTest""" # 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 diff --git a/samples/client/petstore/python-asyncio/test/test_has_only_read_only.py b/samples/client/petstore/python-asyncio/test/test_has_only_read_only.py index af029f26814..26d14aef1f8 100644 --- a/samples/client/petstore/python-asyncio/test/test_has_only_read_only.py +++ b/samples/client/petstore/python-asyncio/test/test_has_only_read_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.has_only_read_only import HasOnlyReadOnly class TestHasOnlyReadOnly(unittest.TestCase): - """ HasOnlyReadOnly unit test stubs """ + """HasOnlyReadOnly unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestHasOnlyReadOnly(unittest.TestCase): pass def testHasOnlyReadOnly(self): - """ - Test HasOnlyReadOnly - """ + """Test HasOnlyReadOnly""" # 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 diff --git a/samples/client/petstore/python-asyncio/test/test_list.py b/samples/client/petstore/python-asyncio/test/test_list.py index 14400e35281..c2cca419f37 100644 --- a/samples/client/petstore/python-asyncio/test/test_list.py +++ b/samples/client/petstore/python-asyncio/test/test_list.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.list import List # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.list import List class TestList(unittest.TestCase): - """ List unit test stubs """ + """List unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestList(unittest.TestCase): pass def testList(self): - """ - Test List - """ + """Test List""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.list.List() + # model = petstore_api.models.list.List() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_map_test.py b/samples/client/petstore/python-asyncio/test/test_map_test.py index c4b2092f0ce..155797d9b2d 100644 --- a/samples/client/petstore/python-asyncio/test/test_map_test.py +++ b/samples/client/petstore/python-asyncio/test/test_map_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.map_test import MapTest # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.map_test import MapTest class TestMapTest(unittest.TestCase): - """ MapTest unit test stubs """ + """MapTest unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestMapTest(unittest.TestCase): pass def testMapTest(self): - """ - Test MapTest - """ + """Test MapTest""" # 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 diff --git a/samples/client/petstore/python-asyncio/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-asyncio/test/test_mixed_properties_and_additional_properties_class.py index f614d36da8a..12a56764080 100644 --- a/samples/client/petstore/python-asyncio/test/test_mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-asyncio/test/test_mixed_properties_and_additional_properties_class.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest 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.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): - """ MixedPropertiesAndAdditionalPropertiesClass unit test stubs """ + """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): pass def testMixedPropertiesAndAdditionalPropertiesClass(self): - """ - Test MixedPropertiesAndAdditionalPropertiesClass - """ + """Test MixedPropertiesAndAdditionalPropertiesClass""" # 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 diff --git a/samples/client/petstore/python-asyncio/test/test_model_200_response.py b/samples/client/petstore/python-asyncio/test/test_model_200_response.py index f202a2d454f..f577dd42144 100644 --- a/samples/client/petstore/python-asyncio/test/test_model_200_response.py +++ b/samples/client/petstore/python-asyncio/test/test_model_200_response.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.model_200_response import Model200Response # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.model_200_response import Model200Response class TestModel200Response(unittest.TestCase): - """ Model200Response unit test stubs """ + """Model200Response unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestModel200Response(unittest.TestCase): pass def testModel200Response(self): - """ - Test Model200Response - """ + """Test Model200Response""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.model_200_response.Model200Response() + # model = petstore_api.models.model_200_response.Model200Response() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_model_return.py b/samples/client/petstore/python-asyncio/test/test_model_return.py index 347c8e4d7cb..64cf27f63ab 100644 --- a/samples/client/petstore/python-asyncio/test/test_model_return.py +++ b/samples/client/petstore/python-asyncio/test/test_model_return.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.model_return import ModelReturn # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.model_return import ModelReturn class TestModelReturn(unittest.TestCase): - """ ModelReturn unit test stubs """ + """ModelReturn unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestModelReturn(unittest.TestCase): pass def testModelReturn(self): - """ - Test ModelReturn - """ + """Test ModelReturn""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.model_return.ModelReturn() + # model = petstore_api.models.model_return.ModelReturn() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_name.py b/samples/client/petstore/python-asyncio/test/test_name.py index c06e35427f6..beba143f39c 100644 --- a/samples/client/petstore/python-asyncio/test/test_name.py +++ b/samples/client/petstore/python-asyncio/test/test_name.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.name import Name # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.name import Name class TestName(unittest.TestCase): - """ Name unit test stubs """ + """Name unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestName(unittest.TestCase): pass def testName(self): - """ - Test Name - """ + """Test Name""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.name.Name() + # model = petstore_api.models.name.Name() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_number_only.py b/samples/client/petstore/python-asyncio/test/test_number_only.py index db3197a9e5b..f2600c79526 100644 --- a/samples/client/petstore/python-asyncio/test/test_number_only.py +++ b/samples/client/petstore/python-asyncio/test/test_number_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.number_only import NumberOnly # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.number_only import NumberOnly class TestNumberOnly(unittest.TestCase): - """ NumberOnly unit test stubs """ + """NumberOnly unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestNumberOnly(unittest.TestCase): pass def testNumberOnly(self): - """ - Test NumberOnly - """ + """Test NumberOnly""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.number_only.NumberOnly() + # model = petstore_api.models.number_only.NumberOnly() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_order.py b/samples/client/petstore/python-asyncio/test/test_order.py index d911487ce97..ed4f8c7d161 100644 --- a/samples/client/petstore/python-asyncio/test/test_order.py +++ b/samples/client/petstore/python-asyncio/test/test_order.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.order import Order # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.order import Order class TestOrder(unittest.TestCase): - """ Order unit test stubs """ + """Order unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestOrder(unittest.TestCase): pass def testOrder(self): - """ - Test Order - """ + """Test Order""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.order.Order() + # model = petstore_api.models.order.Order() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_outer_boolean.py b/samples/client/petstore/python-asyncio/test/test_outer_boolean.py index 9474ab76968..4a7e446693e 100644 --- a/samples/client/petstore/python-asyncio/test/test_outer_boolean.py +++ b/samples/client/petstore/python-asyncio/test/test_outer_boolean.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.outer_boolean import OuterBoolean # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.outer_boolean import OuterBoolean class TestOuterBoolean(unittest.TestCase): - """ OuterBoolean unit test stubs """ + """OuterBoolean unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestOuterBoolean(unittest.TestCase): pass def testOuterBoolean(self): - """ - Test OuterBoolean - """ + """Test OuterBoolean""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.outer_boolean.OuterBoolean() + # model = petstore_api.models.outer_boolean.OuterBoolean() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_outer_composite.py b/samples/client/petstore/python-asyncio/test/test_outer_composite.py index ebbd9d03e6f..e444e695fe8 100644 --- a/samples/client/petstore/python-asyncio/test/test_outer_composite.py +++ b/samples/client/petstore/python-asyncio/test/test_outer_composite.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.outer_composite import OuterComposite # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.outer_composite import OuterComposite class TestOuterComposite(unittest.TestCase): - """ OuterComposite unit test stubs """ + """OuterComposite unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestOuterComposite(unittest.TestCase): pass def testOuterComposite(self): - """ - Test OuterComposite - """ + """Test OuterComposite""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.outer_composite.OuterComposite() + # model = petstore_api.models.outer_composite.OuterComposite() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_outer_enum.py b/samples/client/petstore/python-asyncio/test/test_outer_enum.py index c6e1f030ef1..e3fb15e1b6b 100644 --- a/samples/client/petstore/python-asyncio/test/test_outer_enum.py +++ b/samples/client/petstore/python-asyncio/test/test_outer_enum.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.outer_enum import OuterEnum # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.outer_enum import OuterEnum class TestOuterEnum(unittest.TestCase): - """ OuterEnum unit test stubs """ + """OuterEnum unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestOuterEnum(unittest.TestCase): pass def testOuterEnum(self): - """ - Test OuterEnum - """ + """Test OuterEnum""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.outer_enum.OuterEnum() + # model = petstore_api.models.outer_enum.OuterEnum() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_outer_number.py b/samples/client/petstore/python-asyncio/test/test_outer_number.py index 9f97b407047..da5d3ceee61 100644 --- a/samples/client/petstore/python-asyncio/test/test_outer_number.py +++ b/samples/client/petstore/python-asyncio/test/test_outer_number.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.outer_number import OuterNumber # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.outer_number import OuterNumber class TestOuterNumber(unittest.TestCase): - """ OuterNumber unit test stubs """ + """OuterNumber unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestOuterNumber(unittest.TestCase): pass def testOuterNumber(self): - """ - Test OuterNumber - """ + """Test OuterNumber""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.outer_number.OuterNumber() + # model = petstore_api.models.outer_number.OuterNumber() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_outer_string.py b/samples/client/petstore/python-asyncio/test/test_outer_string.py index b0ac85ed934..02b4967e3b9 100644 --- a/samples/client/petstore/python-asyncio/test/test_outer_string.py +++ b/samples/client/petstore/python-asyncio/test/test_outer_string.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.outer_string import OuterString # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.outer_string import OuterString class TestOuterString(unittest.TestCase): - """ OuterString unit test stubs """ + """OuterString unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestOuterString(unittest.TestCase): pass def testOuterString(self): - """ - Test OuterString - """ + """Test OuterString""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.outer_string.OuterString() + # model = petstore_api.models.outer_string.OuterString() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_pet.py b/samples/client/petstore/python-asyncio/test/test_pet.py index c3e8191bec3..d8df24f92b1 100644 --- a/samples/client/petstore/python-asyncio/test/test_pet.py +++ b/samples/client/petstore/python-asyncio/test/test_pet.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.pet import Pet # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.pet import Pet class TestPet(unittest.TestCase): - """ Pet unit test stubs """ + """Pet unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestPet(unittest.TestCase): pass def testPet(self): - """ - Test Pet - """ + """Test Pet""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.pet.Pet() + # model = petstore_api.models.pet.Pet() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_pet_api.py b/samples/client/petstore/python-asyncio/test/test_pet_api.py index 1eafc35b28c..1e2dd1c42b6 100644 --- a/samples/client/petstore/python-asyncio/test/test_pet_api.py +++ b/samples/client/petstore/python-asyncio/test/test_pet_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,85 +13,75 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.api.pet_api import PetApi # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.apis.pet_api import PetApi class TestPetApi(unittest.TestCase): - """ PetApi unit test stubs """ + """PetApi unit test stubs""" def setUp(self): - self.api = petstore_api.apis.pet_api.PetApi() + self.api = petstore_api.api.pet_api.PetApi() # noqa: E501 def tearDown(self): pass def test_add_pet(self): - """ - Test case for add_pet + """Test case for add_pet - Add a new pet to the store + Add a new pet to the store # noqa: E501 """ pass def test_delete_pet(self): - """ - Test case for delete_pet + """Test case for delete_pet - Deletes a pet + Deletes a pet # noqa: E501 """ pass def test_find_pets_by_status(self): - """ - Test case for find_pets_by_status + """Test case for find_pets_by_status - Finds Pets by status + Finds Pets by status # noqa: E501 """ pass def test_find_pets_by_tags(self): - """ - Test case for find_pets_by_tags + """Test case for find_pets_by_tags - Finds Pets by tags + Finds Pets by tags # noqa: E501 """ pass def test_get_pet_by_id(self): - """ - Test case for get_pet_by_id + """Test case for get_pet_by_id - Find pet by ID + Find pet by ID # noqa: E501 """ pass def test_update_pet(self): - """ - Test case for update_pet + """Test case for update_pet - Update an existing pet + Update an existing pet # noqa: E501 """ pass def test_update_pet_with_form(self): - """ - Test case for update_pet_with_form + """Test case for update_pet_with_form - Updates a pet in the store with form data + Updates a pet in the store with form data # noqa: E501 """ pass def test_upload_file(self): - """ - Test case for upload_file + """Test case for upload_file - uploads an image + uploads an image # noqa: E501 """ pass diff --git a/samples/client/petstore/python-asyncio/test/test_read_only_first.py b/samples/client/petstore/python-asyncio/test/test_read_only_first.py index c89d5d3b6a1..94bf3d127de 100644 --- a/samples/client/petstore/python-asyncio/test/test_read_only_first.py +++ b/samples/client/petstore/python-asyncio/test/test_read_only_first.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.read_only_first import ReadOnlyFirst class TestReadOnlyFirst(unittest.TestCase): - """ ReadOnlyFirst unit test stubs """ + """ReadOnlyFirst unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestReadOnlyFirst(unittest.TestCase): pass def testReadOnlyFirst(self): - """ - Test ReadOnlyFirst - """ + """Test ReadOnlyFirst""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.read_only_first.ReadOnlyFirst() + # model = petstore_api.models.read_only_first.ReadOnlyFirst() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_special_model_name.py b/samples/client/petstore/python-asyncio/test/test_special_model_name.py index d9fa392c36b..002f660cc26 100644 --- a/samples/client/petstore/python-asyncio/test/test_special_model_name.py +++ b/samples/client/petstore/python-asyncio/test/test_special_model_name.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.special_model_name import SpecialModelName # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.special_model_name import SpecialModelName class TestSpecialModelName(unittest.TestCase): - """ SpecialModelName unit test stubs """ + """SpecialModelName unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestSpecialModelName(unittest.TestCase): pass def testSpecialModelName(self): - """ - Test SpecialModelName - """ + """Test SpecialModelName""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.special_model_name.SpecialModelName() + # model = petstore_api.models.special_model_name.SpecialModelName() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_store_api.py b/samples/client/petstore/python-asyncio/test/test_store_api.py index f131b6068b2..537c1bc03f1 100644 --- a/samples/client/petstore/python-asyncio/test/test_store_api.py +++ b/samples/client/petstore/python-asyncio/test/test_store_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,53 +13,47 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.api.store_api import StoreApi # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.apis.store_api import StoreApi class TestStoreApi(unittest.TestCase): - """ StoreApi unit test stubs """ + """StoreApi unit test stubs""" def setUp(self): - self.api = petstore_api.apis.store_api.StoreApi() + self.api = petstore_api.api.store_api.StoreApi() # noqa: E501 def tearDown(self): pass def test_delete_order(self): - """ - Test case for delete_order + """Test case for delete_order - Delete purchase order by ID + Delete purchase order by ID # noqa: E501 """ pass def test_get_inventory(self): - """ - Test case for get_inventory + """Test case for get_inventory - Returns pet inventories by status + Returns pet inventories by status # noqa: E501 """ pass def test_get_order_by_id(self): - """ - Test case for get_order_by_id + """Test case for get_order_by_id - Find purchase order by ID + Find purchase order by ID # noqa: E501 """ pass def test_place_order(self): - """ - Test case for place_order + """Test case for place_order - Place an order for a pet + Place an order for a pet # noqa: E501 """ pass diff --git a/samples/client/petstore/python-asyncio/test/test_tag.py b/samples/client/petstore/python-asyncio/test/test_tag.py index 76f79932c96..e9bc1d471d1 100644 --- a/samples/client/petstore/python-asyncio/test/test_tag.py +++ b/samples/client/petstore/python-asyncio/test/test_tag.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.tag import Tag # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.tag import Tag class TestTag(unittest.TestCase): - """ Tag unit test stubs """ + """Tag unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestTag(unittest.TestCase): pass def testTag(self): - """ - Test Tag - """ + """Test Tag""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.tag.Tag() + # model = petstore_api.models.tag.Tag() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_user.py b/samples/client/petstore/python-asyncio/test/test_user.py index 82f5d9058b0..3575746c00f 100644 --- a/samples/client/petstore/python-asyncio/test/test_user.py +++ b/samples/client/petstore/python-asyncio/test/test_user.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.user import User # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.user import User class TestUser(unittest.TestCase): - """ User unit test stubs """ + """User unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestUser(unittest.TestCase): pass def testUser(self): - """ - Test User - """ + """Test User""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.user.User() + # model = petstore_api.models.user.User() # noqa: E501 pass diff --git a/samples/client/petstore/python-asyncio/test/test_user_api.py b/samples/client/petstore/python-asyncio/test/test_user_api.py index 3e0be964a2d..4ebd90f95e2 100644 --- a/samples/client/petstore/python-asyncio/test/test_user_api.py +++ b/samples/client/petstore/python-asyncio/test/test_user_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,85 +13,75 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.api.user_api import UserApi # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.apis.user_api import UserApi class TestUserApi(unittest.TestCase): - """ UserApi unit test stubs """ + """UserApi unit test stubs""" def setUp(self): - self.api = petstore_api.apis.user_api.UserApi() + self.api = petstore_api.api.user_api.UserApi() # noqa: E501 def tearDown(self): pass def test_create_user(self): - """ - Test case for create_user + """Test case for create_user - Create user + Create user # noqa: E501 """ pass def test_create_users_with_array_input(self): - """ - Test case for create_users_with_array_input + """Test case for create_users_with_array_input - Creates list of users with given input array + Creates list of users with given input array # noqa: E501 """ pass def test_create_users_with_list_input(self): - """ - Test case for create_users_with_list_input + """Test case for create_users_with_list_input - Creates list of users with given input array + Creates list of users with given input array # noqa: E501 """ pass def test_delete_user(self): - """ - Test case for delete_user + """Test case for delete_user - Delete user + Delete user # noqa: E501 """ pass def test_get_user_by_name(self): - """ - Test case for get_user_by_name + """Test case for get_user_by_name - Get user by user name + Get user by user name # noqa: E501 """ pass def test_login_user(self): - """ - Test case for login_user + """Test case for login_user - Logs user into the system + Logs user into the system # noqa: E501 """ pass def test_logout_user(self): - """ - Test case for logout_user + """Test case for logout_user - Logs out current logged in user session + Logs out current logged in user session # noqa: E501 """ pass def test_update_user(self): - """ - Test case for update_user + """Test case for update_user - Updated user + Updated user # noqa: E501 """ pass diff --git a/samples/client/petstore/python-tornado/README.md b/samples/client/petstore/python-tornado/README.md index 87f80990fc5..a49d99c556c 100644 --- a/samples/client/petstore/python-tornado/README.md +++ b/samples/client/petstore/python-tornado/README.md @@ -77,6 +77,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model *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_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 *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 diff --git a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python-tornado/docs/AdditionalPropertiesClass.md index ea12f270f02..796a789d4c4 100644 --- a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/python-tornado/docs/AdditionalPropertiesClass.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **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) diff --git a/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md b/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md index b78fcf86f43..3d70f7a2875 100644 --- a/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md @@ -14,7 +14,7 @@ To test special tags To test special tags -### Example +### Example ```python from __future__ import print_function import time @@ -26,7 +26,7 @@ from pprint import pprint api_instance = petstore_api.AnotherFakeApi() body = petstore_api.Client() # Client | client model -try: +try: # To test special tags api_response = api_instance.test_special_tags(body) pprint(api_response) diff --git a/samples/client/petstore/python-tornado/docs/FakeApi.md b/samples/client/petstore/python-tornado/docs/FakeApi.md index eb669540e53..b910ba2b464 100644 --- a/samples/client/petstore/python-tornado/docs/FakeApi.md +++ b/samples/client/petstore/python-tornado/docs/FakeApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model [**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_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 @@ -21,7 +22,7 @@ Method | HTTP request | Description Test serialization of outer boolean types -### Example +### Example ```python from __future__ import print_function import time @@ -33,7 +34,7 @@ from pprint import pprint api_instance = petstore_api.FakeApi() body = petstore_api.OuterBoolean() # OuterBoolean | Input boolean as post body (optional) -try: +try: api_response = api_instance.fake_outer_boolean_serialize(body=body) pprint(api_response) except ApiException as e: @@ -68,7 +69,7 @@ No authorization required Test serialization of object with outer number type -### Example +### Example ```python from __future__ import print_function import time @@ -80,7 +81,7 @@ from pprint import pprint api_instance = petstore_api.FakeApi() body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) -try: +try: api_response = api_instance.fake_outer_composite_serialize(body=body) pprint(api_response) except ApiException as e: @@ -115,7 +116,7 @@ No authorization required Test serialization of outer number types -### Example +### Example ```python from __future__ import print_function import time @@ -127,7 +128,7 @@ from pprint import pprint api_instance = petstore_api.FakeApi() body = petstore_api.OuterNumber() # OuterNumber | Input number as post body (optional) -try: +try: api_response = api_instance.fake_outer_number_serialize(body=body) pprint(api_response) except ApiException as e: @@ -162,7 +163,7 @@ No authorization required Test serialization of outer string types -### Example +### Example ```python from __future__ import print_function import time @@ -174,7 +175,7 @@ from pprint import pprint api_instance = petstore_api.FakeApi() body = petstore_api.OuterString() # OuterString | Input string as post body (optional) -try: +try: api_response = api_instance.fake_outer_string_serialize(body=body) pprint(api_response) except ApiException as e: @@ -209,7 +210,7 @@ To test \"client\" model To test \"client\" model -### Example +### Example ```python from __future__ import print_function import time @@ -221,7 +222,7 @@ from pprint import pprint api_instance = petstore_api.FakeApi() body = petstore_api.Client() # Client | client model -try: +try: # To test \"client\" model api_response = api_instance.test_client_model(body) pprint(api_response) @@ -257,7 +258,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -### Example +### Example ```python from __future__ import print_function import time @@ -287,7 +288,7 @@ date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) password = 'password_example' # str | None (optional) param_callback = 'param_callback_example' # str | None (optional) -try: +try: # 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) except ApiException as e: @@ -335,7 +336,7 @@ To test enum parameters To test enum parameters -### Example +### Example ```python from __future__ import print_function 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_double = 1.2 # float | Query parameter enum test (double) (optional) -try: +try: # 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) 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) +# **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(param, param2) @@ -396,7 +444,7 @@ test json serialization of form data -### Example +### Example ```python from __future__ import print_function import time @@ -409,7 +457,7 @@ api_instance = petstore_api.FakeApi() param = 'param_example' # str | field1 param2 = 'param2_example' # str | field2 -try: +try: # test json serialization of form data api_instance.test_json_form_data(param, param2) except ApiException as e: diff --git a/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md index a103a4ee327..2546c09ca4a 100644 --- a/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md @@ -12,7 +12,7 @@ Method | HTTP request | Description To test class name in snake case -### Example +### Example ```python from __future__ import print_function import time @@ -30,7 +30,7 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY' api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration)) body = petstore_api.Client() # Client | client model -try: +try: # To test class name in snake case api_response = api_instance.test_classname(body) pprint(api_response) diff --git a/samples/client/petstore/python-tornado/docs/MapTest.md b/samples/client/petstore/python-tornado/docs/MapTest.md index 63cdab0374a..68844755d42 100644 --- a/samples/client/petstore/python-tornado/docs/MapTest.md +++ b/samples/client/petstore/python-tornado/docs/MapTest.md @@ -3,7 +3,7 @@ ## Properties 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] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-tornado/docs/PetApi.md b/samples/client/petstore/python-tornado/docs/PetApi.md index 74c6a5196fd..53b9158e699 100644 --- a/samples/client/petstore/python-tornado/docs/PetApi.md +++ b/samples/client/petstore/python-tornado/docs/PetApi.md @@ -21,7 +21,7 @@ Add a new pet to the store -### Example +### Example ```python from __future__ import print_function import time @@ -37,7 +37,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store -try: +try: # Add a new pet to the store api_instance.add_pet(body) except ApiException as e: @@ -72,7 +72,7 @@ Deletes a pet -### Example +### Example ```python from __future__ import print_function import time @@ -89,7 +89,7 @@ api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) pet_id = 789 # int | Pet id to delete api_key = 'api_key_example' # str | (optional) -try: +try: # Deletes a pet api_instance.delete_pet(pet_id, api_key=api_key) except ApiException as e: @@ -125,7 +125,7 @@ Finds Pets by status Multiple status values can be provided with comma separated strings -### Example +### Example ```python from __future__ import print_function import time @@ -141,7 +141,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) status = ['status_example'] # list[str] | Status values that need to be considered for filter -try: +try: # Finds Pets by status api_response = api_instance.find_pets_by_status(status) 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. -### Example +### Example ```python from __future__ import print_function import time @@ -193,7 +193,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) tags = ['tags_example'] # list[str] | Tags to filter by -try: +try: # Finds Pets by tags api_response = api_instance.find_pets_by_tags(tags) pprint(api_response) @@ -229,7 +229,7 @@ Find pet by ID Returns a single pet -### Example +### Example ```python from __future__ import print_function import time @@ -247,7 +247,7 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY' api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) pet_id = 789 # int | ID of pet to return -try: +try: # Find pet by ID api_response = api_instance.get_pet_by_id(pet_id) pprint(api_response) @@ -283,7 +283,7 @@ Update an existing pet -### Example +### Example ```python from __future__ import print_function import time @@ -299,7 +299,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store -try: +try: # Update an existing pet api_instance.update_pet(body) except ApiException as e: @@ -334,7 +334,7 @@ Updates a pet in the store with form data -### Example +### Example ```python from __future__ import print_function 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) status = 'status_example' # str | Updated status of the pet (optional) -try: +try: # Updates a pet in the store with form data api_instance.update_pet_with_form(pet_id, name=name, status=status) except ApiException as e: @@ -389,7 +389,7 @@ uploads an image -### Example +### Example ```python from __future__ import print_function 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) file = '/path/to/file.txt' # file | file to upload (optional) -try: +try: # uploads an image api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) pprint(api_response) diff --git a/samples/client/petstore/python-tornado/docs/StoreApi.md b/samples/client/petstore/python-tornado/docs/StoreApi.md index a75113975ef..6cbb6b45145 100644 --- a/samples/client/petstore/python-tornado/docs/StoreApi.md +++ b/samples/client/petstore/python-tornado/docs/StoreApi.md @@ -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 -### Example +### Example ```python from __future__ import print_function import time @@ -29,7 +29,7 @@ from pprint import pprint api_instance = petstore_api.StoreApi() order_id = 'order_id_example' # str | ID of the order that needs to be deleted -try: +try: # Delete purchase order by ID api_instance.delete_order(order_id) except ApiException as e: @@ -64,7 +64,7 @@ Returns pet inventories by status Returns a map of status codes to quantities -### Example +### Example ```python from __future__ import print_function import time @@ -81,7 +81,7 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration)) -try: +try: # Returns pet inventories by status api_response = api_instance.get_inventory() 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 -### Example +### Example ```python from __future__ import print_function import time @@ -126,7 +126,7 @@ from pprint import pprint api_instance = petstore_api.StoreApi() order_id = 789 # int | ID of pet that needs to be fetched -try: +try: # Find purchase order by ID api_response = api_instance.get_order_by_id(order_id) pprint(api_response) @@ -162,7 +162,7 @@ Place an order for a pet -### Example +### Example ```python from __future__ import print_function import time @@ -174,7 +174,7 @@ from pprint import pprint api_instance = petstore_api.StoreApi() body = petstore_api.Order() # Order | order placed for purchasing the pet -try: +try: # Place an order for a pet api_response = api_instance.place_order(body) pprint(api_response) diff --git a/samples/client/petstore/python-tornado/docs/UserApi.md b/samples/client/petstore/python-tornado/docs/UserApi.md index 5b73179dce3..969485595ae 100644 --- a/samples/client/petstore/python-tornado/docs/UserApi.md +++ b/samples/client/petstore/python-tornado/docs/UserApi.md @@ -21,7 +21,7 @@ Create user This can only be done by the logged in user. -### Example +### Example ```python from __future__ import print_function import time @@ -33,7 +33,7 @@ from pprint import pprint api_instance = petstore_api.UserApi() body = petstore_api.User() # User | Created user object -try: +try: # Create user api_instance.create_user(body) except ApiException as e: @@ -68,7 +68,7 @@ Creates list of users with given input array -### Example +### Example ```python from __future__ import print_function import time @@ -80,7 +80,7 @@ from pprint import pprint api_instance = petstore_api.UserApi() body = [petstore_api.User()] # list[User] | List of user object -try: +try: # Creates list of users with given input array api_instance.create_users_with_array_input(body) except ApiException as e: @@ -115,7 +115,7 @@ Creates list of users with given input array -### Example +### Example ```python from __future__ import print_function import time @@ -127,7 +127,7 @@ from pprint import pprint api_instance = petstore_api.UserApi() body = [petstore_api.User()] # list[User] | List of user object -try: +try: # Creates list of users with given input array api_instance.create_users_with_list_input(body) except ApiException as e: @@ -162,7 +162,7 @@ Delete user This can only be done by the logged in user. -### Example +### Example ```python from __future__ import print_function import time @@ -174,7 +174,7 @@ from pprint import pprint api_instance = petstore_api.UserApi() username = 'username_example' # str | The name that needs to be deleted -try: +try: # Delete user api_instance.delete_user(username) except ApiException as e: @@ -209,7 +209,7 @@ Get user by user name -### Example +### Example ```python from __future__ import print_function import time @@ -221,7 +221,7 @@ from pprint import pprint api_instance = petstore_api.UserApi() username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. -try: +try: # Get user by user name api_response = api_instance.get_user_by_name(username) pprint(api_response) @@ -257,7 +257,7 @@ Logs user into the system -### Example +### Example ```python from __future__ import print_function import time @@ -270,7 +270,7 @@ api_instance = petstore_api.UserApi() username = 'username_example' # str | The user name for login password = 'password_example' # str | The password for login in clear text -try: +try: # Logs user into the system api_response = api_instance.login_user(username, password) pprint(api_response) @@ -307,7 +307,7 @@ Logs out current logged in user session -### Example +### Example ```python from __future__ import print_function import time @@ -318,7 +318,7 @@ from pprint import pprint # create an instance of the API class api_instance = petstore_api.UserApi() -try: +try: # Logs out current logged in user session api_instance.logout_user() except ApiException as e: @@ -350,7 +350,7 @@ Updated user This can only be done by the logged in user. -### Example +### Example ```python from __future__ import print_function import time @@ -363,7 +363,7 @@ api_instance = petstore_api.UserApi() username = 'username_example' # str | name that need to be deleted body = petstore_api.User() # User | Updated user object -try: +try: # Updated user api_instance.update_user(username, body) except ApiException as e: diff --git a/samples/client/petstore/python-tornado/petstore_api/__init__.py b/samples/client/petstore/python-tornado/petstore_api/__init__.py index cad09e2691c..c368867dd11 100644 --- a/samples/client/petstore/python-tornado/petstore_api/__init__.py +++ b/samples/client/petstore/python-tornado/petstore_api/__init__.py @@ -1,9 +1,11 @@ # coding: utf-8 +# flake8: noqa + """ 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 Contact: apiteam@swagger.io @@ -13,53 +15,51 @@ 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 -from .apis.another_fake_api import AnotherFakeApi -from .apis.fake_api import FakeApi -from .apis.fake_classname_tags_123_api import FakeClassnameTags123Api -from .apis.pet_api import PetApi -from .apis.store_api import StoreApi -from .apis.user_api import UserApi +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 # import ApiClient -from .api_client import ApiClient - -from .configuration import Configuration +from petstore_api.api_client import ApiClient +from petstore_api.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 diff --git a/samples/client/petstore/python-tornado/petstore_api/api/__init__.py b/samples/client/petstore/python-tornado/petstore_api/api/__init__.py new file mode 100644 index 00000000000..74496adb5a2 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/api/__init__.py @@ -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 diff --git a/samples/client/petstore/python-asyncio/petstore_api/apis/another_fake_api.py b/samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py similarity index 59% rename from samples/client/petstore/python-asyncio/petstore_api/apis/another_fake_api.py rename to samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py index 8fb991ff3df..0096dad1a37 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/apis/another_fake_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,19 +13,17 @@ from __future__ import absolute_import -import sys -import os -import re +import re # noqa: F401 # 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): - """ - 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. Ref: https://github.com/swagger-api/swagger-codegen """ @@ -35,10 +33,10 @@ class AnotherFakeApi(object): api_client = ApiClient() self.api_client = api_client - def test_special_tags(self, body, **kwargs): - """ - To test special tags - To test special tags + def test_special_tags(self, body, **kwargs): # noqa: E501 + """To test special tags # noqa: E501 + + To test special tags # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_special_tags(body, async=True) @@ -52,15 +50,15 @@ class AnotherFakeApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.test_special_tags_with_http_info(body, **kwargs) + (data) = self.test_special_tags_with_http_info(body, **kwargs) # noqa: E501 return data - def test_special_tags_with_http_info(self, body, **kwargs): - """ - To test special tags - To test special tags + def test_special_tags_with_http_info(self, body, **kwargs): # noqa: E501 + """To test special tags # noqa: E501 + + To test special tags # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_special_tags_with_http_info(body, async=True) @@ -73,14 +71,14 @@ class AnotherFakeApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -89,9 +87,9 @@ class AnotherFakeApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `test_special_tags`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_special_tags`") # noqa: E501 collection_formats = {} @@ -108,27 +106,28 @@ class AnotherFakeApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/another-fake/dummy', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Client', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/another-fake/dummy', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-asyncio/petstore_api/apis/fake_api.py b/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py similarity index 57% rename from samples/client/petstore/python-asyncio/petstore_api/apis/fake_api.py rename to samples/client/petstore/python-tornado/petstore_api/api/fake_api.py index 46fb22f7290..4c52ee51647 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/apis/fake_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,19 +13,17 @@ from __future__ import absolute_import -import sys -import os -import re +import re # noqa: F401 # 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 FakeApi(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. Ref: https://github.com/swagger-api/swagger-codegen """ @@ -35,9 +33,10 @@ class FakeApi(object): api_client = ApiClient() self.api_client = api_client - def fake_outer_boolean_serialize(self, **kwargs): - """ - Test serialization of outer boolean types + def fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 + """fake_outer_boolean_serialize # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_boolean_serialize(async=True) @@ -51,14 +50,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.fake_outer_boolean_serialize_with_http_info(**kwargs) + return self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.fake_outer_boolean_serialize_with_http_info(**kwargs) + (data) = self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501 return data - def fake_outer_boolean_serialize_with_http_info(self, **kwargs): - """ - Test serialization of outer boolean types + def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 + """fake_outer_boolean_serialize # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_boolean_serialize_with_http_info(async=True) @@ -71,14 +71,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -87,7 +87,6 @@ class FakeApi(object): params[key] = val del params['kwargs'] - collection_formats = {} path_params = {} @@ -103,26 +102,28 @@ class FakeApi(object): if 'body' in params: body_params = params['body'] # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake/outer/boolean', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='OuterBoolean', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake/outer/boolean', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterBoolean', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def fake_outer_composite_serialize(self, **kwargs): - """ - Test serialization of object with outer number type + def fake_outer_composite_serialize(self, **kwargs): # noqa: E501 + """fake_outer_composite_serialize # noqa: E501 + + Test serialization of object with outer number type # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_composite_serialize(async=True) @@ -136,14 +137,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.fake_outer_composite_serialize_with_http_info(**kwargs) + return self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.fake_outer_composite_serialize_with_http_info(**kwargs) + (data) = self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501 return data - def fake_outer_composite_serialize_with_http_info(self, **kwargs): - """ - Test serialization of object with outer number type + def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 + """fake_outer_composite_serialize # noqa: E501 + + Test serialization of object with outer number type # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_composite_serialize_with_http_info(async=True) @@ -156,14 +158,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -172,7 +174,6 @@ class FakeApi(object): params[key] = val del params['kwargs'] - collection_formats = {} path_params = {} @@ -188,26 +189,28 @@ class FakeApi(object): if 'body' in params: body_params = params['body'] # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake/outer/composite', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='OuterComposite', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake/outer/composite', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterComposite', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def fake_outer_number_serialize(self, **kwargs): - """ - Test serialization of outer number types + def fake_outer_number_serialize(self, **kwargs): # noqa: E501 + """fake_outer_number_serialize # noqa: E501 + + Test serialization of outer number types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_number_serialize(async=True) @@ -221,14 +224,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.fake_outer_number_serialize_with_http_info(**kwargs) + return self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.fake_outer_number_serialize_with_http_info(**kwargs) + (data) = self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501 return data - def fake_outer_number_serialize_with_http_info(self, **kwargs): - """ - Test serialization of outer number types + def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 + """fake_outer_number_serialize # noqa: E501 + + Test serialization of outer number types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_number_serialize_with_http_info(async=True) @@ -241,14 +245,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -257,7 +261,6 @@ class FakeApi(object): params[key] = val del params['kwargs'] - collection_formats = {} path_params = {} @@ -273,26 +276,28 @@ class FakeApi(object): if 'body' in params: body_params = params['body'] # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake/outer/number', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='OuterNumber', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake/outer/number', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterNumber', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def fake_outer_string_serialize(self, **kwargs): - """ - Test serialization of outer string types + def fake_outer_string_serialize(self, **kwargs): # noqa: E501 + """fake_outer_string_serialize # noqa: E501 + + Test serialization of outer string types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_string_serialize(async=True) @@ -306,14 +311,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.fake_outer_string_serialize_with_http_info(**kwargs) + return self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.fake_outer_string_serialize_with_http_info(**kwargs) + (data) = self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501 return data - def fake_outer_string_serialize_with_http_info(self, **kwargs): - """ - Test serialization of outer string types + def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 + """fake_outer_string_serialize # noqa: E501 + + Test serialization of outer string types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_string_serialize_with_http_info(async=True) @@ -326,14 +332,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -342,7 +348,6 @@ class FakeApi(object): params[key] = val del params['kwargs'] - collection_formats = {} path_params = {} @@ -358,27 +363,28 @@ class FakeApi(object): if 'body' in params: body_params = params['body'] # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake/outer/string', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='OuterString', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake/outer/string', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterString', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def test_client_model(self, body, **kwargs): - """ - To test \"client\" model - To test \"client\" model + def test_client_model(self, body, **kwargs): # noqa: E501 + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_client_model(body, async=True) @@ -392,15 +398,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.test_client_model_with_http_info(body, **kwargs) + return self.test_client_model_with_http_info(body, **kwargs) # noqa: E501 else: - (data) = self.test_client_model_with_http_info(body, **kwargs) + (data) = self.test_client_model_with_http_info(body, **kwargs) # noqa: E501 return data - def test_client_model_with_http_info(self, body, **kwargs): - """ - To test \"client\" model - To test \"client\" model + def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_client_model_with_http_info(body, async=True) @@ -413,14 +419,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -429,9 +435,9 @@ class FakeApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `test_client_model`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_client_model`") # noqa: E501 collection_formats = {} @@ -448,35 +454,36 @@ class FakeApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Client', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): - """ - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + def test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async=True) @@ -503,15 +510,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) + return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501 else: - (data) = self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) + (data) = self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501 return data - def test_endpoint_parameters_with_http_info(self, number, double, pattern_without_delimiter, byte, **kwargs): - """ - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + def test_endpoint_parameters_with_http_info(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async=True) @@ -537,14 +544,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['number', 'double', 'pattern_without_delimiter', 'byte', 'integer', 'int32', 'int64', 'float', 'string', 'binary', 'date', 'date_time', 'password', 'param_callback'] + all_params = ['number', 'double', 'pattern_without_delimiter', 'byte', 'integer', 'int32', 'int64', 'float', 'string', 'binary', 'date', 'date_time', 'password', 'param_callback'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -553,45 +560,50 @@ class FakeApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'number' is set - if ('number' not in params) or (params['number'] is None): - raise ValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") + if ('number' not in params or + params['number'] is None): + raise ValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'double' is set - if ('double' not in params) or (params['double'] is None): - raise ValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") + if ('double' not in params or + params['double'] is None): + raise ValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'pattern_without_delimiter' is set - if ('pattern_without_delimiter' not in params) or (params['pattern_without_delimiter'] is None): - raise ValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") + if ('pattern_without_delimiter' not in params or + params['pattern_without_delimiter'] is None): + raise ValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'byte' is set - if ('byte' not in params) or (params['byte'] is None): - raise ValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") - - if 'number' in params and params['number'] > 543.2: - raise ValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") - if 'number' in params and params['number'] < 32.1: - raise ValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") - if 'double' in params and params['double'] > 123.4: - raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") - if 'double' in params and params['double'] < 67.8: - raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") - if 'pattern_without_delimiter' in params and not re.search('^[A-Z].*', params['pattern_without_delimiter']): - raise ValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") - if 'integer' in params and params['integer'] > 100: - raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") - if 'integer' in params and params['integer'] < 10: - raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") - if 'int32' in params and params['int32'] > 200: - raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") - if 'int32' in params and params['int32'] < 20: - raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") - if 'float' in params and params['float'] > 987.6: - raise ValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") - if 'string' in params and not re.search('[a-z]', params['string'], flags=re.IGNORECASE): - raise ValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") - if 'password' in params and len(params['password']) > 64: - raise ValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") - if 'password' in params and len(params['password']) < 10: - raise ValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") + if ('byte' not in params or + params['byte'] is None): + raise ValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501 + if 'number' in params and params['number'] > 543.2: # noqa: E501 + raise ValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") # noqa: E501 + if 'number' in params and params['number'] < 32.1: # noqa: E501 + raise ValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") # noqa: E501 + if 'double' in params and params['double'] > 123.4: # noqa: E501 + raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") # noqa: E501 + if 'double' in params and params['double'] < 67.8: # noqa: E501 + raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") # noqa: E501 + if 'pattern_without_delimiter' in params and not re.search('^[A-Z].*', params['pattern_without_delimiter']): # noqa: E501 + raise ValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") # noqa: E501 + if 'integer' in params and params['integer'] > 100: # noqa: E501 + raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") # noqa: E501 + if 'integer' in params and params['integer'] < 10: # noqa: E501 + raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") # noqa: E501 + if 'int32' in params and params['int32'] > 200: # noqa: E501 + raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") # noqa: E501 + if 'int32' in params and params['int32'] < 20: # noqa: E501 + raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") # noqa: E501 + if 'float' in params and params['float'] > 987.6: # noqa: E501 + raise ValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501 + if 'string' in params and not re.search('[a-z]', params['string'], flags=re.IGNORECASE): # noqa: E501 + raise ValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") # noqa: E501 + if ('password' in params and + len(params['password']) > 64): + raise ValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") # noqa: E501 + if ('password' in params and + len(params['password']) < 10): + raise ValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") # noqa: E501 collection_formats = {} path_params = {} @@ -603,65 +615,66 @@ class FakeApi(object): form_params = [] local_var_files = {} if 'integer' in params: - form_params.append(('integer', params['integer'])) + form_params.append(('integer', params['integer'])) # noqa: E501 if 'int32' in params: - form_params.append(('int32', params['int32'])) + form_params.append(('int32', params['int32'])) # noqa: E501 if 'int64' in params: - form_params.append(('int64', params['int64'])) + form_params.append(('int64', params['int64'])) # noqa: E501 if 'number' in params: - form_params.append(('number', params['number'])) + form_params.append(('number', params['number'])) # noqa: E501 if 'float' in params: - form_params.append(('float', params['float'])) + form_params.append(('float', params['float'])) # noqa: E501 if 'double' in params: - form_params.append(('double', params['double'])) + form_params.append(('double', params['double'])) # noqa: E501 if 'string' in params: - form_params.append(('string', params['string'])) + form_params.append(('string', params['string'])) # noqa: E501 if 'pattern_without_delimiter' in params: - form_params.append(('pattern_without_delimiter', params['pattern_without_delimiter'])) + form_params.append(('pattern_without_delimiter', params['pattern_without_delimiter'])) # noqa: E501 if 'byte' in params: - form_params.append(('byte', params['byte'])) + form_params.append(('byte', params['byte'])) # noqa: E501 if 'binary' in params: - form_params.append(('binary', params['binary'])) + form_params.append(('binary', params['binary'])) # noqa: E501 if 'date' in params: - form_params.append(('date', params['date'])) + form_params.append(('date', params['date'])) # noqa: E501 if 'date_time' in params: - form_params.append(('dateTime', params['date_time'])) + form_params.append(('dateTime', params['date_time'])) # noqa: E501 if 'password' in params: - form_params.append(('password', params['password'])) + form_params.append(('password', params['password'])) # noqa: E501 if 'param_callback' in params: - form_params.append(('callback', params['param_callback'])) + form_params.append(('callback', params['param_callback'])) # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml; charset=utf-8', 'application/json; charset=utf-8']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml; charset=utf-8', 'application/json; charset=utf-8']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/xml; charset=utf-8', 'application/json; charset=utf-8']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/xml; charset=utf-8', 'application/json; charset=utf-8']) # noqa: E501 # Authentication setting - auth_settings = ['http_basic_test'] + auth_settings = ['http_basic_test'] # noqa: E501 - return self.api_client.call_api('/fake', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def test_enum_parameters(self, **kwargs): - """ - To test enum parameters - To test enum parameters + def test_enum_parameters(self, **kwargs): # noqa: E501 + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_enum_parameters(async=True) @@ -682,15 +695,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.test_enum_parameters_with_http_info(**kwargs) + return self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.test_enum_parameters_with_http_info(**kwargs) + (data) = self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501 return data - def test_enum_parameters_with_http_info(self, **kwargs): - """ - To test enum parameters - To test enum parameters + def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_enum_parameters_with_http_info(async=True) @@ -710,14 +723,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['enum_form_string_array', 'enum_form_string', 'enum_header_string_array', 'enum_header_string', 'enum_query_string_array', 'enum_query_string', 'enum_query_integer', 'enum_query_double'] + all_params = ['enum_form_string_array', 'enum_form_string', 'enum_header_string_array', 'enum_header_string', 'enum_query_string_array', 'enum_query_string', 'enum_query_integer', 'enum_query_double'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -726,68 +739,163 @@ class FakeApi(object): params[key] = val del params['kwargs'] - collection_formats = {} path_params = {} query_params = [] if 'enum_query_string_array' in params: - query_params.append(('enum_query_string_array', params['enum_query_string_array'])) - collection_formats['enum_query_string_array'] = 'csv' + query_params.append(('enum_query_string_array', params['enum_query_string_array'])) # noqa: E501 + collection_formats['enum_query_string_array'] = 'csv' # noqa: E501 if 'enum_query_string' in params: - query_params.append(('enum_query_string', params['enum_query_string'])) + query_params.append(('enum_query_string', params['enum_query_string'])) # noqa: E501 if 'enum_query_integer' in params: - query_params.append(('enum_query_integer', params['enum_query_integer'])) + query_params.append(('enum_query_integer', params['enum_query_integer'])) # noqa: E501 header_params = {} if 'enum_header_string_array' in params: - header_params['enum_header_string_array'] = params['enum_header_string_array'] - collection_formats['enum_header_string_array'] = 'csv' + header_params['enum_header_string_array'] = params['enum_header_string_array'] # noqa: E501 + collection_formats['enum_header_string_array'] = 'csv' # noqa: E501 if 'enum_header_string' in params: - header_params['enum_header_string'] = params['enum_header_string'] + header_params['enum_header_string'] = params['enum_header_string'] # noqa: E501 form_params = [] local_var_files = {} if 'enum_form_string_array' in params: - form_params.append(('enum_form_string_array', params['enum_form_string_array'])) - collection_formats['enum_form_string_array'] = 'csv' + form_params.append(('enum_form_string_array', params['enum_form_string_array'])) # noqa: E501 + collection_formats['enum_form_string_array'] = 'csv' # noqa: E501 if 'enum_form_string' in params: - form_params.append(('enum_form_string', params['enum_form_string'])) + form_params.append(('enum_form_string', params['enum_form_string'])) # noqa: E501 if 'enum_query_double' in params: - form_params.append(('enum_query_double', params['enum_query_double'])) + form_params.append(('enum_query_double', params['enum_query_double'])) # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['*/*']) + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['*/*']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['*/*']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def test_json_form_data(self, param, param2, **kwargs): + def test_inline_additional_properties(self, param, **kwargs): # noqa: E501 + """test inline additionalProperties # noqa: E501 + + # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_inline_additional_properties(param, async=True) + >>> result = thread.get() + + :param async bool + :param object param: request body (required) + :return: None + If the method is called asynchronously, + returns the request thread. """ - test json serialization of form data - + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.test_inline_additional_properties_with_http_info(param, **kwargs) # noqa: E501 + else: + (data) = self.test_inline_additional_properties_with_http_info(param, **kwargs) # noqa: E501 + return data + + def test_inline_additional_properties_with_http_info(self, param, **kwargs): # noqa: E501 + """test inline additionalProperties # noqa: E501 + + # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_inline_additional_properties_with_http_info(param, async=True) + >>> result = thread.get() + + :param async bool + :param object param: request body (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['param'] # noqa: E501 + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_inline_additional_properties" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'param' is set + if ('param' not in params or + params['param'] is None): + raise ValueError("Missing the required parameter `param` when calling `test_inline_additional_properties`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'param' in params: + body_params = params['param'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/inline-additionalProperties', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_json_form_data(self, param, param2, **kwargs): # noqa: E501 + """test json serialization of form data # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_json_form_data(param, param2, async=True) @@ -802,15 +910,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.test_json_form_data_with_http_info(param, param2, **kwargs) + return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501 else: - (data) = self.test_json_form_data_with_http_info(param, param2, **kwargs) + (data) = self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501 return data - def test_json_form_data_with_http_info(self, param, param2, **kwargs): - """ - test json serialization of form data - + def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: E501 + """test json serialization of form data # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_json_form_data_with_http_info(param, param2, async=True) @@ -824,14 +932,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['param', 'param2'] + all_params = ['param', 'param2'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -840,12 +948,13 @@ class FakeApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'param' is set - if ('param' not in params) or (params['param'] is None): - raise ValueError("Missing the required parameter `param` when calling `test_json_form_data`") + if ('param' not in params or + params['param'] is None): + raise ValueError("Missing the required parameter `param` when calling `test_json_form_data`") # noqa: E501 # verify the required parameter 'param2' is set - if ('param2' not in params) or (params['param2'] is None): - raise ValueError("Missing the required parameter `param2` when calling `test_json_form_data`") - + if ('param2' not in params or + params['param2'] is None): + raise ValueError("Missing the required parameter `param2` when calling `test_json_form_data`") # noqa: E501 collection_formats = {} @@ -858,29 +967,30 @@ class FakeApi(object): form_params = [] local_var_files = {} if 'param' in params: - form_params.append(('param', params['param'])) + form_params.append(('param', params['param'])) # noqa: E501 if 'param2' in params: - form_params.append(('param2', params['param2'])) + form_params.append(('param2', params['param2'])) # noqa: E501 body_params = None # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake/jsonFormData', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake/jsonFormData', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-tornado/petstore_api/apis/fake_classname_tags_123_api.py b/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags_123_api.py similarity index 60% rename from samples/client/petstore/python-tornado/petstore_api/apis/fake_classname_tags_123_api.py rename to samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags_123_api.py index da75ad3cccd..6b6606dc096 100644 --- a/samples/client/petstore/python-tornado/petstore_api/apis/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags_123_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,19 +13,17 @@ from __future__ import absolute_import -import sys -import os -import re +import re # noqa: F401 # 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): - """ - 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. Ref: https://github.com/swagger-api/swagger-codegen """ @@ -35,9 +33,9 @@ class FakeClassnameTags123Api(object): api_client = ApiClient() self.api_client = api_client - def test_classname(self, body, **kwargs): - """ - To test class name in snake case + def test_classname(self, body, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_classname(body, async=True) @@ -51,14 +49,14 @@ class FakeClassnameTags123Api(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.test_classname_with_http_info(body, **kwargs) + (data) = self.test_classname_with_http_info(body, **kwargs) # noqa: E501 return data - def test_classname_with_http_info(self, body, **kwargs): - """ - To test class name in snake case + def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_classname_with_http_info(body, async=True) @@ -71,14 +69,14 @@ class FakeClassnameTags123Api(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -87,9 +85,9 @@ class FakeClassnameTags123Api(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `test_classname`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501 collection_formats = {} @@ -106,27 +104,28 @@ class FakeClassnameTags123Api(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['api_key_query'] + auth_settings = ['api_key_query'] # noqa: E501 - return self.api_client.call_api('/fake_classname_test', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Client', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake_classname_test', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-tornado/petstore_api/apis/pet_api.py b/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py similarity index 57% rename from samples/client/petstore/python-tornado/petstore_api/apis/pet_api.py rename to samples/client/petstore/python-tornado/petstore_api/api/pet_api.py index 51b6ce82540..ff1026f3fae 100644 --- a/samples/client/petstore/python-tornado/petstore_api/apis/pet_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,19 +13,17 @@ from __future__ import absolute_import -import sys -import os -import re +import re # noqa: F401 # 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): - """ - 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. Ref: https://github.com/swagger-api/swagger-codegen """ @@ -35,10 +33,10 @@ class PetApi(object): api_client = ApiClient() self.api_client = api_client - def add_pet(self, body, **kwargs): - """ - Add a new pet to the store - + def add_pet(self, body, **kwargs): # noqa: E501 + """Add a new pet to the store # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.add_pet(body, async=True) @@ -52,15 +50,15 @@ class PetApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.add_pet_with_http_info(body, **kwargs) + (data) = self.add_pet_with_http_info(body, **kwargs) # noqa: E501 return data - def add_pet_with_http_info(self, body, **kwargs): - """ - Add a new pet to the store - + def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 + """Add a new pet to the store # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.add_pet_with_http_info(body, async=True) @@ -73,14 +71,14 @@ class PetApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -89,9 +87,9 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `add_pet`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_pet`") # noqa: E501 collection_formats = {} @@ -108,35 +106,36 @@ class PetApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json', 'application/xml']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json', 'application/xml']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def delete_pet(self, pet_id, **kwargs): - """ - Deletes a pet - + def delete_pet(self, pet_id, **kwargs): # noqa: E501 + """Deletes a pet # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.delete_pet(pet_id, async=True) @@ -151,15 +150,15 @@ class PetApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.delete_pet_with_http_info(pet_id, **kwargs) + (data) = self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501 return data - def delete_pet_with_http_info(self, pet_id, **kwargs): - """ - Deletes a pet - + def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 + """Deletes a pet # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.delete_pet_with_http_info(pet_id, async=True) @@ -173,14 +172,14 @@ class PetApi(object): 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('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -189,52 +188,53 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in params) or (params['pet_id'] is None): - raise ValueError("Missing the required parameter `pet_id` when calling `delete_pet`") - + if ('pet_id' not in params or + params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501 collection_formats = {} path_params = {} if 'pet_id' in params: - path_params['petId'] = params['pet_id'] + path_params['petId'] = params['pet_id'] # noqa: E501 query_params = [] header_params = {} if 'api_key' in params: - header_params['api_key'] = params['api_key'] + header_params['api_key'] = params['api_key'] # noqa: E501 form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet/{petId}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet/{petId}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def find_pets_by_status(self, status, **kwargs): - """ - Finds Pets by status - Multiple status values can be provided with comma separated strings + def find_pets_by_status(self, status, **kwargs): # noqa: E501 + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.find_pets_by_status(status, async=True) @@ -248,15 +248,15 @@ class PetApi(object): """ kwargs['_return_http_data_only'] = True 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: - (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 - def find_pets_by_status_with_http_info(self, status, **kwargs): - """ - Finds Pets by status - Multiple status values can be provided with comma separated strings + def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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. """ - all_params = ['status'] + all_params = ['status'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -285,9 +285,9 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'status' is set - if ('status' not in params) or (params['status'] is None): - raise ValueError("Missing the required parameter `status` when calling `find_pets_by_status`") - + if ('status' not in params or + params['status'] is None): + raise ValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501 collection_formats = {} @@ -295,8 +295,8 @@ class PetApi(object): query_params = [] if 'status' in params: - query_params.append(('status', params['status'])) - collection_formats['status'] = 'csv' + query_params.append(('status', params['status'])) # noqa: E501 + collection_formats['status'] = 'csv' # noqa: E501 header_params = {} @@ -305,31 +305,32 @@ class PetApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet/findByStatus', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[Pet]', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet/findByStatus', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Pet]', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def find_pets_by_tags(self, tags, **kwargs): - """ - Finds Pets by tags - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + def find_pets_by_tags(self, tags, **kwargs): # noqa: E501 + """Finds Pets by tags # noqa: E501 + + 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 asynchronous HTTP request, please pass async=True >>> thread = api.find_pets_by_tags(tags, async=True) @@ -343,15 +344,15 @@ class PetApi(object): """ kwargs['_return_http_data_only'] = True 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: - (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 - def find_pets_by_tags_with_http_info(self, tags, **kwargs): - """ - Finds Pets by tags - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 + """Finds Pets by tags # noqa: E501 + + 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 asynchronous HTTP request, please pass 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. """ - all_params = ['tags'] + all_params = ['tags'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -380,9 +381,9 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'tags' is set - if ('tags' not in params) or (params['tags'] is None): - raise ValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") - + if ('tags' not in params or + params['tags'] is None): + raise ValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501 collection_formats = {} @@ -390,8 +391,8 @@ class PetApi(object): query_params = [] if 'tags' in params: - query_params.append(('tags', params['tags'])) - collection_formats['tags'] = 'csv' + query_params.append(('tags', params['tags'])) # noqa: E501 + collection_formats['tags'] = 'csv' # noqa: E501 header_params = {} @@ -400,31 +401,32 @@ class PetApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet/findByTags', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[Pet]', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet/findByTags', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Pet]', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def get_pet_by_id(self, pet_id, **kwargs): - """ - Find pet by ID - Returns a single pet + def get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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 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: - (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 - def get_pet_by_id_with_http_info(self, pet_id, **kwargs): - """ - Find pet by ID - Returns a single pet + def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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. """ - all_params = ['pet_id'] + all_params = ['pet_id'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -475,15 +477,15 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in params) or (params['pet_id'] is None): - raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") - + if ('pet_id' not in params or + params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501 collection_formats = {} path_params = {} if 'pet_id' in params: - path_params['petId'] = params['pet_id'] + path_params['petId'] = params['pet_id'] # noqa: E501 query_params = [] @@ -494,31 +496,32 @@ class PetApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = ['api_key'] + auth_settings = ['api_key'] # noqa: E501 - return self.api_client.call_api('/pet/{petId}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Pet', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet/{petId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Pet', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def update_pet(self, body, **kwargs): - """ - Update an existing pet - + def update_pet(self, body, **kwargs): # noqa: E501 + """Update an existing pet # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.update_pet(body, async=True) @@ -532,15 +535,15 @@ class PetApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.update_pet_with_http_info(body, **kwargs) + (data) = self.update_pet_with_http_info(body, **kwargs) # noqa: E501 return data - def update_pet_with_http_info(self, body, **kwargs): - """ - Update an existing pet - + def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 + """Update an existing pet # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.update_pet_with_http_info(body, async=True) @@ -553,14 +556,14 @@ class PetApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -569,9 +572,9 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_pet`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_pet`") # noqa: E501 collection_formats = {} @@ -588,35 +591,36 @@ class PetApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json', 'application/xml']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json', 'application/xml']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def update_pet_with_form(self, pet_id, **kwargs): - """ - Updates a pet in the store with form data - + def update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 + """Updates a pet in the store with form data # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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 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: - (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 - def update_pet_with_form_with_http_info(self, pet_id, **kwargs): - """ - Updates a pet in the store with form data - + 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 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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. """ - all_params = ['pet_id', 'name', 'status'] + all_params = ['pet_id', 'name', 'status'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -671,15 +675,15 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in params) or (params['pet_id'] is None): - raise ValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") - + if ('pet_id' not in params or + params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501 collection_formats = {} path_params = {} if 'pet_id' in params: - path_params['petId'] = params['pet_id'] + path_params['petId'] = params['pet_id'] # noqa: E501 query_params = [] @@ -688,41 +692,42 @@ class PetApi(object): form_params = [] local_var_files = {} if 'name' in params: - form_params.append(('name', params['name'])) + form_params.append(('name', params['name'])) # noqa: E501 if 'status' in params: - form_params.append(('status', params['status'])) + form_params.append(('status', params['status'])) # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/x-www-form-urlencoded']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/x-www-form-urlencoded']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet/{petId}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet/{petId}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def upload_file(self, pet_id, **kwargs): - """ - uploads an image - + def upload_file(self, pet_id, **kwargs): # noqa: E501 + """uploads an image # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.upload_file(pet_id, async=True) @@ -738,15 +743,15 @@ class PetApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.upload_file_with_http_info(pet_id, **kwargs) + (data) = self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501 return data - def upload_file_with_http_info(self, pet_id, **kwargs): - """ - uploads an image - + def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 + """uploads an image # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.upload_file_with_http_info(pet_id, async=True) @@ -761,14 +766,14 @@ class PetApi(object): 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('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -777,15 +782,15 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in params) or (params['pet_id'] is None): - raise ValueError("Missing the required parameter `pet_id` when calling `upload_file`") - + if ('pet_id' not in params or + params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501 collection_formats = {} path_params = {} if 'pet_id' in params: - path_params['petId'] = params['pet_id'] + path_params['petId'] = params['pet_id'] # noqa: E501 query_params = [] @@ -794,33 +799,34 @@ class PetApi(object): form_params = [] local_var_files = {} 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: - local_var_files['file'] = params['file'] + local_var_files['file'] = params['file'] # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['multipart/form-data']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['multipart/form-data']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet/{petId}/uploadImage', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ApiResponse', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet/{petId}/uploadImage', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ApiResponse', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-tornado/petstore_api/apis/store_api.py b/samples/client/petstore/python-tornado/petstore_api/api/store_api.py similarity index 57% rename from samples/client/petstore/python-tornado/petstore_api/apis/store_api.py rename to samples/client/petstore/python-tornado/petstore_api/api/store_api.py index e9d9599c363..ebb9a4eb27a 100644 --- a/samples/client/petstore/python-tornado/petstore_api/apis/store_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/store_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,19 +13,17 @@ from __future__ import absolute_import -import sys -import os -import re +import re # noqa: F401 # 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): - """ - 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. Ref: https://github.com/swagger-api/swagger-codegen """ @@ -35,10 +33,10 @@ class StoreApi(object): api_client = ApiClient() self.api_client = api_client - def delete_order(self, order_id, **kwargs): - """ - Delete purchase order by ID - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + def delete_order(self, order_id, **kwargs): # noqa: E501 + """Delete purchase order by ID # noqa: E501 + + 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 asynchronous HTTP request, please pass async=True >>> thread = api.delete_order(order_id, async=True) @@ -52,15 +50,15 @@ class StoreApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.delete_order_with_http_info(order_id, **kwargs) + (data) = self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501 return data - def delete_order_with_http_info(self, order_id, **kwargs): - """ - Delete purchase order by ID - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Delete purchase order by ID # noqa: E501 + + 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 asynchronous HTTP request, please pass async=True >>> thread = api.delete_order_with_http_info(order_id, async=True) @@ -73,14 +71,14 @@ class StoreApi(object): returns the request thread. """ - all_params = ['order_id'] + all_params = ['order_id'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -89,15 +87,15 @@ class StoreApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'order_id' is set - if ('order_id' not in params) or (params['order_id'] is None): - raise ValueError("Missing the required parameter `order_id` when calling `delete_order`") - + if ('order_id' not in params or + params['order_id'] is None): + raise ValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501 collection_formats = {} path_params = {} if 'order_id' in params: - path_params['order_id'] = params['order_id'] + path_params['order_id'] = params['order_id'] # noqa: E501 query_params = [] @@ -108,31 +106,32 @@ class StoreApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/store/order/{order_id}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/store/order/{order_id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def get_inventory(self, **kwargs): - """ - Returns pet inventories by status - Returns a map of status codes to quantities + def get_inventory(self, **kwargs): # noqa: E501 + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.get_inventory(async=True) @@ -145,15 +144,15 @@ class StoreApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_inventory_with_http_info(**kwargs) + return self.get_inventory_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.get_inventory_with_http_info(**kwargs) + (data) = self.get_inventory_with_http_info(**kwargs) # noqa: E501 return data - def get_inventory_with_http_info(self, **kwargs): - """ - Returns pet inventories by status - Returns a map of status codes to quantities + def get_inventory_with_http_info(self, **kwargs): # noqa: E501 + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.get_inventory_with_http_info(async=True) @@ -165,14 +164,14 @@ class StoreApi(object): returns the request thread. """ - all_params = [] + all_params = [] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -194,31 +193,32 @@ class StoreApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['api_key'] + auth_settings = ['api_key'] # noqa: E501 - return self.api_client.call_api('/store/inventory', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='dict(str, int)', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/store/inventory', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, int)', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def get_order_by_id(self, order_id, **kwargs): - """ - Find purchase order by ID - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + def get_order_by_id(self, order_id, **kwargs): # noqa: E501 + """Find purchase order by ID # noqa: E501 + + 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 asynchronous HTTP request, please pass 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 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: - (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 - def get_order_by_id_with_http_info(self, order_id, **kwargs): - """ - Find purchase order by ID - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Find purchase order by ID # noqa: E501 + + 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 asynchronous HTTP request, please pass 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. """ - all_params = ['order_id'] + all_params = ['order_id'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -269,19 +269,19 @@ class StoreApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'order_id' is set - if ('order_id' not in params) or (params['order_id'] is None): - raise ValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") - - 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' not in params or + 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: # 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 = {} path_params = {} if 'order_id' in params: - path_params['order_id'] = params['order_id'] + path_params['order_id'] = params['order_id'] # noqa: E501 query_params = [] @@ -292,31 +292,32 @@ class StoreApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/store/order/{order_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Order', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/store/order/{order_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Order', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def place_order(self, body, **kwargs): - """ - Place an order for a pet - + def place_order(self, body, **kwargs): # noqa: E501 + """Place an order for a pet # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.place_order(body, async=True) @@ -330,15 +331,15 @@ class StoreApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.place_order_with_http_info(body, **kwargs) + (data) = self.place_order_with_http_info(body, **kwargs) # noqa: E501 return data - def place_order_with_http_info(self, body, **kwargs): - """ - Place an order for a pet - + def place_order_with_http_info(self, body, **kwargs): # noqa: E501 + """Place an order for a pet # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.place_order_with_http_info(body, async=True) @@ -351,14 +352,14 @@ class StoreApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -367,9 +368,9 @@ class StoreApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `place_order`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `place_order`") # noqa: E501 collection_formats = {} @@ -386,23 +387,24 @@ class StoreApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/store/order', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Order', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/store/order', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Order', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-tornado/petstore_api/apis/user_api.py b/samples/client/petstore/python-tornado/petstore_api/api/user_api.py similarity index 57% rename from samples/client/petstore/python-tornado/petstore_api/apis/user_api.py rename to samples/client/petstore/python-tornado/petstore_api/api/user_api.py index ffdad2dd60f..89949844aa1 100644 --- a/samples/client/petstore/python-tornado/petstore_api/apis/user_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/user_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,19 +13,17 @@ from __future__ import absolute_import -import sys -import os -import re +import re # noqa: F401 # 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): - """ - 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. Ref: https://github.com/swagger-api/swagger-codegen """ @@ -35,10 +33,10 @@ class UserApi(object): api_client = ApiClient() self.api_client = api_client - def create_user(self, body, **kwargs): - """ - Create user - This can only be done by the logged in user. + def create_user(self, body, **kwargs): # noqa: E501 + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.create_user(body, async=True) @@ -52,15 +50,15 @@ class UserApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.create_user_with_http_info(body, **kwargs) + (data) = self.create_user_with_http_info(body, **kwargs) # noqa: E501 return data - def create_user_with_http_info(self, body, **kwargs): - """ - Create user - This can only be done by the logged in user. + def create_user_with_http_info(self, body, **kwargs): # noqa: E501 + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.create_user_with_http_info(body, async=True) @@ -73,14 +71,14 @@ class UserApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -89,9 +87,9 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_user`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_user`") # noqa: E501 collection_formats = {} @@ -108,31 +106,32 @@ class UserApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def create_users_with_array_input(self, body, **kwargs): - """ - Creates list of users with given input array - + def create_users_with_array_input(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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 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: - (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 - def create_users_with_array_input_with_http_info(self, body, **kwargs): - """ - Creates list of users with given input array - + def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -183,9 +182,9 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") # noqa: E501 collection_formats = {} @@ -202,31 +201,32 @@ class UserApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/createWithArray', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/createWithArray', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def create_users_with_list_input(self, body, **kwargs): - """ - Creates list of users with given input array - + def create_users_with_list_input(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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 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: - (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 - def create_users_with_list_input_with_http_info(self, body, **kwargs): - """ - Creates list of users with given input array - + def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -277,9 +277,9 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") # noqa: E501 collection_formats = {} @@ -296,31 +296,32 @@ class UserApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/createWithList', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/createWithList', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def delete_user(self, username, **kwargs): - """ - Delete user - This can only be done by the logged in user. + def delete_user(self, username, **kwargs): # noqa: E501 + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.delete_user(username, async=True) @@ -334,15 +335,15 @@ class UserApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.delete_user_with_http_info(username, **kwargs) + (data) = self.delete_user_with_http_info(username, **kwargs) # noqa: E501 return data - def delete_user_with_http_info(self, username, **kwargs): - """ - Delete user - This can only be done by the logged in user. + def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.delete_user_with_http_info(username, async=True) @@ -355,14 +356,14 @@ class UserApi(object): returns the request thread. """ - all_params = ['username'] + all_params = ['username'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -371,15 +372,15 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in params) or (params['username'] is None): - raise ValueError("Missing the required parameter `username` when calling `delete_user`") - + if ('username' not in params or + params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501 collection_formats = {} path_params = {} if 'username' in params: - path_params['username'] = params['username'] + path_params['username'] = params['username'] # noqa: E501 query_params = [] @@ -390,31 +391,32 @@ class UserApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/{username}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/{username}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def get_user_by_name(self, username, **kwargs): - """ - Get user by user name - + def get_user_by_name(self, username, **kwargs): # noqa: E501 + """Get user by user name # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.get_user_by_name(username, async=True) @@ -428,15 +430,15 @@ class UserApi(object): """ kwargs['_return_http_data_only'] = True 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: - (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 - def get_user_by_name_with_http_info(self, username, **kwargs): - """ - Get user by user name - + def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 + """Get user by user name # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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. """ - all_params = ['username'] + all_params = ['username'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -465,15 +467,15 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in params) or (params['username'] is None): - raise ValueError("Missing the required parameter `username` when calling `get_user_by_name`") - + if ('username' not in params or + params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501 collection_formats = {} path_params = {} if 'username' in params: - path_params['username'] = params['username'] + path_params['username'] = params['username'] # noqa: E501 query_params = [] @@ -484,31 +486,32 @@ class UserApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/{username}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='User', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/{username}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='User', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def login_user(self, username, password, **kwargs): - """ - Logs user into the system - + def login_user(self, username, password, **kwargs): # noqa: E501 + """Logs user into the system # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.login_user(username, password, async=True) @@ -523,15 +526,15 @@ class UserApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.login_user_with_http_info(username, password, **kwargs) + (data) = self.login_user_with_http_info(username, password, **kwargs) # noqa: E501 return data - def login_user_with_http_info(self, username, password, **kwargs): - """ - Logs user into the system - + def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 + """Logs user into the system # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.login_user_with_http_info(username, password, async=True) @@ -545,14 +548,14 @@ class UserApi(object): returns the request thread. """ - all_params = ['username', 'password'] + all_params = ['username', 'password'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -561,12 +564,13 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in params) or (params['username'] is None): - raise ValueError("Missing the required parameter `username` when calling `login_user`") + if ('username' not in params or + params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501 # verify the required parameter 'password' is set - if ('password' not in params) or (params['password'] is None): - raise ValueError("Missing the required parameter `password` when calling `login_user`") - + if ('password' not in params or + params['password'] is None): + raise ValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501 collection_formats = {} @@ -574,9 +578,9 @@ class UserApi(object): query_params = [] if 'username' in params: - query_params.append(('username', params['username'])) + query_params.append(('username', params['username'])) # noqa: E501 if 'password' in params: - query_params.append(('password', params['password'])) + query_params.append(('password', params['password'])) # noqa: E501 header_params = {} @@ -585,31 +589,32 @@ class UserApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/login', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='str', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/login', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def logout_user(self, **kwargs): - """ - Logs out current logged in user session - + def logout_user(self, **kwargs): # noqa: E501 + """Logs out current logged in user session # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.logout_user(async=True) @@ -622,15 +627,15 @@ class UserApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.logout_user_with_http_info(**kwargs) + return self.logout_user_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.logout_user_with_http_info(**kwargs) + (data) = self.logout_user_with_http_info(**kwargs) # noqa: E501 return data - def logout_user_with_http_info(self, **kwargs): - """ - Logs out current logged in user session - + def logout_user_with_http_info(self, **kwargs): # noqa: E501 + """Logs out current logged in user session # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.logout_user_with_http_info(async=True) @@ -642,14 +647,14 @@ class UserApi(object): returns the request thread. """ - all_params = [] + all_params = [] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -671,31 +676,32 @@ class UserApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/logout', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/logout', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def update_user(self, username, body, **kwargs): - """ - Updated user - This can only be done by the logged in user. + def update_user(self, username, body, **kwargs): # noqa: E501 + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.update_user(username, body, async=True) @@ -710,15 +716,15 @@ class UserApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.update_user_with_http_info(username, body, **kwargs) + (data) = self.update_user_with_http_info(username, body, **kwargs) # noqa: E501 return data - def update_user_with_http_info(self, username, body, **kwargs): - """ - Updated user - This can only be done by the logged in user. + def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501 + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.update_user_with_http_info(username, body, async=True) @@ -732,14 +738,14 @@ class UserApi(object): returns the request thread. """ - all_params = ['username', 'body'] + all_params = ['username', 'body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -748,18 +754,19 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in params) or (params['username'] is None): - raise ValueError("Missing the required parameter `username` when calling `update_user`") + if ('username' not in params or + params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501 # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_user`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_user`") # noqa: E501 collection_formats = {} path_params = {} if 'username' in params: - path_params['username'] = params['username'] + path_params['username'] = params['username'] # noqa: E501 query_params = [] @@ -772,23 +779,24 @@ class UserApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/{username}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/{username}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-tornado/petstore_api/api_client.py b/samples/client/petstore/python-tornado/petstore_api/api_client.py index c30b14130a9..70c7675c90b 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api_client.py +++ b/samples/client/petstore/python-tornado/petstore_api/api_client.py @@ -2,7 +2,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,28 +11,26 @@ from __future__ import absolute_import -import os -import re +import datetime import json import mimetypes -import tempfile -import tornado.gen from multiprocessing.pool import ThreadPool - -from datetime import date, datetime +import os +import re +import tempfile # 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 +import tornado.gen -from . import models -from .configuration import Configuration -from .rest import ApiException, RESTClientObject +from petstore_api.configuration import Configuration +import petstore_api.models +from petstore_api import rest 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- server communication, and is invariant across implementations. Specifics of @@ -43,65 +41,64 @@ class ApiClient(object): Ref: https://github.com/swagger-api/swagger-codegen 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_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 = { 'int': int, - 'long': int if PY3 else long, + 'long': int if six.PY3 else long, # noqa: F821 'float': float, 'str': str, 'bool': bool, - 'date': date, - 'datetime': datetime, + 'date': datetime.date, + 'datetime': datetime.datetime, '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: configuration = Configuration() self.configuration = configuration self.pool = ThreadPool() - self.rest_client = RESTClientObject(configuration) + self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} if header_name is not None: self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. self.user_agent = 'Swagger-Codegen/1.0.0/python' - + def __del__(self): self.pool.close() self.pool.join() @property def user_agent(self): - """ - Gets user agent. - """ + """User agent for this API client""" return self.default_headers['User-Agent'] @user_agent.setter def user_agent(self, value): - """ - Sets user agent. - """ self.default_headers['User-Agent'] = value def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value @tornado.gen.coroutine - def __call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_type=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, _preload_content=True, - _request_timeout=None): + def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): config = self.configuration @@ -123,7 +120,9 @@ class ApiClient(object): for k, v in path_params: # specified safe chars, encode everything 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 if query_params: @@ -149,31 +148,16 @@ class ApiClient(object): url = self.configuration.host + resource_path # perform request and return response - response_data = yield self.request(method, url, - query_params=query_params, - headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + response_data = yield self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) self.last_response = response_data - return_data = response_data - if _preload_content: - # deserialize response data - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None - - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, response_data.getheaders()) - 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 str, int, long, float, bool, return directly. @@ -196,7 +180,7 @@ class ApiClient(object): elif isinstance(obj, tuple): return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) - elif isinstance(obj, (datetime, date)): + elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() if isinstance(obj, dict): @@ -208,15 +192,14 @@ class ApiClient(object): # Convert attribute name to json key in # model definition for request. 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} 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): - """ - Deserializes response into an object. + """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for @@ -238,8 +221,7 @@ class ApiClient(object): return self.__deserialize(data, response_type) 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 klass: class literal, or string of class name. @@ -258,21 +240,21 @@ class ApiClient(object): if klass.startswith('dict('): sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2) return {k: self.__deserialize(v, sub_kls) - for k, v in iteritems(data)} + for k, v in six.iteritems(data)} # convert str to class if klass in self.NATIVE_TYPES_MAPPING: klass = self.NATIVE_TYPES_MAPPING[klass] else: - klass = getattr(models, klass) + klass = getattr(petstore_api.models, klass) if klass in self.PRIMITIVE_TYPES: return self.__deserialize_primitive(data, klass) elif klass == object: return self.__deserialize_object(data) - elif klass == date: + elif klass == datetime.date: return self.__deserialize_date(data) - elif klass == datetime: + elif klass == datetime.datetime: return self.__deserialize_datatime(data) else: return self.__deserialize_model(data, klass) @@ -281,10 +263,10 @@ class ApiClient(object): path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, response_type=None, auth_settings=None, async=None, - _return_http_data_only=None, collection_formats=None, _preload_content=True, - _request_timeout=None): - """ - Makes the HTTP request (synchronous) and return the deserialized data. + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + To make an async request, set the async parameter. :param resource_path: Path to method endpoint. @@ -301,13 +283,17 @@ class ApiClient(object): :param files dict: key -> filename, value -> filepath, for `multipart/form-data`. :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, header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without - reading/decoding response data. Default is True. - :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. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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: If async parameter is True, the request will be called asynchronously. @@ -320,22 +306,23 @@ class ApiClient(object): path_params, query_params, header_params, body, post_params, files, 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: - thread = self.pool.apply_async(self.__call_api, (resource_path, method, - path_params, query_params, + thread = self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, header_params, body, post_params, files, response_type, auth_settings, _return_http_data_only, - collection_formats, _preload_content, _request_timeout)) + collection_formats, + _preload_content, _request_timeout)) return thread def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, _request_timeout=None): - """ - Makes the HTTP request using RESTClient. - """ + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" if method == "GET": return self.rest_client.GET(url, query_params=query_params, @@ -394,8 +381,7 @@ class ApiClient(object): ) 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 dict collection_formats: Parameter collection formats @@ -404,7 +390,7 @@ class ApiClient(object): new_params = [] if collection_formats is None: 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: collection_format = collection_formats[k] if collection_format == 'multi': @@ -425,8 +411,7 @@ class ApiClient(object): return new_params def prepare_post_parameters(self, post_params=None, files=None): - """ - Builds form parameters. + """Builds form parameters. :param post_params: Normal form parameters. :param files: File parameters. @@ -438,7 +423,7 @@ class ApiClient(object): params = post_params if files: - for k, v in iteritems(files): + for k, v in six.iteritems(files): if not v: continue file_names = v if type(v) is list else [v] @@ -446,15 +431,15 @@ class ApiClient(object): with open(n, 'rb') as f: filename = os.path.basename(f.name) filedata = f.read() - mimetype = mimetypes.\ - guess_type(filename)[0] or 'application/octet-stream' - params.append(tuple([k, tuple([filename, filedata, mimetype])])) + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) return params 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. :return: Accept (e.g. application/json). @@ -470,8 +455,7 @@ class ApiClient(object): return ', '.join(accepts) 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. :return: Content-Type (e.g. application/json). @@ -487,8 +471,7 @@ class ApiClient(object): return content_types[0] 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 querys: Query parameters tuple list to be updated. @@ -512,7 +495,8 @@ class ApiClient(object): ) def __deserialize_file(self, response): - """ + """Deserializes body to file + Saves response body into a file in a temporary folder, using the filename from the `Content-Disposition` header if provided. @@ -525,9 +509,8 @@ class ApiClient(object): content_disposition = response.getheader("Content-Disposition") if content_disposition: - filename = re.\ - search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition).\ - group(1) + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) path = os.path.join(os.path.dirname(path), filename) with open(path, "w") as f: @@ -536,8 +519,7 @@ class ApiClient(object): return path def __deserialize_primitive(self, data, klass): - """ - Deserializes string to primitive type. + """Deserializes string to primitive type. :param data: str. :param klass: class literal. @@ -547,21 +529,19 @@ class ApiClient(object): try: return klass(data) except UnicodeEncodeError: - return unicode(data) + return unicode(data) # noqa: F821 except TypeError: return data def __deserialize_object(self, value): - """ - Return a original value. + """Return a original value. :return: object. """ return value def __deserialize_date(self, string): - """ - Deserializes string to date. + """Deserializes string to date. :param string: str. :return: date. @@ -572,14 +552,13 @@ class ApiClient(object): except ImportError: return string except ValueError: - raise ApiException( + raise rest.ApiException( 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): - """ - Deserializes string to datetime. + """Deserializes string to datetime. The string should be in iso8601 datetime format. @@ -592,32 +571,32 @@ class ApiClient(object): except ImportError: return string except ValueError: - raise ApiException( + raise rest.ApiException( status=0, reason=( - "Failed to parse `{0}` into a datetime object" + "Failed to parse `{0}` as datetime object" .format(string) ) ) def __deserialize_model(self, data, klass): - """ - Deserializes list or dict to model. + """Deserializes list or dict to model. :param data: dict, list. :param klass: class literal. :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 kwargs = {} if klass.swagger_types is not None: - for attr, attr_type in iteritems(klass.swagger_types): - if data is not None \ - and klass.attribute_map[attr] in data \ - and isinstance(data, (list, dict)): + for attr, attr_type in six.iteritems(klass.swagger_types): + if (data is not None and + klass.attribute_map[attr] in data and + isinstance(data, (list, dict))): value = data[klass.attribute_map[attr]] kwargs[attr] = self.__deserialize(value, attr_type) diff --git a/samples/client/petstore/python-tornado/petstore_api/apis/__init__.py b/samples/client/petstore/python-tornado/petstore_api/apis/__init__.py deleted file mode 100644 index b4b975ca8e0..00000000000 --- a/samples/client/petstore/python-tornado/petstore_api/apis/__init__.py +++ /dev/null @@ -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 diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index 29bf22034aa..f6273cf28cc 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,24 +13,23 @@ from __future__ import absolute_import -import urllib3 - import copy import logging import multiprocessing import sys +import urllib3 -from six import iteritems -from six import with_metaclass +import six from six.moves import http_client as httplib + class TypeWithDefault(type): def __init__(cls, name, bases, dct): super(TypeWithDefault, cls).__init__(name, bases, dct) cls._default = None def __call__(cls): - if cls._default == None: + if cls._default is None: cls._default = type.__call__(cls) return copy.copy(cls._default) @@ -38,17 +37,15 @@ class TypeWithDefault(type): cls._default = copy.copy(default) -class Configuration(with_metaclass(TypeWithDefault, object)): - """ - NOTE: This class is auto generated by the swagger code generator program. +class Configuration(six.with_metaclass(TypeWithDefault, object)): + """NOTE: This class is auto generated by the swagger code generator program. + Ref: https://github.com/swagger-api/swagger-codegen Do not edit the class manually. """ def __init__(self): - """ - Constructor - """ + """Constructor""" # Default Base url self.host = "http://petstore.swagger.io:80/v2" # Temp file folder for downloading files @@ -83,7 +80,8 @@ class Configuration(with_metaclass(TypeWithDefault, object)): self.debug = False # 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 # Set this to customize the certificate file to verify the peer. 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. self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - # Proxy URL self.proxy = None # Safe chars for path_param @@ -109,18 +106,22 @@ class Configuration(with_metaclass(TypeWithDefault, object)): @property def logger_file(self): - """ - Gets the logger_file. + """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 @logger_file.setter def logger_file(self, value): - """ - Sets the logger_file. + """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. + 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 @@ -131,7 +132,7 @@ class Configuration(with_metaclass(TypeWithDefault, object)): # then add file handler and remove stream handler. self.logger_file_handler = logging.FileHandler(self.__logger_file) 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) if 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. self.logger_stream_handler = logging.StreamHandler() 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) if self.logger_file_handler: logger.removeHandler(self.logger_file_handler) @property def debug(self): - """ - Gets the debug status. + """Debug status + + :param value: The debug status, True or False. + :type: bool """ return self.__debug @debug.setter def debug(self, value): - """ - Sets the debug status. + """Debug status :param value: The debug status, True or False. :type: bool @@ -163,29 +165,32 @@ class Configuration(with_metaclass(TypeWithDefault, object)): self.__debug = value if self.__debug: # 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) # turn on httplib debug httplib.HTTPConnection.debuglevel = 1 else: # if debug status is False, turn off debug logging, # setting log level to default `logging.WARNING` - for _, logger in iteritems(self.logger): + for _, logger in six.iteritems(self.logger): logger.setLevel(logging.WARNING) # turn off httplib debug httplib.HTTPConnection.debuglevel = 0 @property def logger_format(self): - """ - Gets the logger_format. + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str """ return self.__logger_format @logger_format.setter def logger_format(self, value): - """ - Sets the logger_format. + """The 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) 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. :return: The token for api key authentication. """ - if self.api_key.get(identifier) and self.api_key_prefix.get(identifier): - return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] + if (self.api_key.get(identifier) and + self.api_key_prefix.get(identifier)): + return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 elif self.api_key.get(identifier): return self.api_key[identifier] 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 urllib3.util.make_headers(basic_auth=self.username + ':' + self.password)\ - .get('authorization') + return urllib3.util.make_headers( + basic_auth=self.username + ':' + self.password + ).get('authorization') def auth_settings(self): - """ - Gets Auth Settings dict for api client. + """Gets Auth Settings dict for api client. :return: The Auth Settings information dict. """ @@ -256,8 +260,7 @@ class Configuration(with_metaclass(TypeWithDefault, object)): } def to_debug_report(self): - """ - Gets the essential information for debugging. + """Gets the essential information for debugging. :return: The report for debugging. """ diff --git a/samples/client/petstore/python-tornado/petstore_api/models/__init__.py b/samples/client/petstore/python-tornado/petstore_api/models/__init__.py index 21b5d20fa3c..7b339102f9b 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/__init__.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/__init__.py @@ -1,9 +1,10 @@ # coding: utf-8 +# flake8: noqa """ 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 Contact: apiteam@swagger.io @@ -14,39 +15,39 @@ from __future__ import absolute_import # import models into model package -from .additional_properties_class import AdditionalPropertiesClass -from .animal import Animal -from .animal_farm import AnimalFarm -from .api_response import ApiResponse -from .array_of_array_of_number_only import ArrayOfArrayOfNumberOnly -from .array_of_number_only import ArrayOfNumberOnly -from .array_test import ArrayTest -from .capitalization import Capitalization -from .category import Category -from .class_model import ClassModel -from .client import Client -from .enum_arrays import EnumArrays -from .enum_class import EnumClass -from .enum_test import EnumTest -from .format_test import FormatTest -from .has_only_read_only import HasOnlyReadOnly -from .list import List -from .map_test import MapTest -from .mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass -from .model_200_response import Model200Response -from .model_return import ModelReturn -from .name import Name -from .number_only import NumberOnly -from .order import Order -from .outer_boolean import OuterBoolean -from .outer_composite import OuterComposite -from .outer_enum import OuterEnum -from .outer_number import OuterNumber -from .outer_string import OuterString -from .pet import Pet -from .read_only_first import ReadOnlyFirst -from .special_model_name import SpecialModelName -from .tag import Tag -from .user import User -from .cat import Cat -from .dog import Dog +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 diff --git a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_class.py index a5329b411cd..03dbe975f1b 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_class.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_class.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class AdditionalPropertiesClass(object): 'map_of_map_property': 'map_of_map_property' } - def __init__(self, map_property=None, map_of_map_property=None): - """ - AdditionalPropertiesClass - a model defined in Swagger - """ + def __init__(self, map_property=None, map_of_map_property=None): # noqa: E501 + """AdditionalPropertiesClass - a model defined in Swagger""" # noqa: E501 self._map_property = None self._map_of_map_property = None self.discriminator = 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: - self.map_of_map_property = map_of_map_property + self.map_of_map_property = map_of_map_property @property def map_property(self): - """ - Gets the map_property of this AdditionalPropertiesClass. + """Gets the map_property of this AdditionalPropertiesClass. # noqa: E501 - :return: The map_property of this AdditionalPropertiesClass. + + :return: The map_property of this AdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, str) """ return self._map_property @map_property.setter 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) """ @@ -77,32 +75,30 @@ class AdditionalPropertiesClass(object): @property def map_of_map_property(self): - """ - Gets the map_of_map_property of this AdditionalPropertiesClass. + """Gets the map_of_map_property of this AdditionalPropertiesClass. # noqa: E501 - :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)) """ return self._map_of_map_property @map_of_map_property.setter 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)) """ self._map_of_map_property = map_of_map_property def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -123,28 +119,20 @@ class AdditionalPropertiesClass(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, AdditionalPropertiesClass): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/animal.py b/samples/client/petstore/python-tornado/petstore_api/models/animal.py index 13d8276713d..390ac83905e 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/animal.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/animal.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -41,14 +41,12 @@ class Animal(object): } discriminator_value_class_map = { - '': 'Dog', - '': 'Cat' + 'Dog': 'Dog', + 'Cat': 'Cat' } - def __init__(self, class_name=None, color='red'): - """ - Animal - a model defined in Swagger - """ + def __init__(self, class_name=None, color='red'): # noqa: E501 + """Animal - a model defined in Swagger""" # noqa: E501 self._class_name = None self._color = None @@ -56,69 +54,62 @@ class Animal(object): self.class_name = class_name if color is not None: - self.color = color + self.color = color @property def class_name(self): - """ - Gets the class_name of this Animal. + """Gets the class_name of this Animal. # noqa: E501 - :return: The class_name of this Animal. + + :return: The class_name of this Animal. # noqa: E501 :rtype: str """ return self._class_name @class_name.setter 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 """ 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 @property def color(self): - """ - Gets the color of this Animal. + """Gets the color of this Animal. # noqa: E501 - :return: The color of this Animal. + + :return: The color of this Animal. # noqa: E501 :rtype: str """ return self._color @color.setter 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 """ self._color = color 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() - if self.discriminator_value_class_map.has_key(discriminator_value): - return self.discriminator_value_class_map[discriminator_value] - else: - return None + return self.discriminator_value_class_map.get(discriminator_value) def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -139,28 +130,20 @@ class Animal(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Animal): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/animal_farm.py b/samples/client/petstore/python-tornado/petstore_api/models/animal_farm.py index fa47d63f881..6371257286e 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/animal_farm.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/animal_farm.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,20 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six + +from petstore_api.models.animal import Animal # noqa: F401,E501 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,28 +33,20 @@ class AnimalFarm(object): and the value is json key in definition. """ swagger_types = { - } attribute_map = { - } - def __init__(self): - """ - AnimalFarm - a model defined in Swagger - """ - + def __init__(self): # noqa: E501 + """AnimalFarm - a model defined in Swagger""" # noqa: E501 self.discriminator = None - def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -73,28 +67,20 @@ class AnimalFarm(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, AnimalFarm): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/api_response.py b/samples/client/petstore/python-tornado/petstore_api/models/api_response.py index b2d784d8020..45c4831bb10 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/api_response.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/api_response.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +42,8 @@ class ApiResponse(object): 'message': 'message' } - def __init__(self, code=None, type=None, message=None): - """ - ApiResponse - a model defined in Swagger - """ + def __init__(self, code=None, type=None, message=None): # noqa: E501 + """ApiResponse - a model defined in Swagger""" # noqa: E501 self._code = None self._type = None @@ -53,28 +51,28 @@ class ApiResponse(object): self.discriminator = None if code is not None: - self.code = code + self.code = code if type is not None: - self.type = type + self.type = type if message is not None: - self.message = message + self.message = message @property def code(self): - """ - Gets the code of this ApiResponse. + """Gets the code of this ApiResponse. # noqa: E501 - :return: The code of this ApiResponse. + + :return: The code of this ApiResponse. # noqa: E501 :rtype: int """ return self._code @code.setter 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 """ @@ -82,20 +80,20 @@ class ApiResponse(object): @property def type(self): - """ - Gets the type of this ApiResponse. + """Gets the type of this ApiResponse. # noqa: E501 - :return: The type of this ApiResponse. + + :return: The type of this ApiResponse. # noqa: E501 :rtype: str """ return self._type @type.setter 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 """ @@ -103,32 +101,30 @@ class ApiResponse(object): @property def message(self): - """ - Gets the message of this ApiResponse. + """Gets the message of this ApiResponse. # noqa: E501 - :return: The message of this ApiResponse. + + :return: The message of this ApiResponse. # noqa: E501 :rtype: str """ return self._message @message.setter 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 """ self._message = message def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -149,28 +145,20 @@ class ApiResponse(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ApiResponse): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/array_of_array_of_number_only.py b/samples/client/petstore/python-tornado/petstore_api/models/array_of_array_of_number_only.py index 0792f5a8a23..c6b363f19d8 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/array_of_array_of_number_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class ArrayOfArrayOfNumberOnly(object): 'array_array_number': 'ArrayArrayNumber' } - def __init__(self, array_array_number=None): - """ - ArrayOfArrayOfNumberOnly - a model defined in Swagger - """ + def __init__(self, array_array_number=None): # noqa: E501 + """ArrayOfArrayOfNumberOnly - a model defined in Swagger""" # noqa: E501 self._array_array_number = None self.discriminator = None if array_array_number is not None: - self.array_array_number = array_array_number + self.array_array_number = array_array_number @property def array_array_number(self): - """ - Gets the array_array_number of this ArrayOfArrayOfNumberOnly. + """Gets the array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 - :return: The array_array_number of this ArrayOfArrayOfNumberOnly. + + :return: The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 :rtype: list[list[float]] """ return self._array_array_number @array_array_number.setter 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]] """ self._array_array_number = array_array_number def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class ArrayOfArrayOfNumberOnly(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ArrayOfArrayOfNumberOnly): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/array_of_number_only.py b/samples/client/petstore/python-tornado/petstore_api/models/array_of_number_only.py index 9d00e1b37a2..240362696cd 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/array_of_number_only.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/array_of_number_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class ArrayOfNumberOnly(object): 'array_number': 'ArrayNumber' } - def __init__(self, array_number=None): - """ - ArrayOfNumberOnly - a model defined in Swagger - """ + def __init__(self, array_number=None): # noqa: E501 + """ArrayOfNumberOnly - a model defined in Swagger""" # noqa: E501 self._array_number = None self.discriminator = None if array_number is not None: - self.array_number = array_number + self.array_number = array_number @property def array_number(self): - """ - Gets the array_number of this ArrayOfNumberOnly. + """Gets the array_number of this ArrayOfNumberOnly. # noqa: E501 - :return: The array_number of this ArrayOfNumberOnly. + + :return: The array_number of this ArrayOfNumberOnly. # noqa: E501 :rtype: list[float] """ return self._array_number @array_number.setter 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] """ self._array_number = array_number def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class ArrayOfNumberOnly(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ArrayOfNumberOnly): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/array_test.py b/samples/client/petstore/python-tornado/petstore_api/models/array_test.py index ac3079087c8..c5cd6bfe159 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/array_test.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/array_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,20 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six + +from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: F401,E501 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +44,8 @@ class ArrayTest(object): '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): - """ - ArrayTest - a model defined in Swagger - """ + 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 self._array_of_string = None self._array_array_of_integer = None @@ -53,28 +53,28 @@ class ArrayTest(object): self.discriminator = 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: - 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: - self.array_array_of_model = array_array_of_model + self.array_array_of_model = array_array_of_model @property def array_of_string(self): - """ - Gets the array_of_string of this ArrayTest. + """Gets the array_of_string of this ArrayTest. # noqa: E501 - :return: The array_of_string of this ArrayTest. + + :return: The array_of_string of this ArrayTest. # noqa: E501 :rtype: list[str] """ return self._array_of_string @array_of_string.setter 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] """ @@ -82,20 +82,20 @@ class ArrayTest(object): @property def array_array_of_integer(self): - """ - Gets the array_array_of_integer of this ArrayTest. + """Gets the array_array_of_integer of this ArrayTest. # noqa: E501 - :return: The array_array_of_integer of this ArrayTest. + + :return: The array_array_of_integer of this ArrayTest. # noqa: E501 :rtype: list[list[int]] """ return self._array_array_of_integer @array_array_of_integer.setter 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]] """ @@ -103,32 +103,30 @@ class ArrayTest(object): @property def array_array_of_model(self): - """ - Gets the array_array_of_model of this ArrayTest. + """Gets the array_array_of_model of this ArrayTest. # noqa: E501 - :return: The array_array_of_model of this ArrayTest. + + :return: The array_array_of_model of this ArrayTest. # noqa: E501 :rtype: list[list[ReadOnlyFirst]] """ return self._array_array_of_model @array_array_of_model.setter 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]] """ self._array_array_of_model = array_array_of_model def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -149,28 +147,20 @@ class ArrayTest(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ArrayTest): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/capitalization.py b/samples/client/petstore/python-tornado/petstore_api/models/capitalization.py index c9be6ed4d15..309642bdeff 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/capitalization.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/capitalization.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -48,10 +48,8 @@ class Capitalization(object): '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): - """ - Capitalization - a model defined in Swagger - """ + 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 self._small_camel = None self._capital_camel = None @@ -62,34 +60,34 @@ class Capitalization(object): self.discriminator = None if small_camel is not None: - self.small_camel = small_camel + self.small_camel = small_camel if capital_camel is not None: - self.capital_camel = capital_camel + self.capital_camel = capital_camel if small_snake is not None: - self.small_snake = small_snake + self.small_snake = small_snake if capital_snake is not None: - self.capital_snake = capital_snake + self.capital_snake = capital_snake 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: - self.att_name = att_name + self.att_name = att_name @property def small_camel(self): - """ - Gets the small_camel of this Capitalization. + """Gets the small_camel of this Capitalization. # noqa: E501 - :return: The small_camel of this Capitalization. + + :return: The small_camel of this Capitalization. # noqa: E501 :rtype: str """ return self._small_camel @small_camel.setter 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 """ @@ -97,20 +95,20 @@ class Capitalization(object): @property def capital_camel(self): - """ - Gets the capital_camel of this Capitalization. + """Gets the capital_camel of this Capitalization. # noqa: E501 - :return: The capital_camel of this Capitalization. + + :return: The capital_camel of this Capitalization. # noqa: E501 :rtype: str """ return self._capital_camel @capital_camel.setter 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 """ @@ -118,20 +116,20 @@ class Capitalization(object): @property def small_snake(self): - """ - Gets the small_snake of this Capitalization. + """Gets the small_snake of this Capitalization. # noqa: E501 - :return: The small_snake of this Capitalization. + + :return: The small_snake of this Capitalization. # noqa: E501 :rtype: str """ return self._small_snake @small_snake.setter 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 """ @@ -139,20 +137,20 @@ class Capitalization(object): @property def capital_snake(self): - """ - Gets the capital_snake of this Capitalization. + """Gets the capital_snake of this Capitalization. # noqa: E501 - :return: The capital_snake of this Capitalization. + + :return: The capital_snake of this Capitalization. # noqa: E501 :rtype: str """ return self._capital_snake @capital_snake.setter 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 """ @@ -160,20 +158,20 @@ class Capitalization(object): @property def sca_eth_flow_points(self): - """ - Gets the sca_eth_flow_points of this Capitalization. + """Gets the sca_eth_flow_points of this Capitalization. # noqa: E501 - :return: The sca_eth_flow_points of this Capitalization. + + :return: The sca_eth_flow_points of this Capitalization. # noqa: E501 :rtype: str """ return self._sca_eth_flow_points @sca_eth_flow_points.setter 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 """ @@ -181,34 +179,32 @@ class Capitalization(object): @property def att_name(self): - """ - Gets the att_name of this Capitalization. - Name of the pet + """Gets the att_name of this Capitalization. # noqa: E501 - :return: The att_name of this Capitalization. + Name of the pet # noqa: E501 + + :return: The att_name of this Capitalization. # noqa: E501 :rtype: str """ return self._att_name @att_name.setter def att_name(self, att_name): - """ - Sets the att_name of this Capitalization. - Name of the pet + """Sets the att_name of this Capitalization. - :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 """ self._att_name = att_name def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -229,28 +225,20 @@ class Capitalization(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Capitalization): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/cat.py b/samples/client/petstore/python-tornado/petstore_api/models/cat.py index 76dfdc0e5b1..526d3e2aaf5 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/cat.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/cat.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,20 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six + +from petstore_api.models.animal import Animal # noqa: F401,E501 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +40,41 @@ class Cat(object): 'declawed': 'declawed' } - def __init__(self, declawed=None): - """ - Cat - a model defined in Swagger - """ + def __init__(self, declawed=None): # noqa: E501 + """Cat - a model defined in Swagger""" # noqa: E501 self._declawed = None self.discriminator = None if declawed is not None: - self.declawed = declawed + self.declawed = declawed @property def declawed(self): - """ - Gets the declawed of this Cat. + """Gets the declawed of this Cat. # noqa: E501 - :return: The declawed of this Cat. + + :return: The declawed of this Cat. # noqa: E501 :rtype: bool """ return self._declawed @declawed.setter 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 """ self._declawed = declawed def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +95,20 @@ class Cat(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Cat): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/category.py b/samples/client/petstore/python-tornado/petstore_api/models/category.py index 859283a3f77..02d393af888 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/category.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/category.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class Category(object): 'name': 'name' } - def __init__(self, id=None, name=None): - """ - Category - a model defined in Swagger - """ + def __init__(self, id=None, name=None): # noqa: E501 + """Category - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None self.discriminator = None if id is not None: - self.id = id + self.id = id if name is not None: - self.name = name + self.name = name @property def id(self): - """ - Gets the id of this Category. + """Gets the id of this Category. # noqa: E501 - :return: The id of this Category. + + :return: The id of this Category. # noqa: E501 :rtype: int """ return self._id @id.setter 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 """ @@ -77,32 +75,30 @@ class Category(object): @property def name(self): - """ - Gets the name of this Category. + """Gets the name of this Category. # noqa: E501 - :return: The name of this Category. + + :return: The name of this Category. # noqa: E501 :rtype: str """ return self._name @name.setter 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 """ self._name = name def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -123,28 +119,20 @@ class Category(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Category): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/class_model.py b/samples/client/petstore/python-tornado/petstore_api/models/class_model.py index 7b39d38abe9..4bcb19b8dc2 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/class_model.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/class_model.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class ClassModel(object): '_class': '_class' } - def __init__(self, _class=None): - """ - ClassModel - a model defined in Swagger - """ + def __init__(self, _class=None): # noqa: E501 + """ClassModel - a model defined in Swagger""" # noqa: E501 self.__class = None self.discriminator = None if _class is not None: - self._class = _class + self._class = _class @property def _class(self): - """ - Gets the _class of this ClassModel. + """Gets the _class of this ClassModel. # noqa: E501 - :return: The _class of this ClassModel. + + :return: The _class of this ClassModel. # noqa: E501 :rtype: str """ return self.__class @_class.setter 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 """ self.__class = _class def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class ClassModel(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ClassModel): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/client.py b/samples/client/petstore/python-tornado/petstore_api/models/client.py index 395f77913cc..e267fed6d8c 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/client.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/client.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class Client(object): 'client': 'client' } - def __init__(self, client=None): - """ - Client - a model defined in Swagger - """ + def __init__(self, client=None): # noqa: E501 + """Client - a model defined in Swagger""" # noqa: E501 self._client = None self.discriminator = None if client is not None: - self.client = client + self.client = client @property def client(self): - """ - Gets the client of this Client. + """Gets the client of this Client. # noqa: E501 - :return: The client of this Client. + + :return: The client of this Client. # noqa: E501 :rtype: str """ return self._client @client.setter 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 """ self._client = client def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class Client(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Client): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/dog.py b/samples/client/petstore/python-tornado/petstore_api/models/dog.py index 3c159ad0d6f..34aac6aaad4 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/dog.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/dog.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,20 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six + +from petstore_api.models.animal import Animal # noqa: F401,E501 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +40,41 @@ class Dog(object): 'breed': 'breed' } - def __init__(self, breed=None): - """ - Dog - a model defined in Swagger - """ + def __init__(self, breed=None): # noqa: E501 + """Dog - a model defined in Swagger""" # noqa: E501 self._breed = None self.discriminator = None if breed is not None: - self.breed = breed + self.breed = breed @property def breed(self): - """ - Gets the breed of this Dog. + """Gets the breed of this Dog. # noqa: E501 - :return: The breed of this Dog. + + :return: The breed of this Dog. # noqa: E501 :rtype: str """ return self._breed @breed.setter 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 """ self._breed = breed def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +95,20 @@ class Dog(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Dog): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/enum_arrays.py b/samples/client/petstore/python-tornado/petstore_api/models/enum_arrays.py index 893085ea235..d02be298d2f 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/enum_arrays.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/enum_arrays.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,42 +40,40 @@ class EnumArrays(object): 'array_enum': 'array_enum' } - def __init__(self, just_symbol=None, array_enum=None): - """ - EnumArrays - a model defined in Swagger - """ + def __init__(self, just_symbol=None, array_enum=None): # noqa: E501 + """EnumArrays - a model defined in Swagger""" # noqa: E501 self._just_symbol = None self._array_enum = None self.discriminator = None if just_symbol is not None: - self.just_symbol = just_symbol + self.just_symbol = just_symbol if array_enum is not None: - self.array_enum = array_enum + self.array_enum = array_enum @property def just_symbol(self): - """ - Gets the just_symbol of this EnumArrays. + """Gets the just_symbol of this EnumArrays. # noqa: E501 - :return: The just_symbol of this EnumArrays. + + :return: The just_symbol of this EnumArrays. # noqa: E501 :rtype: str """ return self._just_symbol @just_symbol.setter 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 """ - allowed_values = [">=", "$"] + allowed_values = [">=", "$"] # noqa: E501 if just_symbol not in allowed_values: 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) ) @@ -83,39 +81,37 @@ class EnumArrays(object): @property def array_enum(self): - """ - Gets the array_enum of this EnumArrays. + """Gets the array_enum of this EnumArrays. # noqa: E501 - :return: The array_enum of this EnumArrays. + + :return: The array_enum of this EnumArrays. # noqa: E501 :rtype: list[str] """ return self._array_enum @array_enum.setter 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] """ - allowed_values = ["fish", "crab"] + allowed_values = ["fish", "crab"] # noqa: E501 if not set(array_enum).issubset(set(allowed_values)): raise ValueError( - "Invalid values for `array_enum` [{0}], must be a subset of [{1}]" - .format(", ".join(map(str, set(array_enum)-set(allowed_values))), + "Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501 ", ".join(map(str, allowed_values))) ) self._array_enum = array_enum def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -136,28 +132,20 @@ class EnumArrays(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, EnumArrays): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/enum_class.py b/samples/client/petstore/python-tornado/petstore_api/models/enum_class.py index d9e0b771a7d..e4721545e83 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/enum_class.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/enum_class.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,14 +11,15 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ @@ -37,28 +38,20 @@ class EnumClass(object): and the value is json key in definition. """ swagger_types = { - } attribute_map = { - } - def __init__(self): - """ - EnumClass - a model defined in Swagger - """ - + def __init__(self): # noqa: E501 + """EnumClass - a model defined in Swagger""" # noqa: E501 self.discriminator = None - def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -79,28 +72,20 @@ class EnumClass(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, EnumClass): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/enum_test.py b/samples/client/petstore/python-tornado/petstore_api/models/enum_test.py index 6d7caa1f4bc..1bb234764ab 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/enum_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,20 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six + +from petstore_api.models.outer_enum import OuterEnum # noqa: F401,E501 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,10 +46,8 @@ class EnumTest(object): 'outer_enum': 'outerEnum' } - def __init__(self, enum_string=None, enum_integer=None, enum_number=None, outer_enum=None): - """ - EnumTest - a model defined in Swagger - """ + 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 self._enum_string = None self._enum_integer = None @@ -56,36 +56,36 @@ class EnumTest(object): self.discriminator = None if enum_string is not None: - self.enum_string = enum_string + self.enum_string = enum_string if enum_integer is not None: - self.enum_integer = enum_integer + self.enum_integer = enum_integer if enum_number is not None: - self.enum_number = enum_number + self.enum_number = enum_number if outer_enum is not None: - self.outer_enum = outer_enum + self.outer_enum = outer_enum @property def enum_string(self): - """ - Gets the enum_string of this EnumTest. + """Gets the enum_string of this EnumTest. # noqa: E501 - :return: The enum_string of this EnumTest. + + :return: The enum_string of this EnumTest. # noqa: E501 :rtype: str """ return self._enum_string @enum_string.setter 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 """ - allowed_values = ["UPPER", "lower", ""] + allowed_values = ["UPPER", "lower", ""] # noqa: E501 if enum_string not in allowed_values: 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) ) @@ -93,26 +93,26 @@ class EnumTest(object): @property def enum_integer(self): - """ - Gets the enum_integer of this EnumTest. + """Gets the enum_integer of this EnumTest. # noqa: E501 - :return: The enum_integer of this EnumTest. + + :return: The enum_integer of this EnumTest. # noqa: E501 :rtype: int """ return self._enum_integer @enum_integer.setter 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 """ - allowed_values = [1, -1] + allowed_values = [1, -1] # noqa: E501 if enum_integer not in allowed_values: 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) ) @@ -120,26 +120,26 @@ class EnumTest(object): @property def enum_number(self): - """ - Gets the enum_number of this EnumTest. + """Gets the enum_number of this EnumTest. # noqa: E501 - :return: The enum_number of this EnumTest. + + :return: The enum_number of this EnumTest. # noqa: E501 :rtype: float """ return self._enum_number @enum_number.setter 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 """ - allowed_values = [1.1, -1.2] + allowed_values = [1.1, -1.2] # noqa: E501 if enum_number not in allowed_values: 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) ) @@ -147,32 +147,30 @@ class EnumTest(object): @property def outer_enum(self): - """ - Gets the outer_enum of this EnumTest. + """Gets the outer_enum of this EnumTest. # noqa: E501 - :return: The outer_enum of this EnumTest. + + :return: The outer_enum of this EnumTest. # noqa: E501 :rtype: OuterEnum """ return self._outer_enum @outer_enum.setter 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 """ self._outer_enum = outer_enum def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -193,28 +191,20 @@ class EnumTest(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, EnumTest): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/format_test.py b/samples/client/petstore/python-tornado/petstore_api/models/format_test.py index 139d1733b35..7974d732fda 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/format_test.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/format_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -62,10 +62,8 @@ class FormatTest(object): '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): - """ - FormatTest - a model defined in Swagger - """ + 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 self._integer = None self._int32 = None @@ -83,94 +81,94 @@ class FormatTest(object): self.discriminator = None if integer is not None: - self.integer = integer + self.integer = integer if int32 is not None: - self.int32 = int32 + self.int32 = int32 if int64 is not None: - self.int64 = int64 + self.int64 = int64 self.number = number if float is not None: - self.float = float + self.float = float if double is not None: - self.double = double + self.double = double if string is not None: - self.string = string + self.string = string self.byte = byte if binary is not None: - self.binary = binary + self.binary = binary self.date = date if date_time is not None: - self.date_time = date_time + self.date_time = date_time if uuid is not None: - self.uuid = uuid + self.uuid = uuid self.password = password @property def integer(self): - """ - Gets the integer of this FormatTest. + """Gets the integer of this FormatTest. # noqa: E501 - :return: The integer of this FormatTest. + + :return: The integer of this FormatTest. # noqa: E501 :rtype: int """ return self._integer @integer.setter 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 """ - if integer is not None and integer > 100: - raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100`") - if integer is not None and integer < 10: - raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") + 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`") # noqa: E501 + 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`") # noqa: E501 self._integer = integer @property def int32(self): - """ - Gets the int32 of this FormatTest. + """Gets the int32 of this FormatTest. # noqa: E501 - :return: The int32 of this FormatTest. + + :return: The int32 of this FormatTest. # noqa: E501 :rtype: int """ return self._int32 @int32.setter 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 """ - if int32 is not None and int32 > 200: - raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200`") - if int32 is not None and int32 < 20: - raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") + 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`") # noqa: E501 + 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`") # noqa: E501 self._int32 = int32 @property def int64(self): - """ - Gets the int64 of this FormatTest. + """Gets the int64 of this FormatTest. # noqa: E501 - :return: The int64 of this FormatTest. + + :return: The int64 of this FormatTest. # noqa: E501 :rtype: int """ return self._int64 @int64.setter 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 """ @@ -178,145 +176,145 @@ class FormatTest(object): @property def number(self): - """ - Gets the number of this FormatTest. + """Gets the number of this FormatTest. # noqa: E501 - :return: The number of this FormatTest. + + :return: The number of this FormatTest. # noqa: E501 :rtype: float """ return self._number @number.setter 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 """ if number is None: - raise ValueError("Invalid value for `number`, must not be `None`") - if number is not None and number > 543.2: - raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`") - if number is not None and number < 32.1: - raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") + raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501 + 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`") # noqa: E501 + 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`") # noqa: E501 self._number = number @property def float(self): - """ - Gets the float of this FormatTest. + """Gets the float of this FormatTest. # noqa: E501 - :return: The float of this FormatTest. + + :return: The float of this FormatTest. # noqa: E501 :rtype: float """ return self._float @float.setter 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 """ - if float is not None and float > 987.6: - raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") - if float is not None and float < 54.3: - raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") + 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`") # noqa: E501 + 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`") # noqa: E501 self._float = float @property def double(self): - """ - Gets the double of this FormatTest. + """Gets the double of this FormatTest. # noqa: E501 - :return: The double of this FormatTest. + + :return: The double of this FormatTest. # noqa: E501 :rtype: float """ return self._double @double.setter 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 """ - if double is not None and double > 123.4: - raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`") - if double is not None and double < 67.8: - raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") + 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`") # noqa: E501 + 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`") # noqa: E501 self._double = double @property def string(self): - """ - Gets the string of this FormatTest. + """Gets the string of this FormatTest. # noqa: E501 - :return: The string of this FormatTest. + + :return: The string of this FormatTest. # noqa: E501 :rtype: str """ return self._string @string.setter 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 """ - if string is not None and not re.search('[a-z]', string, flags=re.IGNORECASE): - raise ValueError("Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") + 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`") # noqa: E501 self._string = string @property def byte(self): - """ - Gets the byte of this FormatTest. + """Gets the byte of this FormatTest. # noqa: E501 - :return: The byte of this FormatTest. + + :return: The byte of this FormatTest. # noqa: E501 :rtype: str """ return self._byte @byte.setter 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 """ if byte is None: - raise ValueError("Invalid value for `byte`, must not be `None`") - 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): - 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 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): # 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}=)?$/`") # noqa: E501 self._byte = byte @property def binary(self): - """ - Gets the binary of this FormatTest. + """Gets the binary of this FormatTest. # noqa: E501 - :return: The binary of this FormatTest. + + :return: The binary of this FormatTest. # noqa: E501 :rtype: str """ return self._binary @binary.setter 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 """ @@ -324,43 +322,43 @@ class FormatTest(object): @property def date(self): - """ - Gets the date of this FormatTest. + """Gets the date of this FormatTest. # noqa: E501 - :return: The date of this FormatTest. + + :return: The date of this FormatTest. # noqa: E501 :rtype: date """ return self._date @date.setter 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 """ 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 @property def date_time(self): - """ - Gets the date_time of this FormatTest. + """Gets the date_time of this FormatTest. # noqa: E501 - :return: The date_time of this FormatTest. + + :return: The date_time of this FormatTest. # noqa: E501 :rtype: datetime """ return self._date_time @date_time.setter 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 """ @@ -368,20 +366,20 @@ class FormatTest(object): @property def uuid(self): - """ - Gets the uuid of this FormatTest. + """Gets the uuid of this FormatTest. # noqa: E501 - :return: The uuid of this FormatTest. + + :return: The uuid of this FormatTest. # noqa: E501 :rtype: str """ return self._uuid @uuid.setter 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 """ @@ -389,38 +387,36 @@ class FormatTest(object): @property def password(self): - """ - Gets the password of this FormatTest. + """Gets the password of this FormatTest. # noqa: E501 - :return: The password of this FormatTest. + + :return: The password of this FormatTest. # noqa: E501 :rtype: str """ return self._password @password.setter 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 """ 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: - 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: - 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 def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -441,28 +437,20 @@ class FormatTest(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, FormatTest): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/has_only_read_only.py b/samples/client/petstore/python-tornado/petstore_api/models/has_only_read_only.py index da0c14ec5b1..3c93eb30996 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/has_only_read_only.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/has_only_read_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class HasOnlyReadOnly(object): 'foo': 'foo' } - def __init__(self, bar=None, foo=None): - """ - HasOnlyReadOnly - a model defined in Swagger - """ + def __init__(self, bar=None, foo=None): # noqa: E501 + """HasOnlyReadOnly - a model defined in Swagger""" # noqa: E501 self._bar = None self._foo = None self.discriminator = None if bar is not None: - self.bar = bar + self.bar = bar if foo is not None: - self.foo = foo + self.foo = foo @property def bar(self): - """ - Gets the bar of this HasOnlyReadOnly. + """Gets the bar of this HasOnlyReadOnly. # noqa: E501 - :return: The bar of this HasOnlyReadOnly. + + :return: The bar of this HasOnlyReadOnly. # noqa: E501 :rtype: str """ return self._bar @bar.setter 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 """ @@ -77,32 +75,30 @@ class HasOnlyReadOnly(object): @property def foo(self): - """ - Gets the foo of this HasOnlyReadOnly. + """Gets the foo of this HasOnlyReadOnly. # noqa: E501 - :return: The foo of this HasOnlyReadOnly. + + :return: The foo of this HasOnlyReadOnly. # noqa: E501 :rtype: str """ return self._foo @foo.setter 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 """ self._foo = foo def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -123,28 +119,20 @@ class HasOnlyReadOnly(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, HasOnlyReadOnly): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/list.py b/samples/client/petstore/python-tornado/petstore_api/models/list.py index 2ac0e51fb12..fbe30e6d01e 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/list.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/list.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class List(object): '_123_list': '123-list' } - def __init__(self, _123_list=None): - """ - List - a model defined in Swagger - """ + def __init__(self, _123_list=None): # noqa: E501 + """List - a model defined in Swagger""" # noqa: E501 self.__123_list = None self.discriminator = None if _123_list is not None: - self._123_list = _123_list + self._123_list = _123_list @property def _123_list(self): - """ - Gets the _123_list of this List. + """Gets the _123_list of this List. # noqa: E501 - :return: The _123_list of this List. + + :return: The _123_list of this List. # noqa: E501 :rtype: str """ return self.__123_list @_123_list.setter 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 """ self.__123_list = _123_list def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class List(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, List): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/map_test.py b/samples/client/petstore/python-tornado/petstore_api/models/map_test.py index 3cb936e0db8..374c0661ba5 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/map_test.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/map_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class MapTest(object): 'map_of_enum_string': 'map_of_enum_string' } - def __init__(self, map_map_of_string=None, map_of_enum_string=None): - """ - MapTest - a model defined in Swagger - """ + def __init__(self, map_map_of_string=None, map_of_enum_string=None): # noqa: E501 + """MapTest - a model defined in Swagger""" # noqa: E501 self._map_map_of_string = None self._map_of_enum_string = None self.discriminator = 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: - self.map_of_enum_string = map_of_enum_string + self.map_of_enum_string = map_of_enum_string @property def map_map_of_string(self): - """ - Gets the map_map_of_string of this MapTest. + """Gets the map_map_of_string of this MapTest. # noqa: E501 - :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)) """ return self._map_map_of_string @map_map_of_string.setter 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)) """ @@ -77,39 +75,37 @@ class MapTest(object): @property def map_of_enum_string(self): - """ - Gets the map_of_enum_string of this MapTest. + """Gets the map_of_enum_string of this MapTest. # noqa: E501 - :return: The map_of_enum_string of this MapTest. + + :return: The map_of_enum_string of this MapTest. # noqa: E501 :rtype: dict(str, str) """ return self._map_of_enum_string @map_of_enum_string.setter 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) """ - allowed_values = ["UPPER", "lower"] + allowed_values = ["UPPER", "lower"] # noqa: E501 if not set(map_of_enum_string.keys()).issubset(set(allowed_values)): raise ValueError( - "Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" - .format(", ".join(map(str, set(map_of_enum_string.keys())-set(allowed_values))), + "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))), # noqa: E501 ", ".join(map(str, allowed_values))) ) self._map_of_enum_string = map_of_enum_string def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -130,28 +126,20 @@ class MapTest(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, MapTest): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-tornado/petstore_api/models/mixed_properties_and_additional_properties_class.py index 4b773deacef..dba1f261352 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,20 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six + +from petstore_api.models.animal import Animal # noqa: F401,E501 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +44,8 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): 'map': 'map' } - def __init__(self, uuid=None, date_time=None, map=None): - """ - MixedPropertiesAndAdditionalPropertiesClass - a model defined in Swagger - """ + def __init__(self, uuid=None, date_time=None, map=None): # noqa: E501 + """MixedPropertiesAndAdditionalPropertiesClass - a model defined in Swagger""" # noqa: E501 self._uuid = None self._date_time = None @@ -53,28 +53,28 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): self.discriminator = None if uuid is not None: - self.uuid = uuid + self.uuid = uuid if date_time is not None: - self.date_time = date_time + self.date_time = date_time if map is not None: - self.map = map + self.map = map @property def uuid(self): - """ - Gets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. + """Gets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :return: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. + + :return: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 :rtype: str """ return self._uuid @uuid.setter 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 """ @@ -82,20 +82,20 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): @property def date_time(self): - """ - Gets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. + """Gets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :return: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. + + :return: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 :rtype: datetime """ return self._date_time @date_time.setter 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 """ @@ -103,32 +103,30 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): @property def map(self): - """ - Gets the map of this MixedPropertiesAndAdditionalPropertiesClass. + """Gets the map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :return: The map of this MixedPropertiesAndAdditionalPropertiesClass. + + :return: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, Animal) """ return self._map @map.setter 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) """ self._map = map def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -149,28 +147,20 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/model_200_response.py b/samples/client/petstore/python-tornado/petstore_api/models/model_200_response.py index 2b6aeb090c0..60f9c96a676 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/model_200_response.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/model_200_response.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class Model200Response(object): '_class': 'class' } - def __init__(self, name=None, _class=None): - """ - Model200Response - a model defined in Swagger - """ + def __init__(self, name=None, _class=None): # noqa: E501 + """Model200Response - a model defined in Swagger""" # noqa: E501 self._name = None self.__class = None self.discriminator = None if name is not None: - self.name = name + self.name = name if _class is not None: - self._class = _class + self._class = _class @property def name(self): - """ - Gets the name of this Model200Response. + """Gets the name of this Model200Response. # noqa: E501 - :return: The name of this Model200Response. + + :return: The name of this Model200Response. # noqa: E501 :rtype: int """ return self._name @name.setter 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 """ @@ -77,32 +75,30 @@ class Model200Response(object): @property def _class(self): - """ - Gets the _class of this Model200Response. + """Gets the _class of this Model200Response. # noqa: E501 - :return: The _class of this Model200Response. + + :return: The _class of this Model200Response. # noqa: E501 :rtype: str """ return self.__class @_class.setter 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 """ self.__class = _class def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -123,28 +119,20 @@ class Model200Response(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Model200Response): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/model_return.py b/samples/client/petstore/python-tornado/petstore_api/models/model_return.py index a2160d21dd1..c9d8b5682aa 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/model_return.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/model_return.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class ModelReturn(object): '_return': 'return' } - def __init__(self, _return=None): - """ - ModelReturn - a model defined in Swagger - """ + def __init__(self, _return=None): # noqa: E501 + """ModelReturn - a model defined in Swagger""" # noqa: E501 self.__return = None self.discriminator = None if _return is not None: - self._return = _return + self._return = _return @property def _return(self): - """ - Gets the _return of this ModelReturn. + """Gets the _return of this ModelReturn. # noqa: E501 - :return: The _return of this ModelReturn. + + :return: The _return of this ModelReturn. # noqa: E501 :rtype: int """ return self.__return @_return.setter 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 """ self.__return = _return def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class ModelReturn(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ModelReturn): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/name.py b/samples/client/petstore/python-tornado/petstore_api/models/name.py index 52b51890dde..cbfbddeb1ab 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/name.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/name.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,10 +44,8 @@ class Name(object): '_123_number': '123Number' } - def __init__(self, name=None, snake_case=None, _property=None, _123_number=None): - """ - Name - a model defined in Swagger - """ + def __init__(self, name=None, snake_case=None, _property=None, _123_number=None): # noqa: E501 + """Name - a model defined in Swagger""" # noqa: E501 self._name = None self._snake_case = None @@ -57,51 +55,51 @@ class Name(object): self.name = name if snake_case is not None: - self.snake_case = snake_case + self.snake_case = snake_case if _property is not None: - self._property = _property + self._property = _property if _123_number is not None: - self._123_number = _123_number + self._123_number = _123_number @property def name(self): - """ - Gets the name of this Name. + """Gets the name of this Name. # noqa: E501 - :return: The name of this Name. + + :return: The name of this Name. # noqa: E501 :rtype: int """ return self._name @name.setter 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 """ 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 @property def snake_case(self): - """ - Gets the snake_case of this Name. + """Gets the snake_case of this Name. # noqa: E501 - :return: The snake_case of this Name. + + :return: The snake_case of this Name. # noqa: E501 :rtype: int """ return self._snake_case @snake_case.setter 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 """ @@ -109,20 +107,20 @@ class Name(object): @property def _property(self): - """ - Gets the _property of this Name. + """Gets the _property of this Name. # noqa: E501 - :return: The _property of this Name. + + :return: The _property of this Name. # noqa: E501 :rtype: str """ return self.__property @_property.setter 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 """ @@ -130,32 +128,30 @@ class Name(object): @property def _123_number(self): - """ - Gets the _123_number of this Name. + """Gets the _123_number of this Name. # noqa: E501 - :return: The _123_number of this Name. + + :return: The _123_number of this Name. # noqa: E501 :rtype: int """ return self.__123_number @_123_number.setter 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 """ self.__123_number = _123_number def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -176,28 +172,20 @@ class Name(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Name): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/number_only.py b/samples/client/petstore/python-tornado/petstore_api/models/number_only.py index b0e279b53a5..b96321109b9 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/number_only.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/number_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class NumberOnly(object): 'just_number': 'JustNumber' } - def __init__(self, just_number=None): - """ - NumberOnly - a model defined in Swagger - """ + def __init__(self, just_number=None): # noqa: E501 + """NumberOnly - a model defined in Swagger""" # noqa: E501 self._just_number = None self.discriminator = None if just_number is not None: - self.just_number = just_number + self.just_number = just_number @property def just_number(self): - """ - Gets the just_number of this NumberOnly. + """Gets the just_number of this NumberOnly. # noqa: E501 - :return: The just_number of this NumberOnly. + + :return: The just_number of this NumberOnly. # noqa: E501 :rtype: float """ return self._just_number @just_number.setter 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 """ self._just_number = just_number def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class NumberOnly(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, NumberOnly): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/order.py b/samples/client/petstore/python-tornado/petstore_api/models/order.py index 52c7b6c227e..6636542e941 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/order.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/order.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -48,10 +48,8 @@ class Order(object): 'complete': 'complete' } - def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False): - """ - Order - a model defined in Swagger - """ + 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 self._id = None self._pet_id = None @@ -62,34 +60,34 @@ class Order(object): self.discriminator = None if id is not None: - self.id = id + self.id = id if pet_id is not None: - self.pet_id = pet_id + self.pet_id = pet_id if quantity is not None: - self.quantity = quantity + self.quantity = quantity if ship_date is not None: - self.ship_date = ship_date + self.ship_date = ship_date if status is not None: - self.status = status + self.status = status if complete is not None: - self.complete = complete + self.complete = complete @property def id(self): - """ - Gets the id of this Order. + """Gets the id of this Order. # noqa: E501 - :return: The id of this Order. + + :return: The id of this Order. # noqa: E501 :rtype: int """ return self._id @id.setter 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 """ @@ -97,20 +95,20 @@ class Order(object): @property def pet_id(self): - """ - Gets the pet_id of this Order. + """Gets the pet_id of this Order. # noqa: E501 - :return: The pet_id of this Order. + + :return: The pet_id of this Order. # noqa: E501 :rtype: int """ return self._pet_id @pet_id.setter 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 """ @@ -118,20 +116,20 @@ class Order(object): @property def quantity(self): - """ - Gets the quantity of this Order. + """Gets the quantity of this Order. # noqa: E501 - :return: The quantity of this Order. + + :return: The quantity of this Order. # noqa: E501 :rtype: int """ return self._quantity @quantity.setter 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 """ @@ -139,20 +137,20 @@ class Order(object): @property def ship_date(self): - """ - Gets the ship_date of this Order. + """Gets the ship_date of this Order. # noqa: E501 - :return: The ship_date of this Order. + + :return: The ship_date of this Order. # noqa: E501 :rtype: datetime """ return self._ship_date @ship_date.setter 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 """ @@ -160,28 +158,28 @@ class Order(object): @property def status(self): - """ - Gets the status of this Order. - Order Status + """Gets the status of this Order. # noqa: E501 - :return: The status of this Order. + Order Status # noqa: E501 + + :return: The status of this Order. # noqa: E501 :rtype: str """ return self._status @status.setter def status(self, status): - """ - Sets the status of this Order. - Order Status + """Sets the status of this Order. - :param status: The status of this Order. + Order Status # noqa: E501 + + :param status: The status of this Order. # noqa: E501 :type: str """ - allowed_values = ["placed", "approved", "delivered"] + allowed_values = ["placed", "approved", "delivered"] # noqa: E501 if status not in allowed_values: 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) ) @@ -189,32 +187,30 @@ class Order(object): @property def complete(self): - """ - Gets the complete of this Order. + """Gets the complete of this Order. # noqa: E501 - :return: The complete of this Order. + + :return: The complete of this Order. # noqa: E501 :rtype: bool """ return self._complete @complete.setter 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 """ self._complete = complete def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -235,28 +231,20 @@ class Order(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Order): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/outer_boolean.py b/samples/client/petstore/python-tornado/petstore_api/models/outer_boolean.py index aa9aee11973..9b3aebd3608 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/outer_boolean.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/outer_boolean.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,28 +31,20 @@ class OuterBoolean(object): and the value is json key in definition. """ swagger_types = { - } attribute_map = { - } - def __init__(self): - """ - OuterBoolean - a model defined in Swagger - """ - + def __init__(self): # noqa: E501 + """OuterBoolean - a model defined in Swagger""" # noqa: E501 self.discriminator = None - def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -73,28 +65,20 @@ class OuterBoolean(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, OuterBoolean): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/outer_composite.py b/samples/client/petstore/python-tornado/petstore_api/models/outer_composite.py index 81611c17688..19775255e4e 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/outer_composite.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/outer_composite.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,22 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +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): - """ - 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +46,8 @@ class OuterComposite(object): 'my_boolean': 'my_boolean' } - def __init__(self, my_number=None, my_string=None, my_boolean=None): - """ - OuterComposite - a model defined in Swagger - """ + def __init__(self, my_number=None, my_string=None, my_boolean=None): # noqa: E501 + """OuterComposite - a model defined in Swagger""" # noqa: E501 self._my_number = None self._my_string = None @@ -53,28 +55,28 @@ class OuterComposite(object): self.discriminator = None if my_number is not None: - self.my_number = my_number + self.my_number = my_number if my_string is not None: - self.my_string = my_string + self.my_string = my_string if my_boolean is not None: - self.my_boolean = my_boolean + self.my_boolean = my_boolean @property def my_number(self): - """ - Gets the my_number of this OuterComposite. + """Gets the my_number of this OuterComposite. # noqa: E501 - :return: The my_number of this OuterComposite. + + :return: The my_number of this OuterComposite. # noqa: E501 :rtype: OuterNumber """ return self._my_number @my_number.setter 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 """ @@ -82,20 +84,20 @@ class OuterComposite(object): @property def my_string(self): - """ - Gets the my_string of this OuterComposite. + """Gets the my_string of this OuterComposite. # noqa: E501 - :return: The my_string of this OuterComposite. + + :return: The my_string of this OuterComposite. # noqa: E501 :rtype: OuterString """ return self._my_string @my_string.setter 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 """ @@ -103,32 +105,30 @@ class OuterComposite(object): @property def my_boolean(self): - """ - Gets the my_boolean of this OuterComposite. + """Gets the my_boolean of this OuterComposite. # noqa: E501 - :return: The my_boolean of this OuterComposite. + + :return: The my_boolean of this OuterComposite. # noqa: E501 :rtype: OuterBoolean """ return self._my_boolean @my_boolean.setter 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 """ self._my_boolean = my_boolean def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -149,28 +149,20 @@ class OuterComposite(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, OuterComposite): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/outer_enum.py b/samples/client/petstore/python-tornado/petstore_api/models/outer_enum.py index 8772472c655..5ee1e49a587 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/outer_enum.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/outer_enum.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,14 +11,15 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ @@ -37,28 +38,20 @@ class OuterEnum(object): and the value is json key in definition. """ swagger_types = { - } attribute_map = { - } - def __init__(self): - """ - OuterEnum - a model defined in Swagger - """ - + def __init__(self): # noqa: E501 + """OuterEnum - a model defined in Swagger""" # noqa: E501 self.discriminator = None - def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -79,28 +72,20 @@ class OuterEnum(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, OuterEnum): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/outer_number.py b/samples/client/petstore/python-tornado/petstore_api/models/outer_number.py index 04c44923fb0..a35587be65e 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/outer_number.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/outer_number.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,28 +31,20 @@ class OuterNumber(object): and the value is json key in definition. """ swagger_types = { - } attribute_map = { - } - def __init__(self): - """ - OuterNumber - a model defined in Swagger - """ - + def __init__(self): # noqa: E501 + """OuterNumber - a model defined in Swagger""" # noqa: E501 self.discriminator = None - def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -73,28 +65,20 @@ class OuterNumber(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, OuterNumber): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/outer_string.py b/samples/client/petstore/python-tornado/petstore_api/models/outer_string.py index fd2d7c7623e..736edacd1bc 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/outer_string.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/outer_string.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,28 +31,20 @@ class OuterString(object): and the value is json key in definition. """ swagger_types = { - } attribute_map = { - } - def __init__(self): - """ - OuterString - a model defined in Swagger - """ - + def __init__(self): # noqa: E501 + """OuterString - a model defined in Swagger""" # noqa: E501 self.discriminator = None - def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -73,28 +65,20 @@ class OuterString(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, OuterString): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/pet.py b/samples/client/petstore/python-tornado/petstore_api/models/pet.py index e1afa26f785..81b2bb617f9 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/pet.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/pet.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,21 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +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): - """ - 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -48,10 +51,8 @@ class Pet(object): 'status': 'status' } - def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None): - """ - Pet - a model defined in Swagger - """ + 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 self._id = None self._category = None @@ -62,32 +63,32 @@ class Pet(object): self.discriminator = None if id is not None: - self.id = id + self.id = id if category is not None: - self.category = category + self.category = category self.name = name self.photo_urls = photo_urls if tags is not None: - self.tags = tags + self.tags = tags if status is not None: - self.status = status + self.status = status @property def id(self): - """ - Gets the id of this Pet. + """Gets the id of this Pet. # noqa: E501 - :return: The id of this Pet. + + :return: The id of this Pet. # noqa: E501 :rtype: int """ return self._id @id.setter 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 """ @@ -95,20 +96,20 @@ class Pet(object): @property def category(self): - """ - Gets the category of this Pet. + """Gets the category of this Pet. # noqa: E501 - :return: The category of this Pet. + + :return: The category of this Pet. # noqa: E501 :rtype: Category """ return self._category @category.setter 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 """ @@ -116,66 +117,66 @@ class Pet(object): @property def name(self): - """ - Gets the name of this Pet. + """Gets the name of this Pet. # noqa: E501 - :return: The name of this Pet. + + :return: The name of this Pet. # noqa: E501 :rtype: str """ return self._name @name.setter 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 """ 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 @property def photo_urls(self): - """ - Gets the photo_urls of this Pet. + """Gets the photo_urls of this Pet. # noqa: E501 - :return: The photo_urls of this Pet. + + :return: The photo_urls of this Pet. # noqa: E501 :rtype: list[str] """ return self._photo_urls @photo_urls.setter 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] """ 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 @property def tags(self): - """ - Gets the tags of this Pet. + """Gets the tags of this Pet. # noqa: E501 - :return: The tags of this Pet. + + :return: The tags of this Pet. # noqa: E501 :rtype: list[Tag] """ return self._tags @tags.setter 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] """ @@ -183,40 +184,38 @@ class Pet(object): @property def status(self): - """ - Gets the status of this Pet. - pet status in the store + """Gets the status of this Pet. # noqa: E501 - :return: The status of this Pet. + pet status in the store # noqa: E501 + + :return: The status of this Pet. # noqa: E501 :rtype: str """ return self._status @status.setter def status(self, status): - """ - Sets the status of this Pet. - pet status in the store + """Sets the status of this Pet. - :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 """ - allowed_values = ["available", "pending", "sold"] + allowed_values = ["available", "pending", "sold"] # noqa: E501 if status not in allowed_values: 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) ) self._status = status def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -237,28 +236,20 @@ class Pet(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Pet): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/read_only_first.py b/samples/client/petstore/python-tornado/petstore_api/models/read_only_first.py index a26d1f33c87..106463077e8 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/read_only_first.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/read_only_first.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class ReadOnlyFirst(object): 'baz': 'baz' } - def __init__(self, bar=None, baz=None): - """ - ReadOnlyFirst - a model defined in Swagger - """ + def __init__(self, bar=None, baz=None): # noqa: E501 + """ReadOnlyFirst - a model defined in Swagger""" # noqa: E501 self._bar = None self._baz = None self.discriminator = None if bar is not None: - self.bar = bar + self.bar = bar if baz is not None: - self.baz = baz + self.baz = baz @property def bar(self): - """ - Gets the bar of this ReadOnlyFirst. + """Gets the bar of this ReadOnlyFirst. # noqa: E501 - :return: The bar of this ReadOnlyFirst. + + :return: The bar of this ReadOnlyFirst. # noqa: E501 :rtype: str """ return self._bar @bar.setter 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 """ @@ -77,32 +75,30 @@ class ReadOnlyFirst(object): @property def baz(self): - """ - Gets the baz of this ReadOnlyFirst. + """Gets the baz of this ReadOnlyFirst. # noqa: E501 - :return: The baz of this ReadOnlyFirst. + + :return: The baz of this ReadOnlyFirst. # noqa: E501 :rtype: str """ return self._baz @baz.setter 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 """ self._baz = baz def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -123,28 +119,20 @@ class ReadOnlyFirst(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ReadOnlyFirst): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/special_model_name.py b/samples/client/petstore/python-tornado/petstore_api/models/special_model_name.py index 6be888fb9e3..a31b8db66e2 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/special_model_name.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/special_model_name.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class SpecialModelName(object): 'special_property_name': '$special[property.name]' } - def __init__(self, special_property_name=None): - """ - SpecialModelName - a model defined in Swagger - """ + def __init__(self, special_property_name=None): # noqa: E501 + """SpecialModelName - a model defined in Swagger""" # noqa: E501 self._special_property_name = None self.discriminator = None if special_property_name is not None: - self.special_property_name = special_property_name + self.special_property_name = special_property_name @property def special_property_name(self): - """ - Gets the special_property_name of this SpecialModelName. + """Gets the special_property_name of this SpecialModelName. # noqa: E501 - :return: The special_property_name of this SpecialModelName. + + :return: The special_property_name of this SpecialModelName. # noqa: E501 :rtype: int """ return self._special_property_name @special_property_name.setter 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 """ self._special_property_name = special_property_name def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class SpecialModelName(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, SpecialModelName): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/tag.py b/samples/client/petstore/python-tornado/petstore_api/models/tag.py index d59a490a07d..b486a672b88 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/tag.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/tag.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class Tag(object): 'name': 'name' } - def __init__(self, id=None, name=None): - """ - Tag - a model defined in Swagger - """ + def __init__(self, id=None, name=None): # noqa: E501 + """Tag - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None self.discriminator = None if id is not None: - self.id = id + self.id = id if name is not None: - self.name = name + self.name = name @property def id(self): - """ - Gets the id of this Tag. + """Gets the id of this Tag. # noqa: E501 - :return: The id of this Tag. + + :return: The id of this Tag. # noqa: E501 :rtype: int """ return self._id @id.setter 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 """ @@ -77,32 +75,30 @@ class Tag(object): @property def name(self): - """ - Gets the name of this Tag. + """Gets the name of this Tag. # noqa: E501 - :return: The name of this Tag. + + :return: The name of this Tag. # noqa: E501 :rtype: str """ return self._name @name.setter 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 """ self._name = name def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -123,28 +119,20 @@ class Tag(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Tag): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/user.py b/samples/client/petstore/python-tornado/petstore_api/models/user.py index 21993e90521..c9fe0072a9c 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/user.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/user.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -52,10 +52,8 @@ class User(object): '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): - """ - User - a model defined in Swagger - """ + 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 self._id = None self._username = None @@ -68,38 +66,38 @@ class User(object): self.discriminator = None if id is not None: - self.id = id + self.id = id if username is not None: - self.username = username + self.username = username if first_name is not None: - self.first_name = first_name + self.first_name = first_name if last_name is not None: - self.last_name = last_name + self.last_name = last_name if email is not None: - self.email = email + self.email = email if password is not None: - self.password = password + self.password = password if phone is not None: - self.phone = phone + self.phone = phone if user_status is not None: - self.user_status = user_status + self.user_status = user_status @property def id(self): - """ - Gets the id of this User. + """Gets the id of this User. # noqa: E501 - :return: The id of this User. + + :return: The id of this User. # noqa: E501 :rtype: int """ return self._id @id.setter 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 """ @@ -107,20 +105,20 @@ class User(object): @property def username(self): - """ - Gets the username of this User. + """Gets the username of this User. # noqa: E501 - :return: The username of this User. + + :return: The username of this User. # noqa: E501 :rtype: str """ return self._username @username.setter 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 """ @@ -128,20 +126,20 @@ class User(object): @property def first_name(self): - """ - Gets the first_name of this User. + """Gets the first_name of this User. # noqa: E501 - :return: The first_name of this User. + + :return: The first_name of this User. # noqa: E501 :rtype: str """ return self._first_name @first_name.setter 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 """ @@ -149,20 +147,20 @@ class User(object): @property def last_name(self): - """ - Gets the last_name of this User. + """Gets the last_name of this User. # noqa: E501 - :return: The last_name of this User. + + :return: The last_name of this User. # noqa: E501 :rtype: str """ return self._last_name @last_name.setter 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 """ @@ -170,20 +168,20 @@ class User(object): @property def email(self): - """ - Gets the email of this User. + """Gets the email of this User. # noqa: E501 - :return: The email of this User. + + :return: The email of this User. # noqa: E501 :rtype: str """ return self._email @email.setter 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 """ @@ -191,20 +189,20 @@ class User(object): @property def password(self): - """ - Gets the password of this User. + """Gets the password of this User. # noqa: E501 - :return: The password of this User. + + :return: The password of this User. # noqa: E501 :rtype: str """ return self._password @password.setter 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 """ @@ -212,20 +210,20 @@ class User(object): @property def phone(self): - """ - Gets the phone of this User. + """Gets the phone of this User. # noqa: E501 - :return: The phone of this User. + + :return: The phone of this User. # noqa: E501 :rtype: str """ return self._phone @phone.setter 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 """ @@ -233,34 +231,32 @@ class User(object): @property def user_status(self): - """ - Gets the user_status of this User. - User Status + """Gets the user_status of this User. # noqa: E501 - :return: The user_status of this User. + User Status # noqa: E501 + + :return: The user_status of this User. # noqa: E501 :rtype: int """ return self._user_status @user_status.setter def user_status(self, user_status): - """ - Sets the user_status of this User. - User Status + """Sets the user_status of this User. - :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 """ self._user_status = user_status def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -281,28 +277,20 @@ class User(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, User): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/rest.py b/samples/client/petstore/python-tornado/petstore_api/rest.py index dc76fcdb917..dc68ca3d60d 100644 --- a/samples/client/petstore/python-tornado/petstore_api/rest.py +++ b/samples/client/petstore/python-tornado/petstore_api/rest.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,16 @@ import io import json -import ssl -import certifi import logging import re +import ssl + +import certifi +# python 2 and python 3 compatibility library +from six.moves.urllib.parse import urlencode import tornado import tornado.gen -from tornado.httpclient import AsyncHTTPClient, HTTPRequest - -# python 2 and python 3 compatibility library -from six import PY3 -from six.moves.urllib.parse import urlencode +from tornado import httpclient from urllib3.filepost import encode_multipart_formdata logger = logging.getLogger(__name__) @@ -38,22 +37,18 @@ class RESTResponse(io.IOBase): self.data = data def getheaders(self): - """ - Returns a CIMultiDictProxy of the response headers. - """ + """Returns a CIMultiDictProxy of the response headers.""" return self.tornado_response.headers def getheader(self, name, default=None): - """ - Returns a given response header. - """ + """Returns a given response header.""" return self.tornado_response.headers.get(name, default) -class RESTClientObject: +class RESTClientObject(object): 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 # http://stackoverflow.com/a/23957365/2985775 @@ -64,9 +59,10 @@ class RESTClientObject: # if not set certificate file, use Mozilla's root certificates. 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: - ssl_context.load_cert_chain( + self.ssl_context.load_cert_chain( configuration.cert_file, keyfile=configuration.key_file ) @@ -77,12 +73,14 @@ class RESTClientObject: self.proxy_port = 80 self.proxy_host = configuration.proxy - self.pool_manager = AsyncHTTPClient() + self.pool_manager = httpclient.AsyncHTTPClient() @tornado.gen.coroutine - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, _request_timeout=None): - """ + def request(self, method, url, query_params=None, headers=None, body=None, + post_params=None, _preload_content=True, + _request_timeout=None): + """Execute Request + :param method: http request method :param url: http request url :param query_params: query parameters in the url @@ -91,19 +89,23 @@ class RESTClientObject: :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: this is a non-applicable field for the AiohttpClient. - :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. + :param _preload_content: this is a non-applicable field for + the AiohttpClient. + :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() - 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: raise ValueError( "body parameter cannot be used with post_params parameter." ) - request = HTTPRequest(url) + request = httpclient.HTTPRequest(url) request.ssl_context = self.ssl_context request.proxy_host = self.proxy_host request.proxy_port = self.proxy_port @@ -114,7 +116,6 @@ class RESTClientObject: request.headers['Content-Type'] = 'application/json' request.request_timeout = _request_timeout or 5 * 60 - post_params = post_params or {} if query_params: @@ -126,9 +127,8 @@ class RESTClientObject: if body: body = json.dumps(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) - # TODO: transform to multipart form elif headers['Content-Type'] == 'multipart/form-data': request.body = encode_multipart_formdata(post_params) # Pass a `bytes` parameter directly in the body to support @@ -138,8 +138,9 @@ class RESTClientObject: request.body = body else: # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided arguments. - Please check that your arguments match declared content type.""" + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" raise ApiException(status=0, reason=msg) r = yield self.pool_manager.fetch(request) @@ -151,40 +152,41 @@ class RESTClientObject: if not 200 <= r.status <= 299: raise ApiException(http_resp=r) - return r - @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, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) raise tornado.gen.Return(result) @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, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) raise tornado.gen.Return(result) @tornado.gen.coroutine - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): result = yield self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) raise tornado.gen.Return(result) @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, headers=headers, query_params=query_params, @@ -194,39 +196,39 @@ class RESTClientObject: raise tornado.gen.Return(result) @tornado.gen.coroutine - def POST(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): result = yield self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) raise tornado.gen.Return(result) @tornado.gen.coroutine - def PUT(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): result = yield self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) raise tornado.gen.Return(result) @tornado.gen.coroutine - def PATCH(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): result = yield self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) raise tornado.gen.Return(result) @@ -245,13 +247,12 @@ class ApiException(Exception): self.headers = None def __str__(self): - """ - Custom error messages for exception - """ - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) + """Custom error messages for exception""" + error_message = "({0})\nReason: {1}\n".format( + self.status, self.reason) 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: error_message += "HTTP response body: {0}\n".format(self.body) diff --git a/samples/client/petstore/python-tornado/setup.py b/samples/client/petstore/python-tornado/setup.py index 7373560db31..ea0a40a1b06 100644 --- a/samples/client/petstore/python-tornado/setup.py +++ b/samples/client/petstore/python-tornado/setup.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,8 +11,7 @@ """ -import sys -from setuptools import setup, find_packages +from setuptools import setup, find_packages # noqa: H301 NAME = "petstore-api" VERSION = "1.0.0" @@ -37,6 +36,6 @@ setup( packages=find_packages(), include_package_data=True, 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: \" \\ + 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 """ ) diff --git a/samples/client/petstore/python-tornado/test/test_additional_properties_class.py b/samples/client/petstore/python-tornado/test/test_additional_properties_class.py index e90e5f92efc..77ccb73b028 100644 --- a/samples/client/petstore/python-tornado/test/test_additional_properties_class.py +++ b/samples/client/petstore/python-tornado/test/test_additional_properties_class.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass class TestAdditionalPropertiesClass(unittest.TestCase): - """ AdditionalPropertiesClass unit test stubs """ + """AdditionalPropertiesClass unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestAdditionalPropertiesClass(unittest.TestCase): pass def testAdditionalPropertiesClass(self): - """ - Test AdditionalPropertiesClass - """ + """Test AdditionalPropertiesClass""" # 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 diff --git a/samples/client/petstore/python-tornado/test/test_animal.py b/samples/client/petstore/python-tornado/test/test_animal.py index c675d583ccc..eb5f7cb930e 100644 --- a/samples/client/petstore/python-tornado/test/test_animal.py +++ b/samples/client/petstore/python-tornado/test/test_animal.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.animal import Animal # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.animal import Animal class TestAnimal(unittest.TestCase): - """ Animal unit test stubs """ + """Animal unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestAnimal(unittest.TestCase): pass def testAnimal(self): - """ - Test Animal - """ + """Test Animal""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.animal.Animal() + # model = petstore_api.models.animal.Animal() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_animal_farm.py b/samples/client/petstore/python-tornado/test/test_animal_farm.py index e459318a948..8f79946fa73 100644 --- a/samples/client/petstore/python-tornado/test/test_animal_farm.py +++ b/samples/client/petstore/python-tornado/test/test_animal_farm.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.animal_farm import AnimalFarm # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.animal_farm import AnimalFarm class TestAnimalFarm(unittest.TestCase): - """ AnimalFarm unit test stubs """ + """AnimalFarm unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestAnimalFarm(unittest.TestCase): pass def testAnimalFarm(self): - """ - Test AnimalFarm - """ + """Test AnimalFarm""" # 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 diff --git a/samples/client/petstore/python-tornado/test/test_another_fake_api.py b/samples/client/petstore/python-tornado/test/test_another_fake_api.py index 9f562fe1134..c294aa90359 100644 --- a/samples/client/petstore/python-tornado/test/test_another_fake_api.py +++ b/samples/client/petstore/python-tornado/test/test_another_fake_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,29 +13,26 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.apis.another_fake_api import AnotherFakeApi class TestAnotherFakeApi(unittest.TestCase): - """ AnotherFakeApi unit test stubs """ + """AnotherFakeApi unit test stubs""" 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): pass 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 diff --git a/samples/client/petstore/python-tornado/test/test_api_response.py b/samples/client/petstore/python-tornado/test/test_api_response.py index 928af048b43..97ed978a5f6 100644 --- a/samples/client/petstore/python-tornado/test/test_api_response.py +++ b/samples/client/petstore/python-tornado/test/test_api_response.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.api_response import ApiResponse # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.api_response import ApiResponse class TestApiResponse(unittest.TestCase): - """ ApiResponse unit test stubs """ + """ApiResponse unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestApiResponse(unittest.TestCase): pass def testApiResponse(self): - """ - Test ApiResponse - """ + """Test ApiResponse""" # 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 diff --git a/samples/client/petstore/python-tornado/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python-tornado/test/test_array_of_array_of_number_only.py index 740e45cbafd..b617ed2cd3e 100644 --- a/samples/client/petstore/python-tornado/test/test_array_of_array_of_number_only.py +++ b/samples/client/petstore/python-tornado/test/test_array_of_array_of_number_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest 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.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly class TestArrayOfArrayOfNumberOnly(unittest.TestCase): - """ ArrayOfArrayOfNumberOnly unit test stubs """ + """ArrayOfArrayOfNumberOnly unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestArrayOfArrayOfNumberOnly(unittest.TestCase): pass def testArrayOfArrayOfNumberOnly(self): - """ - Test ArrayOfArrayOfNumberOnly - """ + """Test ArrayOfArrayOfNumberOnly""" # 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 diff --git a/samples/client/petstore/python-tornado/test/test_array_of_number_only.py b/samples/client/petstore/python-tornado/test/test_array_of_number_only.py index 6da67a490b6..7439364c7b1 100644 --- a/samples/client/petstore/python-tornado/test/test_array_of_number_only.py +++ b/samples/client/petstore/python-tornado/test/test_array_of_number_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly class TestArrayOfNumberOnly(unittest.TestCase): - """ ArrayOfNumberOnly unit test stubs """ + """ArrayOfNumberOnly unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestArrayOfNumberOnly(unittest.TestCase): pass def testArrayOfNumberOnly(self): - """ - Test ArrayOfNumberOnly - """ + """Test ArrayOfNumberOnly""" # 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 diff --git a/samples/client/petstore/python-tornado/test/test_array_test.py b/samples/client/petstore/python-tornado/test/test_array_test.py index dcf8cc111c0..d7feb2ac8f4 100644 --- a/samples/client/petstore/python-tornado/test/test_array_test.py +++ b/samples/client/petstore/python-tornado/test/test_array_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.array_test import ArrayTest # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.array_test import ArrayTest class TestArrayTest(unittest.TestCase): - """ ArrayTest unit test stubs """ + """ArrayTest unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestArrayTest(unittest.TestCase): pass def testArrayTest(self): - """ - Test ArrayTest - """ + """Test ArrayTest""" # 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 diff --git a/samples/client/petstore/python-tornado/test/test_capitalization.py b/samples/client/petstore/python-tornado/test/test_capitalization.py index 4ea6d2e3fd0..4ac874e817c 100644 --- a/samples/client/petstore/python-tornado/test/test_capitalization.py +++ b/samples/client/petstore/python-tornado/test/test_capitalization.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.capitalization import Capitalization # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.capitalization import Capitalization class TestCapitalization(unittest.TestCase): - """ Capitalization unit test stubs """ + """Capitalization unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestCapitalization(unittest.TestCase): pass def testCapitalization(self): - """ - Test Capitalization - """ + """Test Capitalization""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.capitalization.Capitalization() + # model = petstore_api.models.capitalization.Capitalization() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_cat.py b/samples/client/petstore/python-tornado/test/test_cat.py index 9d9fbc50ab3..370f1081383 100644 --- a/samples/client/petstore/python-tornado/test/test_cat.py +++ b/samples/client/petstore/python-tornado/test/test_cat.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.cat import Cat # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.cat import Cat class TestCat(unittest.TestCase): - """ Cat unit test stubs """ + """Cat unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestCat(unittest.TestCase): pass def testCat(self): - """ - Test Cat - """ + """Test Cat""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.cat.Cat() + # model = petstore_api.models.cat.Cat() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_category.py b/samples/client/petstore/python-tornado/test/test_category.py index 6ded8f0f1ac..7a9e40a1f65 100644 --- a/samples/client/petstore/python-tornado/test/test_category.py +++ b/samples/client/petstore/python-tornado/test/test_category.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.category import Category # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.category import Category class TestCategory(unittest.TestCase): - """ Category unit test stubs """ + """Category unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestCategory(unittest.TestCase): pass def testCategory(self): - """ - Test Category - """ + """Test Category""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.category.Category() + # model = petstore_api.models.category.Category() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_class_model.py b/samples/client/petstore/python-tornado/test/test_class_model.py index 85d56bbe52a..a42127abf50 100644 --- a/samples/client/petstore/python-tornado/test/test_class_model.py +++ b/samples/client/petstore/python-tornado/test/test_class_model.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.class_model import ClassModel # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.class_model import ClassModel class TestClassModel(unittest.TestCase): - """ ClassModel unit test stubs """ + """ClassModel unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestClassModel(unittest.TestCase): pass def testClassModel(self): - """ - Test ClassModel - """ + """Test ClassModel""" # 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 diff --git a/samples/client/petstore/python-tornado/test/test_client.py b/samples/client/petstore/python-tornado/test/test_client.py index 363ced2923c..81df726dbfc 100644 --- a/samples/client/petstore/python-tornado/test/test_client.py +++ b/samples/client/petstore/python-tornado/test/test_client.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.client import Client # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.client import Client class TestClient(unittest.TestCase): - """ Client unit test stubs """ + """Client unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestClient(unittest.TestCase): pass def testClient(self): - """ - Test Client - """ + """Test Client""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.client.Client() + # model = petstore_api.models.client.Client() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_dog.py b/samples/client/petstore/python-tornado/test/test_dog.py index b0428646591..ae13869b99f 100644 --- a/samples/client/petstore/python-tornado/test/test_dog.py +++ b/samples/client/petstore/python-tornado/test/test_dog.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.dog import Dog # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.dog import Dog class TestDog(unittest.TestCase): - """ Dog unit test stubs """ + """Dog unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestDog(unittest.TestCase): pass def testDog(self): - """ - Test Dog - """ + """Test Dog""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.dog.Dog() + # model = petstore_api.models.dog.Dog() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_enum_arrays.py b/samples/client/petstore/python-tornado/test/test_enum_arrays.py index 2803f17aede..144e48883e5 100644 --- a/samples/client/petstore/python-tornado/test/test_enum_arrays.py +++ b/samples/client/petstore/python-tornado/test/test_enum_arrays.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.enum_arrays import EnumArrays # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.enum_arrays import EnumArrays class TestEnumArrays(unittest.TestCase): - """ EnumArrays unit test stubs """ + """EnumArrays unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestEnumArrays(unittest.TestCase): pass def testEnumArrays(self): - """ - Test EnumArrays - """ + """Test EnumArrays""" # 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 diff --git a/samples/client/petstore/python-tornado/test/test_enum_class.py b/samples/client/petstore/python-tornado/test/test_enum_class.py index f673e741f84..a47581d2820 100644 --- a/samples/client/petstore/python-tornado/test/test_enum_class.py +++ b/samples/client/petstore/python-tornado/test/test_enum_class.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.enum_class import EnumClass # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.enum_class import EnumClass class TestEnumClass(unittest.TestCase): - """ EnumClass unit test stubs """ + """EnumClass unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestEnumClass(unittest.TestCase): pass def testEnumClass(self): - """ - Test EnumClass - """ + """Test EnumClass""" # 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 diff --git a/samples/client/petstore/python-tornado/test/test_enum_test.py b/samples/client/petstore/python-tornado/test/test_enum_test.py index e27c0107fd2..7487efe9fa1 100644 --- a/samples/client/petstore/python-tornado/test/test_enum_test.py +++ b/samples/client/petstore/python-tornado/test/test_enum_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.enum_test import EnumTest # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.enum_test import EnumTest class TestEnumTest(unittest.TestCase): - """ EnumTest unit test stubs """ + """EnumTest unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestEnumTest(unittest.TestCase): pass def testEnumTest(self): - """ - Test EnumTest - """ + """Test EnumTest""" # 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 diff --git a/samples/client/petstore/python-tornado/test/test_fake_api.py b/samples/client/petstore/python-tornado/test/test_fake_api.py index 55a02cf899c..00473d4a13b 100644 --- a/samples/client/petstore/python-tornado/test/test_fake_api.py +++ b/samples/client/petstore/python-tornado/test/test_fake_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,85 +13,78 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.api.fake_api import FakeApi # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.apis.fake_api import FakeApi class TestFakeApi(unittest.TestCase): - """ FakeApi unit test stubs """ + """FakeApi unit test stubs""" def setUp(self): - self.api = petstore_api.apis.fake_api.FakeApi() + self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501 def tearDown(self): pass def test_fake_outer_boolean_serialize(self): - """ - Test case for fake_outer_boolean_serialize + """Test case for fake_outer_boolean_serialize - """ pass def test_fake_outer_composite_serialize(self): - """ - Test case for fake_outer_composite_serialize + """Test case for fake_outer_composite_serialize - """ pass def test_fake_outer_number_serialize(self): - """ - Test case for fake_outer_number_serialize + """Test case for fake_outer_number_serialize - """ pass def test_fake_outer_string_serialize(self): - """ - Test case for fake_outer_string_serialize + """Test case for fake_outer_string_serialize - """ pass 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 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 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 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 diff --git a/samples/client/petstore/python-tornado/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python-tornado/test/test_fake_classname_tags_123_api.py index 7a11a2378bf..8f40062a929 100644 --- a/samples/client/petstore/python-tornado/test/test_fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-tornado/test/test_fake_classname_tags_123_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,29 +13,26 @@ from __future__ import absolute_import -import os -import sys import unittest 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.apis.fake_classname_tags_123_api import FakeClassnameTags123Api class TestFakeClassnameTags123Api(unittest.TestCase): - """ FakeClassnameTags123Api unit test stubs """ + """FakeClassnameTags123Api unit test stubs""" 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): pass 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 diff --git a/samples/client/petstore/python-tornado/test/test_format_test.py b/samples/client/petstore/python-tornado/test/test_format_test.py index ad028c0b431..59809b9f442 100644 --- a/samples/client/petstore/python-tornado/test/test_format_test.py +++ b/samples/client/petstore/python-tornado/test/test_format_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.format_test import FormatTest # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.format_test import FormatTest class TestFormatTest(unittest.TestCase): - """ FormatTest unit test stubs """ + """FormatTest unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestFormatTest(unittest.TestCase): pass def testFormatTest(self): - """ - Test FormatTest - """ + """Test FormatTest""" # 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 diff --git a/samples/client/petstore/python-tornado/test/test_has_only_read_only.py b/samples/client/petstore/python-tornado/test/test_has_only_read_only.py index af029f26814..26d14aef1f8 100644 --- a/samples/client/petstore/python-tornado/test/test_has_only_read_only.py +++ b/samples/client/petstore/python-tornado/test/test_has_only_read_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.has_only_read_only import HasOnlyReadOnly class TestHasOnlyReadOnly(unittest.TestCase): - """ HasOnlyReadOnly unit test stubs """ + """HasOnlyReadOnly unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestHasOnlyReadOnly(unittest.TestCase): pass def testHasOnlyReadOnly(self): - """ - Test HasOnlyReadOnly - """ + """Test HasOnlyReadOnly""" # 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 diff --git a/samples/client/petstore/python-tornado/test/test_list.py b/samples/client/petstore/python-tornado/test/test_list.py index 14400e35281..c2cca419f37 100644 --- a/samples/client/petstore/python-tornado/test/test_list.py +++ b/samples/client/petstore/python-tornado/test/test_list.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.list import List # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.list import List class TestList(unittest.TestCase): - """ List unit test stubs """ + """List unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestList(unittest.TestCase): pass def testList(self): - """ - Test List - """ + """Test List""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.list.List() + # model = petstore_api.models.list.List() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_map_test.py b/samples/client/petstore/python-tornado/test/test_map_test.py index c4b2092f0ce..155797d9b2d 100644 --- a/samples/client/petstore/python-tornado/test/test_map_test.py +++ b/samples/client/petstore/python-tornado/test/test_map_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.map_test import MapTest # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.map_test import MapTest class TestMapTest(unittest.TestCase): - """ MapTest unit test stubs """ + """MapTest unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestMapTest(unittest.TestCase): pass def testMapTest(self): - """ - Test MapTest - """ + """Test MapTest""" # 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 diff --git a/samples/client/petstore/python-tornado/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-tornado/test/test_mixed_properties_and_additional_properties_class.py index f614d36da8a..12a56764080 100644 --- a/samples/client/petstore/python-tornado/test/test_mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-tornado/test/test_mixed_properties_and_additional_properties_class.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest 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.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): - """ MixedPropertiesAndAdditionalPropertiesClass unit test stubs """ + """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): pass def testMixedPropertiesAndAdditionalPropertiesClass(self): - """ - Test MixedPropertiesAndAdditionalPropertiesClass - """ + """Test MixedPropertiesAndAdditionalPropertiesClass""" # 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 diff --git a/samples/client/petstore/python-tornado/test/test_model_200_response.py b/samples/client/petstore/python-tornado/test/test_model_200_response.py index f202a2d454f..f577dd42144 100644 --- a/samples/client/petstore/python-tornado/test/test_model_200_response.py +++ b/samples/client/petstore/python-tornado/test/test_model_200_response.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.model_200_response import Model200Response # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.model_200_response import Model200Response class TestModel200Response(unittest.TestCase): - """ Model200Response unit test stubs """ + """Model200Response unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestModel200Response(unittest.TestCase): pass def testModel200Response(self): - """ - Test Model200Response - """ + """Test Model200Response""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.model_200_response.Model200Response() + # model = petstore_api.models.model_200_response.Model200Response() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_model_return.py b/samples/client/petstore/python-tornado/test/test_model_return.py index 347c8e4d7cb..64cf27f63ab 100644 --- a/samples/client/petstore/python-tornado/test/test_model_return.py +++ b/samples/client/petstore/python-tornado/test/test_model_return.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.model_return import ModelReturn # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.model_return import ModelReturn class TestModelReturn(unittest.TestCase): - """ ModelReturn unit test stubs """ + """ModelReturn unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestModelReturn(unittest.TestCase): pass def testModelReturn(self): - """ - Test ModelReturn - """ + """Test ModelReturn""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.model_return.ModelReturn() + # model = petstore_api.models.model_return.ModelReturn() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_name.py b/samples/client/petstore/python-tornado/test/test_name.py index c06e35427f6..beba143f39c 100644 --- a/samples/client/petstore/python-tornado/test/test_name.py +++ b/samples/client/petstore/python-tornado/test/test_name.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.name import Name # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.name import Name class TestName(unittest.TestCase): - """ Name unit test stubs """ + """Name unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestName(unittest.TestCase): pass def testName(self): - """ - Test Name - """ + """Test Name""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.name.Name() + # model = petstore_api.models.name.Name() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_number_only.py b/samples/client/petstore/python-tornado/test/test_number_only.py index db3197a9e5b..f2600c79526 100644 --- a/samples/client/petstore/python-tornado/test/test_number_only.py +++ b/samples/client/petstore/python-tornado/test/test_number_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.number_only import NumberOnly # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.number_only import NumberOnly class TestNumberOnly(unittest.TestCase): - """ NumberOnly unit test stubs """ + """NumberOnly unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestNumberOnly(unittest.TestCase): pass def testNumberOnly(self): - """ - Test NumberOnly - """ + """Test NumberOnly""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.number_only.NumberOnly() + # model = petstore_api.models.number_only.NumberOnly() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_order.py b/samples/client/petstore/python-tornado/test/test_order.py index d911487ce97..ed4f8c7d161 100644 --- a/samples/client/petstore/python-tornado/test/test_order.py +++ b/samples/client/petstore/python-tornado/test/test_order.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.order import Order # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.order import Order class TestOrder(unittest.TestCase): - """ Order unit test stubs """ + """Order unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestOrder(unittest.TestCase): pass def testOrder(self): - """ - Test Order - """ + """Test Order""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.order.Order() + # model = petstore_api.models.order.Order() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_outer_boolean.py b/samples/client/petstore/python-tornado/test/test_outer_boolean.py index 9474ab76968..4a7e446693e 100644 --- a/samples/client/petstore/python-tornado/test/test_outer_boolean.py +++ b/samples/client/petstore/python-tornado/test/test_outer_boolean.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.outer_boolean import OuterBoolean # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.outer_boolean import OuterBoolean class TestOuterBoolean(unittest.TestCase): - """ OuterBoolean unit test stubs """ + """OuterBoolean unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestOuterBoolean(unittest.TestCase): pass def testOuterBoolean(self): - """ - Test OuterBoolean - """ + """Test OuterBoolean""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.outer_boolean.OuterBoolean() + # model = petstore_api.models.outer_boolean.OuterBoolean() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_outer_composite.py b/samples/client/petstore/python-tornado/test/test_outer_composite.py index ebbd9d03e6f..e444e695fe8 100644 --- a/samples/client/petstore/python-tornado/test/test_outer_composite.py +++ b/samples/client/petstore/python-tornado/test/test_outer_composite.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.outer_composite import OuterComposite # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.outer_composite import OuterComposite class TestOuterComposite(unittest.TestCase): - """ OuterComposite unit test stubs """ + """OuterComposite unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestOuterComposite(unittest.TestCase): pass def testOuterComposite(self): - """ - Test OuterComposite - """ + """Test OuterComposite""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.outer_composite.OuterComposite() + # model = petstore_api.models.outer_composite.OuterComposite() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_outer_enum.py b/samples/client/petstore/python-tornado/test/test_outer_enum.py index c6e1f030ef1..e3fb15e1b6b 100644 --- a/samples/client/petstore/python-tornado/test/test_outer_enum.py +++ b/samples/client/petstore/python-tornado/test/test_outer_enum.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.outer_enum import OuterEnum # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.outer_enum import OuterEnum class TestOuterEnum(unittest.TestCase): - """ OuterEnum unit test stubs """ + """OuterEnum unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestOuterEnum(unittest.TestCase): pass def testOuterEnum(self): - """ - Test OuterEnum - """ + """Test OuterEnum""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.outer_enum.OuterEnum() + # model = petstore_api.models.outer_enum.OuterEnum() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_outer_number.py b/samples/client/petstore/python-tornado/test/test_outer_number.py index 9f97b407047..da5d3ceee61 100644 --- a/samples/client/petstore/python-tornado/test/test_outer_number.py +++ b/samples/client/petstore/python-tornado/test/test_outer_number.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.outer_number import OuterNumber # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.outer_number import OuterNumber class TestOuterNumber(unittest.TestCase): - """ OuterNumber unit test stubs """ + """OuterNumber unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestOuterNumber(unittest.TestCase): pass def testOuterNumber(self): - """ - Test OuterNumber - """ + """Test OuterNumber""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.outer_number.OuterNumber() + # model = petstore_api.models.outer_number.OuterNumber() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_outer_string.py b/samples/client/petstore/python-tornado/test/test_outer_string.py index b0ac85ed934..02b4967e3b9 100644 --- a/samples/client/petstore/python-tornado/test/test_outer_string.py +++ b/samples/client/petstore/python-tornado/test/test_outer_string.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.outer_string import OuterString # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.outer_string import OuterString class TestOuterString(unittest.TestCase): - """ OuterString unit test stubs """ + """OuterString unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestOuterString(unittest.TestCase): pass def testOuterString(self): - """ - Test OuterString - """ + """Test OuterString""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.outer_string.OuterString() + # model = petstore_api.models.outer_string.OuterString() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_pet.py b/samples/client/petstore/python-tornado/test/test_pet.py index c3e8191bec3..d8df24f92b1 100644 --- a/samples/client/petstore/python-tornado/test/test_pet.py +++ b/samples/client/petstore/python-tornado/test/test_pet.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.pet import Pet # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.pet import Pet class TestPet(unittest.TestCase): - """ Pet unit test stubs """ + """Pet unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestPet(unittest.TestCase): pass def testPet(self): - """ - Test Pet - """ + """Test Pet""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.pet.Pet() + # model = petstore_api.models.pet.Pet() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_pet_api.py b/samples/client/petstore/python-tornado/test/test_pet_api.py index 1eafc35b28c..1e2dd1c42b6 100644 --- a/samples/client/petstore/python-tornado/test/test_pet_api.py +++ b/samples/client/petstore/python-tornado/test/test_pet_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,85 +13,75 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.api.pet_api import PetApi # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.apis.pet_api import PetApi class TestPetApi(unittest.TestCase): - """ PetApi unit test stubs """ + """PetApi unit test stubs""" def setUp(self): - self.api = petstore_api.apis.pet_api.PetApi() + self.api = petstore_api.api.pet_api.PetApi() # noqa: E501 def tearDown(self): pass def test_add_pet(self): - """ - Test case for add_pet + """Test case for add_pet - Add a new pet to the store + Add a new pet to the store # noqa: E501 """ pass def test_delete_pet(self): - """ - Test case for delete_pet + """Test case for delete_pet - Deletes a pet + Deletes a pet # noqa: E501 """ pass def test_find_pets_by_status(self): - """ - Test case for find_pets_by_status + """Test case for find_pets_by_status - Finds Pets by status + Finds Pets by status # noqa: E501 """ pass def test_find_pets_by_tags(self): - """ - Test case for find_pets_by_tags + """Test case for find_pets_by_tags - Finds Pets by tags + Finds Pets by tags # noqa: E501 """ pass def test_get_pet_by_id(self): - """ - Test case for get_pet_by_id + """Test case for get_pet_by_id - Find pet by ID + Find pet by ID # noqa: E501 """ pass def test_update_pet(self): - """ - Test case for update_pet + """Test case for update_pet - Update an existing pet + Update an existing pet # noqa: E501 """ pass def test_update_pet_with_form(self): - """ - Test case for update_pet_with_form + """Test case for update_pet_with_form - Updates a pet in the store with form data + Updates a pet in the store with form data # noqa: E501 """ pass def test_upload_file(self): - """ - Test case for upload_file + """Test case for upload_file - uploads an image + uploads an image # noqa: E501 """ pass diff --git a/samples/client/petstore/python-tornado/test/test_read_only_first.py b/samples/client/petstore/python-tornado/test/test_read_only_first.py index c89d5d3b6a1..94bf3d127de 100644 --- a/samples/client/petstore/python-tornado/test/test_read_only_first.py +++ b/samples/client/petstore/python-tornado/test/test_read_only_first.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.read_only_first import ReadOnlyFirst class TestReadOnlyFirst(unittest.TestCase): - """ ReadOnlyFirst unit test stubs """ + """ReadOnlyFirst unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestReadOnlyFirst(unittest.TestCase): pass def testReadOnlyFirst(self): - """ - Test ReadOnlyFirst - """ + """Test ReadOnlyFirst""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.read_only_first.ReadOnlyFirst() + # model = petstore_api.models.read_only_first.ReadOnlyFirst() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_special_model_name.py b/samples/client/petstore/python-tornado/test/test_special_model_name.py index d9fa392c36b..002f660cc26 100644 --- a/samples/client/petstore/python-tornado/test/test_special_model_name.py +++ b/samples/client/petstore/python-tornado/test/test_special_model_name.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.special_model_name import SpecialModelName # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.special_model_name import SpecialModelName class TestSpecialModelName(unittest.TestCase): - """ SpecialModelName unit test stubs """ + """SpecialModelName unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestSpecialModelName(unittest.TestCase): pass def testSpecialModelName(self): - """ - Test SpecialModelName - """ + """Test SpecialModelName""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.special_model_name.SpecialModelName() + # model = petstore_api.models.special_model_name.SpecialModelName() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_store_api.py b/samples/client/petstore/python-tornado/test/test_store_api.py index f131b6068b2..537c1bc03f1 100644 --- a/samples/client/petstore/python-tornado/test/test_store_api.py +++ b/samples/client/petstore/python-tornado/test/test_store_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,53 +13,47 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.api.store_api import StoreApi # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.apis.store_api import StoreApi class TestStoreApi(unittest.TestCase): - """ StoreApi unit test stubs """ + """StoreApi unit test stubs""" def setUp(self): - self.api = petstore_api.apis.store_api.StoreApi() + self.api = petstore_api.api.store_api.StoreApi() # noqa: E501 def tearDown(self): pass def test_delete_order(self): - """ - Test case for delete_order + """Test case for delete_order - Delete purchase order by ID + Delete purchase order by ID # noqa: E501 """ pass def test_get_inventory(self): - """ - Test case for get_inventory + """Test case for get_inventory - Returns pet inventories by status + Returns pet inventories by status # noqa: E501 """ pass def test_get_order_by_id(self): - """ - Test case for get_order_by_id + """Test case for get_order_by_id - Find purchase order by ID + Find purchase order by ID # noqa: E501 """ pass def test_place_order(self): - """ - Test case for place_order + """Test case for place_order - Place an order for a pet + Place an order for a pet # noqa: E501 """ pass diff --git a/samples/client/petstore/python-tornado/test/test_tag.py b/samples/client/petstore/python-tornado/test/test_tag.py index 76f79932c96..e9bc1d471d1 100644 --- a/samples/client/petstore/python-tornado/test/test_tag.py +++ b/samples/client/petstore/python-tornado/test/test_tag.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.tag import Tag # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.tag import Tag class TestTag(unittest.TestCase): - """ Tag unit test stubs """ + """Tag unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestTag(unittest.TestCase): pass def testTag(self): - """ - Test Tag - """ + """Test Tag""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.tag.Tag() + # model = petstore_api.models.tag.Tag() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_user.py b/samples/client/petstore/python-tornado/test/test_user.py index 82f5d9058b0..3575746c00f 100644 --- a/samples/client/petstore/python-tornado/test/test_user.py +++ b/samples/client/petstore/python-tornado/test/test_user.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.user import User # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.user import User class TestUser(unittest.TestCase): - """ User unit test stubs """ + """User unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestUser(unittest.TestCase): pass def testUser(self): - """ - Test User - """ + """Test User""" # FIXME: construct object with mandatory attributes with example values - #model = petstore_api.models.user.User() + # model = petstore_api.models.user.User() # noqa: E501 pass diff --git a/samples/client/petstore/python-tornado/test/test_user_api.py b/samples/client/petstore/python-tornado/test/test_user_api.py index 3e0be964a2d..4ebd90f95e2 100644 --- a/samples/client/petstore/python-tornado/test/test_user_api.py +++ b/samples/client/petstore/python-tornado/test/test_user_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,85 +13,75 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.api.user_api import UserApi # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.apis.user_api import UserApi class TestUserApi(unittest.TestCase): - """ UserApi unit test stubs """ + """UserApi unit test stubs""" def setUp(self): - self.api = petstore_api.apis.user_api.UserApi() + self.api = petstore_api.api.user_api.UserApi() # noqa: E501 def tearDown(self): pass def test_create_user(self): - """ - Test case for create_user + """Test case for create_user - Create user + Create user # noqa: E501 """ pass def test_create_users_with_array_input(self): - """ - Test case for create_users_with_array_input + """Test case for create_users_with_array_input - Creates list of users with given input array + Creates list of users with given input array # noqa: E501 """ pass def test_create_users_with_list_input(self): - """ - Test case for create_users_with_list_input + """Test case for create_users_with_list_input - Creates list of users with given input array + Creates list of users with given input array # noqa: E501 """ pass def test_delete_user(self): - """ - Test case for delete_user + """Test case for delete_user - Delete user + Delete user # noqa: E501 """ pass def test_get_user_by_name(self): - """ - Test case for get_user_by_name + """Test case for get_user_by_name - Get user by user name + Get user by user name # noqa: E501 """ pass def test_login_user(self): - """ - Test case for login_user + """Test case for login_user - Logs user into the system + Logs user into the system # noqa: E501 """ pass def test_logout_user(self): - """ - Test case for logout_user + """Test case for logout_user - Logs out current logged in user session + Logs out current logged in user session # noqa: E501 """ pass def test_update_user(self): - """ - Test case for update_user + """Test case for update_user - Updated user + Updated user # noqa: E501 """ pass diff --git a/samples/client/petstore/python/Makefile b/samples/client/petstore/python/Makefile index 52033cee703..ba5c5e73c63 100644 --- a/samples/client/petstore/python/Makefile +++ b/samples/client/petstore/python/Makefile @@ -14,8 +14,8 @@ clean: find . -name "*.py[oc]" -delete find . -name "__pycache__" -delete -test: clean +test: clean bash ./test_python2.sh -test-all: clean +test-all: clean bash ./test_python2_and_3.sh diff --git a/samples/client/petstore/python/dev-requirements.txt b/samples/client/petstore/python/dev-requirements.txt index 01a2e25f1c7..f50c13b5c50 100644 --- a/samples/client/petstore/python/dev-requirements.txt +++ b/samples/client/petstore/python/dev-requirements.txt @@ -2,3 +2,4 @@ nose tox coverage randomize +flake8 diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python/docs/AdditionalPropertiesClass.md index ea12f270f02..796a789d4c4 100644 --- a/samples/client/petstore/python/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/python/docs/AdditionalPropertiesClass.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **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) diff --git a/samples/client/petstore/python/docs/AnotherFakeApi.md b/samples/client/petstore/python/docs/AnotherFakeApi.md index b78fcf86f43..3d70f7a2875 100644 --- a/samples/client/petstore/python/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python/docs/AnotherFakeApi.md @@ -14,7 +14,7 @@ To test special tags To test special tags -### Example +### Example ```python from __future__ import print_function import time @@ -26,7 +26,7 @@ from pprint import pprint api_instance = petstore_api.AnotherFakeApi() body = petstore_api.Client() # Client | client model -try: +try: # To test special tags api_response = api_instance.test_special_tags(body) pprint(api_response) diff --git a/samples/client/petstore/python/docs/FakeApi.md b/samples/client/petstore/python/docs/FakeApi.md index eb651a109a7..b910ba2b464 100644 --- a/samples/client/petstore/python/docs/FakeApi.md +++ b/samples/client/petstore/python/docs/FakeApi.md @@ -22,7 +22,7 @@ Method | HTTP request | Description Test serialization of outer boolean types -### Example +### Example ```python from __future__ import print_function import time @@ -34,7 +34,7 @@ from pprint import pprint api_instance = petstore_api.FakeApi() body = petstore_api.OuterBoolean() # OuterBoolean | Input boolean as post body (optional) -try: +try: api_response = api_instance.fake_outer_boolean_serialize(body=body) pprint(api_response) except ApiException as e: @@ -69,7 +69,7 @@ No authorization required Test serialization of object with outer number type -### Example +### Example ```python from __future__ import print_function import time @@ -81,7 +81,7 @@ from pprint import pprint api_instance = petstore_api.FakeApi() body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) -try: +try: api_response = api_instance.fake_outer_composite_serialize(body=body) pprint(api_response) except ApiException as e: @@ -116,7 +116,7 @@ No authorization required Test serialization of outer number types -### Example +### Example ```python from __future__ import print_function import time @@ -128,7 +128,7 @@ from pprint import pprint api_instance = petstore_api.FakeApi() body = petstore_api.OuterNumber() # OuterNumber | Input number as post body (optional) -try: +try: api_response = api_instance.fake_outer_number_serialize(body=body) pprint(api_response) except ApiException as e: @@ -163,7 +163,7 @@ No authorization required Test serialization of outer string types -### Example +### Example ```python from __future__ import print_function import time @@ -175,7 +175,7 @@ from pprint import pprint api_instance = petstore_api.FakeApi() body = petstore_api.OuterString() # OuterString | Input string as post body (optional) -try: +try: api_response = api_instance.fake_outer_string_serialize(body=body) pprint(api_response) except ApiException as e: @@ -210,7 +210,7 @@ To test \"client\" model To test \"client\" model -### Example +### Example ```python from __future__ import print_function import time @@ -222,7 +222,7 @@ from pprint import pprint api_instance = petstore_api.FakeApi() body = petstore_api.Client() # Client | client model -try: +try: # To test \"client\" model api_response = api_instance.test_client_model(body) pprint(api_response) @@ -258,7 +258,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -### Example +### Example ```python from __future__ import print_function import time @@ -288,7 +288,7 @@ date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) password = 'password_example' # str | None (optional) param_callback = 'param_callback_example' # str | None (optional) -try: +try: # 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) except ApiException as e: @@ -336,7 +336,7 @@ To test enum parameters To test enum parameters -### Example +### Example ```python from __future__ import print_function import time @@ -355,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_double = 1.2 # float | Query parameter enum test (double) (optional) -try: +try: # 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) except ApiException as e: @@ -397,7 +397,7 @@ test inline additionalProperties -### Example +### Example ```python from __future__ import print_function import time @@ -409,7 +409,7 @@ from pprint import pprint api_instance = petstore_api.FakeApi() param = NULL # object | request body -try: +try: # test inline additionalProperties api_instance.test_inline_additional_properties(param) except ApiException as e: @@ -444,7 +444,7 @@ test json serialization of form data -### Example +### Example ```python from __future__ import print_function import time @@ -457,7 +457,7 @@ api_instance = petstore_api.FakeApi() param = 'param_example' # str | field1 param2 = 'param2_example' # str | field2 -try: +try: # test json serialization of form data api_instance.test_json_form_data(param, param2) except ApiException as e: diff --git a/samples/client/petstore/python/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python/docs/FakeClassnameTags123Api.md index a103a4ee327..2546c09ca4a 100644 --- a/samples/client/petstore/python/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python/docs/FakeClassnameTags123Api.md @@ -12,7 +12,7 @@ Method | HTTP request | Description To test class name in snake case -### Example +### Example ```python from __future__ import print_function import time @@ -30,7 +30,7 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY' api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration)) body = petstore_api.Client() # Client | client model -try: +try: # To test class name in snake case api_response = api_instance.test_classname(body) pprint(api_response) diff --git a/samples/client/petstore/python/docs/MapTest.md b/samples/client/petstore/python/docs/MapTest.md index 63cdab0374a..68844755d42 100644 --- a/samples/client/petstore/python/docs/MapTest.md +++ b/samples/client/petstore/python/docs/MapTest.md @@ -3,7 +3,7 @@ ## Properties 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] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/PetApi.md b/samples/client/petstore/python/docs/PetApi.md index 74c6a5196fd..53b9158e699 100644 --- a/samples/client/petstore/python/docs/PetApi.md +++ b/samples/client/petstore/python/docs/PetApi.md @@ -21,7 +21,7 @@ Add a new pet to the store -### Example +### Example ```python from __future__ import print_function import time @@ -37,7 +37,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store -try: +try: # Add a new pet to the store api_instance.add_pet(body) except ApiException as e: @@ -72,7 +72,7 @@ Deletes a pet -### Example +### Example ```python from __future__ import print_function import time @@ -89,7 +89,7 @@ api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) pet_id = 789 # int | Pet id to delete api_key = 'api_key_example' # str | (optional) -try: +try: # Deletes a pet api_instance.delete_pet(pet_id, api_key=api_key) except ApiException as e: @@ -125,7 +125,7 @@ Finds Pets by status Multiple status values can be provided with comma separated strings -### Example +### Example ```python from __future__ import print_function import time @@ -141,7 +141,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) status = ['status_example'] # list[str] | Status values that need to be considered for filter -try: +try: # Finds Pets by status api_response = api_instance.find_pets_by_status(status) 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. -### Example +### Example ```python from __future__ import print_function import time @@ -193,7 +193,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) tags = ['tags_example'] # list[str] | Tags to filter by -try: +try: # Finds Pets by tags api_response = api_instance.find_pets_by_tags(tags) pprint(api_response) @@ -229,7 +229,7 @@ Find pet by ID Returns a single pet -### Example +### Example ```python from __future__ import print_function import time @@ -247,7 +247,7 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY' api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) pet_id = 789 # int | ID of pet to return -try: +try: # Find pet by ID api_response = api_instance.get_pet_by_id(pet_id) pprint(api_response) @@ -283,7 +283,7 @@ Update an existing pet -### Example +### Example ```python from __future__ import print_function import time @@ -299,7 +299,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store -try: +try: # Update an existing pet api_instance.update_pet(body) except ApiException as e: @@ -334,7 +334,7 @@ Updates a pet in the store with form data -### Example +### Example ```python from __future__ import print_function 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) status = 'status_example' # str | Updated status of the pet (optional) -try: +try: # Updates a pet in the store with form data api_instance.update_pet_with_form(pet_id, name=name, status=status) except ApiException as e: @@ -389,7 +389,7 @@ uploads an image -### Example +### Example ```python from __future__ import print_function 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) file = '/path/to/file.txt' # file | file to upload (optional) -try: +try: # uploads an image api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) pprint(api_response) diff --git a/samples/client/petstore/python/docs/StoreApi.md b/samples/client/petstore/python/docs/StoreApi.md index a75113975ef..6cbb6b45145 100644 --- a/samples/client/petstore/python/docs/StoreApi.md +++ b/samples/client/petstore/python/docs/StoreApi.md @@ -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 -### Example +### Example ```python from __future__ import print_function import time @@ -29,7 +29,7 @@ from pprint import pprint api_instance = petstore_api.StoreApi() order_id = 'order_id_example' # str | ID of the order that needs to be deleted -try: +try: # Delete purchase order by ID api_instance.delete_order(order_id) except ApiException as e: @@ -64,7 +64,7 @@ Returns pet inventories by status Returns a map of status codes to quantities -### Example +### Example ```python from __future__ import print_function import time @@ -81,7 +81,7 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration)) -try: +try: # Returns pet inventories by status api_response = api_instance.get_inventory() 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 -### Example +### Example ```python from __future__ import print_function import time @@ -126,7 +126,7 @@ from pprint import pprint api_instance = petstore_api.StoreApi() order_id = 789 # int | ID of pet that needs to be fetched -try: +try: # Find purchase order by ID api_response = api_instance.get_order_by_id(order_id) pprint(api_response) @@ -162,7 +162,7 @@ Place an order for a pet -### Example +### Example ```python from __future__ import print_function import time @@ -174,7 +174,7 @@ from pprint import pprint api_instance = petstore_api.StoreApi() body = petstore_api.Order() # Order | order placed for purchasing the pet -try: +try: # Place an order for a pet api_response = api_instance.place_order(body) pprint(api_response) diff --git a/samples/client/petstore/python/docs/UserApi.md b/samples/client/petstore/python/docs/UserApi.md index 5b73179dce3..969485595ae 100644 --- a/samples/client/petstore/python/docs/UserApi.md +++ b/samples/client/petstore/python/docs/UserApi.md @@ -21,7 +21,7 @@ Create user This can only be done by the logged in user. -### Example +### Example ```python from __future__ import print_function import time @@ -33,7 +33,7 @@ from pprint import pprint api_instance = petstore_api.UserApi() body = petstore_api.User() # User | Created user object -try: +try: # Create user api_instance.create_user(body) except ApiException as e: @@ -68,7 +68,7 @@ Creates list of users with given input array -### Example +### Example ```python from __future__ import print_function import time @@ -80,7 +80,7 @@ from pprint import pprint api_instance = petstore_api.UserApi() body = [petstore_api.User()] # list[User] | List of user object -try: +try: # Creates list of users with given input array api_instance.create_users_with_array_input(body) except ApiException as e: @@ -115,7 +115,7 @@ Creates list of users with given input array -### Example +### Example ```python from __future__ import print_function import time @@ -127,7 +127,7 @@ from pprint import pprint api_instance = petstore_api.UserApi() body = [petstore_api.User()] # list[User] | List of user object -try: +try: # Creates list of users with given input array api_instance.create_users_with_list_input(body) except ApiException as e: @@ -162,7 +162,7 @@ Delete user This can only be done by the logged in user. -### Example +### Example ```python from __future__ import print_function import time @@ -174,7 +174,7 @@ from pprint import pprint api_instance = petstore_api.UserApi() username = 'username_example' # str | The name that needs to be deleted -try: +try: # Delete user api_instance.delete_user(username) except ApiException as e: @@ -209,7 +209,7 @@ Get user by user name -### Example +### Example ```python from __future__ import print_function import time @@ -221,7 +221,7 @@ from pprint import pprint api_instance = petstore_api.UserApi() username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. -try: +try: # Get user by user name api_response = api_instance.get_user_by_name(username) pprint(api_response) @@ -257,7 +257,7 @@ Logs user into the system -### Example +### Example ```python from __future__ import print_function import time @@ -270,7 +270,7 @@ api_instance = petstore_api.UserApi() username = 'username_example' # str | The user name for login password = 'password_example' # str | The password for login in clear text -try: +try: # Logs user into the system api_response = api_instance.login_user(username, password) pprint(api_response) @@ -307,7 +307,7 @@ Logs out current logged in user session -### Example +### Example ```python from __future__ import print_function import time @@ -318,7 +318,7 @@ from pprint import pprint # create an instance of the API class api_instance = petstore_api.UserApi() -try: +try: # Logs out current logged in user session api_instance.logout_user() except ApiException as e: @@ -350,7 +350,7 @@ Updated user This can only be done by the logged in user. -### Example +### Example ```python from __future__ import print_function import time @@ -363,7 +363,7 @@ api_instance = petstore_api.UserApi() username = 'username_example' # str | name that need to be deleted body = petstore_api.User() # User | Updated user object -try: +try: # Updated user api_instance.update_user(username, body) except ApiException as e: diff --git a/samples/client/petstore/python/petstore b/samples/client/petstore/python/petstore deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/python/petstore_api/__init__.py b/samples/client/petstore/python/petstore_api/__init__.py index cad09e2691c..c368867dd11 100644 --- a/samples/client/petstore/python/petstore_api/__init__.py +++ b/samples/client/petstore/python/petstore_api/__init__.py @@ -1,9 +1,11 @@ # coding: utf-8 +# flake8: noqa + """ 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 Contact: apiteam@swagger.io @@ -13,53 +15,51 @@ 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 -from .apis.another_fake_api import AnotherFakeApi -from .apis.fake_api import FakeApi -from .apis.fake_classname_tags_123_api import FakeClassnameTags123Api -from .apis.pet_api import PetApi -from .apis.store_api import StoreApi -from .apis.user_api import UserApi +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 # import ApiClient -from .api_client import ApiClient - -from .configuration import Configuration +from petstore_api.api_client import ApiClient +from petstore_api.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 diff --git a/samples/client/petstore/python/petstore_api/api/__init__.py b/samples/client/petstore/python/petstore_api/api/__init__.py new file mode 100644 index 00000000000..74496adb5a2 --- /dev/null +++ b/samples/client/petstore/python/petstore_api/api/__init__.py @@ -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 diff --git a/samples/client/petstore/python/petstore_api/apis/another_fake_api.py b/samples/client/petstore/python/petstore_api/api/another_fake_api.py similarity index 59% rename from samples/client/petstore/python/petstore_api/apis/another_fake_api.py rename to samples/client/petstore/python/petstore_api/api/another_fake_api.py index 8fb991ff3df..0096dad1a37 100644 --- a/samples/client/petstore/python/petstore_api/apis/another_fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/another_fake_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,19 +13,17 @@ from __future__ import absolute_import -import sys -import os -import re +import re # noqa: F401 # 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): - """ - 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. Ref: https://github.com/swagger-api/swagger-codegen """ @@ -35,10 +33,10 @@ class AnotherFakeApi(object): api_client = ApiClient() self.api_client = api_client - def test_special_tags(self, body, **kwargs): - """ - To test special tags - To test special tags + def test_special_tags(self, body, **kwargs): # noqa: E501 + """To test special tags # noqa: E501 + + To test special tags # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_special_tags(body, async=True) @@ -52,15 +50,15 @@ class AnotherFakeApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.test_special_tags_with_http_info(body, **kwargs) + (data) = self.test_special_tags_with_http_info(body, **kwargs) # noqa: E501 return data - def test_special_tags_with_http_info(self, body, **kwargs): - """ - To test special tags - To test special tags + def test_special_tags_with_http_info(self, body, **kwargs): # noqa: E501 + """To test special tags # noqa: E501 + + To test special tags # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_special_tags_with_http_info(body, async=True) @@ -73,14 +71,14 @@ class AnotherFakeApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -89,9 +87,9 @@ class AnotherFakeApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `test_special_tags`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_special_tags`") # noqa: E501 collection_formats = {} @@ -108,27 +106,28 @@ class AnotherFakeApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/another-fake/dummy', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Client', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/another-fake/dummy', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-tornado/petstore_api/apis/fake_api.py b/samples/client/petstore/python/petstore_api/api/fake_api.py similarity index 57% rename from samples/client/petstore/python-tornado/petstore_api/apis/fake_api.py rename to samples/client/petstore/python/petstore_api/api/fake_api.py index 46fb22f7290..4c52ee51647 100644 --- a/samples/client/petstore/python-tornado/petstore_api/apis/fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,19 +13,17 @@ from __future__ import absolute_import -import sys -import os -import re +import re # noqa: F401 # 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 FakeApi(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. Ref: https://github.com/swagger-api/swagger-codegen """ @@ -35,9 +33,10 @@ class FakeApi(object): api_client = ApiClient() self.api_client = api_client - def fake_outer_boolean_serialize(self, **kwargs): - """ - Test serialization of outer boolean types + def fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 + """fake_outer_boolean_serialize # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_boolean_serialize(async=True) @@ -51,14 +50,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.fake_outer_boolean_serialize_with_http_info(**kwargs) + return self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.fake_outer_boolean_serialize_with_http_info(**kwargs) + (data) = self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501 return data - def fake_outer_boolean_serialize_with_http_info(self, **kwargs): - """ - Test serialization of outer boolean types + def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 + """fake_outer_boolean_serialize # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_boolean_serialize_with_http_info(async=True) @@ -71,14 +71,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -87,7 +87,6 @@ class FakeApi(object): params[key] = val del params['kwargs'] - collection_formats = {} path_params = {} @@ -103,26 +102,28 @@ class FakeApi(object): if 'body' in params: body_params = params['body'] # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake/outer/boolean', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='OuterBoolean', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake/outer/boolean', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterBoolean', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def fake_outer_composite_serialize(self, **kwargs): - """ - Test serialization of object with outer number type + def fake_outer_composite_serialize(self, **kwargs): # noqa: E501 + """fake_outer_composite_serialize # noqa: E501 + + Test serialization of object with outer number type # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_composite_serialize(async=True) @@ -136,14 +137,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.fake_outer_composite_serialize_with_http_info(**kwargs) + return self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.fake_outer_composite_serialize_with_http_info(**kwargs) + (data) = self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501 return data - def fake_outer_composite_serialize_with_http_info(self, **kwargs): - """ - Test serialization of object with outer number type + def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 + """fake_outer_composite_serialize # noqa: E501 + + Test serialization of object with outer number type # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_composite_serialize_with_http_info(async=True) @@ -156,14 +158,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -172,7 +174,6 @@ class FakeApi(object): params[key] = val del params['kwargs'] - collection_formats = {} path_params = {} @@ -188,26 +189,28 @@ class FakeApi(object): if 'body' in params: body_params = params['body'] # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake/outer/composite', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='OuterComposite', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake/outer/composite', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterComposite', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def fake_outer_number_serialize(self, **kwargs): - """ - Test serialization of outer number types + def fake_outer_number_serialize(self, **kwargs): # noqa: E501 + """fake_outer_number_serialize # noqa: E501 + + Test serialization of outer number types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_number_serialize(async=True) @@ -221,14 +224,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.fake_outer_number_serialize_with_http_info(**kwargs) + return self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.fake_outer_number_serialize_with_http_info(**kwargs) + (data) = self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501 return data - def fake_outer_number_serialize_with_http_info(self, **kwargs): - """ - Test serialization of outer number types + def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 + """fake_outer_number_serialize # noqa: E501 + + Test serialization of outer number types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_number_serialize_with_http_info(async=True) @@ -241,14 +245,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -257,7 +261,6 @@ class FakeApi(object): params[key] = val del params['kwargs'] - collection_formats = {} path_params = {} @@ -273,26 +276,28 @@ class FakeApi(object): if 'body' in params: body_params = params['body'] # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake/outer/number', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='OuterNumber', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake/outer/number', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterNumber', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def fake_outer_string_serialize(self, **kwargs): - """ - Test serialization of outer string types + def fake_outer_string_serialize(self, **kwargs): # noqa: E501 + """fake_outer_string_serialize # noqa: E501 + + Test serialization of outer string types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_string_serialize(async=True) @@ -306,14 +311,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.fake_outer_string_serialize_with_http_info(**kwargs) + return self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.fake_outer_string_serialize_with_http_info(**kwargs) + (data) = self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501 return data - def fake_outer_string_serialize_with_http_info(self, **kwargs): - """ - Test serialization of outer string types + def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 + """fake_outer_string_serialize # noqa: E501 + + Test serialization of outer string types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.fake_outer_string_serialize_with_http_info(async=True) @@ -326,14 +332,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -342,7 +348,6 @@ class FakeApi(object): params[key] = val del params['kwargs'] - collection_formats = {} path_params = {} @@ -358,27 +363,28 @@ class FakeApi(object): if 'body' in params: body_params = params['body'] # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake/outer/string', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='OuterString', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake/outer/string', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterString', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def test_client_model(self, body, **kwargs): - """ - To test \"client\" model - To test \"client\" model + def test_client_model(self, body, **kwargs): # noqa: E501 + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_client_model(body, async=True) @@ -392,15 +398,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.test_client_model_with_http_info(body, **kwargs) + return self.test_client_model_with_http_info(body, **kwargs) # noqa: E501 else: - (data) = self.test_client_model_with_http_info(body, **kwargs) + (data) = self.test_client_model_with_http_info(body, **kwargs) # noqa: E501 return data - def test_client_model_with_http_info(self, body, **kwargs): - """ - To test \"client\" model - To test \"client\" model + def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_client_model_with_http_info(body, async=True) @@ -413,14 +419,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -429,9 +435,9 @@ class FakeApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `test_client_model`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_client_model`") # noqa: E501 collection_formats = {} @@ -448,35 +454,36 @@ class FakeApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Client', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): - """ - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + def test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async=True) @@ -503,15 +510,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) + return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501 else: - (data) = self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) + (data) = self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501 return data - def test_endpoint_parameters_with_http_info(self, number, double, pattern_without_delimiter, byte, **kwargs): - """ - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + def test_endpoint_parameters_with_http_info(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async=True) @@ -537,14 +544,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['number', 'double', 'pattern_without_delimiter', 'byte', 'integer', 'int32', 'int64', 'float', 'string', 'binary', 'date', 'date_time', 'password', 'param_callback'] + all_params = ['number', 'double', 'pattern_without_delimiter', 'byte', 'integer', 'int32', 'int64', 'float', 'string', 'binary', 'date', 'date_time', 'password', 'param_callback'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -553,45 +560,50 @@ class FakeApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'number' is set - if ('number' not in params) or (params['number'] is None): - raise ValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") + if ('number' not in params or + params['number'] is None): + raise ValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'double' is set - if ('double' not in params) or (params['double'] is None): - raise ValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") + if ('double' not in params or + params['double'] is None): + raise ValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'pattern_without_delimiter' is set - if ('pattern_without_delimiter' not in params) or (params['pattern_without_delimiter'] is None): - raise ValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") + if ('pattern_without_delimiter' not in params or + params['pattern_without_delimiter'] is None): + raise ValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'byte' is set - if ('byte' not in params) or (params['byte'] is None): - raise ValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") - - if 'number' in params and params['number'] > 543.2: - raise ValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") - if 'number' in params and params['number'] < 32.1: - raise ValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") - if 'double' in params and params['double'] > 123.4: - raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") - if 'double' in params and params['double'] < 67.8: - raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") - if 'pattern_without_delimiter' in params and not re.search('^[A-Z].*', params['pattern_without_delimiter']): - raise ValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") - if 'integer' in params and params['integer'] > 100: - raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") - if 'integer' in params and params['integer'] < 10: - raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") - if 'int32' in params and params['int32'] > 200: - raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") - if 'int32' in params and params['int32'] < 20: - raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") - if 'float' in params and params['float'] > 987.6: - raise ValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") - if 'string' in params and not re.search('[a-z]', params['string'], flags=re.IGNORECASE): - raise ValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") - if 'password' in params and len(params['password']) > 64: - raise ValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") - if 'password' in params and len(params['password']) < 10: - raise ValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") + if ('byte' not in params or + params['byte'] is None): + raise ValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501 + if 'number' in params and params['number'] > 543.2: # noqa: E501 + raise ValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") # noqa: E501 + if 'number' in params and params['number'] < 32.1: # noqa: E501 + raise ValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") # noqa: E501 + if 'double' in params and params['double'] > 123.4: # noqa: E501 + raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") # noqa: E501 + if 'double' in params and params['double'] < 67.8: # noqa: E501 + raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") # noqa: E501 + if 'pattern_without_delimiter' in params and not re.search('^[A-Z].*', params['pattern_without_delimiter']): # noqa: E501 + raise ValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") # noqa: E501 + if 'integer' in params and params['integer'] > 100: # noqa: E501 + raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") # noqa: E501 + if 'integer' in params and params['integer'] < 10: # noqa: E501 + raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") # noqa: E501 + if 'int32' in params and params['int32'] > 200: # noqa: E501 + raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") # noqa: E501 + if 'int32' in params and params['int32'] < 20: # noqa: E501 + raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") # noqa: E501 + if 'float' in params and params['float'] > 987.6: # noqa: E501 + raise ValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501 + if 'string' in params and not re.search('[a-z]', params['string'], flags=re.IGNORECASE): # noqa: E501 + raise ValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") # noqa: E501 + if ('password' in params and + len(params['password']) > 64): + raise ValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") # noqa: E501 + if ('password' in params and + len(params['password']) < 10): + raise ValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") # noqa: E501 collection_formats = {} path_params = {} @@ -603,65 +615,66 @@ class FakeApi(object): form_params = [] local_var_files = {} if 'integer' in params: - form_params.append(('integer', params['integer'])) + form_params.append(('integer', params['integer'])) # noqa: E501 if 'int32' in params: - form_params.append(('int32', params['int32'])) + form_params.append(('int32', params['int32'])) # noqa: E501 if 'int64' in params: - form_params.append(('int64', params['int64'])) + form_params.append(('int64', params['int64'])) # noqa: E501 if 'number' in params: - form_params.append(('number', params['number'])) + form_params.append(('number', params['number'])) # noqa: E501 if 'float' in params: - form_params.append(('float', params['float'])) + form_params.append(('float', params['float'])) # noqa: E501 if 'double' in params: - form_params.append(('double', params['double'])) + form_params.append(('double', params['double'])) # noqa: E501 if 'string' in params: - form_params.append(('string', params['string'])) + form_params.append(('string', params['string'])) # noqa: E501 if 'pattern_without_delimiter' in params: - form_params.append(('pattern_without_delimiter', params['pattern_without_delimiter'])) + form_params.append(('pattern_without_delimiter', params['pattern_without_delimiter'])) # noqa: E501 if 'byte' in params: - form_params.append(('byte', params['byte'])) + form_params.append(('byte', params['byte'])) # noqa: E501 if 'binary' in params: - form_params.append(('binary', params['binary'])) + form_params.append(('binary', params['binary'])) # noqa: E501 if 'date' in params: - form_params.append(('date', params['date'])) + form_params.append(('date', params['date'])) # noqa: E501 if 'date_time' in params: - form_params.append(('dateTime', params['date_time'])) + form_params.append(('dateTime', params['date_time'])) # noqa: E501 if 'password' in params: - form_params.append(('password', params['password'])) + form_params.append(('password', params['password'])) # noqa: E501 if 'param_callback' in params: - form_params.append(('callback', params['param_callback'])) + form_params.append(('callback', params['param_callback'])) # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml; charset=utf-8', 'application/json; charset=utf-8']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml; charset=utf-8', 'application/json; charset=utf-8']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/xml; charset=utf-8', 'application/json; charset=utf-8']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/xml; charset=utf-8', 'application/json; charset=utf-8']) # noqa: E501 # Authentication setting - auth_settings = ['http_basic_test'] + auth_settings = ['http_basic_test'] # noqa: E501 - return self.api_client.call_api('/fake', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def test_enum_parameters(self, **kwargs): - """ - To test enum parameters - To test enum parameters + def test_enum_parameters(self, **kwargs): # noqa: E501 + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_enum_parameters(async=True) @@ -682,15 +695,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.test_enum_parameters_with_http_info(**kwargs) + return self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.test_enum_parameters_with_http_info(**kwargs) + (data) = self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501 return data - def test_enum_parameters_with_http_info(self, **kwargs): - """ - To test enum parameters - To test enum parameters + def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_enum_parameters_with_http_info(async=True) @@ -710,14 +723,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['enum_form_string_array', 'enum_form_string', 'enum_header_string_array', 'enum_header_string', 'enum_query_string_array', 'enum_query_string', 'enum_query_integer', 'enum_query_double'] + all_params = ['enum_form_string_array', 'enum_form_string', 'enum_header_string_array', 'enum_header_string', 'enum_query_string_array', 'enum_query_string', 'enum_query_integer', 'enum_query_double'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -726,68 +739,163 @@ class FakeApi(object): params[key] = val del params['kwargs'] - collection_formats = {} path_params = {} query_params = [] if 'enum_query_string_array' in params: - query_params.append(('enum_query_string_array', params['enum_query_string_array'])) - collection_formats['enum_query_string_array'] = 'csv' + query_params.append(('enum_query_string_array', params['enum_query_string_array'])) # noqa: E501 + collection_formats['enum_query_string_array'] = 'csv' # noqa: E501 if 'enum_query_string' in params: - query_params.append(('enum_query_string', params['enum_query_string'])) + query_params.append(('enum_query_string', params['enum_query_string'])) # noqa: E501 if 'enum_query_integer' in params: - query_params.append(('enum_query_integer', params['enum_query_integer'])) + query_params.append(('enum_query_integer', params['enum_query_integer'])) # noqa: E501 header_params = {} if 'enum_header_string_array' in params: - header_params['enum_header_string_array'] = params['enum_header_string_array'] - collection_formats['enum_header_string_array'] = 'csv' + header_params['enum_header_string_array'] = params['enum_header_string_array'] # noqa: E501 + collection_formats['enum_header_string_array'] = 'csv' # noqa: E501 if 'enum_header_string' in params: - header_params['enum_header_string'] = params['enum_header_string'] + header_params['enum_header_string'] = params['enum_header_string'] # noqa: E501 form_params = [] local_var_files = {} if 'enum_form_string_array' in params: - form_params.append(('enum_form_string_array', params['enum_form_string_array'])) - collection_formats['enum_form_string_array'] = 'csv' + form_params.append(('enum_form_string_array', params['enum_form_string_array'])) # noqa: E501 + collection_formats['enum_form_string_array'] = 'csv' # noqa: E501 if 'enum_form_string' in params: - form_params.append(('enum_form_string', params['enum_form_string'])) + form_params.append(('enum_form_string', params['enum_form_string'])) # noqa: E501 if 'enum_query_double' in params: - form_params.append(('enum_query_double', params['enum_query_double'])) + form_params.append(('enum_query_double', params['enum_query_double'])) # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['*/*']) + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['*/*']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['*/*']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def test_json_form_data(self, param, param2, **kwargs): + def test_inline_additional_properties(self, param, **kwargs): # noqa: E501 + """test inline additionalProperties # noqa: E501 + + # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_inline_additional_properties(param, async=True) + >>> result = thread.get() + + :param async bool + :param object param: request body (required) + :return: None + If the method is called asynchronously, + returns the request thread. """ - test json serialization of form data - + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.test_inline_additional_properties_with_http_info(param, **kwargs) # noqa: E501 + else: + (data) = self.test_inline_additional_properties_with_http_info(param, **kwargs) # noqa: E501 + return data + + def test_inline_additional_properties_with_http_info(self, param, **kwargs): # noqa: E501 + """test inline additionalProperties # noqa: E501 + + # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_inline_additional_properties_with_http_info(param, async=True) + >>> result = thread.get() + + :param async bool + :param object param: request body (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['param'] # noqa: E501 + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_inline_additional_properties" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'param' is set + if ('param' not in params or + params['param'] is None): + raise ValueError("Missing the required parameter `param` when calling `test_inline_additional_properties`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'param' in params: + body_params = params['param'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/inline-additionalProperties', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_json_form_data(self, param, param2, **kwargs): # noqa: E501 + """test json serialization of form data # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_json_form_data(param, param2, async=True) @@ -802,15 +910,15 @@ class FakeApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.test_json_form_data_with_http_info(param, param2, **kwargs) + return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501 else: - (data) = self.test_json_form_data_with_http_info(param, param2, **kwargs) + (data) = self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501 return data - def test_json_form_data_with_http_info(self, param, param2, **kwargs): - """ - test json serialization of form data - + def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: E501 + """test json serialization of form data # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_json_form_data_with_http_info(param, param2, async=True) @@ -824,14 +932,14 @@ class FakeApi(object): returns the request thread. """ - all_params = ['param', 'param2'] + all_params = ['param', 'param2'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -840,12 +948,13 @@ class FakeApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'param' is set - if ('param' not in params) or (params['param'] is None): - raise ValueError("Missing the required parameter `param` when calling `test_json_form_data`") + if ('param' not in params or + params['param'] is None): + raise ValueError("Missing the required parameter `param` when calling `test_json_form_data`") # noqa: E501 # verify the required parameter 'param2' is set - if ('param2' not in params) or (params['param2'] is None): - raise ValueError("Missing the required parameter `param2` when calling `test_json_form_data`") - + if ('param2' not in params or + params['param2'] is None): + raise ValueError("Missing the required parameter `param2` when calling `test_json_form_data`") # noqa: E501 collection_formats = {} @@ -858,29 +967,30 @@ class FakeApi(object): form_params = [] local_var_files = {} if 'param' in params: - form_params.append(('param', params['param'])) + form_params.append(('param', params['param'])) # noqa: E501 if 'param2' in params: - form_params.append(('param2', params['param2'])) + form_params.append(('param2', params['param2'])) # noqa: E501 body_params = None # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/fake/jsonFormData', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake/jsonFormData', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-asyncio/petstore_api/apis/fake_classname_tags_123_api.py b/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py similarity index 60% rename from samples/client/petstore/python-asyncio/petstore_api/apis/fake_classname_tags_123_api.py rename to samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py index da75ad3cccd..6b6606dc096 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/apis/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,19 +13,17 @@ from __future__ import absolute_import -import sys -import os -import re +import re # noqa: F401 # 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): - """ - 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. Ref: https://github.com/swagger-api/swagger-codegen """ @@ -35,9 +33,9 @@ class FakeClassnameTags123Api(object): api_client = ApiClient() self.api_client = api_client - def test_classname(self, body, **kwargs): - """ - To test class name in snake case + def test_classname(self, body, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_classname(body, async=True) @@ -51,14 +49,14 @@ class FakeClassnameTags123Api(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.test_classname_with_http_info(body, **kwargs) + (data) = self.test_classname_with_http_info(body, **kwargs) # noqa: E501 return data - def test_classname_with_http_info(self, body, **kwargs): - """ - To test class name in snake case + def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.test_classname_with_http_info(body, async=True) @@ -71,14 +69,14 @@ class FakeClassnameTags123Api(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -87,9 +85,9 @@ class FakeClassnameTags123Api(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `test_classname`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501 collection_formats = {} @@ -106,27 +104,28 @@ class FakeClassnameTags123Api(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['api_key_query'] + auth_settings = ['api_key_query'] # noqa: E501 - return self.api_client.call_api('/fake_classname_test', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Client', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/fake_classname_test', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python/petstore_api/apis/pet_api.py b/samples/client/petstore/python/petstore_api/api/pet_api.py similarity index 57% rename from samples/client/petstore/python/petstore_api/apis/pet_api.py rename to samples/client/petstore/python/petstore_api/api/pet_api.py index 51b6ce82540..ff1026f3fae 100644 --- a/samples/client/petstore/python/petstore_api/apis/pet_api.py +++ b/samples/client/petstore/python/petstore_api/api/pet_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,19 +13,17 @@ from __future__ import absolute_import -import sys -import os -import re +import re # noqa: F401 # 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): - """ - 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. Ref: https://github.com/swagger-api/swagger-codegen """ @@ -35,10 +33,10 @@ class PetApi(object): api_client = ApiClient() self.api_client = api_client - def add_pet(self, body, **kwargs): - """ - Add a new pet to the store - + def add_pet(self, body, **kwargs): # noqa: E501 + """Add a new pet to the store # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.add_pet(body, async=True) @@ -52,15 +50,15 @@ class PetApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.add_pet_with_http_info(body, **kwargs) + (data) = self.add_pet_with_http_info(body, **kwargs) # noqa: E501 return data - def add_pet_with_http_info(self, body, **kwargs): - """ - Add a new pet to the store - + def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 + """Add a new pet to the store # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.add_pet_with_http_info(body, async=True) @@ -73,14 +71,14 @@ class PetApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -89,9 +87,9 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `add_pet`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_pet`") # noqa: E501 collection_formats = {} @@ -108,35 +106,36 @@ class PetApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json', 'application/xml']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json', 'application/xml']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def delete_pet(self, pet_id, **kwargs): - """ - Deletes a pet - + def delete_pet(self, pet_id, **kwargs): # noqa: E501 + """Deletes a pet # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.delete_pet(pet_id, async=True) @@ -151,15 +150,15 @@ class PetApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.delete_pet_with_http_info(pet_id, **kwargs) + (data) = self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501 return data - def delete_pet_with_http_info(self, pet_id, **kwargs): - """ - Deletes a pet - + def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 + """Deletes a pet # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.delete_pet_with_http_info(pet_id, async=True) @@ -173,14 +172,14 @@ class PetApi(object): 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('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -189,52 +188,53 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in params) or (params['pet_id'] is None): - raise ValueError("Missing the required parameter `pet_id` when calling `delete_pet`") - + if ('pet_id' not in params or + params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501 collection_formats = {} path_params = {} if 'pet_id' in params: - path_params['petId'] = params['pet_id'] + path_params['petId'] = params['pet_id'] # noqa: E501 query_params = [] header_params = {} if 'api_key' in params: - header_params['api_key'] = params['api_key'] + header_params['api_key'] = params['api_key'] # noqa: E501 form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet/{petId}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet/{petId}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def find_pets_by_status(self, status, **kwargs): - """ - Finds Pets by status - Multiple status values can be provided with comma separated strings + def find_pets_by_status(self, status, **kwargs): # noqa: E501 + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.find_pets_by_status(status, async=True) @@ -248,15 +248,15 @@ class PetApi(object): """ kwargs['_return_http_data_only'] = True 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: - (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 - def find_pets_by_status_with_http_info(self, status, **kwargs): - """ - Finds Pets by status - Multiple status values can be provided with comma separated strings + def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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. """ - all_params = ['status'] + all_params = ['status'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -285,9 +285,9 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'status' is set - if ('status' not in params) or (params['status'] is None): - raise ValueError("Missing the required parameter `status` when calling `find_pets_by_status`") - + if ('status' not in params or + params['status'] is None): + raise ValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501 collection_formats = {} @@ -295,8 +295,8 @@ class PetApi(object): query_params = [] if 'status' in params: - query_params.append(('status', params['status'])) - collection_formats['status'] = 'csv' + query_params.append(('status', params['status'])) # noqa: E501 + collection_formats['status'] = 'csv' # noqa: E501 header_params = {} @@ -305,31 +305,32 @@ class PetApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet/findByStatus', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[Pet]', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet/findByStatus', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Pet]', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def find_pets_by_tags(self, tags, **kwargs): - """ - Finds Pets by tags - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + def find_pets_by_tags(self, tags, **kwargs): # noqa: E501 + """Finds Pets by tags # noqa: E501 + + 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 asynchronous HTTP request, please pass async=True >>> thread = api.find_pets_by_tags(tags, async=True) @@ -343,15 +344,15 @@ class PetApi(object): """ kwargs['_return_http_data_only'] = True 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: - (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 - def find_pets_by_tags_with_http_info(self, tags, **kwargs): - """ - Finds Pets by tags - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 + """Finds Pets by tags # noqa: E501 + + 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 asynchronous HTTP request, please pass 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. """ - all_params = ['tags'] + all_params = ['tags'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -380,9 +381,9 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'tags' is set - if ('tags' not in params) or (params['tags'] is None): - raise ValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") - + if ('tags' not in params or + params['tags'] is None): + raise ValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501 collection_formats = {} @@ -390,8 +391,8 @@ class PetApi(object): query_params = [] if 'tags' in params: - query_params.append(('tags', params['tags'])) - collection_formats['tags'] = 'csv' + query_params.append(('tags', params['tags'])) # noqa: E501 + collection_formats['tags'] = 'csv' # noqa: E501 header_params = {} @@ -400,31 +401,32 @@ class PetApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet/findByTags', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[Pet]', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet/findByTags', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Pet]', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def get_pet_by_id(self, pet_id, **kwargs): - """ - Find pet by ID - Returns a single pet + def get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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 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: - (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 - def get_pet_by_id_with_http_info(self, pet_id, **kwargs): - """ - Find pet by ID - Returns a single pet + def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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. """ - all_params = ['pet_id'] + all_params = ['pet_id'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -475,15 +477,15 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in params) or (params['pet_id'] is None): - raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") - + if ('pet_id' not in params or + params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501 collection_formats = {} path_params = {} if 'pet_id' in params: - path_params['petId'] = params['pet_id'] + path_params['petId'] = params['pet_id'] # noqa: E501 query_params = [] @@ -494,31 +496,32 @@ class PetApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = ['api_key'] + auth_settings = ['api_key'] # noqa: E501 - return self.api_client.call_api('/pet/{petId}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Pet', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet/{petId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Pet', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def update_pet(self, body, **kwargs): - """ - Update an existing pet - + def update_pet(self, body, **kwargs): # noqa: E501 + """Update an existing pet # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.update_pet(body, async=True) @@ -532,15 +535,15 @@ class PetApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.update_pet_with_http_info(body, **kwargs) + (data) = self.update_pet_with_http_info(body, **kwargs) # noqa: E501 return data - def update_pet_with_http_info(self, body, **kwargs): - """ - Update an existing pet - + def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 + """Update an existing pet # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.update_pet_with_http_info(body, async=True) @@ -553,14 +556,14 @@ class PetApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -569,9 +572,9 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_pet`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_pet`") # noqa: E501 collection_formats = {} @@ -588,35 +591,36 @@ class PetApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json', 'application/xml']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json', 'application/xml']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def update_pet_with_form(self, pet_id, **kwargs): - """ - Updates a pet in the store with form data - + def update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 + """Updates a pet in the store with form data # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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 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: - (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 - def update_pet_with_form_with_http_info(self, pet_id, **kwargs): - """ - Updates a pet in the store with form data - + 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 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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. """ - all_params = ['pet_id', 'name', 'status'] + all_params = ['pet_id', 'name', 'status'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -671,15 +675,15 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in params) or (params['pet_id'] is None): - raise ValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") - + if ('pet_id' not in params or + params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501 collection_formats = {} path_params = {} if 'pet_id' in params: - path_params['petId'] = params['pet_id'] + path_params['petId'] = params['pet_id'] # noqa: E501 query_params = [] @@ -688,41 +692,42 @@ class PetApi(object): form_params = [] local_var_files = {} if 'name' in params: - form_params.append(('name', params['name'])) + form_params.append(('name', params['name'])) # noqa: E501 if 'status' in params: - form_params.append(('status', params['status'])) + form_params.append(('status', params['status'])) # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/x-www-form-urlencoded']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/x-www-form-urlencoded']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet/{petId}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet/{petId}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def upload_file(self, pet_id, **kwargs): - """ - uploads an image - + def upload_file(self, pet_id, **kwargs): # noqa: E501 + """uploads an image # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.upload_file(pet_id, async=True) @@ -738,15 +743,15 @@ class PetApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.upload_file_with_http_info(pet_id, **kwargs) + (data) = self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501 return data - def upload_file_with_http_info(self, pet_id, **kwargs): - """ - uploads an image - + def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 + """uploads an image # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.upload_file_with_http_info(pet_id, async=True) @@ -761,14 +766,14 @@ class PetApi(object): 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('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -777,15 +782,15 @@ class PetApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in params) or (params['pet_id'] is None): - raise ValueError("Missing the required parameter `pet_id` when calling `upload_file`") - + if ('pet_id' not in params or + params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501 collection_formats = {} path_params = {} if 'pet_id' in params: - path_params['petId'] = params['pet_id'] + path_params['petId'] = params['pet_id'] # noqa: E501 query_params = [] @@ -794,33 +799,34 @@ class PetApi(object): form_params = [] local_var_files = {} 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: - local_var_files['file'] = params['file'] + local_var_files['file'] = params['file'] # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['multipart/form-data']) + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['multipart/form-data']) # noqa: E501 # Authentication setting - auth_settings = ['petstore_auth'] + auth_settings = ['petstore_auth'] # noqa: E501 - return self.api_client.call_api('/pet/{petId}/uploadImage', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ApiResponse', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/pet/{petId}/uploadImage', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ApiResponse', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python/petstore_api/apis/store_api.py b/samples/client/petstore/python/petstore_api/api/store_api.py similarity index 57% rename from samples/client/petstore/python/petstore_api/apis/store_api.py rename to samples/client/petstore/python/petstore_api/api/store_api.py index e9d9599c363..ebb9a4eb27a 100644 --- a/samples/client/petstore/python/petstore_api/apis/store_api.py +++ b/samples/client/petstore/python/petstore_api/api/store_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,19 +13,17 @@ from __future__ import absolute_import -import sys -import os -import re +import re # noqa: F401 # 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): - """ - 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. Ref: https://github.com/swagger-api/swagger-codegen """ @@ -35,10 +33,10 @@ class StoreApi(object): api_client = ApiClient() self.api_client = api_client - def delete_order(self, order_id, **kwargs): - """ - Delete purchase order by ID - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + def delete_order(self, order_id, **kwargs): # noqa: E501 + """Delete purchase order by ID # noqa: E501 + + 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 asynchronous HTTP request, please pass async=True >>> thread = api.delete_order(order_id, async=True) @@ -52,15 +50,15 @@ class StoreApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.delete_order_with_http_info(order_id, **kwargs) + (data) = self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501 return data - def delete_order_with_http_info(self, order_id, **kwargs): - """ - Delete purchase order by ID - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Delete purchase order by ID # noqa: E501 + + 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 asynchronous HTTP request, please pass async=True >>> thread = api.delete_order_with_http_info(order_id, async=True) @@ -73,14 +71,14 @@ class StoreApi(object): returns the request thread. """ - all_params = ['order_id'] + all_params = ['order_id'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -89,15 +87,15 @@ class StoreApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'order_id' is set - if ('order_id' not in params) or (params['order_id'] is None): - raise ValueError("Missing the required parameter `order_id` when calling `delete_order`") - + if ('order_id' not in params or + params['order_id'] is None): + raise ValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501 collection_formats = {} path_params = {} if 'order_id' in params: - path_params['order_id'] = params['order_id'] + path_params['order_id'] = params['order_id'] # noqa: E501 query_params = [] @@ -108,31 +106,32 @@ class StoreApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/store/order/{order_id}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/store/order/{order_id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def get_inventory(self, **kwargs): - """ - Returns pet inventories by status - Returns a map of status codes to quantities + def get_inventory(self, **kwargs): # noqa: E501 + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.get_inventory(async=True) @@ -145,15 +144,15 @@ class StoreApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_inventory_with_http_info(**kwargs) + return self.get_inventory_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.get_inventory_with_http_info(**kwargs) + (data) = self.get_inventory_with_http_info(**kwargs) # noqa: E501 return data - def get_inventory_with_http_info(self, **kwargs): - """ - Returns pet inventories by status - Returns a map of status codes to quantities + def get_inventory_with_http_info(self, **kwargs): # noqa: E501 + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.get_inventory_with_http_info(async=True) @@ -165,14 +164,14 @@ class StoreApi(object): returns the request thread. """ - all_params = [] + all_params = [] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -194,31 +193,32 @@ class StoreApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['api_key'] + auth_settings = ['api_key'] # noqa: E501 - return self.api_client.call_api('/store/inventory', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='dict(str, int)', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/store/inventory', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, int)', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def get_order_by_id(self, order_id, **kwargs): - """ - Find purchase order by ID - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + def get_order_by_id(self, order_id, **kwargs): # noqa: E501 + """Find purchase order by ID # noqa: E501 + + 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 asynchronous HTTP request, please pass 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 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: - (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 - def get_order_by_id_with_http_info(self, order_id, **kwargs): - """ - Find purchase order by ID - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Find purchase order by ID # noqa: E501 + + 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 asynchronous HTTP request, please pass 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. """ - all_params = ['order_id'] + all_params = ['order_id'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -269,19 +269,19 @@ class StoreApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'order_id' is set - if ('order_id' not in params) or (params['order_id'] is None): - raise ValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") - - 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' not in params or + 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: # 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 = {} path_params = {} if 'order_id' in params: - path_params['order_id'] = params['order_id'] + path_params['order_id'] = params['order_id'] # noqa: E501 query_params = [] @@ -292,31 +292,32 @@ class StoreApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/store/order/{order_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Order', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/store/order/{order_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Order', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def place_order(self, body, **kwargs): - """ - Place an order for a pet - + def place_order(self, body, **kwargs): # noqa: E501 + """Place an order for a pet # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.place_order(body, async=True) @@ -330,15 +331,15 @@ class StoreApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.place_order_with_http_info(body, **kwargs) + (data) = self.place_order_with_http_info(body, **kwargs) # noqa: E501 return data - def place_order_with_http_info(self, body, **kwargs): - """ - Place an order for a pet - + def place_order_with_http_info(self, body, **kwargs): # noqa: E501 + """Place an order for a pet # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.place_order_with_http_info(body, async=True) @@ -351,14 +352,14 @@ class StoreApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -367,9 +368,9 @@ class StoreApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `place_order`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `place_order`") # noqa: E501 collection_formats = {} @@ -386,23 +387,24 @@ class StoreApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/store/order', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Order', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/store/order', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Order', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-asyncio/petstore_api/apis/user_api.py b/samples/client/petstore/python/petstore_api/api/user_api.py similarity index 57% rename from samples/client/petstore/python-asyncio/petstore_api/apis/user_api.py rename to samples/client/petstore/python/petstore_api/api/user_api.py index ffdad2dd60f..89949844aa1 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/apis/user_api.py +++ b/samples/client/petstore/python/petstore_api/api/user_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,19 +13,17 @@ from __future__ import absolute_import -import sys -import os -import re +import re # noqa: F401 # 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): - """ - 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. Ref: https://github.com/swagger-api/swagger-codegen """ @@ -35,10 +33,10 @@ class UserApi(object): api_client = ApiClient() self.api_client = api_client - def create_user(self, body, **kwargs): - """ - Create user - This can only be done by the logged in user. + def create_user(self, body, **kwargs): # noqa: E501 + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.create_user(body, async=True) @@ -52,15 +50,15 @@ class UserApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.create_user_with_http_info(body, **kwargs) + (data) = self.create_user_with_http_info(body, **kwargs) # noqa: E501 return data - def create_user_with_http_info(self, body, **kwargs): - """ - Create user - This can only be done by the logged in user. + def create_user_with_http_info(self, body, **kwargs): # noqa: E501 + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.create_user_with_http_info(body, async=True) @@ -73,14 +71,14 @@ class UserApi(object): returns the request thread. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -89,9 +87,9 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_user`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_user`") # noqa: E501 collection_formats = {} @@ -108,31 +106,32 @@ class UserApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def create_users_with_array_input(self, body, **kwargs): - """ - Creates list of users with given input array - + def create_users_with_array_input(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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 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: - (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 - def create_users_with_array_input_with_http_info(self, body, **kwargs): - """ - Creates list of users with given input array - + def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -183,9 +182,9 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") # noqa: E501 collection_formats = {} @@ -202,31 +201,32 @@ class UserApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/createWithArray', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/createWithArray', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def create_users_with_list_input(self, body, **kwargs): - """ - Creates list of users with given input array - + def create_users_with_list_input(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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 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: - (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 - def create_users_with_list_input_with_http_info(self, body, **kwargs): - """ - Creates list of users with given input array - + def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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. """ - all_params = ['body'] + all_params = ['body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -277,9 +277,9 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") # noqa: E501 collection_formats = {} @@ -296,31 +296,32 @@ class UserApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/createWithList', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/createWithList', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def delete_user(self, username, **kwargs): - """ - Delete user - This can only be done by the logged in user. + def delete_user(self, username, **kwargs): # noqa: E501 + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.delete_user(username, async=True) @@ -334,15 +335,15 @@ class UserApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.delete_user_with_http_info(username, **kwargs) + (data) = self.delete_user_with_http_info(username, **kwargs) # noqa: E501 return data - def delete_user_with_http_info(self, username, **kwargs): - """ - Delete user - This can only be done by the logged in user. + def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.delete_user_with_http_info(username, async=True) @@ -355,14 +356,14 @@ class UserApi(object): returns the request thread. """ - all_params = ['username'] + all_params = ['username'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -371,15 +372,15 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in params) or (params['username'] is None): - raise ValueError("Missing the required parameter `username` when calling `delete_user`") - + if ('username' not in params or + params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501 collection_formats = {} path_params = {} if 'username' in params: - path_params['username'] = params['username'] + path_params['username'] = params['username'] # noqa: E501 query_params = [] @@ -390,31 +391,32 @@ class UserApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/{username}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/{username}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def get_user_by_name(self, username, **kwargs): - """ - Get user by user name - + def get_user_by_name(self, username, **kwargs): # noqa: E501 + """Get user by user name # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.get_user_by_name(username, async=True) @@ -428,15 +430,15 @@ class UserApi(object): """ kwargs['_return_http_data_only'] = True 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: - (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 - def get_user_by_name_with_http_info(self, username, **kwargs): - """ - Get user by user name - + def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 + """Get user by user name # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass 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. """ - all_params = ['username'] + all_params = ['username'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -465,15 +467,15 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in params) or (params['username'] is None): - raise ValueError("Missing the required parameter `username` when calling `get_user_by_name`") - + if ('username' not in params or + params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501 collection_formats = {} path_params = {} if 'username' in params: - path_params['username'] = params['username'] + path_params['username'] = params['username'] # noqa: E501 query_params = [] @@ -484,31 +486,32 @@ class UserApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/{username}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='User', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/{username}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='User', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def login_user(self, username, password, **kwargs): - """ - Logs user into the system - + def login_user(self, username, password, **kwargs): # noqa: E501 + """Logs user into the system # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.login_user(username, password, async=True) @@ -523,15 +526,15 @@ class UserApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.login_user_with_http_info(username, password, **kwargs) + (data) = self.login_user_with_http_info(username, password, **kwargs) # noqa: E501 return data - def login_user_with_http_info(self, username, password, **kwargs): - """ - Logs user into the system - + def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 + """Logs user into the system # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.login_user_with_http_info(username, password, async=True) @@ -545,14 +548,14 @@ class UserApi(object): returns the request thread. """ - all_params = ['username', 'password'] + all_params = ['username', 'password'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -561,12 +564,13 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in params) or (params['username'] is None): - raise ValueError("Missing the required parameter `username` when calling `login_user`") + if ('username' not in params or + params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501 # verify the required parameter 'password' is set - if ('password' not in params) or (params['password'] is None): - raise ValueError("Missing the required parameter `password` when calling `login_user`") - + if ('password' not in params or + params['password'] is None): + raise ValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501 collection_formats = {} @@ -574,9 +578,9 @@ class UserApi(object): query_params = [] if 'username' in params: - query_params.append(('username', params['username'])) + query_params.append(('username', params['username'])) # noqa: E501 if 'password' in params: - query_params.append(('password', params['password'])) + query_params.append(('password', params['password'])) # noqa: E501 header_params = {} @@ -585,31 +589,32 @@ class UserApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/login', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='str', - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/login', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def logout_user(self, **kwargs): - """ - Logs out current logged in user session - + def logout_user(self, **kwargs): # noqa: E501 + """Logs out current logged in user session # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.logout_user(async=True) @@ -622,15 +627,15 @@ class UserApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.logout_user_with_http_info(**kwargs) + return self.logout_user_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.logout_user_with_http_info(**kwargs) + (data) = self.logout_user_with_http_info(**kwargs) # noqa: E501 return data - def logout_user_with_http_info(self, **kwargs): - """ - Logs out current logged in user session - + def logout_user_with_http_info(self, **kwargs): # noqa: E501 + """Logs out current logged in user session # noqa: E501 + + # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.logout_user_with_http_info(async=True) @@ -642,14 +647,14 @@ class UserApi(object): returns the request thread. """ - all_params = [] + all_params = [] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -671,31 +676,32 @@ class UserApi(object): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/logout', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/logout', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - def update_user(self, username, body, **kwargs): - """ - Updated user - This can only be done by the logged in user. + def update_user(self, username, body, **kwargs): # noqa: E501 + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.update_user(username, body, async=True) @@ -710,15 +716,15 @@ class UserApi(object): """ kwargs['_return_http_data_only'] = True 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: - (data) = self.update_user_with_http_info(username, body, **kwargs) + (data) = self.update_user_with_http_info(username, body, **kwargs) # noqa: E501 return data - def update_user_with_http_info(self, username, body, **kwargs): - """ - Updated user - This can only be done by the logged in user. + def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501 + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.update_user_with_http_info(username, body, async=True) @@ -732,14 +738,14 @@ class UserApi(object): returns the request thread. """ - all_params = ['username', 'body'] + all_params = ['username', 'body'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() - for key, val in iteritems(params['kwargs']): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" @@ -748,18 +754,19 @@ class UserApi(object): params[key] = val del params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in params) or (params['username'] is None): - raise ValueError("Missing the required parameter `username` when calling `update_user`") + if ('username' not in params or + params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501 # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_user`") - + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_user`") # noqa: E501 collection_formats = {} path_params = {} if 'username' in params: - path_params['username'] = params['username'] + path_params['username'] = params['username'] # noqa: E501 query_params = [] @@ -772,23 +779,24 @@ class UserApi(object): if 'body' in params: body_params = params['body'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = [] + auth_settings = [] # noqa: E501 - return self.api_client.call_api('/user/{username}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - async=params.get('async'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + return self.api_client.call_api( + '/user/{username}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index 00347369b7c..805777128a6 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -2,7 +2,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,27 +11,25 @@ from __future__ import absolute_import -import os -import re +import datetime import json import mimetypes -import tempfile from multiprocessing.pool import ThreadPool - -from datetime import date, datetime +import os +import re +import tempfile # 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 . import models -from .configuration import Configuration -from .rest import ApiException, RESTClientObject +from petstore_api.configuration import Configuration +import petstore_api.models +from petstore_api import rest 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- server communication, and is invariant across implementations. Specifics of @@ -44,38 +42,39 @@ class ApiClient(object): :param configuration: .Configuration object for this client :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. - :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 """ - PRIMITIVE_TYPES = (float, bool, bytes, text_type) + integer_types + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types NATIVE_TYPES_MAPPING = { 'int': int, - 'long': int if PY3 else long, + 'long': int if six.PY3 else long, # noqa: F821 'float': float, 'str': str, 'bool': bool, - 'date': date, - 'datetime': datetime, + 'date': datetime.date, + 'datetime': datetime.datetime, '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: configuration = Configuration() self.configuration = configuration self.pool = ThreadPool() - self.rest_client = RESTClientObject(configuration) + self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} if header_name is not None: self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. self.user_agent = 'Swagger-Codegen/1.0.0/python' - + def __del__(self): self.pool.close() self.pool.join() @@ -92,12 +91,12 @@ class ApiClient(object): def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value - def __call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_type=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, _preload_content=True, - _request_timeout=None): + def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): config = self.configuration @@ -119,7 +118,9 @@ class ApiClient(object): for k, v in path_params: # specified safe chars, encode everything 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 if query_params: @@ -145,12 +146,11 @@ class ApiClient(object): url = self.configuration.host + resource_path # perform request and return response - response_data = self.request(method, url, - query_params=query_params, - headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) self.last_response = response_data @@ -165,11 +165,11 @@ class ApiClient(object): if _return_http_data_only: return (return_data) 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): - """ - Builds a JSON POST object. + """Builds a JSON POST object. If obj is None, return None. If obj is str, int, long, float, bool, return directly. @@ -192,7 +192,7 @@ class ApiClient(object): elif isinstance(obj, tuple): return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) - elif isinstance(obj, (datetime, date)): + elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() if isinstance(obj, dict): @@ -204,15 +204,14 @@ class ApiClient(object): # Convert attribute name to json key in # model definition for request. 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} 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): - """ - Deserializes response into an object. + """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for @@ -234,8 +233,7 @@ class ApiClient(object): return self.__deserialize(data, response_type) 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 klass: class literal, or string of class name. @@ -254,21 +252,21 @@ class ApiClient(object): if klass.startswith('dict('): sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2) return {k: self.__deserialize(v, sub_kls) - for k, v in iteritems(data)} + for k, v in six.iteritems(data)} # convert str to class if klass in self.NATIVE_TYPES_MAPPING: klass = self.NATIVE_TYPES_MAPPING[klass] else: - klass = getattr(models, klass) + klass = getattr(petstore_api.models, klass) if klass in self.PRIMITIVE_TYPES: return self.__deserialize_primitive(data, klass) elif klass == object: return self.__deserialize_object(data) - elif klass == date: + elif klass == datetime.date: return self.__deserialize_date(data) - elif klass == datetime: + elif klass == datetime.datetime: return self.__deserialize_datatime(data) else: return self.__deserialize_model(data, klass) @@ -277,10 +275,10 @@ class ApiClient(object): path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, response_type=None, auth_settings=None, async=None, - _return_http_data_only=None, collection_formats=None, _preload_content=True, - _request_timeout=None): - """ - Makes the HTTP request (synchronous) and return the deserialized data. + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + To make an async request, set the async parameter. :param resource_path: Path to method endpoint. @@ -297,13 +295,17 @@ class ApiClient(object): :param files dict: key -> filename, value -> filepath, for `multipart/form-data`. :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, header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without - reading/decoding response data. Default is True. - :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. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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: If async parameter is True, the request will be called asynchronously. @@ -316,22 +318,23 @@ class ApiClient(object): path_params, query_params, header_params, body, post_params, files, 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: - thread = self.pool.apply_async(self.__call_api, (resource_path, method, - path_params, query_params, + thread = self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, header_params, body, post_params, files, response_type, auth_settings, _return_http_data_only, - collection_formats, _preload_content, _request_timeout)) + collection_formats, + _preload_content, _request_timeout)) return thread def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, _request_timeout=None): - """ - Makes the HTTP request using RESTClient. - """ + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" if method == "GET": return self.rest_client.GET(url, query_params=query_params, @@ -390,8 +393,7 @@ class ApiClient(object): ) 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 dict collection_formats: Parameter collection formats @@ -400,7 +402,7 @@ class ApiClient(object): new_params = [] if collection_formats is None: 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: collection_format = collection_formats[k] if collection_format == 'multi': @@ -421,8 +423,7 @@ class ApiClient(object): return new_params def prepare_post_parameters(self, post_params=None, files=None): - """ - Builds form parameters. + """Builds form parameters. :param post_params: Normal form parameters. :param files: File parameters. @@ -434,7 +435,7 @@ class ApiClient(object): params = post_params if files: - for k, v in iteritems(files): + for k, v in six.iteritems(files): if not v: continue file_names = v if type(v) is list else [v] @@ -442,15 +443,15 @@ class ApiClient(object): with open(n, 'rb') as f: filename = os.path.basename(f.name) filedata = f.read() - mimetype = mimetypes.\ - guess_type(filename)[0] or 'application/octet-stream' - params.append(tuple([k, tuple([filename, filedata, mimetype])])) + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) return params 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. :return: Accept (e.g. application/json). @@ -466,8 +467,7 @@ class ApiClient(object): return ', '.join(accepts) 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. :return: Content-Type (e.g. application/json). @@ -483,8 +483,7 @@ class ApiClient(object): return content_types[0] 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 querys: Query parameters tuple list to be updated. @@ -508,7 +507,8 @@ class ApiClient(object): ) def __deserialize_file(self, response): - """ + """Deserializes body to file + Saves response body into a file in a temporary folder, using the filename from the `Content-Disposition` header if provided. @@ -521,9 +521,8 @@ class ApiClient(object): content_disposition = response.getheader("Content-Disposition") if content_disposition: - filename = re.\ - search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition).\ - group(1) + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) path = os.path.join(os.path.dirname(path), filename) with open(path, "w") as f: @@ -532,8 +531,7 @@ class ApiClient(object): return path def __deserialize_primitive(self, data, klass): - """ - Deserializes string to primitive type. + """Deserializes string to primitive type. :param data: str. :param klass: class literal. @@ -543,21 +541,19 @@ class ApiClient(object): try: return klass(data) except UnicodeEncodeError: - return unicode(data) + return unicode(data) # noqa: F821 except TypeError: return data def __deserialize_object(self, value): - """ - Return a original value. + """Return a original value. :return: object. """ return value def __deserialize_date(self, string): - """ - Deserializes string to date. + """Deserializes string to date. :param string: str. :return: date. @@ -568,14 +564,13 @@ class ApiClient(object): except ImportError: return string except ValueError: - raise ApiException( + raise rest.ApiException( 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): - """ - Deserializes string to datetime. + """Deserializes string to datetime. The string should be in iso8601 datetime format. @@ -588,32 +583,32 @@ class ApiClient(object): except ImportError: return string except ValueError: - raise ApiException( + raise rest.ApiException( status=0, reason=( - "Failed to parse `{0}` into a datetime object" + "Failed to parse `{0}` as datetime object" .format(string) ) ) def __deserialize_model(self, data, klass): - """ - Deserializes list or dict to model. + """Deserializes list or dict to model. :param data: dict, list. :param klass: class literal. :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 kwargs = {} if klass.swagger_types is not None: - for attr, attr_type in iteritems(klass.swagger_types): - if data is not None \ - and klass.attribute_map[attr] in data \ - and isinstance(data, (list, dict)): + for attr, attr_type in six.iteritems(klass.swagger_types): + if (data is not None and + klass.attribute_map[attr] in data and + isinstance(data, (list, dict))): value = data[klass.attribute_map[attr]] kwargs[attr] = self.__deserialize(value, attr_type) diff --git a/samples/client/petstore/python/petstore_api/apis/__init__.py b/samples/client/petstore/python/petstore_api/apis/__init__.py deleted file mode 100644 index b4b975ca8e0..00000000000 --- a/samples/client/petstore/python/petstore_api/apis/__init__.py +++ /dev/null @@ -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 diff --git a/samples/client/petstore/python/petstore_api/apis/fake_classname_tags123_api.py b/samples/client/petstore/python/petstore_api/apis/fake_classname_tags123_api.py deleted file mode 100644 index 4fe6106e00f..00000000000 --- a/samples/client/petstore/python/petstore_api/apis/fake_classname_tags123_api.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ - - OpenAPI spec version: 1.0.0 - Contact: apiteam@swagger.io - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import sys -import os -import re - -# python 2 and python 3 compatibility library -from six import iteritems - -from ..api_client import ApiClient - - -class FakeClassnameTags123Api(object): - """ - NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def test_classname(self, body, **kwargs): - """ - To test class name in snake case - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.test_classname(body, callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param Client body: client model (required) - :return: Client - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('callback'): - return self.test_classname_with_http_info(body, **kwargs) - else: - (data) = self.test_classname_with_http_info(body, **kwargs) - return data - - def test_classname_with_http_info(self, body, **kwargs): - """ - To test class name in snake case - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.test_classname_with_http_info(body, callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param Client body: client model (required) - :return: Client - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] - all_params.append('callback') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method test_classname" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params) or (params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `test_classname`") - - - collection_formats = {} - - resource_path = '/fake_classname_test'.replace('{format}', 'json') - path_params = {} - - query_params = {} - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json']) - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json']) - - # Authentication setting - auth_settings = [] - - return self.api_client.call_api(resource_path, 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Client', - auth_settings=auth_settings, - callback=params.get('callback'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 8410a94f57b..f6273cf28cc 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,24 +13,23 @@ from __future__ import absolute_import -import urllib3 - import copy import logging import multiprocessing import sys +import urllib3 -from six import iteritems -from six import with_metaclass +import six from six.moves import http_client as httplib + class TypeWithDefault(type): def __init__(cls, name, bases, dct): super(TypeWithDefault, cls).__init__(name, bases, dct) cls._default = None def __call__(cls): - if cls._default == None: + if cls._default is None: cls._default = type.__call__(cls) return copy.copy(cls._default) @@ -38,17 +37,15 @@ class TypeWithDefault(type): cls._default = copy.copy(default) -class Configuration(with_metaclass(TypeWithDefault, object)): - """ - NOTE: This class is auto generated by the swagger code generator program. +class Configuration(six.with_metaclass(TypeWithDefault, object)): + """NOTE: This class is auto generated by the swagger code generator program. + Ref: https://github.com/swagger-api/swagger-codegen Do not edit the class manually. """ def __init__(self): - """ - Constructor - """ + """Constructor""" # Default Base url self.host = "http://petstore.swagger.io:80/v2" # Temp file folder for downloading files @@ -83,7 +80,8 @@ class Configuration(with_metaclass(TypeWithDefault, object)): self.debug = False # 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 # Set this to customize the certificate file to verify the peer. 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. self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - # Proxy URL self.proxy = None # Safe chars for path_param @@ -111,8 +108,8 @@ class Configuration(with_metaclass(TypeWithDefault, object)): def logger_file(self): """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. + 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 @@ -123,8 +120,8 @@ class Configuration(with_metaclass(TypeWithDefault, object)): def logger_file(self, value): """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. + 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 @@ -135,7 +132,7 @@ class Configuration(with_metaclass(TypeWithDefault, object)): # then add file handler and remove stream handler. self.logger_file_handler = logging.FileHandler(self.__logger_file) 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) if self.logger_stream_handler: logger.removeHandler(self.logger_stream_handler) @@ -144,7 +141,7 @@ class Configuration(with_metaclass(TypeWithDefault, object)): # then add stream handler and remove file handler. self.logger_stream_handler = logging.StreamHandler() 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) if self.logger_file_handler: logger.removeHandler(self.logger_file_handler) @@ -168,14 +165,14 @@ class Configuration(with_metaclass(TypeWithDefault, object)): self.__debug = value if self.__debug: # 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) # turn on httplib debug httplib.HTTPConnection.debuglevel = 1 else: # if debug status is False, turn off debug logging, # setting log level to default `logging.WARNING` - for _, logger in iteritems(self.logger): + for _, logger in six.iteritems(self.logger): logger.setLevel(logging.WARNING) # turn off httplib debug httplib.HTTPConnection.debuglevel = 0 @@ -209,8 +206,9 @@ class Configuration(with_metaclass(TypeWithDefault, object)): :param identifier: The identifier of apiKey. :return: The token for api key authentication. """ - if self.api_key.get(identifier) and self.api_key_prefix.get(identifier): - return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] + if (self.api_key.get(identifier) and + self.api_key_prefix.get(identifier)): + return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 elif self.api_key.get(identifier): return self.api_key[identifier] @@ -219,8 +217,9 @@ class Configuration(with_metaclass(TypeWithDefault, object)): :return: The token for basic HTTP authentication. """ - return urllib3.util.make_headers(basic_auth=self.username + ':' + self.password)\ - .get('authorization') + return urllib3.util.make_headers( + basic_auth=self.username + ':' + self.password + ).get('authorization') def auth_settings(self): """Gets Auth Settings dict for api client. diff --git a/samples/client/petstore/python/petstore_api/models/__init__.py b/samples/client/petstore/python/petstore_api/models/__init__.py index 21b5d20fa3c..7b339102f9b 100644 --- a/samples/client/petstore/python/petstore_api/models/__init__.py +++ b/samples/client/petstore/python/petstore_api/models/__init__.py @@ -1,9 +1,10 @@ # coding: utf-8 +# flake8: noqa """ 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 Contact: apiteam@swagger.io @@ -14,39 +15,39 @@ from __future__ import absolute_import # import models into model package -from .additional_properties_class import AdditionalPropertiesClass -from .animal import Animal -from .animal_farm import AnimalFarm -from .api_response import ApiResponse -from .array_of_array_of_number_only import ArrayOfArrayOfNumberOnly -from .array_of_number_only import ArrayOfNumberOnly -from .array_test import ArrayTest -from .capitalization import Capitalization -from .category import Category -from .class_model import ClassModel -from .client import Client -from .enum_arrays import EnumArrays -from .enum_class import EnumClass -from .enum_test import EnumTest -from .format_test import FormatTest -from .has_only_read_only import HasOnlyReadOnly -from .list import List -from .map_test import MapTest -from .mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass -from .model_200_response import Model200Response -from .model_return import ModelReturn -from .name import Name -from .number_only import NumberOnly -from .order import Order -from .outer_boolean import OuterBoolean -from .outer_composite import OuterComposite -from .outer_enum import OuterEnum -from .outer_number import OuterNumber -from .outer_string import OuterString -from .pet import Pet -from .read_only_first import ReadOnlyFirst -from .special_model_name import SpecialModelName -from .tag import Tag -from .user import User -from .cat import Cat -from .dog import Dog +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 diff --git a/samples/client/petstore/python/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python/petstore_api/models/additional_properties_class.py index a5329b411cd..03dbe975f1b 100644 --- a/samples/client/petstore/python/petstore_api/models/additional_properties_class.py +++ b/samples/client/petstore/python/petstore_api/models/additional_properties_class.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class AdditionalPropertiesClass(object): 'map_of_map_property': 'map_of_map_property' } - def __init__(self, map_property=None, map_of_map_property=None): - """ - AdditionalPropertiesClass - a model defined in Swagger - """ + def __init__(self, map_property=None, map_of_map_property=None): # noqa: E501 + """AdditionalPropertiesClass - a model defined in Swagger""" # noqa: E501 self._map_property = None self._map_of_map_property = None self.discriminator = 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: - self.map_of_map_property = map_of_map_property + self.map_of_map_property = map_of_map_property @property def map_property(self): - """ - Gets the map_property of this AdditionalPropertiesClass. + """Gets the map_property of this AdditionalPropertiesClass. # noqa: E501 - :return: The map_property of this AdditionalPropertiesClass. + + :return: The map_property of this AdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, str) """ return self._map_property @map_property.setter 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) """ @@ -77,32 +75,30 @@ class AdditionalPropertiesClass(object): @property def map_of_map_property(self): - """ - Gets the map_of_map_property of this AdditionalPropertiesClass. + """Gets the map_of_map_property of this AdditionalPropertiesClass. # noqa: E501 - :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)) """ return self._map_of_map_property @map_of_map_property.setter 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)) """ self._map_of_map_property = map_of_map_property def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -123,28 +119,20 @@ class AdditionalPropertiesClass(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, AdditionalPropertiesClass): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/animal.py b/samples/client/petstore/python/petstore_api/models/animal.py index 13d8276713d..390ac83905e 100644 --- a/samples/client/petstore/python/petstore_api/models/animal.py +++ b/samples/client/petstore/python/petstore_api/models/animal.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -41,14 +41,12 @@ class Animal(object): } discriminator_value_class_map = { - '': 'Dog', - '': 'Cat' + 'Dog': 'Dog', + 'Cat': 'Cat' } - def __init__(self, class_name=None, color='red'): - """ - Animal - a model defined in Swagger - """ + def __init__(self, class_name=None, color='red'): # noqa: E501 + """Animal - a model defined in Swagger""" # noqa: E501 self._class_name = None self._color = None @@ -56,69 +54,62 @@ class Animal(object): self.class_name = class_name if color is not None: - self.color = color + self.color = color @property def class_name(self): - """ - Gets the class_name of this Animal. + """Gets the class_name of this Animal. # noqa: E501 - :return: The class_name of this Animal. + + :return: The class_name of this Animal. # noqa: E501 :rtype: str """ return self._class_name @class_name.setter 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 """ 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 @property def color(self): - """ - Gets the color of this Animal. + """Gets the color of this Animal. # noqa: E501 - :return: The color of this Animal. + + :return: The color of this Animal. # noqa: E501 :rtype: str """ return self._color @color.setter 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 """ self._color = color 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() - if self.discriminator_value_class_map.has_key(discriminator_value): - return self.discriminator_value_class_map[discriminator_value] - else: - return None + return self.discriminator_value_class_map.get(discriminator_value) def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -139,28 +130,20 @@ class Animal(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Animal): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/animal_farm.py b/samples/client/petstore/python/petstore_api/models/animal_farm.py index fa47d63f881..6371257286e 100644 --- a/samples/client/petstore/python/petstore_api/models/animal_farm.py +++ b/samples/client/petstore/python/petstore_api/models/animal_farm.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,20 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six + +from petstore_api.models.animal import Animal # noqa: F401,E501 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,28 +33,20 @@ class AnimalFarm(object): and the value is json key in definition. """ swagger_types = { - } attribute_map = { - } - def __init__(self): - """ - AnimalFarm - a model defined in Swagger - """ - + def __init__(self): # noqa: E501 + """AnimalFarm - a model defined in Swagger""" # noqa: E501 self.discriminator = None - def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -73,28 +67,20 @@ class AnimalFarm(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, AnimalFarm): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/api_response.py b/samples/client/petstore/python/petstore_api/models/api_response.py index b2d784d8020..45c4831bb10 100644 --- a/samples/client/petstore/python/petstore_api/models/api_response.py +++ b/samples/client/petstore/python/petstore_api/models/api_response.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +42,8 @@ class ApiResponse(object): 'message': 'message' } - def __init__(self, code=None, type=None, message=None): - """ - ApiResponse - a model defined in Swagger - """ + def __init__(self, code=None, type=None, message=None): # noqa: E501 + """ApiResponse - a model defined in Swagger""" # noqa: E501 self._code = None self._type = None @@ -53,28 +51,28 @@ class ApiResponse(object): self.discriminator = None if code is not None: - self.code = code + self.code = code if type is not None: - self.type = type + self.type = type if message is not None: - self.message = message + self.message = message @property def code(self): - """ - Gets the code of this ApiResponse. + """Gets the code of this ApiResponse. # noqa: E501 - :return: The code of this ApiResponse. + + :return: The code of this ApiResponse. # noqa: E501 :rtype: int """ return self._code @code.setter 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 """ @@ -82,20 +80,20 @@ class ApiResponse(object): @property def type(self): - """ - Gets the type of this ApiResponse. + """Gets the type of this ApiResponse. # noqa: E501 - :return: The type of this ApiResponse. + + :return: The type of this ApiResponse. # noqa: E501 :rtype: str """ return self._type @type.setter 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 """ @@ -103,32 +101,30 @@ class ApiResponse(object): @property def message(self): - """ - Gets the message of this ApiResponse. + """Gets the message of this ApiResponse. # noqa: E501 - :return: The message of this ApiResponse. + + :return: The message of this ApiResponse. # noqa: E501 :rtype: str """ return self._message @message.setter 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 """ self._message = message def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -149,28 +145,20 @@ class ApiResponse(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ApiResponse): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py b/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py index 0792f5a8a23..c6b363f19d8 100644 --- a/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class ArrayOfArrayOfNumberOnly(object): 'array_array_number': 'ArrayArrayNumber' } - def __init__(self, array_array_number=None): - """ - ArrayOfArrayOfNumberOnly - a model defined in Swagger - """ + def __init__(self, array_array_number=None): # noqa: E501 + """ArrayOfArrayOfNumberOnly - a model defined in Swagger""" # noqa: E501 self._array_array_number = None self.discriminator = None if array_array_number is not None: - self.array_array_number = array_array_number + self.array_array_number = array_array_number @property def array_array_number(self): - """ - Gets the array_array_number of this ArrayOfArrayOfNumberOnly. + """Gets the array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 - :return: The array_array_number of this ArrayOfArrayOfNumberOnly. + + :return: The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 :rtype: list[list[float]] """ return self._array_array_number @array_array_number.setter 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]] """ self._array_array_number = array_array_number def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class ArrayOfArrayOfNumberOnly(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ArrayOfArrayOfNumberOnly): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/array_of_number_only.py b/samples/client/petstore/python/petstore_api/models/array_of_number_only.py index 9d00e1b37a2..240362696cd 100644 --- a/samples/client/petstore/python/petstore_api/models/array_of_number_only.py +++ b/samples/client/petstore/python/petstore_api/models/array_of_number_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class ArrayOfNumberOnly(object): 'array_number': 'ArrayNumber' } - def __init__(self, array_number=None): - """ - ArrayOfNumberOnly - a model defined in Swagger - """ + def __init__(self, array_number=None): # noqa: E501 + """ArrayOfNumberOnly - a model defined in Swagger""" # noqa: E501 self._array_number = None self.discriminator = None if array_number is not None: - self.array_number = array_number + self.array_number = array_number @property def array_number(self): - """ - Gets the array_number of this ArrayOfNumberOnly. + """Gets the array_number of this ArrayOfNumberOnly. # noqa: E501 - :return: The array_number of this ArrayOfNumberOnly. + + :return: The array_number of this ArrayOfNumberOnly. # noqa: E501 :rtype: list[float] """ return self._array_number @array_number.setter 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] """ self._array_number = array_number def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class ArrayOfNumberOnly(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ArrayOfNumberOnly): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/array_test.py b/samples/client/petstore/python/petstore_api/models/array_test.py index ac3079087c8..c5cd6bfe159 100644 --- a/samples/client/petstore/python/petstore_api/models/array_test.py +++ b/samples/client/petstore/python/petstore_api/models/array_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,20 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six + +from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: F401,E501 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +44,8 @@ class ArrayTest(object): '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): - """ - ArrayTest - a model defined in Swagger - """ + 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 self._array_of_string = None self._array_array_of_integer = None @@ -53,28 +53,28 @@ class ArrayTest(object): self.discriminator = 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: - 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: - self.array_array_of_model = array_array_of_model + self.array_array_of_model = array_array_of_model @property def array_of_string(self): - """ - Gets the array_of_string of this ArrayTest. + """Gets the array_of_string of this ArrayTest. # noqa: E501 - :return: The array_of_string of this ArrayTest. + + :return: The array_of_string of this ArrayTest. # noqa: E501 :rtype: list[str] """ return self._array_of_string @array_of_string.setter 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] """ @@ -82,20 +82,20 @@ class ArrayTest(object): @property def array_array_of_integer(self): - """ - Gets the array_array_of_integer of this ArrayTest. + """Gets the array_array_of_integer of this ArrayTest. # noqa: E501 - :return: The array_array_of_integer of this ArrayTest. + + :return: The array_array_of_integer of this ArrayTest. # noqa: E501 :rtype: list[list[int]] """ return self._array_array_of_integer @array_array_of_integer.setter 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]] """ @@ -103,32 +103,30 @@ class ArrayTest(object): @property def array_array_of_model(self): - """ - Gets the array_array_of_model of this ArrayTest. + """Gets the array_array_of_model of this ArrayTest. # noqa: E501 - :return: The array_array_of_model of this ArrayTest. + + :return: The array_array_of_model of this ArrayTest. # noqa: E501 :rtype: list[list[ReadOnlyFirst]] """ return self._array_array_of_model @array_array_of_model.setter 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]] """ self._array_array_of_model = array_array_of_model def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -149,28 +147,20 @@ class ArrayTest(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ArrayTest): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/capitalization.py b/samples/client/petstore/python/petstore_api/models/capitalization.py index c9be6ed4d15..309642bdeff 100644 --- a/samples/client/petstore/python/petstore_api/models/capitalization.py +++ b/samples/client/petstore/python/petstore_api/models/capitalization.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -48,10 +48,8 @@ class Capitalization(object): '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): - """ - Capitalization - a model defined in Swagger - """ + 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 self._small_camel = None self._capital_camel = None @@ -62,34 +60,34 @@ class Capitalization(object): self.discriminator = None if small_camel is not None: - self.small_camel = small_camel + self.small_camel = small_camel if capital_camel is not None: - self.capital_camel = capital_camel + self.capital_camel = capital_camel if small_snake is not None: - self.small_snake = small_snake + self.small_snake = small_snake if capital_snake is not None: - self.capital_snake = capital_snake + self.capital_snake = capital_snake 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: - self.att_name = att_name + self.att_name = att_name @property def small_camel(self): - """ - Gets the small_camel of this Capitalization. + """Gets the small_camel of this Capitalization. # noqa: E501 - :return: The small_camel of this Capitalization. + + :return: The small_camel of this Capitalization. # noqa: E501 :rtype: str """ return self._small_camel @small_camel.setter 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 """ @@ -97,20 +95,20 @@ class Capitalization(object): @property def capital_camel(self): - """ - Gets the capital_camel of this Capitalization. + """Gets the capital_camel of this Capitalization. # noqa: E501 - :return: The capital_camel of this Capitalization. + + :return: The capital_camel of this Capitalization. # noqa: E501 :rtype: str """ return self._capital_camel @capital_camel.setter 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 """ @@ -118,20 +116,20 @@ class Capitalization(object): @property def small_snake(self): - """ - Gets the small_snake of this Capitalization. + """Gets the small_snake of this Capitalization. # noqa: E501 - :return: The small_snake of this Capitalization. + + :return: The small_snake of this Capitalization. # noqa: E501 :rtype: str """ return self._small_snake @small_snake.setter 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 """ @@ -139,20 +137,20 @@ class Capitalization(object): @property def capital_snake(self): - """ - Gets the capital_snake of this Capitalization. + """Gets the capital_snake of this Capitalization. # noqa: E501 - :return: The capital_snake of this Capitalization. + + :return: The capital_snake of this Capitalization. # noqa: E501 :rtype: str """ return self._capital_snake @capital_snake.setter 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 """ @@ -160,20 +158,20 @@ class Capitalization(object): @property def sca_eth_flow_points(self): - """ - Gets the sca_eth_flow_points of this Capitalization. + """Gets the sca_eth_flow_points of this Capitalization. # noqa: E501 - :return: The sca_eth_flow_points of this Capitalization. + + :return: The sca_eth_flow_points of this Capitalization. # noqa: E501 :rtype: str """ return self._sca_eth_flow_points @sca_eth_flow_points.setter 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 """ @@ -181,34 +179,32 @@ class Capitalization(object): @property def att_name(self): - """ - Gets the att_name of this Capitalization. - Name of the pet + """Gets the att_name of this Capitalization. # noqa: E501 - :return: The att_name of this Capitalization. + Name of the pet # noqa: E501 + + :return: The att_name of this Capitalization. # noqa: E501 :rtype: str """ return self._att_name @att_name.setter def att_name(self, att_name): - """ - Sets the att_name of this Capitalization. - Name of the pet + """Sets the att_name of this Capitalization. - :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 """ self._att_name = att_name def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -229,28 +225,20 @@ class Capitalization(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Capitalization): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/cat.py b/samples/client/petstore/python/petstore_api/models/cat.py index 76dfdc0e5b1..526d3e2aaf5 100644 --- a/samples/client/petstore/python/petstore_api/models/cat.py +++ b/samples/client/petstore/python/petstore_api/models/cat.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,20 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six + +from petstore_api.models.animal import Animal # noqa: F401,E501 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +40,41 @@ class Cat(object): 'declawed': 'declawed' } - def __init__(self, declawed=None): - """ - Cat - a model defined in Swagger - """ + def __init__(self, declawed=None): # noqa: E501 + """Cat - a model defined in Swagger""" # noqa: E501 self._declawed = None self.discriminator = None if declawed is not None: - self.declawed = declawed + self.declawed = declawed @property def declawed(self): - """ - Gets the declawed of this Cat. + """Gets the declawed of this Cat. # noqa: E501 - :return: The declawed of this Cat. + + :return: The declawed of this Cat. # noqa: E501 :rtype: bool """ return self._declawed @declawed.setter 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 """ self._declawed = declawed def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +95,20 @@ class Cat(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Cat): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/category.py b/samples/client/petstore/python/petstore_api/models/category.py index 859283a3f77..02d393af888 100644 --- a/samples/client/petstore/python/petstore_api/models/category.py +++ b/samples/client/petstore/python/petstore_api/models/category.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class Category(object): 'name': 'name' } - def __init__(self, id=None, name=None): - """ - Category - a model defined in Swagger - """ + def __init__(self, id=None, name=None): # noqa: E501 + """Category - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None self.discriminator = None if id is not None: - self.id = id + self.id = id if name is not None: - self.name = name + self.name = name @property def id(self): - """ - Gets the id of this Category. + """Gets the id of this Category. # noqa: E501 - :return: The id of this Category. + + :return: The id of this Category. # noqa: E501 :rtype: int """ return self._id @id.setter 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 """ @@ -77,32 +75,30 @@ class Category(object): @property def name(self): - """ - Gets the name of this Category. + """Gets the name of this Category. # noqa: E501 - :return: The name of this Category. + + :return: The name of this Category. # noqa: E501 :rtype: str """ return self._name @name.setter 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 """ self._name = name def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -123,28 +119,20 @@ class Category(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Category): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/class_model.py b/samples/client/petstore/python/petstore_api/models/class_model.py index 7b39d38abe9..4bcb19b8dc2 100644 --- a/samples/client/petstore/python/petstore_api/models/class_model.py +++ b/samples/client/petstore/python/petstore_api/models/class_model.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class ClassModel(object): '_class': '_class' } - def __init__(self, _class=None): - """ - ClassModel - a model defined in Swagger - """ + def __init__(self, _class=None): # noqa: E501 + """ClassModel - a model defined in Swagger""" # noqa: E501 self.__class = None self.discriminator = None if _class is not None: - self._class = _class + self._class = _class @property def _class(self): - """ - Gets the _class of this ClassModel. + """Gets the _class of this ClassModel. # noqa: E501 - :return: The _class of this ClassModel. + + :return: The _class of this ClassModel. # noqa: E501 :rtype: str """ return self.__class @_class.setter 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 """ self.__class = _class def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class ClassModel(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ClassModel): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/client.py b/samples/client/petstore/python/petstore_api/models/client.py index 395f77913cc..e267fed6d8c 100644 --- a/samples/client/petstore/python/petstore_api/models/client.py +++ b/samples/client/petstore/python/petstore_api/models/client.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class Client(object): 'client': 'client' } - def __init__(self, client=None): - """ - Client - a model defined in Swagger - """ + def __init__(self, client=None): # noqa: E501 + """Client - a model defined in Swagger""" # noqa: E501 self._client = None self.discriminator = None if client is not None: - self.client = client + self.client = client @property def client(self): - """ - Gets the client of this Client. + """Gets the client of this Client. # noqa: E501 - :return: The client of this Client. + + :return: The client of this Client. # noqa: E501 :rtype: str """ return self._client @client.setter 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 """ self._client = client def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class Client(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Client): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/dog.py b/samples/client/petstore/python/petstore_api/models/dog.py index 3c159ad0d6f..34aac6aaad4 100644 --- a/samples/client/petstore/python/petstore_api/models/dog.py +++ b/samples/client/petstore/python/petstore_api/models/dog.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,20 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six + +from petstore_api.models.animal import Animal # noqa: F401,E501 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +40,41 @@ class Dog(object): 'breed': 'breed' } - def __init__(self, breed=None): - """ - Dog - a model defined in Swagger - """ + def __init__(self, breed=None): # noqa: E501 + """Dog - a model defined in Swagger""" # noqa: E501 self._breed = None self.discriminator = None if breed is not None: - self.breed = breed + self.breed = breed @property def breed(self): - """ - Gets the breed of this Dog. + """Gets the breed of this Dog. # noqa: E501 - :return: The breed of this Dog. + + :return: The breed of this Dog. # noqa: E501 :rtype: str """ return self._breed @breed.setter 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 """ self._breed = breed def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +95,20 @@ class Dog(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Dog): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/enum_arrays.py b/samples/client/petstore/python/petstore_api/models/enum_arrays.py index 893085ea235..d02be298d2f 100644 --- a/samples/client/petstore/python/petstore_api/models/enum_arrays.py +++ b/samples/client/petstore/python/petstore_api/models/enum_arrays.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,42 +40,40 @@ class EnumArrays(object): 'array_enum': 'array_enum' } - def __init__(self, just_symbol=None, array_enum=None): - """ - EnumArrays - a model defined in Swagger - """ + def __init__(self, just_symbol=None, array_enum=None): # noqa: E501 + """EnumArrays - a model defined in Swagger""" # noqa: E501 self._just_symbol = None self._array_enum = None self.discriminator = None if just_symbol is not None: - self.just_symbol = just_symbol + self.just_symbol = just_symbol if array_enum is not None: - self.array_enum = array_enum + self.array_enum = array_enum @property def just_symbol(self): - """ - Gets the just_symbol of this EnumArrays. + """Gets the just_symbol of this EnumArrays. # noqa: E501 - :return: The just_symbol of this EnumArrays. + + :return: The just_symbol of this EnumArrays. # noqa: E501 :rtype: str """ return self._just_symbol @just_symbol.setter 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 """ - allowed_values = [">=", "$"] + allowed_values = [">=", "$"] # noqa: E501 if just_symbol not in allowed_values: 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) ) @@ -83,39 +81,37 @@ class EnumArrays(object): @property def array_enum(self): - """ - Gets the array_enum of this EnumArrays. + """Gets the array_enum of this EnumArrays. # noqa: E501 - :return: The array_enum of this EnumArrays. + + :return: The array_enum of this EnumArrays. # noqa: E501 :rtype: list[str] """ return self._array_enum @array_enum.setter 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] """ - allowed_values = ["fish", "crab"] + allowed_values = ["fish", "crab"] # noqa: E501 if not set(array_enum).issubset(set(allowed_values)): raise ValueError( - "Invalid values for `array_enum` [{0}], must be a subset of [{1}]" - .format(", ".join(map(str, set(array_enum)-set(allowed_values))), + "Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501 ", ".join(map(str, allowed_values))) ) self._array_enum = array_enum def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -136,28 +132,20 @@ class EnumArrays(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, EnumArrays): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/enum_class.py b/samples/client/petstore/python/petstore_api/models/enum_class.py index d9e0b771a7d..e4721545e83 100644 --- a/samples/client/petstore/python/petstore_api/models/enum_class.py +++ b/samples/client/petstore/python/petstore_api/models/enum_class.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,14 +11,15 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ @@ -37,28 +38,20 @@ class EnumClass(object): and the value is json key in definition. """ swagger_types = { - } attribute_map = { - } - def __init__(self): - """ - EnumClass - a model defined in Swagger - """ - + def __init__(self): # noqa: E501 + """EnumClass - a model defined in Swagger""" # noqa: E501 self.discriminator = None - def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -79,28 +72,20 @@ class EnumClass(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, EnumClass): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/enum_test.py b/samples/client/petstore/python/petstore_api/models/enum_test.py index 6d7caa1f4bc..1bb234764ab 100644 --- a/samples/client/petstore/python/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python/petstore_api/models/enum_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,20 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six + +from petstore_api.models.outer_enum import OuterEnum # noqa: F401,E501 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,10 +46,8 @@ class EnumTest(object): 'outer_enum': 'outerEnum' } - def __init__(self, enum_string=None, enum_integer=None, enum_number=None, outer_enum=None): - """ - EnumTest - a model defined in Swagger - """ + 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 self._enum_string = None self._enum_integer = None @@ -56,36 +56,36 @@ class EnumTest(object): self.discriminator = None if enum_string is not None: - self.enum_string = enum_string + self.enum_string = enum_string if enum_integer is not None: - self.enum_integer = enum_integer + self.enum_integer = enum_integer if enum_number is not None: - self.enum_number = enum_number + self.enum_number = enum_number if outer_enum is not None: - self.outer_enum = outer_enum + self.outer_enum = outer_enum @property def enum_string(self): - """ - Gets the enum_string of this EnumTest. + """Gets the enum_string of this EnumTest. # noqa: E501 - :return: The enum_string of this EnumTest. + + :return: The enum_string of this EnumTest. # noqa: E501 :rtype: str """ return self._enum_string @enum_string.setter 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 """ - allowed_values = ["UPPER", "lower", ""] + allowed_values = ["UPPER", "lower", ""] # noqa: E501 if enum_string not in allowed_values: 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) ) @@ -93,26 +93,26 @@ class EnumTest(object): @property def enum_integer(self): - """ - Gets the enum_integer of this EnumTest. + """Gets the enum_integer of this EnumTest. # noqa: E501 - :return: The enum_integer of this EnumTest. + + :return: The enum_integer of this EnumTest. # noqa: E501 :rtype: int """ return self._enum_integer @enum_integer.setter 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 """ - allowed_values = [1, -1] + allowed_values = [1, -1] # noqa: E501 if enum_integer not in allowed_values: 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) ) @@ -120,26 +120,26 @@ class EnumTest(object): @property def enum_number(self): - """ - Gets the enum_number of this EnumTest. + """Gets the enum_number of this EnumTest. # noqa: E501 - :return: The enum_number of this EnumTest. + + :return: The enum_number of this EnumTest. # noqa: E501 :rtype: float """ return self._enum_number @enum_number.setter 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 """ - allowed_values = [1.1, -1.2] + allowed_values = [1.1, -1.2] # noqa: E501 if enum_number not in allowed_values: 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) ) @@ -147,32 +147,30 @@ class EnumTest(object): @property def outer_enum(self): - """ - Gets the outer_enum of this EnumTest. + """Gets the outer_enum of this EnumTest. # noqa: E501 - :return: The outer_enum of this EnumTest. + + :return: The outer_enum of this EnumTest. # noqa: E501 :rtype: OuterEnum """ return self._outer_enum @outer_enum.setter 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 """ self._outer_enum = outer_enum def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -193,28 +191,20 @@ class EnumTest(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, EnumTest): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/format_test.py b/samples/client/petstore/python/petstore_api/models/format_test.py index 139d1733b35..7974d732fda 100644 --- a/samples/client/petstore/python/petstore_api/models/format_test.py +++ b/samples/client/petstore/python/petstore_api/models/format_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -62,10 +62,8 @@ class FormatTest(object): '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): - """ - FormatTest - a model defined in Swagger - """ + 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 self._integer = None self._int32 = None @@ -83,94 +81,94 @@ class FormatTest(object): self.discriminator = None if integer is not None: - self.integer = integer + self.integer = integer if int32 is not None: - self.int32 = int32 + self.int32 = int32 if int64 is not None: - self.int64 = int64 + self.int64 = int64 self.number = number if float is not None: - self.float = float + self.float = float if double is not None: - self.double = double + self.double = double if string is not None: - self.string = string + self.string = string self.byte = byte if binary is not None: - self.binary = binary + self.binary = binary self.date = date if date_time is not None: - self.date_time = date_time + self.date_time = date_time if uuid is not None: - self.uuid = uuid + self.uuid = uuid self.password = password @property def integer(self): - """ - Gets the integer of this FormatTest. + """Gets the integer of this FormatTest. # noqa: E501 - :return: The integer of this FormatTest. + + :return: The integer of this FormatTest. # noqa: E501 :rtype: int """ return self._integer @integer.setter 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 """ - if integer is not None and integer > 100: - raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100`") - if integer is not None and integer < 10: - raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") + 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`") # noqa: E501 + 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`") # noqa: E501 self._integer = integer @property def int32(self): - """ - Gets the int32 of this FormatTest. + """Gets the int32 of this FormatTest. # noqa: E501 - :return: The int32 of this FormatTest. + + :return: The int32 of this FormatTest. # noqa: E501 :rtype: int """ return self._int32 @int32.setter 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 """ - if int32 is not None and int32 > 200: - raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200`") - if int32 is not None and int32 < 20: - raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") + 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`") # noqa: E501 + 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`") # noqa: E501 self._int32 = int32 @property def int64(self): - """ - Gets the int64 of this FormatTest. + """Gets the int64 of this FormatTest. # noqa: E501 - :return: The int64 of this FormatTest. + + :return: The int64 of this FormatTest. # noqa: E501 :rtype: int """ return self._int64 @int64.setter 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 """ @@ -178,145 +176,145 @@ class FormatTest(object): @property def number(self): - """ - Gets the number of this FormatTest. + """Gets the number of this FormatTest. # noqa: E501 - :return: The number of this FormatTest. + + :return: The number of this FormatTest. # noqa: E501 :rtype: float """ return self._number @number.setter 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 """ if number is None: - raise ValueError("Invalid value for `number`, must not be `None`") - if number is not None and number > 543.2: - raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`") - if number is not None and number < 32.1: - raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") + raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501 + 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`") # noqa: E501 + 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`") # noqa: E501 self._number = number @property def float(self): - """ - Gets the float of this FormatTest. + """Gets the float of this FormatTest. # noqa: E501 - :return: The float of this FormatTest. + + :return: The float of this FormatTest. # noqa: E501 :rtype: float """ return self._float @float.setter 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 """ - if float is not None and float > 987.6: - raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") - if float is not None and float < 54.3: - raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") + 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`") # noqa: E501 + 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`") # noqa: E501 self._float = float @property def double(self): - """ - Gets the double of this FormatTest. + """Gets the double of this FormatTest. # noqa: E501 - :return: The double of this FormatTest. + + :return: The double of this FormatTest. # noqa: E501 :rtype: float """ return self._double @double.setter 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 """ - if double is not None and double > 123.4: - raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`") - if double is not None and double < 67.8: - raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") + 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`") # noqa: E501 + 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`") # noqa: E501 self._double = double @property def string(self): - """ - Gets the string of this FormatTest. + """Gets the string of this FormatTest. # noqa: E501 - :return: The string of this FormatTest. + + :return: The string of this FormatTest. # noqa: E501 :rtype: str """ return self._string @string.setter 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 """ - if string is not None and not re.search('[a-z]', string, flags=re.IGNORECASE): - raise ValueError("Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") + 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`") # noqa: E501 self._string = string @property def byte(self): - """ - Gets the byte of this FormatTest. + """Gets the byte of this FormatTest. # noqa: E501 - :return: The byte of this FormatTest. + + :return: The byte of this FormatTest. # noqa: E501 :rtype: str """ return self._byte @byte.setter 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 """ if byte is None: - raise ValueError("Invalid value for `byte`, must not be `None`") - 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): - 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 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): # 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}=)?$/`") # noqa: E501 self._byte = byte @property def binary(self): - """ - Gets the binary of this FormatTest. + """Gets the binary of this FormatTest. # noqa: E501 - :return: The binary of this FormatTest. + + :return: The binary of this FormatTest. # noqa: E501 :rtype: str """ return self._binary @binary.setter 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 """ @@ -324,43 +322,43 @@ class FormatTest(object): @property def date(self): - """ - Gets the date of this FormatTest. + """Gets the date of this FormatTest. # noqa: E501 - :return: The date of this FormatTest. + + :return: The date of this FormatTest. # noqa: E501 :rtype: date """ return self._date @date.setter 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 """ 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 @property def date_time(self): - """ - Gets the date_time of this FormatTest. + """Gets the date_time of this FormatTest. # noqa: E501 - :return: The date_time of this FormatTest. + + :return: The date_time of this FormatTest. # noqa: E501 :rtype: datetime """ return self._date_time @date_time.setter 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 """ @@ -368,20 +366,20 @@ class FormatTest(object): @property def uuid(self): - """ - Gets the uuid of this FormatTest. + """Gets the uuid of this FormatTest. # noqa: E501 - :return: The uuid of this FormatTest. + + :return: The uuid of this FormatTest. # noqa: E501 :rtype: str """ return self._uuid @uuid.setter 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 """ @@ -389,38 +387,36 @@ class FormatTest(object): @property def password(self): - """ - Gets the password of this FormatTest. + """Gets the password of this FormatTest. # noqa: E501 - :return: The password of this FormatTest. + + :return: The password of this FormatTest. # noqa: E501 :rtype: str """ return self._password @password.setter 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 """ 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: - 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: - 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 def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -441,28 +437,20 @@ class FormatTest(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, FormatTest): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/has_only_read_only.py b/samples/client/petstore/python/petstore_api/models/has_only_read_only.py index da0c14ec5b1..3c93eb30996 100644 --- a/samples/client/petstore/python/petstore_api/models/has_only_read_only.py +++ b/samples/client/petstore/python/petstore_api/models/has_only_read_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class HasOnlyReadOnly(object): 'foo': 'foo' } - def __init__(self, bar=None, foo=None): - """ - HasOnlyReadOnly - a model defined in Swagger - """ + def __init__(self, bar=None, foo=None): # noqa: E501 + """HasOnlyReadOnly - a model defined in Swagger""" # noqa: E501 self._bar = None self._foo = None self.discriminator = None if bar is not None: - self.bar = bar + self.bar = bar if foo is not None: - self.foo = foo + self.foo = foo @property def bar(self): - """ - Gets the bar of this HasOnlyReadOnly. + """Gets the bar of this HasOnlyReadOnly. # noqa: E501 - :return: The bar of this HasOnlyReadOnly. + + :return: The bar of this HasOnlyReadOnly. # noqa: E501 :rtype: str """ return self._bar @bar.setter 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 """ @@ -77,32 +75,30 @@ class HasOnlyReadOnly(object): @property def foo(self): - """ - Gets the foo of this HasOnlyReadOnly. + """Gets the foo of this HasOnlyReadOnly. # noqa: E501 - :return: The foo of this HasOnlyReadOnly. + + :return: The foo of this HasOnlyReadOnly. # noqa: E501 :rtype: str """ return self._foo @foo.setter 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 """ self._foo = foo def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -123,28 +119,20 @@ class HasOnlyReadOnly(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, HasOnlyReadOnly): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/list.py b/samples/client/petstore/python/petstore_api/models/list.py index 2ac0e51fb12..fbe30e6d01e 100644 --- a/samples/client/petstore/python/petstore_api/models/list.py +++ b/samples/client/petstore/python/petstore_api/models/list.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class List(object): '_123_list': '123-list' } - def __init__(self, _123_list=None): - """ - List - a model defined in Swagger - """ + def __init__(self, _123_list=None): # noqa: E501 + """List - a model defined in Swagger""" # noqa: E501 self.__123_list = None self.discriminator = None if _123_list is not None: - self._123_list = _123_list + self._123_list = _123_list @property def _123_list(self): - """ - Gets the _123_list of this List. + """Gets the _123_list of this List. # noqa: E501 - :return: The _123_list of this List. + + :return: The _123_list of this List. # noqa: E501 :rtype: str """ return self.__123_list @_123_list.setter 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 """ self.__123_list = _123_list def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class List(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, List): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/map_test.py b/samples/client/petstore/python/petstore_api/models/map_test.py index 3cb936e0db8..374c0661ba5 100644 --- a/samples/client/petstore/python/petstore_api/models/map_test.py +++ b/samples/client/petstore/python/petstore_api/models/map_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class MapTest(object): 'map_of_enum_string': 'map_of_enum_string' } - def __init__(self, map_map_of_string=None, map_of_enum_string=None): - """ - MapTest - a model defined in Swagger - """ + def __init__(self, map_map_of_string=None, map_of_enum_string=None): # noqa: E501 + """MapTest - a model defined in Swagger""" # noqa: E501 self._map_map_of_string = None self._map_of_enum_string = None self.discriminator = 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: - self.map_of_enum_string = map_of_enum_string + self.map_of_enum_string = map_of_enum_string @property def map_map_of_string(self): - """ - Gets the map_map_of_string of this MapTest. + """Gets the map_map_of_string of this MapTest. # noqa: E501 - :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)) """ return self._map_map_of_string @map_map_of_string.setter 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)) """ @@ -77,39 +75,37 @@ class MapTest(object): @property def map_of_enum_string(self): - """ - Gets the map_of_enum_string of this MapTest. + """Gets the map_of_enum_string of this MapTest. # noqa: E501 - :return: The map_of_enum_string of this MapTest. + + :return: The map_of_enum_string of this MapTest. # noqa: E501 :rtype: dict(str, str) """ return self._map_of_enum_string @map_of_enum_string.setter 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) """ - allowed_values = ["UPPER", "lower"] + allowed_values = ["UPPER", "lower"] # noqa: E501 if not set(map_of_enum_string.keys()).issubset(set(allowed_values)): raise ValueError( - "Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" - .format(", ".join(map(str, set(map_of_enum_string.keys())-set(allowed_values))), + "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))), # noqa: E501 ", ".join(map(str, allowed_values))) ) self._map_of_enum_string = map_of_enum_string def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -130,28 +126,20 @@ class MapTest(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, MapTest): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py index 4b773deacef..dba1f261352 100644 --- a/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,20 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six + +from petstore_api.models.animal import Animal # noqa: F401,E501 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +44,8 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): 'map': 'map' } - def __init__(self, uuid=None, date_time=None, map=None): - """ - MixedPropertiesAndAdditionalPropertiesClass - a model defined in Swagger - """ + def __init__(self, uuid=None, date_time=None, map=None): # noqa: E501 + """MixedPropertiesAndAdditionalPropertiesClass - a model defined in Swagger""" # noqa: E501 self._uuid = None self._date_time = None @@ -53,28 +53,28 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): self.discriminator = None if uuid is not None: - self.uuid = uuid + self.uuid = uuid if date_time is not None: - self.date_time = date_time + self.date_time = date_time if map is not None: - self.map = map + self.map = map @property def uuid(self): - """ - Gets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. + """Gets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :return: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. + + :return: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 :rtype: str """ return self._uuid @uuid.setter 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 """ @@ -82,20 +82,20 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): @property def date_time(self): - """ - Gets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. + """Gets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :return: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. + + :return: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 :rtype: datetime """ return self._date_time @date_time.setter 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 """ @@ -103,32 +103,30 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): @property def map(self): - """ - Gets the map of this MixedPropertiesAndAdditionalPropertiesClass. + """Gets the map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - :return: The map of this MixedPropertiesAndAdditionalPropertiesClass. + + :return: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, Animal) """ return self._map @map.setter 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) """ self._map = map def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -149,28 +147,20 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/model_200_response.py b/samples/client/petstore/python/petstore_api/models/model_200_response.py index 2b6aeb090c0..60f9c96a676 100644 --- a/samples/client/petstore/python/petstore_api/models/model_200_response.py +++ b/samples/client/petstore/python/petstore_api/models/model_200_response.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class Model200Response(object): '_class': 'class' } - def __init__(self, name=None, _class=None): - """ - Model200Response - a model defined in Swagger - """ + def __init__(self, name=None, _class=None): # noqa: E501 + """Model200Response - a model defined in Swagger""" # noqa: E501 self._name = None self.__class = None self.discriminator = None if name is not None: - self.name = name + self.name = name if _class is not None: - self._class = _class + self._class = _class @property def name(self): - """ - Gets the name of this Model200Response. + """Gets the name of this Model200Response. # noqa: E501 - :return: The name of this Model200Response. + + :return: The name of this Model200Response. # noqa: E501 :rtype: int """ return self._name @name.setter 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 """ @@ -77,32 +75,30 @@ class Model200Response(object): @property def _class(self): - """ - Gets the _class of this Model200Response. + """Gets the _class of this Model200Response. # noqa: E501 - :return: The _class of this Model200Response. + + :return: The _class of this Model200Response. # noqa: E501 :rtype: str """ return self.__class @_class.setter 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 """ self.__class = _class def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -123,28 +119,20 @@ class Model200Response(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Model200Response): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/model_return.py b/samples/client/petstore/python/petstore_api/models/model_return.py index a2160d21dd1..c9d8b5682aa 100644 --- a/samples/client/petstore/python/petstore_api/models/model_return.py +++ b/samples/client/petstore/python/petstore_api/models/model_return.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class ModelReturn(object): '_return': 'return' } - def __init__(self, _return=None): - """ - ModelReturn - a model defined in Swagger - """ + def __init__(self, _return=None): # noqa: E501 + """ModelReturn - a model defined in Swagger""" # noqa: E501 self.__return = None self.discriminator = None if _return is not None: - self._return = _return + self._return = _return @property def _return(self): - """ - Gets the _return of this ModelReturn. + """Gets the _return of this ModelReturn. # noqa: E501 - :return: The _return of this ModelReturn. + + :return: The _return of this ModelReturn. # noqa: E501 :rtype: int """ return self.__return @_return.setter 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 """ self.__return = _return def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class ModelReturn(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ModelReturn): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/name.py b/samples/client/petstore/python/petstore_api/models/name.py index 52b51890dde..cbfbddeb1ab 100644 --- a/samples/client/petstore/python/petstore_api/models/name.py +++ b/samples/client/petstore/python/petstore_api/models/name.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,10 +44,8 @@ class Name(object): '_123_number': '123Number' } - def __init__(self, name=None, snake_case=None, _property=None, _123_number=None): - """ - Name - a model defined in Swagger - """ + def __init__(self, name=None, snake_case=None, _property=None, _123_number=None): # noqa: E501 + """Name - a model defined in Swagger""" # noqa: E501 self._name = None self._snake_case = None @@ -57,51 +55,51 @@ class Name(object): self.name = name if snake_case is not None: - self.snake_case = snake_case + self.snake_case = snake_case if _property is not None: - self._property = _property + self._property = _property if _123_number is not None: - self._123_number = _123_number + self._123_number = _123_number @property def name(self): - """ - Gets the name of this Name. + """Gets the name of this Name. # noqa: E501 - :return: The name of this Name. + + :return: The name of this Name. # noqa: E501 :rtype: int """ return self._name @name.setter 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 """ 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 @property def snake_case(self): - """ - Gets the snake_case of this Name. + """Gets the snake_case of this Name. # noqa: E501 - :return: The snake_case of this Name. + + :return: The snake_case of this Name. # noqa: E501 :rtype: int """ return self._snake_case @snake_case.setter 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 """ @@ -109,20 +107,20 @@ class Name(object): @property def _property(self): - """ - Gets the _property of this Name. + """Gets the _property of this Name. # noqa: E501 - :return: The _property of this Name. + + :return: The _property of this Name. # noqa: E501 :rtype: str """ return self.__property @_property.setter 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 """ @@ -130,32 +128,30 @@ class Name(object): @property def _123_number(self): - """ - Gets the _123_number of this Name. + """Gets the _123_number of this Name. # noqa: E501 - :return: The _123_number of this Name. + + :return: The _123_number of this Name. # noqa: E501 :rtype: int """ return self.__123_number @_123_number.setter 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 """ self.__123_number = _123_number def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -176,28 +172,20 @@ class Name(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Name): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/number_only.py b/samples/client/petstore/python/petstore_api/models/number_only.py index b0e279b53a5..b96321109b9 100644 --- a/samples/client/petstore/python/petstore_api/models/number_only.py +++ b/samples/client/petstore/python/petstore_api/models/number_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class NumberOnly(object): 'just_number': 'JustNumber' } - def __init__(self, just_number=None): - """ - NumberOnly - a model defined in Swagger - """ + def __init__(self, just_number=None): # noqa: E501 + """NumberOnly - a model defined in Swagger""" # noqa: E501 self._just_number = None self.discriminator = None if just_number is not None: - self.just_number = just_number + self.just_number = just_number @property def just_number(self): - """ - Gets the just_number of this NumberOnly. + """Gets the just_number of this NumberOnly. # noqa: E501 - :return: The just_number of this NumberOnly. + + :return: The just_number of this NumberOnly. # noqa: E501 :rtype: float """ return self._just_number @just_number.setter 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 """ self._just_number = just_number def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class NumberOnly(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, NumberOnly): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/order.py b/samples/client/petstore/python/petstore_api/models/order.py index 52c7b6c227e..6636542e941 100644 --- a/samples/client/petstore/python/petstore_api/models/order.py +++ b/samples/client/petstore/python/petstore_api/models/order.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -48,10 +48,8 @@ class Order(object): 'complete': 'complete' } - def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False): - """ - Order - a model defined in Swagger - """ + 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 self._id = None self._pet_id = None @@ -62,34 +60,34 @@ class Order(object): self.discriminator = None if id is not None: - self.id = id + self.id = id if pet_id is not None: - self.pet_id = pet_id + self.pet_id = pet_id if quantity is not None: - self.quantity = quantity + self.quantity = quantity if ship_date is not None: - self.ship_date = ship_date + self.ship_date = ship_date if status is not None: - self.status = status + self.status = status if complete is not None: - self.complete = complete + self.complete = complete @property def id(self): - """ - Gets the id of this Order. + """Gets the id of this Order. # noqa: E501 - :return: The id of this Order. + + :return: The id of this Order. # noqa: E501 :rtype: int """ return self._id @id.setter 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 """ @@ -97,20 +95,20 @@ class Order(object): @property def pet_id(self): - """ - Gets the pet_id of this Order. + """Gets the pet_id of this Order. # noqa: E501 - :return: The pet_id of this Order. + + :return: The pet_id of this Order. # noqa: E501 :rtype: int """ return self._pet_id @pet_id.setter 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 """ @@ -118,20 +116,20 @@ class Order(object): @property def quantity(self): - """ - Gets the quantity of this Order. + """Gets the quantity of this Order. # noqa: E501 - :return: The quantity of this Order. + + :return: The quantity of this Order. # noqa: E501 :rtype: int """ return self._quantity @quantity.setter 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 """ @@ -139,20 +137,20 @@ class Order(object): @property def ship_date(self): - """ - Gets the ship_date of this Order. + """Gets the ship_date of this Order. # noqa: E501 - :return: The ship_date of this Order. + + :return: The ship_date of this Order. # noqa: E501 :rtype: datetime """ return self._ship_date @ship_date.setter 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 """ @@ -160,28 +158,28 @@ class Order(object): @property def status(self): - """ - Gets the status of this Order. - Order Status + """Gets the status of this Order. # noqa: E501 - :return: The status of this Order. + Order Status # noqa: E501 + + :return: The status of this Order. # noqa: E501 :rtype: str """ return self._status @status.setter def status(self, status): - """ - Sets the status of this Order. - Order Status + """Sets the status of this Order. - :param status: The status of this Order. + Order Status # noqa: E501 + + :param status: The status of this Order. # noqa: E501 :type: str """ - allowed_values = ["placed", "approved", "delivered"] + allowed_values = ["placed", "approved", "delivered"] # noqa: E501 if status not in allowed_values: 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) ) @@ -189,32 +187,30 @@ class Order(object): @property def complete(self): - """ - Gets the complete of this Order. + """Gets the complete of this Order. # noqa: E501 - :return: The complete of this Order. + + :return: The complete of this Order. # noqa: E501 :rtype: bool """ return self._complete @complete.setter 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 """ self._complete = complete def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -235,28 +231,20 @@ class Order(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Order): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/outer_boolean.py b/samples/client/petstore/python/petstore_api/models/outer_boolean.py index aa9aee11973..9b3aebd3608 100644 --- a/samples/client/petstore/python/petstore_api/models/outer_boolean.py +++ b/samples/client/petstore/python/petstore_api/models/outer_boolean.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,28 +31,20 @@ class OuterBoolean(object): and the value is json key in definition. """ swagger_types = { - } attribute_map = { - } - def __init__(self): - """ - OuterBoolean - a model defined in Swagger - """ - + def __init__(self): # noqa: E501 + """OuterBoolean - a model defined in Swagger""" # noqa: E501 self.discriminator = None - def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -73,28 +65,20 @@ class OuterBoolean(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, OuterBoolean): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/outer_composite.py b/samples/client/petstore/python/petstore_api/models/outer_composite.py index 81611c17688..19775255e4e 100644 --- a/samples/client/petstore/python/petstore_api/models/outer_composite.py +++ b/samples/client/petstore/python/petstore_api/models/outer_composite.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,22 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +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): - """ - 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +46,8 @@ class OuterComposite(object): 'my_boolean': 'my_boolean' } - def __init__(self, my_number=None, my_string=None, my_boolean=None): - """ - OuterComposite - a model defined in Swagger - """ + def __init__(self, my_number=None, my_string=None, my_boolean=None): # noqa: E501 + """OuterComposite - a model defined in Swagger""" # noqa: E501 self._my_number = None self._my_string = None @@ -53,28 +55,28 @@ class OuterComposite(object): self.discriminator = None if my_number is not None: - self.my_number = my_number + self.my_number = my_number if my_string is not None: - self.my_string = my_string + self.my_string = my_string if my_boolean is not None: - self.my_boolean = my_boolean + self.my_boolean = my_boolean @property def my_number(self): - """ - Gets the my_number of this OuterComposite. + """Gets the my_number of this OuterComposite. # noqa: E501 - :return: The my_number of this OuterComposite. + + :return: The my_number of this OuterComposite. # noqa: E501 :rtype: OuterNumber """ return self._my_number @my_number.setter 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 """ @@ -82,20 +84,20 @@ class OuterComposite(object): @property def my_string(self): - """ - Gets the my_string of this OuterComposite. + """Gets the my_string of this OuterComposite. # noqa: E501 - :return: The my_string of this OuterComposite. + + :return: The my_string of this OuterComposite. # noqa: E501 :rtype: OuterString """ return self._my_string @my_string.setter 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 """ @@ -103,32 +105,30 @@ class OuterComposite(object): @property def my_boolean(self): - """ - Gets the my_boolean of this OuterComposite. + """Gets the my_boolean of this OuterComposite. # noqa: E501 - :return: The my_boolean of this OuterComposite. + + :return: The my_boolean of this OuterComposite. # noqa: E501 :rtype: OuterBoolean """ return self._my_boolean @my_boolean.setter 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 """ self._my_boolean = my_boolean def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -149,28 +149,20 @@ class OuterComposite(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, OuterComposite): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/outer_enum.py b/samples/client/petstore/python/petstore_api/models/outer_enum.py index 8772472c655..5ee1e49a587 100644 --- a/samples/client/petstore/python/petstore_api/models/outer_enum.py +++ b/samples/client/petstore/python/petstore_api/models/outer_enum.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,14 +11,15 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ @@ -37,28 +38,20 @@ class OuterEnum(object): and the value is json key in definition. """ swagger_types = { - } attribute_map = { - } - def __init__(self): - """ - OuterEnum - a model defined in Swagger - """ - + def __init__(self): # noqa: E501 + """OuterEnum - a model defined in Swagger""" # noqa: E501 self.discriminator = None - def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -79,28 +72,20 @@ class OuterEnum(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, OuterEnum): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/outer_number.py b/samples/client/petstore/python/petstore_api/models/outer_number.py index 04c44923fb0..a35587be65e 100644 --- a/samples/client/petstore/python/petstore_api/models/outer_number.py +++ b/samples/client/petstore/python/petstore_api/models/outer_number.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,28 +31,20 @@ class OuterNumber(object): and the value is json key in definition. """ swagger_types = { - } attribute_map = { - } - def __init__(self): - """ - OuterNumber - a model defined in Swagger - """ - + def __init__(self): # noqa: E501 + """OuterNumber - a model defined in Swagger""" # noqa: E501 self.discriminator = None - def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -73,28 +65,20 @@ class OuterNumber(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, OuterNumber): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/outer_string.py b/samples/client/petstore/python/petstore_api/models/outer_string.py index fd2d7c7623e..736edacd1bc 100644 --- a/samples/client/petstore/python/petstore_api/models/outer_string.py +++ b/samples/client/petstore/python/petstore_api/models/outer_string.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,28 +31,20 @@ class OuterString(object): and the value is json key in definition. """ swagger_types = { - } attribute_map = { - } - def __init__(self): - """ - OuterString - a model defined in Swagger - """ - + def __init__(self): # noqa: E501 + """OuterString - a model defined in Swagger""" # noqa: E501 self.discriminator = None - def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -73,28 +65,20 @@ class OuterString(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, OuterString): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/pet.py b/samples/client/petstore/python/petstore_api/models/pet.py index e1afa26f785..81b2bb617f9 100644 --- a/samples/client/petstore/python/petstore_api/models/pet.py +++ b/samples/client/petstore/python/petstore_api/models/pet.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,21 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +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): - """ - 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -48,10 +51,8 @@ class Pet(object): 'status': 'status' } - def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None): - """ - Pet - a model defined in Swagger - """ + 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 self._id = None self._category = None @@ -62,32 +63,32 @@ class Pet(object): self.discriminator = None if id is not None: - self.id = id + self.id = id if category is not None: - self.category = category + self.category = category self.name = name self.photo_urls = photo_urls if tags is not None: - self.tags = tags + self.tags = tags if status is not None: - self.status = status + self.status = status @property def id(self): - """ - Gets the id of this Pet. + """Gets the id of this Pet. # noqa: E501 - :return: The id of this Pet. + + :return: The id of this Pet. # noqa: E501 :rtype: int """ return self._id @id.setter 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 """ @@ -95,20 +96,20 @@ class Pet(object): @property def category(self): - """ - Gets the category of this Pet. + """Gets the category of this Pet. # noqa: E501 - :return: The category of this Pet. + + :return: The category of this Pet. # noqa: E501 :rtype: Category """ return self._category @category.setter 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 """ @@ -116,66 +117,66 @@ class Pet(object): @property def name(self): - """ - Gets the name of this Pet. + """Gets the name of this Pet. # noqa: E501 - :return: The name of this Pet. + + :return: The name of this Pet. # noqa: E501 :rtype: str """ return self._name @name.setter 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 """ 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 @property def photo_urls(self): - """ - Gets the photo_urls of this Pet. + """Gets the photo_urls of this Pet. # noqa: E501 - :return: The photo_urls of this Pet. + + :return: The photo_urls of this Pet. # noqa: E501 :rtype: list[str] """ return self._photo_urls @photo_urls.setter 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] """ 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 @property def tags(self): - """ - Gets the tags of this Pet. + """Gets the tags of this Pet. # noqa: E501 - :return: The tags of this Pet. + + :return: The tags of this Pet. # noqa: E501 :rtype: list[Tag] """ return self._tags @tags.setter 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] """ @@ -183,40 +184,38 @@ class Pet(object): @property def status(self): - """ - Gets the status of this Pet. - pet status in the store + """Gets the status of this Pet. # noqa: E501 - :return: The status of this Pet. + pet status in the store # noqa: E501 + + :return: The status of this Pet. # noqa: E501 :rtype: str """ return self._status @status.setter def status(self, status): - """ - Sets the status of this Pet. - pet status in the store + """Sets the status of this Pet. - :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 """ - allowed_values = ["available", "pending", "sold"] + allowed_values = ["available", "pending", "sold"] # noqa: E501 if status not in allowed_values: 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) ) self._status = status def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -237,28 +236,20 @@ class Pet(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Pet): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/read_only_first.py b/samples/client/petstore/python/petstore_api/models/read_only_first.py index a26d1f33c87..106463077e8 100644 --- a/samples/client/petstore/python/petstore_api/models/read_only_first.py +++ b/samples/client/petstore/python/petstore_api/models/read_only_first.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class ReadOnlyFirst(object): 'baz': 'baz' } - def __init__(self, bar=None, baz=None): - """ - ReadOnlyFirst - a model defined in Swagger - """ + def __init__(self, bar=None, baz=None): # noqa: E501 + """ReadOnlyFirst - a model defined in Swagger""" # noqa: E501 self._bar = None self._baz = None self.discriminator = None if bar is not None: - self.bar = bar + self.bar = bar if baz is not None: - self.baz = baz + self.baz = baz @property def bar(self): - """ - Gets the bar of this ReadOnlyFirst. + """Gets the bar of this ReadOnlyFirst. # noqa: E501 - :return: The bar of this ReadOnlyFirst. + + :return: The bar of this ReadOnlyFirst. # noqa: E501 :rtype: str """ return self._bar @bar.setter 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 """ @@ -77,32 +75,30 @@ class ReadOnlyFirst(object): @property def baz(self): - """ - Gets the baz of this ReadOnlyFirst. + """Gets the baz of this ReadOnlyFirst. # noqa: E501 - :return: The baz of this ReadOnlyFirst. + + :return: The baz of this ReadOnlyFirst. # noqa: E501 :rtype: str """ return self._baz @baz.setter 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 """ self._baz = baz def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -123,28 +119,20 @@ class ReadOnlyFirst(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, ReadOnlyFirst): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/special_model_name.py b/samples/client/petstore/python/petstore_api/models/special_model_name.py index 6be888fb9e3..a31b8db66e2 100644 --- a/samples/client/petstore/python/petstore_api/models/special_model_name.py +++ b/samples/client/petstore/python/petstore_api/models/special_model_name.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,45 +38,41 @@ class SpecialModelName(object): 'special_property_name': '$special[property.name]' } - def __init__(self, special_property_name=None): - """ - SpecialModelName - a model defined in Swagger - """ + def __init__(self, special_property_name=None): # noqa: E501 + """SpecialModelName - a model defined in Swagger""" # noqa: E501 self._special_property_name = None self.discriminator = None if special_property_name is not None: - self.special_property_name = special_property_name + self.special_property_name = special_property_name @property def special_property_name(self): - """ - Gets the special_property_name of this SpecialModelName. + """Gets the special_property_name of this SpecialModelName. # noqa: E501 - :return: The special_property_name of this SpecialModelName. + + :return: The special_property_name of this SpecialModelName. # noqa: E501 :rtype: int """ return self._special_property_name @special_property_name.setter 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 """ self._special_property_name = special_property_name def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -97,28 +93,20 @@ class SpecialModelName(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, SpecialModelName): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/tag.py b/samples/client/petstore/python/petstore_api/models/tag.py index d59a490a07d..b486a672b88 100644 --- a/samples/client/petstore/python/petstore_api/models/tag.py +++ b/samples/client/petstore/python/petstore_api/models/tag.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,36 +40,34 @@ class Tag(object): 'name': 'name' } - def __init__(self, id=None, name=None): - """ - Tag - a model defined in Swagger - """ + def __init__(self, id=None, name=None): # noqa: E501 + """Tag - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None self.discriminator = None if id is not None: - self.id = id + self.id = id if name is not None: - self.name = name + self.name = name @property def id(self): - """ - Gets the id of this Tag. + """Gets the id of this Tag. # noqa: E501 - :return: The id of this Tag. + + :return: The id of this Tag. # noqa: E501 :rtype: int """ return self._id @id.setter 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 """ @@ -77,32 +75,30 @@ class Tag(object): @property def name(self): - """ - Gets the name of this Tag. + """Gets the name of this Tag. # noqa: E501 - :return: The name of this Tag. + + :return: The name of this Tag. # noqa: E501 :rtype: str """ return self._name @name.setter 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 """ self._name = name def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -123,28 +119,20 @@ class Tag(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, Tag): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/user.py b/samples/client/petstore/python/petstore_api/models/user.py index 21993e90521..c9fe0072a9c 100644 --- a/samples/client/petstore/python/petstore_api/models/user.py +++ b/samples/client/petstore/python/petstore_api/models/user.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,18 +11,18 @@ """ -from pprint import pformat -from six import iteritems -import re +import pprint +import re # noqa: F401 + +import six 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. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -52,10 +52,8 @@ class User(object): '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): - """ - User - a model defined in Swagger - """ + 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 self._id = None self._username = None @@ -68,38 +66,38 @@ class User(object): self.discriminator = None if id is not None: - self.id = id + self.id = id if username is not None: - self.username = username + self.username = username if first_name is not None: - self.first_name = first_name + self.first_name = first_name if last_name is not None: - self.last_name = last_name + self.last_name = last_name if email is not None: - self.email = email + self.email = email if password is not None: - self.password = password + self.password = password if phone is not None: - self.phone = phone + self.phone = phone if user_status is not None: - self.user_status = user_status + self.user_status = user_status @property def id(self): - """ - Gets the id of this User. + """Gets the id of this User. # noqa: E501 - :return: The id of this User. + + :return: The id of this User. # noqa: E501 :rtype: int """ return self._id @id.setter 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 """ @@ -107,20 +105,20 @@ class User(object): @property def username(self): - """ - Gets the username of this User. + """Gets the username of this User. # noqa: E501 - :return: The username of this User. + + :return: The username of this User. # noqa: E501 :rtype: str """ return self._username @username.setter 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 """ @@ -128,20 +126,20 @@ class User(object): @property def first_name(self): - """ - Gets the first_name of this User. + """Gets the first_name of this User. # noqa: E501 - :return: The first_name of this User. + + :return: The first_name of this User. # noqa: E501 :rtype: str """ return self._first_name @first_name.setter 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 """ @@ -149,20 +147,20 @@ class User(object): @property def last_name(self): - """ - Gets the last_name of this User. + """Gets the last_name of this User. # noqa: E501 - :return: The last_name of this User. + + :return: The last_name of this User. # noqa: E501 :rtype: str """ return self._last_name @last_name.setter 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 """ @@ -170,20 +168,20 @@ class User(object): @property def email(self): - """ - Gets the email of this User. + """Gets the email of this User. # noqa: E501 - :return: The email of this User. + + :return: The email of this User. # noqa: E501 :rtype: str """ return self._email @email.setter 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 """ @@ -191,20 +189,20 @@ class User(object): @property def password(self): - """ - Gets the password of this User. + """Gets the password of this User. # noqa: E501 - :return: The password of this User. + + :return: The password of this User. # noqa: E501 :rtype: str """ return self._password @password.setter 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 """ @@ -212,20 +210,20 @@ class User(object): @property def phone(self): - """ - Gets the phone of this User. + """Gets the phone of this User. # noqa: E501 - :return: The phone of this User. + + :return: The phone of this User. # noqa: E501 :rtype: str """ return self._phone @phone.setter 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 """ @@ -233,34 +231,32 @@ class User(object): @property def user_status(self): - """ - Gets the user_status of this User. - User Status + """Gets the user_status of this User. # noqa: E501 - :return: The user_status of this User. + User Status # noqa: E501 + + :return: The user_status of this User. # noqa: E501 :rtype: int """ return self._user_status @user_status.setter def user_status(self, user_status): - """ - Sets the user_status of this User. - User Status + """Sets the user_status of this User. - :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 """ self._user_status = user_status def to_dict(self): - """ - Returns the model properties as a dict - """ + """Returns the model properties as a dict""" result = {} - for attr, _ in iteritems(self.swagger_types): + for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( @@ -281,28 +277,20 @@ class User(object): return result def to_str(self): - """ - Returns the string representation of the model - """ - return pformat(self.to_dict()) + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) def __repr__(self): - """ - For `print` and `pprint` - """ + """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): - """ - Returns true if both objects are equal - """ + """Returns true if both objects are equal""" if not isinstance(other, User): return False return self.__dict__ == other.__dict__ def __ne__(self, other): - """ - Returns true if both objects are not equal - """ + """Returns true if both objects are not equal""" return not self == other diff --git a/samples/client/petstore/python/petstore_api/rest.py b/samples/client/petstore/python/petstore_api/rest.py index 5a73a2b908c..ef55c4ea44a 100644 --- a/samples/client/petstore/python/petstore_api/rest.py +++ b/samples/client/petstore/python/petstore_api/rest.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -15,13 +15,13 @@ from __future__ import absolute_import import io import json -import ssl -import certifi import logging import re +import ssl +import certifi # python 2 and python 3 compatibility library -from six import PY3 +import six from six.moves.urllib.parse import urlencode try: @@ -42,15 +42,11 @@ class RESTResponse(io.IOBase): self.data = resp.data def getheaders(self): - """ - Returns a dictionary of the response headers. - """ + """Returns a dictionary of the response headers.""" return self.urllib3_response.getheaders() def getheader(self, name, default=None): - """ - Returns a given response header. - """ + """Returns a given response header.""" return self.urllib3_response.getheader(name, default) @@ -58,10 +54,10 @@ class RESTClientObject(object): def __init__(self, configuration, pools_size=4, maxsize=None): # 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/connectionpool.py#L680 - # maxsize is the number of requests to host that are allowed in parallel - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # 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 # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 # cert_reqs if configuration.verify_ssl: @@ -78,7 +74,7 @@ class RESTClientObject(object): addition_pool_args = {} 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 configuration.connection_pool_maxsize is not None: @@ -110,8 +106,10 @@ class RESTClientObject(object): ) 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 url: http request url :param query_params: query parameters in the url @@ -120,13 +118,17 @@ class RESTClientObject(object): :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without - reading/decoding response data. Default is True. - :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. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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() - 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: raise ValueError( @@ -138,10 +140,12 @@ class RESTClientObject(object): timeout = None 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) - elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2: - timeout = urllib3.Timeout(connect=_request_timeout[0], read=_request_timeout[1]) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) if 'Content-Type' not in headers: headers['Content-Type'] = 'application/json' @@ -155,42 +159,48 @@ class RESTClientObject(object): request_body = None if body is not None: request_body = json.dumps(body) - r = self.pool_manager.request(method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': - r = self.pool_manager.request(method, url, - fields=post_params, - encode_multipart=False, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct Content-Type - # which generated by urllib3 will be overwritten. + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. del headers['Content-Type'] - r = self.pool_manager.request(method, url, - fields=post_params, - encode_multipart=True, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is provided - # in serialized form + # other content types than Json when `body` argument is + # provided in serialized form elif isinstance(body, str): request_body = body - r = self.pool_manager.request(method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) else: # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided arguments. - Please check that your arguments match declared content type.""" + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: @@ -208,7 +218,7 @@ class RESTClientObject(object): # In the python 3, the response.data is bytes. # we need to decode it to string. - if PY3: + if six.PY3: r.data = r.data.decode('utf8') # log response body @@ -219,22 +229,24 @@ class RESTClientObject(object): 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, headers=headers, _preload_content=_preload_content, _request_timeout=_request_timeout, 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, headers=headers, _preload_content=_preload_content, _request_timeout=_request_timeout, query_params=query_params) - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): return self.request("OPTIONS", url, headers=headers, query_params=query_params, @@ -243,7 +255,8 @@ class RESTClientObject(object): _request_timeout=_request_timeout, 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, headers=headers, query_params=query_params, @@ -251,8 +264,8 @@ class RESTClientObject(object): _request_timeout=_request_timeout, body=body) - def POST(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): return self.request("POST", url, headers=headers, query_params=query_params, @@ -261,8 +274,8 @@ class RESTClientObject(object): _request_timeout=_request_timeout, body=body) - def PUT(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): return self.request("PUT", url, headers=headers, query_params=query_params, @@ -271,8 +284,8 @@ class RESTClientObject(object): _request_timeout=_request_timeout, body=body) - def PATCH(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, - _request_timeout=None): + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): return self.request("PATCH", url, headers=headers, query_params=query_params, @@ -297,13 +310,12 @@ class ApiException(Exception): self.headers = None def __str__(self): - """ - Custom error messages for exception - """ + """Custom error messages for exception""" error_message = "({0})\n"\ "Reason: {1}\n".format(self.status, self.reason) 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: error_message += "HTTP response body: {0}\n".format(self.body) diff --git a/samples/client/petstore/python/setup.py b/samples/client/petstore/python/setup.py index 187e1b1636f..6831357735b 100644 --- a/samples/client/petstore/python/setup.py +++ b/samples/client/petstore/python/setup.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -11,8 +11,7 @@ """ -import sys -from setuptools import setup, find_packages +from setuptools import setup, find_packages # noqa: H301 NAME = "petstore-api" VERSION = "1.0.0" @@ -36,6 +35,6 @@ setup( packages=find_packages(), include_package_data=True, 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: \" \\ + 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 """ ) diff --git a/samples/client/petstore/python/test/test_additional_properties_class.py b/samples/client/petstore/python/test/test_additional_properties_class.py index 36fa7fb3a18..77ccb73b028 100644 --- a/samples/client/petstore/python/test/test_additional_properties_class.py +++ b/samples/client/petstore/python/test/test_additional_properties_class.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass class TestAdditionalPropertiesClass(unittest.TestCase): - """ AdditionalPropertiesClass unit test stubs """ + """AdditionalPropertiesClass unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestAdditionalPropertiesClass(unittest.TestCase): pass def testAdditionalPropertiesClass(self): - """ - Test AdditionalPropertiesClass - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() + """Test AdditionalPropertiesClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_animal.py b/samples/client/petstore/python/test/test_animal.py index 67eba1eaffb..eb5f7cb930e 100644 --- a/samples/client/petstore/python/test/test_animal.py +++ b/samples/client/petstore/python/test/test_animal.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.animal import Animal # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.animal import Animal class TestAnimal(unittest.TestCase): - """ Animal unit test stubs """ + """Animal unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestAnimal(unittest.TestCase): pass def testAnimal(self): - """ - Test Animal - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.animal.Animal() + """Test Animal""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.animal.Animal() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_animal_farm.py b/samples/client/petstore/python/test/test_animal_farm.py index d8610735ec6..8f79946fa73 100644 --- a/samples/client/petstore/python/test/test_animal_farm.py +++ b/samples/client/petstore/python/test/test_animal_farm.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.animal_farm import AnimalFarm # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.animal_farm import AnimalFarm class TestAnimalFarm(unittest.TestCase): - """ AnimalFarm unit test stubs """ + """AnimalFarm unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestAnimalFarm(unittest.TestCase): pass def testAnimalFarm(self): - """ - Test AnimalFarm - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.animal_farm.AnimalFarm() + """Test AnimalFarm""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.animal_farm.AnimalFarm() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_another_fake_api.py b/samples/client/petstore/python/test/test_another_fake_api.py index 9f562fe1134..c294aa90359 100644 --- a/samples/client/petstore/python/test/test_another_fake_api.py +++ b/samples/client/petstore/python/test/test_another_fake_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,29 +13,26 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.apis.another_fake_api import AnotherFakeApi class TestAnotherFakeApi(unittest.TestCase): - """ AnotherFakeApi unit test stubs """ + """AnotherFakeApi unit test stubs""" 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): pass 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 diff --git a/samples/client/petstore/python/test/test_api_response.py b/samples/client/petstore/python/test/test_api_response.py index 766c0a93f85..97ed978a5f6 100644 --- a/samples/client/petstore/python/test/test_api_response.py +++ b/samples/client/petstore/python/test/test_api_response.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.api_response import ApiResponse # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.api_response import ApiResponse class TestApiResponse(unittest.TestCase): - """ ApiResponse unit test stubs """ + """ApiResponse unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestApiResponse(unittest.TestCase): pass def testApiResponse(self): - """ - Test ApiResponse - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.api_response.ApiResponse() + """Test ApiResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.api_response.ApiResponse() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python/test/test_array_of_array_of_number_only.py index d095b23abf2..b617ed2cd3e 100644 --- a/samples/client/petstore/python/test/test_array_of_array_of_number_only.py +++ b/samples/client/petstore/python/test/test_array_of_array_of_number_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest 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.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly class TestArrayOfArrayOfNumberOnly(unittest.TestCase): - """ ArrayOfArrayOfNumberOnly unit test stubs """ + """ArrayOfArrayOfNumberOnly unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestArrayOfArrayOfNumberOnly(unittest.TestCase): pass def testArrayOfArrayOfNumberOnly(self): - """ - Test ArrayOfArrayOfNumberOnly - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() + """Test ArrayOfArrayOfNumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_array_of_number_only.py b/samples/client/petstore/python/test/test_array_of_number_only.py index 24c5adb8299..7439364c7b1 100644 --- a/samples/client/petstore/python/test/test_array_of_number_only.py +++ b/samples/client/petstore/python/test/test_array_of_number_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly class TestArrayOfNumberOnly(unittest.TestCase): - """ ArrayOfNumberOnly unit test stubs """ + """ArrayOfNumberOnly unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestArrayOfNumberOnly(unittest.TestCase): pass def testArrayOfNumberOnly(self): - """ - Test ArrayOfNumberOnly - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() + """Test ArrayOfNumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_array_test.py b/samples/client/petstore/python/test/test_array_test.py index 99c0f4d2b67..d7feb2ac8f4 100644 --- a/samples/client/petstore/python/test/test_array_test.py +++ b/samples/client/petstore/python/test/test_array_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.array_test import ArrayTest # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.array_test import ArrayTest class TestArrayTest(unittest.TestCase): - """ ArrayTest unit test stubs """ + """ArrayTest unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestArrayTest(unittest.TestCase): pass def testArrayTest(self): - """ - Test ArrayTest - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.array_test.ArrayTest() + """Test ArrayTest""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.array_test.ArrayTest() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_capitalization.py b/samples/client/petstore/python/test/test_capitalization.py index f903de14261..4ac874e817c 100644 --- a/samples/client/petstore/python/test/test_capitalization.py +++ b/samples/client/petstore/python/test/test_capitalization.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.capitalization import Capitalization # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.capitalization import Capitalization class TestCapitalization(unittest.TestCase): - """ Capitalization unit test stubs """ + """Capitalization unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestCapitalization(unittest.TestCase): pass def testCapitalization(self): - """ - Test Capitalization - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.capitalization.Capitalization() + """Test Capitalization""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.capitalization.Capitalization() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_cat.py b/samples/client/petstore/python/test/test_cat.py index 39a2d63b147..370f1081383 100644 --- a/samples/client/petstore/python/test/test_cat.py +++ b/samples/client/petstore/python/test/test_cat.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.cat import Cat # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.cat import Cat class TestCat(unittest.TestCase): - """ Cat unit test stubs """ + """Cat unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestCat(unittest.TestCase): pass def testCat(self): - """ - Test Cat - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.cat.Cat() + """Test Cat""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.cat.Cat() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_category.py b/samples/client/petstore/python/test/test_category.py index 87868e6bb8f..7a9e40a1f65 100644 --- a/samples/client/petstore/python/test/test_category.py +++ b/samples/client/petstore/python/test/test_category.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.category import Category # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.category import Category class TestCategory(unittest.TestCase): - """ Category unit test stubs """ + """Category unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestCategory(unittest.TestCase): pass def testCategory(self): - """ - Test Category - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.category.Category() + """Test Category""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.category.Category() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_class_model.py b/samples/client/petstore/python/test/test_class_model.py index b9afda56e48..a42127abf50 100644 --- a/samples/client/petstore/python/test/test_class_model.py +++ b/samples/client/petstore/python/test/test_class_model.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.class_model import ClassModel # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.class_model import ClassModel class TestClassModel(unittest.TestCase): - """ ClassModel unit test stubs """ + """ClassModel unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestClassModel(unittest.TestCase): pass def testClassModel(self): - """ - Test ClassModel - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.class_model.ClassModel() + """Test ClassModel""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.class_model.ClassModel() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_client.py b/samples/client/petstore/python/test/test_client.py index 07af5e40c3a..81df726dbfc 100644 --- a/samples/client/petstore/python/test/test_client.py +++ b/samples/client/petstore/python/test/test_client.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.client import Client # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.client import Client class TestClient(unittest.TestCase): - """ Client unit test stubs """ + """Client unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestClient(unittest.TestCase): pass def testClient(self): - """ - Test Client - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.client.Client() + """Test Client""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.client.Client() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_dog.py b/samples/client/petstore/python/test/test_dog.py index 3f1654ffc88..ae13869b99f 100644 --- a/samples/client/petstore/python/test/test_dog.py +++ b/samples/client/petstore/python/test/test_dog.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.dog import Dog # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.dog import Dog class TestDog(unittest.TestCase): - """ Dog unit test stubs """ + """Dog unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestDog(unittest.TestCase): pass def testDog(self): - """ - Test Dog - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.dog.Dog() + """Test Dog""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.dog.Dog() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_enum_arrays.py b/samples/client/petstore/python/test/test_enum_arrays.py index 844c7f92294..144e48883e5 100644 --- a/samples/client/petstore/python/test/test_enum_arrays.py +++ b/samples/client/petstore/python/test/test_enum_arrays.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.enum_arrays import EnumArrays # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.enum_arrays import EnumArrays class TestEnumArrays(unittest.TestCase): - """ EnumArrays unit test stubs """ + """EnumArrays unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestEnumArrays(unittest.TestCase): pass def testEnumArrays(self): - """ - Test EnumArrays - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.enum_arrays.EnumArrays() + """Test EnumArrays""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.enum_arrays.EnumArrays() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_enum_class.py b/samples/client/petstore/python/test/test_enum_class.py index 71c9461b299..a47581d2820 100644 --- a/samples/client/petstore/python/test/test_enum_class.py +++ b/samples/client/petstore/python/test/test_enum_class.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.enum_class import EnumClass # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.enum_class import EnumClass class TestEnumClass(unittest.TestCase): - """ EnumClass unit test stubs """ + """EnumClass unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestEnumClass(unittest.TestCase): pass def testEnumClass(self): - """ - Test EnumClass - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.enum_class.EnumClass() + """Test EnumClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.enum_class.EnumClass() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_enum_test.py b/samples/client/petstore/python/test/test_enum_test.py index 3f3f5f51159..7487efe9fa1 100644 --- a/samples/client/petstore/python/test/test_enum_test.py +++ b/samples/client/petstore/python/test/test_enum_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.enum_test import EnumTest # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.enum_test import EnumTest class TestEnumTest(unittest.TestCase): - """ EnumTest unit test stubs """ + """EnumTest unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestEnumTest(unittest.TestCase): pass def testEnumTest(self): - """ - Test EnumTest - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.enum_test.EnumTest() + """Test EnumTest""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.enum_test.EnumTest() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_fake_api.py b/samples/client/petstore/python/test/test_fake_api.py index 575978dff3f..00473d4a13b 100644 --- a/samples/client/petstore/python/test/test_fake_api.py +++ b/samples/client/petstore/python/test/test_fake_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,45 +13,78 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.api.fake_api import FakeApi # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.apis.fake_api import FakeApi class TestFakeApi(unittest.TestCase): - """ FakeApi unit test stubs """ + """FakeApi unit test stubs""" def setUp(self): - self.api = petstore_api.apis.fake_api.FakeApi() + self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501 def tearDown(self): pass - def test_test_client_model(self): - """ - Test case for test_client_model + def test_fake_outer_boolean_serialize(self): + """Test case for fake_outer_boolean_serialize - To test \"client\" model + """ + pass + + def test_fake_outer_composite_serialize(self): + """Test case for fake_outer_composite_serialize + + """ + pass + + def test_fake_outer_number_serialize(self): + """Test case for fake_outer_number_serialize + + """ + pass + + def test_fake_outer_string_serialize(self): + """Test case for fake_outer_string_serialize + + """ + pass + + def test_test_client_model(self): + """Test case for test_client_model + + To test \"client\" model # noqa: E501 """ pass 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 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 + + def test_test_json_form_data(self): + """Test case for test_json_form_data + + test json serialization of form data # noqa: E501 """ pass diff --git a/samples/client/petstore/python/test/test_fake_classname_tags123_api.py b/samples/client/petstore/python/test/test_fake_classname_tags123_api.py deleted file mode 100644 index 2dab6a38fc5..00000000000 --- a/samples/client/petstore/python/test/test_fake_classname_tags123_api.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ - - OpenAPI spec version: 1.0.0 - Contact: apiteam@swagger.io - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import petstore_api -from petstore_api.rest import ApiException -from petstore_api.apis.fake_classname_tags123_api import FakeClassnameTags123Api - - -class TestFakeClassnameTags123Api(unittest.TestCase): - """ FakeClassnameTags123Api unit test stubs """ - - def setUp(self): - self.api = petstore_api.apis.fake_classname_tags123_api.FakeClassnameTags123Api() - - def tearDown(self): - pass - - def test_test_classname(self): - """ - Test case for test_classname - - To test class name in snake case - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/client/petstore/python/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python/test/test_fake_classname_tags_123_api.py index 7a11a2378bf..8f40062a929 100644 --- a/samples/client/petstore/python/test/test_fake_classname_tags_123_api.py +++ b/samples/client/petstore/python/test/test_fake_classname_tags_123_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,29 +13,26 @@ from __future__ import absolute_import -import os -import sys import unittest 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.apis.fake_classname_tags_123_api import FakeClassnameTags123Api class TestFakeClassnameTags123Api(unittest.TestCase): - """ FakeClassnameTags123Api unit test stubs """ + """FakeClassnameTags123Api unit test stubs""" 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): pass 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 diff --git a/samples/client/petstore/python/test/test_format_test.py b/samples/client/petstore/python/test/test_format_test.py index a9e92f0d276..59809b9f442 100644 --- a/samples/client/petstore/python/test/test_format_test.py +++ b/samples/client/petstore/python/test/test_format_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.format_test import FormatTest # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.format_test import FormatTest class TestFormatTest(unittest.TestCase): - """ FormatTest unit test stubs """ + """FormatTest unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestFormatTest(unittest.TestCase): pass def testFormatTest(self): - """ - Test FormatTest - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.format_test.FormatTest() + """Test FormatTest""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.format_test.FormatTest() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_has_only_read_only.py b/samples/client/petstore/python/test/test_has_only_read_only.py index 454a17429c5..26d14aef1f8 100644 --- a/samples/client/petstore/python/test/test_has_only_read_only.py +++ b/samples/client/petstore/python/test/test_has_only_read_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.has_only_read_only import HasOnlyReadOnly class TestHasOnlyReadOnly(unittest.TestCase): - """ HasOnlyReadOnly unit test stubs """ + """HasOnlyReadOnly unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestHasOnlyReadOnly(unittest.TestCase): pass def testHasOnlyReadOnly(self): - """ - Test HasOnlyReadOnly - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() + """Test HasOnlyReadOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_list.py b/samples/client/petstore/python/test/test_list.py index 1c55f1ae425..c2cca419f37 100644 --- a/samples/client/petstore/python/test/test_list.py +++ b/samples/client/petstore/python/test/test_list.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.list import List # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.list import List class TestList(unittest.TestCase): - """ List unit test stubs """ + """List unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestList(unittest.TestCase): pass def testList(self): - """ - Test List - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.list.List() + """Test List""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.list.List() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_map_test.py b/samples/client/petstore/python/test/test_map_test.py index 5eadb021be1..155797d9b2d 100644 --- a/samples/client/petstore/python/test/test_map_test.py +++ b/samples/client/petstore/python/test/test_map_test.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.map_test import MapTest # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.map_test import MapTest class TestMapTest(unittest.TestCase): - """ MapTest unit test stubs """ + """MapTest unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestMapTest(unittest.TestCase): pass def testMapTest(self): - """ - Test MapTest - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.map_test.MapTest() + """Test MapTest""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.map_test.MapTest() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py index 8b2ee454655..12a56764080 100644 --- a/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest 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.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): - """ MixedPropertiesAndAdditionalPropertiesClass unit test stubs """ + """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): pass def testMixedPropertiesAndAdditionalPropertiesClass(self): - """ - Test MixedPropertiesAndAdditionalPropertiesClass - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() + """Test MixedPropertiesAndAdditionalPropertiesClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_model_200_response.py b/samples/client/petstore/python/test/test_model_200_response.py index c3d0367d39a..f577dd42144 100644 --- a/samples/client/petstore/python/test/test_model_200_response.py +++ b/samples/client/petstore/python/test/test_model_200_response.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.model_200_response import Model200Response # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.model_200_response import Model200Response class TestModel200Response(unittest.TestCase): - """ Model200Response unit test stubs """ + """Model200Response unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestModel200Response(unittest.TestCase): pass def testModel200Response(self): - """ - Test Model200Response - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.model_200_response.Model200Response() + """Test Model200Response""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.model_200_response.Model200Response() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_model_return.py b/samples/client/petstore/python/test/test_model_return.py index 13c683ee46a..64cf27f63ab 100644 --- a/samples/client/petstore/python/test/test_model_return.py +++ b/samples/client/petstore/python/test/test_model_return.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.model_return import ModelReturn # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.model_return import ModelReturn class TestModelReturn(unittest.TestCase): - """ ModelReturn unit test stubs """ + """ModelReturn unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestModelReturn(unittest.TestCase): pass def testModelReturn(self): - """ - Test ModelReturn - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.model_return.ModelReturn() + """Test ModelReturn""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.model_return.ModelReturn() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_name.py b/samples/client/petstore/python/test/test_name.py index 2b972303fb1..beba143f39c 100644 --- a/samples/client/petstore/python/test/test_name.py +++ b/samples/client/petstore/python/test/test_name.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.name import Name # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.name import Name class TestName(unittest.TestCase): - """ Name unit test stubs """ + """Name unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestName(unittest.TestCase): pass def testName(self): - """ - Test Name - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.name.Name() + """Test Name""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.name.Name() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_number_only.py b/samples/client/petstore/python/test/test_number_only.py index a05bfd5ffe2..f2600c79526 100644 --- a/samples/client/petstore/python/test/test_number_only.py +++ b/samples/client/petstore/python/test/test_number_only.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.number_only import NumberOnly # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.number_only import NumberOnly class TestNumberOnly(unittest.TestCase): - """ NumberOnly unit test stubs """ + """NumberOnly unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestNumberOnly(unittest.TestCase): pass def testNumberOnly(self): - """ - Test NumberOnly - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.number_only.NumberOnly() + """Test NumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.number_only.NumberOnly() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_order.py b/samples/client/petstore/python/test/test_order.py index cc181aad7da..ed4f8c7d161 100644 --- a/samples/client/petstore/python/test/test_order.py +++ b/samples/client/petstore/python/test/test_order.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.order import Order # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.order import Order class TestOrder(unittest.TestCase): - """ Order unit test stubs """ + """Order unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestOrder(unittest.TestCase): pass def testOrder(self): - """ - Test Order - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.order.Order() + """Test Order""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.order.Order() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_outer_boolean.py b/samples/client/petstore/python/test/test_outer_boolean.py index 082b05cf928..4a7e446693e 100644 --- a/samples/client/petstore/python/test/test_outer_boolean.py +++ b/samples/client/petstore/python/test/test_outer_boolean.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.outer_boolean import OuterBoolean # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.outer_boolean import OuterBoolean class TestOuterBoolean(unittest.TestCase): - """ OuterBoolean unit test stubs """ + """OuterBoolean unit test stubs""" def setUp(self): pass @@ -32,10 +30,10 @@ class TestOuterBoolean(unittest.TestCase): pass def testOuterBoolean(self): - """ - Test OuterBoolean - """ - model = petstore_api.models.outer_boolean.OuterBoolean() + """Test OuterBoolean""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.outer_boolean.OuterBoolean() # noqa: E501 + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_outer_composite.py b/samples/client/petstore/python/test/test_outer_composite.py index fa084c04bf2..e444e695fe8 100644 --- a/samples/client/petstore/python/test/test_outer_composite.py +++ b/samples/client/petstore/python/test/test_outer_composite.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.outer_composite import OuterComposite # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.outer_composite import OuterComposite class TestOuterComposite(unittest.TestCase): - """ OuterComposite unit test stubs """ + """OuterComposite unit test stubs""" def setUp(self): pass @@ -32,10 +30,10 @@ class TestOuterComposite(unittest.TestCase): pass def testOuterComposite(self): - """ - Test OuterComposite - """ - model = petstore_api.models.outer_composite.OuterComposite() + """Test OuterComposite""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.outer_composite.OuterComposite() # noqa: E501 + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_outer_enum.py b/samples/client/petstore/python/test/test_outer_enum.py index 203212883e5..e3fb15e1b6b 100644 --- a/samples/client/petstore/python/test/test_outer_enum.py +++ b/samples/client/petstore/python/test/test_outer_enum.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.outer_enum import OuterEnum # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.outer_enum import OuterEnum class TestOuterEnum(unittest.TestCase): - """ OuterEnum unit test stubs """ + """OuterEnum unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestOuterEnum(unittest.TestCase): pass def testOuterEnum(self): - """ - Test OuterEnum - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.outer_enum.OuterEnum() + """Test OuterEnum""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.outer_enum.OuterEnum() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_outer_number.py b/samples/client/petstore/python/test/test_outer_number.py index 4019b356bc4..da5d3ceee61 100644 --- a/samples/client/petstore/python/test/test_outer_number.py +++ b/samples/client/petstore/python/test/test_outer_number.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.outer_number import OuterNumber # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.outer_number import OuterNumber class TestOuterNumber(unittest.TestCase): - """ OuterNumber unit test stubs """ + """OuterNumber unit test stubs""" def setUp(self): pass @@ -32,10 +30,10 @@ class TestOuterNumber(unittest.TestCase): pass def testOuterNumber(self): - """ - Test OuterNumber - """ - model = petstore_api.models.outer_number.OuterNumber() + """Test OuterNumber""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.outer_number.OuterNumber() # noqa: E501 + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_outer_string.py b/samples/client/petstore/python/test/test_outer_string.py index a23c7815efe..02b4967e3b9 100644 --- a/samples/client/petstore/python/test/test_outer_string.py +++ b/samples/client/petstore/python/test/test_outer_string.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.outer_string import OuterString # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.outer_string import OuterString class TestOuterString(unittest.TestCase): - """ OuterString unit test stubs """ + """OuterString unit test stubs""" def setUp(self): pass @@ -32,10 +30,10 @@ class TestOuterString(unittest.TestCase): pass def testOuterString(self): - """ - Test OuterString - """ - model = petstore_api.models.outer_string.OuterString() + """Test OuterString""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.outer_string.OuterString() # noqa: E501 + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_pet.py b/samples/client/petstore/python/test/test_pet.py index 7da7d887e42..d8df24f92b1 100644 --- a/samples/client/petstore/python/test/test_pet.py +++ b/samples/client/petstore/python/test/test_pet.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.pet import Pet # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.pet import Pet class TestPet(unittest.TestCase): - """ Pet unit test stubs """ + """Pet unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestPet(unittest.TestCase): pass def testPet(self): - """ - Test Pet - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.pet.Pet() + """Test Pet""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.pet.Pet() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_pet_api.py b/samples/client/petstore/python/test/test_pet_api.py index 1eafc35b28c..1e2dd1c42b6 100644 --- a/samples/client/petstore/python/test/test_pet_api.py +++ b/samples/client/petstore/python/test/test_pet_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,85 +13,75 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.api.pet_api import PetApi # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.apis.pet_api import PetApi class TestPetApi(unittest.TestCase): - """ PetApi unit test stubs """ + """PetApi unit test stubs""" def setUp(self): - self.api = petstore_api.apis.pet_api.PetApi() + self.api = petstore_api.api.pet_api.PetApi() # noqa: E501 def tearDown(self): pass def test_add_pet(self): - """ - Test case for add_pet + """Test case for add_pet - Add a new pet to the store + Add a new pet to the store # noqa: E501 """ pass def test_delete_pet(self): - """ - Test case for delete_pet + """Test case for delete_pet - Deletes a pet + Deletes a pet # noqa: E501 """ pass def test_find_pets_by_status(self): - """ - Test case for find_pets_by_status + """Test case for find_pets_by_status - Finds Pets by status + Finds Pets by status # noqa: E501 """ pass def test_find_pets_by_tags(self): - """ - Test case for find_pets_by_tags + """Test case for find_pets_by_tags - Finds Pets by tags + Finds Pets by tags # noqa: E501 """ pass def test_get_pet_by_id(self): - """ - Test case for get_pet_by_id + """Test case for get_pet_by_id - Find pet by ID + Find pet by ID # noqa: E501 """ pass def test_update_pet(self): - """ - Test case for update_pet + """Test case for update_pet - Update an existing pet + Update an existing pet # noqa: E501 """ pass def test_update_pet_with_form(self): - """ - Test case for update_pet_with_form + """Test case for update_pet_with_form - Updates a pet in the store with form data + Updates a pet in the store with form data # noqa: E501 """ pass def test_upload_file(self): - """ - Test case for upload_file + """Test case for upload_file - uploads an image + uploads an image # noqa: E501 """ pass diff --git a/samples/client/petstore/python/test/test_read_only_first.py b/samples/client/petstore/python/test/test_read_only_first.py index 42a402f7658..94bf3d127de 100644 --- a/samples/client/petstore/python/test/test_read_only_first.py +++ b/samples/client/petstore/python/test/test_read_only_first.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.read_only_first import ReadOnlyFirst class TestReadOnlyFirst(unittest.TestCase): - """ ReadOnlyFirst unit test stubs """ + """ReadOnlyFirst unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestReadOnlyFirst(unittest.TestCase): pass def testReadOnlyFirst(self): - """ - Test ReadOnlyFirst - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.read_only_first.ReadOnlyFirst() + """Test ReadOnlyFirst""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.read_only_first.ReadOnlyFirst() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_special_model_name.py b/samples/client/petstore/python/test/test_special_model_name.py index f6e59a4b3ce..002f660cc26 100644 --- a/samples/client/petstore/python/test/test_special_model_name.py +++ b/samples/client/petstore/python/test/test_special_model_name.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.special_model_name import SpecialModelName # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.special_model_name import SpecialModelName class TestSpecialModelName(unittest.TestCase): - """ SpecialModelName unit test stubs """ + """SpecialModelName unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestSpecialModelName(unittest.TestCase): pass def testSpecialModelName(self): - """ - Test SpecialModelName - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.special_model_name.SpecialModelName() + """Test SpecialModelName""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.special_model_name.SpecialModelName() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_store_api.py b/samples/client/petstore/python/test/test_store_api.py index f131b6068b2..537c1bc03f1 100644 --- a/samples/client/petstore/python/test/test_store_api.py +++ b/samples/client/petstore/python/test/test_store_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,53 +13,47 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.api.store_api import StoreApi # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.apis.store_api import StoreApi class TestStoreApi(unittest.TestCase): - """ StoreApi unit test stubs """ + """StoreApi unit test stubs""" def setUp(self): - self.api = petstore_api.apis.store_api.StoreApi() + self.api = petstore_api.api.store_api.StoreApi() # noqa: E501 def tearDown(self): pass def test_delete_order(self): - """ - Test case for delete_order + """Test case for delete_order - Delete purchase order by ID + Delete purchase order by ID # noqa: E501 """ pass def test_get_inventory(self): - """ - Test case for get_inventory + """Test case for get_inventory - Returns pet inventories by status + Returns pet inventories by status # noqa: E501 """ pass def test_get_order_by_id(self): - """ - Test case for get_order_by_id + """Test case for get_order_by_id - Find purchase order by ID + Find purchase order by ID # noqa: E501 """ pass def test_place_order(self): - """ - Test case for place_order + """Test case for place_order - Place an order for a pet + Place an order for a pet # noqa: E501 """ pass diff --git a/samples/client/petstore/python/test/test_tag.py b/samples/client/petstore/python/test/test_tag.py index 0975bcf9b67..e9bc1d471d1 100644 --- a/samples/client/petstore/python/test/test_tag.py +++ b/samples/client/petstore/python/test/test_tag.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.tag import Tag # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.tag import Tag class TestTag(unittest.TestCase): - """ Tag unit test stubs """ + """Tag unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestTag(unittest.TestCase): pass def testTag(self): - """ - Test Tag - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.tag.Tag() + """Test Tag""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.tag.Tag() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_user.py b/samples/client/petstore/python/test/test_user.py index a2c2d941d44..3575746c00f 100644 --- a/samples/client/petstore/python/test/test_user.py +++ b/samples/client/petstore/python/test/test_user.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,17 +13,15 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.models.user import User # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.models.user import User class TestUser(unittest.TestCase): - """ User unit test stubs """ + """User unit test stubs""" def setUp(self): pass @@ -32,11 +30,9 @@ class TestUser(unittest.TestCase): pass def testUser(self): - """ - Test User - """ - # FIXME: construct object with required attributes - #model = petstore_api.models.user.User() + """Test User""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.user.User() # noqa: E501 pass diff --git a/samples/client/petstore/python/test/test_user_api.py b/samples/client/petstore/python/test/test_user_api.py index 3e0be964a2d..4ebd90f95e2 100644 --- a/samples/client/petstore/python/test/test_user_api.py +++ b/samples/client/petstore/python/test/test_user_api.py @@ -3,7 +3,7 @@ """ 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 Contact: apiteam@swagger.io @@ -13,85 +13,75 @@ from __future__ import absolute_import -import os -import sys import unittest import petstore_api +from petstore_api.api.user_api import UserApi # noqa: E501 from petstore_api.rest import ApiException -from petstore_api.apis.user_api import UserApi class TestUserApi(unittest.TestCase): - """ UserApi unit test stubs """ + """UserApi unit test stubs""" def setUp(self): - self.api = petstore_api.apis.user_api.UserApi() + self.api = petstore_api.api.user_api.UserApi() # noqa: E501 def tearDown(self): pass def test_create_user(self): - """ - Test case for create_user + """Test case for create_user - Create user + Create user # noqa: E501 """ pass def test_create_users_with_array_input(self): - """ - Test case for create_users_with_array_input + """Test case for create_users_with_array_input - Creates list of users with given input array + Creates list of users with given input array # noqa: E501 """ pass def test_create_users_with_list_input(self): - """ - Test case for create_users_with_list_input + """Test case for create_users_with_list_input - Creates list of users with given input array + Creates list of users with given input array # noqa: E501 """ pass def test_delete_user(self): - """ - Test case for delete_user + """Test case for delete_user - Delete user + Delete user # noqa: E501 """ pass def test_get_user_by_name(self): - """ - Test case for get_user_by_name + """Test case for get_user_by_name - Get user by user name + Get user by user name # noqa: E501 """ pass def test_login_user(self): - """ - Test case for login_user + """Test case for login_user - Logs user into the system + Logs user into the system # noqa: E501 """ pass def test_logout_user(self): - """ - Test case for logout_user + """Test case for logout_user - Logs out current logged in user session + Logs out current logged in user session # noqa: E501 """ pass def test_update_user(self): - """ - Test case for update_user + """Test case for update_user - Updated user + Updated user # noqa: E501 """ pass diff --git a/samples/client/petstore/python/test_python2.sh b/samples/client/petstore/python/test_python2.sh index e2492be49f6..c88094efc2d 100755 --- a/samples/client/petstore/python/test_python2.sh +++ b/samples/client/petstore/python/test_python2.sh @@ -23,6 +23,9 @@ python setup.py develop ### run tests nosetests +### static analysis of code +flake8 --show-source petstore_api/ + ### deactivate virtualenv #if [ $DEACTIVE == true ]; then # deactivate diff --git a/samples/client/petstore/python/test_python2_and_3.sh b/samples/client/petstore/python/test_python2_and_3.sh index b917ecad06a..a224ffe75dc 100755 --- a/samples/client/petstore/python/test_python2_and_3.sh +++ b/samples/client/petstore/python/test_python2_and_3.sh @@ -23,6 +23,9 @@ python setup.py develop ### run tests tox +### static analysis of code +flake8 --show-source petstore_api/ + ### deactivate virtualenv #if [ $DEACTIVE == true ]; then # deactivate diff --git a/samples/client/petstore/python/tests/test_api_client.py b/samples/client/petstore/python/tests/test_api_client.py index 0564a69686b..1e0a83accb1 100644 --- a/samples/client/petstore/python/tests/test_api_client.py +++ b/samples/client/petstore/python/tests/test_api_client.py @@ -1,5 +1,7 @@ # coding: utf-8 +# flake8: noqa + """ Run the tests. $ pip install nose (optional) diff --git a/samples/client/petstore/python/tests/test_api_exception.py b/samples/client/petstore/python/tests/test_api_exception.py index 82c825875d0..931dc34edfa 100644 --- a/samples/client/petstore/python/tests/test_api_exception.py +++ b/samples/client/petstore/python/tests/test_api_exception.py @@ -1,5 +1,7 @@ # coding: utf-8 +# flake8: noqa + """ Run the tests. $ pip install nose (optional) diff --git a/samples/client/petstore/python/tests/test_deserialization.py b/samples/client/petstore/python/tests/test_deserialization.py index 737ed9ea2cf..97d047563df 100644 --- a/samples/client/petstore/python/tests/test_deserialization.py +++ b/samples/client/petstore/python/tests/test_deserialization.py @@ -1,5 +1,7 @@ # coding: utf-8 +# flake8: noqa + """ Run the tests. $ pip install nose (optional) diff --git a/samples/client/petstore/python/tests/test_enum_arrays.py b/samples/client/petstore/python/tests/test_enum_arrays.py index 41e7dcb0a74..2f7e347f9c3 100644 --- a/samples/client/petstore/python/tests/test_enum_arrays.py +++ b/samples/client/petstore/python/tests/test_enum_arrays.py @@ -1,5 +1,7 @@ # coding: utf-8 +# flake8: noqa + """ Run the tests. $ pip install nose (optional) diff --git a/samples/client/petstore/python/tests/test_map_test.py b/samples/client/petstore/python/tests/test_map_test.py index 012b9254b47..a411a4e541b 100644 --- a/samples/client/petstore/python/tests/test_map_test.py +++ b/samples/client/petstore/python/tests/test_map_test.py @@ -1,5 +1,7 @@ # coding: utf-8 +# flake8: noqa + """ Run the tests. $ pip install nose (optional) diff --git a/samples/client/petstore/python/tests/test_order_model.py b/samples/client/petstore/python/tests/test_order_model.py index 710f3c175a9..31dc6e3661c 100644 --- a/samples/client/petstore/python/tests/test_order_model.py +++ b/samples/client/petstore/python/tests/test_order_model.py @@ -1,5 +1,7 @@ # coding: utf-8 +# flake8: noqa + """ Run the tests. $ pip install nose (optional) diff --git a/samples/client/petstore/python/tests/test_pet_api.py b/samples/client/petstore/python/tests/test_pet_api.py index 6dd6dce1d5a..1c5b2739062 100644 --- a/samples/client/petstore/python/tests/test_pet_api.py +++ b/samples/client/petstore/python/tests/test_pet_api.py @@ -1,5 +1,7 @@ # coding: utf-8 +# flake8: noqa + """ Run the tests. $ pip install nose (optional) diff --git a/samples/client/petstore/python/tests/test_pet_model.py b/samples/client/petstore/python/tests/test_pet_model.py index 3ecb5ec85ba..70ab1a007a0 100644 --- a/samples/client/petstore/python/tests/test_pet_model.py +++ b/samples/client/petstore/python/tests/test_pet_model.py @@ -1,5 +1,7 @@ # coding: utf-8 +# flake8: noqa + """ Run the tests. $ pip install nose (optional) diff --git a/samples/client/petstore/python/tests/test_store_api.py b/samples/client/petstore/python/tests/test_store_api.py index b7e80281707..095f5e7b236 100644 --- a/samples/client/petstore/python/tests/test_store_api.py +++ b/samples/client/petstore/python/tests/test_store_api.py @@ -1,5 +1,7 @@ # coding: utf-8 +# flake8: noqa + """ Run the tests. $ pip install nose (optional) diff --git a/samples/client/petstore/python/tests/util.py b/samples/client/petstore/python/tests/util.py index e83ca37a942..113d7dcc547 100644 --- a/samples/client/petstore/python/tests/util.py +++ b/samples/client/petstore/python/tests/util.py @@ -1,3 +1,5 @@ +# flake8: noqa + import random diff --git a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/pet.py b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/pet.py index 52ef5f7e9d3..0f8e96dcd56 100644 --- a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/pet.py +++ b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/pet.py @@ -6,8 +6,8 @@ from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from swagger_server.models.base_model_ import Model -from swagger_server.models.category import Category # noqa: E501 -from swagger_server.models.tag import Tag # noqa: E501 +from swagger_server.models.category import Category # noqa: F401,E501 +from swagger_server.models.tag import Tag # noqa: F401,E501 from swagger_server import util diff --git a/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml b/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml index 28b7a179620..ba2a870047d 100644 --- a/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml +++ b/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml @@ -108,11 +108,11 @@ paths: type: "array" items: type: "string" - default: "available" enum: - "available" - "pending" - "sold" + default: "available" collectionFormat: "csv" responses: 200: diff --git a/samples/server/petstore/flaskConnexion/swagger_server/models/pet.py b/samples/server/petstore/flaskConnexion/swagger_server/models/pet.py index 8c511d9801a..5fa728911de 100644 --- a/samples/server/petstore/flaskConnexion/swagger_server/models/pet.py +++ b/samples/server/petstore/flaskConnexion/swagger_server/models/pet.py @@ -6,8 +6,8 @@ from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from swagger_server.models.base_model_ import Model -from swagger_server.models.category import Category # noqa: E501 -from swagger_server.models.tag import Tag # noqa: E501 +from swagger_server.models.category import Category # noqa: F401,E501 +from swagger_server.models.tag import Tag # noqa: F401,E501 from swagger_server import util