forked from loafle/openapi-generator-original
[python] Renames python generators (#7965)
* python->python-legacy, python-experimental->python * test with openjdk8 * test with openjdk11 * comment out rm * move kotlin tests to circleci * move kotlin tests * move tests to circleci * fix circleci * rearrange test * move tests * use wrapper Co-authored-by: Justin Black <justin.a.black@gmail.com>
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
# coding: utf-8
|
||||
|
||||
# flake8: noqa
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
__version__ = "1.0.0"
|
||||
|
||||
# import apis into sdk package
|
||||
from petstore_api.api.another_fake_api import AnotherFakeApi
|
||||
from petstore_api.api.fake_api import FakeApi
|
||||
from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api
|
||||
from petstore_api.api.pet_api import PetApi
|
||||
from petstore_api.api.store_api import StoreApi
|
||||
from petstore_api.api.user_api import UserApi
|
||||
|
||||
# import ApiClient
|
||||
from petstore_api.api_client import ApiClient
|
||||
from petstore_api.configuration import Configuration
|
||||
from petstore_api.exceptions import OpenApiException
|
||||
from petstore_api.exceptions import ApiTypeError
|
||||
from petstore_api.exceptions import ApiValueError
|
||||
from petstore_api.exceptions import ApiKeyError
|
||||
from petstore_api.exceptions import ApiAttributeError
|
||||
from petstore_api.exceptions import ApiException
|
||||
# import models into sdk package
|
||||
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
|
||||
from petstore_api.models.additional_properties_array import AdditionalPropertiesArray
|
||||
from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean
|
||||
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
|
||||
from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger
|
||||
from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber
|
||||
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
|
||||
from petstore_api.models.additional_properties_string import AdditionalPropertiesString
|
||||
from petstore_api.models.animal import Animal
|
||||
from petstore_api.models.api_response import ApiResponse
|
||||
from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
|
||||
from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
|
||||
from petstore_api.models.array_test import ArrayTest
|
||||
from petstore_api.models.big_cat import BigCat
|
||||
from petstore_api.models.big_cat_all_of import BigCatAllOf
|
||||
from petstore_api.models.capitalization import Capitalization
|
||||
from petstore_api.models.cat import Cat
|
||||
from petstore_api.models.cat_all_of import CatAllOf
|
||||
from petstore_api.models.category import Category
|
||||
from petstore_api.models.class_model import ClassModel
|
||||
from petstore_api.models.client import Client
|
||||
from petstore_api.models.dog import Dog
|
||||
from petstore_api.models.dog_all_of import DogAllOf
|
||||
from petstore_api.models.enum_arrays import EnumArrays
|
||||
from petstore_api.models.enum_class import EnumClass
|
||||
from petstore_api.models.enum_test import EnumTest
|
||||
from petstore_api.models.file import File
|
||||
from petstore_api.models.file_schema_test_class import FileSchemaTestClass
|
||||
from petstore_api.models.format_test import FormatTest
|
||||
from petstore_api.models.has_only_read_only import HasOnlyReadOnly
|
||||
from petstore_api.models.list import List
|
||||
from petstore_api.models.map_test import MapTest
|
||||
from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
|
||||
from petstore_api.models.model200_response import Model200Response
|
||||
from petstore_api.models.model_return import ModelReturn
|
||||
from petstore_api.models.name import Name
|
||||
from petstore_api.models.number_only import NumberOnly
|
||||
from petstore_api.models.order import Order
|
||||
from petstore_api.models.outer_composite import OuterComposite
|
||||
from petstore_api.models.outer_enum import OuterEnum
|
||||
from petstore_api.models.pet import Pet
|
||||
from petstore_api.models.read_only_first import ReadOnlyFirst
|
||||
from petstore_api.models.special_model_name import SpecialModelName
|
||||
from petstore_api.models.tag import Tag
|
||||
from petstore_api.models.type_holder_default import TypeHolderDefault
|
||||
from petstore_api.models.type_holder_example import TypeHolderExample
|
||||
from petstore_api.models.user import User
|
||||
from petstore_api.models.xml_item import XmlItem
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
# flake8: noqa
|
||||
|
||||
# import apis into api package
|
||||
from petstore_api.api.another_fake_api import AnotherFakeApi
|
||||
from petstore_api.api.fake_api import FakeApi
|
||||
from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api
|
||||
from petstore_api.api.pet_api import PetApi
|
||||
from petstore_api.api.store_api import StoreApi
|
||||
from petstore_api.api.user_api import UserApi
|
||||
@@ -0,0 +1,176 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import re # noqa: F401
|
||||
|
||||
# python 2 and python 3 compatibility library
|
||||
import six
|
||||
|
||||
from petstore_api.api_client import ApiClient
|
||||
from petstore_api.exceptions import ( # noqa: F401
|
||||
ApiTypeError,
|
||||
ApiValueError
|
||||
)
|
||||
|
||||
|
||||
class AnotherFakeApi(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
def __init__(self, api_client=None):
|
||||
if api_client is None:
|
||||
api_client = ApiClient()
|
||||
self.api_client = api_client
|
||||
|
||||
def call_123_test_special_tags(self, body, **kwargs): # noqa: E501
|
||||
"""To test special tags # noqa: E501
|
||||
|
||||
To test special tags and operation ID starting with number # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
|
||||
>>> thread = api.call_123_test_special_tags(body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param body: client model (required)
|
||||
:type body: Client
|
||||
:param async_req: Whether to execute the request asynchronously.
|
||||
:type async_req: bool, optional
|
||||
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
||||
be returned without reading/decoding response
|
||||
data. Default is True.
|
||||
:type _preload_content: bool, optional
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:return: Returns the result object.
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
:rtype: Client
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
return self.call_123_test_special_tags_with_http_info(body, **kwargs) # noqa: E501
|
||||
|
||||
def call_123_test_special_tags_with_http_info(self, body, **kwargs): # noqa: E501
|
||||
"""To test special tags # noqa: E501
|
||||
|
||||
To test special tags and operation ID starting with number # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
|
||||
>>> thread = api.call_123_test_special_tags_with_http_info(body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param body: client model (required)
|
||||
:type body: Client
|
||||
:param async_req: Whether to execute the request asynchronously.
|
||||
:type async_req: bool, optional
|
||||
:param _return_http_data_only: response data without head status code
|
||||
and headers
|
||||
:type _return_http_data_only: bool, optional
|
||||
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
||||
be returned without reading/decoding response
|
||||
data. Default is True.
|
||||
:type _preload_content: bool, optional
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the authentication
|
||||
in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:return: Returns the result object.
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
:rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
|
||||
"""
|
||||
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = [
|
||||
'body'
|
||||
]
|
||||
all_params.extend(
|
||||
[
|
||||
'async_req',
|
||||
'_return_http_data_only',
|
||||
'_preload_content',
|
||||
'_request_timeout',
|
||||
'_request_auth'
|
||||
]
|
||||
)
|
||||
|
||||
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||
if key not in all_params:
|
||||
raise ApiTypeError(
|
||||
"Got an unexpected keyword argument '%s'"
|
||||
" to method call_123_test_special_tags" % key
|
||||
)
|
||||
local_var_params[key] = val
|
||||
del local_var_params['kwargs']
|
||||
# verify the required parameter 'body' is set
|
||||
if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
|
||||
local_var_params['body'] is None): # noqa: E501
|
||||
raise ApiValueError("Missing the required parameter `body` when calling `call_123_test_special_tags`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in local_var_params:
|
||||
body_params = local_var_params['body']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = [] # noqa: E501
|
||||
|
||||
response_types_map = {
|
||||
200: "Client",
|
||||
}
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/another-fake/dummy', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_types_map=response_types_map,
|
||||
auth_settings=auth_settings,
|
||||
async_req=local_var_params.get('async_req'),
|
||||
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||
_preload_content=local_var_params.get('_preload_content', True),
|
||||
_request_timeout=local_var_params.get('_request_timeout'),
|
||||
collection_formats=collection_formats,
|
||||
_request_auth=local_var_params.get('_request_auth'))
|
||||
2176
samples/client/petstore/python-legacy/petstore_api/api/fake_api.py
Normal file
2176
samples/client/petstore/python-legacy/petstore_api/api/fake_api.py
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,176 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import re # noqa: F401
|
||||
|
||||
# python 2 and python 3 compatibility library
|
||||
import six
|
||||
|
||||
from petstore_api.api_client import ApiClient
|
||||
from petstore_api.exceptions import ( # noqa: F401
|
||||
ApiTypeError,
|
||||
ApiValueError
|
||||
)
|
||||
|
||||
|
||||
class FakeClassnameTags123Api(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
def __init__(self, api_client=None):
|
||||
if api_client is None:
|
||||
api_client = ApiClient()
|
||||
self.api_client = api_client
|
||||
|
||||
def test_classname(self, body, **kwargs): # noqa: E501
|
||||
"""To test class name in snake case # noqa: E501
|
||||
|
||||
To test class name in snake case # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
|
||||
>>> thread = api.test_classname(body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param body: client model (required)
|
||||
:type body: Client
|
||||
:param async_req: Whether to execute the request asynchronously.
|
||||
:type async_req: bool, optional
|
||||
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
||||
be returned without reading/decoding response
|
||||
data. Default is True.
|
||||
:type _preload_content: bool, optional
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:return: Returns the result object.
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
:rtype: Client
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
return self.test_classname_with_http_info(body, **kwargs) # noqa: E501
|
||||
|
||||
def test_classname_with_http_info(self, body, **kwargs): # noqa: E501
|
||||
"""To test class name in snake case # noqa: E501
|
||||
|
||||
To test class name in snake case # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
|
||||
>>> thread = api.test_classname_with_http_info(body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param body: client model (required)
|
||||
:type body: Client
|
||||
:param async_req: Whether to execute the request asynchronously.
|
||||
:type async_req: bool, optional
|
||||
:param _return_http_data_only: response data without head status code
|
||||
and headers
|
||||
:type _return_http_data_only: bool, optional
|
||||
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
||||
be returned without reading/decoding response
|
||||
data. Default is True.
|
||||
:type _preload_content: bool, optional
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the authentication
|
||||
in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:return: Returns the result object.
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
:rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
|
||||
"""
|
||||
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = [
|
||||
'body'
|
||||
]
|
||||
all_params.extend(
|
||||
[
|
||||
'async_req',
|
||||
'_return_http_data_only',
|
||||
'_preload_content',
|
||||
'_request_timeout',
|
||||
'_request_auth'
|
||||
]
|
||||
)
|
||||
|
||||
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||
if key not in all_params:
|
||||
raise ApiTypeError(
|
||||
"Got an unexpected keyword argument '%s'"
|
||||
" to method test_classname" % key
|
||||
)
|
||||
local_var_params[key] = val
|
||||
del local_var_params['kwargs']
|
||||
# verify the required parameter 'body' is set
|
||||
if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
|
||||
local_var_params['body'] is None): # noqa: E501
|
||||
raise ApiValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in local_var_params:
|
||||
body_params = local_var_params['body']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['api_key_query'] # noqa: E501
|
||||
|
||||
response_types_map = {
|
||||
200: "Client",
|
||||
}
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/fake_classname_test', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_types_map=response_types_map,
|
||||
auth_settings=auth_settings,
|
||||
async_req=local_var_params.get('async_req'),
|
||||
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||
_preload_content=local_var_params.get('_preload_content', True),
|
||||
_request_timeout=local_var_params.get('_request_timeout'),
|
||||
collection_formats=collection_formats,
|
||||
_request_auth=local_var_params.get('_request_auth'))
|
||||
1295
samples/client/petstore/python-legacy/petstore_api/api/pet_api.py
Normal file
1295
samples/client/petstore/python-legacy/petstore_api/api/pet_api.py
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,565 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import re # noqa: F401
|
||||
|
||||
# python 2 and python 3 compatibility library
|
||||
import six
|
||||
|
||||
from petstore_api.api_client import ApiClient
|
||||
from petstore_api.exceptions import ( # noqa: F401
|
||||
ApiTypeError,
|
||||
ApiValueError
|
||||
)
|
||||
|
||||
|
||||
class StoreApi(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
def __init__(self, api_client=None):
|
||||
if api_client is None:
|
||||
api_client = ApiClient()
|
||||
self.api_client = api_client
|
||||
|
||||
def delete_order(self, order_id, **kwargs): # noqa: E501
|
||||
"""Delete purchase order by ID # noqa: E501
|
||||
|
||||
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
|
||||
>>> thread = api.delete_order(order_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param order_id: ID of the order that needs to be deleted (required)
|
||||
:type order_id: str
|
||||
:param async_req: Whether to execute the request asynchronously.
|
||||
:type async_req: bool, optional
|
||||
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
||||
be returned without reading/decoding response
|
||||
data. Default is True.
|
||||
:type _preload_content: bool, optional
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:return: Returns the result object.
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
:rtype: None
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501
|
||||
|
||||
def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501
|
||||
"""Delete purchase order by ID # noqa: E501
|
||||
|
||||
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
|
||||
>>> thread = api.delete_order_with_http_info(order_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param order_id: ID of the order that needs to be deleted (required)
|
||||
:type order_id: str
|
||||
:param async_req: Whether to execute the request asynchronously.
|
||||
:type async_req: bool, optional
|
||||
:param _return_http_data_only: response data without head status code
|
||||
and headers
|
||||
:type _return_http_data_only: bool, optional
|
||||
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
||||
be returned without reading/decoding response
|
||||
data. Default is True.
|
||||
:type _preload_content: bool, optional
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the authentication
|
||||
in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:return: Returns the result object.
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
:rtype: None
|
||||
"""
|
||||
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = [
|
||||
'order_id'
|
||||
]
|
||||
all_params.extend(
|
||||
[
|
||||
'async_req',
|
||||
'_return_http_data_only',
|
||||
'_preload_content',
|
||||
'_request_timeout',
|
||||
'_request_auth'
|
||||
]
|
||||
)
|
||||
|
||||
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||
if key not in all_params:
|
||||
raise ApiTypeError(
|
||||
"Got an unexpected keyword argument '%s'"
|
||||
" to method delete_order" % key
|
||||
)
|
||||
local_var_params[key] = val
|
||||
del local_var_params['kwargs']
|
||||
# verify the required parameter 'order_id' is set
|
||||
if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501
|
||||
local_var_params['order_id'] is None): # noqa: E501
|
||||
raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'order_id' in local_var_params:
|
||||
path_params['order_id'] = local_var_params['order_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
# Authentication setting
|
||||
auth_settings = [] # noqa: E501
|
||||
|
||||
response_types_map = {}
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/store/order/{order_id}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_types_map=response_types_map,
|
||||
auth_settings=auth_settings,
|
||||
async_req=local_var_params.get('async_req'),
|
||||
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||
_preload_content=local_var_params.get('_preload_content', True),
|
||||
_request_timeout=local_var_params.get('_request_timeout'),
|
||||
collection_formats=collection_formats,
|
||||
_request_auth=local_var_params.get('_request_auth'))
|
||||
|
||||
def get_inventory(self, **kwargs): # noqa: E501
|
||||
"""Returns pet inventories by status # noqa: E501
|
||||
|
||||
Returns a map of status codes to quantities # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
|
||||
>>> thread = api.get_inventory(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req: Whether to execute the request asynchronously.
|
||||
:type async_req: bool, optional
|
||||
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
||||
be returned without reading/decoding response
|
||||
data. Default is True.
|
||||
:type _preload_content: bool, optional
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:return: Returns the result object.
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
:rtype: dict(str, int)
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
return self.get_inventory_with_http_info(**kwargs) # noqa: E501
|
||||
|
||||
def get_inventory_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Returns pet inventories by status # noqa: E501
|
||||
|
||||
Returns a map of status codes to quantities # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
|
||||
>>> thread = api.get_inventory_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req: Whether to execute the request asynchronously.
|
||||
:type async_req: bool, optional
|
||||
:param _return_http_data_only: response data without head status code
|
||||
and headers
|
||||
:type _return_http_data_only: bool, optional
|
||||
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
||||
be returned without reading/decoding response
|
||||
data. Default is True.
|
||||
:type _preload_content: bool, optional
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the authentication
|
||||
in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:return: Returns the result object.
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
:rtype: tuple(dict(str, int), status_code(int), headers(HTTPHeaderDict))
|
||||
"""
|
||||
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = [
|
||||
]
|
||||
all_params.extend(
|
||||
[
|
||||
'async_req',
|
||||
'_return_http_data_only',
|
||||
'_preload_content',
|
||||
'_request_timeout',
|
||||
'_request_auth'
|
||||
]
|
||||
)
|
||||
|
||||
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||
if key not in all_params:
|
||||
raise ApiTypeError(
|
||||
"Got an unexpected keyword argument '%s'"
|
||||
" to method get_inventory" % key
|
||||
)
|
||||
local_var_params[key] = val
|
||||
del local_var_params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/json']) # noqa: E501
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['api_key'] # noqa: E501
|
||||
|
||||
response_types_map = {
|
||||
200: "dict(str, int)",
|
||||
}
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/store/inventory', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_types_map=response_types_map,
|
||||
auth_settings=auth_settings,
|
||||
async_req=local_var_params.get('async_req'),
|
||||
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||
_preload_content=local_var_params.get('_preload_content', True),
|
||||
_request_timeout=local_var_params.get('_request_timeout'),
|
||||
collection_formats=collection_formats,
|
||||
_request_auth=local_var_params.get('_request_auth'))
|
||||
|
||||
def get_order_by_id(self, order_id, **kwargs): # noqa: E501
|
||||
"""Find purchase order by ID # noqa: E501
|
||||
|
||||
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
|
||||
>>> thread = api.get_order_by_id(order_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param order_id: ID of pet that needs to be fetched (required)
|
||||
:type order_id: int
|
||||
:param async_req: Whether to execute the request asynchronously.
|
||||
:type async_req: bool, optional
|
||||
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
||||
be returned without reading/decoding response
|
||||
data. Default is True.
|
||||
:type _preload_content: bool, optional
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:return: Returns the result object.
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
:rtype: Order
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501
|
||||
|
||||
def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501
|
||||
"""Find purchase order by ID # noqa: E501
|
||||
|
||||
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
|
||||
>>> thread = api.get_order_by_id_with_http_info(order_id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param order_id: ID of pet that needs to be fetched (required)
|
||||
:type order_id: int
|
||||
:param async_req: Whether to execute the request asynchronously.
|
||||
:type async_req: bool, optional
|
||||
:param _return_http_data_only: response data without head status code
|
||||
and headers
|
||||
:type _return_http_data_only: bool, optional
|
||||
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
||||
be returned without reading/decoding response
|
||||
data. Default is True.
|
||||
:type _preload_content: bool, optional
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the authentication
|
||||
in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:return: Returns the result object.
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
:rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict))
|
||||
"""
|
||||
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = [
|
||||
'order_id'
|
||||
]
|
||||
all_params.extend(
|
||||
[
|
||||
'async_req',
|
||||
'_return_http_data_only',
|
||||
'_preload_content',
|
||||
'_request_timeout',
|
||||
'_request_auth'
|
||||
]
|
||||
)
|
||||
|
||||
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||
if key not in all_params:
|
||||
raise ApiTypeError(
|
||||
"Got an unexpected keyword argument '%s'"
|
||||
" to method get_order_by_id" % key
|
||||
)
|
||||
local_var_params[key] = val
|
||||
del local_var_params['kwargs']
|
||||
# verify the required parameter 'order_id' is set
|
||||
if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501
|
||||
local_var_params['order_id'] is None): # noqa: E501
|
||||
raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501
|
||||
|
||||
if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501
|
||||
raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`") # noqa: E501
|
||||
if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] < 1: # noqa: E501
|
||||
raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`") # noqa: E501
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'order_id' in local_var_params:
|
||||
path_params['order_id'] = local_var_params['order_id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/xml', 'application/json']) # noqa: E501
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = [] # noqa: E501
|
||||
|
||||
response_types_map = {
|
||||
200: "Order",
|
||||
400: None,
|
||||
404: None,
|
||||
}
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/store/order/{order_id}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_types_map=response_types_map,
|
||||
auth_settings=auth_settings,
|
||||
async_req=local_var_params.get('async_req'),
|
||||
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||
_preload_content=local_var_params.get('_preload_content', True),
|
||||
_request_timeout=local_var_params.get('_request_timeout'),
|
||||
collection_formats=collection_formats,
|
||||
_request_auth=local_var_params.get('_request_auth'))
|
||||
|
||||
def place_order(self, body, **kwargs): # noqa: E501
|
||||
"""Place an order for a pet # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
|
||||
>>> thread = api.place_order(body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param body: order placed for purchasing the pet (required)
|
||||
:type body: Order
|
||||
:param async_req: Whether to execute the request asynchronously.
|
||||
:type async_req: bool, optional
|
||||
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
||||
be returned without reading/decoding response
|
||||
data. Default is True.
|
||||
:type _preload_content: bool, optional
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:return: Returns the result object.
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
:rtype: Order
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
return self.place_order_with_http_info(body, **kwargs) # noqa: E501
|
||||
|
||||
def place_order_with_http_info(self, body, **kwargs): # noqa: E501
|
||||
"""Place an order for a pet # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
|
||||
>>> thread = api.place_order_with_http_info(body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param body: order placed for purchasing the pet (required)
|
||||
:type body: Order
|
||||
:param async_req: Whether to execute the request asynchronously.
|
||||
:type async_req: bool, optional
|
||||
:param _return_http_data_only: response data without head status code
|
||||
and headers
|
||||
:type _return_http_data_only: bool, optional
|
||||
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
||||
be returned without reading/decoding response
|
||||
data. Default is True.
|
||||
:type _preload_content: bool, optional
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the authentication
|
||||
in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:return: Returns the result object.
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
:rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict))
|
||||
"""
|
||||
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = [
|
||||
'body'
|
||||
]
|
||||
all_params.extend(
|
||||
[
|
||||
'async_req',
|
||||
'_return_http_data_only',
|
||||
'_preload_content',
|
||||
'_request_timeout',
|
||||
'_request_auth'
|
||||
]
|
||||
)
|
||||
|
||||
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||
if key not in all_params:
|
||||
raise ApiTypeError(
|
||||
"Got an unexpected keyword argument '%s'"
|
||||
" to method place_order" % key
|
||||
)
|
||||
local_var_params[key] = val
|
||||
del local_var_params['kwargs']
|
||||
# verify the required parameter 'body' is set
|
||||
if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
|
||||
local_var_params['body'] is None): # noqa: E501
|
||||
raise ApiValueError("Missing the required parameter `body` when calling `place_order`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in local_var_params:
|
||||
body_params = local_var_params['body']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/xml', 'application/json']) # noqa: E501
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = [] # noqa: E501
|
||||
|
||||
response_types_map = {
|
||||
200: "Order",
|
||||
400: None,
|
||||
}
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/store/order', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_types_map=response_types_map,
|
||||
auth_settings=auth_settings,
|
||||
async_req=local_var_params.get('async_req'),
|
||||
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||
_preload_content=local_var_params.get('_preload_content', True),
|
||||
_request_timeout=local_var_params.get('_request_timeout'),
|
||||
collection_formats=collection_formats,
|
||||
_request_auth=local_var_params.get('_request_auth'))
|
||||
1085
samples/client/petstore/python-legacy/petstore_api/api/user_api.py
Normal file
1085
samples/client/petstore/python-legacy/petstore_api/api/user_api.py
Normal file
File diff suppressed because it is too large
Load Diff
693
samples/client/petstore/python-legacy/petstore_api/api_client.py
Normal file
693
samples/client/petstore/python-legacy/petstore_api/api_client.py
Normal file
@@ -0,0 +1,693 @@
|
||||
# coding: utf-8
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import atexit
|
||||
import datetime
|
||||
from dateutil.parser import parse
|
||||
import json
|
||||
import mimetypes
|
||||
from multiprocessing.pool import ThreadPool
|
||||
import os
|
||||
import re
|
||||
import tempfile
|
||||
|
||||
# python 2 and python 3 compatibility library
|
||||
import six
|
||||
from six.moves.urllib.parse import quote
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
import petstore_api.models
|
||||
from petstore_api import rest
|
||||
from petstore_api.exceptions import ApiValueError, ApiException
|
||||
|
||||
|
||||
class ApiClient(object):
|
||||
"""Generic API client for OpenAPI client library builds.
|
||||
|
||||
OpenAPI generic API client. This client handles the client-
|
||||
server communication, and is invariant across implementations. Specifics of
|
||||
the methods and models for each application are generated from the OpenAPI
|
||||
templates.
|
||||
|
||||
NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
Do not edit the class manually.
|
||||
|
||||
:param configuration: .Configuration object for this client
|
||||
:param header_name: a header to pass when making calls to the API.
|
||||
:param header_value: a header value to pass when making calls to
|
||||
the API.
|
||||
:param cookie: a cookie to include in the header when making calls
|
||||
to the API
|
||||
:param pool_threads: The number of threads to use for async requests
|
||||
to the API. More threads means more concurrent API requests.
|
||||
"""
|
||||
|
||||
PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types
|
||||
NATIVE_TYPES_MAPPING = {
|
||||
'int': int,
|
||||
'long': int if six.PY3 else long, # noqa: F821
|
||||
'float': float,
|
||||
'str': str,
|
||||
'bool': bool,
|
||||
'date': datetime.date,
|
||||
'datetime': datetime.datetime,
|
||||
'object': object,
|
||||
}
|
||||
_pool = None
|
||||
|
||||
def __init__(self, configuration=None, header_name=None, header_value=None,
|
||||
cookie=None, pool_threads=1):
|
||||
if configuration is None:
|
||||
configuration = Configuration.get_default_copy()
|
||||
self.configuration = configuration
|
||||
self.pool_threads = pool_threads
|
||||
|
||||
self.rest_client = rest.RESTClientObject(configuration)
|
||||
self.default_headers = {}
|
||||
if header_name is not None:
|
||||
self.default_headers[header_name] = header_value
|
||||
self.cookie = cookie
|
||||
# Set default User-Agent.
|
||||
self.user_agent = 'OpenAPI-Generator/1.0.0/python'
|
||||
self.client_side_validation = configuration.client_side_validation
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
self.close()
|
||||
|
||||
def close(self):
|
||||
if self._pool:
|
||||
self._pool.close()
|
||||
self._pool.join()
|
||||
self._pool = None
|
||||
if hasattr(atexit, 'unregister'):
|
||||
atexit.unregister(self.close)
|
||||
|
||||
@property
|
||||
def pool(self):
|
||||
"""Create thread pool on first request
|
||||
avoids instantiating unused threadpool for blocking clients.
|
||||
"""
|
||||
if self._pool is None:
|
||||
atexit.register(self.close)
|
||||
self._pool = ThreadPool(self.pool_threads)
|
||||
return self._pool
|
||||
|
||||
@property
|
||||
def user_agent(self):
|
||||
"""User agent for this API client"""
|
||||
return self.default_headers['User-Agent']
|
||||
|
||||
@user_agent.setter
|
||||
def user_agent(self, value):
|
||||
self.default_headers['User-Agent'] = value
|
||||
|
||||
def set_default_header(self, header_name, header_value):
|
||||
self.default_headers[header_name] = header_value
|
||||
|
||||
def __call_api(
|
||||
self, resource_path, method, path_params=None,
|
||||
query_params=None, header_params=None, body=None, post_params=None,
|
||||
files=None, response_types_map=None, auth_settings=None,
|
||||
_return_http_data_only=None, collection_formats=None,
|
||||
_preload_content=True, _request_timeout=None, _host=None,
|
||||
_request_auth=None):
|
||||
|
||||
config = self.configuration
|
||||
|
||||
# header parameters
|
||||
header_params = header_params or {}
|
||||
header_params.update(self.default_headers)
|
||||
if self.cookie:
|
||||
header_params['Cookie'] = self.cookie
|
||||
if header_params:
|
||||
header_params = self.sanitize_for_serialization(header_params)
|
||||
header_params = dict(self.parameters_to_tuples(header_params,
|
||||
collection_formats))
|
||||
|
||||
# path parameters
|
||||
if path_params:
|
||||
path_params = self.sanitize_for_serialization(path_params)
|
||||
path_params = self.parameters_to_tuples(path_params,
|
||||
collection_formats)
|
||||
for k, v in path_params:
|
||||
# specified safe chars, encode everything
|
||||
resource_path = resource_path.replace(
|
||||
'{%s}' % k,
|
||||
quote(str(v), safe=config.safe_chars_for_path_param)
|
||||
)
|
||||
|
||||
# query parameters
|
||||
if query_params:
|
||||
query_params = self.sanitize_for_serialization(query_params)
|
||||
query_params = self.parameters_to_tuples(query_params,
|
||||
collection_formats)
|
||||
|
||||
# post parameters
|
||||
if post_params or files:
|
||||
post_params = post_params if post_params else []
|
||||
post_params = self.sanitize_for_serialization(post_params)
|
||||
post_params = self.parameters_to_tuples(post_params,
|
||||
collection_formats)
|
||||
post_params.extend(self.files_parameters(files))
|
||||
|
||||
# auth setting
|
||||
self.update_params_for_auth(
|
||||
header_params, query_params, auth_settings,
|
||||
request_auth=_request_auth)
|
||||
|
||||
# body
|
||||
if body:
|
||||
body = self.sanitize_for_serialization(body)
|
||||
|
||||
# request url
|
||||
if _host is None:
|
||||
url = self.configuration.host + resource_path
|
||||
else:
|
||||
# use server/host defined in path or operation instead
|
||||
url = _host + resource_path
|
||||
|
||||
try:
|
||||
# perform request and return response
|
||||
response_data = self.request(
|
||||
method, url, query_params=query_params, headers=header_params,
|
||||
post_params=post_params, body=body,
|
||||
_preload_content=_preload_content,
|
||||
_request_timeout=_request_timeout)
|
||||
except ApiException as e:
|
||||
e.body = e.body.decode('utf-8') if six.PY3 else e.body
|
||||
raise e
|
||||
|
||||
self.last_response = response_data
|
||||
|
||||
return_data = response_data
|
||||
|
||||
if not _preload_content:
|
||||
return return_data
|
||||
|
||||
response_type = response_types_map.get(response_data.status, None)
|
||||
|
||||
if six.PY3 and response_type not in ["file", "bytes"]:
|
||||
match = None
|
||||
content_type = response_data.getheader('content-type')
|
||||
if content_type is not None:
|
||||
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type)
|
||||
encoding = match.group(1) if match else "utf-8"
|
||||
response_data.data = response_data.data.decode(encoding)
|
||||
|
||||
# deserialize response data
|
||||
|
||||
if response_type:
|
||||
return_data = self.deserialize(response_data, response_type)
|
||||
else:
|
||||
return_data = None
|
||||
|
||||
if _return_http_data_only:
|
||||
return (return_data)
|
||||
else:
|
||||
return (return_data, response_data.status,
|
||||
response_data.getheaders())
|
||||
|
||||
def sanitize_for_serialization(self, obj):
|
||||
"""Builds a JSON POST object.
|
||||
|
||||
If obj is None, return None.
|
||||
If obj is str, int, long, float, bool, return directly.
|
||||
If obj is datetime.datetime, datetime.date
|
||||
convert to string in iso8601 format.
|
||||
If obj is list, sanitize each element in the list.
|
||||
If obj is dict, return the dict.
|
||||
If obj is OpenAPI model, return the properties dict.
|
||||
|
||||
:param obj: The data to serialize.
|
||||
:return: The serialized form of data.
|
||||
"""
|
||||
if obj is None:
|
||||
return None
|
||||
elif isinstance(obj, self.PRIMITIVE_TYPES):
|
||||
return obj
|
||||
elif isinstance(obj, list):
|
||||
return [self.sanitize_for_serialization(sub_obj)
|
||||
for sub_obj in obj]
|
||||
elif isinstance(obj, tuple):
|
||||
return tuple(self.sanitize_for_serialization(sub_obj)
|
||||
for sub_obj in obj)
|
||||
elif isinstance(obj, (datetime.datetime, datetime.date)):
|
||||
return obj.isoformat()
|
||||
|
||||
if isinstance(obj, dict):
|
||||
obj_dict = obj
|
||||
else:
|
||||
# Convert model obj to dict except
|
||||
# attributes `openapi_types`, `attribute_map`
|
||||
# and attributes which value is not None.
|
||||
# Convert attribute name to json key in
|
||||
# model definition for request.
|
||||
obj_dict = {obj.attribute_map[attr]: getattr(obj, attr)
|
||||
for attr, _ in six.iteritems(obj.openapi_types)
|
||||
if getattr(obj, attr) is not None}
|
||||
|
||||
return {key: self.sanitize_for_serialization(val)
|
||||
for key, val in six.iteritems(obj_dict)}
|
||||
|
||||
def deserialize(self, response, response_type):
|
||||
"""Deserializes response into an object.
|
||||
|
||||
:param response: RESTResponse object to be deserialized.
|
||||
:param response_type: class literal for
|
||||
deserialized object, or string of class name.
|
||||
|
||||
:return: deserialized object.
|
||||
"""
|
||||
# handle file downloading
|
||||
# save response body into a tmp file and return the instance
|
||||
if response_type == "file":
|
||||
return self.__deserialize_file(response)
|
||||
|
||||
# fetch data from response object
|
||||
try:
|
||||
data = json.loads(response.data)
|
||||
except ValueError:
|
||||
data = response.data
|
||||
|
||||
return self.__deserialize(data, response_type)
|
||||
|
||||
def __deserialize(self, data, klass):
|
||||
"""Deserializes dict, list, str into an object.
|
||||
|
||||
:param data: dict, list or str.
|
||||
:param klass: class literal, or string of class name.
|
||||
|
||||
:return: object.
|
||||
"""
|
||||
if data is None:
|
||||
return None
|
||||
|
||||
if type(klass) == str:
|
||||
if klass.startswith('list['):
|
||||
sub_kls = re.match(r'list\[(.*)\]', klass).group(1)
|
||||
return [self.__deserialize(sub_data, sub_kls)
|
||||
for sub_data in data]
|
||||
|
||||
if klass.startswith('dict('):
|
||||
sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2)
|
||||
return {k: self.__deserialize(v, sub_kls)
|
||||
for k, v in six.iteritems(data)}
|
||||
|
||||
# convert str to class
|
||||
if klass in self.NATIVE_TYPES_MAPPING:
|
||||
klass = self.NATIVE_TYPES_MAPPING[klass]
|
||||
else:
|
||||
klass = getattr(petstore_api.models, klass)
|
||||
|
||||
if klass in self.PRIMITIVE_TYPES:
|
||||
return self.__deserialize_primitive(data, klass)
|
||||
elif klass == object:
|
||||
return self.__deserialize_object(data)
|
||||
elif klass == datetime.date:
|
||||
return self.__deserialize_date(data)
|
||||
elif klass == datetime.datetime:
|
||||
return self.__deserialize_datetime(data)
|
||||
else:
|
||||
return self.__deserialize_model(data, klass)
|
||||
|
||||
def call_api(self, resource_path, method,
|
||||
path_params=None, query_params=None, header_params=None,
|
||||
body=None, post_params=None, files=None,
|
||||
response_types_map=None, auth_settings=None,
|
||||
async_req=None, _return_http_data_only=None,
|
||||
collection_formats=None,_preload_content=True,
|
||||
_request_timeout=None, _host=None, _request_auth=None):
|
||||
"""Makes the HTTP request (synchronous) and returns deserialized data.
|
||||
|
||||
To make an async_req request, set the async_req parameter.
|
||||
|
||||
:param resource_path: Path to method endpoint.
|
||||
:param method: Method to call.
|
||||
:param path_params: Path parameters in the url.
|
||||
:param query_params: Query parameters in the url.
|
||||
:param header_params: Header parameters to be
|
||||
placed in the request header.
|
||||
:param body: Request body.
|
||||
:param post_params dict: Request post form parameters,
|
||||
for `application/x-www-form-urlencoded`, `multipart/form-data`.
|
||||
:param auth_settings list: Auth Settings names for the request.
|
||||
:param response: Response data type.
|
||||
:param files dict: key -> filename, value -> filepath,
|
||||
for `multipart/form-data`.
|
||||
:param async_req bool: execute request asynchronously
|
||||
:param _return_http_data_only: response data without head status code
|
||||
and headers
|
||||
:param collection_formats: dict of collection formats for path, query,
|
||||
header, and post parameters.
|
||||
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
||||
be returned without reading/decoding response
|
||||
data. Default is True.
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the authentication
|
||||
in the spec for a single request.
|
||||
:type _request_token: dict, optional
|
||||
:return:
|
||||
If async_req parameter is True,
|
||||
the request will be called asynchronously.
|
||||
The method will return the request thread.
|
||||
If parameter async_req is False or missing,
|
||||
then the method will return the response directly.
|
||||
"""
|
||||
if not async_req:
|
||||
return self.__call_api(resource_path, method,
|
||||
path_params, query_params, header_params,
|
||||
body, post_params, files,
|
||||
response_types_map, auth_settings,
|
||||
_return_http_data_only, collection_formats,
|
||||
_preload_content, _request_timeout, _host,
|
||||
_request_auth)
|
||||
|
||||
return self.pool.apply_async(self.__call_api, (resource_path,
|
||||
method, path_params,
|
||||
query_params,
|
||||
header_params, body,
|
||||
post_params, files,
|
||||
response_types_map,
|
||||
auth_settings,
|
||||
_return_http_data_only,
|
||||
collection_formats,
|
||||
_preload_content,
|
||||
_request_timeout,
|
||||
_host, _request_auth))
|
||||
|
||||
def request(self, method, url, query_params=None, headers=None,
|
||||
post_params=None, body=None, _preload_content=True,
|
||||
_request_timeout=None):
|
||||
"""Makes the HTTP request using RESTClient."""
|
||||
if method == "GET":
|
||||
return self.rest_client.GET(url,
|
||||
query_params=query_params,
|
||||
_preload_content=_preload_content,
|
||||
_request_timeout=_request_timeout,
|
||||
headers=headers)
|
||||
elif method == "HEAD":
|
||||
return self.rest_client.HEAD(url,
|
||||
query_params=query_params,
|
||||
_preload_content=_preload_content,
|
||||
_request_timeout=_request_timeout,
|
||||
headers=headers)
|
||||
elif method == "OPTIONS":
|
||||
return self.rest_client.OPTIONS(url,
|
||||
query_params=query_params,
|
||||
headers=headers,
|
||||
_preload_content=_preload_content,
|
||||
_request_timeout=_request_timeout)
|
||||
elif method == "POST":
|
||||
return self.rest_client.POST(url,
|
||||
query_params=query_params,
|
||||
headers=headers,
|
||||
post_params=post_params,
|
||||
_preload_content=_preload_content,
|
||||
_request_timeout=_request_timeout,
|
||||
body=body)
|
||||
elif method == "PUT":
|
||||
return self.rest_client.PUT(url,
|
||||
query_params=query_params,
|
||||
headers=headers,
|
||||
post_params=post_params,
|
||||
_preload_content=_preload_content,
|
||||
_request_timeout=_request_timeout,
|
||||
body=body)
|
||||
elif method == "PATCH":
|
||||
return self.rest_client.PATCH(url,
|
||||
query_params=query_params,
|
||||
headers=headers,
|
||||
post_params=post_params,
|
||||
_preload_content=_preload_content,
|
||||
_request_timeout=_request_timeout,
|
||||
body=body)
|
||||
elif method == "DELETE":
|
||||
return self.rest_client.DELETE(url,
|
||||
query_params=query_params,
|
||||
headers=headers,
|
||||
_preload_content=_preload_content,
|
||||
_request_timeout=_request_timeout,
|
||||
body=body)
|
||||
else:
|
||||
raise ApiValueError(
|
||||
"http method must be `GET`, `HEAD`, `OPTIONS`,"
|
||||
" `POST`, `PATCH`, `PUT` or `DELETE`."
|
||||
)
|
||||
|
||||
def parameters_to_tuples(self, params, collection_formats):
|
||||
"""Get parameters as list of tuples, formatting collections.
|
||||
|
||||
:param params: Parameters as dict or list of two-tuples
|
||||
:param dict collection_formats: Parameter collection formats
|
||||
:return: Parameters as list of tuples, collections formatted
|
||||
"""
|
||||
new_params = []
|
||||
if collection_formats is None:
|
||||
collection_formats = {}
|
||||
for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501
|
||||
if k in collection_formats:
|
||||
collection_format = collection_formats[k]
|
||||
if collection_format == 'multi':
|
||||
new_params.extend((k, value) for value in v)
|
||||
else:
|
||||
if collection_format == 'ssv':
|
||||
delimiter = ' '
|
||||
elif collection_format == 'tsv':
|
||||
delimiter = '\t'
|
||||
elif collection_format == 'pipes':
|
||||
delimiter = '|'
|
||||
else: # csv is the default
|
||||
delimiter = ','
|
||||
new_params.append(
|
||||
(k, delimiter.join(str(value) for value in v)))
|
||||
else:
|
||||
new_params.append((k, v))
|
||||
return new_params
|
||||
|
||||
def files_parameters(self, files=None):
|
||||
"""Builds form parameters.
|
||||
|
||||
:param files: File parameters.
|
||||
:return: Form parameters with files.
|
||||
"""
|
||||
params = []
|
||||
|
||||
if files:
|
||||
for k, v in six.iteritems(files):
|
||||
if not v:
|
||||
continue
|
||||
file_names = v if type(v) is list else [v]
|
||||
for n in file_names:
|
||||
with open(n, 'rb') as f:
|
||||
filename = os.path.basename(f.name)
|
||||
filedata = f.read()
|
||||
mimetype = (mimetypes.guess_type(filename)[0] or
|
||||
'application/octet-stream')
|
||||
params.append(
|
||||
tuple([k, tuple([filename, filedata, mimetype])]))
|
||||
|
||||
return params
|
||||
|
||||
def select_header_accept(self, accepts):
|
||||
"""Returns `Accept` based on an array of accepts provided.
|
||||
|
||||
:param accepts: List of headers.
|
||||
:return: Accept (e.g. application/json).
|
||||
"""
|
||||
if not accepts:
|
||||
return
|
||||
|
||||
accepts = [x.lower() for x in accepts]
|
||||
|
||||
if 'application/json' in accepts:
|
||||
return 'application/json'
|
||||
else:
|
||||
return ', '.join(accepts)
|
||||
|
||||
def select_header_content_type(self, content_types):
|
||||
"""Returns `Content-Type` based on an array of content_types provided.
|
||||
|
||||
:param content_types: List of content-types.
|
||||
:return: Content-Type (e.g. application/json).
|
||||
"""
|
||||
if not content_types:
|
||||
return 'application/json'
|
||||
|
||||
content_types = [x.lower() for x in content_types]
|
||||
|
||||
if 'application/json' in content_types or '*/*' in content_types:
|
||||
return 'application/json'
|
||||
else:
|
||||
return content_types[0]
|
||||
|
||||
def update_params_for_auth(self, headers, querys, auth_settings,
|
||||
request_auth=None):
|
||||
"""Updates header and query params based on authentication setting.
|
||||
|
||||
:param headers: Header parameters dict to be updated.
|
||||
:param querys: Query parameters tuple list to be updated.
|
||||
:param auth_settings: Authentication setting identifiers list.
|
||||
:param request_auth: if set, the provided settings will
|
||||
override the token in the configuration.
|
||||
"""
|
||||
if not auth_settings:
|
||||
return
|
||||
|
||||
if request_auth:
|
||||
self._apply_auth_params(headers, querys, request_auth)
|
||||
return
|
||||
|
||||
for auth in auth_settings:
|
||||
auth_setting = self.configuration.auth_settings().get(auth)
|
||||
if auth_setting:
|
||||
self._apply_auth_params(headers, querys, auth_setting)
|
||||
|
||||
def _apply_auth_params(self, headers, querys, auth_setting):
|
||||
"""Updates the request parameters based on a single auth_setting
|
||||
|
||||
:param headers: Header parameters dict to be updated.
|
||||
:param querys: Query parameters tuple list to be updated.
|
||||
:param auth_setting: auth settings for the endpoint
|
||||
"""
|
||||
if auth_setting['in'] == 'cookie':
|
||||
headers['Cookie'] = auth_setting['value']
|
||||
elif auth_setting['in'] == 'header':
|
||||
headers[auth_setting['key']] = auth_setting['value']
|
||||
elif auth_setting['in'] == 'query':
|
||||
querys.append((auth_setting['key'], auth_setting['value']))
|
||||
else:
|
||||
raise ApiValueError(
|
||||
'Authentication token must be in `query` or `header`'
|
||||
)
|
||||
|
||||
def __deserialize_file(self, response):
|
||||
"""Deserializes body to file
|
||||
|
||||
Saves response body into a file in a temporary folder,
|
||||
using the filename from the `Content-Disposition` header if provided.
|
||||
|
||||
:param response: RESTResponse.
|
||||
:return: file path.
|
||||
"""
|
||||
fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path)
|
||||
os.close(fd)
|
||||
os.remove(path)
|
||||
|
||||
content_disposition = response.getheader("Content-Disposition")
|
||||
if content_disposition:
|
||||
filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?',
|
||||
content_disposition).group(1)
|
||||
path = os.path.join(os.path.dirname(path), filename)
|
||||
|
||||
with open(path, "wb") as f:
|
||||
f.write(response.data)
|
||||
|
||||
return path
|
||||
|
||||
def __deserialize_primitive(self, data, klass):
|
||||
"""Deserializes string to primitive type.
|
||||
|
||||
:param data: str.
|
||||
:param klass: class literal.
|
||||
|
||||
:return: int, long, float, str, bool.
|
||||
"""
|
||||
try:
|
||||
return klass(data)
|
||||
except UnicodeEncodeError:
|
||||
return six.text_type(data)
|
||||
except TypeError:
|
||||
return data
|
||||
|
||||
def __deserialize_object(self, value):
|
||||
"""Return an original value.
|
||||
|
||||
:return: object.
|
||||
"""
|
||||
return value
|
||||
|
||||
def __deserialize_date(self, string):
|
||||
"""Deserializes string to date.
|
||||
|
||||
:param string: str.
|
||||
:return: date.
|
||||
"""
|
||||
try:
|
||||
return parse(string).date()
|
||||
except ImportError:
|
||||
return string
|
||||
except ValueError:
|
||||
raise rest.ApiException(
|
||||
status=0,
|
||||
reason="Failed to parse `{0}` as date object".format(string)
|
||||
)
|
||||
|
||||
def __deserialize_datetime(self, string):
|
||||
"""Deserializes string to datetime.
|
||||
|
||||
The string should be in iso8601 datetime format.
|
||||
|
||||
:param string: str.
|
||||
:return: datetime.
|
||||
"""
|
||||
try:
|
||||
return parse(string)
|
||||
except ImportError:
|
||||
return string
|
||||
except ValueError:
|
||||
raise rest.ApiException(
|
||||
status=0,
|
||||
reason=(
|
||||
"Failed to parse `{0}` as datetime object"
|
||||
.format(string)
|
||||
)
|
||||
)
|
||||
|
||||
def __deserialize_model(self, data, klass):
|
||||
"""Deserializes list or dict to model.
|
||||
|
||||
:param data: dict, list.
|
||||
:param klass: class literal.
|
||||
:return: model object.
|
||||
"""
|
||||
has_discriminator = False
|
||||
if (hasattr(klass, 'get_real_child_model')
|
||||
and klass.discriminator_value_class_map):
|
||||
has_discriminator = True
|
||||
|
||||
if not klass.openapi_types and has_discriminator is False:
|
||||
return data
|
||||
|
||||
kwargs = {}
|
||||
if (data is not None and
|
||||
klass.openapi_types is not None and
|
||||
isinstance(data, (list, dict))):
|
||||
for attr, attr_type in six.iteritems(klass.openapi_types):
|
||||
if klass.attribute_map[attr] in data:
|
||||
value = data[klass.attribute_map[attr]]
|
||||
kwargs[attr] = self.__deserialize(value, attr_type)
|
||||
|
||||
instance = klass(**kwargs)
|
||||
|
||||
if has_discriminator:
|
||||
klass_name = instance.get_real_child_model(data)
|
||||
if klass_name:
|
||||
instance = self.__deserialize(data, klass_name)
|
||||
return instance
|
||||
@@ -0,0 +1,515 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import copy
|
||||
import logging
|
||||
import multiprocessing
|
||||
import sys
|
||||
import urllib3
|
||||
|
||||
import six
|
||||
from six.moves import http_client as httplib
|
||||
from petstore_api.exceptions import ApiValueError
|
||||
|
||||
|
||||
JSON_SCHEMA_VALIDATION_KEYWORDS = {
|
||||
'multipleOf', 'maximum', 'exclusiveMaximum',
|
||||
'minimum', 'exclusiveMinimum', 'maxLength',
|
||||
'minLength', 'pattern', 'maxItems', 'minItems'
|
||||
}
|
||||
|
||||
class Configuration(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator
|
||||
|
||||
Ref: https://openapi-generator.tech
|
||||
Do not edit the class manually.
|
||||
|
||||
:param host: Base url
|
||||
:param api_key: Dict to store API key(s).
|
||||
Each entry in the dict specifies an API key.
|
||||
The dict key is the name of the security scheme in the OAS specification.
|
||||
The dict value is the API key secret.
|
||||
:param api_key_prefix: Dict to store API prefix (e.g. Bearer)
|
||||
The dict key is the name of the security scheme in the OAS specification.
|
||||
The dict value is an API key prefix when generating the auth data.
|
||||
:param username: Username for HTTP basic authentication
|
||||
:param password: Password for HTTP basic authentication
|
||||
:param discard_unknown_keys: Boolean value indicating whether to discard
|
||||
unknown properties. A server may send a response that includes additional
|
||||
properties that are not known by the client in the following scenarios:
|
||||
1. The OpenAPI document is incomplete, i.e. it does not match the server
|
||||
implementation.
|
||||
2. The client was generated using an older version of the OpenAPI document
|
||||
and the server has been upgraded since then.
|
||||
If a schema in the OpenAPI document defines the additionalProperties attribute,
|
||||
then all undeclared properties received by the server are injected into the
|
||||
additional properties map. In that case, there are undeclared properties, and
|
||||
nothing to discard.
|
||||
:param disabled_client_side_validations (string): Comma-separated list of
|
||||
JSON schema validation keywords to disable JSON schema structural validation
|
||||
rules. The following keywords may be specified: multipleOf, maximum,
|
||||
exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern,
|
||||
maxItems, minItems.
|
||||
By default, the validation is performed for data generated locally by the client
|
||||
and data received from the server, independent of any validation performed by
|
||||
the server side. If the input data does not satisfy the JSON schema validation
|
||||
rules specified in the OpenAPI document, an exception is raised.
|
||||
If disabled_client_side_validations is set, structural validation is
|
||||
disabled. This can be useful to troubleshoot data validation problem, such as
|
||||
when the OpenAPI document validation rules do not match the actual API data
|
||||
received by the server.
|
||||
:param server_index: Index to servers configuration.
|
||||
:param server_variables: Mapping with string values to replace variables in
|
||||
templated server configuration. The validation of enums is performed for
|
||||
variables with defined enum values before.
|
||||
:param server_operation_index: Mapping from operation ID to an index to server
|
||||
configuration.
|
||||
:param server_operation_variables: Mapping from operation ID to a mapping with
|
||||
string values to replace variables in templated server configuration.
|
||||
The validation of enums is performed for variables with defined enum values before.
|
||||
|
||||
:Example:
|
||||
|
||||
API Key Authentication Example.
|
||||
Given the following security scheme in the OpenAPI specification:
|
||||
components:
|
||||
securitySchemes:
|
||||
cookieAuth: # name for the security scheme
|
||||
type: apiKey
|
||||
in: cookie
|
||||
name: JSESSIONID # cookie name
|
||||
|
||||
You can programmatically set the cookie:
|
||||
|
||||
conf = petstore_api.Configuration(
|
||||
api_key={'cookieAuth': 'abc123'}
|
||||
api_key_prefix={'cookieAuth': 'JSESSIONID'}
|
||||
)
|
||||
|
||||
The following cookie will be added to the HTTP request:
|
||||
Cookie: JSESSIONID abc123
|
||||
|
||||
HTTP Basic Authentication Example.
|
||||
Given the following security scheme in the OpenAPI specification:
|
||||
components:
|
||||
securitySchemes:
|
||||
http_basic_auth:
|
||||
type: http
|
||||
scheme: basic
|
||||
|
||||
Configure API client with HTTP basic authentication:
|
||||
|
||||
conf = petstore_api.Configuration(
|
||||
username='the-user',
|
||||
password='the-password',
|
||||
)
|
||||
|
||||
"""
|
||||
|
||||
_default = None
|
||||
|
||||
def __init__(self, host=None,
|
||||
api_key=None, api_key_prefix=None,
|
||||
username=None, password=None,
|
||||
discard_unknown_keys=False,
|
||||
disabled_client_side_validations="",
|
||||
server_index=None, server_variables=None,
|
||||
server_operation_index=None, server_operation_variables=None,
|
||||
):
|
||||
"""Constructor
|
||||
"""
|
||||
self._base_path = "http://petstore.swagger.io:80/v2" if host is None else host
|
||||
"""Default Base url
|
||||
"""
|
||||
self.server_index = 0 if server_index is None and host is None else server_index
|
||||
self.server_operation_index = server_operation_index or {}
|
||||
"""Default server index
|
||||
"""
|
||||
self.server_variables = server_variables or {}
|
||||
self.server_operation_variables = server_operation_variables or {}
|
||||
"""Default server variables
|
||||
"""
|
||||
self.temp_folder_path = None
|
||||
"""Temp file folder for downloading files
|
||||
"""
|
||||
# Authentication Settings
|
||||
self.api_key = {}
|
||||
if api_key:
|
||||
self.api_key = api_key
|
||||
"""dict to store API key(s)
|
||||
"""
|
||||
self.api_key_prefix = {}
|
||||
if api_key_prefix:
|
||||
self.api_key_prefix = api_key_prefix
|
||||
"""dict to store API prefix (e.g. Bearer)
|
||||
"""
|
||||
self.refresh_api_key_hook = None
|
||||
"""function hook to refresh API key if expired
|
||||
"""
|
||||
self.username = username
|
||||
"""Username for HTTP basic authentication
|
||||
"""
|
||||
self.password = password
|
||||
"""Password for HTTP basic authentication
|
||||
"""
|
||||
self.discard_unknown_keys = discard_unknown_keys
|
||||
self.disabled_client_side_validations = disabled_client_side_validations
|
||||
self.access_token = None
|
||||
"""access token for OAuth/Bearer
|
||||
"""
|
||||
self.logger = {}
|
||||
"""Logging Settings
|
||||
"""
|
||||
self.logger["package_logger"] = logging.getLogger("petstore_api")
|
||||
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
|
||||
self.logger_format = '%(asctime)s %(levelname)s %(message)s'
|
||||
"""Log format
|
||||
"""
|
||||
self.logger_stream_handler = None
|
||||
"""Log stream handler
|
||||
"""
|
||||
self.logger_file_handler = None
|
||||
"""Log file handler
|
||||
"""
|
||||
self.logger_file = None
|
||||
"""Debug file location
|
||||
"""
|
||||
self.debug = False
|
||||
"""Debug switch
|
||||
"""
|
||||
|
||||
self.verify_ssl = True
|
||||
"""SSL/TLS verification
|
||||
Set this to false to skip verifying SSL certificate when calling API
|
||||
from https server.
|
||||
"""
|
||||
self.ssl_ca_cert = None
|
||||
"""Set this to customize the certificate file to verify the peer.
|
||||
"""
|
||||
self.cert_file = None
|
||||
"""client certificate file
|
||||
"""
|
||||
self.key_file = None
|
||||
"""client key file
|
||||
"""
|
||||
self.assert_hostname = None
|
||||
"""Set this to True/False to enable/disable SSL hostname verification.
|
||||
"""
|
||||
|
||||
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
|
||||
"""urllib3 connection pool's maximum number of connections saved
|
||||
per pool. urllib3 uses 1 connection as default value, but this is
|
||||
not the best value when you are making a lot of possibly parallel
|
||||
requests to the same host, which is often the case here.
|
||||
cpu_count * 5 is used as default value to increase performance.
|
||||
"""
|
||||
|
||||
self.proxy = None
|
||||
"""Proxy URL
|
||||
"""
|
||||
self.proxy_headers = None
|
||||
"""Proxy headers
|
||||
"""
|
||||
self.safe_chars_for_path_param = ''
|
||||
"""Safe chars for path_param
|
||||
"""
|
||||
self.retries = None
|
||||
"""Adding retries to override urllib3 default value 3
|
||||
"""
|
||||
# Enable client side validation
|
||||
self.client_side_validation = True
|
||||
|
||||
self.socket_options = None
|
||||
"""Options to pass down to the underlying urllib3 socket
|
||||
"""
|
||||
|
||||
def __deepcopy__(self, memo):
|
||||
cls = self.__class__
|
||||
result = cls.__new__(cls)
|
||||
memo[id(self)] = result
|
||||
for k, v in self.__dict__.items():
|
||||
if k not in ('logger', 'logger_file_handler'):
|
||||
setattr(result, k, copy.deepcopy(v, memo))
|
||||
# shallow copy of loggers
|
||||
result.logger = copy.copy(self.logger)
|
||||
# use setters to configure loggers
|
||||
result.logger_file = self.logger_file
|
||||
result.debug = self.debug
|
||||
return result
|
||||
|
||||
def __setattr__(self, name, value):
|
||||
object.__setattr__(self, name, value)
|
||||
if name == 'disabled_client_side_validations':
|
||||
s = set(filter(None, value.split(',')))
|
||||
for v in s:
|
||||
if v not in JSON_SCHEMA_VALIDATION_KEYWORDS:
|
||||
raise ApiValueError(
|
||||
"Invalid keyword: '{0}''".format(v))
|
||||
self._disabled_client_side_validations = s
|
||||
|
||||
@classmethod
|
||||
def set_default(cls, default):
|
||||
"""Set default instance of configuration.
|
||||
|
||||
It stores default configuration, which can be
|
||||
returned by get_default_copy method.
|
||||
|
||||
:param default: object of Configuration
|
||||
"""
|
||||
cls._default = copy.deepcopy(default)
|
||||
|
||||
@classmethod
|
||||
def get_default_copy(cls):
|
||||
"""Return new instance of configuration.
|
||||
|
||||
This method returns newly created, based on default constructor,
|
||||
object of Configuration class or returns a copy of default
|
||||
configuration passed by the set_default method.
|
||||
|
||||
:return: The configuration object.
|
||||
"""
|
||||
if cls._default is not None:
|
||||
return copy.deepcopy(cls._default)
|
||||
return Configuration()
|
||||
|
||||
@property
|
||||
def logger_file(self):
|
||||
"""The logger file.
|
||||
|
||||
If the logger_file is None, then add stream handler and remove file
|
||||
handler. Otherwise, add file handler and remove stream handler.
|
||||
|
||||
:param value: The logger_file path.
|
||||
:type: str
|
||||
"""
|
||||
return self.__logger_file
|
||||
|
||||
@logger_file.setter
|
||||
def logger_file(self, value):
|
||||
"""The logger file.
|
||||
|
||||
If the logger_file is None, then add stream handler and remove file
|
||||
handler. Otherwise, add file handler and remove stream handler.
|
||||
|
||||
:param value: The logger_file path.
|
||||
:type: str
|
||||
"""
|
||||
self.__logger_file = value
|
||||
if self.__logger_file:
|
||||
# If set logging file,
|
||||
# then add file handler and remove stream handler.
|
||||
self.logger_file_handler = logging.FileHandler(self.__logger_file)
|
||||
self.logger_file_handler.setFormatter(self.logger_formatter)
|
||||
for _, logger in six.iteritems(self.logger):
|
||||
logger.addHandler(self.logger_file_handler)
|
||||
|
||||
@property
|
||||
def debug(self):
|
||||
"""Debug status
|
||||
|
||||
:param value: The debug status, True or False.
|
||||
:type: bool
|
||||
"""
|
||||
return self.__debug
|
||||
|
||||
@debug.setter
|
||||
def debug(self, value):
|
||||
"""Debug status
|
||||
|
||||
:param value: The debug status, True or False.
|
||||
:type: bool
|
||||
"""
|
||||
self.__debug = value
|
||||
if self.__debug:
|
||||
# if debug status is True, turn on debug logging
|
||||
for _, logger in six.iteritems(self.logger):
|
||||
logger.setLevel(logging.DEBUG)
|
||||
# turn on httplib debug
|
||||
httplib.HTTPConnection.debuglevel = 1
|
||||
else:
|
||||
# if debug status is False, turn off debug logging,
|
||||
# setting log level to default `logging.WARNING`
|
||||
for _, logger in six.iteritems(self.logger):
|
||||
logger.setLevel(logging.WARNING)
|
||||
# turn off httplib debug
|
||||
httplib.HTTPConnection.debuglevel = 0
|
||||
|
||||
@property
|
||||
def logger_format(self):
|
||||
"""The logger format.
|
||||
|
||||
The logger_formatter will be updated when sets logger_format.
|
||||
|
||||
:param value: The format string.
|
||||
:type: str
|
||||
"""
|
||||
return self.__logger_format
|
||||
|
||||
@logger_format.setter
|
||||
def logger_format(self, value):
|
||||
"""The logger format.
|
||||
|
||||
The logger_formatter will be updated when sets logger_format.
|
||||
|
||||
:param value: The format string.
|
||||
:type: str
|
||||
"""
|
||||
self.__logger_format = value
|
||||
self.logger_formatter = logging.Formatter(self.__logger_format)
|
||||
|
||||
def get_api_key_with_prefix(self, identifier, alias=None):
|
||||
"""Gets API key (with prefix if set).
|
||||
|
||||
:param identifier: The identifier of apiKey.
|
||||
:param alias: The alternative identifier of apiKey.
|
||||
:return: The token for api key authentication.
|
||||
"""
|
||||
if self.refresh_api_key_hook is not None:
|
||||
self.refresh_api_key_hook(self)
|
||||
key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None)
|
||||
if key:
|
||||
prefix = self.api_key_prefix.get(identifier)
|
||||
if prefix:
|
||||
return "%s %s" % (prefix, key)
|
||||
else:
|
||||
return key
|
||||
|
||||
def get_basic_auth_token(self):
|
||||
"""Gets HTTP basic authentication header (string).
|
||||
|
||||
:return: The token for basic HTTP authentication.
|
||||
"""
|
||||
username = ""
|
||||
if self.username is not None:
|
||||
username = self.username
|
||||
password = ""
|
||||
if self.password is not None:
|
||||
password = self.password
|
||||
return urllib3.util.make_headers(
|
||||
basic_auth=username + ':' + password
|
||||
).get('authorization')
|
||||
|
||||
def auth_settings(self):
|
||||
"""Gets Auth Settings dict for api client.
|
||||
|
||||
:return: The Auth Settings information dict.
|
||||
"""
|
||||
auth = {}
|
||||
if 'api_key' in self.api_key:
|
||||
auth['api_key'] = {
|
||||
'type': 'api_key',
|
||||
'in': 'header',
|
||||
'key': 'api_key',
|
||||
'value': self.get_api_key_with_prefix(
|
||||
'api_key',
|
||||
),
|
||||
}
|
||||
if 'api_key_query' in self.api_key:
|
||||
auth['api_key_query'] = {
|
||||
'type': 'api_key',
|
||||
'in': 'query',
|
||||
'key': 'api_key_query',
|
||||
'value': self.get_api_key_with_prefix(
|
||||
'api_key_query',
|
||||
),
|
||||
}
|
||||
if self.username is not None and self.password is not None:
|
||||
auth['http_basic_test'] = {
|
||||
'type': 'basic',
|
||||
'in': 'header',
|
||||
'key': 'Authorization',
|
||||
'value': self.get_basic_auth_token()
|
||||
}
|
||||
if self.access_token is not None:
|
||||
auth['petstore_auth'] = {
|
||||
'type': 'oauth2',
|
||||
'in': 'header',
|
||||
'key': 'Authorization',
|
||||
'value': 'Bearer ' + self.access_token
|
||||
}
|
||||
return auth
|
||||
|
||||
def to_debug_report(self):
|
||||
"""Gets the essential information for debugging.
|
||||
|
||||
:return: The report for debugging.
|
||||
"""
|
||||
return "Python SDK Debug Report:\n"\
|
||||
"OS: {env}\n"\
|
||||
"Python Version: {pyversion}\n"\
|
||||
"Version of the API: 1.0.0\n"\
|
||||
"SDK Package Version: 1.0.0".\
|
||||
format(env=sys.platform, pyversion=sys.version)
|
||||
|
||||
def get_host_settings(self):
|
||||
"""Gets an array of host settings
|
||||
|
||||
:return: An array of host settings
|
||||
"""
|
||||
return [
|
||||
{
|
||||
'url': "http://petstore.swagger.io:80/v2",
|
||||
'description': "No description provided",
|
||||
}
|
||||
]
|
||||
|
||||
def get_host_from_settings(self, index, variables=None, servers=None):
|
||||
"""Gets host URL based on the index and variables
|
||||
:param index: array index of the host settings
|
||||
:param variables: hash of variable and the corresponding value
|
||||
:param servers: an array of host settings or None
|
||||
:return: URL based on host settings
|
||||
"""
|
||||
if index is None:
|
||||
return self._base_path
|
||||
|
||||
variables = {} if variables is None else variables
|
||||
servers = self.get_host_settings() if servers is None else servers
|
||||
|
||||
try:
|
||||
server = servers[index]
|
||||
except IndexError:
|
||||
raise ValueError(
|
||||
"Invalid index {0} when selecting the host settings. "
|
||||
"Must be less than {1}".format(index, len(servers)))
|
||||
|
||||
url = server['url']
|
||||
|
||||
# go through variables and replace placeholders
|
||||
for variable_name, variable in server.get('variables', {}).items():
|
||||
used_value = variables.get(
|
||||
variable_name, variable['default_value'])
|
||||
|
||||
if 'enum_values' in variable \
|
||||
and used_value not in variable['enum_values']:
|
||||
raise ValueError(
|
||||
"The variable `{0}` in the host URL has invalid value "
|
||||
"{1}. Must be {2}.".format(
|
||||
variable_name, variables[variable_name],
|
||||
variable['enum_values']))
|
||||
|
||||
url = url.replace("{" + variable_name + "}", used_value)
|
||||
|
||||
return url
|
||||
|
||||
@property
|
||||
def host(self):
|
||||
"""Return generated host."""
|
||||
return self.get_host_from_settings(self.server_index, variables=self.server_variables)
|
||||
|
||||
@host.setter
|
||||
def host(self, value):
|
||||
"""Fix base path."""
|
||||
self._base_path = value
|
||||
self.server_index = None
|
||||
163
samples/client/petstore/python-legacy/petstore_api/exceptions.py
Normal file
163
samples/client/petstore/python-legacy/petstore_api/exceptions.py
Normal file
@@ -0,0 +1,163 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import six
|
||||
|
||||
|
||||
class OpenApiException(Exception):
|
||||
"""The base exception class for all OpenAPIExceptions"""
|
||||
|
||||
|
||||
class ApiTypeError(OpenApiException, TypeError):
|
||||
def __init__(self, msg, path_to_item=None, valid_classes=None,
|
||||
key_type=None):
|
||||
""" Raises an exception for TypeErrors
|
||||
|
||||
Args:
|
||||
msg (str): the exception message
|
||||
|
||||
Keyword Args:
|
||||
path_to_item (list): a list of keys an indices to get to the
|
||||
current_item
|
||||
None if unset
|
||||
valid_classes (tuple): the primitive classes that current item
|
||||
should be an instance of
|
||||
None if unset
|
||||
key_type (bool): False if our value is a value in a dict
|
||||
True if it is a key in a dict
|
||||
False if our item is an item in a list
|
||||
None if unset
|
||||
"""
|
||||
self.path_to_item = path_to_item
|
||||
self.valid_classes = valid_classes
|
||||
self.key_type = key_type
|
||||
full_msg = msg
|
||||
if path_to_item:
|
||||
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
||||
super(ApiTypeError, self).__init__(full_msg)
|
||||
|
||||
|
||||
class ApiValueError(OpenApiException, ValueError):
|
||||
def __init__(self, msg, path_to_item=None):
|
||||
"""
|
||||
Args:
|
||||
msg (str): the exception message
|
||||
|
||||
Keyword Args:
|
||||
path_to_item (list) the path to the exception in the
|
||||
received_data dict. None if unset
|
||||
"""
|
||||
|
||||
self.path_to_item = path_to_item
|
||||
full_msg = msg
|
||||
if path_to_item:
|
||||
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
||||
super(ApiValueError, self).__init__(full_msg)
|
||||
|
||||
|
||||
class ApiAttributeError(OpenApiException, AttributeError):
|
||||
def __init__(self, msg, path_to_item=None):
|
||||
"""
|
||||
Raised when an attribute reference or assignment fails.
|
||||
|
||||
Args:
|
||||
msg (str): the exception message
|
||||
|
||||
Keyword Args:
|
||||
path_to_item (None/list) the path to the exception in the
|
||||
received_data dict
|
||||
"""
|
||||
self.path_to_item = path_to_item
|
||||
full_msg = msg
|
||||
if path_to_item:
|
||||
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
||||
super(ApiAttributeError, self).__init__(full_msg)
|
||||
|
||||
|
||||
class ApiKeyError(OpenApiException, KeyError):
|
||||
def __init__(self, msg, path_to_item=None):
|
||||
"""
|
||||
Args:
|
||||
msg (str): the exception message
|
||||
|
||||
Keyword Args:
|
||||
path_to_item (None/list) the path to the exception in the
|
||||
received_data dict
|
||||
"""
|
||||
self.path_to_item = path_to_item
|
||||
full_msg = msg
|
||||
if path_to_item:
|
||||
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
||||
super(ApiKeyError, self).__init__(full_msg)
|
||||
|
||||
|
||||
class ApiException(OpenApiException):
|
||||
|
||||
def __init__(self, status=None, reason=None, http_resp=None):
|
||||
if http_resp:
|
||||
self.status = http_resp.status
|
||||
self.reason = http_resp.reason
|
||||
self.body = http_resp.data
|
||||
self.headers = http_resp.getheaders()
|
||||
else:
|
||||
self.status = status
|
||||
self.reason = reason
|
||||
self.body = None
|
||||
self.headers = None
|
||||
|
||||
def __str__(self):
|
||||
"""Custom error messages for exception"""
|
||||
error_message = "({0})\n"\
|
||||
"Reason: {1}\n".format(self.status, self.reason)
|
||||
if self.headers:
|
||||
error_message += "HTTP response headers: {0}\n".format(
|
||||
self.headers)
|
||||
|
||||
if self.body:
|
||||
error_message += "HTTP response body: {0}\n".format(self.body)
|
||||
|
||||
return error_message
|
||||
|
||||
|
||||
class NotFoundException(ApiException):
|
||||
|
||||
def __init__(self, status=None, reason=None, http_resp=None):
|
||||
super(NotFoundException, self).__init__(status, reason, http_resp)
|
||||
|
||||
|
||||
class UnauthorizedException(ApiException):
|
||||
|
||||
def __init__(self, status=None, reason=None, http_resp=None):
|
||||
super(UnauthorizedException, self).__init__(status, reason, http_resp)
|
||||
|
||||
|
||||
class ForbiddenException(ApiException):
|
||||
|
||||
def __init__(self, status=None, reason=None, http_resp=None):
|
||||
super(ForbiddenException, self).__init__(status, reason, http_resp)
|
||||
|
||||
|
||||
class ServiceException(ApiException):
|
||||
|
||||
def __init__(self, status=None, reason=None, http_resp=None):
|
||||
super(ServiceException, self).__init__(status, reason, http_resp)
|
||||
|
||||
|
||||
def render_path(path_to_item):
|
||||
"""Returns a string representation of a path"""
|
||||
result = ""
|
||||
for pth in path_to_item:
|
||||
if isinstance(pth, six.integer_types):
|
||||
result += "[{0}]".format(pth)
|
||||
else:
|
||||
result += "['{0}']".format(pth)
|
||||
return result
|
||||
@@ -0,0 +1,64 @@
|
||||
# coding: utf-8
|
||||
|
||||
# flake8: noqa
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
# import models into model package
|
||||
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
|
||||
from petstore_api.models.additional_properties_array import AdditionalPropertiesArray
|
||||
from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean
|
||||
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
|
||||
from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger
|
||||
from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber
|
||||
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
|
||||
from petstore_api.models.additional_properties_string import AdditionalPropertiesString
|
||||
from petstore_api.models.animal import Animal
|
||||
from petstore_api.models.api_response import ApiResponse
|
||||
from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
|
||||
from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
|
||||
from petstore_api.models.array_test import ArrayTest
|
||||
from petstore_api.models.big_cat import BigCat
|
||||
from petstore_api.models.big_cat_all_of import BigCatAllOf
|
||||
from petstore_api.models.capitalization import Capitalization
|
||||
from petstore_api.models.cat import Cat
|
||||
from petstore_api.models.cat_all_of import CatAllOf
|
||||
from petstore_api.models.category import Category
|
||||
from petstore_api.models.class_model import ClassModel
|
||||
from petstore_api.models.client import Client
|
||||
from petstore_api.models.dog import Dog
|
||||
from petstore_api.models.dog_all_of import DogAllOf
|
||||
from petstore_api.models.enum_arrays import EnumArrays
|
||||
from petstore_api.models.enum_class import EnumClass
|
||||
from petstore_api.models.enum_test import EnumTest
|
||||
from petstore_api.models.file import File
|
||||
from petstore_api.models.file_schema_test_class import FileSchemaTestClass
|
||||
from petstore_api.models.format_test import FormatTest
|
||||
from petstore_api.models.has_only_read_only import HasOnlyReadOnly
|
||||
from petstore_api.models.list import List
|
||||
from petstore_api.models.map_test import MapTest
|
||||
from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
|
||||
from petstore_api.models.model200_response import Model200Response
|
||||
from petstore_api.models.model_return import ModelReturn
|
||||
from petstore_api.models.name import Name
|
||||
from petstore_api.models.number_only import NumberOnly
|
||||
from petstore_api.models.order import Order
|
||||
from petstore_api.models.outer_composite import OuterComposite
|
||||
from petstore_api.models.outer_enum import OuterEnum
|
||||
from petstore_api.models.pet import Pet
|
||||
from petstore_api.models.read_only_first import ReadOnlyFirst
|
||||
from petstore_api.models.special_model_name import SpecialModelName
|
||||
from petstore_api.models.tag import Tag
|
||||
from petstore_api.models.type_holder_default import TypeHolderDefault
|
||||
from petstore_api.models.type_holder_example import TypeHolderExample
|
||||
from petstore_api.models.user import User
|
||||
from petstore_api.models.xml_item import XmlItem
|
||||
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class AdditionalPropertiesAnyType(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'name': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'name': 'name'
|
||||
}
|
||||
|
||||
def __init__(self, name=None, local_vars_configuration=None): # noqa: E501
|
||||
"""AdditionalPropertiesAnyType - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._name = None
|
||||
self.discriminator = None
|
||||
|
||||
if name is not None:
|
||||
self.name = name
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Gets the name of this AdditionalPropertiesAnyType. # noqa: E501
|
||||
|
||||
|
||||
:return: The name of this AdditionalPropertiesAnyType. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name):
|
||||
"""Sets the name of this AdditionalPropertiesAnyType.
|
||||
|
||||
|
||||
:param name: The name of this AdditionalPropertiesAnyType. # noqa: E501
|
||||
:type name: str
|
||||
"""
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, AdditionalPropertiesAnyType):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, AdditionalPropertiesAnyType):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class AdditionalPropertiesArray(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'name': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'name': 'name'
|
||||
}
|
||||
|
||||
def __init__(self, name=None, local_vars_configuration=None): # noqa: E501
|
||||
"""AdditionalPropertiesArray - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._name = None
|
||||
self.discriminator = None
|
||||
|
||||
if name is not None:
|
||||
self.name = name
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Gets the name of this AdditionalPropertiesArray. # noqa: E501
|
||||
|
||||
|
||||
:return: The name of this AdditionalPropertiesArray. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name):
|
||||
"""Sets the name of this AdditionalPropertiesArray.
|
||||
|
||||
|
||||
:param name: The name of this AdditionalPropertiesArray. # noqa: E501
|
||||
:type name: str
|
||||
"""
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, AdditionalPropertiesArray):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, AdditionalPropertiesArray):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class AdditionalPropertiesBoolean(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'name': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'name': 'name'
|
||||
}
|
||||
|
||||
def __init__(self, name=None, local_vars_configuration=None): # noqa: E501
|
||||
"""AdditionalPropertiesBoolean - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._name = None
|
||||
self.discriminator = None
|
||||
|
||||
if name is not None:
|
||||
self.name = name
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Gets the name of this AdditionalPropertiesBoolean. # noqa: E501
|
||||
|
||||
|
||||
:return: The name of this AdditionalPropertiesBoolean. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name):
|
||||
"""Sets the name of this AdditionalPropertiesBoolean.
|
||||
|
||||
|
||||
:param name: The name of this AdditionalPropertiesBoolean. # noqa: E501
|
||||
:type name: str
|
||||
"""
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, AdditionalPropertiesBoolean):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, AdditionalPropertiesBoolean):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,388 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class AdditionalPropertiesClass(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'map_string': 'dict(str, str)',
|
||||
'map_number': 'dict(str, float)',
|
||||
'map_integer': 'dict(str, int)',
|
||||
'map_boolean': 'dict(str, bool)',
|
||||
'map_array_integer': 'dict(str, list[int])',
|
||||
'map_array_anytype': 'dict(str, list[object])',
|
||||
'map_map_string': 'dict(str, dict(str, str))',
|
||||
'map_map_anytype': 'dict(str, dict(str, object))',
|
||||
'anytype_1': 'object',
|
||||
'anytype_2': 'object',
|
||||
'anytype_3': 'object'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'map_string': 'map_string',
|
||||
'map_number': 'map_number',
|
||||
'map_integer': 'map_integer',
|
||||
'map_boolean': 'map_boolean',
|
||||
'map_array_integer': 'map_array_integer',
|
||||
'map_array_anytype': 'map_array_anytype',
|
||||
'map_map_string': 'map_map_string',
|
||||
'map_map_anytype': 'map_map_anytype',
|
||||
'anytype_1': 'anytype_1',
|
||||
'anytype_2': 'anytype_2',
|
||||
'anytype_3': 'anytype_3'
|
||||
}
|
||||
|
||||
def __init__(self, map_string=None, map_number=None, map_integer=None, map_boolean=None, map_array_integer=None, map_array_anytype=None, map_map_string=None, map_map_anytype=None, anytype_1=None, anytype_2=None, anytype_3=None, local_vars_configuration=None): # noqa: E501
|
||||
"""AdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._map_string = None
|
||||
self._map_number = None
|
||||
self._map_integer = None
|
||||
self._map_boolean = None
|
||||
self._map_array_integer = None
|
||||
self._map_array_anytype = None
|
||||
self._map_map_string = None
|
||||
self._map_map_anytype = None
|
||||
self._anytype_1 = None
|
||||
self._anytype_2 = None
|
||||
self._anytype_3 = None
|
||||
self.discriminator = None
|
||||
|
||||
if map_string is not None:
|
||||
self.map_string = map_string
|
||||
if map_number is not None:
|
||||
self.map_number = map_number
|
||||
if map_integer is not None:
|
||||
self.map_integer = map_integer
|
||||
if map_boolean is not None:
|
||||
self.map_boolean = map_boolean
|
||||
if map_array_integer is not None:
|
||||
self.map_array_integer = map_array_integer
|
||||
if map_array_anytype is not None:
|
||||
self.map_array_anytype = map_array_anytype
|
||||
if map_map_string is not None:
|
||||
self.map_map_string = map_map_string
|
||||
if map_map_anytype is not None:
|
||||
self.map_map_anytype = map_map_anytype
|
||||
if anytype_1 is not None:
|
||||
self.anytype_1 = anytype_1
|
||||
if anytype_2 is not None:
|
||||
self.anytype_2 = anytype_2
|
||||
if anytype_3 is not None:
|
||||
self.anytype_3 = anytype_3
|
||||
|
||||
@property
|
||||
def map_string(self):
|
||||
"""Gets the map_string of this AdditionalPropertiesClass. # noqa: E501
|
||||
|
||||
|
||||
:return: The map_string of this AdditionalPropertiesClass. # noqa: E501
|
||||
:rtype: dict(str, str)
|
||||
"""
|
||||
return self._map_string
|
||||
|
||||
@map_string.setter
|
||||
def map_string(self, map_string):
|
||||
"""Sets the map_string of this AdditionalPropertiesClass.
|
||||
|
||||
|
||||
:param map_string: The map_string of this AdditionalPropertiesClass. # noqa: E501
|
||||
:type map_string: dict(str, str)
|
||||
"""
|
||||
|
||||
self._map_string = map_string
|
||||
|
||||
@property
|
||||
def map_number(self):
|
||||
"""Gets the map_number of this AdditionalPropertiesClass. # noqa: E501
|
||||
|
||||
|
||||
:return: The map_number of this AdditionalPropertiesClass. # noqa: E501
|
||||
:rtype: dict(str, float)
|
||||
"""
|
||||
return self._map_number
|
||||
|
||||
@map_number.setter
|
||||
def map_number(self, map_number):
|
||||
"""Sets the map_number of this AdditionalPropertiesClass.
|
||||
|
||||
|
||||
:param map_number: The map_number of this AdditionalPropertiesClass. # noqa: E501
|
||||
:type map_number: dict(str, float)
|
||||
"""
|
||||
|
||||
self._map_number = map_number
|
||||
|
||||
@property
|
||||
def map_integer(self):
|
||||
"""Gets the map_integer of this AdditionalPropertiesClass. # noqa: E501
|
||||
|
||||
|
||||
:return: The map_integer of this AdditionalPropertiesClass. # noqa: E501
|
||||
:rtype: dict(str, int)
|
||||
"""
|
||||
return self._map_integer
|
||||
|
||||
@map_integer.setter
|
||||
def map_integer(self, map_integer):
|
||||
"""Sets the map_integer of this AdditionalPropertiesClass.
|
||||
|
||||
|
||||
:param map_integer: The map_integer of this AdditionalPropertiesClass. # noqa: E501
|
||||
:type map_integer: dict(str, int)
|
||||
"""
|
||||
|
||||
self._map_integer = map_integer
|
||||
|
||||
@property
|
||||
def map_boolean(self):
|
||||
"""Gets the map_boolean of this AdditionalPropertiesClass. # noqa: E501
|
||||
|
||||
|
||||
:return: The map_boolean of this AdditionalPropertiesClass. # noqa: E501
|
||||
:rtype: dict(str, bool)
|
||||
"""
|
||||
return self._map_boolean
|
||||
|
||||
@map_boolean.setter
|
||||
def map_boolean(self, map_boolean):
|
||||
"""Sets the map_boolean of this AdditionalPropertiesClass.
|
||||
|
||||
|
||||
:param map_boolean: The map_boolean of this AdditionalPropertiesClass. # noqa: E501
|
||||
:type map_boolean: dict(str, bool)
|
||||
"""
|
||||
|
||||
self._map_boolean = map_boolean
|
||||
|
||||
@property
|
||||
def map_array_integer(self):
|
||||
"""Gets the map_array_integer of this AdditionalPropertiesClass. # noqa: E501
|
||||
|
||||
|
||||
:return: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501
|
||||
:rtype: dict(str, list[int])
|
||||
"""
|
||||
return self._map_array_integer
|
||||
|
||||
@map_array_integer.setter
|
||||
def map_array_integer(self, map_array_integer):
|
||||
"""Sets the map_array_integer of this AdditionalPropertiesClass.
|
||||
|
||||
|
||||
:param map_array_integer: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501
|
||||
:type map_array_integer: dict(str, list[int])
|
||||
"""
|
||||
|
||||
self._map_array_integer = map_array_integer
|
||||
|
||||
@property
|
||||
def map_array_anytype(self):
|
||||
"""Gets the map_array_anytype of this AdditionalPropertiesClass. # noqa: E501
|
||||
|
||||
|
||||
:return: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501
|
||||
:rtype: dict(str, list[object])
|
||||
"""
|
||||
return self._map_array_anytype
|
||||
|
||||
@map_array_anytype.setter
|
||||
def map_array_anytype(self, map_array_anytype):
|
||||
"""Sets the map_array_anytype of this AdditionalPropertiesClass.
|
||||
|
||||
|
||||
:param map_array_anytype: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501
|
||||
:type map_array_anytype: dict(str, list[object])
|
||||
"""
|
||||
|
||||
self._map_array_anytype = map_array_anytype
|
||||
|
||||
@property
|
||||
def map_map_string(self):
|
||||
"""Gets the map_map_string of this AdditionalPropertiesClass. # noqa: E501
|
||||
|
||||
|
||||
:return: The map_map_string of this AdditionalPropertiesClass. # noqa: E501
|
||||
:rtype: dict(str, dict(str, str))
|
||||
"""
|
||||
return self._map_map_string
|
||||
|
||||
@map_map_string.setter
|
||||
def map_map_string(self, map_map_string):
|
||||
"""Sets the map_map_string of this AdditionalPropertiesClass.
|
||||
|
||||
|
||||
:param map_map_string: The map_map_string of this AdditionalPropertiesClass. # noqa: E501
|
||||
:type map_map_string: dict(str, dict(str, str))
|
||||
"""
|
||||
|
||||
self._map_map_string = map_map_string
|
||||
|
||||
@property
|
||||
def map_map_anytype(self):
|
||||
"""Gets the map_map_anytype of this AdditionalPropertiesClass. # noqa: E501
|
||||
|
||||
|
||||
:return: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501
|
||||
:rtype: dict(str, dict(str, object))
|
||||
"""
|
||||
return self._map_map_anytype
|
||||
|
||||
@map_map_anytype.setter
|
||||
def map_map_anytype(self, map_map_anytype):
|
||||
"""Sets the map_map_anytype of this AdditionalPropertiesClass.
|
||||
|
||||
|
||||
:param map_map_anytype: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501
|
||||
:type map_map_anytype: dict(str, dict(str, object))
|
||||
"""
|
||||
|
||||
self._map_map_anytype = map_map_anytype
|
||||
|
||||
@property
|
||||
def anytype_1(self):
|
||||
"""Gets the anytype_1 of this AdditionalPropertiesClass. # noqa: E501
|
||||
|
||||
|
||||
:return: The anytype_1 of this AdditionalPropertiesClass. # noqa: E501
|
||||
:rtype: object
|
||||
"""
|
||||
return self._anytype_1
|
||||
|
||||
@anytype_1.setter
|
||||
def anytype_1(self, anytype_1):
|
||||
"""Sets the anytype_1 of this AdditionalPropertiesClass.
|
||||
|
||||
|
||||
:param anytype_1: The anytype_1 of this AdditionalPropertiesClass. # noqa: E501
|
||||
:type anytype_1: object
|
||||
"""
|
||||
|
||||
self._anytype_1 = anytype_1
|
||||
|
||||
@property
|
||||
def anytype_2(self):
|
||||
"""Gets the anytype_2 of this AdditionalPropertiesClass. # noqa: E501
|
||||
|
||||
|
||||
:return: The anytype_2 of this AdditionalPropertiesClass. # noqa: E501
|
||||
:rtype: object
|
||||
"""
|
||||
return self._anytype_2
|
||||
|
||||
@anytype_2.setter
|
||||
def anytype_2(self, anytype_2):
|
||||
"""Sets the anytype_2 of this AdditionalPropertiesClass.
|
||||
|
||||
|
||||
:param anytype_2: The anytype_2 of this AdditionalPropertiesClass. # noqa: E501
|
||||
:type anytype_2: object
|
||||
"""
|
||||
|
||||
self._anytype_2 = anytype_2
|
||||
|
||||
@property
|
||||
def anytype_3(self):
|
||||
"""Gets the anytype_3 of this AdditionalPropertiesClass. # noqa: E501
|
||||
|
||||
|
||||
:return: The anytype_3 of this AdditionalPropertiesClass. # noqa: E501
|
||||
:rtype: object
|
||||
"""
|
||||
return self._anytype_3
|
||||
|
||||
@anytype_3.setter
|
||||
def anytype_3(self, anytype_3):
|
||||
"""Sets the anytype_3 of this AdditionalPropertiesClass.
|
||||
|
||||
|
||||
:param anytype_3: The anytype_3 of this AdditionalPropertiesClass. # noqa: E501
|
||||
:type anytype_3: object
|
||||
"""
|
||||
|
||||
self._anytype_3 = anytype_3
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, AdditionalPropertiesClass):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, AdditionalPropertiesClass):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class AdditionalPropertiesInteger(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'name': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'name': 'name'
|
||||
}
|
||||
|
||||
def __init__(self, name=None, local_vars_configuration=None): # noqa: E501
|
||||
"""AdditionalPropertiesInteger - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._name = None
|
||||
self.discriminator = None
|
||||
|
||||
if name is not None:
|
||||
self.name = name
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Gets the name of this AdditionalPropertiesInteger. # noqa: E501
|
||||
|
||||
|
||||
:return: The name of this AdditionalPropertiesInteger. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name):
|
||||
"""Sets the name of this AdditionalPropertiesInteger.
|
||||
|
||||
|
||||
:param name: The name of this AdditionalPropertiesInteger. # noqa: E501
|
||||
:type name: str
|
||||
"""
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, AdditionalPropertiesInteger):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, AdditionalPropertiesInteger):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class AdditionalPropertiesNumber(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'name': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'name': 'name'
|
||||
}
|
||||
|
||||
def __init__(self, name=None, local_vars_configuration=None): # noqa: E501
|
||||
"""AdditionalPropertiesNumber - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._name = None
|
||||
self.discriminator = None
|
||||
|
||||
if name is not None:
|
||||
self.name = name
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Gets the name of this AdditionalPropertiesNumber. # noqa: E501
|
||||
|
||||
|
||||
:return: The name of this AdditionalPropertiesNumber. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name):
|
||||
"""Sets the name of this AdditionalPropertiesNumber.
|
||||
|
||||
|
||||
:param name: The name of this AdditionalPropertiesNumber. # noqa: E501
|
||||
:type name: str
|
||||
"""
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, AdditionalPropertiesNumber):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, AdditionalPropertiesNumber):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class AdditionalPropertiesObject(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'name': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'name': 'name'
|
||||
}
|
||||
|
||||
def __init__(self, name=None, local_vars_configuration=None): # noqa: E501
|
||||
"""AdditionalPropertiesObject - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._name = None
|
||||
self.discriminator = None
|
||||
|
||||
if name is not None:
|
||||
self.name = name
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Gets the name of this AdditionalPropertiesObject. # noqa: E501
|
||||
|
||||
|
||||
:return: The name of this AdditionalPropertiesObject. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name):
|
||||
"""Sets the name of this AdditionalPropertiesObject.
|
||||
|
||||
|
||||
:param name: The name of this AdditionalPropertiesObject. # noqa: E501
|
||||
:type name: str
|
||||
"""
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, AdditionalPropertiesObject):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, AdditionalPropertiesObject):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class AdditionalPropertiesString(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'name': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'name': 'name'
|
||||
}
|
||||
|
||||
def __init__(self, name=None, local_vars_configuration=None): # noqa: E501
|
||||
"""AdditionalPropertiesString - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._name = None
|
||||
self.discriminator = None
|
||||
|
||||
if name is not None:
|
||||
self.name = name
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Gets the name of this AdditionalPropertiesString. # noqa: E501
|
||||
|
||||
|
||||
:return: The name of this AdditionalPropertiesString. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name):
|
||||
"""Sets the name of this AdditionalPropertiesString.
|
||||
|
||||
|
||||
:param name: The name of this AdditionalPropertiesString. # noqa: E501
|
||||
:type name: str
|
||||
"""
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, AdditionalPropertiesString):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, AdditionalPropertiesString):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,167 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class Animal(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'class_name': 'str',
|
||||
'color': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'class_name': 'className',
|
||||
'color': 'color'
|
||||
}
|
||||
|
||||
discriminator_value_class_map = {
|
||||
'Dog': 'Dog',
|
||||
'Cat': 'Cat',
|
||||
'BigCat': 'BigCat'
|
||||
}
|
||||
|
||||
def __init__(self, class_name=None, color='red', local_vars_configuration=None): # noqa: E501
|
||||
"""Animal - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._class_name = None
|
||||
self._color = None
|
||||
self.discriminator = 'class_name'
|
||||
|
||||
self.class_name = class_name
|
||||
if color is not None:
|
||||
self.color = color
|
||||
|
||||
@property
|
||||
def class_name(self):
|
||||
"""Gets the class_name of this Animal. # noqa: E501
|
||||
|
||||
|
||||
:return: The class_name of this Animal. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._class_name
|
||||
|
||||
@class_name.setter
|
||||
def class_name(self, class_name):
|
||||
"""Sets the class_name of this Animal.
|
||||
|
||||
|
||||
:param class_name: The class_name of this Animal. # noqa: E501
|
||||
:type class_name: str
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and class_name is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `class_name`, must not be `None`") # noqa: E501
|
||||
|
||||
self._class_name = class_name
|
||||
|
||||
@property
|
||||
def color(self):
|
||||
"""Gets the color of this Animal. # noqa: E501
|
||||
|
||||
|
||||
:return: The color of this Animal. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._color
|
||||
|
||||
@color.setter
|
||||
def color(self, color):
|
||||
"""Sets the color of this Animal.
|
||||
|
||||
|
||||
:param color: The color of this Animal. # noqa: E501
|
||||
:type color: str
|
||||
"""
|
||||
|
||||
self._color = color
|
||||
|
||||
def get_real_child_model(self, data):
|
||||
"""Returns the real base class specified by the discriminator"""
|
||||
discriminator_key = self.attribute_map[self.discriminator]
|
||||
discriminator_value = data[discriminator_key]
|
||||
return self.discriminator_value_class_map.get(discriminator_value)
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, Animal):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, Animal):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,180 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class ApiResponse(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'code': 'int',
|
||||
'type': 'str',
|
||||
'message': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'code': 'code',
|
||||
'type': 'type',
|
||||
'message': 'message'
|
||||
}
|
||||
|
||||
def __init__(self, code=None, type=None, message=None, local_vars_configuration=None): # noqa: E501
|
||||
"""ApiResponse - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._code = None
|
||||
self._type = None
|
||||
self._message = None
|
||||
self.discriminator = None
|
||||
|
||||
if code is not None:
|
||||
self.code = code
|
||||
if type is not None:
|
||||
self.type = type
|
||||
if message is not None:
|
||||
self.message = message
|
||||
|
||||
@property
|
||||
def code(self):
|
||||
"""Gets the code of this ApiResponse. # noqa: E501
|
||||
|
||||
|
||||
:return: The code of this ApiResponse. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._code
|
||||
|
||||
@code.setter
|
||||
def code(self, code):
|
||||
"""Sets the code of this ApiResponse.
|
||||
|
||||
|
||||
:param code: The code of this ApiResponse. # noqa: E501
|
||||
:type code: int
|
||||
"""
|
||||
|
||||
self._code = code
|
||||
|
||||
@property
|
||||
def type(self):
|
||||
"""Gets the type of this ApiResponse. # noqa: E501
|
||||
|
||||
|
||||
:return: The type of this ApiResponse. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._type
|
||||
|
||||
@type.setter
|
||||
def type(self, type):
|
||||
"""Sets the type of this ApiResponse.
|
||||
|
||||
|
||||
:param type: The type of this ApiResponse. # noqa: E501
|
||||
:type type: str
|
||||
"""
|
||||
|
||||
self._type = type
|
||||
|
||||
@property
|
||||
def message(self):
|
||||
"""Gets the message of this ApiResponse. # noqa: E501
|
||||
|
||||
|
||||
:return: The message of this ApiResponse. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._message
|
||||
|
||||
@message.setter
|
||||
def message(self, message):
|
||||
"""Sets the message of this ApiResponse.
|
||||
|
||||
|
||||
:param message: The message of this ApiResponse. # noqa: E501
|
||||
:type message: str
|
||||
"""
|
||||
|
||||
self._message = message
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, ApiResponse):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, ApiResponse):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class ArrayOfArrayOfNumberOnly(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'array_array_number': 'list[list[float]]'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'array_array_number': 'ArrayArrayNumber'
|
||||
}
|
||||
|
||||
def __init__(self, array_array_number=None, local_vars_configuration=None): # noqa: E501
|
||||
"""ArrayOfArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._array_array_number = None
|
||||
self.discriminator = None
|
||||
|
||||
if array_array_number is not None:
|
||||
self.array_array_number = array_array_number
|
||||
|
||||
@property
|
||||
def array_array_number(self):
|
||||
"""Gets the array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501
|
||||
|
||||
|
||||
:return: The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501
|
||||
:rtype: list[list[float]]
|
||||
"""
|
||||
return self._array_array_number
|
||||
|
||||
@array_array_number.setter
|
||||
def array_array_number(self, array_array_number):
|
||||
"""Sets the array_array_number of this ArrayOfArrayOfNumberOnly.
|
||||
|
||||
|
||||
:param array_array_number: The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501
|
||||
:type array_array_number: list[list[float]]
|
||||
"""
|
||||
|
||||
self._array_array_number = array_array_number
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, ArrayOfArrayOfNumberOnly):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, ArrayOfArrayOfNumberOnly):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class ArrayOfNumberOnly(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'array_number': 'list[float]'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'array_number': 'ArrayNumber'
|
||||
}
|
||||
|
||||
def __init__(self, array_number=None, local_vars_configuration=None): # noqa: E501
|
||||
"""ArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._array_number = None
|
||||
self.discriminator = None
|
||||
|
||||
if array_number is not None:
|
||||
self.array_number = array_number
|
||||
|
||||
@property
|
||||
def array_number(self):
|
||||
"""Gets the array_number of this ArrayOfNumberOnly. # noqa: E501
|
||||
|
||||
|
||||
:return: The array_number of this ArrayOfNumberOnly. # noqa: E501
|
||||
:rtype: list[float]
|
||||
"""
|
||||
return self._array_number
|
||||
|
||||
@array_number.setter
|
||||
def array_number(self, array_number):
|
||||
"""Sets the array_number of this ArrayOfNumberOnly.
|
||||
|
||||
|
||||
:param array_number: The array_number of this ArrayOfNumberOnly. # noqa: E501
|
||||
:type array_number: list[float]
|
||||
"""
|
||||
|
||||
self._array_number = array_number
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, ArrayOfNumberOnly):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, ArrayOfNumberOnly):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,180 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class ArrayTest(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'array_of_string': 'list[str]',
|
||||
'array_array_of_integer': 'list[list[int]]',
|
||||
'array_array_of_model': 'list[list[ReadOnlyFirst]]'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'array_of_string': 'array_of_string',
|
||||
'array_array_of_integer': 'array_array_of_integer',
|
||||
'array_array_of_model': 'array_array_of_model'
|
||||
}
|
||||
|
||||
def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None, local_vars_configuration=None): # noqa: E501
|
||||
"""ArrayTest - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._array_of_string = None
|
||||
self._array_array_of_integer = None
|
||||
self._array_array_of_model = None
|
||||
self.discriminator = None
|
||||
|
||||
if array_of_string is not None:
|
||||
self.array_of_string = array_of_string
|
||||
if array_array_of_integer is not None:
|
||||
self.array_array_of_integer = array_array_of_integer
|
||||
if array_array_of_model is not None:
|
||||
self.array_array_of_model = array_array_of_model
|
||||
|
||||
@property
|
||||
def array_of_string(self):
|
||||
"""Gets the array_of_string of this ArrayTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The array_of_string of this ArrayTest. # noqa: E501
|
||||
:rtype: list[str]
|
||||
"""
|
||||
return self._array_of_string
|
||||
|
||||
@array_of_string.setter
|
||||
def array_of_string(self, array_of_string):
|
||||
"""Sets the array_of_string of this ArrayTest.
|
||||
|
||||
|
||||
:param array_of_string: The array_of_string of this ArrayTest. # noqa: E501
|
||||
:type array_of_string: list[str]
|
||||
"""
|
||||
|
||||
self._array_of_string = array_of_string
|
||||
|
||||
@property
|
||||
def array_array_of_integer(self):
|
||||
"""Gets the array_array_of_integer of this ArrayTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The array_array_of_integer of this ArrayTest. # noqa: E501
|
||||
:rtype: list[list[int]]
|
||||
"""
|
||||
return self._array_array_of_integer
|
||||
|
||||
@array_array_of_integer.setter
|
||||
def array_array_of_integer(self, array_array_of_integer):
|
||||
"""Sets the array_array_of_integer of this ArrayTest.
|
||||
|
||||
|
||||
:param array_array_of_integer: The array_array_of_integer of this ArrayTest. # noqa: E501
|
||||
:type array_array_of_integer: list[list[int]]
|
||||
"""
|
||||
|
||||
self._array_array_of_integer = array_array_of_integer
|
||||
|
||||
@property
|
||||
def array_array_of_model(self):
|
||||
"""Gets the array_array_of_model of this ArrayTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The array_array_of_model of this ArrayTest. # noqa: E501
|
||||
:rtype: list[list[ReadOnlyFirst]]
|
||||
"""
|
||||
return self._array_array_of_model
|
||||
|
||||
@array_array_of_model.setter
|
||||
def array_array_of_model(self, array_array_of_model):
|
||||
"""Sets the array_array_of_model of this ArrayTest.
|
||||
|
||||
|
||||
:param array_array_of_model: The array_array_of_model of this ArrayTest. # noqa: E501
|
||||
:type array_array_of_model: list[list[ReadOnlyFirst]]
|
||||
"""
|
||||
|
||||
self._array_array_of_model = array_array_of_model
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, ArrayTest):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, ArrayTest):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,134 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class BigCat(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'kind': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'kind': 'kind'
|
||||
}
|
||||
|
||||
def __init__(self, kind=None, local_vars_configuration=None): # noqa: E501
|
||||
"""BigCat - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._kind = None
|
||||
self.discriminator = None
|
||||
|
||||
if kind is not None:
|
||||
self.kind = kind
|
||||
|
||||
@property
|
||||
def kind(self):
|
||||
"""Gets the kind of this BigCat. # noqa: E501
|
||||
|
||||
|
||||
:return: The kind of this BigCat. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._kind
|
||||
|
||||
@kind.setter
|
||||
def kind(self, kind):
|
||||
"""Sets the kind of this BigCat.
|
||||
|
||||
|
||||
:param kind: The kind of this BigCat. # noqa: E501
|
||||
:type kind: str
|
||||
"""
|
||||
allowed_values = ["lions", "tigers", "leopards", "jaguars"] # noqa: E501
|
||||
if self.local_vars_configuration.client_side_validation and kind not in allowed_values: # noqa: E501
|
||||
raise ValueError(
|
||||
"Invalid value for `kind` ({0}), must be one of {1}" # noqa: E501
|
||||
.format(kind, allowed_values)
|
||||
)
|
||||
|
||||
self._kind = kind
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, BigCat):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, BigCat):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,134 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class BigCatAllOf(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'kind': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'kind': 'kind'
|
||||
}
|
||||
|
||||
def __init__(self, kind=None, local_vars_configuration=None): # noqa: E501
|
||||
"""BigCatAllOf - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._kind = None
|
||||
self.discriminator = None
|
||||
|
||||
if kind is not None:
|
||||
self.kind = kind
|
||||
|
||||
@property
|
||||
def kind(self):
|
||||
"""Gets the kind of this BigCatAllOf. # noqa: E501
|
||||
|
||||
|
||||
:return: The kind of this BigCatAllOf. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._kind
|
||||
|
||||
@kind.setter
|
||||
def kind(self, kind):
|
||||
"""Sets the kind of this BigCatAllOf.
|
||||
|
||||
|
||||
:param kind: The kind of this BigCatAllOf. # noqa: E501
|
||||
:type kind: str
|
||||
"""
|
||||
allowed_values = ["lions", "tigers", "leopards", "jaguars"] # noqa: E501
|
||||
if self.local_vars_configuration.client_side_validation and kind not in allowed_values: # noqa: E501
|
||||
raise ValueError(
|
||||
"Invalid value for `kind` ({0}), must be one of {1}" # noqa: E501
|
||||
.format(kind, allowed_values)
|
||||
)
|
||||
|
||||
self._kind = kind
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, BigCatAllOf):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, BigCatAllOf):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,260 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class Capitalization(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'small_camel': 'str',
|
||||
'capital_camel': 'str',
|
||||
'small_snake': 'str',
|
||||
'capital_snake': 'str',
|
||||
'sca_eth_flow_points': 'str',
|
||||
'att_name': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'small_camel': 'smallCamel',
|
||||
'capital_camel': 'CapitalCamel',
|
||||
'small_snake': 'small_Snake',
|
||||
'capital_snake': 'Capital_Snake',
|
||||
'sca_eth_flow_points': 'SCA_ETH_Flow_Points',
|
||||
'att_name': 'ATT_NAME'
|
||||
}
|
||||
|
||||
def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None, local_vars_configuration=None): # noqa: E501
|
||||
"""Capitalization - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._small_camel = None
|
||||
self._capital_camel = None
|
||||
self._small_snake = None
|
||||
self._capital_snake = None
|
||||
self._sca_eth_flow_points = None
|
||||
self._att_name = None
|
||||
self.discriminator = None
|
||||
|
||||
if small_camel is not None:
|
||||
self.small_camel = small_camel
|
||||
if capital_camel is not None:
|
||||
self.capital_camel = capital_camel
|
||||
if small_snake is not None:
|
||||
self.small_snake = small_snake
|
||||
if capital_snake is not None:
|
||||
self.capital_snake = capital_snake
|
||||
if sca_eth_flow_points is not None:
|
||||
self.sca_eth_flow_points = sca_eth_flow_points
|
||||
if att_name is not None:
|
||||
self.att_name = att_name
|
||||
|
||||
@property
|
||||
def small_camel(self):
|
||||
"""Gets the small_camel of this Capitalization. # noqa: E501
|
||||
|
||||
|
||||
:return: The small_camel of this Capitalization. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._small_camel
|
||||
|
||||
@small_camel.setter
|
||||
def small_camel(self, small_camel):
|
||||
"""Sets the small_camel of this Capitalization.
|
||||
|
||||
|
||||
:param small_camel: The small_camel of this Capitalization. # noqa: E501
|
||||
:type small_camel: str
|
||||
"""
|
||||
|
||||
self._small_camel = small_camel
|
||||
|
||||
@property
|
||||
def capital_camel(self):
|
||||
"""Gets the capital_camel of this Capitalization. # noqa: E501
|
||||
|
||||
|
||||
:return: The capital_camel of this Capitalization. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._capital_camel
|
||||
|
||||
@capital_camel.setter
|
||||
def capital_camel(self, capital_camel):
|
||||
"""Sets the capital_camel of this Capitalization.
|
||||
|
||||
|
||||
:param capital_camel: The capital_camel of this Capitalization. # noqa: E501
|
||||
:type capital_camel: str
|
||||
"""
|
||||
|
||||
self._capital_camel = capital_camel
|
||||
|
||||
@property
|
||||
def small_snake(self):
|
||||
"""Gets the small_snake of this Capitalization. # noqa: E501
|
||||
|
||||
|
||||
:return: The small_snake of this Capitalization. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._small_snake
|
||||
|
||||
@small_snake.setter
|
||||
def small_snake(self, small_snake):
|
||||
"""Sets the small_snake of this Capitalization.
|
||||
|
||||
|
||||
:param small_snake: The small_snake of this Capitalization. # noqa: E501
|
||||
:type small_snake: str
|
||||
"""
|
||||
|
||||
self._small_snake = small_snake
|
||||
|
||||
@property
|
||||
def capital_snake(self):
|
||||
"""Gets the capital_snake of this Capitalization. # noqa: E501
|
||||
|
||||
|
||||
:return: The capital_snake of this Capitalization. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._capital_snake
|
||||
|
||||
@capital_snake.setter
|
||||
def capital_snake(self, capital_snake):
|
||||
"""Sets the capital_snake of this Capitalization.
|
||||
|
||||
|
||||
:param capital_snake: The capital_snake of this Capitalization. # noqa: E501
|
||||
:type capital_snake: str
|
||||
"""
|
||||
|
||||
self._capital_snake = capital_snake
|
||||
|
||||
@property
|
||||
def sca_eth_flow_points(self):
|
||||
"""Gets the sca_eth_flow_points of this Capitalization. # noqa: E501
|
||||
|
||||
|
||||
:return: The sca_eth_flow_points of this Capitalization. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._sca_eth_flow_points
|
||||
|
||||
@sca_eth_flow_points.setter
|
||||
def sca_eth_flow_points(self, sca_eth_flow_points):
|
||||
"""Sets the sca_eth_flow_points of this Capitalization.
|
||||
|
||||
|
||||
:param sca_eth_flow_points: The sca_eth_flow_points of this Capitalization. # noqa: E501
|
||||
:type sca_eth_flow_points: str
|
||||
"""
|
||||
|
||||
self._sca_eth_flow_points = sca_eth_flow_points
|
||||
|
||||
@property
|
||||
def att_name(self):
|
||||
"""Gets the att_name of this Capitalization. # noqa: E501
|
||||
|
||||
Name of the pet # noqa: E501
|
||||
|
||||
:return: The att_name of this Capitalization. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._att_name
|
||||
|
||||
@att_name.setter
|
||||
def att_name(self, att_name):
|
||||
"""Sets the att_name of this Capitalization.
|
||||
|
||||
Name of the pet # noqa: E501
|
||||
|
||||
:param att_name: The att_name of this Capitalization. # noqa: E501
|
||||
:type att_name: str
|
||||
"""
|
||||
|
||||
self._att_name = att_name
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, Capitalization):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, Capitalization):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
128
samples/client/petstore/python-legacy/petstore_api/models/cat.py
Normal file
128
samples/client/petstore/python-legacy/petstore_api/models/cat.py
Normal file
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class Cat(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'declawed': 'bool'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'declawed': 'declawed'
|
||||
}
|
||||
|
||||
def __init__(self, declawed=None, local_vars_configuration=None): # noqa: E501
|
||||
"""Cat - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._declawed = None
|
||||
self.discriminator = None
|
||||
|
||||
if declawed is not None:
|
||||
self.declawed = declawed
|
||||
|
||||
@property
|
||||
def declawed(self):
|
||||
"""Gets the declawed of this Cat. # noqa: E501
|
||||
|
||||
|
||||
:return: The declawed of this Cat. # noqa: E501
|
||||
:rtype: bool
|
||||
"""
|
||||
return self._declawed
|
||||
|
||||
@declawed.setter
|
||||
def declawed(self, declawed):
|
||||
"""Sets the declawed of this Cat.
|
||||
|
||||
|
||||
:param declawed: The declawed of this Cat. # noqa: E501
|
||||
:type declawed: bool
|
||||
"""
|
||||
|
||||
self._declawed = declawed
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, Cat):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, Cat):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class CatAllOf(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'declawed': 'bool'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'declawed': 'declawed'
|
||||
}
|
||||
|
||||
def __init__(self, declawed=None, local_vars_configuration=None): # noqa: E501
|
||||
"""CatAllOf - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._declawed = None
|
||||
self.discriminator = None
|
||||
|
||||
if declawed is not None:
|
||||
self.declawed = declawed
|
||||
|
||||
@property
|
||||
def declawed(self):
|
||||
"""Gets the declawed of this CatAllOf. # noqa: E501
|
||||
|
||||
|
||||
:return: The declawed of this CatAllOf. # noqa: E501
|
||||
:rtype: bool
|
||||
"""
|
||||
return self._declawed
|
||||
|
||||
@declawed.setter
|
||||
def declawed(self, declawed):
|
||||
"""Sets the declawed of this CatAllOf.
|
||||
|
||||
|
||||
:param declawed: The declawed of this CatAllOf. # noqa: E501
|
||||
:type declawed: bool
|
||||
"""
|
||||
|
||||
self._declawed = declawed
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, CatAllOf):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, CatAllOf):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,155 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class Category(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'id': 'int',
|
||||
'name': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'id': 'id',
|
||||
'name': 'name'
|
||||
}
|
||||
|
||||
def __init__(self, id=None, name='default-name', local_vars_configuration=None): # noqa: E501
|
||||
"""Category - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._id = None
|
||||
self._name = None
|
||||
self.discriminator = None
|
||||
|
||||
if id is not None:
|
||||
self.id = id
|
||||
self.name = name
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""Gets the id of this Category. # noqa: E501
|
||||
|
||||
|
||||
:return: The id of this Category. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._id
|
||||
|
||||
@id.setter
|
||||
def id(self, id):
|
||||
"""Sets the id of this Category.
|
||||
|
||||
|
||||
:param id: The id of this Category. # noqa: E501
|
||||
:type id: int
|
||||
"""
|
||||
|
||||
self._id = id
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Gets the name of this Category. # noqa: E501
|
||||
|
||||
|
||||
:return: The name of this Category. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name):
|
||||
"""Sets the name of this Category.
|
||||
|
||||
|
||||
:param name: The name of this Category. # noqa: E501
|
||||
:type name: str
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, Category):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, Category):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class ClassModel(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'_class': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'_class': '_class'
|
||||
}
|
||||
|
||||
def __init__(self, _class=None, local_vars_configuration=None): # noqa: E501
|
||||
"""ClassModel - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self.__class = None
|
||||
self.discriminator = None
|
||||
|
||||
if _class is not None:
|
||||
self._class = _class
|
||||
|
||||
@property
|
||||
def _class(self):
|
||||
"""Gets the _class of this ClassModel. # noqa: E501
|
||||
|
||||
|
||||
:return: The _class of this ClassModel. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self.__class
|
||||
|
||||
@_class.setter
|
||||
def _class(self, _class):
|
||||
"""Sets the _class of this ClassModel.
|
||||
|
||||
|
||||
:param _class: The _class of this ClassModel. # noqa: E501
|
||||
:type _class: str
|
||||
"""
|
||||
|
||||
self.__class = _class
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, ClassModel):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, ClassModel):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class Client(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'client': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'client': 'client'
|
||||
}
|
||||
|
||||
def __init__(self, client=None, local_vars_configuration=None): # noqa: E501
|
||||
"""Client - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._client = None
|
||||
self.discriminator = None
|
||||
|
||||
if client is not None:
|
||||
self.client = client
|
||||
|
||||
@property
|
||||
def client(self):
|
||||
"""Gets the client of this Client. # noqa: E501
|
||||
|
||||
|
||||
:return: The client of this Client. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._client
|
||||
|
||||
@client.setter
|
||||
def client(self, client):
|
||||
"""Sets the client of this Client.
|
||||
|
||||
|
||||
:param client: The client of this Client. # noqa: E501
|
||||
:type client: str
|
||||
"""
|
||||
|
||||
self._client = client
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, Client):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, Client):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
128
samples/client/petstore/python-legacy/petstore_api/models/dog.py
Normal file
128
samples/client/petstore/python-legacy/petstore_api/models/dog.py
Normal file
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class Dog(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'breed': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'breed': 'breed'
|
||||
}
|
||||
|
||||
def __init__(self, breed=None, local_vars_configuration=None): # noqa: E501
|
||||
"""Dog - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._breed = None
|
||||
self.discriminator = None
|
||||
|
||||
if breed is not None:
|
||||
self.breed = breed
|
||||
|
||||
@property
|
||||
def breed(self):
|
||||
"""Gets the breed of this Dog. # noqa: E501
|
||||
|
||||
|
||||
:return: The breed of this Dog. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._breed
|
||||
|
||||
@breed.setter
|
||||
def breed(self, breed):
|
||||
"""Sets the breed of this Dog.
|
||||
|
||||
|
||||
:param breed: The breed of this Dog. # noqa: E501
|
||||
:type breed: str
|
||||
"""
|
||||
|
||||
self._breed = breed
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, Dog):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, Dog):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class DogAllOf(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'breed': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'breed': 'breed'
|
||||
}
|
||||
|
||||
def __init__(self, breed=None, local_vars_configuration=None): # noqa: E501
|
||||
"""DogAllOf - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._breed = None
|
||||
self.discriminator = None
|
||||
|
||||
if breed is not None:
|
||||
self.breed = breed
|
||||
|
||||
@property
|
||||
def breed(self):
|
||||
"""Gets the breed of this DogAllOf. # noqa: E501
|
||||
|
||||
|
||||
:return: The breed of this DogAllOf. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._breed
|
||||
|
||||
@breed.setter
|
||||
def breed(self, breed):
|
||||
"""Sets the breed of this DogAllOf.
|
||||
|
||||
|
||||
:param breed: The breed of this DogAllOf. # noqa: E501
|
||||
:type breed: str
|
||||
"""
|
||||
|
||||
self._breed = breed
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, DogAllOf):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, DogAllOf):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,168 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class EnumArrays(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'just_symbol': 'str',
|
||||
'array_enum': 'list[str]'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'just_symbol': 'just_symbol',
|
||||
'array_enum': 'array_enum'
|
||||
}
|
||||
|
||||
def __init__(self, just_symbol=None, array_enum=None, local_vars_configuration=None): # noqa: E501
|
||||
"""EnumArrays - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._just_symbol = None
|
||||
self._array_enum = None
|
||||
self.discriminator = None
|
||||
|
||||
if just_symbol is not None:
|
||||
self.just_symbol = just_symbol
|
||||
if array_enum is not None:
|
||||
self.array_enum = array_enum
|
||||
|
||||
@property
|
||||
def just_symbol(self):
|
||||
"""Gets the just_symbol of this EnumArrays. # noqa: E501
|
||||
|
||||
|
||||
:return: The just_symbol of this EnumArrays. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._just_symbol
|
||||
|
||||
@just_symbol.setter
|
||||
def just_symbol(self, just_symbol):
|
||||
"""Sets the just_symbol of this EnumArrays.
|
||||
|
||||
|
||||
:param just_symbol: The just_symbol of this EnumArrays. # noqa: E501
|
||||
:type just_symbol: str
|
||||
"""
|
||||
allowed_values = [">=", "$"] # noqa: E501
|
||||
if self.local_vars_configuration.client_side_validation and just_symbol not in allowed_values: # noqa: E501
|
||||
raise ValueError(
|
||||
"Invalid value for `just_symbol` ({0}), must be one of {1}" # noqa: E501
|
||||
.format(just_symbol, allowed_values)
|
||||
)
|
||||
|
||||
self._just_symbol = just_symbol
|
||||
|
||||
@property
|
||||
def array_enum(self):
|
||||
"""Gets the array_enum of this EnumArrays. # noqa: E501
|
||||
|
||||
|
||||
:return: The array_enum of this EnumArrays. # noqa: E501
|
||||
:rtype: list[str]
|
||||
"""
|
||||
return self._array_enum
|
||||
|
||||
@array_enum.setter
|
||||
def array_enum(self, array_enum):
|
||||
"""Sets the array_enum of this EnumArrays.
|
||||
|
||||
|
||||
:param array_enum: The array_enum of this EnumArrays. # noqa: E501
|
||||
:type array_enum: list[str]
|
||||
"""
|
||||
allowed_values = ["fish", "crab"] # noqa: E501
|
||||
if (self.local_vars_configuration.client_side_validation and
|
||||
not set(array_enum).issubset(set(allowed_values))): # noqa: E501
|
||||
raise ValueError(
|
||||
"Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501
|
||||
.format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501
|
||||
", ".join(map(str, allowed_values)))
|
||||
)
|
||||
|
||||
self._array_enum = array_enum
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, EnumArrays):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, EnumArrays):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,109 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class EnumClass(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
allowed enum values
|
||||
"""
|
||||
_ABC = "_abc"
|
||||
_EFG = "-efg"
|
||||
_XYZ_ = "(xyz)"
|
||||
|
||||
allowable_values = [_ABC, _EFG, _XYZ_] # noqa: E501
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
}
|
||||
|
||||
def __init__(self, local_vars_configuration=None): # noqa: E501
|
||||
"""EnumClass - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
self.discriminator = None
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, EnumClass):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, EnumClass):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,257 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class EnumTest(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'enum_string': 'str',
|
||||
'enum_string_required': 'str',
|
||||
'enum_integer': 'int',
|
||||
'enum_number': 'float',
|
||||
'outer_enum': 'OuterEnum'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'enum_string': 'enum_string',
|
||||
'enum_string_required': 'enum_string_required',
|
||||
'enum_integer': 'enum_integer',
|
||||
'enum_number': 'enum_number',
|
||||
'outer_enum': 'outerEnum'
|
||||
}
|
||||
|
||||
def __init__(self, enum_string=None, enum_string_required=None, enum_integer=None, enum_number=None, outer_enum=None, local_vars_configuration=None): # noqa: E501
|
||||
"""EnumTest - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._enum_string = None
|
||||
self._enum_string_required = None
|
||||
self._enum_integer = None
|
||||
self._enum_number = None
|
||||
self._outer_enum = None
|
||||
self.discriminator = None
|
||||
|
||||
if enum_string is not None:
|
||||
self.enum_string = enum_string
|
||||
self.enum_string_required = enum_string_required
|
||||
if enum_integer is not None:
|
||||
self.enum_integer = enum_integer
|
||||
if enum_number is not None:
|
||||
self.enum_number = enum_number
|
||||
if outer_enum is not None:
|
||||
self.outer_enum = outer_enum
|
||||
|
||||
@property
|
||||
def enum_string(self):
|
||||
"""Gets the enum_string of this EnumTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The enum_string of this EnumTest. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._enum_string
|
||||
|
||||
@enum_string.setter
|
||||
def enum_string(self, enum_string):
|
||||
"""Sets the enum_string of this EnumTest.
|
||||
|
||||
|
||||
:param enum_string: The enum_string of this EnumTest. # noqa: E501
|
||||
:type enum_string: str
|
||||
"""
|
||||
allowed_values = ["UPPER", "lower", ""] # noqa: E501
|
||||
if self.local_vars_configuration.client_side_validation and enum_string not in allowed_values: # noqa: E501
|
||||
raise ValueError(
|
||||
"Invalid value for `enum_string` ({0}), must be one of {1}" # noqa: E501
|
||||
.format(enum_string, allowed_values)
|
||||
)
|
||||
|
||||
self._enum_string = enum_string
|
||||
|
||||
@property
|
||||
def enum_string_required(self):
|
||||
"""Gets the enum_string_required of this EnumTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The enum_string_required of this EnumTest. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._enum_string_required
|
||||
|
||||
@enum_string_required.setter
|
||||
def enum_string_required(self, enum_string_required):
|
||||
"""Sets the enum_string_required of this EnumTest.
|
||||
|
||||
|
||||
:param enum_string_required: The enum_string_required of this EnumTest. # noqa: E501
|
||||
:type enum_string_required: str
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and enum_string_required is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `enum_string_required`, must not be `None`") # noqa: E501
|
||||
allowed_values = ["UPPER", "lower", ""] # noqa: E501
|
||||
if self.local_vars_configuration.client_side_validation and enum_string_required not in allowed_values: # noqa: E501
|
||||
raise ValueError(
|
||||
"Invalid value for `enum_string_required` ({0}), must be one of {1}" # noqa: E501
|
||||
.format(enum_string_required, allowed_values)
|
||||
)
|
||||
|
||||
self._enum_string_required = enum_string_required
|
||||
|
||||
@property
|
||||
def enum_integer(self):
|
||||
"""Gets the enum_integer of this EnumTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The enum_integer of this EnumTest. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._enum_integer
|
||||
|
||||
@enum_integer.setter
|
||||
def enum_integer(self, enum_integer):
|
||||
"""Sets the enum_integer of this EnumTest.
|
||||
|
||||
|
||||
:param enum_integer: The enum_integer of this EnumTest. # noqa: E501
|
||||
:type enum_integer: int
|
||||
"""
|
||||
allowed_values = [1, -1] # noqa: E501
|
||||
if self.local_vars_configuration.client_side_validation and enum_integer not in allowed_values: # noqa: E501
|
||||
raise ValueError(
|
||||
"Invalid value for `enum_integer` ({0}), must be one of {1}" # noqa: E501
|
||||
.format(enum_integer, allowed_values)
|
||||
)
|
||||
|
||||
self._enum_integer = enum_integer
|
||||
|
||||
@property
|
||||
def enum_number(self):
|
||||
"""Gets the enum_number of this EnumTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The enum_number of this EnumTest. # noqa: E501
|
||||
:rtype: float
|
||||
"""
|
||||
return self._enum_number
|
||||
|
||||
@enum_number.setter
|
||||
def enum_number(self, enum_number):
|
||||
"""Sets the enum_number of this EnumTest.
|
||||
|
||||
|
||||
:param enum_number: The enum_number of this EnumTest. # noqa: E501
|
||||
:type enum_number: float
|
||||
"""
|
||||
allowed_values = [1.1, -1.2] # noqa: E501
|
||||
if self.local_vars_configuration.client_side_validation and enum_number not in allowed_values: # noqa: E501
|
||||
raise ValueError(
|
||||
"Invalid value for `enum_number` ({0}), must be one of {1}" # noqa: E501
|
||||
.format(enum_number, allowed_values)
|
||||
)
|
||||
|
||||
self._enum_number = enum_number
|
||||
|
||||
@property
|
||||
def outer_enum(self):
|
||||
"""Gets the outer_enum of this EnumTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The outer_enum of this EnumTest. # noqa: E501
|
||||
:rtype: OuterEnum
|
||||
"""
|
||||
return self._outer_enum
|
||||
|
||||
@outer_enum.setter
|
||||
def outer_enum(self, outer_enum):
|
||||
"""Sets the outer_enum of this EnumTest.
|
||||
|
||||
|
||||
:param outer_enum: The outer_enum of this EnumTest. # noqa: E501
|
||||
:type outer_enum: OuterEnum
|
||||
"""
|
||||
|
||||
self._outer_enum = outer_enum
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, EnumTest):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, EnumTest):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,130 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class File(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'source_uri': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'source_uri': 'sourceURI'
|
||||
}
|
||||
|
||||
def __init__(self, source_uri=None, local_vars_configuration=None): # noqa: E501
|
||||
"""File - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._source_uri = None
|
||||
self.discriminator = None
|
||||
|
||||
if source_uri is not None:
|
||||
self.source_uri = source_uri
|
||||
|
||||
@property
|
||||
def source_uri(self):
|
||||
"""Gets the source_uri of this File. # noqa: E501
|
||||
|
||||
Test capitalization # noqa: E501
|
||||
|
||||
:return: The source_uri of this File. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._source_uri
|
||||
|
||||
@source_uri.setter
|
||||
def source_uri(self, source_uri):
|
||||
"""Sets the source_uri of this File.
|
||||
|
||||
Test capitalization # noqa: E501
|
||||
|
||||
:param source_uri: The source_uri of this File. # noqa: E501
|
||||
:type source_uri: str
|
||||
"""
|
||||
|
||||
self._source_uri = source_uri
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, File):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, File):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,154 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class FileSchemaTestClass(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'file': 'File',
|
||||
'files': 'list[File]'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'file': 'file',
|
||||
'files': 'files'
|
||||
}
|
||||
|
||||
def __init__(self, file=None, files=None, local_vars_configuration=None): # noqa: E501
|
||||
"""FileSchemaTestClass - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._file = None
|
||||
self._files = None
|
||||
self.discriminator = None
|
||||
|
||||
if file is not None:
|
||||
self.file = file
|
||||
if files is not None:
|
||||
self.files = files
|
||||
|
||||
@property
|
||||
def file(self):
|
||||
"""Gets the file of this FileSchemaTestClass. # noqa: E501
|
||||
|
||||
|
||||
:return: The file of this FileSchemaTestClass. # noqa: E501
|
||||
:rtype: File
|
||||
"""
|
||||
return self._file
|
||||
|
||||
@file.setter
|
||||
def file(self, file):
|
||||
"""Sets the file of this FileSchemaTestClass.
|
||||
|
||||
|
||||
:param file: The file of this FileSchemaTestClass. # noqa: E501
|
||||
:type file: File
|
||||
"""
|
||||
|
||||
self._file = file
|
||||
|
||||
@property
|
||||
def files(self):
|
||||
"""Gets the files of this FileSchemaTestClass. # noqa: E501
|
||||
|
||||
|
||||
:return: The files of this FileSchemaTestClass. # noqa: E501
|
||||
:rtype: list[File]
|
||||
"""
|
||||
return self._files
|
||||
|
||||
@files.setter
|
||||
def files(self, files):
|
||||
"""Sets the files of this FileSchemaTestClass.
|
||||
|
||||
|
||||
:param files: The files of this FileSchemaTestClass. # noqa: E501
|
||||
:type files: list[File]
|
||||
"""
|
||||
|
||||
self._files = files
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, FileSchemaTestClass):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, FileSchemaTestClass):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,512 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class FormatTest(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'integer': 'int',
|
||||
'int32': 'int',
|
||||
'int64': 'int',
|
||||
'number': 'float',
|
||||
'float': 'float',
|
||||
'double': 'float',
|
||||
'string': 'str',
|
||||
'byte': 'str',
|
||||
'binary': 'file',
|
||||
'date': 'date',
|
||||
'date_time': 'datetime',
|
||||
'uuid': 'str',
|
||||
'password': 'str',
|
||||
'big_decimal': 'Decimal'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'integer': 'integer',
|
||||
'int32': 'int32',
|
||||
'int64': 'int64',
|
||||
'number': 'number',
|
||||
'float': 'float',
|
||||
'double': 'double',
|
||||
'string': 'string',
|
||||
'byte': 'byte',
|
||||
'binary': 'binary',
|
||||
'date': 'date',
|
||||
'date_time': 'dateTime',
|
||||
'uuid': 'uuid',
|
||||
'password': 'password',
|
||||
'big_decimal': 'BigDecimal'
|
||||
}
|
||||
|
||||
def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None, big_decimal=None, local_vars_configuration=None): # noqa: E501
|
||||
"""FormatTest - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._integer = None
|
||||
self._int32 = None
|
||||
self._int64 = None
|
||||
self._number = None
|
||||
self._float = None
|
||||
self._double = None
|
||||
self._string = None
|
||||
self._byte = None
|
||||
self._binary = None
|
||||
self._date = None
|
||||
self._date_time = None
|
||||
self._uuid = None
|
||||
self._password = None
|
||||
self._big_decimal = None
|
||||
self.discriminator = None
|
||||
|
||||
if integer is not None:
|
||||
self.integer = integer
|
||||
if int32 is not None:
|
||||
self.int32 = int32
|
||||
if int64 is not None:
|
||||
self.int64 = int64
|
||||
self.number = number
|
||||
if float is not None:
|
||||
self.float = float
|
||||
if double is not None:
|
||||
self.double = double
|
||||
if string is not None:
|
||||
self.string = string
|
||||
self.byte = byte
|
||||
if binary is not None:
|
||||
self.binary = binary
|
||||
self.date = date
|
||||
if date_time is not None:
|
||||
self.date_time = date_time
|
||||
if uuid is not None:
|
||||
self.uuid = uuid
|
||||
self.password = password
|
||||
if big_decimal is not None:
|
||||
self.big_decimal = big_decimal
|
||||
|
||||
@property
|
||||
def integer(self):
|
||||
"""Gets the integer of this FormatTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The integer of this FormatTest. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._integer
|
||||
|
||||
@integer.setter
|
||||
def integer(self, integer):
|
||||
"""Sets the integer of this FormatTest.
|
||||
|
||||
|
||||
:param integer: The integer of this FormatTest. # noqa: E501
|
||||
:type integer: int
|
||||
"""
|
||||
if (self.local_vars_configuration.client_side_validation and
|
||||
integer is not None and integer > 100): # noqa: E501
|
||||
raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100`") # noqa: E501
|
||||
if (self.local_vars_configuration.client_side_validation and
|
||||
integer is not None and integer < 10): # noqa: E501
|
||||
raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") # noqa: E501
|
||||
|
||||
self._integer = integer
|
||||
|
||||
@property
|
||||
def int32(self):
|
||||
"""Gets the int32 of this FormatTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The int32 of this FormatTest. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._int32
|
||||
|
||||
@int32.setter
|
||||
def int32(self, int32):
|
||||
"""Sets the int32 of this FormatTest.
|
||||
|
||||
|
||||
:param int32: The int32 of this FormatTest. # noqa: E501
|
||||
:type int32: int
|
||||
"""
|
||||
if (self.local_vars_configuration.client_side_validation and
|
||||
int32 is not None and int32 > 200): # noqa: E501
|
||||
raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200`") # noqa: E501
|
||||
if (self.local_vars_configuration.client_side_validation and
|
||||
int32 is not None and int32 < 20): # noqa: E501
|
||||
raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") # noqa: E501
|
||||
|
||||
self._int32 = int32
|
||||
|
||||
@property
|
||||
def int64(self):
|
||||
"""Gets the int64 of this FormatTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The int64 of this FormatTest. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._int64
|
||||
|
||||
@int64.setter
|
||||
def int64(self, int64):
|
||||
"""Sets the int64 of this FormatTest.
|
||||
|
||||
|
||||
:param int64: The int64 of this FormatTest. # noqa: E501
|
||||
:type int64: int
|
||||
"""
|
||||
|
||||
self._int64 = int64
|
||||
|
||||
@property
|
||||
def number(self):
|
||||
"""Gets the number of this FormatTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The number of this FormatTest. # noqa: E501
|
||||
:rtype: float
|
||||
"""
|
||||
return self._number
|
||||
|
||||
@number.setter
|
||||
def number(self, number):
|
||||
"""Sets the number of this FormatTest.
|
||||
|
||||
|
||||
:param number: The number of this FormatTest. # noqa: E501
|
||||
:type number: float
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and number is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501
|
||||
if (self.local_vars_configuration.client_side_validation and
|
||||
number is not None and number > 543.2): # noqa: E501
|
||||
raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`") # noqa: E501
|
||||
if (self.local_vars_configuration.client_side_validation and
|
||||
number is not None and number < 32.1): # noqa: E501
|
||||
raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") # noqa: E501
|
||||
|
||||
self._number = number
|
||||
|
||||
@property
|
||||
def float(self):
|
||||
"""Gets the float of this FormatTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The float of this FormatTest. # noqa: E501
|
||||
:rtype: float
|
||||
"""
|
||||
return self._float
|
||||
|
||||
@float.setter
|
||||
def float(self, float):
|
||||
"""Sets the float of this FormatTest.
|
||||
|
||||
|
||||
:param float: The float of this FormatTest. # noqa: E501
|
||||
:type float: float
|
||||
"""
|
||||
if (self.local_vars_configuration.client_side_validation and
|
||||
float is not None and float > 987.6): # noqa: E501
|
||||
raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") # noqa: E501
|
||||
if (self.local_vars_configuration.client_side_validation and
|
||||
float is not None and float < 54.3): # noqa: E501
|
||||
raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") # noqa: E501
|
||||
|
||||
self._float = float
|
||||
|
||||
@property
|
||||
def double(self):
|
||||
"""Gets the double of this FormatTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The double of this FormatTest. # noqa: E501
|
||||
:rtype: float
|
||||
"""
|
||||
return self._double
|
||||
|
||||
@double.setter
|
||||
def double(self, double):
|
||||
"""Sets the double of this FormatTest.
|
||||
|
||||
|
||||
:param double: The double of this FormatTest. # noqa: E501
|
||||
:type double: float
|
||||
"""
|
||||
if (self.local_vars_configuration.client_side_validation and
|
||||
double is not None and double > 123.4): # noqa: E501
|
||||
raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`") # noqa: E501
|
||||
if (self.local_vars_configuration.client_side_validation and
|
||||
double is not None and double < 67.8): # noqa: E501
|
||||
raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") # noqa: E501
|
||||
|
||||
self._double = double
|
||||
|
||||
@property
|
||||
def string(self):
|
||||
"""Gets the string of this FormatTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The string of this FormatTest. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._string
|
||||
|
||||
@string.setter
|
||||
def string(self, string):
|
||||
"""Sets the string of this FormatTest.
|
||||
|
||||
|
||||
:param string: The string of this FormatTest. # noqa: E501
|
||||
:type string: str
|
||||
"""
|
||||
if (self.local_vars_configuration.client_side_validation and
|
||||
string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE)): # noqa: E501
|
||||
raise ValueError(r"Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501
|
||||
|
||||
self._string = string
|
||||
|
||||
@property
|
||||
def byte(self):
|
||||
"""Gets the byte of this FormatTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The byte of this FormatTest. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._byte
|
||||
|
||||
@byte.setter
|
||||
def byte(self, byte):
|
||||
"""Sets the byte of this FormatTest.
|
||||
|
||||
|
||||
:param byte: The byte of this FormatTest. # noqa: E501
|
||||
:type byte: str
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and byte is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501
|
||||
if (self.local_vars_configuration.client_side_validation and
|
||||
byte is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte)): # noqa: E501
|
||||
raise ValueError(r"Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501
|
||||
|
||||
self._byte = byte
|
||||
|
||||
@property
|
||||
def binary(self):
|
||||
"""Gets the binary of this FormatTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The binary of this FormatTest. # noqa: E501
|
||||
:rtype: file
|
||||
"""
|
||||
return self._binary
|
||||
|
||||
@binary.setter
|
||||
def binary(self, binary):
|
||||
"""Sets the binary of this FormatTest.
|
||||
|
||||
|
||||
:param binary: The binary of this FormatTest. # noqa: E501
|
||||
:type binary: file
|
||||
"""
|
||||
|
||||
self._binary = binary
|
||||
|
||||
@property
|
||||
def date(self):
|
||||
"""Gets the date of this FormatTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The date of this FormatTest. # noqa: E501
|
||||
:rtype: date
|
||||
"""
|
||||
return self._date
|
||||
|
||||
@date.setter
|
||||
def date(self, date):
|
||||
"""Sets the date of this FormatTest.
|
||||
|
||||
|
||||
:param date: The date of this FormatTest. # noqa: E501
|
||||
:type date: date
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and date is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501
|
||||
|
||||
self._date = date
|
||||
|
||||
@property
|
||||
def date_time(self):
|
||||
"""Gets the date_time of this FormatTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The date_time of this FormatTest. # noqa: E501
|
||||
:rtype: datetime
|
||||
"""
|
||||
return self._date_time
|
||||
|
||||
@date_time.setter
|
||||
def date_time(self, date_time):
|
||||
"""Sets the date_time of this FormatTest.
|
||||
|
||||
|
||||
:param date_time: The date_time of this FormatTest. # noqa: E501
|
||||
:type date_time: datetime
|
||||
"""
|
||||
|
||||
self._date_time = date_time
|
||||
|
||||
@property
|
||||
def uuid(self):
|
||||
"""Gets the uuid of this FormatTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The uuid of this FormatTest. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._uuid
|
||||
|
||||
@uuid.setter
|
||||
def uuid(self, uuid):
|
||||
"""Sets the uuid of this FormatTest.
|
||||
|
||||
|
||||
:param uuid: The uuid of this FormatTest. # noqa: E501
|
||||
:type uuid: str
|
||||
"""
|
||||
|
||||
self._uuid = uuid
|
||||
|
||||
@property
|
||||
def password(self):
|
||||
"""Gets the password of this FormatTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The password of this FormatTest. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._password
|
||||
|
||||
@password.setter
|
||||
def password(self, password):
|
||||
"""Sets the password of this FormatTest.
|
||||
|
||||
|
||||
:param password: The password of this FormatTest. # noqa: E501
|
||||
:type password: str
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and password is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501
|
||||
if (self.local_vars_configuration.client_side_validation and
|
||||
password is not None and len(password) > 64):
|
||||
raise ValueError("Invalid value for `password`, length must be less than or equal to `64`") # noqa: E501
|
||||
if (self.local_vars_configuration.client_side_validation and
|
||||
password is not None and len(password) < 10):
|
||||
raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`") # noqa: E501
|
||||
|
||||
self._password = password
|
||||
|
||||
@property
|
||||
def big_decimal(self):
|
||||
"""Gets the big_decimal of this FormatTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The big_decimal of this FormatTest. # noqa: E501
|
||||
:rtype: Decimal
|
||||
"""
|
||||
return self._big_decimal
|
||||
|
||||
@big_decimal.setter
|
||||
def big_decimal(self, big_decimal):
|
||||
"""Sets the big_decimal of this FormatTest.
|
||||
|
||||
|
||||
:param big_decimal: The big_decimal of this FormatTest. # noqa: E501
|
||||
:type big_decimal: Decimal
|
||||
"""
|
||||
|
||||
self._big_decimal = big_decimal
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, FormatTest):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, FormatTest):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,154 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class HasOnlyReadOnly(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'bar': 'str',
|
||||
'foo': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'bar': 'bar',
|
||||
'foo': 'foo'
|
||||
}
|
||||
|
||||
def __init__(self, bar=None, foo=None, local_vars_configuration=None): # noqa: E501
|
||||
"""HasOnlyReadOnly - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._bar = None
|
||||
self._foo = None
|
||||
self.discriminator = None
|
||||
|
||||
if bar is not None:
|
||||
self.bar = bar
|
||||
if foo is not None:
|
||||
self.foo = foo
|
||||
|
||||
@property
|
||||
def bar(self):
|
||||
"""Gets the bar of this HasOnlyReadOnly. # noqa: E501
|
||||
|
||||
|
||||
:return: The bar of this HasOnlyReadOnly. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._bar
|
||||
|
||||
@bar.setter
|
||||
def bar(self, bar):
|
||||
"""Sets the bar of this HasOnlyReadOnly.
|
||||
|
||||
|
||||
:param bar: The bar of this HasOnlyReadOnly. # noqa: E501
|
||||
:type bar: str
|
||||
"""
|
||||
|
||||
self._bar = bar
|
||||
|
||||
@property
|
||||
def foo(self):
|
||||
"""Gets the foo of this HasOnlyReadOnly. # noqa: E501
|
||||
|
||||
|
||||
:return: The foo of this HasOnlyReadOnly. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._foo
|
||||
|
||||
@foo.setter
|
||||
def foo(self, foo):
|
||||
"""Sets the foo of this HasOnlyReadOnly.
|
||||
|
||||
|
||||
:param foo: The foo of this HasOnlyReadOnly. # noqa: E501
|
||||
:type foo: str
|
||||
"""
|
||||
|
||||
self._foo = foo
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, HasOnlyReadOnly):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, HasOnlyReadOnly):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class List(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'_123_list': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'_123_list': '123-list'
|
||||
}
|
||||
|
||||
def __init__(self, _123_list=None, local_vars_configuration=None): # noqa: E501
|
||||
"""List - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self.__123_list = None
|
||||
self.discriminator = None
|
||||
|
||||
if _123_list is not None:
|
||||
self._123_list = _123_list
|
||||
|
||||
@property
|
||||
def _123_list(self):
|
||||
"""Gets the _123_list of this List. # noqa: E501
|
||||
|
||||
|
||||
:return: The _123_list of this List. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self.__123_list
|
||||
|
||||
@_123_list.setter
|
||||
def _123_list(self, _123_list):
|
||||
"""Sets the _123_list of this List.
|
||||
|
||||
|
||||
:param _123_list: The _123_list of this List. # noqa: E501
|
||||
:type _123_list: str
|
||||
"""
|
||||
|
||||
self.__123_list = _123_list
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, List):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, List):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,214 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class MapTest(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'map_map_of_string': 'dict(str, dict(str, str))',
|
||||
'map_of_enum_string': 'dict(str, str)',
|
||||
'direct_map': 'dict(str, bool)',
|
||||
'indirect_map': 'dict(str, bool)'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'map_map_of_string': 'map_map_of_string',
|
||||
'map_of_enum_string': 'map_of_enum_string',
|
||||
'direct_map': 'direct_map',
|
||||
'indirect_map': 'indirect_map'
|
||||
}
|
||||
|
||||
def __init__(self, map_map_of_string=None, map_of_enum_string=None, direct_map=None, indirect_map=None, local_vars_configuration=None): # noqa: E501
|
||||
"""MapTest - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._map_map_of_string = None
|
||||
self._map_of_enum_string = None
|
||||
self._direct_map = None
|
||||
self._indirect_map = None
|
||||
self.discriminator = None
|
||||
|
||||
if map_map_of_string is not None:
|
||||
self.map_map_of_string = map_map_of_string
|
||||
if map_of_enum_string is not None:
|
||||
self.map_of_enum_string = map_of_enum_string
|
||||
if direct_map is not None:
|
||||
self.direct_map = direct_map
|
||||
if indirect_map is not None:
|
||||
self.indirect_map = indirect_map
|
||||
|
||||
@property
|
||||
def map_map_of_string(self):
|
||||
"""Gets the map_map_of_string of this MapTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The map_map_of_string of this MapTest. # noqa: E501
|
||||
:rtype: dict(str, dict(str, str))
|
||||
"""
|
||||
return self._map_map_of_string
|
||||
|
||||
@map_map_of_string.setter
|
||||
def map_map_of_string(self, map_map_of_string):
|
||||
"""Sets the map_map_of_string of this MapTest.
|
||||
|
||||
|
||||
:param map_map_of_string: The map_map_of_string of this MapTest. # noqa: E501
|
||||
:type map_map_of_string: dict(str, dict(str, str))
|
||||
"""
|
||||
|
||||
self._map_map_of_string = map_map_of_string
|
||||
|
||||
@property
|
||||
def map_of_enum_string(self):
|
||||
"""Gets the map_of_enum_string of this MapTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The map_of_enum_string of this MapTest. # noqa: E501
|
||||
:rtype: dict(str, str)
|
||||
"""
|
||||
return self._map_of_enum_string
|
||||
|
||||
@map_of_enum_string.setter
|
||||
def map_of_enum_string(self, map_of_enum_string):
|
||||
"""Sets the map_of_enum_string of this MapTest.
|
||||
|
||||
|
||||
:param map_of_enum_string: The map_of_enum_string of this MapTest. # noqa: E501
|
||||
:type map_of_enum_string: dict(str, str)
|
||||
"""
|
||||
allowed_values = ["UPPER", "lower"] # noqa: E501
|
||||
if (self.local_vars_configuration.client_side_validation and
|
||||
not set(map_of_enum_string.keys()).issubset(set(allowed_values))): # noqa: E501
|
||||
raise ValueError(
|
||||
"Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501
|
||||
.format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501
|
||||
", ".join(map(str, allowed_values)))
|
||||
)
|
||||
|
||||
self._map_of_enum_string = map_of_enum_string
|
||||
|
||||
@property
|
||||
def direct_map(self):
|
||||
"""Gets the direct_map of this MapTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The direct_map of this MapTest. # noqa: E501
|
||||
:rtype: dict(str, bool)
|
||||
"""
|
||||
return self._direct_map
|
||||
|
||||
@direct_map.setter
|
||||
def direct_map(self, direct_map):
|
||||
"""Sets the direct_map of this MapTest.
|
||||
|
||||
|
||||
:param direct_map: The direct_map of this MapTest. # noqa: E501
|
||||
:type direct_map: dict(str, bool)
|
||||
"""
|
||||
|
||||
self._direct_map = direct_map
|
||||
|
||||
@property
|
||||
def indirect_map(self):
|
||||
"""Gets the indirect_map of this MapTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The indirect_map of this MapTest. # noqa: E501
|
||||
:rtype: dict(str, bool)
|
||||
"""
|
||||
return self._indirect_map
|
||||
|
||||
@indirect_map.setter
|
||||
def indirect_map(self, indirect_map):
|
||||
"""Sets the indirect_map of this MapTest.
|
||||
|
||||
|
||||
:param indirect_map: The indirect_map of this MapTest. # noqa: E501
|
||||
:type indirect_map: dict(str, bool)
|
||||
"""
|
||||
|
||||
self._indirect_map = indirect_map
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, MapTest):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, MapTest):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,180 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class MixedPropertiesAndAdditionalPropertiesClass(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'uuid': 'str',
|
||||
'date_time': 'datetime',
|
||||
'map': 'dict(str, Animal)'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'uuid': 'uuid',
|
||||
'date_time': 'dateTime',
|
||||
'map': 'map'
|
||||
}
|
||||
|
||||
def __init__(self, uuid=None, date_time=None, map=None, local_vars_configuration=None): # noqa: E501
|
||||
"""MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._uuid = None
|
||||
self._date_time = None
|
||||
self._map = None
|
||||
self.discriminator = None
|
||||
|
||||
if uuid is not None:
|
||||
self.uuid = uuid
|
||||
if date_time is not None:
|
||||
self.date_time = date_time
|
||||
if map is not None:
|
||||
self.map = map
|
||||
|
||||
@property
|
||||
def uuid(self):
|
||||
"""Gets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
|
||||
|
||||
|
||||
:return: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._uuid
|
||||
|
||||
@uuid.setter
|
||||
def uuid(self, uuid):
|
||||
"""Sets the uuid of this MixedPropertiesAndAdditionalPropertiesClass.
|
||||
|
||||
|
||||
:param uuid: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
|
||||
:type uuid: str
|
||||
"""
|
||||
|
||||
self._uuid = uuid
|
||||
|
||||
@property
|
||||
def date_time(self):
|
||||
"""Gets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
|
||||
|
||||
|
||||
:return: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
|
||||
:rtype: datetime
|
||||
"""
|
||||
return self._date_time
|
||||
|
||||
@date_time.setter
|
||||
def date_time(self, date_time):
|
||||
"""Sets the date_time of this MixedPropertiesAndAdditionalPropertiesClass.
|
||||
|
||||
|
||||
:param date_time: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
|
||||
:type date_time: datetime
|
||||
"""
|
||||
|
||||
self._date_time = date_time
|
||||
|
||||
@property
|
||||
def map(self):
|
||||
"""Gets the map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
|
||||
|
||||
|
||||
:return: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
|
||||
:rtype: dict(str, Animal)
|
||||
"""
|
||||
return self._map
|
||||
|
||||
@map.setter
|
||||
def map(self, map):
|
||||
"""Sets the map of this MixedPropertiesAndAdditionalPropertiesClass.
|
||||
|
||||
|
||||
:param map: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501
|
||||
:type map: dict(str, Animal)
|
||||
"""
|
||||
|
||||
self._map = map
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,154 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class Model200Response(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'name': 'int',
|
||||
'_class': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'name': 'name',
|
||||
'_class': 'class'
|
||||
}
|
||||
|
||||
def __init__(self, name=None, _class=None, local_vars_configuration=None): # noqa: E501
|
||||
"""Model200Response - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._name = None
|
||||
self.__class = None
|
||||
self.discriminator = None
|
||||
|
||||
if name is not None:
|
||||
self.name = name
|
||||
if _class is not None:
|
||||
self._class = _class
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Gets the name of this Model200Response. # noqa: E501
|
||||
|
||||
|
||||
:return: The name of this Model200Response. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name):
|
||||
"""Sets the name of this Model200Response.
|
||||
|
||||
|
||||
:param name: The name of this Model200Response. # noqa: E501
|
||||
:type name: int
|
||||
"""
|
||||
|
||||
self._name = name
|
||||
|
||||
@property
|
||||
def _class(self):
|
||||
"""Gets the _class of this Model200Response. # noqa: E501
|
||||
|
||||
|
||||
:return: The _class of this Model200Response. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self.__class
|
||||
|
||||
@_class.setter
|
||||
def _class(self, _class):
|
||||
"""Sets the _class of this Model200Response.
|
||||
|
||||
|
||||
:param _class: The _class of this Model200Response. # noqa: E501
|
||||
:type _class: str
|
||||
"""
|
||||
|
||||
self.__class = _class
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, Model200Response):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, Model200Response):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class ModelReturn(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'_return': 'int'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'_return': 'return'
|
||||
}
|
||||
|
||||
def __init__(self, _return=None, local_vars_configuration=None): # noqa: E501
|
||||
"""ModelReturn - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self.__return = None
|
||||
self.discriminator = None
|
||||
|
||||
if _return is not None:
|
||||
self._return = _return
|
||||
|
||||
@property
|
||||
def _return(self):
|
||||
"""Gets the _return of this ModelReturn. # noqa: E501
|
||||
|
||||
|
||||
:return: The _return of this ModelReturn. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self.__return
|
||||
|
||||
@_return.setter
|
||||
def _return(self, _return):
|
||||
"""Sets the _return of this ModelReturn.
|
||||
|
||||
|
||||
:param _return: The _return of this ModelReturn. # noqa: E501
|
||||
:type _return: int
|
||||
"""
|
||||
|
||||
self.__return = _return
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, ModelReturn):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, ModelReturn):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,207 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class Name(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'name': 'int',
|
||||
'snake_case': 'int',
|
||||
'_property': 'str',
|
||||
'_123_number': 'int'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'name': 'name',
|
||||
'snake_case': 'snake_case',
|
||||
'_property': 'property',
|
||||
'_123_number': '123Number'
|
||||
}
|
||||
|
||||
def __init__(self, name=None, snake_case=None, _property=None, _123_number=None, local_vars_configuration=None): # noqa: E501
|
||||
"""Name - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._name = None
|
||||
self._snake_case = None
|
||||
self.__property = None
|
||||
self.__123_number = None
|
||||
self.discriminator = None
|
||||
|
||||
self.name = name
|
||||
if snake_case is not None:
|
||||
self.snake_case = snake_case
|
||||
if _property is not None:
|
||||
self._property = _property
|
||||
if _123_number is not None:
|
||||
self._123_number = _123_number
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Gets the name of this Name. # noqa: E501
|
||||
|
||||
|
||||
:return: The name of this Name. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name):
|
||||
"""Sets the name of this Name.
|
||||
|
||||
|
||||
:param name: The name of this Name. # noqa: E501
|
||||
:type name: int
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
|
||||
|
||||
self._name = name
|
||||
|
||||
@property
|
||||
def snake_case(self):
|
||||
"""Gets the snake_case of this Name. # noqa: E501
|
||||
|
||||
|
||||
:return: The snake_case of this Name. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._snake_case
|
||||
|
||||
@snake_case.setter
|
||||
def snake_case(self, snake_case):
|
||||
"""Sets the snake_case of this Name.
|
||||
|
||||
|
||||
:param snake_case: The snake_case of this Name. # noqa: E501
|
||||
:type snake_case: int
|
||||
"""
|
||||
|
||||
self._snake_case = snake_case
|
||||
|
||||
@property
|
||||
def _property(self):
|
||||
"""Gets the _property of this Name. # noqa: E501
|
||||
|
||||
|
||||
:return: The _property of this Name. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self.__property
|
||||
|
||||
@_property.setter
|
||||
def _property(self, _property):
|
||||
"""Sets the _property of this Name.
|
||||
|
||||
|
||||
:param _property: The _property of this Name. # noqa: E501
|
||||
:type _property: str
|
||||
"""
|
||||
|
||||
self.__property = _property
|
||||
|
||||
@property
|
||||
def _123_number(self):
|
||||
"""Gets the _123_number of this Name. # noqa: E501
|
||||
|
||||
|
||||
:return: The _123_number of this Name. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self.__123_number
|
||||
|
||||
@_123_number.setter
|
||||
def _123_number(self, _123_number):
|
||||
"""Sets the _123_number of this Name.
|
||||
|
||||
|
||||
:param _123_number: The _123_number of this Name. # noqa: E501
|
||||
:type _123_number: int
|
||||
"""
|
||||
|
||||
self.__123_number = _123_number
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, Name):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, Name):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class NumberOnly(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'just_number': 'float'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'just_number': 'JustNumber'
|
||||
}
|
||||
|
||||
def __init__(self, just_number=None, local_vars_configuration=None): # noqa: E501
|
||||
"""NumberOnly - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._just_number = None
|
||||
self.discriminator = None
|
||||
|
||||
if just_number is not None:
|
||||
self.just_number = just_number
|
||||
|
||||
@property
|
||||
def just_number(self):
|
||||
"""Gets the just_number of this NumberOnly. # noqa: E501
|
||||
|
||||
|
||||
:return: The just_number of this NumberOnly. # noqa: E501
|
||||
:rtype: float
|
||||
"""
|
||||
return self._just_number
|
||||
|
||||
@just_number.setter
|
||||
def just_number(self, just_number):
|
||||
"""Sets the just_number of this NumberOnly.
|
||||
|
||||
|
||||
:param just_number: The just_number of this NumberOnly. # noqa: E501
|
||||
:type just_number: float
|
||||
"""
|
||||
|
||||
self._just_number = just_number
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, NumberOnly):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, NumberOnly):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,266 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class Order(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'id': 'int',
|
||||
'pet_id': 'int',
|
||||
'quantity': 'int',
|
||||
'ship_date': 'datetime',
|
||||
'status': 'str',
|
||||
'complete': 'bool'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'id': 'id',
|
||||
'pet_id': 'petId',
|
||||
'quantity': 'quantity',
|
||||
'ship_date': 'shipDate',
|
||||
'status': 'status',
|
||||
'complete': 'complete'
|
||||
}
|
||||
|
||||
def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False, local_vars_configuration=None): # noqa: E501
|
||||
"""Order - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._id = None
|
||||
self._pet_id = None
|
||||
self._quantity = None
|
||||
self._ship_date = None
|
||||
self._status = None
|
||||
self._complete = None
|
||||
self.discriminator = None
|
||||
|
||||
if id is not None:
|
||||
self.id = id
|
||||
if pet_id is not None:
|
||||
self.pet_id = pet_id
|
||||
if quantity is not None:
|
||||
self.quantity = quantity
|
||||
if ship_date is not None:
|
||||
self.ship_date = ship_date
|
||||
if status is not None:
|
||||
self.status = status
|
||||
if complete is not None:
|
||||
self.complete = complete
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""Gets the id of this Order. # noqa: E501
|
||||
|
||||
|
||||
:return: The id of this Order. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._id
|
||||
|
||||
@id.setter
|
||||
def id(self, id):
|
||||
"""Sets the id of this Order.
|
||||
|
||||
|
||||
:param id: The id of this Order. # noqa: E501
|
||||
:type id: int
|
||||
"""
|
||||
|
||||
self._id = id
|
||||
|
||||
@property
|
||||
def pet_id(self):
|
||||
"""Gets the pet_id of this Order. # noqa: E501
|
||||
|
||||
|
||||
:return: The pet_id of this Order. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._pet_id
|
||||
|
||||
@pet_id.setter
|
||||
def pet_id(self, pet_id):
|
||||
"""Sets the pet_id of this Order.
|
||||
|
||||
|
||||
:param pet_id: The pet_id of this Order. # noqa: E501
|
||||
:type pet_id: int
|
||||
"""
|
||||
|
||||
self._pet_id = pet_id
|
||||
|
||||
@property
|
||||
def quantity(self):
|
||||
"""Gets the quantity of this Order. # noqa: E501
|
||||
|
||||
|
||||
:return: The quantity of this Order. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._quantity
|
||||
|
||||
@quantity.setter
|
||||
def quantity(self, quantity):
|
||||
"""Sets the quantity of this Order.
|
||||
|
||||
|
||||
:param quantity: The quantity of this Order. # noqa: E501
|
||||
:type quantity: int
|
||||
"""
|
||||
|
||||
self._quantity = quantity
|
||||
|
||||
@property
|
||||
def ship_date(self):
|
||||
"""Gets the ship_date of this Order. # noqa: E501
|
||||
|
||||
|
||||
:return: The ship_date of this Order. # noqa: E501
|
||||
:rtype: datetime
|
||||
"""
|
||||
return self._ship_date
|
||||
|
||||
@ship_date.setter
|
||||
def ship_date(self, ship_date):
|
||||
"""Sets the ship_date of this Order.
|
||||
|
||||
|
||||
:param ship_date: The ship_date of this Order. # noqa: E501
|
||||
:type ship_date: datetime
|
||||
"""
|
||||
|
||||
self._ship_date = ship_date
|
||||
|
||||
@property
|
||||
def status(self):
|
||||
"""Gets the status of this Order. # noqa: E501
|
||||
|
||||
Order Status # noqa: E501
|
||||
|
||||
:return: The status of this Order. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._status
|
||||
|
||||
@status.setter
|
||||
def status(self, status):
|
||||
"""Sets the status of this Order.
|
||||
|
||||
Order Status # noqa: E501
|
||||
|
||||
:param status: The status of this Order. # noqa: E501
|
||||
:type status: str
|
||||
"""
|
||||
allowed_values = ["placed", "approved", "delivered"] # noqa: E501
|
||||
if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501
|
||||
raise ValueError(
|
||||
"Invalid value for `status` ({0}), must be one of {1}" # noqa: E501
|
||||
.format(status, allowed_values)
|
||||
)
|
||||
|
||||
self._status = status
|
||||
|
||||
@property
|
||||
def complete(self):
|
||||
"""Gets the complete of this Order. # noqa: E501
|
||||
|
||||
|
||||
:return: The complete of this Order. # noqa: E501
|
||||
:rtype: bool
|
||||
"""
|
||||
return self._complete
|
||||
|
||||
@complete.setter
|
||||
def complete(self, complete):
|
||||
"""Sets the complete of this Order.
|
||||
|
||||
|
||||
:param complete: The complete of this Order. # noqa: E501
|
||||
:type complete: bool
|
||||
"""
|
||||
|
||||
self._complete = complete
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, Order):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, Order):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,180 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class OuterComposite(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'my_number': 'float',
|
||||
'my_string': 'str',
|
||||
'my_boolean': 'bool'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'my_number': 'my_number',
|
||||
'my_string': 'my_string',
|
||||
'my_boolean': 'my_boolean'
|
||||
}
|
||||
|
||||
def __init__(self, my_number=None, my_string=None, my_boolean=None, local_vars_configuration=None): # noqa: E501
|
||||
"""OuterComposite - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._my_number = None
|
||||
self._my_string = None
|
||||
self._my_boolean = None
|
||||
self.discriminator = None
|
||||
|
||||
if my_number is not None:
|
||||
self.my_number = my_number
|
||||
if my_string is not None:
|
||||
self.my_string = my_string
|
||||
if my_boolean is not None:
|
||||
self.my_boolean = my_boolean
|
||||
|
||||
@property
|
||||
def my_number(self):
|
||||
"""Gets the my_number of this OuterComposite. # noqa: E501
|
||||
|
||||
|
||||
:return: The my_number of this OuterComposite. # noqa: E501
|
||||
:rtype: float
|
||||
"""
|
||||
return self._my_number
|
||||
|
||||
@my_number.setter
|
||||
def my_number(self, my_number):
|
||||
"""Sets the my_number of this OuterComposite.
|
||||
|
||||
|
||||
:param my_number: The my_number of this OuterComposite. # noqa: E501
|
||||
:type my_number: float
|
||||
"""
|
||||
|
||||
self._my_number = my_number
|
||||
|
||||
@property
|
||||
def my_string(self):
|
||||
"""Gets the my_string of this OuterComposite. # noqa: E501
|
||||
|
||||
|
||||
:return: The my_string of this OuterComposite. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._my_string
|
||||
|
||||
@my_string.setter
|
||||
def my_string(self, my_string):
|
||||
"""Sets the my_string of this OuterComposite.
|
||||
|
||||
|
||||
:param my_string: The my_string of this OuterComposite. # noqa: E501
|
||||
:type my_string: str
|
||||
"""
|
||||
|
||||
self._my_string = my_string
|
||||
|
||||
@property
|
||||
def my_boolean(self):
|
||||
"""Gets the my_boolean of this OuterComposite. # noqa: E501
|
||||
|
||||
|
||||
:return: The my_boolean of this OuterComposite. # noqa: E501
|
||||
:rtype: bool
|
||||
"""
|
||||
return self._my_boolean
|
||||
|
||||
@my_boolean.setter
|
||||
def my_boolean(self, my_boolean):
|
||||
"""Sets the my_boolean of this OuterComposite.
|
||||
|
||||
|
||||
:param my_boolean: The my_boolean of this OuterComposite. # noqa: E501
|
||||
:type my_boolean: bool
|
||||
"""
|
||||
|
||||
self._my_boolean = my_boolean
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, OuterComposite):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, OuterComposite):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,109 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class OuterEnum(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
allowed enum values
|
||||
"""
|
||||
PLACED = "placed"
|
||||
APPROVED = "approved"
|
||||
DELIVERED = "delivered"
|
||||
|
||||
allowable_values = [PLACED, APPROVED, DELIVERED] # noqa: E501
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
}
|
||||
|
||||
def __init__(self, local_vars_configuration=None): # noqa: E501
|
||||
"""OuterEnum - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
self.discriminator = None
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, OuterEnum):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, OuterEnum):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
268
samples/client/petstore/python-legacy/petstore_api/models/pet.py
Normal file
268
samples/client/petstore/python-legacy/petstore_api/models/pet.py
Normal file
@@ -0,0 +1,268 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class Pet(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'id': 'int',
|
||||
'category': 'Category',
|
||||
'name': 'str',
|
||||
'photo_urls': 'list[str]',
|
||||
'tags': 'list[Tag]',
|
||||
'status': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'id': 'id',
|
||||
'category': 'category',
|
||||
'name': 'name',
|
||||
'photo_urls': 'photoUrls',
|
||||
'tags': 'tags',
|
||||
'status': 'status'
|
||||
}
|
||||
|
||||
def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None, local_vars_configuration=None): # noqa: E501
|
||||
"""Pet - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._id = None
|
||||
self._category = None
|
||||
self._name = None
|
||||
self._photo_urls = None
|
||||
self._tags = None
|
||||
self._status = None
|
||||
self.discriminator = None
|
||||
|
||||
if id is not None:
|
||||
self.id = id
|
||||
if category is not None:
|
||||
self.category = category
|
||||
self.name = name
|
||||
self.photo_urls = photo_urls
|
||||
if tags is not None:
|
||||
self.tags = tags
|
||||
if status is not None:
|
||||
self.status = status
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""Gets the id of this Pet. # noqa: E501
|
||||
|
||||
|
||||
:return: The id of this Pet. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._id
|
||||
|
||||
@id.setter
|
||||
def id(self, id):
|
||||
"""Sets the id of this Pet.
|
||||
|
||||
|
||||
:param id: The id of this Pet. # noqa: E501
|
||||
:type id: int
|
||||
"""
|
||||
|
||||
self._id = id
|
||||
|
||||
@property
|
||||
def category(self):
|
||||
"""Gets the category of this Pet. # noqa: E501
|
||||
|
||||
|
||||
:return: The category of this Pet. # noqa: E501
|
||||
:rtype: Category
|
||||
"""
|
||||
return self._category
|
||||
|
||||
@category.setter
|
||||
def category(self, category):
|
||||
"""Sets the category of this Pet.
|
||||
|
||||
|
||||
:param category: The category of this Pet. # noqa: E501
|
||||
:type category: Category
|
||||
"""
|
||||
|
||||
self._category = category
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Gets the name of this Pet. # noqa: E501
|
||||
|
||||
|
||||
:return: The name of this Pet. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name):
|
||||
"""Sets the name of this Pet.
|
||||
|
||||
|
||||
:param name: The name of this Pet. # noqa: E501
|
||||
:type name: str
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
|
||||
|
||||
self._name = name
|
||||
|
||||
@property
|
||||
def photo_urls(self):
|
||||
"""Gets the photo_urls of this Pet. # noqa: E501
|
||||
|
||||
|
||||
:return: The photo_urls of this Pet. # noqa: E501
|
||||
:rtype: list[str]
|
||||
"""
|
||||
return self._photo_urls
|
||||
|
||||
@photo_urls.setter
|
||||
def photo_urls(self, photo_urls):
|
||||
"""Sets the photo_urls of this Pet.
|
||||
|
||||
|
||||
:param photo_urls: The photo_urls of this Pet. # noqa: E501
|
||||
:type photo_urls: list[str]
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and photo_urls is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `photo_urls`, must not be `None`") # noqa: E501
|
||||
|
||||
self._photo_urls = photo_urls
|
||||
|
||||
@property
|
||||
def tags(self):
|
||||
"""Gets the tags of this Pet. # noqa: E501
|
||||
|
||||
|
||||
:return: The tags of this Pet. # noqa: E501
|
||||
:rtype: list[Tag]
|
||||
"""
|
||||
return self._tags
|
||||
|
||||
@tags.setter
|
||||
def tags(self, tags):
|
||||
"""Sets the tags of this Pet.
|
||||
|
||||
|
||||
:param tags: The tags of this Pet. # noqa: E501
|
||||
:type tags: list[Tag]
|
||||
"""
|
||||
|
||||
self._tags = tags
|
||||
|
||||
@property
|
||||
def status(self):
|
||||
"""Gets the status of this Pet. # noqa: E501
|
||||
|
||||
pet status in the store # noqa: E501
|
||||
|
||||
:return: The status of this Pet. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._status
|
||||
|
||||
@status.setter
|
||||
def status(self, status):
|
||||
"""Sets the status of this Pet.
|
||||
|
||||
pet status in the store # noqa: E501
|
||||
|
||||
:param status: The status of this Pet. # noqa: E501
|
||||
:type status: str
|
||||
"""
|
||||
allowed_values = ["available", "pending", "sold"] # noqa: E501
|
||||
if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501
|
||||
raise ValueError(
|
||||
"Invalid value for `status` ({0}), must be one of {1}" # noqa: E501
|
||||
.format(status, allowed_values)
|
||||
)
|
||||
|
||||
self._status = status
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, Pet):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, Pet):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,154 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class ReadOnlyFirst(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'bar': 'str',
|
||||
'baz': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'bar': 'bar',
|
||||
'baz': 'baz'
|
||||
}
|
||||
|
||||
def __init__(self, bar=None, baz=None, local_vars_configuration=None): # noqa: E501
|
||||
"""ReadOnlyFirst - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._bar = None
|
||||
self._baz = None
|
||||
self.discriminator = None
|
||||
|
||||
if bar is not None:
|
||||
self.bar = bar
|
||||
if baz is not None:
|
||||
self.baz = baz
|
||||
|
||||
@property
|
||||
def bar(self):
|
||||
"""Gets the bar of this ReadOnlyFirst. # noqa: E501
|
||||
|
||||
|
||||
:return: The bar of this ReadOnlyFirst. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._bar
|
||||
|
||||
@bar.setter
|
||||
def bar(self, bar):
|
||||
"""Sets the bar of this ReadOnlyFirst.
|
||||
|
||||
|
||||
:param bar: The bar of this ReadOnlyFirst. # noqa: E501
|
||||
:type bar: str
|
||||
"""
|
||||
|
||||
self._bar = bar
|
||||
|
||||
@property
|
||||
def baz(self):
|
||||
"""Gets the baz of this ReadOnlyFirst. # noqa: E501
|
||||
|
||||
|
||||
:return: The baz of this ReadOnlyFirst. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._baz
|
||||
|
||||
@baz.setter
|
||||
def baz(self, baz):
|
||||
"""Sets the baz of this ReadOnlyFirst.
|
||||
|
||||
|
||||
:param baz: The baz of this ReadOnlyFirst. # noqa: E501
|
||||
:type baz: str
|
||||
"""
|
||||
|
||||
self._baz = baz
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, ReadOnlyFirst):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, ReadOnlyFirst):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class SpecialModelName(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'special_property_name': 'int'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'special_property_name': '$special[property.name]'
|
||||
}
|
||||
|
||||
def __init__(self, special_property_name=None, local_vars_configuration=None): # noqa: E501
|
||||
"""SpecialModelName - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._special_property_name = None
|
||||
self.discriminator = None
|
||||
|
||||
if special_property_name is not None:
|
||||
self.special_property_name = special_property_name
|
||||
|
||||
@property
|
||||
def special_property_name(self):
|
||||
"""Gets the special_property_name of this SpecialModelName. # noqa: E501
|
||||
|
||||
|
||||
:return: The special_property_name of this SpecialModelName. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._special_property_name
|
||||
|
||||
@special_property_name.setter
|
||||
def special_property_name(self, special_property_name):
|
||||
"""Sets the special_property_name of this SpecialModelName.
|
||||
|
||||
|
||||
:param special_property_name: The special_property_name of this SpecialModelName. # noqa: E501
|
||||
:type special_property_name: int
|
||||
"""
|
||||
|
||||
self._special_property_name = special_property_name
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, SpecialModelName):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, SpecialModelName):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
154
samples/client/petstore/python-legacy/petstore_api/models/tag.py
Normal file
154
samples/client/petstore/python-legacy/petstore_api/models/tag.py
Normal file
@@ -0,0 +1,154 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class Tag(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'id': 'int',
|
||||
'name': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'id': 'id',
|
||||
'name': 'name'
|
||||
}
|
||||
|
||||
def __init__(self, id=None, name=None, local_vars_configuration=None): # noqa: E501
|
||||
"""Tag - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._id = None
|
||||
self._name = None
|
||||
self.discriminator = None
|
||||
|
||||
if id is not None:
|
||||
self.id = id
|
||||
if name is not None:
|
||||
self.name = name
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""Gets the id of this Tag. # noqa: E501
|
||||
|
||||
|
||||
:return: The id of this Tag. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._id
|
||||
|
||||
@id.setter
|
||||
def id(self, id):
|
||||
"""Sets the id of this Tag.
|
||||
|
||||
|
||||
:param id: The id of this Tag. # noqa: E501
|
||||
:type id: int
|
||||
"""
|
||||
|
||||
self._id = id
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Gets the name of this Tag. # noqa: E501
|
||||
|
||||
|
||||
:return: The name of this Tag. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name):
|
||||
"""Sets the name of this Tag.
|
||||
|
||||
|
||||
:param name: The name of this Tag. # noqa: E501
|
||||
:type name: str
|
||||
"""
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, Tag):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, Tag):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,237 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class TypeHolderDefault(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'string_item': 'str',
|
||||
'number_item': 'float',
|
||||
'integer_item': 'int',
|
||||
'bool_item': 'bool',
|
||||
'array_item': 'list[int]'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'string_item': 'string_item',
|
||||
'number_item': 'number_item',
|
||||
'integer_item': 'integer_item',
|
||||
'bool_item': 'bool_item',
|
||||
'array_item': 'array_item'
|
||||
}
|
||||
|
||||
def __init__(self, string_item='what', number_item=None, integer_item=None, bool_item=True, array_item=None, local_vars_configuration=None): # noqa: E501
|
||||
"""TypeHolderDefault - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._string_item = None
|
||||
self._number_item = None
|
||||
self._integer_item = None
|
||||
self._bool_item = None
|
||||
self._array_item = None
|
||||
self.discriminator = None
|
||||
|
||||
self.string_item = string_item
|
||||
self.number_item = number_item
|
||||
self.integer_item = integer_item
|
||||
self.bool_item = bool_item
|
||||
self.array_item = array_item
|
||||
|
||||
@property
|
||||
def string_item(self):
|
||||
"""Gets the string_item of this TypeHolderDefault. # noqa: E501
|
||||
|
||||
|
||||
:return: The string_item of this TypeHolderDefault. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._string_item
|
||||
|
||||
@string_item.setter
|
||||
def string_item(self, string_item):
|
||||
"""Sets the string_item of this TypeHolderDefault.
|
||||
|
||||
|
||||
:param string_item: The string_item of this TypeHolderDefault. # noqa: E501
|
||||
:type string_item: str
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and string_item is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501
|
||||
|
||||
self._string_item = string_item
|
||||
|
||||
@property
|
||||
def number_item(self):
|
||||
"""Gets the number_item of this TypeHolderDefault. # noqa: E501
|
||||
|
||||
|
||||
:return: The number_item of this TypeHolderDefault. # noqa: E501
|
||||
:rtype: float
|
||||
"""
|
||||
return self._number_item
|
||||
|
||||
@number_item.setter
|
||||
def number_item(self, number_item):
|
||||
"""Sets the number_item of this TypeHolderDefault.
|
||||
|
||||
|
||||
:param number_item: The number_item of this TypeHolderDefault. # noqa: E501
|
||||
:type number_item: float
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and number_item is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501
|
||||
|
||||
self._number_item = number_item
|
||||
|
||||
@property
|
||||
def integer_item(self):
|
||||
"""Gets the integer_item of this TypeHolderDefault. # noqa: E501
|
||||
|
||||
|
||||
:return: The integer_item of this TypeHolderDefault. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._integer_item
|
||||
|
||||
@integer_item.setter
|
||||
def integer_item(self, integer_item):
|
||||
"""Sets the integer_item of this TypeHolderDefault.
|
||||
|
||||
|
||||
:param integer_item: The integer_item of this TypeHolderDefault. # noqa: E501
|
||||
:type integer_item: int
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and integer_item is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501
|
||||
|
||||
self._integer_item = integer_item
|
||||
|
||||
@property
|
||||
def bool_item(self):
|
||||
"""Gets the bool_item of this TypeHolderDefault. # noqa: E501
|
||||
|
||||
|
||||
:return: The bool_item of this TypeHolderDefault. # noqa: E501
|
||||
:rtype: bool
|
||||
"""
|
||||
return self._bool_item
|
||||
|
||||
@bool_item.setter
|
||||
def bool_item(self, bool_item):
|
||||
"""Sets the bool_item of this TypeHolderDefault.
|
||||
|
||||
|
||||
:param bool_item: The bool_item of this TypeHolderDefault. # noqa: E501
|
||||
:type bool_item: bool
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and bool_item is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501
|
||||
|
||||
self._bool_item = bool_item
|
||||
|
||||
@property
|
||||
def array_item(self):
|
||||
"""Gets the array_item of this TypeHolderDefault. # noqa: E501
|
||||
|
||||
|
||||
:return: The array_item of this TypeHolderDefault. # noqa: E501
|
||||
:rtype: list[int]
|
||||
"""
|
||||
return self._array_item
|
||||
|
||||
@array_item.setter
|
||||
def array_item(self, array_item):
|
||||
"""Sets the array_item of this TypeHolderDefault.
|
||||
|
||||
|
||||
:param array_item: The array_item of this TypeHolderDefault. # noqa: E501
|
||||
:type array_item: list[int]
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and array_item is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501
|
||||
|
||||
self._array_item = array_item
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, TypeHolderDefault):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, TypeHolderDefault):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,264 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class TypeHolderExample(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'string_item': 'str',
|
||||
'number_item': 'float',
|
||||
'float_item': 'float',
|
||||
'integer_item': 'int',
|
||||
'bool_item': 'bool',
|
||||
'array_item': 'list[int]'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'string_item': 'string_item',
|
||||
'number_item': 'number_item',
|
||||
'float_item': 'float_item',
|
||||
'integer_item': 'integer_item',
|
||||
'bool_item': 'bool_item',
|
||||
'array_item': 'array_item'
|
||||
}
|
||||
|
||||
def __init__(self, string_item=None, number_item=None, float_item=None, integer_item=None, bool_item=None, array_item=None, local_vars_configuration=None): # noqa: E501
|
||||
"""TypeHolderExample - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._string_item = None
|
||||
self._number_item = None
|
||||
self._float_item = None
|
||||
self._integer_item = None
|
||||
self._bool_item = None
|
||||
self._array_item = None
|
||||
self.discriminator = None
|
||||
|
||||
self.string_item = string_item
|
||||
self.number_item = number_item
|
||||
self.float_item = float_item
|
||||
self.integer_item = integer_item
|
||||
self.bool_item = bool_item
|
||||
self.array_item = array_item
|
||||
|
||||
@property
|
||||
def string_item(self):
|
||||
"""Gets the string_item of this TypeHolderExample. # noqa: E501
|
||||
|
||||
|
||||
:return: The string_item of this TypeHolderExample. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._string_item
|
||||
|
||||
@string_item.setter
|
||||
def string_item(self, string_item):
|
||||
"""Sets the string_item of this TypeHolderExample.
|
||||
|
||||
|
||||
:param string_item: The string_item of this TypeHolderExample. # noqa: E501
|
||||
:type string_item: str
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and string_item is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501
|
||||
|
||||
self._string_item = string_item
|
||||
|
||||
@property
|
||||
def number_item(self):
|
||||
"""Gets the number_item of this TypeHolderExample. # noqa: E501
|
||||
|
||||
|
||||
:return: The number_item of this TypeHolderExample. # noqa: E501
|
||||
:rtype: float
|
||||
"""
|
||||
return self._number_item
|
||||
|
||||
@number_item.setter
|
||||
def number_item(self, number_item):
|
||||
"""Sets the number_item of this TypeHolderExample.
|
||||
|
||||
|
||||
:param number_item: The number_item of this TypeHolderExample. # noqa: E501
|
||||
:type number_item: float
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and number_item is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501
|
||||
|
||||
self._number_item = number_item
|
||||
|
||||
@property
|
||||
def float_item(self):
|
||||
"""Gets the float_item of this TypeHolderExample. # noqa: E501
|
||||
|
||||
|
||||
:return: The float_item of this TypeHolderExample. # noqa: E501
|
||||
:rtype: float
|
||||
"""
|
||||
return self._float_item
|
||||
|
||||
@float_item.setter
|
||||
def float_item(self, float_item):
|
||||
"""Sets the float_item of this TypeHolderExample.
|
||||
|
||||
|
||||
:param float_item: The float_item of this TypeHolderExample. # noqa: E501
|
||||
:type float_item: float
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and float_item is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `float_item`, must not be `None`") # noqa: E501
|
||||
|
||||
self._float_item = float_item
|
||||
|
||||
@property
|
||||
def integer_item(self):
|
||||
"""Gets the integer_item of this TypeHolderExample. # noqa: E501
|
||||
|
||||
|
||||
:return: The integer_item of this TypeHolderExample. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._integer_item
|
||||
|
||||
@integer_item.setter
|
||||
def integer_item(self, integer_item):
|
||||
"""Sets the integer_item of this TypeHolderExample.
|
||||
|
||||
|
||||
:param integer_item: The integer_item of this TypeHolderExample. # noqa: E501
|
||||
:type integer_item: int
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and integer_item is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501
|
||||
|
||||
self._integer_item = integer_item
|
||||
|
||||
@property
|
||||
def bool_item(self):
|
||||
"""Gets the bool_item of this TypeHolderExample. # noqa: E501
|
||||
|
||||
|
||||
:return: The bool_item of this TypeHolderExample. # noqa: E501
|
||||
:rtype: bool
|
||||
"""
|
||||
return self._bool_item
|
||||
|
||||
@bool_item.setter
|
||||
def bool_item(self, bool_item):
|
||||
"""Sets the bool_item of this TypeHolderExample.
|
||||
|
||||
|
||||
:param bool_item: The bool_item of this TypeHolderExample. # noqa: E501
|
||||
:type bool_item: bool
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and bool_item is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501
|
||||
|
||||
self._bool_item = bool_item
|
||||
|
||||
@property
|
||||
def array_item(self):
|
||||
"""Gets the array_item of this TypeHolderExample. # noqa: E501
|
||||
|
||||
|
||||
:return: The array_item of this TypeHolderExample. # noqa: E501
|
||||
:rtype: list[int]
|
||||
"""
|
||||
return self._array_item
|
||||
|
||||
@array_item.setter
|
||||
def array_item(self, array_item):
|
||||
"""Sets the array_item of this TypeHolderExample.
|
||||
|
||||
|
||||
:param array_item: The array_item of this TypeHolderExample. # noqa: E501
|
||||
:type array_item: list[int]
|
||||
"""
|
||||
if self.local_vars_configuration.client_side_validation and array_item is None: # noqa: E501
|
||||
raise ValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501
|
||||
|
||||
self._array_item = array_item
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, TypeHolderExample):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, TypeHolderExample):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,312 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class User(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'id': 'int',
|
||||
'username': 'str',
|
||||
'first_name': 'str',
|
||||
'last_name': 'str',
|
||||
'email': 'str',
|
||||
'password': 'str',
|
||||
'phone': 'str',
|
||||
'user_status': 'int'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'id': 'id',
|
||||
'username': 'username',
|
||||
'first_name': 'firstName',
|
||||
'last_name': 'lastName',
|
||||
'email': 'email',
|
||||
'password': 'password',
|
||||
'phone': 'phone',
|
||||
'user_status': 'userStatus'
|
||||
}
|
||||
|
||||
def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None, local_vars_configuration=None): # noqa: E501
|
||||
"""User - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._id = None
|
||||
self._username = None
|
||||
self._first_name = None
|
||||
self._last_name = None
|
||||
self._email = None
|
||||
self._password = None
|
||||
self._phone = None
|
||||
self._user_status = None
|
||||
self.discriminator = None
|
||||
|
||||
if id is not None:
|
||||
self.id = id
|
||||
if username is not None:
|
||||
self.username = username
|
||||
if first_name is not None:
|
||||
self.first_name = first_name
|
||||
if last_name is not None:
|
||||
self.last_name = last_name
|
||||
if email is not None:
|
||||
self.email = email
|
||||
if password is not None:
|
||||
self.password = password
|
||||
if phone is not None:
|
||||
self.phone = phone
|
||||
if user_status is not None:
|
||||
self.user_status = user_status
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""Gets the id of this User. # noqa: E501
|
||||
|
||||
|
||||
:return: The id of this User. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._id
|
||||
|
||||
@id.setter
|
||||
def id(self, id):
|
||||
"""Sets the id of this User.
|
||||
|
||||
|
||||
:param id: The id of this User. # noqa: E501
|
||||
:type id: int
|
||||
"""
|
||||
|
||||
self._id = id
|
||||
|
||||
@property
|
||||
def username(self):
|
||||
"""Gets the username of this User. # noqa: E501
|
||||
|
||||
|
||||
:return: The username of this User. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._username
|
||||
|
||||
@username.setter
|
||||
def username(self, username):
|
||||
"""Sets the username of this User.
|
||||
|
||||
|
||||
:param username: The username of this User. # noqa: E501
|
||||
:type username: str
|
||||
"""
|
||||
|
||||
self._username = username
|
||||
|
||||
@property
|
||||
def first_name(self):
|
||||
"""Gets the first_name of this User. # noqa: E501
|
||||
|
||||
|
||||
:return: The first_name of this User. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._first_name
|
||||
|
||||
@first_name.setter
|
||||
def first_name(self, first_name):
|
||||
"""Sets the first_name of this User.
|
||||
|
||||
|
||||
:param first_name: The first_name of this User. # noqa: E501
|
||||
:type first_name: str
|
||||
"""
|
||||
|
||||
self._first_name = first_name
|
||||
|
||||
@property
|
||||
def last_name(self):
|
||||
"""Gets the last_name of this User. # noqa: E501
|
||||
|
||||
|
||||
:return: The last_name of this User. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._last_name
|
||||
|
||||
@last_name.setter
|
||||
def last_name(self, last_name):
|
||||
"""Sets the last_name of this User.
|
||||
|
||||
|
||||
:param last_name: The last_name of this User. # noqa: E501
|
||||
:type last_name: str
|
||||
"""
|
||||
|
||||
self._last_name = last_name
|
||||
|
||||
@property
|
||||
def email(self):
|
||||
"""Gets the email of this User. # noqa: E501
|
||||
|
||||
|
||||
:return: The email of this User. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._email
|
||||
|
||||
@email.setter
|
||||
def email(self, email):
|
||||
"""Sets the email of this User.
|
||||
|
||||
|
||||
:param email: The email of this User. # noqa: E501
|
||||
:type email: str
|
||||
"""
|
||||
|
||||
self._email = email
|
||||
|
||||
@property
|
||||
def password(self):
|
||||
"""Gets the password of this User. # noqa: E501
|
||||
|
||||
|
||||
:return: The password of this User. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._password
|
||||
|
||||
@password.setter
|
||||
def password(self, password):
|
||||
"""Sets the password of this User.
|
||||
|
||||
|
||||
:param password: The password of this User. # noqa: E501
|
||||
:type password: str
|
||||
"""
|
||||
|
||||
self._password = password
|
||||
|
||||
@property
|
||||
def phone(self):
|
||||
"""Gets the phone of this User. # noqa: E501
|
||||
|
||||
|
||||
:return: The phone of this User. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._phone
|
||||
|
||||
@phone.setter
|
||||
def phone(self, phone):
|
||||
"""Sets the phone of this User.
|
||||
|
||||
|
||||
:param phone: The phone of this User. # noqa: E501
|
||||
:type phone: str
|
||||
"""
|
||||
|
||||
self._phone = phone
|
||||
|
||||
@property
|
||||
def user_status(self):
|
||||
"""Gets the user_status of this User. # noqa: E501
|
||||
|
||||
User Status # noqa: E501
|
||||
|
||||
:return: The user_status of this User. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._user_status
|
||||
|
||||
@user_status.setter
|
||||
def user_status(self, user_status):
|
||||
"""Sets the user_status of this User.
|
||||
|
||||
User Status # noqa: E501
|
||||
|
||||
:param user_status: The user_status of this User. # noqa: E501
|
||||
:type user_status: int
|
||||
"""
|
||||
|
||||
self._user_status = user_status
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, User):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, User):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
@@ -0,0 +1,856 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
|
||||
|
||||
class XmlItem(object):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
openapi_types = {
|
||||
'attribute_string': 'str',
|
||||
'attribute_number': 'float',
|
||||
'attribute_integer': 'int',
|
||||
'attribute_boolean': 'bool',
|
||||
'wrapped_array': 'list[int]',
|
||||
'name_string': 'str',
|
||||
'name_number': 'float',
|
||||
'name_integer': 'int',
|
||||
'name_boolean': 'bool',
|
||||
'name_array': 'list[int]',
|
||||
'name_wrapped_array': 'list[int]',
|
||||
'prefix_string': 'str',
|
||||
'prefix_number': 'float',
|
||||
'prefix_integer': 'int',
|
||||
'prefix_boolean': 'bool',
|
||||
'prefix_array': 'list[int]',
|
||||
'prefix_wrapped_array': 'list[int]',
|
||||
'namespace_string': 'str',
|
||||
'namespace_number': 'float',
|
||||
'namespace_integer': 'int',
|
||||
'namespace_boolean': 'bool',
|
||||
'namespace_array': 'list[int]',
|
||||
'namespace_wrapped_array': 'list[int]',
|
||||
'prefix_ns_string': 'str',
|
||||
'prefix_ns_number': 'float',
|
||||
'prefix_ns_integer': 'int',
|
||||
'prefix_ns_boolean': 'bool',
|
||||
'prefix_ns_array': 'list[int]',
|
||||
'prefix_ns_wrapped_array': 'list[int]'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'attribute_string': 'attribute_string',
|
||||
'attribute_number': 'attribute_number',
|
||||
'attribute_integer': 'attribute_integer',
|
||||
'attribute_boolean': 'attribute_boolean',
|
||||
'wrapped_array': 'wrapped_array',
|
||||
'name_string': 'name_string',
|
||||
'name_number': 'name_number',
|
||||
'name_integer': 'name_integer',
|
||||
'name_boolean': 'name_boolean',
|
||||
'name_array': 'name_array',
|
||||
'name_wrapped_array': 'name_wrapped_array',
|
||||
'prefix_string': 'prefix_string',
|
||||
'prefix_number': 'prefix_number',
|
||||
'prefix_integer': 'prefix_integer',
|
||||
'prefix_boolean': 'prefix_boolean',
|
||||
'prefix_array': 'prefix_array',
|
||||
'prefix_wrapped_array': 'prefix_wrapped_array',
|
||||
'namespace_string': 'namespace_string',
|
||||
'namespace_number': 'namespace_number',
|
||||
'namespace_integer': 'namespace_integer',
|
||||
'namespace_boolean': 'namespace_boolean',
|
||||
'namespace_array': 'namespace_array',
|
||||
'namespace_wrapped_array': 'namespace_wrapped_array',
|
||||
'prefix_ns_string': 'prefix_ns_string',
|
||||
'prefix_ns_number': 'prefix_ns_number',
|
||||
'prefix_ns_integer': 'prefix_ns_integer',
|
||||
'prefix_ns_boolean': 'prefix_ns_boolean',
|
||||
'prefix_ns_array': 'prefix_ns_array',
|
||||
'prefix_ns_wrapped_array': 'prefix_ns_wrapped_array'
|
||||
}
|
||||
|
||||
def __init__(self, attribute_string=None, attribute_number=None, attribute_integer=None, attribute_boolean=None, wrapped_array=None, name_string=None, name_number=None, name_integer=None, name_boolean=None, name_array=None, name_wrapped_array=None, prefix_string=None, prefix_number=None, prefix_integer=None, prefix_boolean=None, prefix_array=None, prefix_wrapped_array=None, namespace_string=None, namespace_number=None, namespace_integer=None, namespace_boolean=None, namespace_array=None, namespace_wrapped_array=None, prefix_ns_string=None, prefix_ns_number=None, prefix_ns_integer=None, prefix_ns_boolean=None, prefix_ns_array=None, prefix_ns_wrapped_array=None, local_vars_configuration=None): # noqa: E501
|
||||
"""XmlItem - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
|
||||
self._attribute_string = None
|
||||
self._attribute_number = None
|
||||
self._attribute_integer = None
|
||||
self._attribute_boolean = None
|
||||
self._wrapped_array = None
|
||||
self._name_string = None
|
||||
self._name_number = None
|
||||
self._name_integer = None
|
||||
self._name_boolean = None
|
||||
self._name_array = None
|
||||
self._name_wrapped_array = None
|
||||
self._prefix_string = None
|
||||
self._prefix_number = None
|
||||
self._prefix_integer = None
|
||||
self._prefix_boolean = None
|
||||
self._prefix_array = None
|
||||
self._prefix_wrapped_array = None
|
||||
self._namespace_string = None
|
||||
self._namespace_number = None
|
||||
self._namespace_integer = None
|
||||
self._namespace_boolean = None
|
||||
self._namespace_array = None
|
||||
self._namespace_wrapped_array = None
|
||||
self._prefix_ns_string = None
|
||||
self._prefix_ns_number = None
|
||||
self._prefix_ns_integer = None
|
||||
self._prefix_ns_boolean = None
|
||||
self._prefix_ns_array = None
|
||||
self._prefix_ns_wrapped_array = None
|
||||
self.discriminator = None
|
||||
|
||||
if attribute_string is not None:
|
||||
self.attribute_string = attribute_string
|
||||
if attribute_number is not None:
|
||||
self.attribute_number = attribute_number
|
||||
if attribute_integer is not None:
|
||||
self.attribute_integer = attribute_integer
|
||||
if attribute_boolean is not None:
|
||||
self.attribute_boolean = attribute_boolean
|
||||
if wrapped_array is not None:
|
||||
self.wrapped_array = wrapped_array
|
||||
if name_string is not None:
|
||||
self.name_string = name_string
|
||||
if name_number is not None:
|
||||
self.name_number = name_number
|
||||
if name_integer is not None:
|
||||
self.name_integer = name_integer
|
||||
if name_boolean is not None:
|
||||
self.name_boolean = name_boolean
|
||||
if name_array is not None:
|
||||
self.name_array = name_array
|
||||
if name_wrapped_array is not None:
|
||||
self.name_wrapped_array = name_wrapped_array
|
||||
if prefix_string is not None:
|
||||
self.prefix_string = prefix_string
|
||||
if prefix_number is not None:
|
||||
self.prefix_number = prefix_number
|
||||
if prefix_integer is not None:
|
||||
self.prefix_integer = prefix_integer
|
||||
if prefix_boolean is not None:
|
||||
self.prefix_boolean = prefix_boolean
|
||||
if prefix_array is not None:
|
||||
self.prefix_array = prefix_array
|
||||
if prefix_wrapped_array is not None:
|
||||
self.prefix_wrapped_array = prefix_wrapped_array
|
||||
if namespace_string is not None:
|
||||
self.namespace_string = namespace_string
|
||||
if namespace_number is not None:
|
||||
self.namespace_number = namespace_number
|
||||
if namespace_integer is not None:
|
||||
self.namespace_integer = namespace_integer
|
||||
if namespace_boolean is not None:
|
||||
self.namespace_boolean = namespace_boolean
|
||||
if namespace_array is not None:
|
||||
self.namespace_array = namespace_array
|
||||
if namespace_wrapped_array is not None:
|
||||
self.namespace_wrapped_array = namespace_wrapped_array
|
||||
if prefix_ns_string is not None:
|
||||
self.prefix_ns_string = prefix_ns_string
|
||||
if prefix_ns_number is not None:
|
||||
self.prefix_ns_number = prefix_ns_number
|
||||
if prefix_ns_integer is not None:
|
||||
self.prefix_ns_integer = prefix_ns_integer
|
||||
if prefix_ns_boolean is not None:
|
||||
self.prefix_ns_boolean = prefix_ns_boolean
|
||||
if prefix_ns_array is not None:
|
||||
self.prefix_ns_array = prefix_ns_array
|
||||
if prefix_ns_wrapped_array is not None:
|
||||
self.prefix_ns_wrapped_array = prefix_ns_wrapped_array
|
||||
|
||||
@property
|
||||
def attribute_string(self):
|
||||
"""Gets the attribute_string of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The attribute_string of this XmlItem. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._attribute_string
|
||||
|
||||
@attribute_string.setter
|
||||
def attribute_string(self, attribute_string):
|
||||
"""Sets the attribute_string of this XmlItem.
|
||||
|
||||
|
||||
:param attribute_string: The attribute_string of this XmlItem. # noqa: E501
|
||||
:type attribute_string: str
|
||||
"""
|
||||
|
||||
self._attribute_string = attribute_string
|
||||
|
||||
@property
|
||||
def attribute_number(self):
|
||||
"""Gets the attribute_number of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The attribute_number of this XmlItem. # noqa: E501
|
||||
:rtype: float
|
||||
"""
|
||||
return self._attribute_number
|
||||
|
||||
@attribute_number.setter
|
||||
def attribute_number(self, attribute_number):
|
||||
"""Sets the attribute_number of this XmlItem.
|
||||
|
||||
|
||||
:param attribute_number: The attribute_number of this XmlItem. # noqa: E501
|
||||
:type attribute_number: float
|
||||
"""
|
||||
|
||||
self._attribute_number = attribute_number
|
||||
|
||||
@property
|
||||
def attribute_integer(self):
|
||||
"""Gets the attribute_integer of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The attribute_integer of this XmlItem. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._attribute_integer
|
||||
|
||||
@attribute_integer.setter
|
||||
def attribute_integer(self, attribute_integer):
|
||||
"""Sets the attribute_integer of this XmlItem.
|
||||
|
||||
|
||||
:param attribute_integer: The attribute_integer of this XmlItem. # noqa: E501
|
||||
:type attribute_integer: int
|
||||
"""
|
||||
|
||||
self._attribute_integer = attribute_integer
|
||||
|
||||
@property
|
||||
def attribute_boolean(self):
|
||||
"""Gets the attribute_boolean of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The attribute_boolean of this XmlItem. # noqa: E501
|
||||
:rtype: bool
|
||||
"""
|
||||
return self._attribute_boolean
|
||||
|
||||
@attribute_boolean.setter
|
||||
def attribute_boolean(self, attribute_boolean):
|
||||
"""Sets the attribute_boolean of this XmlItem.
|
||||
|
||||
|
||||
:param attribute_boolean: The attribute_boolean of this XmlItem. # noqa: E501
|
||||
:type attribute_boolean: bool
|
||||
"""
|
||||
|
||||
self._attribute_boolean = attribute_boolean
|
||||
|
||||
@property
|
||||
def wrapped_array(self):
|
||||
"""Gets the wrapped_array of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The wrapped_array of this XmlItem. # noqa: E501
|
||||
:rtype: list[int]
|
||||
"""
|
||||
return self._wrapped_array
|
||||
|
||||
@wrapped_array.setter
|
||||
def wrapped_array(self, wrapped_array):
|
||||
"""Sets the wrapped_array of this XmlItem.
|
||||
|
||||
|
||||
:param wrapped_array: The wrapped_array of this XmlItem. # noqa: E501
|
||||
:type wrapped_array: list[int]
|
||||
"""
|
||||
|
||||
self._wrapped_array = wrapped_array
|
||||
|
||||
@property
|
||||
def name_string(self):
|
||||
"""Gets the name_string of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The name_string of this XmlItem. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._name_string
|
||||
|
||||
@name_string.setter
|
||||
def name_string(self, name_string):
|
||||
"""Sets the name_string of this XmlItem.
|
||||
|
||||
|
||||
:param name_string: The name_string of this XmlItem. # noqa: E501
|
||||
:type name_string: str
|
||||
"""
|
||||
|
||||
self._name_string = name_string
|
||||
|
||||
@property
|
||||
def name_number(self):
|
||||
"""Gets the name_number of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The name_number of this XmlItem. # noqa: E501
|
||||
:rtype: float
|
||||
"""
|
||||
return self._name_number
|
||||
|
||||
@name_number.setter
|
||||
def name_number(self, name_number):
|
||||
"""Sets the name_number of this XmlItem.
|
||||
|
||||
|
||||
:param name_number: The name_number of this XmlItem. # noqa: E501
|
||||
:type name_number: float
|
||||
"""
|
||||
|
||||
self._name_number = name_number
|
||||
|
||||
@property
|
||||
def name_integer(self):
|
||||
"""Gets the name_integer of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The name_integer of this XmlItem. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._name_integer
|
||||
|
||||
@name_integer.setter
|
||||
def name_integer(self, name_integer):
|
||||
"""Sets the name_integer of this XmlItem.
|
||||
|
||||
|
||||
:param name_integer: The name_integer of this XmlItem. # noqa: E501
|
||||
:type name_integer: int
|
||||
"""
|
||||
|
||||
self._name_integer = name_integer
|
||||
|
||||
@property
|
||||
def name_boolean(self):
|
||||
"""Gets the name_boolean of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The name_boolean of this XmlItem. # noqa: E501
|
||||
:rtype: bool
|
||||
"""
|
||||
return self._name_boolean
|
||||
|
||||
@name_boolean.setter
|
||||
def name_boolean(self, name_boolean):
|
||||
"""Sets the name_boolean of this XmlItem.
|
||||
|
||||
|
||||
:param name_boolean: The name_boolean of this XmlItem. # noqa: E501
|
||||
:type name_boolean: bool
|
||||
"""
|
||||
|
||||
self._name_boolean = name_boolean
|
||||
|
||||
@property
|
||||
def name_array(self):
|
||||
"""Gets the name_array of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The name_array of this XmlItem. # noqa: E501
|
||||
:rtype: list[int]
|
||||
"""
|
||||
return self._name_array
|
||||
|
||||
@name_array.setter
|
||||
def name_array(self, name_array):
|
||||
"""Sets the name_array of this XmlItem.
|
||||
|
||||
|
||||
:param name_array: The name_array of this XmlItem. # noqa: E501
|
||||
:type name_array: list[int]
|
||||
"""
|
||||
|
||||
self._name_array = name_array
|
||||
|
||||
@property
|
||||
def name_wrapped_array(self):
|
||||
"""Gets the name_wrapped_array of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The name_wrapped_array of this XmlItem. # noqa: E501
|
||||
:rtype: list[int]
|
||||
"""
|
||||
return self._name_wrapped_array
|
||||
|
||||
@name_wrapped_array.setter
|
||||
def name_wrapped_array(self, name_wrapped_array):
|
||||
"""Sets the name_wrapped_array of this XmlItem.
|
||||
|
||||
|
||||
:param name_wrapped_array: The name_wrapped_array of this XmlItem. # noqa: E501
|
||||
:type name_wrapped_array: list[int]
|
||||
"""
|
||||
|
||||
self._name_wrapped_array = name_wrapped_array
|
||||
|
||||
@property
|
||||
def prefix_string(self):
|
||||
"""Gets the prefix_string of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The prefix_string of this XmlItem. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._prefix_string
|
||||
|
||||
@prefix_string.setter
|
||||
def prefix_string(self, prefix_string):
|
||||
"""Sets the prefix_string of this XmlItem.
|
||||
|
||||
|
||||
:param prefix_string: The prefix_string of this XmlItem. # noqa: E501
|
||||
:type prefix_string: str
|
||||
"""
|
||||
|
||||
self._prefix_string = prefix_string
|
||||
|
||||
@property
|
||||
def prefix_number(self):
|
||||
"""Gets the prefix_number of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The prefix_number of this XmlItem. # noqa: E501
|
||||
:rtype: float
|
||||
"""
|
||||
return self._prefix_number
|
||||
|
||||
@prefix_number.setter
|
||||
def prefix_number(self, prefix_number):
|
||||
"""Sets the prefix_number of this XmlItem.
|
||||
|
||||
|
||||
:param prefix_number: The prefix_number of this XmlItem. # noqa: E501
|
||||
:type prefix_number: float
|
||||
"""
|
||||
|
||||
self._prefix_number = prefix_number
|
||||
|
||||
@property
|
||||
def prefix_integer(self):
|
||||
"""Gets the prefix_integer of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The prefix_integer of this XmlItem. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._prefix_integer
|
||||
|
||||
@prefix_integer.setter
|
||||
def prefix_integer(self, prefix_integer):
|
||||
"""Sets the prefix_integer of this XmlItem.
|
||||
|
||||
|
||||
:param prefix_integer: The prefix_integer of this XmlItem. # noqa: E501
|
||||
:type prefix_integer: int
|
||||
"""
|
||||
|
||||
self._prefix_integer = prefix_integer
|
||||
|
||||
@property
|
||||
def prefix_boolean(self):
|
||||
"""Gets the prefix_boolean of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The prefix_boolean of this XmlItem. # noqa: E501
|
||||
:rtype: bool
|
||||
"""
|
||||
return self._prefix_boolean
|
||||
|
||||
@prefix_boolean.setter
|
||||
def prefix_boolean(self, prefix_boolean):
|
||||
"""Sets the prefix_boolean of this XmlItem.
|
||||
|
||||
|
||||
:param prefix_boolean: The prefix_boolean of this XmlItem. # noqa: E501
|
||||
:type prefix_boolean: bool
|
||||
"""
|
||||
|
||||
self._prefix_boolean = prefix_boolean
|
||||
|
||||
@property
|
||||
def prefix_array(self):
|
||||
"""Gets the prefix_array of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The prefix_array of this XmlItem. # noqa: E501
|
||||
:rtype: list[int]
|
||||
"""
|
||||
return self._prefix_array
|
||||
|
||||
@prefix_array.setter
|
||||
def prefix_array(self, prefix_array):
|
||||
"""Sets the prefix_array of this XmlItem.
|
||||
|
||||
|
||||
:param prefix_array: The prefix_array of this XmlItem. # noqa: E501
|
||||
:type prefix_array: list[int]
|
||||
"""
|
||||
|
||||
self._prefix_array = prefix_array
|
||||
|
||||
@property
|
||||
def prefix_wrapped_array(self):
|
||||
"""Gets the prefix_wrapped_array of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The prefix_wrapped_array of this XmlItem. # noqa: E501
|
||||
:rtype: list[int]
|
||||
"""
|
||||
return self._prefix_wrapped_array
|
||||
|
||||
@prefix_wrapped_array.setter
|
||||
def prefix_wrapped_array(self, prefix_wrapped_array):
|
||||
"""Sets the prefix_wrapped_array of this XmlItem.
|
||||
|
||||
|
||||
:param prefix_wrapped_array: The prefix_wrapped_array of this XmlItem. # noqa: E501
|
||||
:type prefix_wrapped_array: list[int]
|
||||
"""
|
||||
|
||||
self._prefix_wrapped_array = prefix_wrapped_array
|
||||
|
||||
@property
|
||||
def namespace_string(self):
|
||||
"""Gets the namespace_string of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The namespace_string of this XmlItem. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._namespace_string
|
||||
|
||||
@namespace_string.setter
|
||||
def namespace_string(self, namespace_string):
|
||||
"""Sets the namespace_string of this XmlItem.
|
||||
|
||||
|
||||
:param namespace_string: The namespace_string of this XmlItem. # noqa: E501
|
||||
:type namespace_string: str
|
||||
"""
|
||||
|
||||
self._namespace_string = namespace_string
|
||||
|
||||
@property
|
||||
def namespace_number(self):
|
||||
"""Gets the namespace_number of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The namespace_number of this XmlItem. # noqa: E501
|
||||
:rtype: float
|
||||
"""
|
||||
return self._namespace_number
|
||||
|
||||
@namespace_number.setter
|
||||
def namespace_number(self, namespace_number):
|
||||
"""Sets the namespace_number of this XmlItem.
|
||||
|
||||
|
||||
:param namespace_number: The namespace_number of this XmlItem. # noqa: E501
|
||||
:type namespace_number: float
|
||||
"""
|
||||
|
||||
self._namespace_number = namespace_number
|
||||
|
||||
@property
|
||||
def namespace_integer(self):
|
||||
"""Gets the namespace_integer of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The namespace_integer of this XmlItem. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._namespace_integer
|
||||
|
||||
@namespace_integer.setter
|
||||
def namespace_integer(self, namespace_integer):
|
||||
"""Sets the namespace_integer of this XmlItem.
|
||||
|
||||
|
||||
:param namespace_integer: The namespace_integer of this XmlItem. # noqa: E501
|
||||
:type namespace_integer: int
|
||||
"""
|
||||
|
||||
self._namespace_integer = namespace_integer
|
||||
|
||||
@property
|
||||
def namespace_boolean(self):
|
||||
"""Gets the namespace_boolean of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The namespace_boolean of this XmlItem. # noqa: E501
|
||||
:rtype: bool
|
||||
"""
|
||||
return self._namespace_boolean
|
||||
|
||||
@namespace_boolean.setter
|
||||
def namespace_boolean(self, namespace_boolean):
|
||||
"""Sets the namespace_boolean of this XmlItem.
|
||||
|
||||
|
||||
:param namespace_boolean: The namespace_boolean of this XmlItem. # noqa: E501
|
||||
:type namespace_boolean: bool
|
||||
"""
|
||||
|
||||
self._namespace_boolean = namespace_boolean
|
||||
|
||||
@property
|
||||
def namespace_array(self):
|
||||
"""Gets the namespace_array of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The namespace_array of this XmlItem. # noqa: E501
|
||||
:rtype: list[int]
|
||||
"""
|
||||
return self._namespace_array
|
||||
|
||||
@namespace_array.setter
|
||||
def namespace_array(self, namespace_array):
|
||||
"""Sets the namespace_array of this XmlItem.
|
||||
|
||||
|
||||
:param namespace_array: The namespace_array of this XmlItem. # noqa: E501
|
||||
:type namespace_array: list[int]
|
||||
"""
|
||||
|
||||
self._namespace_array = namespace_array
|
||||
|
||||
@property
|
||||
def namespace_wrapped_array(self):
|
||||
"""Gets the namespace_wrapped_array of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The namespace_wrapped_array of this XmlItem. # noqa: E501
|
||||
:rtype: list[int]
|
||||
"""
|
||||
return self._namespace_wrapped_array
|
||||
|
||||
@namespace_wrapped_array.setter
|
||||
def namespace_wrapped_array(self, namespace_wrapped_array):
|
||||
"""Sets the namespace_wrapped_array of this XmlItem.
|
||||
|
||||
|
||||
:param namespace_wrapped_array: The namespace_wrapped_array of this XmlItem. # noqa: E501
|
||||
:type namespace_wrapped_array: list[int]
|
||||
"""
|
||||
|
||||
self._namespace_wrapped_array = namespace_wrapped_array
|
||||
|
||||
@property
|
||||
def prefix_ns_string(self):
|
||||
"""Gets the prefix_ns_string of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The prefix_ns_string of this XmlItem. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._prefix_ns_string
|
||||
|
||||
@prefix_ns_string.setter
|
||||
def prefix_ns_string(self, prefix_ns_string):
|
||||
"""Sets the prefix_ns_string of this XmlItem.
|
||||
|
||||
|
||||
:param prefix_ns_string: The prefix_ns_string of this XmlItem. # noqa: E501
|
||||
:type prefix_ns_string: str
|
||||
"""
|
||||
|
||||
self._prefix_ns_string = prefix_ns_string
|
||||
|
||||
@property
|
||||
def prefix_ns_number(self):
|
||||
"""Gets the prefix_ns_number of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The prefix_ns_number of this XmlItem. # noqa: E501
|
||||
:rtype: float
|
||||
"""
|
||||
return self._prefix_ns_number
|
||||
|
||||
@prefix_ns_number.setter
|
||||
def prefix_ns_number(self, prefix_ns_number):
|
||||
"""Sets the prefix_ns_number of this XmlItem.
|
||||
|
||||
|
||||
:param prefix_ns_number: The prefix_ns_number of this XmlItem. # noqa: E501
|
||||
:type prefix_ns_number: float
|
||||
"""
|
||||
|
||||
self._prefix_ns_number = prefix_ns_number
|
||||
|
||||
@property
|
||||
def prefix_ns_integer(self):
|
||||
"""Gets the prefix_ns_integer of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The prefix_ns_integer of this XmlItem. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._prefix_ns_integer
|
||||
|
||||
@prefix_ns_integer.setter
|
||||
def prefix_ns_integer(self, prefix_ns_integer):
|
||||
"""Sets the prefix_ns_integer of this XmlItem.
|
||||
|
||||
|
||||
:param prefix_ns_integer: The prefix_ns_integer of this XmlItem. # noqa: E501
|
||||
:type prefix_ns_integer: int
|
||||
"""
|
||||
|
||||
self._prefix_ns_integer = prefix_ns_integer
|
||||
|
||||
@property
|
||||
def prefix_ns_boolean(self):
|
||||
"""Gets the prefix_ns_boolean of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The prefix_ns_boolean of this XmlItem. # noqa: E501
|
||||
:rtype: bool
|
||||
"""
|
||||
return self._prefix_ns_boolean
|
||||
|
||||
@prefix_ns_boolean.setter
|
||||
def prefix_ns_boolean(self, prefix_ns_boolean):
|
||||
"""Sets the prefix_ns_boolean of this XmlItem.
|
||||
|
||||
|
||||
:param prefix_ns_boolean: The prefix_ns_boolean of this XmlItem. # noqa: E501
|
||||
:type prefix_ns_boolean: bool
|
||||
"""
|
||||
|
||||
self._prefix_ns_boolean = prefix_ns_boolean
|
||||
|
||||
@property
|
||||
def prefix_ns_array(self):
|
||||
"""Gets the prefix_ns_array of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The prefix_ns_array of this XmlItem. # noqa: E501
|
||||
:rtype: list[int]
|
||||
"""
|
||||
return self._prefix_ns_array
|
||||
|
||||
@prefix_ns_array.setter
|
||||
def prefix_ns_array(self, prefix_ns_array):
|
||||
"""Sets the prefix_ns_array of this XmlItem.
|
||||
|
||||
|
||||
:param prefix_ns_array: The prefix_ns_array of this XmlItem. # noqa: E501
|
||||
:type prefix_ns_array: list[int]
|
||||
"""
|
||||
|
||||
self._prefix_ns_array = prefix_ns_array
|
||||
|
||||
@property
|
||||
def prefix_ns_wrapped_array(self):
|
||||
"""Gets the prefix_ns_wrapped_array of this XmlItem. # noqa: E501
|
||||
|
||||
|
||||
:return: The prefix_ns_wrapped_array of this XmlItem. # noqa: E501
|
||||
:rtype: list[int]
|
||||
"""
|
||||
return self._prefix_ns_wrapped_array
|
||||
|
||||
@prefix_ns_wrapped_array.setter
|
||||
def prefix_ns_wrapped_array(self, prefix_ns_wrapped_array):
|
||||
"""Sets the prefix_ns_wrapped_array of this XmlItem.
|
||||
|
||||
|
||||
:param prefix_ns_wrapped_array: The prefix_ns_wrapped_array of this XmlItem. # noqa: E501
|
||||
:type prefix_ns_wrapped_array: list[int]
|
||||
"""
|
||||
|
||||
self._prefix_ns_wrapped_array = prefix_ns_wrapped_array
|
||||
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, XmlItem):
|
||||
return False
|
||||
|
||||
return self.to_dict() == other.to_dict()
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
if not isinstance(other, XmlItem):
|
||||
return True
|
||||
|
||||
return self.to_dict() != other.to_dict()
|
||||
306
samples/client/petstore/python-legacy/petstore_api/rest.py
Normal file
306
samples/client/petstore/python-legacy/petstore_api/rest.py
Normal file
@@ -0,0 +1,306 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import io
|
||||
import json
|
||||
import logging
|
||||
import re
|
||||
import ssl
|
||||
|
||||
import certifi
|
||||
# python 2 and python 3 compatibility library
|
||||
import six
|
||||
from six.moves.urllib.parse import urlencode
|
||||
import urllib3
|
||||
|
||||
from petstore_api.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class RESTResponse(io.IOBase):
|
||||
|
||||
def __init__(self, resp):
|
||||
self.urllib3_response = resp
|
||||
self.status = resp.status
|
||||
self.reason = resp.reason
|
||||
self.data = resp.data
|
||||
|
||||
def getheaders(self):
|
||||
"""Returns a dictionary of the response headers."""
|
||||
return self.urllib3_response.getheaders()
|
||||
|
||||
def getheader(self, name, default=None):
|
||||
"""Returns a given response header."""
|
||||
return self.urllib3_response.getheader(name, default)
|
||||
|
||||
|
||||
class RESTClientObject(object):
|
||||
|
||||
def __init__(self, configuration, pools_size=4, maxsize=None):
|
||||
# urllib3.PoolManager will pass all kw parameters to connectionpool
|
||||
# https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501
|
||||
# https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501
|
||||
# maxsize is the number of requests to host that are allowed in parallel # noqa: E501
|
||||
# Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501
|
||||
|
||||
# cert_reqs
|
||||
if configuration.verify_ssl:
|
||||
cert_reqs = ssl.CERT_REQUIRED
|
||||
else:
|
||||
cert_reqs = ssl.CERT_NONE
|
||||
|
||||
# ca_certs
|
||||
if configuration.ssl_ca_cert:
|
||||
ca_certs = configuration.ssl_ca_cert
|
||||
else:
|
||||
# if not set certificate file, use Mozilla's root certificates.
|
||||
ca_certs = certifi.where()
|
||||
|
||||
addition_pool_args = {}
|
||||
if configuration.assert_hostname is not None:
|
||||
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
|
||||
|
||||
if configuration.retries is not None:
|
||||
addition_pool_args['retries'] = configuration.retries
|
||||
|
||||
if configuration.socket_options is not None:
|
||||
addition_pool_args['socket_options'] = configuration.socket_options
|
||||
|
||||
if maxsize is None:
|
||||
if configuration.connection_pool_maxsize is not None:
|
||||
maxsize = configuration.connection_pool_maxsize
|
||||
else:
|
||||
maxsize = 4
|
||||
|
||||
# https pool manager
|
||||
if configuration.proxy:
|
||||
self.pool_manager = urllib3.ProxyManager(
|
||||
num_pools=pools_size,
|
||||
maxsize=maxsize,
|
||||
cert_reqs=cert_reqs,
|
||||
ca_certs=ca_certs,
|
||||
cert_file=configuration.cert_file,
|
||||
key_file=configuration.key_file,
|
||||
proxy_url=configuration.proxy,
|
||||
proxy_headers=configuration.proxy_headers,
|
||||
**addition_pool_args
|
||||
)
|
||||
else:
|
||||
self.pool_manager = urllib3.PoolManager(
|
||||
num_pools=pools_size,
|
||||
maxsize=maxsize,
|
||||
cert_reqs=cert_reqs,
|
||||
ca_certs=ca_certs,
|
||||
cert_file=configuration.cert_file,
|
||||
key_file=configuration.key_file,
|
||||
**addition_pool_args
|
||||
)
|
||||
|
||||
def request(self, method, url, query_params=None, headers=None,
|
||||
body=None, post_params=None, _preload_content=True,
|
||||
_request_timeout=None):
|
||||
"""Perform requests.
|
||||
|
||||
:param method: http request method
|
||||
:param url: http request url
|
||||
:param query_params: query parameters in the url
|
||||
:param headers: http request headers
|
||||
:param body: request json body, for `application/json`
|
||||
:param post_params: request post parameters,
|
||||
`application/x-www-form-urlencoded`
|
||||
and `multipart/form-data`
|
||||
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
||||
be returned without reading/decoding response
|
||||
data. Default is True.
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
"""
|
||||
method = method.upper()
|
||||
assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
|
||||
'PATCH', 'OPTIONS']
|
||||
|
||||
if post_params and body:
|
||||
raise ApiValueError(
|
||||
"body parameter cannot be used with post_params parameter."
|
||||
)
|
||||
|
||||
post_params = post_params or {}
|
||||
headers = headers or {}
|
||||
|
||||
timeout = None
|
||||
if _request_timeout:
|
||||
if isinstance(_request_timeout, six.integer_types + (float, )): # noqa: E501,F821
|
||||
timeout = urllib3.Timeout(total=_request_timeout)
|
||||
elif (isinstance(_request_timeout, tuple) and
|
||||
len(_request_timeout) == 2):
|
||||
timeout = urllib3.Timeout(
|
||||
connect=_request_timeout[0], read=_request_timeout[1])
|
||||
|
||||
if 'Content-Type' not in headers:
|
||||
headers['Content-Type'] = 'application/json'
|
||||
|
||||
try:
|
||||
# For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
|
||||
if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
|
||||
if query_params:
|
||||
url += '?' + urlencode(query_params)
|
||||
if re.search('json', headers['Content-Type'], re.IGNORECASE):
|
||||
request_body = None
|
||||
if body is not None:
|
||||
request_body = json.dumps(body)
|
||||
r = self.pool_manager.request(
|
||||
method, url,
|
||||
body=request_body,
|
||||
preload_content=_preload_content,
|
||||
timeout=timeout,
|
||||
headers=headers)
|
||||
elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
|
||||
r = self.pool_manager.request(
|
||||
method, url,
|
||||
fields=post_params,
|
||||
encode_multipart=False,
|
||||
preload_content=_preload_content,
|
||||
timeout=timeout,
|
||||
headers=headers)
|
||||
elif headers['Content-Type'] == 'multipart/form-data':
|
||||
# must del headers['Content-Type'], or the correct
|
||||
# Content-Type which generated by urllib3 will be
|
||||
# overwritten.
|
||||
del headers['Content-Type']
|
||||
r = self.pool_manager.request(
|
||||
method, url,
|
||||
fields=post_params,
|
||||
encode_multipart=True,
|
||||
preload_content=_preload_content,
|
||||
timeout=timeout,
|
||||
headers=headers)
|
||||
# Pass a `string` parameter directly in the body to support
|
||||
# other content types than Json when `body` argument is
|
||||
# provided in serialized form
|
||||
elif isinstance(body, str) or isinstance(body, bytes):
|
||||
request_body = body
|
||||
r = self.pool_manager.request(
|
||||
method, url,
|
||||
body=request_body,
|
||||
preload_content=_preload_content,
|
||||
timeout=timeout,
|
||||
headers=headers)
|
||||
else:
|
||||
# Cannot generate the request from given parameters
|
||||
msg = """Cannot prepare a request message for provided
|
||||
arguments. Please check that your arguments match
|
||||
declared content type."""
|
||||
raise ApiException(status=0, reason=msg)
|
||||
# For `GET`, `HEAD`
|
||||
else:
|
||||
r = self.pool_manager.request(method, url,
|
||||
fields=query_params,
|
||||
preload_content=_preload_content,
|
||||
timeout=timeout,
|
||||
headers=headers)
|
||||
except urllib3.exceptions.SSLError as e:
|
||||
msg = "{0}\n{1}".format(type(e).__name__, str(e))
|
||||
raise ApiException(status=0, reason=msg)
|
||||
|
||||
if _preload_content:
|
||||
r = RESTResponse(r)
|
||||
|
||||
# log response body
|
||||
logger.debug("response body: %s", r.data)
|
||||
|
||||
if not 200 <= r.status <= 299:
|
||||
if r.status == 401:
|
||||
raise UnauthorizedException(http_resp=r)
|
||||
|
||||
if r.status == 403:
|
||||
raise ForbiddenException(http_resp=r)
|
||||
|
||||
if r.status == 404:
|
||||
raise NotFoundException(http_resp=r)
|
||||
|
||||
if 500 <= r.status <= 599:
|
||||
raise ServiceException(http_resp=r)
|
||||
|
||||
raise ApiException(http_resp=r)
|
||||
|
||||
return r
|
||||
|
||||
def GET(self, url, headers=None, query_params=None, _preload_content=True,
|
||||
_request_timeout=None):
|
||||
return self.request("GET", url,
|
||||
headers=headers,
|
||||
_preload_content=_preload_content,
|
||||
_request_timeout=_request_timeout,
|
||||
query_params=query_params)
|
||||
|
||||
def HEAD(self, url, headers=None, query_params=None, _preload_content=True,
|
||||
_request_timeout=None):
|
||||
return self.request("HEAD", url,
|
||||
headers=headers,
|
||||
_preload_content=_preload_content,
|
||||
_request_timeout=_request_timeout,
|
||||
query_params=query_params)
|
||||
|
||||
def OPTIONS(self, url, headers=None, query_params=None, post_params=None,
|
||||
body=None, _preload_content=True, _request_timeout=None):
|
||||
return self.request("OPTIONS", url,
|
||||
headers=headers,
|
||||
query_params=query_params,
|
||||
post_params=post_params,
|
||||
_preload_content=_preload_content,
|
||||
_request_timeout=_request_timeout,
|
||||
body=body)
|
||||
|
||||
def DELETE(self, url, headers=None, query_params=None, body=None,
|
||||
_preload_content=True, _request_timeout=None):
|
||||
return self.request("DELETE", url,
|
||||
headers=headers,
|
||||
query_params=query_params,
|
||||
_preload_content=_preload_content,
|
||||
_request_timeout=_request_timeout,
|
||||
body=body)
|
||||
|
||||
def POST(self, url, headers=None, query_params=None, post_params=None,
|
||||
body=None, _preload_content=True, _request_timeout=None):
|
||||
return self.request("POST", url,
|
||||
headers=headers,
|
||||
query_params=query_params,
|
||||
post_params=post_params,
|
||||
_preload_content=_preload_content,
|
||||
_request_timeout=_request_timeout,
|
||||
body=body)
|
||||
|
||||
def PUT(self, url, headers=None, query_params=None, post_params=None,
|
||||
body=None, _preload_content=True, _request_timeout=None):
|
||||
return self.request("PUT", url,
|
||||
headers=headers,
|
||||
query_params=query_params,
|
||||
post_params=post_params,
|
||||
_preload_content=_preload_content,
|
||||
_request_timeout=_request_timeout,
|
||||
body=body)
|
||||
|
||||
def PATCH(self, url, headers=None, query_params=None, post_params=None,
|
||||
body=None, _preload_content=True, _request_timeout=None):
|
||||
return self.request("PATCH", url,
|
||||
headers=headers,
|
||||
query_params=query_params,
|
||||
post_params=post_params,
|
||||
_preload_content=_preload_content,
|
||||
_request_timeout=_request_timeout,
|
||||
body=body)
|
||||
Reference in New Issue
Block a user