[python-experimental] Removes python2 (#6991)

* Removes future from python-exp v3 sample

* Removes future from python-exp v2 sample

* Deletes future from remaining python-exp files

* Removes six from python-exp templates

* Removes six from python-exp samples

* Removes mock from python-exp

* Python-exp switched to py3

* Removes python 2.7 for python-exp ci testing

* Requires python>=3.3 for python-exp

* Reverts unnecessary changes to two templates
This commit is contained in:
Justin Black
2020-07-19 09:45:56 -07:00
committed by GitHub
parent ed84280108
commit 0e0f8eb74c
447 changed files with 1512 additions and 1859 deletions

View File

@@ -140,6 +140,20 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen {
supportingFiles.remove(new SupportingFile("__init__model.mustache", packagePath() + File.separatorChar + "models", "__init__.py"));
supportingFiles.add(new SupportingFile("python-experimental/__init__model.mustache", packagePath() + File.separatorChar + "model", "__init__.py"));
supportingFiles.remove(new SupportingFile("configuration.mustache", packagePath(), "configuration.py"));
supportingFiles.add(new SupportingFile("python-experimental/configuration.mustache", packagePath(), "configuration.py"));
supportingFiles.remove(new SupportingFile("__init__api.mustache", packagePath() + File.separatorChar + "api", "__init__.py"));
supportingFiles.add(new SupportingFile("python-experimental/__init__api.mustache", packagePath() + File.separatorChar + "api", "__init__.py"));
supportingFiles.remove(new SupportingFile("exceptions.mustache", packagePath(), "exceptions.py"));
supportingFiles.add(new SupportingFile("python-experimental/exceptions.mustache", packagePath(), "exceptions.py"));
if ("urllib3".equals(getLibrary())) {
supportingFiles.remove(new SupportingFile("rest.mustache", packagePath(), "rest.py"));
supportingFiles.add(new SupportingFile("python-experimental/rest.mustache", packagePath(), "rest.py"));
}
supportingFiles.remove(new SupportingFile("__init__package.mustache", packagePath(), "__init__.py"));
supportingFiles.add(new SupportingFile("python-experimental/__init__package.mustache", packagePath(), "__init__.py"));
@@ -176,6 +190,12 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen {
supportingFiles.add(new SupportingFile(readmeTemplate, "", readmePath));
if (!generateSourceCodeOnly) {
supportingFiles.remove(new SupportingFile("travis.mustache", "", ".travis.yml"));
supportingFiles.add(new SupportingFile("python-experimental/travis.mustache", "", ".travis.yml"));
supportingFiles.remove(new SupportingFile("gitlab-ci.mustache", "", ".gitlab-ci.yml"));
supportingFiles.add(new SupportingFile("python-experimental/gitlab-ci.mustache", "", ".gitlab-ci.yml"));
supportingFiles.remove(new SupportingFile("tox.mustache", "", "tox.ini"));
supportingFiles.add(new SupportingFile("python-experimental/tox.mustache", "", "tox.ini"));
supportingFiles.remove(new SupportingFile("setup.mustache", "", "setup.py"));
supportingFiles.add(new SupportingFile("python-experimental/setup.mustache", "", "setup.py"));
supportingFiles.remove(new SupportingFile("requirements.mustache", "", "requirements.txt"));

View File

@@ -17,7 +17,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
## Requirements.
Python 2.7 and 3.4+
Python 3.4+
## Installation & Usage
### pip install

View File

@@ -1,5 +1,4 @@
```python
from __future__ import print_function
{{#apiInfo}}{{#apis}}{{^hasMore}}{{#hasHttpSignatureMethods}}import datetime{{/hasHttpSignatureMethods}}{{/hasMore}}{{/apis}}{{/apiInfo}}
import time
import {{{packageName}}}

View File

@@ -26,7 +26,6 @@ This python library package is generated without supporting files like setup.py
To be able to use it, you will need these dependencies in your own package that uses this library:
* urllib3 >= 1.15
* six >= 1.10
* certifi
* python-dateutil
{{#asyncio}}

View File

@@ -1,3 +1,3 @@
# do not import all apis into this module because that uses a lot of memory and stack frames
# if you need the ability to import all models from one package, import them with
# if you need the ability to import all apis from one package, import them with
# from {{packageName}.apis import DefaultApi, PetApi

View File

@@ -4,8 +4,6 @@
{{>partial_header}}
from __future__ import absolute_import
__version__ = "{{packageVersion}}"
# import ApiClient

View File

@@ -2,14 +2,9 @@
{{>partial_header}}
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
# python 2 and python 3 compatibility library
import six
from {{packageName}}.api_client import ApiClient, Endpoint
from {{packageName}}.model_utils import ( # noqa: F401
check_allowed_values,
@@ -17,9 +12,7 @@ from {{packageName}}.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_and_convert_types
)
{{#imports}}

View File

@@ -1,6 +1,5 @@
# coding: utf-8
{{>partial_header}}
from __future__ import absolute_import
import json
import atexit
@@ -8,10 +7,8 @@ import mimetypes
from multiprocessing.pool import ThreadPool
import os
import re
from urllib.parse import quote
# python 2 and python 3 compatibility library
import six
from six.moves.urllib.parse import quote
{{#tornado}}
import tornado.gen
{{/tornado}}
@@ -29,10 +26,8 @@ from {{packageName}}.model_utils import (
datetime,
deserialize_file,
file_type,
int,
model_to_dict,
none_type,
str,
validate_and_convert_types
)
@@ -59,10 +54,8 @@ class ApiClient(object):
to the API. More threads means more concurrent API requests.
"""
# six.binary_type python2=str, python3=bytes
# six.text_type python2=unicode, python3=str
PRIMITIVE_TYPES = (
(float, bool, six.binary_type, six.text_type) + six.integer_types
float, bool, bytes, str, int
)
_pool = None
@@ -189,7 +182,7 @@ class ApiClient(object):
_preload_content=_preload_content,
_request_timeout=_request_timeout)
except ApiException as e:
e.body = e.body.decode('utf-8') if six.PY3 else e.body
e.body = e.body.decode('utf-8')
raise e
content_type = response_data.getheader('content-type')
@@ -207,7 +200,7 @@ class ApiClient(object):
{{/tornado}}
return return_data
if six.PY3 and response_type not in ["file", "bytes"]:
if response_type not in ["file", "bytes"]:
match = None
if content_type is not None:
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type)
@@ -277,7 +270,7 @@ class ApiClient(object):
return self.sanitize_for_serialization(obj.value)
return {key: self.sanitize_for_serialization(val)
for key, val in six.iteritems(obj_dict)}
for key, val in obj_dict.items()}
def deserialize(self, response, response_type, _check_type):
"""Deserializes response into an object.
@@ -477,7 +470,7 @@ class ApiClient(object):
new_params = []
if collection_formats is None:
collection_formats = {}
for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501
for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
if k in collection_formats:
collection_format = collection_formats[k]
if collection_format == 'multi':
@@ -508,7 +501,7 @@ class ApiClient(object):
return []
params = []
for param_name, file_instances in six.iteritems(files):
for param_name, file_instances in files.items():
if file_instances is None:
# if the file field is nullable, skip None values
continue
@@ -692,7 +685,7 @@ class Endpoint(object):
if kwargs['_check_input_type'] is False:
return
for key, value in six.iteritems(kwargs):
for key, value in kwargs.items():
fixed_val = validate_and_convert_types(
value,
self.openapi_types[key],
@@ -714,7 +707,7 @@ class Endpoint(object):
'query': []
}
for param_name, param_value in six.iteritems(kwargs):
for param_name, param_value in kwargs.items():
param_location = self.location_map.get(param_name)
if param_location is None:
continue
@@ -772,7 +765,7 @@ class Endpoint(object):
)
_host = None
for key, value in six.iteritems(kwargs):
for key, value in kwargs.items():
if key not in self.params_map['all']:
raise ApiTypeError(
"Got an unexpected parameter '%s'"

View File

@@ -1,5 +1,4 @@
```python
from __future__ import print_function
import time
import {{{packageName}}}
from {{apiPackage}} import {{classVarName}}

View File

@@ -2,8 +2,6 @@
{{>partial_header}}
from __future__ import absolute_import
import unittest
import {{packageName}}

View File

@@ -0,0 +1,632 @@
# coding: utf-8
{{>partial_header}}
import copy
import logging
{{^asyncio}}
import multiprocessing
{{/asyncio}}
import sys
import urllib3
from http import client as http_client
from {{packageName}}.exceptions import ApiValueError
JSON_SCHEMA_VALIDATION_KEYWORDS = {
'multipleOf', 'maximum', 'exclusiveMaximum',
'minimum', 'exclusiveMinimum', 'maxLength',
'minLength', 'pattern', 'maxItems', 'minItems'
}
class Configuration(object):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
:param host: Base url
:param api_key: Dict to store API key(s).
Each entry in the dict specifies an API key.
The dict key is the name of the security scheme in the OAS specification.
The dict value is the API key secret.
:param api_key_prefix: Dict to store API prefix (e.g. Bearer)
The dict key is the name of the security scheme in the OAS specification.
The dict value is an API key prefix when generating the auth data.
:param username: Username for HTTP basic authentication
:param password: Password for HTTP basic authentication
:param discard_unknown_keys: Boolean value indicating whether to discard
unknown properties. A server may send a response that includes additional
properties that are not known by the client in the following scenarios:
1. The OpenAPI document is incomplete, i.e. it does not match the server
implementation.
2. The client was generated using an older version of the OpenAPI document
and the server has been upgraded since then.
If a schema in the OpenAPI document defines the additionalProperties attribute,
then all undeclared properties received by the server are injected into the
additional properties map. In that case, there are undeclared properties, and
nothing to discard.
:param disabled_client_side_validations (string): Comma-separated list of
JSON schema validation keywords to disable JSON schema structural validation
rules. The following keywords may be specified: multipleOf, maximum,
exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern,
maxItems, minItems.
By default, the validation is performed for data generated locally by the client
and data received from the server, independent of any validation performed by
the server side. If the input data does not satisfy the JSON schema validation
rules specified in the OpenAPI document, an exception is raised.
If disabled_client_side_validations is set, structural validation is
disabled. This can be useful to troubleshoot data validation problem, such as
when the OpenAPI document validation rules do not match the actual API data
received by the server.
{{#hasHttpSignatureMethods}}
:param signing_info: Configuration parameters for the HTTP signature security scheme.
Must be an instance of {{{packageName}}}.signing.HttpSigningConfiguration
{{/hasHttpSignatureMethods}}
:param server_index: Index to servers configuration.
:param server_variables: Mapping with string values to replace variables in
templated server configuration. The validation of enums is performed for
variables with defined enum values before.
:param server_operation_index: Mapping from operation ID to an index to server
configuration.
:param server_operation_variables: Mapping from operation ID to a mapping with
string values to replace variables in templated server configuration.
The validation of enums is performed for variables with defined enum values before.
{{#hasAuthMethods}}
:Example:
{{#hasApiKeyMethods}}
API Key Authentication Example.
Given the following security scheme in the OpenAPI specification:
components:
securitySchemes:
cookieAuth: # name for the security scheme
type: apiKey
in: cookie
name: JSESSIONID # cookie name
You can programmatically set the cookie:
conf = {{{packageName}}}.Configuration(
api_key={'cookieAuth': 'abc123'}
api_key_prefix={'cookieAuth': 'JSESSIONID'}
)
The following cookie will be added to the HTTP request:
Cookie: JSESSIONID abc123
{{/hasApiKeyMethods}}
{{#hasHttpBasicMethods}}
HTTP Basic Authentication Example.
Given the following security scheme in the OpenAPI specification:
components:
securitySchemes:
http_basic_auth:
type: http
scheme: basic
Configure API client with HTTP basic authentication:
conf = {{{packageName}}}.Configuration(
username='the-user',
password='the-password',
)
{{/hasHttpBasicMethods}}
{{#hasHttpSignatureMethods}}
HTTP Signature Authentication Example.
Given the following security scheme in the OpenAPI specification:
components:
securitySchemes:
http_basic_auth:
type: http
scheme: signature
Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme,
sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time
of the signature to 5 minutes after the signature has been created.
Note you can use the constants defined in the {{{packageName}}}.signing module, and you can
also specify arbitrary HTTP headers to be included in the HTTP signature, except for the
'Authorization' header, which is used to carry the signature.
One may be tempted to sign all headers by default, but in practice it rarely works.
This is beccause explicit proxies, transparent proxies, TLS termination endpoints or
load balancers may add/modify/remove headers. Include the HTTP headers that you know
are not going to be modified in transit.
conf = {{{packageName}}}.Configuration(
signing_info = {{{packageName}}}.signing.HttpSigningConfiguration(
key_id = 'my-key-id',
private_key_path = 'rsa.pem',
signing_scheme = {{{packageName}}}.signing.SCHEME_HS2019,
signing_algorithm = {{{packageName}}}.signing.ALGORITHM_RSASSA_PSS,
signed_headers = [{{{packageName}}}.signing.HEADER_REQUEST_TARGET,
{{{packageName}}}.signing.HEADER_CREATED,
{{{packageName}}}.signing.HEADER_EXPIRES,
{{{packageName}}}.signing.HEADER_HOST,
{{{packageName}}}.signing.HEADER_DATE,
{{{packageName}}}.signing.HEADER_DIGEST,
'Content-Type',
'User-Agent'
],
signature_max_validity = datetime.timedelta(minutes=5)
)
)
{{/hasHttpSignatureMethods}}
{{/hasAuthMethods}}
"""
_default = None
def __init__(self, host=None,
api_key=None, api_key_prefix=None,
username=None, password=None,
discard_unknown_keys=False,
disabled_client_side_validations="",
{{#hasHttpSignatureMethods}}
signing_info=None,
{{/hasHttpSignatureMethods}}
server_index=None, server_variables=None,
server_operation_index=None, server_operation_variables=None,
):
"""Constructor
"""
self._base_path = "{{{basePath}}}" if host is None else host
"""Default Base url
"""
self.server_index = 0 if server_index is None and host is None else server_index
self.server_operation_index = server_operation_index or {}
"""Default server index
"""
self.server_variables = server_variables or {}
self.server_operation_variables = server_operation_variables or {}
"""Default server variables
"""
self.temp_folder_path = None
"""Temp file folder for downloading files
"""
# Authentication Settings
self.api_key = {}
if api_key:
self.api_key = api_key
"""dict to store API key(s)
"""
self.api_key_prefix = {}
if api_key_prefix:
self.api_key_prefix = api_key_prefix
"""dict to store API prefix (e.g. Bearer)
"""
self.refresh_api_key_hook = None
"""function hook to refresh API key if expired
"""
self.username = username
"""Username for HTTP basic authentication
"""
self.password = password
"""Password for HTTP basic authentication
"""
self.discard_unknown_keys = discard_unknown_keys
self.disabled_client_side_validations = disabled_client_side_validations
{{#hasHttpSignatureMethods}}
if signing_info is not None:
signing_info.host = host
self.signing_info = signing_info
"""The HTTP signing configuration
"""
{{/hasHttpSignatureMethods}}
{{#hasOAuthMethods}}
self.access_token = None
"""access token for OAuth/Bearer
"""
{{/hasOAuthMethods}}
{{^hasOAuthMethods}}
{{#hasBearerMethods}}
self.access_token = None
"""access token for OAuth/Bearer
"""
{{/hasBearerMethods}}
{{/hasOAuthMethods}}
self.logger = {}
"""Logging Settings
"""
self.logger["package_logger"] = logging.getLogger("{{packageName}}")
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
self.logger_format = '%(asctime)s %(levelname)s %(message)s'
"""Log format
"""
self.logger_stream_handler = None
"""Log stream handler
"""
self.logger_file_handler = None
"""Log file handler
"""
self.logger_file = None
"""Debug file location
"""
self.debug = False
"""Debug switch
"""
self.verify_ssl = True
"""SSL/TLS verification
Set this to false to skip verifying SSL certificate when calling API
from https server.
"""
self.ssl_ca_cert = None
"""Set this to customize the certificate file to verify the peer.
"""
self.cert_file = None
"""client certificate file
"""
self.key_file = None
"""client key file
"""
self.assert_hostname = None
"""Set this to True/False to enable/disable SSL hostname verification.
"""
{{#asyncio}}
self.connection_pool_maxsize = 100
"""This value is passed to the aiohttp to limit simultaneous connections.
Default values is 100, None means no-limit.
"""
{{/asyncio}}
{{^asyncio}}
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
"""urllib3 connection pool's maximum number of connections saved
per pool. urllib3 uses 1 connection as default value, but this is
not the best value when you are making a lot of possibly parallel
requests to the same host, which is often the case here.
cpu_count * 5 is used as default value to increase performance.
"""
{{/asyncio}}
self.proxy = None
"""Proxy URL
"""
self.proxy_headers = None
"""Proxy headers
"""
self.safe_chars_for_path_param = ''
"""Safe chars for path_param
"""
self.retries = None
"""Adding retries to override urllib3 default value 3
"""
# Enable client side validation
self.client_side_validation = True
def __deepcopy__(self, memo):
cls = self.__class__
result = cls.__new__(cls)
memo[id(self)] = result
for k, v in self.__dict__.items():
if k not in ('logger', 'logger_file_handler'):
setattr(result, k, copy.deepcopy(v, memo))
# shallow copy of loggers
result.logger = copy.copy(self.logger)
# use setters to configure loggers
result.logger_file = self.logger_file
result.debug = self.debug
return result
def __setattr__(self, name, value):
object.__setattr__(self, name, value)
if name == 'disabled_client_side_validations':
s = set(filter(None, value.split(',')))
for v in s:
if v not in JSON_SCHEMA_VALIDATION_KEYWORDS:
raise ApiValueError(
"Invalid keyword: '{0}''".format(v))
self._disabled_client_side_validations = s
{{#hasHttpSignatureMethods}}
if name == "signing_info" and value is not None:
# Ensure the host paramater from signing info is the same as
# Configuration.host.
value.host = self.host
{{/hasHttpSignatureMethods}}
@classmethod
def set_default(cls, default):
"""Set default instance of configuration.
It stores default configuration, which can be
returned by get_default_copy method.
:param default: object of Configuration
"""
cls._default = copy.deepcopy(default)
@classmethod
def get_default_copy(cls):
"""Return new instance of configuration.
This method returns newly created, based on default constructor,
object of Configuration class or returns a copy of default
configuration passed by the set_default method.
:return: The configuration object.
"""
if cls._default is not None:
return copy.deepcopy(cls._default)
return Configuration()
@property
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.
:param value: The logger_file path.
:type: str
"""
return self.__logger_file
@logger_file.setter
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.
:param value: The logger_file path.
:type: str
"""
self.__logger_file = value
if self.__logger_file:
# If set logging file,
# 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 self.logger.items():
logger.addHandler(self.logger_file_handler)
@property
def debug(self):
"""Debug status
:param value: The debug status, True or False.
:type: bool
"""
return self.__debug
@debug.setter
def debug(self, value):
"""Debug status
:param value: The debug status, True or False.
:type: bool
"""
self.__debug = value
if self.__debug:
# if debug status is True, turn on debug logging
for _, logger in self.logger.items():
logger.setLevel(logging.DEBUG)
# turn on http_client debug
http_client.HTTPConnection.debuglevel = 1
else:
# if debug status is False, turn off debug logging,
# setting log level to default `logging.WARNING`
for _, logger in self.logger.items():
logger.setLevel(logging.WARNING)
# turn off http_client debug
http_client.HTTPConnection.debuglevel = 0
@property
def logger_format(self):
"""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):
"""The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
"""
self.__logger_format = value
self.logger_formatter = logging.Formatter(self.__logger_format)
def get_api_key_with_prefix(self, identifier, alias=None):
"""Gets API key (with prefix if set).
:param identifier: The identifier of apiKey.
:param alias: The alternative identifier of apiKey.
:return: The token for api key authentication.
"""
if self.refresh_api_key_hook is not None:
self.refresh_api_key_hook(self)
key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None)
if key:
prefix = self.api_key_prefix.get(identifier)
if prefix:
return "%s %s" % (prefix, key)
else:
return key
def get_basic_auth_token(self):
"""Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
"""
username = ""
if self.username is not None:
username = self.username
password = ""
if self.password is not None:
password = self.password
return urllib3.util.make_headers(
basic_auth=username + ':' + password
).get('authorization')
def auth_settings(self):
"""Gets Auth Settings dict for api client.
:return: The Auth Settings information dict.
"""
auth = {}
{{#authMethods}}
{{#isApiKey}}
if '{{name}}' in self.api_key{{#vendorExtensions.x-auth-id-alias}} or '{{.}}' in self.api_key{{/vendorExtensions.x-auth-id-alias}}:
auth['{{name}}'] = {
'type': 'api_key',
'in': {{#isKeyInCookie}}'cookie'{{/isKeyInCookie}}{{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{#isKeyInQuery}}'query'{{/isKeyInQuery}},
'key': '{{keyParamName}}',
'value': self.get_api_key_with_prefix(
'{{name}}',{{#vendorExtensions.x-auth-id-alias}}
alias='{{.}}',{{/vendorExtensions.x-auth-id-alias}}
),
}
{{/isApiKey}}
{{#isBasic}}
{{#isBasicBasic}}
if self.username is not None and self.password is not None:
auth['{{name}}'] = {
'type': 'basic',
'in': 'header',
'key': 'Authorization',
'value': self.get_basic_auth_token()
}
{{/isBasicBasic}}
{{#isBasicBearer}}
if self.access_token is not None:
auth['{{name}}'] = {
'type': 'bearer',
'in': 'header',
{{#bearerFormat}}
'format': '{{{.}}}',
{{/bearerFormat}}
'key': 'Authorization',
'value': 'Bearer ' + self.access_token
}
{{/isBasicBearer}}
{{#isHttpSignature}}
if self.signing_info is not None:
auth['{{name}}'] = {
'type': 'http-signature',
'in': 'header',
'key': 'Authorization',
'value': None # Signature headers are calculated for every HTTP request
}
{{/isHttpSignature}}
{{/isBasic}}
{{#isOAuth}}
if self.access_token is not None:
auth['{{name}}'] = {
'type': 'oauth2',
'in': 'header',
'key': 'Authorization',
'value': 'Bearer ' + self.access_token
}
{{/isOAuth}}
{{/authMethods}}
return auth
def to_debug_report(self):
"""Gets the essential information for debugging.
:return: The report for debugging.
"""
return "Python SDK Debug Report:\n"\
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: {{version}}\n"\
"SDK Package Version: {{packageVersion}}".\
format(env=sys.platform, pyversion=sys.version)
def get_host_settings(self):
"""Gets an array of host settings
:return: An array of host settings
"""
return [
{{#servers}}
{
'url': "{{{url}}}",
'description': "{{{description}}}{{^description}}No description provided{{/description}}",
{{#variables}}
{{#-first}}
'variables': {
{{/-first}}
'{{{name}}}': {
'description': "{{{description}}}{{^description}}No description provided{{/description}}",
'default_value': "{{{defaultValue}}}",
{{#enumValues}}
{{#-first}}
'enum_values': [
{{/-first}}
"{{{.}}}"{{^-last}},{{/-last}}
{{#-last}}
]
{{/-last}}
{{/enumValues}}
}{{^-last}},{{/-last}}
{{#-last}}
}
{{/-last}}
{{/variables}}
}{{^-last}},{{/-last}}
{{/servers}}
]
def get_host_from_settings(self, index, variables=None, servers=None):
"""Gets host URL based on the index and variables
:param index: array index of the host settings
:param variables: hash of variable and the corresponding value
:param servers: an array of host settings or None
:return: URL based on host settings
"""
if index is None:
return self._base_path
variables = {} if variables is None else variables
servers = self.get_host_settings() if servers is None else servers
try:
server = servers[index]
except IndexError:
raise ValueError(
"Invalid index {0} when selecting the host settings. "
"Must be less than {1}".format(index, len(servers)))
url = server['url']
# go through variables and replace placeholders
for variable_name, variable in server.get('variables', {}).items():
used_value = variables.get(
variable_name, variable['default_value'])
if 'enum_values' in variable \
and used_value not in variable['enum_values']:
raise ValueError(
"The variable `{0}` in the host URL has invalid value "
"{1}. Must be {2}.".format(
variable_name, variables[variable_name],
variable['enum_values']))
url = url.replace("{" + variable_name + "}", used_value)
return url
@property
def host(self):
"""Return generated host."""
return self.get_host_from_settings(self.server_index, variables=self.server_variables)
@host.setter
def host(self, value):
"""Fix base path."""
self._base_path = value
self.server_index = None

View File

@@ -0,0 +1,129 @@
# coding: utf-8
{{>partial_header}}
class OpenApiException(Exception):
"""The base exception class for all OpenAPIExceptions"""
class ApiTypeError(OpenApiException, TypeError):
def __init__(self, msg, path_to_item=None, valid_classes=None,
key_type=None):
""" Raises an exception for TypeErrors
Args:
msg (str): the exception message
Keyword Args:
path_to_item (list): a list of keys an indices to get to the
current_item
None if unset
valid_classes (tuple): the primitive classes that current item
should be an instance of
None if unset
key_type (bool): False if our value is a value in a dict
True if it is a key in a dict
False if our item is an item in a list
None if unset
"""
self.path_to_item = path_to_item
self.valid_classes = valid_classes
self.key_type = key_type
full_msg = msg
if path_to_item:
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
super(ApiTypeError, self).__init__(full_msg)
class ApiValueError(OpenApiException, ValueError):
def __init__(self, msg, path_to_item=None):
"""
Args:
msg (str): the exception message
Keyword Args:
path_to_item (list) the path to the exception in the
received_data dict. None if unset
"""
self.path_to_item = path_to_item
full_msg = msg
if path_to_item:
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
super(ApiValueError, self).__init__(full_msg)
class ApiAttributeError(OpenApiException, AttributeError):
def __init__(self, msg, path_to_item=None):
"""
Raised when an attribute reference or assignment fails.
Args:
msg (str): the exception message
Keyword Args:
path_to_item (None/list) the path to the exception in the
received_data dict
"""
self.path_to_item = path_to_item
full_msg = msg
if path_to_item:
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
super(ApiAttributeError, self).__init__(full_msg)
class ApiKeyError(OpenApiException, KeyError):
def __init__(self, msg, path_to_item=None):
"""
Args:
msg (str): the exception message
Keyword Args:
path_to_item (None/list) the path to the exception in the
received_data dict
"""
self.path_to_item = path_to_item
full_msg = msg
if path_to_item:
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
super(ApiKeyError, self).__init__(full_msg)
class ApiException(OpenApiException):
def __init__(self, status=None, reason=None, http_resp=None):
if http_resp:
self.status = http_resp.status
self.reason = http_resp.reason
self.body = http_resp.data
self.headers = http_resp.getheaders()
else:
self.status = status
self.reason = reason
self.body = None
self.headers = None
def __str__(self):
"""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)
if self.body:
error_message += "HTTP response body: {0}\n".format(self.body)
return error_message
def render_path(path_to_item):
"""Returns a string representation of a path"""
result = ""
for pth in path_to_item:
if isinstance(pth, int):
result += "[{0}]".format(pth)
else:
result += "['{0}']".format(pth)
return result

View File

@@ -0,0 +1,35 @@
# ref: https://docs.gitlab.com/ee/ci/README.html
stages:
- test
.nosetest:
stage: test
script:
- pip install -r requirements.txt
- pip install -r test-requirements.txt
{{#useNose}}
- nosetests
{{/useNose}}
{{^useNose}}
- pytest --cov={{{packageName}}}
{{/useNose}}
nosetest-3.3:
extends: .nosetest
image: python:3.3-alpine
nosetest-3.4:
extends: .nosetest
image: python:3.4-alpine
nosetest-3.5:
extends: .nosetest
image: python:3.5-alpine
nosetest-3.6:
extends: .nosetest
image: python:3.6-alpine
nosetest-3.7:
extends: .nosetest
image: python:3.7-alpine
nosetest-3.8:
extends: .nosetest
image: python:3.8-alpine

View File

@@ -2,11 +2,9 @@
{{>partial_header}}
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from {{packageName}}.model_utils import ( # noqa: F401
@@ -20,9 +18,7 @@ from {{packageName}}.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
{{#models}}

View File

@@ -41,7 +41,7 @@
for var_name, var_value in required_args.items():
setattr(self, var_name, var_value)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name in unused_args and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -15,7 +15,7 @@
{{#requiredVars}}
self.{{name}} = {{name}}
{{/requiredVars}}
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -13,17 +13,12 @@
if not set(self._data_store.keys()) == set(other._data_store.keys()):
return False
for _var_name, this_val in six.iteritems(self._data_store):
for _var_name, this_val in self._data_store.items():
that_val = other._data_store[_var_name]
types = set()
types.add(this_val.__class__)
types.add(that_val.__class__)
vals_equal = this_val == that_val
if (not six.PY3 and
len(types) == 2 and unicode in types): # noqa: F821
vals_equal = (
this_val.encode('utf-8') == that_val.encode('utf-8')
)
if not vals_equal:
return False
return True

View File

@@ -13,10 +13,4 @@
types.add(this_val.__class__)
types.add(that_val.__class__)
vals_equal = this_val == that_val
if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821
vals_equal = (
this_val.encode('utf-8') == that_val.encode('utf-8')
)
if not vals_equal:
return False
return True
return vals_equal

View File

@@ -2,7 +2,6 @@
{{>partial_header}}
from __future__ import absolute_import
import sys
import unittest

View File

@@ -4,13 +4,13 @@
from datetime import date, datetime # noqa: F401
import inspect
import io
import os
import pprint
import re
import tempfile
from dateutil.parser import parse
import six
from {{packageName}}.exceptions import (
ApiKeyError,
@@ -20,20 +20,7 @@ from {{packageName}}.exceptions import (
)
none_type = type(None)
if six.PY3:
import io
file_type = io.IOBase
# these are needed for when other modules import str and int from here
str = str
int = int
else:
file_type = file # noqa: F821
str_py2 = str
unicode_py2 = unicode # noqa: F821
long_py2 = long # noqa: F821
int_py2 = int
# this requires that the future library is installed
from builtins import int, str
file_type = io.IOBase
class cached_property(object):
@@ -380,8 +367,6 @@ def get_simple_class(input_value):
# isinstance(True, int) == True
return bool
elif isinstance(input_value, int):
# for python2 input_value==long_instance -> return int
# where int is the python3 int backport
return int
elif isinstance(input_value, datetime):
# this must be higher than the date check because
@@ -389,8 +374,7 @@ def get_simple_class(input_value):
return datetime
elif isinstance(input_value, date):
return date
elif (six.PY2 and isinstance(input_value, (str_py2, unicode_py2, str)) or
isinstance(input_value, str)):
elif isinstance(input_value, str):
return str
return type(input_value)
@@ -835,12 +819,12 @@ def deserialize_primitive(data, klass, path_to_item):
return converted_value
except (OverflowError, ValueError) as ex:
# parse can raise OverflowError
six.raise_from(ApiValueError(
raise ApiValueError(
"{0}Failed to parse {1} as {2}".format(
additional_message, repr(data), get_py3_class_name(klass)
additional_message, repr(data), klass.__name__
),
path_to_item=path_to_item
), ex)
) from ex
def get_discriminator_class(model_class,
@@ -964,8 +948,8 @@ def deserialize_file(response_data, configuration, content_disposition=None):
path = os.path.join(os.path.dirname(path), filename)
with open(path, "wb") as f:
if six.PY3 and isinstance(response_data, str):
# in python3 change str to bytes so we can write it
if isinstance(response_data, str):
# change str to bytes so we can write it
response_data = response_data.encode('utf-8')
f.write(response_data)
@@ -1184,7 +1168,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
if input_value == {}:
# allow an empty dict
return input_value
for inner_key, inner_val in six.iteritems(input_value):
for inner_key, inner_val in input_value.items():
inner_path = list(path_to_item)
inner_path.append(inner_key)
if get_simple_class(inner_key) != str:
@@ -1218,7 +1202,7 @@ def model_to_dict(model_instance, serialize=True):
if model_instance._composed_schemas:
model_instances.extend(model_instance._composed_instances)
for model_instance in model_instances:
for attr, value in six.iteritems(model_instance._data_store):
for attr, value in model_instance._data_store.items():
if serialize:
# we use get here because additional property key names do not
# exist in attribute_map
@@ -1275,13 +1259,8 @@ def type_error_message(var_value=None, var_name=None, valid_classes=None,
def get_valid_classes_phrase(input_classes):
"""Returns a string phrase describing what types are allowed
Note: Adds the extra valid classes in python2
"""
all_classes = list(input_classes)
if six.PY2 and str in input_classes:
all_classes.extend([str_py2, unicode_py2])
if six.PY2 and int in input_classes:
all_classes.extend([int_py2, long_py2])
all_classes = sorted(all_classes, key=lambda cls: cls.__name__)
all_class_names = [cls.__name__ for cls in all_classes]
if len(all_class_names) == 1:
@@ -1289,15 +1268,6 @@ def get_valid_classes_phrase(input_classes):
return "is one of [{0}]".format(", ".join(all_class_names))
def get_py3_class_name(input_class):
if six.PY2:
if input_class == str:
return 'str'
elif input_class == int:
return 'int'
return input_class.__name__
def convert_js_args_to_python_args(fn):
from functools import wraps
@wraps(fn)
@@ -1340,7 +1310,7 @@ def get_allof_instances(self, model_args, constant_args):
allof_instance = allof_class(**kwargs)
composed_instances.append(allof_instance)
except Exception as ex:
six.raise_from(ApiValueError(
raise ApiValueError(
"Invalid inputs given to generate an instance of '%s'. The "
"input data was invalid for the allOf schema '%s' in the composed "
"schema '%s'. Error=%s" % (
@@ -1349,7 +1319,7 @@ def get_allof_instances(self, model_args, constant_args):
self.__class__.__name__,
str(ex)
)
), ex)
) from ex
return composed_instances

View File

@@ -1,7 +1,5 @@
nulltype
certifi >= 14.05.14
future; python_version<="2.7"
six >= 1.10
python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.15.1

View File

@@ -0,0 +1,279 @@
# coding: utf-8
{{>partial_header}}
import io
import json
import logging
import re
import ssl
from urllib.parse import urlencode
import certifi
import urllib3
from {{packageName}}.exceptions import ApiException, ApiValueError
logger = logging.getLogger(__name__)
class RESTResponse(io.IOBase):
def __init__(self, resp):
self.urllib3_response = resp
self.status = resp.status
self.reason = resp.reason
self.data = resp.data
def getheaders(self):
"""Returns a dictionary of the response headers."""
return self.urllib3_response.getheaders()
def getheader(self, name, default=None):
"""Returns a given response header."""
return self.urllib3_response.getheader(name, default)
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 # 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:
cert_reqs = ssl.CERT_REQUIRED
else:
cert_reqs = ssl.CERT_NONE
# ca_certs
if configuration.ssl_ca_cert:
ca_certs = configuration.ssl_ca_cert
else:
# if not set certificate file, use Mozilla's root certificates.
ca_certs = certifi.where()
addition_pool_args = {}
if configuration.assert_hostname is not None:
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
if configuration.retries is not None:
addition_pool_args['retries'] = configuration.retries
if maxsize is None:
if configuration.connection_pool_maxsize is not None:
maxsize = configuration.connection_pool_maxsize
else:
maxsize = 4
# https pool manager
if configuration.proxy:
self.pool_manager = urllib3.ProxyManager(
num_pools=pools_size,
maxsize=maxsize,
cert_reqs=cert_reqs,
ca_certs=ca_certs,
cert_file=configuration.cert_file,
key_file=configuration.key_file,
proxy_url=configuration.proxy,
proxy_headers=configuration.proxy_headers,
**addition_pool_args
)
else:
self.pool_manager = urllib3.PoolManager(
num_pools=pools_size,
maxsize=maxsize,
cert_reqs=cert_reqs,
ca_certs=ca_certs,
cert_file=configuration.cert_file,
key_file=configuration.key_file,
**addition_pool_args
)
def request(self, method, url, query_params=None, headers=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
:param headers: http request headers
:param body: request json body, for `application/json`
: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.
"""
method = method.upper()
assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
'PATCH', 'OPTIONS']
if post_params and body:
raise ApiValueError(
"body parameter cannot be used with post_params parameter."
)
post_params = post_params or {}
headers = headers or {}
timeout = None
if _request_timeout:
if isinstance(_request_timeout, int): # 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])
if 'Content-Type' not in headers:
headers['Content-Type'] = 'application/json'
try:
# For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
if query_params:
url += '?' + urlencode(query_params)
if re.search('json', headers['Content-Type'], re.IGNORECASE):
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': # 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.
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)
# Pass a `string` parameter directly in the body to support
# other content types than Json when `body` argument is
# provided in serialized form
elif isinstance(body, str) or isinstance(body, bytes):
request_body = body
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."""
raise ApiException(status=0, reason=msg)
# For `GET`, `HEAD`
else:
r = self.pool_manager.request(method, url,
fields=query_params,
preload_content=_preload_content,
timeout=timeout,
headers=headers)
except urllib3.exceptions.SSLError as e:
msg = "{0}\n{1}".format(type(e).__name__, str(e))
raise ApiException(status=0, reason=msg)
if _preload_content:
r = RESTResponse(r)
# log response body
logger.debug("response body: %s", r.data)
if not 200 <= r.status <= 299:
raise ApiException(http_resp=r)
return r
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):
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):
return self.request("OPTIONS", url,
headers=headers,
query_params=query_params,
post_params=post_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
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,
_preload_content=_preload_content,
_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):
return self.request("POST", url,
headers=headers,
query_params=query_params,
post_params=post_params,
_preload_content=_preload_content,
_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):
return self.request("PUT", url,
headers=headers,
query_params=query_params,
post_params=post_params,
_preload_content=_preload_content,
_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):
return self.request("PATCH", url,
headers=headers,
query_params=query_params,
post_params=post_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)

View File

@@ -18,7 +18,6 @@ VERSION = "{{packageVersion}}"
REQUIRES = [
"urllib3 >= 1.15",
"six >= 1.10",
"certifi",
"python-dateutil",
"nulltype",
@@ -33,7 +32,6 @@ REQUIRES = [
"pycryptodome>=3.9.0",
{{/hasHttpSignatureMethods}}
]
EXTRAS = {':python_version <= "2.7"': ['future']}
setup(
name=NAME,
@@ -43,8 +41,8 @@ setup(
author_email="{{#infoEmail}}{{infoEmail}}{{/infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}",
url="{{packageUrl}}",
keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"],
python_requires=">=3.3",
install_requires=REQUIRES,
extras_require=EXTRAS,
packages=find_packages(exclude=["test", "tests"]),
include_package_data=True,
{{#licenseInfo}}license="{{licenseInfo}}",

View File

@@ -1,6 +1,5 @@
# coding: utf-8
{{>partial_header}}
from __future__ import absolute_import
from base64 import b64encode
from Crypto.IO import PEM, PKCS8
@@ -11,8 +10,8 @@ from email.utils import formatdate
import json
import os
import re
from six.moves.urllib.parse import urlencode, urlparse
from time import time
from urllib.parse import urlencode, urlparse
# The constants below define a subset of HTTP headers that can be included in the
# HTTP signature scheme. Additional headers may be included in the signature.

View File

@@ -6,11 +6,10 @@ py>=1.4.31
randomize>=0.13
{{/useNose}}
{{^useNose}}
pytest~=4.6.7 # needed for python 2.7+3.4
pytest~=4.6.7 # needed for python 3.4
pytest-cov>=2.8.1
pytest-randomly==1.2.3 # needed for python 2.7+3.4
pytest-randomly==1.2.3 # needed for python 3.4
{{/useNose}}
{{#hasHttpSignatureMethods}}
pycryptodome>=3.9.0
{{/hasHttpSignatureMethods}}
mock; python_version<="2.7"

View File

@@ -0,0 +1,9 @@
[tox]
envlist = py3
[testenv]
deps=-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands=
{{^useNose}}pytest --cov={{{packageName}}}{{/useNose}}{{#useNose}}nosetests{{/useNose}}

View File

@@ -0,0 +1,21 @@
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
- "3.2"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
# command to install dependencies
install:
- "pip install -r requirements.txt"
- "pip install -r test-requirements.txt"
# command to run tests
{{#useNose}}
script: nosetests
{{/useNose}}
{{^useNose}}
script: pytest --cov={{{packageName}}}
{{/useNose}}

View File

@@ -10,9 +10,6 @@ stages:
- pip install -r test-requirements.txt
- pytest --cov=petstore_api
nosetest-2.7:
extends: .nosetest
image: python:2.7-alpine
nosetest-3.3:
extends: .nosetest
image: python:3.3-alpine

View File

@@ -1,7 +1,6 @@
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
- "2.7"
- "3.2"
- "3.3"
- "3.4"

View File

@@ -15,7 +15,4 @@ clean:
find . -name "__pycache__" -delete
test: clean
bash ./test_python2.sh
test-all: clean
bash ./test_python2_and_3.sh
bash ./test_python.sh

View File

@@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
## Requirements.
Python 2.7 and 3.4+
Python 3.4+
## Installation & Usage
### pip install
@@ -45,7 +45,6 @@ import petstore_api
Please follow the [installation procedure](#installation--usage) and then run the following:
```python
from __future__ import print_function
import time
import petstore_api

View File

@@ -17,7 +17,6 @@ To test special tags and operation ID starting with number
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import another_fake_api

View File

@@ -32,7 +32,6 @@ Test serialization of ArrayModel
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
@@ -96,7 +95,6 @@ Test serialization of outer boolean types
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
@@ -159,7 +157,6 @@ this route creates an XmlItem
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
@@ -222,7 +219,6 @@ Test serialization of outer number types
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
@@ -286,7 +282,6 @@ Test serialization of object with $refed properties
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
@@ -350,7 +345,6 @@ Test serialization of outer string types
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
@@ -413,7 +407,6 @@ Test serialization of outer enum
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
@@ -477,7 +470,6 @@ For this test, the body for this request much reference a schema named `File`.
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
@@ -537,7 +529,6 @@ No authorization required
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
@@ -601,7 +592,6 @@ To test \"client\" model
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
@@ -665,7 +655,6 @@ This route has required values with enums of 1
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
@@ -730,7 +719,6 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイ
* Basic Authentication (http_basic_test):
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
@@ -837,7 +825,6 @@ To test enum parameters
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
@@ -915,7 +902,6 @@ Fake endpoint to test group parameters (optional)
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
@@ -993,7 +979,6 @@ test inline additionalProperties
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
@@ -1053,7 +1038,6 @@ test json serialization of form data
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api

View File

@@ -18,7 +18,6 @@ To test class name in snake case
* Api Key Authentication (api_key_query):
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_classname_tags_123_api

View File

@@ -24,7 +24,6 @@ Add a new pet to the store
* OAuth Authentication (petstore_auth):
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import pet_api
@@ -97,7 +96,6 @@ Deletes a pet
* OAuth Authentication (petstore_auth):
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import pet_api
@@ -181,7 +179,6 @@ Multiple status values can be provided with comma separated strings
* OAuth Authentication (petstore_auth):
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import pet_api
@@ -257,7 +254,6 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
* OAuth Authentication (petstore_auth):
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import pet_api
@@ -333,7 +329,6 @@ Returns a single pet
* Api Key Authentication (api_key):
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import pet_api
@@ -412,7 +407,6 @@ Update an existing pet
* OAuth Authentication (petstore_auth):
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import pet_api
@@ -487,7 +481,6 @@ Updates a pet in the store with form data
* OAuth Authentication (petstore_auth):
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import pet_api
@@ -570,7 +563,6 @@ uploads an image
* OAuth Authentication (petstore_auth):
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import pet_api
@@ -658,7 +650,6 @@ uploads an image (required)
* OAuth Authentication (petstore_auth):
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import pet_api

View File

@@ -20,7 +20,6 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import store_api
@@ -84,7 +83,6 @@ Returns a map of status codes to quantities
* Api Key Authentication (api_key):
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import store_api
@@ -157,7 +155,6 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import store_api
@@ -221,7 +218,6 @@ Place an order for a pet
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import store_api

View File

@@ -24,7 +24,6 @@ This can only be done by the logged in user.
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import user_api
@@ -85,7 +84,6 @@ Creates list of users with given input array
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import user_api
@@ -146,7 +144,6 @@ Creates list of users with given input array
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import user_api
@@ -209,7 +206,6 @@ This can only be done by the logged in user.
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import user_api
@@ -270,7 +266,6 @@ Get user by user name
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import user_api
@@ -334,7 +329,6 @@ Logs user into the system
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import user_api
@@ -398,7 +392,6 @@ Logs out current logged in user session
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import user_api
@@ -456,7 +449,6 @@ This can only be done by the logged in user.
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import user_api

View File

@@ -12,8 +12,6 @@
"""
from __future__ import absolute_import
__version__ = "1.0.0"
# import ApiClient

View File

@@ -1,11 +1,3 @@
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
# do not import all apis into this module because that uses a lot of memory and stack frames
# if you need the ability to import all apis from one package, import them with
# from {{packageName}.apis import DefaultApi, PetApi

View File

@@ -10,14 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
# python 2 and python 3 compatibility library
import six
from petstore_api.api_client import ApiClient, Endpoint
from petstore_api.model_utils import ( # noqa: F401
check_allowed_values,
@@ -25,9 +20,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_and_convert_types
)
from petstore_api.model import client

View File

@@ -10,14 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
# python 2 and python 3 compatibility library
import six
from petstore_api.api_client import ApiClient, Endpoint
from petstore_api.model_utils import ( # noqa: F401
check_allowed_values,
@@ -25,9 +20,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_and_convert_types
)
from petstore_api.model import animal_farm

View File

@@ -10,14 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
# python 2 and python 3 compatibility library
import six
from petstore_api.api_client import ApiClient, Endpoint
from petstore_api.model_utils import ( # noqa: F401
check_allowed_values,
@@ -25,9 +20,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_and_convert_types
)
from petstore_api.model import client

View File

@@ -10,14 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
# python 2 and python 3 compatibility library
import six
from petstore_api.api_client import ApiClient, Endpoint
from petstore_api.model_utils import ( # noqa: F401
check_allowed_values,
@@ -25,9 +20,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_and_convert_types
)
from petstore_api.model import pet

View File

@@ -10,14 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
# python 2 and python 3 compatibility library
import six
from petstore_api.api_client import ApiClient, Endpoint
from petstore_api.model_utils import ( # noqa: F401
check_allowed_values,
@@ -25,9 +20,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_and_convert_types
)
from petstore_api.model import order

View File

@@ -10,14 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
# python 2 and python 3 compatibility library
import six
from petstore_api.api_client import ApiClient, Endpoint
from petstore_api.model_utils import ( # noqa: F401
check_allowed_values,
@@ -25,9 +20,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_and_convert_types
)
from petstore_api.model import user

View File

@@ -8,7 +8,6 @@
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import json
import atexit
@@ -16,10 +15,8 @@ import mimetypes
from multiprocessing.pool import ThreadPool
import os
import re
from urllib.parse import quote
# python 2 and python 3 compatibility library
import six
from six.moves.urllib.parse import quote
from petstore_api import rest
from petstore_api.configuration import Configuration
@@ -34,10 +31,8 @@ from petstore_api.model_utils import (
datetime,
deserialize_file,
file_type,
int,
model_to_dict,
none_type,
str,
validate_and_convert_types
)
@@ -64,10 +59,8 @@ class ApiClient(object):
to the API. More threads means more concurrent API requests.
"""
# six.binary_type python2=str, python3=bytes
# six.text_type python2=unicode, python3=str
PRIMITIVE_TYPES = (
(float, bool, six.binary_type, six.text_type) + six.integer_types
float, bool, bytes, str, int
)
_pool = None
@@ -191,7 +184,7 @@ class ApiClient(object):
_preload_content=_preload_content,
_request_timeout=_request_timeout)
except ApiException as e:
e.body = e.body.decode('utf-8') if six.PY3 else e.body
e.body = e.body.decode('utf-8')
raise e
content_type = response_data.getheader('content-type')
@@ -204,7 +197,7 @@ class ApiClient(object):
return (return_data)
return return_data
if six.PY3 and response_type not in ["file", "bytes"]:
if response_type not in ["file", "bytes"]:
match = None
if content_type is not None:
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type)
@@ -265,7 +258,7 @@ class ApiClient(object):
return self.sanitize_for_serialization(obj.value)
return {key: self.sanitize_for_serialization(val)
for key, val in six.iteritems(obj_dict)}
for key, val in obj_dict.items()}
def deserialize(self, response, response_type, _check_type):
"""Deserializes response into an object.
@@ -465,7 +458,7 @@ class ApiClient(object):
new_params = []
if collection_formats is None:
collection_formats = {}
for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501
for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
if k in collection_formats:
collection_format = collection_formats[k]
if collection_format == 'multi':
@@ -496,7 +489,7 @@ class ApiClient(object):
return []
params = []
for param_name, file_instances in six.iteritems(files):
for param_name, file_instances in files.items():
if file_instances is None:
# if the file field is nullable, skip None values
continue
@@ -671,7 +664,7 @@ class Endpoint(object):
if kwargs['_check_input_type'] is False:
return
for key, value in six.iteritems(kwargs):
for key, value in kwargs.items():
fixed_val = validate_and_convert_types(
value,
self.openapi_types[key],
@@ -693,7 +686,7 @@ class Endpoint(object):
'query': []
}
for param_name, param_value in six.iteritems(kwargs):
for param_name, param_value in kwargs.items():
param_location = self.location_map.get(param_name)
if param_location is None:
continue
@@ -751,7 +744,7 @@ class Endpoint(object):
)
_host = None
for key, value in six.iteritems(kwargs):
for key, value in kwargs.items():
if key not in self.params_map['all']:
raise ApiTypeError(
"Got an unexpected parameter '%s'"

View File

@@ -10,16 +10,13 @@
"""
from __future__ import absolute_import
import copy
import logging
import multiprocessing
import sys
import urllib3
import six
from six.moves import http_client as httplib
from http import client as http_client
from petstore_api.exceptions import ApiValueError
@@ -307,7 +304,7 @@ conf = petstore_api.Configuration(
# 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 six.iteritems(self.logger):
for _, logger in self.logger.items():
logger.addHandler(self.logger_file_handler)
@property
@@ -329,17 +326,17 @@ conf = petstore_api.Configuration(
self.__debug = value
if self.__debug:
# if debug status is True, turn on debug logging
for _, logger in six.iteritems(self.logger):
for _, logger in self.logger.items():
logger.setLevel(logging.DEBUG)
# turn on httplib debug
httplib.HTTPConnection.debuglevel = 1
# turn on http_client debug
http_client.HTTPConnection.debuglevel = 1
else:
# if debug status is False, turn off debug logging,
# setting log level to default `logging.WARNING`
for _, logger in six.iteritems(self.logger):
for _, logger in self.logger.items():
logger.setLevel(logging.WARNING)
# turn off httplib debug
httplib.HTTPConnection.debuglevel = 0
# turn off http_client debug
http_client.HTTPConnection.debuglevel = 0
@property
def logger_format(self):

View File

@@ -10,8 +10,6 @@
"""
import six
class OpenApiException(Exception):
"""The base exception class for all OpenAPIExceptions"""
@@ -132,7 +130,7 @@ def render_path(path_to_item):
"""Returns a string representation of a path"""
result = ""
for pth in path_to_item:
if isinstance(pth, six.integer_types):
if isinstance(pth, int):
result += "[{0}]".format(pth)
else:
result += "['{0}']".format(pth)

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class AdditionalPropertiesAnyType(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class AdditionalPropertiesArray(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class AdditionalPropertiesBoolean(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -193,7 +189,7 @@ class AdditionalPropertiesClass(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class AdditionalPropertiesInteger(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class AdditionalPropertiesNumber(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class AdditionalPropertiesObject(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class AdditionalPropertiesString(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
try:
@@ -185,7 +181,7 @@ class Animal(ModelNormal):
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
self.class_name = class_name
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
try:

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -169,7 +165,7 @@ class ApiResponse(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class ArrayOfArrayOfNumberOnly(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class ArrayOfNumberOnly(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
try:
@@ -174,7 +170,7 @@ class ArrayTest(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -178,7 +174,7 @@ class Capitalization(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
try:
@@ -213,7 +209,7 @@ class Cat(ModelComposed):
for var_name, var_value in required_args.items():
setattr(self, var_name, var_value)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name in unused_args and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class CatAllOf(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -170,7 +166,7 @@ class Category(ModelNormal):
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
self.name = name
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
try:
@@ -206,7 +202,7 @@ class Child(ModelComposed):
for var_name, var_value in required_args.items():
setattr(self, var_name, var_value)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name in unused_args and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class ChildAllOf(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
try:
@@ -210,7 +206,7 @@ class ChildCat(ModelComposed):
for var_name, var_value in required_args.items():
setattr(self, var_name, var_value)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name in unused_args and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class ChildCatAllOf(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
try:
@@ -210,7 +206,7 @@ class ChildDog(ModelComposed):
for var_name, var_value in required_args.items():
setattr(self, var_name, var_value)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name in unused_args and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class ChildDogAllOf(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
try:
@@ -210,7 +206,7 @@ class ChildLizard(ModelComposed):
for var_name, var_value in required_args.items():
setattr(self, var_name, var_value)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name in unused_args and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class ChildLizardAllOf(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class ClassModel(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class Client(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
try:
@@ -213,7 +209,7 @@ class Dog(ModelComposed):
for var_name, var_value in required_args.items():
setattr(self, var_name, var_value)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name in unused_args and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class DogAllOf(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -174,7 +170,7 @@ class EnumArrays(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
try:
@@ -201,7 +197,7 @@ class EnumTest(ModelNormal):
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
self.enum_string_required = enum_string_required
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class File(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
try:
@@ -171,7 +167,7 @@ class FileSchemaTestClass(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -240,7 +236,7 @@ class FormatTest(ModelNormal):
self.byte = byte
self.date = date
self.password = password
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class Grandparent(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
try:
@@ -194,7 +190,7 @@ class GrandparentAnimal(ModelNormal):
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
self.pet_type = pet_type
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -166,7 +162,7 @@ class HasOnlyReadOnly(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class List(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
try:
@@ -181,7 +177,7 @@ class MapTest(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
try:
@@ -174,7 +170,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -166,7 +162,7 @@ class Model200Response(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class ModelReturn(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -175,7 +171,7 @@ class Name(ModelNormal):
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
self.name = name
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class NumberOnly(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
try:
@@ -174,7 +170,7 @@ class ObjectModelWithRefProps(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -183,7 +179,7 @@ class Order(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
try:
@@ -203,7 +199,7 @@ class Parent(ModelComposed):
for var_name, var_value in required_args.items():
setattr(self, var_name, var_value)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name in unused_args and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
@@ -163,7 +159,7 @@ class ParentAllOf(ModelNormal):
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

View File

@@ -10,11 +10,9 @@
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
@@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
try:
@@ -220,7 +216,7 @@ class ParentPet(ModelComposed):
for var_name, var_value in required_args.items():
setattr(self, var_name, var_value)
for var_name, var_value in six.iteritems(kwargs):
for var_name, var_value in kwargs.items():
if var_name in unused_args and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \

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