Merge remote-tracking branch 'origin/5.3.x' into 6.0.x

This commit is contained in:
William Cheng
2021-07-27 11:52:19 +08:00
1011 changed files with 34058 additions and 5848 deletions

View File

@@ -16,6 +16,7 @@ docs/Category.md
docs/ClassModel.md
docs/Client.md
docs/DefaultApi.md
docs/DeprecatedObject.md
docs/Dog.md
docs/DogAllOf.md
docs/EnumArrays.md
@@ -38,6 +39,7 @@ docs/ModelReturn.md
docs/Name.md
docs/NullableClass.md
docs/NumberOnly.md
docs/ObjectWithDeprecatedFields.md
docs/Order.md
docs/OuterComposite.md
docs/OuterEnum.md
@@ -79,6 +81,7 @@ petstore_api/models/cat_all_of.py
petstore_api/models/category.py
petstore_api/models/class_model.py
petstore_api/models/client.py
petstore_api/models/deprecated_object.py
petstore_api/models/dog.py
petstore_api/models/dog_all_of.py
petstore_api/models/enum_arrays.py
@@ -99,6 +102,7 @@ petstore_api/models/model_return.py
petstore_api/models/name.py
petstore_api/models/nullable_class.py
petstore_api/models/number_only.py
petstore_api/models/object_with_deprecated_fields.py
petstore_api/models/order.py
petstore_api/models/outer_composite.py
petstore_api/models/outer_enum.py

View File

@@ -138,6 +138,7 @@ Class | Method | HTTP request | Description
- [Category](docs/Category.md)
- [ClassModel](docs/ClassModel.md)
- [Client](docs/Client.md)
- [DeprecatedObject](docs/DeprecatedObject.md)
- [Dog](docs/Dog.md)
- [DogAllOf](docs/DogAllOf.md)
- [EnumArrays](docs/EnumArrays.md)
@@ -158,6 +159,7 @@ Class | Method | HTTP request | Description
- [Name](docs/Name.md)
- [NullableClass](docs/NullableClass.md)
- [NumberOnly](docs/NumberOnly.md)
- [ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md)
- [Order](docs/Order.md)
- [OuterComposite](docs/OuterComposite.md)
- [OuterEnum](docs/OuterEnum.md)

View File

@@ -0,0 +1,11 @@
# DeprecatedObject
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,14 @@
# ObjectWithDeprecatedFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **str** | | [optional]
**id** | **float** | | [optional]
**deprecated_ref** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional]
**bars** | **list[str]** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -47,6 +47,7 @@ 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.deprecated_object import DeprecatedObject
from petstore_api.models.dog import Dog
from petstore_api.models.dog_all_of import DogAllOf
from petstore_api.models.enum_arrays import EnumArrays
@@ -67,6 +68,7 @@ from petstore_api.models.model_return import ModelReturn
from petstore_api.models.name import Name
from petstore_api.models.nullable_class import NullableClass
from petstore_api.models.number_only import NumberOnly
from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields
from petstore_api.models.order import Order
from petstore_api.models.outer_composite import OuterComposite
from petstore_api.models.outer_enum import OuterEnum

View File

@@ -26,6 +26,7 @@ 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.deprecated_object import DeprecatedObject
from petstore_api.models.dog import Dog
from petstore_api.models.dog_all_of import DogAllOf
from petstore_api.models.enum_arrays import EnumArrays
@@ -46,6 +47,7 @@ from petstore_api.models.model_return import ModelReturn
from petstore_api.models.name import Name
from petstore_api.models.nullable_class import NullableClass
from petstore_api.models.number_only import NumberOnly
from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields
from petstore_api.models.order import Order
from petstore_api.models.outer_composite import OuterComposite
from petstore_api.models.outer_enum import OuterEnum

View File

@@ -0,0 +1,131 @@
# 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
"""
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getfullargspec
import pprint
import re # noqa: F401
import six
from petstore_api.configuration import Configuration
class DeprecatedObject(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
"""DeprecatedObject - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration.get_default_copy()
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 DeprecatedObject. # noqa: E501
:return: The name of this DeprecatedObject. # noqa: E501
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""Sets the name of this DeprecatedObject.
:param name: The name of this DeprecatedObject. # 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 = getfullargspec(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, DeprecatedObject):
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, DeprecatedObject):
return True
return self.to_dict() != other.to_dict()

View File

