forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 5.0-sync-master
This commit is contained in:
33
samples/client/petstore/python-experimental/.gitlab-ci.yml
Normal file
33
samples/client/petstore/python-experimental/.gitlab-ci.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
# 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
|
||||
- pytest --cov=petstore_api
|
||||
|
||||
nosetest-2.7:
|
||||
extends: .nosetest
|
||||
image: python:2.7-alpine
|
||||
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
|
||||
@@ -1 +1,5 @@
|
||||
5.0.0-SNAPSHOT
|
||||
<<<<<<< HEAD
|
||||
5.0.0-SNAPSHOT
|
||||
=======
|
||||
4.3.1-SNAPSHOT
|
||||
>>>>>>> origin/master
|
||||
|
||||
@@ -10,6 +10,8 @@ python:
|
||||
- "3.7"
|
||||
- "3.8"
|
||||
# command to install dependencies
|
||||
install: "pip install -r requirements.txt"
|
||||
install:
|
||||
- "pip install -r requirements.txt"
|
||||
- "pip install -r test-requirements.txt"
|
||||
# command to run tests
|
||||
script: nosetests
|
||||
script: pytest --cov=petstore_api
|
||||
|
||||
@@ -23,7 +23,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.AnotherFakeApi(api_client)
|
||||
body = petstore_api.Client() # client.Client | client model
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**inter_net** | **bool** | | [optional]
|
||||
**radio_waves** | **bool** | | [optional]
|
||||
**tele_vision** | **bool** | | [optional]
|
||||
**inter_net** | **bool** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi(api_client)
|
||||
xml_item = petstore_api.XmlItem() # xml_item.XmlItem | XmlItem Body
|
||||
@@ -92,7 +92,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi(api_client)
|
||||
body = True # bool | Input boolean as post body (optional)
|
||||
@@ -148,7 +148,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi(api_client)
|
||||
body = petstore_api.OuterComposite() # outer_composite.OuterComposite | Input composite as post body (optional)
|
||||
@@ -204,7 +204,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi(api_client)
|
||||
body = petstore_api.OuterEnum("placed") # outer_enum.OuterEnum | Input enum as post body (optional)
|
||||
@@ -260,7 +260,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi(api_client)
|
||||
body = petstore_api.OuterNumber(3.4) # outer_number.OuterNumber | Input number as post body (optional)
|
||||
@@ -316,7 +316,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi(api_client)
|
||||
body = 'body_example' # str | Input string as post body (optional)
|
||||
@@ -372,7 +372,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi(api_client)
|
||||
body = petstore_api.FileSchemaTestClass() # file_schema_test_class.FileSchemaTestClass |
|
||||
@@ -424,7 +424,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi(api_client)
|
||||
query = 'query_example' # str |
|
||||
@@ -480,7 +480,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi(api_client)
|
||||
body = petstore_api.Client() # client.Client | client model
|
||||
@@ -536,7 +536,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi(api_client)
|
||||
|
||||
@@ -599,6 +599,7 @@ configuration.password = 'YOUR_PASSWORD'
|
||||
|
||||
# Defining host is optional and default to http://petstore.swagger.io:80/v2
|
||||
configuration.host = "http://petstore.swagger.io:80/v2"
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
@@ -690,7 +691,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi(api_client)
|
||||
enum_header_string_array = ['enum_header_string_array_example'] # [str] | Header parameter enum test (string array) (optional)
|
||||
@@ -761,7 +762,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi(api_client)
|
||||
required_string_group = 56 # int | Required String in group parameters
|
||||
@@ -832,7 +833,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi(api_client)
|
||||
param = {'key': 'param_example'} # {str: (str,)} | request body
|
||||
@@ -885,7 +886,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi(api_client)
|
||||
param = 'param_example' # str | field1
|
||||
|
||||
@@ -30,6 +30,7 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY'
|
||||
|
||||
# Defining host is optional and default to http://petstore.swagger.io:80/v2
|
||||
configuration.host = "http://petstore.swagger.io:80/v2"
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**radio_waves** | **bool** | | [optional]
|
||||
**tele_vision** | **bool** | | [optional]
|
||||
**radio_waves** | **bool** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
|
||||
# Defining host is optional and default to http://petstore.swagger.io:80/v2
|
||||
configuration.host = "http://petstore.swagger.io:80/v2"
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
@@ -94,6 +95,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
|
||||
# Defining host is optional and default to http://petstore.swagger.io:80/v2
|
||||
configuration.host = "http://petstore.swagger.io:80/v2"
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
@@ -166,6 +168,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
|
||||
# Defining host is optional and default to http://petstore.swagger.io:80/v2
|
||||
configuration.host = "http://petstore.swagger.io:80/v2"
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
@@ -229,6 +232,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
|
||||
# Defining host is optional and default to http://petstore.swagger.io:80/v2
|
||||
configuration.host = "http://petstore.swagger.io:80/v2"
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
@@ -294,6 +298,7 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY'
|
||||
|
||||
# Defining host is optional and default to http://petstore.swagger.io:80/v2
|
||||
configuration.host = "http://petstore.swagger.io:80/v2"
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
@@ -356,6 +361,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
|
||||
# Defining host is optional and default to http://petstore.swagger.io:80/v2
|
||||
configuration.host = "http://petstore.swagger.io:80/v2"
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
@@ -418,6 +424,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
|
||||
# Defining host is optional and default to http://petstore.swagger.io:80/v2
|
||||
configuration.host = "http://petstore.swagger.io:80/v2"
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
@@ -489,6 +496,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
|
||||
# Defining host is optional and default to http://petstore.swagger.io:80/v2
|
||||
configuration.host = "http://petstore.swagger.io:80/v2"
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
@@ -564,6 +572,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
|
||||
# Defining host is optional and default to http://petstore.swagger.io:80/v2
|
||||
configuration.host = "http://petstore.swagger.io:80/v2"
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
|
||||
@@ -26,7 +26,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.StoreApi(api_client)
|
||||
order_id = 'order_id_example' # str | ID of the order that needs to be deleted
|
||||
@@ -89,6 +89,7 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY'
|
||||
|
||||
# Defining host is optional and default to http://petstore.swagger.io:80/v2
|
||||
configuration.host = "http://petstore.swagger.io:80/v2"
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
@@ -142,7 +143,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.StoreApi(api_client)
|
||||
order_id = 56 # int | ID of pet that needs to be fetched
|
||||
@@ -198,7 +199,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.StoreApi(api_client)
|
||||
body = petstore_api.Order() # order.Order | order placed for purchasing the pet
|
||||
|
||||
@@ -30,7 +30,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.UserApi(api_client)
|
||||
body = petstore_api.User() # user.User | Created user object
|
||||
@@ -83,7 +83,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.UserApi(api_client)
|
||||
body = [petstore_api.User()] # [user.User] | List of user object
|
||||
@@ -136,7 +136,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.UserApi(api_client)
|
||||
body = [petstore_api.User()] # [user.User] | List of user object
|
||||
@@ -191,7 +191,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.UserApi(api_client)
|
||||
username = 'username_example' # str | The name that needs to be deleted
|
||||
@@ -245,7 +245,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.UserApi(api_client)
|
||||
username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing.
|
||||
@@ -301,7 +301,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.UserApi(api_client)
|
||||
username = 'username_example' # str | The user name for login
|
||||
@@ -358,7 +358,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.UserApi(api_client)
|
||||
|
||||
@@ -409,7 +409,7 @@ import petstore_api
|
||||
from pprint import pprint
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient(configuration) as api_client:
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.UserApi(api_client)
|
||||
username = 'username_example' # str | name that need to be deleted
|
||||
|
||||
@@ -26,6 +26,7 @@ from petstore_api.exceptions import ApiValueError
|
||||
from petstore_api.model_utils import (
|
||||
ModelNormal,
|
||||
ModelSimple,
|
||||
ModelComposed,
|
||||
date,
|
||||
datetime,
|
||||
deserialize_file,
|
||||
@@ -233,7 +234,7 @@ class ApiClient(object):
|
||||
|
||||
if isinstance(obj, dict):
|
||||
obj_dict = obj
|
||||
elif isinstance(obj, ModelNormal):
|
||||
elif isinstance(obj, ModelNormal) or isinstance(obj, ModelComposed):
|
||||
# Convert model obj to dict
|
||||
# Convert attribute name to json key in
|
||||
# model definition for request
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import copy
|
||||
import logging
|
||||
import multiprocessing
|
||||
import sys
|
||||
@@ -37,6 +38,17 @@ class Configuration(object):
|
||||
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.
|
||||
|
||||
:Example:
|
||||
|
||||
@@ -72,9 +84,12 @@ class Configuration(object):
|
||||
)
|
||||
"""
|
||||
|
||||
_default = None
|
||||
|
||||
def __init__(self, host="http://petstore.swagger.io:80/v2",
|
||||
api_key=None, api_key_prefix=None,
|
||||
username=None, password=None,
|
||||
discard_unknown_keys=False,
|
||||
):
|
||||
"""Constructor
|
||||
"""
|
||||
@@ -104,6 +119,7 @@ class Configuration(object):
|
||||
self.password = password
|
||||
"""Password for HTTP basic authentication
|
||||
"""
|
||||
self.discard_unknown_keys = discard_unknown_keys
|
||||
self.access_token = None
|
||||
"""access token for OAuth/Bearer
|
||||
"""
|
||||
@@ -169,6 +185,45 @@ class Configuration(object):
|
||||
# Disable 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
|
||||
|
||||
@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.
|
||||
|
||||
@@ -274,25 +274,33 @@ class ModelComposed(OpenApiModel):
|
||||
if self._path_to_item:
|
||||
path_to_item.extend(self._path_to_item)
|
||||
path_to_item.append(name)
|
||||
values = []
|
||||
# A composed model stores child (oneof/anyOf/allOf) models under
|
||||
# self._var_name_to_model_instances. A named property can exist in
|
||||
# multiple child models. If the property is present in more than one
|
||||
# child model, the value must be the same across all the child models.
|
||||
if model_instances:
|
||||
values = set()
|
||||
for model_instance in model_instances:
|
||||
if name in model_instance._data_store:
|
||||
values.add(model_instance._data_store[name])
|
||||
if len(values) == 1:
|
||||
return list(values)[0]
|
||||
v = model_instance._data_store[name]
|
||||
if v not in values:
|
||||
values.append(v)
|
||||
len_values = len(values)
|
||||
if len_values == 0:
|
||||
raise ApiKeyError(
|
||||
"{0} has no key '{1}'".format(type(self).__name__, name),
|
||||
path_to_item
|
||||
)
|
||||
elif len_values == 1:
|
||||
return values[0]
|
||||
elif len_values > 1:
|
||||
raise ApiValueError(
|
||||
"Values stored for property {0} in {1} difffer when looking "
|
||||
"Values stored for property {0} in {1} differ when looking "
|
||||
"at self and self's composed instances. All values must be "
|
||||
"the same".format(name, type(self).__name__),
|
||||
path_to_item
|
||||
)
|
||||
|
||||
raise ApiKeyError(
|
||||
"{0} has no key '{1}'".format(type(self).__name__, name),
|
||||
path_to_item
|
||||
)
|
||||
|
||||
def to_dict(self):
|
||||
"""Returns the model properties as a dict"""
|
||||
return model_to_dict(self, serialize=False)
|
||||
@@ -718,7 +726,11 @@ def get_required_type_classes(required_types_mixed):
|
||||
def change_keys_js_to_python(input_dict, model_class):
|
||||
"""
|
||||
Converts from javascript_key keys in the input_dict to python_keys in
|
||||
the output dict using the mapping in model_class
|
||||
the output dict using the mapping in model_class.
|
||||
If the input_dict contains a key which does not declared in the model_class,
|
||||
the key is added to the output dict as is. The assumption is the model_class
|
||||
may have undeclared properties (additionalProperties attribute in the OAS
|
||||
document).
|
||||
"""
|
||||
|
||||
output_dict = {}
|
||||
@@ -931,8 +943,9 @@ def attempt_convert_item(input_value, valid_classes, path_to_item,
|
||||
if not valid_classes_coercible or key_type:
|
||||
# we do not handle keytype errors, json will take care
|
||||
# of this for us
|
||||
raise get_type_error(input_value, path_to_item, valid_classes,
|
||||
key_type=key_type)
|
||||
if configuration is None or not configuration.discard_unknown_keys:
|
||||
raise get_type_error(input_value, path_to_item, valid_classes,
|
||||
key_type=key_type)
|
||||
for valid_class in valid_classes_coercible:
|
||||
try:
|
||||
if issubclass(valid_class, OpenApiModel):
|
||||
@@ -1081,7 +1094,7 @@ def model_to_dict(model_instance, serialize=True):
|
||||
|
||||
model_instances = [model_instance]
|
||||
if model_instance._composed_schemas() is not None:
|
||||
model_instances = model_instance._composed_instances
|
||||
model_instances.extend(model_instance._composed_instances)
|
||||
for model_instance in model_instances:
|
||||
for attr, value in six.iteritems(model_instance._data_store):
|
||||
if serialize:
|
||||
@@ -1189,53 +1202,88 @@ def get_allof_instances(self, model_args, constant_args):
|
||||
|
||||
# and use it to make the instance
|
||||
kwargs.update(constant_args)
|
||||
allof_instance = allof_class(**kwargs)
|
||||
composed_instances.append(allof_instance)
|
||||
try:
|
||||
allof_instance = allof_class(**kwargs)
|
||||
composed_instances.append(allof_instance)
|
||||
except Exception as ex:
|
||||
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" % (
|
||||
allof_class.__class__.__name__,
|
||||
allof_class.__class__.__name__,
|
||||
self.__class__.__name__,
|
||||
str(ex)
|
||||
)
|
||||
)
|
||||
return composed_instances
|
||||
|
||||
|
||||
def get_oneof_instance(self, model_args, constant_args):
|
||||
"""
|
||||
Find the oneOf schema that matches the input data (e.g. payload).
|
||||
If exactly one schema matches the input data, an instance of that schema
|
||||
is returned.
|
||||
If zero or more than one schema match the input data, an exception is raised.
|
||||
In OAS 3.x, the payload MUST, by validation, match exactly one of the
|
||||
schemas described by oneOf.
|
||||
Args:
|
||||
self: the class we are handling
|
||||
model_args (dict): var_name to var_value
|
||||
used to make instances
|
||||
The input data, e.g. the payload that must match a oneOf schema
|
||||
in the OpenAPI document.
|
||||
constant_args (dict): var_name to var_value
|
||||
used to make instances
|
||||
args that every model requires, including configuration, server
|
||||
and path to item.
|
||||
|
||||
Returns
|
||||
oneof_instance (instance)
|
||||
oneof_instance (instance/None)
|
||||
"""
|
||||
oneof_instance = None
|
||||
if len(self._composed_schemas()['oneOf']) == 0:
|
||||
return oneof_instance
|
||||
return None
|
||||
|
||||
oneof_instances = []
|
||||
# Iterate over each oneOf schema and determine if the input data
|
||||
# matches the oneOf schemas.
|
||||
for oneof_class in self._composed_schemas()['oneOf']:
|
||||
# transform js keys to python keys in fixed_model_args
|
||||
# transform js keys from input data to python keys in fixed_model_args
|
||||
fixed_model_args = change_keys_js_to_python(
|
||||
model_args, oneof_class)
|
||||
|
||||
# extract a dict of only required keys from fixed_model_args
|
||||
# Extract a dict with the properties that are declared in the oneOf schema.
|
||||
# Undeclared properties (e.g. properties that are allowed because of the
|
||||
# additionalProperties attribute in the OAS document) are not added to
|
||||
# the dict.
|
||||
kwargs = {}
|
||||
var_names = set(oneof_class.openapi_types().keys())
|
||||
for var_name in var_names:
|
||||
if var_name in fixed_model_args:
|
||||
kwargs[var_name] = fixed_model_args[var_name]
|
||||
|
||||
# do not try to make a model with no input args
|
||||
if len(kwargs) == 0:
|
||||
continue
|
||||
|
||||
# and use it to make the instance
|
||||
kwargs.update(constant_args)
|
||||
try:
|
||||
oneof_instance = oneof_class(**kwargs)
|
||||
break
|
||||
oneof_instances.append(oneof_instance)
|
||||
except Exception:
|
||||
pass
|
||||
if oneof_instance is None:
|
||||
if len(oneof_instances) == 0:
|
||||
raise ApiValueError(
|
||||
"Invalid inputs given to generate an instance of %s. Unable to "
|
||||
"make any instances of the classes in oneOf definition." %
|
||||
"Invalid inputs given to generate an instance of %s. None "
|
||||
"of the oneOf schemas matched the input data." %
|
||||
self.__class__.__name__
|
||||
)
|
||||
return oneof_instance
|
||||
elif len(oneof_instances) > 1:
|
||||
raise ApiValueError(
|
||||
"Invalid inputs given to generate an instance of %s. Multiple "
|
||||
"oneOf schemas matched the inputs, but a max of one is allowed." %
|
||||
self.__class__.__name__
|
||||
)
|
||||
return oneof_instances[0]
|
||||
|
||||
|
||||
def get_anyof_instances(self, model_args, constant_args):
|
||||
@@ -1265,6 +1313,10 @@ def get_anyof_instances(self, model_args, constant_args):
|
||||
if var_name in fixed_model_args:
|
||||
kwargs[var_name] = fixed_model_args[var_name]
|
||||
|
||||
# do not try to make a model with no input args
|
||||
if len(kwargs) == 0:
|
||||
continue
|
||||
|
||||
# and use it to make the instance
|
||||
kwargs.update(constant_args)
|
||||
try:
|
||||
@@ -1274,8 +1326,8 @@ def get_anyof_instances(self, model_args, constant_args):
|
||||
pass
|
||||
if len(anyof_instances) == 0:
|
||||
raise ApiValueError(
|
||||
"Invalid inputs given to generate an instance of %s. Unable to "
|
||||
"make any instances of the classes in anyOf definition." %
|
||||
"Invalid inputs given to generate an instance of %s. None of the "
|
||||
"anyOf schemas matched the inputs." %
|
||||
self.__class__.__name__
|
||||
)
|
||||
return anyof_instances
|
||||
@@ -1326,10 +1378,18 @@ def get_unused_args(self, composed_instances, model_args):
|
||||
|
||||
def validate_get_composed_info(constant_args, model_args, self):
|
||||
"""
|
||||
For composed schemas/classes, validates the classes to make sure that
|
||||
they do not share any of the same parameters. If there is no collision
|
||||
then composed model instances are created and returned tot the calling
|
||||
self model
|
||||
For composed schemas, generate schema instances for
|
||||
all schemas in the oneOf/anyOf/allOf definition. If additional
|
||||
properties are allowed, also assign those properties on
|
||||
all matched schemas that contain additionalProperties.
|
||||
Openapi schemas are python classes.
|
||||
|
||||
Exceptions are raised if:
|
||||
- no oneOf schema matches the model_args input data
|
||||
- > 1 oneOf schema matches the model_args input data
|
||||
- > 1 oneOf schema matches the model_args input data
|
||||
- no anyOf schema matches the model_args input data
|
||||
- any of the allOf schemas do not match the model_args input data
|
||||
|
||||
Args:
|
||||
constant_args (dict): these are the args that every model requires
|
||||
@@ -1371,16 +1431,16 @@ def validate_get_composed_info(constant_args, model_args, self):
|
||||
|
||||
# set any remaining values
|
||||
unused_args = get_unused_args(self, composed_instances, model_args)
|
||||
if len(unused_args) > 0:
|
||||
if len(additional_properties_model_instances) == 0:
|
||||
raise ApiValueError(
|
||||
"Invalid input arguments input when making an instance of "
|
||||
"class %s. Not all inputs were used. The unused input data "
|
||||
"is %s" % (self.__class__.__name__, unused_args)
|
||||
)
|
||||
for var_name, var_value in six.iteritems(unused_args):
|
||||
for instance in additional_properties_model_instances:
|
||||
setattr(instance, var_name, var_value)
|
||||
if len(unused_args) > 0 and \
|
||||
len(additional_properties_model_instances) == 0 and \
|
||||
(self._configuration is None or
|
||||
not self._configuration.discard_unknown_keys):
|
||||
raise ApiValueError(
|
||||
"Invalid input arguments input when making an instance of "
|
||||
"class %s. Not all inputs were used. The unused input data "
|
||||
"is %s" % (self.__class__.__name__, unused_args)
|
||||
)
|
||||
|
||||
# no need to add additional_properties to var_name_to_model_instances here
|
||||
# because additional_properties_model_instances will direct us to that
|
||||
# instance when we use getattr or setattr
|
||||
@@ -1389,5 +1449,6 @@ def validate_get_composed_info(constant_args, model_args, self):
|
||||
return [
|
||||
composed_instances,
|
||||
var_name_to_model_instances,
|
||||
additional_properties_model_instances
|
||||
additional_properties_model_instances,
|
||||
unused_args
|
||||
]
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class AdditionalPropertiesAnyType(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""additional_properties_any_type.AdditionalPropertiesAnyType - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class AdditionalPropertiesAnyType(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class AdditionalPropertiesArray(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""additional_properties_array.AdditionalPropertiesArray - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class AdditionalPropertiesArray(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class AdditionalPropertiesBoolean(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""additional_properties_boolean.AdditionalPropertiesBoolean - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class AdditionalPropertiesBoolean(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -119,7 +120,6 @@ class AdditionalPropertiesClass(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""additional_properties_class.AdditionalPropertiesClass - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -154,4 +154,10 @@ class AdditionalPropertiesClass(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class AdditionalPropertiesInteger(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""additional_properties_integer.AdditionalPropertiesInteger - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class AdditionalPropertiesInteger(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class AdditionalPropertiesNumber(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""additional_properties_number.AdditionalPropertiesNumber - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class AdditionalPropertiesNumber(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class AdditionalPropertiesObject(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""additional_properties_object.AdditionalPropertiesObject - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class AdditionalPropertiesObject(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class AdditionalPropertiesString(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""additional_properties_string.AdditionalPropertiesString - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class AdditionalPropertiesString(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -144,6 +145,12 @@ class Animal(ModelNormal):
|
||||
|
||||
self.class_name = class_name
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -103,7 +104,6 @@ class ApiResponse(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""api_response.ApiResponse - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -130,4 +130,10 @@ class ApiResponse(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class ArrayOfArrayOfNumberOnly(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""array_of_array_of_number_only.ArrayOfArrayOfNumberOnly - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class ArrayOfArrayOfNumberOnly(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class ArrayOfNumberOnly(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""array_of_number_only.ArrayOfNumberOnly - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class ArrayOfNumberOnly(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -108,7 +109,6 @@ class ArrayTest(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""array_test.ArrayTest - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -135,4 +135,10 @@ class ArrayTest(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -109,7 +110,6 @@ class Capitalization(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""capitalization.Capitalization - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -139,4 +139,10 @@ class Capitalization(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -145,18 +146,33 @@ class Cat(ModelComposed):
|
||||
'_from_server': _from_server,
|
||||
'_configuration': _configuration,
|
||||
}
|
||||
model_args = {
|
||||
required_args = {
|
||||
'class_name': class_name,
|
||||
}
|
||||
# remove args whose value is Null because they are unset
|
||||
required_arg_names = list(required_args.keys())
|
||||
for required_arg_name in required_arg_names:
|
||||
if required_args[required_arg_name] is nulltype.Null:
|
||||
del required_args[required_arg_name]
|
||||
model_args = {}
|
||||
model_args.update(required_args)
|
||||
model_args.update(kwargs)
|
||||
composed_info = validate_get_composed_info(
|
||||
constant_args, model_args, self)
|
||||
self._composed_instances = composed_info[0]
|
||||
self._var_name_to_model_instances = composed_info[1]
|
||||
self._additional_properties_model_instances = composed_info[2]
|
||||
unused_args = composed_info[3]
|
||||
|
||||
self.class_name = class_name
|
||||
for var_name, var_value in required_args.items():
|
||||
setattr(self, var_name, var_value)
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name in unused_args and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
not self._additional_properties_model_instances:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class CatAllOf(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""cat_all_of.CatAllOf - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class CatAllOf(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -104,7 +105,7 @@ class Category(ModelNormal):
|
||||
Args:
|
||||
|
||||
Keyword Args:
|
||||
name (str): defaults to 'default-name', must be one of ['default-name'] # noqa: E501
|
||||
name (str): defaults to 'default-name' # noqa: E501
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
raised if the wrong type is input.
|
||||
@@ -129,4 +130,10 @@ class Category(ModelNormal):
|
||||
|
||||
self.name = name
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -83,9 +84,9 @@ class Child(ModelComposed):
|
||||
and the value is attribute type.
|
||||
"""
|
||||
return {
|
||||
'inter_net': (bool,), # noqa: E501
|
||||
'radio_waves': (bool,), # noqa: E501
|
||||
'tele_vision': (bool,), # noqa: E501
|
||||
'inter_net': (bool,), # noqa: E501
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
@@ -93,9 +94,9 @@ class Child(ModelComposed):
|
||||
return None
|
||||
|
||||
attribute_map = {
|
||||
'inter_net': 'interNet', # noqa: E501
|
||||
'radio_waves': 'radioWaves', # noqa: E501
|
||||
'tele_vision': 'teleVision', # noqa: E501
|
||||
'inter_net': 'interNet', # noqa: E501
|
||||
}
|
||||
|
||||
required_properties = set([
|
||||
@@ -112,7 +113,6 @@ class Child(ModelComposed):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""child.Child - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -127,9 +127,9 @@ class Child(ModelComposed):
|
||||
deserializing a file_type parameter.
|
||||
If passed, type conversion is attempted
|
||||
If omitted no type conversion is done.
|
||||
inter_net (bool): [optional] # noqa: E501
|
||||
radio_waves (bool): [optional] # noqa: E501
|
||||
tele_vision (bool): [optional] # noqa: E501
|
||||
inter_net (bool): [optional] # noqa: E501
|
||||
"""
|
||||
|
||||
self._data_store = {}
|
||||
@@ -144,16 +144,32 @@ class Child(ModelComposed):
|
||||
'_from_server': _from_server,
|
||||
'_configuration': _configuration,
|
||||
}
|
||||
model_args = {
|
||||
required_args = {
|
||||
}
|
||||
# remove args whose value is Null because they are unset
|
||||
required_arg_names = list(required_args.keys())
|
||||
for required_arg_name in required_arg_names:
|
||||
if required_args[required_arg_name] is nulltype.Null:
|
||||
del required_args[required_arg_name]
|
||||
model_args = {}
|
||||
model_args.update(required_args)
|
||||
model_args.update(kwargs)
|
||||
composed_info = validate_get_composed_info(
|
||||
constant_args, model_args, self)
|
||||
self._composed_instances = composed_info[0]
|
||||
self._var_name_to_model_instances = composed_info[1]
|
||||
self._additional_properties_model_instances = composed_info[2]
|
||||
unused_args = composed_info[3]
|
||||
|
||||
for var_name, var_value in required_args.items():
|
||||
setattr(self, var_name, var_value)
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name in unused_args and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
not self._additional_properties_model_instances:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class ChildAllOf(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""child_all_of.ChildAllOf - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class ChildAllOf(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -142,18 +143,33 @@ class ChildCat(ModelComposed):
|
||||
'_from_server': _from_server,
|
||||
'_configuration': _configuration,
|
||||
}
|
||||
model_args = {
|
||||
required_args = {
|
||||
'pet_type': pet_type,
|
||||
}
|
||||
# remove args whose value is Null because they are unset
|
||||
required_arg_names = list(required_args.keys())
|
||||
for required_arg_name in required_arg_names:
|
||||
if required_args[required_arg_name] is nulltype.Null:
|
||||
del required_args[required_arg_name]
|
||||
model_args = {}
|
||||
model_args.update(required_args)
|
||||
model_args.update(kwargs)
|
||||
composed_info = validate_get_composed_info(
|
||||
constant_args, model_args, self)
|
||||
self._composed_instances = composed_info[0]
|
||||
self._var_name_to_model_instances = composed_info[1]
|
||||
self._additional_properties_model_instances = composed_info[2]
|
||||
unused_args = composed_info[3]
|
||||
|
||||
self.pet_type = pet_type
|
||||
for var_name, var_value in required_args.items():
|
||||
setattr(self, var_name, var_value)
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name in unused_args and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
not self._additional_properties_model_instances:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class ChildCatAllOf(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""child_cat_all_of.ChildCatAllOf - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class ChildCatAllOf(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -142,18 +143,33 @@ class ChildDog(ModelComposed):
|
||||
'_from_server': _from_server,
|
||||
'_configuration': _configuration,
|
||||
}
|
||||
model_args = {
|
||||
required_args = {
|
||||
'pet_type': pet_type,
|
||||
}
|
||||
# remove args whose value is Null because they are unset
|
||||
required_arg_names = list(required_args.keys())
|
||||
for required_arg_name in required_arg_names:
|
||||
if required_args[required_arg_name] is nulltype.Null:
|
||||
del required_args[required_arg_name]
|
||||
model_args = {}
|
||||
model_args.update(required_args)
|
||||
model_args.update(kwargs)
|
||||
composed_info = validate_get_composed_info(
|
||||
constant_args, model_args, self)
|
||||
self._composed_instances = composed_info[0]
|
||||
self._var_name_to_model_instances = composed_info[1]
|
||||
self._additional_properties_model_instances = composed_info[2]
|
||||
unused_args = composed_info[3]
|
||||
|
||||
self.pet_type = pet_type
|
||||
for var_name, var_value in required_args.items():
|
||||
setattr(self, var_name, var_value)
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name in unused_args and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
not self._additional_properties_model_instances:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class ChildDogAllOf(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""child_dog_all_of.ChildDogAllOf - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class ChildDogAllOf(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -142,18 +143,33 @@ class ChildLizard(ModelComposed):
|
||||
'_from_server': _from_server,
|
||||
'_configuration': _configuration,
|
||||
}
|
||||
model_args = {
|
||||
required_args = {
|
||||
'pet_type': pet_type,
|
||||
}
|
||||
# remove args whose value is Null because they are unset
|
||||
required_arg_names = list(required_args.keys())
|
||||
for required_arg_name in required_arg_names:
|
||||
if required_args[required_arg_name] is nulltype.Null:
|
||||
del required_args[required_arg_name]
|
||||
model_args = {}
|
||||
model_args.update(required_args)
|
||||
model_args.update(kwargs)
|
||||
composed_info = validate_get_composed_info(
|
||||
constant_args, model_args, self)
|
||||
self._composed_instances = composed_info[0]
|
||||
self._var_name_to_model_instances = composed_info[1]
|
||||
self._additional_properties_model_instances = composed_info[2]
|
||||
unused_args = composed_info[3]
|
||||
|
||||
self.pet_type = pet_type
|
||||
for var_name, var_value in required_args.items():
|
||||
setattr(self, var_name, var_value)
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name in unused_args and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
not self._additional_properties_model_instances:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class ChildLizardAllOf(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""child_lizard_all_of.ChildLizardAllOf - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class ChildLizardAllOf(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class ClassModel(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""class_model.ClassModel - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class ClassModel(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class Client(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""client.Client - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class Client(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -145,18 +146,33 @@ class Dog(ModelComposed):
|
||||
'_from_server': _from_server,
|
||||
'_configuration': _configuration,
|
||||
}
|
||||
model_args = {
|
||||
required_args = {
|
||||
'class_name': class_name,
|
||||
}
|
||||
# remove args whose value is Null because they are unset
|
||||
required_arg_names = list(required_args.keys())
|
||||
for required_arg_name in required_arg_names:
|
||||
if required_args[required_arg_name] is nulltype.Null:
|
||||
del required_args[required_arg_name]
|
||||
model_args = {}
|
||||
model_args.update(required_args)
|
||||
model_args.update(kwargs)
|
||||
composed_info = validate_get_composed_info(
|
||||
constant_args, model_args, self)
|
||||
self._composed_instances = composed_info[0]
|
||||
self._var_name_to_model_instances = composed_info[1]
|
||||
self._additional_properties_model_instances = composed_info[2]
|
||||
unused_args = composed_info[3]
|
||||
|
||||
self.class_name = class_name
|
||||
for var_name, var_value in required_args.items():
|
||||
setattr(self, var_name, var_value)
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name in unused_args and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
not self._additional_properties_model_instances:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class DogAllOf(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""dog_all_of.DogAllOf - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class DogAllOf(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -109,7 +110,6 @@ class EnumArrays(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""enum_arrays.EnumArrays - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -135,4 +135,10 @@ class EnumArrays(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,7 @@ class EnumClass(ModelSimple):
|
||||
Args:
|
||||
|
||||
Keyword Args:
|
||||
value (str): defaults to '-efg', must be one of ['-efg'] # noqa: E501
|
||||
value (str): defaults to '-efg', must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
raised if the wrong type is input.
|
||||
@@ -123,4 +124,10 @@ class EnumClass(ModelSimple):
|
||||
|
||||
self.value = value
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -161,4 +162,10 @@ class EnumTest(ModelNormal):
|
||||
|
||||
self.enum_string_required = enum_string_required
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class File(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""file.File - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class File(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -106,7 +107,6 @@ class FileSchemaTestClass(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""file_schema_test_class.FileSchemaTestClass - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -132,4 +132,10 @@ class FileSchemaTestClass(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -200,4 +201,10 @@ class FormatTest(ModelNormal):
|
||||
self.date = date
|
||||
self.password = password
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class Grandparent(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""grandparent.Grandparent - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class Grandparent(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -126,4 +127,10 @@ class GrandparentAnimal(ModelNormal):
|
||||
|
||||
self.pet_type = pet_type
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -101,7 +102,6 @@ class HasOnlyReadOnly(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""has_only_read_only.HasOnlyReadOnly - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -127,4 +127,10 @@ class HasOnlyReadOnly(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class List(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""list.List - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class List(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -114,7 +115,6 @@ class MapTest(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""map_test.MapTest - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -142,4 +142,10 @@ class MapTest(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -108,7 +109,6 @@ class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -135,4 +135,10 @@ class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -101,7 +102,6 @@ class Model200Response(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""model200_response.Model200Response - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -127,4 +127,10 @@ class Model200Response(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class ModelReturn(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""model_return.ModelReturn - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class ModelReturn(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -135,4 +136,10 @@ class Name(ModelNormal):
|
||||
|
||||
self.name = name
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class NumberOnly(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""number_only.NumberOnly - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class NumberOnly(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -114,7 +115,6 @@ class Order(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""order.Order - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -144,4 +144,10 @@ class Order(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -108,7 +109,6 @@ class OuterComposite(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""outer_composite.OuterComposite - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -135,4 +135,10 @@ class OuterComposite(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -123,4 +124,10 @@ class OuterEnum(ModelSimple):
|
||||
|
||||
self.value = value
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -122,4 +123,10 @@ class OuterNumber(ModelSimple):
|
||||
|
||||
self.value = value
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -83,8 +84,8 @@ class Parent(ModelComposed):
|
||||
and the value is attribute type.
|
||||
"""
|
||||
return {
|
||||
'radio_waves': (bool,), # noqa: E501
|
||||
'tele_vision': (bool,), # noqa: E501
|
||||
'radio_waves': (bool,), # noqa: E501
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
@@ -92,8 +93,8 @@ class Parent(ModelComposed):
|
||||
return None
|
||||
|
||||
attribute_map = {
|
||||
'radio_waves': 'radioWaves', # noqa: E501
|
||||
'tele_vision': 'teleVision', # noqa: E501
|
||||
'radio_waves': 'radioWaves', # noqa: E501
|
||||
}
|
||||
|
||||
required_properties = set([
|
||||
@@ -110,7 +111,6 @@ class Parent(ModelComposed):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""parent.Parent - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -125,8 +125,8 @@ class Parent(ModelComposed):
|
||||
deserializing a file_type parameter.
|
||||
If passed, type conversion is attempted
|
||||
If omitted no type conversion is done.
|
||||
radio_waves (bool): [optional] # noqa: E501
|
||||
tele_vision (bool): [optional] # noqa: E501
|
||||
radio_waves (bool): [optional] # noqa: E501
|
||||
"""
|
||||
|
||||
self._data_store = {}
|
||||
@@ -141,16 +141,32 @@ class Parent(ModelComposed):
|
||||
'_from_server': _from_server,
|
||||
'_configuration': _configuration,
|
||||
}
|
||||
model_args = {
|
||||
required_args = {
|
||||
}
|
||||
# remove args whose value is Null because they are unset
|
||||
required_arg_names = list(required_args.keys())
|
||||
for required_arg_name in required_arg_names:
|
||||
if required_args[required_arg_name] is nulltype.Null:
|
||||
del required_args[required_arg_name]
|
||||
model_args = {}
|
||||
model_args.update(required_args)
|
||||
model_args.update(kwargs)
|
||||
composed_info = validate_get_composed_info(
|
||||
constant_args, model_args, self)
|
||||
self._composed_instances = composed_info[0]
|
||||
self._var_name_to_model_instances = composed_info[1]
|
||||
self._additional_properties_model_instances = composed_info[2]
|
||||
unused_args = composed_info[3]
|
||||
|
||||
for var_name, var_value in required_args.items():
|
||||
setattr(self, var_name, var_value)
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name in unused_args and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
not self._additional_properties_model_instances:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class ParentAllOf(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""parent_all_of.ParentAllOf - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class ParentAllOf(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -155,18 +156,33 @@ class ParentPet(ModelComposed):
|
||||
'_from_server': _from_server,
|
||||
'_configuration': _configuration,
|
||||
}
|
||||
model_args = {
|
||||
required_args = {
|
||||
'pet_type': pet_type,
|
||||
}
|
||||
# remove args whose value is Null because they are unset
|
||||
required_arg_names = list(required_args.keys())
|
||||
for required_arg_name in required_arg_names:
|
||||
if required_args[required_arg_name] is nulltype.Null:
|
||||
del required_args[required_arg_name]
|
||||
model_args = {}
|
||||
model_args.update(required_args)
|
||||
model_args.update(kwargs)
|
||||
composed_info = validate_get_composed_info(
|
||||
constant_args, model_args, self)
|
||||
self._composed_instances = composed_info[0]
|
||||
self._var_name_to_model_instances = composed_info[1]
|
||||
self._additional_properties_model_instances = composed_info[2]
|
||||
unused_args = composed_info[3]
|
||||
|
||||
self.pet_type = pet_type
|
||||
for var_name, var_value in required_args.items():
|
||||
setattr(self, var_name, var_value)
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name in unused_args and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
not self._additional_properties_model_instances:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -157,4 +158,10 @@ class Pet(ModelNormal):
|
||||
self.name = name
|
||||
self.photo_urls = photo_urls
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -129,4 +130,10 @@ class Player(ModelNormal):
|
||||
|
||||
self.name = name
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -101,7 +102,6 @@ class ReadOnlyFirst(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""read_only_first.ReadOnlyFirst - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -127,4 +127,10 @@ class ReadOnlyFirst(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -99,7 +100,6 @@ class SpecialModelName(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""special_model_name.SpecialModelName - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -124,4 +124,10 @@ class SpecialModelName(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -97,7 +98,6 @@ class StringBooleanMap(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""string_boolean_map.StringBooleanMap - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -121,4 +121,10 @@ class StringBooleanMap(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -103,7 +104,6 @@ class Tag(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""tag.Tag - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -130,4 +130,10 @@ class Tag(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -115,10 +116,10 @@ class TypeHolderDefault(ModelNormal):
|
||||
array_item ([int]):
|
||||
|
||||
Keyword Args:
|
||||
string_item (str): defaults to 'what', must be one of ['what'] # noqa: E501
|
||||
number_item (float): defaults to 1.234, must be one of [1.234] # noqa: E501
|
||||
integer_item (int): defaults to -2, must be one of [-2] # noqa: E501
|
||||
bool_item (bool): defaults to True, must be one of [True] # noqa: E501
|
||||
string_item (str): defaults to 'what' # noqa: E501
|
||||
number_item (float): defaults to 1.234 # noqa: E501
|
||||
integer_item (int): defaults to -2 # noqa: E501
|
||||
bool_item (bool): defaults to True # noqa: E501
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
raised if the wrong type is input.
|
||||
@@ -148,4 +149,10 @@ class TypeHolderDefault(ModelNormal):
|
||||
self.bool_item = bool_item
|
||||
self.array_item = array_item
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -121,9 +122,9 @@ class TypeHolderExample(ModelNormal):
|
||||
array_item ([int]):
|
||||
|
||||
Keyword Args:
|
||||
string_item (str): defaults to 'what', must be one of ['what'] # noqa: E501
|
||||
number_item (float): defaults to 1.234, must be one of [1.234] # noqa: E501
|
||||
integer_item (int): defaults to -2, must be one of [-2] # noqa: E501
|
||||
string_item (str): defaults to 'what', must be one of ["what", ] # noqa: E501
|
||||
number_item (float): defaults to 1.234, must be one of [1.234, ] # noqa: E501
|
||||
integer_item (int): defaults to -2, must be one of [-2, ] # noqa: E501
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
raised if the wrong type is input.
|
||||
@@ -151,4 +152,10 @@ class TypeHolderExample(ModelNormal):
|
||||
self.bool_item = bool_item
|
||||
self.array_item = array_item
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -113,7 +114,6 @@ class User(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""user.User - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -145,4 +145,10 @@ class User(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -15,6 +15,7 @@ import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
import six # noqa: F401
|
||||
import nulltype # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ModelComposed,
|
||||
@@ -155,7 +156,6 @@ class XmlItem(ModelNormal):
|
||||
def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501
|
||||
"""xml_item.XmlItem - a model defined in OpenAPI
|
||||
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
@@ -208,4 +208,10 @@ class XmlItem(ModelNormal):
|
||||
self._configuration = _configuration
|
||||
|
||||
for var_name, var_value in six.iteritems(kwargs):
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
nulltype
|
||||
certifi >= 14.05.14
|
||||
future; python_version<="2.7"
|
||||
six >= 1.10
|
||||
|
||||
@@ -26,6 +26,7 @@ REQUIRES = [
|
||||
"six >= 1.10",
|
||||
"certifi",
|
||||
"python-dateutil",
|
||||
"nulltype",
|
||||
]
|
||||
EXTRAS = {':python_version <= "2.7"': ['future']}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user