@@ -0,0 +1,209 @@
# 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
"""
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getfullargspec
import pprint
import re # noqa: F401
import six
from petstore_api.configuration import Configuration
class ObjectWithDeprecatedFields(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',
'id': 'float',
'deprecated_ref': 'DeprecatedObject',
'bars': 'list[str]'
}
attribute_map = {
'uuid': 'uuid',
'id': 'id',
'deprecated_ref': 'deprecatedRef',
'bars': 'bars'
}
def __init__(self, uuid=None, id=None, deprecated_ref=None, bars=None, local_vars_configuration=None): # noqa: E501
"""ObjectWithDeprecatedFields - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration.get_default_copy()
self.local_vars_configuration = local_vars_configuration
self._uuid = None
self._id = None
self._deprecated_ref = None
self._bars = None
self.discriminator = None
if uuid is not None:
self.uuid = uuid
if id is not None:
self.id = id
if deprecated_ref is not None:
self.deprecated_ref = deprecated_ref
if bars is not None:
self.bars = bars
@property
def uuid(self):
"""Gets the uuid of this ObjectWithDeprecatedFields. # noqa: E501
:return: The uuid of this ObjectWithDeprecatedFields. # noqa: E501
:rtype: str
"""
return self._uuid
@uuid.setter
def uuid(self, uuid):
"""Sets the uuid of this ObjectWithDeprecatedFields.
:param uuid: The uuid of this ObjectWithDeprecatedFields. # noqa: E501
:type uuid: str
"""
self._uuid = uuid
@property
def id(self):
"""Gets the id of this ObjectWithDeprecatedFields. # noqa: E501
:return: The id of this ObjectWithDeprecatedFields. # noqa: E501
:rtype: float
"""
return self._id
@id.setter
def id(self, id):
"""Sets the id of this ObjectWithDeprecatedFields.
:param id: The id of this ObjectWithDeprecatedFields. # noqa: E501
:type id: float
"""
self._id = id
@property
def deprecated_ref(self):
"""Gets the deprecated_ref of this ObjectWithDeprecatedFields. # noqa: E501
:return: The deprecated_ref of this ObjectWithDeprecatedFields. # noqa: E501
:rtype: DeprecatedObject
"""
return self._deprecated_ref
@deprecated_ref.setter
def deprecated_ref(self, deprecated_ref):
"""Sets the deprecated_ref of this ObjectWithDeprecatedFields.
:param deprecated_ref: The deprecated_ref of this ObjectWithDeprecatedFields. # noqa: E501
:type deprecated_ref: DeprecatedObject
"""
self._deprecated_ref = deprecated_ref
@property
def bars(self):
"""Gets the bars of this ObjectWithDeprecatedFields. # noqa: E501
:return: The bars of this ObjectWithDeprecatedFields. # noqa: E501
:rtype: list[str]
"""
return self._bars
@bars.setter
def bars(self, bars):
"""Sets the bars of this ObjectWithDeprecatedFields.
:param bars: The bars of this ObjectWithDeprecatedFields. # noqa: E501
:type bars: list[str]
"""
self._bars = bars
def to_dict(self, serialize=False):
"""Returns the model properties as a dict"""
result = {}
def convert(x):
if hasattr(x, "to_dict"):
args = getfullargspec(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, ObjectWithDeprecatedFields):
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, ObjectWithDeprecatedFields):
return True
return self.to_dict() != other.to_dict()

View File

@@ -0,0 +1,51 @@
# 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 unittest
import datetime
import petstore_api
from petstore_api.models.deprecated_object import DeprecatedObject # noqa: E501
from petstore_api.rest import ApiException
class TestDeprecatedObject(unittest.TestCase):
"""DeprecatedObject unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def make_instance(self, include_optional):
"""Test DeprecatedObject
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# model = petstore_api.models.deprecated_object.DeprecatedObject() # noqa: E501
if include_optional :
return DeprecatedObject(
name = ''
)
else :
return DeprecatedObject(
)
def testDeprecatedObject(self):
"""Test DeprecatedObject"""
inst_req_only = self.make_instance(include_optional=False)
inst_req_and_optional = self.make_instance(include_optional=True)
if __name__ == '__main__':
unittest.main()

View File

@@ -0,0 +1,57 @@
# 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 unittest
import datetime
import petstore_api
from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields # noqa: E501
from petstore_api.rest import ApiException
class TestObjectWithDeprecatedFields(unittest.TestCase):
"""ObjectWithDeprecatedFields unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def make_instance(self, include_optional):
"""Test ObjectWithDeprecatedFields
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# model = petstore_api.models.object_with_deprecated_fields.ObjectWithDeprecatedFields() # noqa: E501
if include_optional :
return ObjectWithDeprecatedFields(
uuid = '',
id = 1.337,
deprecated_ref = petstore_api.models.deprecated_object.DeprecatedObject(
name = '', ),
bars = [
'bar'
]
)
else :
return ObjectWithDeprecatedFields(
)
def testObjectWithDeprecatedFields(self):
"""Test ObjectWithDeprecatedFields"""
inst_req_only = self.make_instance(include_optional=False)
inst_req_and_optional = self.make_instance(include_optional=True)
if __name__ == '__main__':
unittest.main()