Adds spec additionalProperties + nullable examples (#2405)

* Adds v2 spec additionalproperties examples, adds v3 spec nulllable model example, updates samples

* Remaining samples updates

* Adds csharp generator update to handle models with multilevel parent types, which works for the AdditionalPropertiesObject model, samples updated
This commit is contained in:
Justin Black
2019-03-20 00:31:28 -07:00
committed by William Cheng
parent c10463600a
commit b67318ef21
1174 changed files with 86297 additions and 2549 deletions

View File

@@ -28,7 +28,14 @@ from petstore_api.api.user_api import UserApi
from petstore_api.api_client import ApiClient
from petstore_api.configuration import Configuration
# 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

View File

@@ -0,0 +1,120 @@
# 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
OpenAPI spec version: 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 ApiKeyError(OpenApiException, KeyError):
def __init__(self, msg, path_to_item=None):
"""
Args:
msg (str): the exception message
Keyword Args:
path_to_item (None/list) the path to the exception in the
received_data dict
"""
self.path_to_item = path_to_item
full_msg = msg
if path_to_item:
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
super(ApiKeyError, self).__init__(full_msg)
class ApiException(OpenApiException):
def __init__(self, status=None, reason=None, http_resp=None):
if http_resp:
self.status = http_resp.status
self.reason = http_resp.reason
self.body = http_resp.data
self.headers = http_resp.getheaders()
else:
self.status = status
self.reason = reason
self.body = None
self.headers = None
def __str__(self):
"""Custom error messages for exception"""
error_message = "({0})\n"\
"Reason: {1}\n".format(self.status, self.reason)
if self.headers:
error_message += "HTTP response headers: {0}\n".format(
self.headers)
if self.body:
error_message += "HTTP response body: {0}\n".format(self.body)
return error_message
def render_path(path_to_item):
"""Returns a string representation of a path"""
result = ""
for pth in path_to_item:
if isinstance(pth, six.integer_types):
result += "[{0}]".format(pth)
else:
result += "['{0}']".format(pth)
return result

View File

@@ -14,7 +14,14 @@
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

View File

@@ -0,0 +1,112 @@
# 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
OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
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): # noqa: E501
"""AdditionalPropertiesAnyType - a model defined in OpenAPI""" # noqa: E501
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: str
"""
self._name = name
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = 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.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other

View File

@@ -0,0 +1,112 @@
# 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
OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
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): # noqa: E501
"""AdditionalPropertiesArray - a model defined in OpenAPI""" # noqa: E501
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: str
"""
self._name = name
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = 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.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other

View File

@@ -0,0 +1,112 @@
# 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
OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
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): # noqa: E501
"""AdditionalPropertiesBoolean - a model defined in OpenAPI""" # noqa: E501
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: str
"""
self._name = name
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = 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.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other

View File

@@ -31,68 +31,302 @@ class AdditionalPropertiesClass(object):
and the value is json key in definition.
"""
openapi_types = {
'map_property': 'dict(str, str)',
'map_of_map_property': 'dict(str, dict(str, str))'
'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_property': 'map_property',
'map_of_map_property': 'map_of_map_property'
'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_property=None, map_of_map_property=None): # noqa: E501
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): # noqa: E501
"""AdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501
self._map_property = None
self._map_of_map_property = None
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_property is not None:
self.map_property = map_property
if map_of_map_property is not None:
self.map_of_map_property = map_of_map_property
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_property(self):
"""Gets the map_property of this AdditionalPropertiesClass. # noqa: E501
def map_string(self):
"""Gets the map_string of this AdditionalPropertiesClass. # noqa: E501
:return: The map_property of this AdditionalPropertiesClass. # noqa: E501
:return: The map_string of this AdditionalPropertiesClass. # noqa: E501
:rtype: dict(str, str)
"""
return self._map_property
return self._map_string
@map_property.setter
def map_property(self, map_property):
"""Sets the map_property of this AdditionalPropertiesClass.
@map_string.setter
def map_string(self, map_string):
"""Sets the map_string of this AdditionalPropertiesClass.
:param map_property: The map_property of this AdditionalPropertiesClass. # noqa: E501
:param map_string: The map_string of this AdditionalPropertiesClass. # noqa: E501
:type: dict(str, str)
"""
self._map_property = map_property
self._map_string = map_string
@property
def map_of_map_property(self):
"""Gets the map_of_map_property of this AdditionalPropertiesClass. # noqa: E501
def map_number(self):
"""Gets the map_number of this AdditionalPropertiesClass. # noqa: E501
:return: The map_of_map_property 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: 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: 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: 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: 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: 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_of_map_property
return self._map_map_string
@map_of_map_property.setter
def map_of_map_property(self, map_of_map_property):
"""Sets the map_of_map_property of this AdditionalPropertiesClass.
@map_map_string.setter
def map_map_string(self, map_map_string):
"""Sets the map_map_string of this AdditionalPropertiesClass.
:param map_of_map_property: The map_of_map_property of this AdditionalPropertiesClass. # noqa: E501
:param map_map_string: The map_map_string of this AdditionalPropertiesClass. # noqa: E501
:type: dict(str, dict(str, str))
"""
self._map_of_map_property = map_of_map_property
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: 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: 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: 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: object
"""
self._anytype_3 = anytype_3
def to_dict(self):
"""Returns the model properties as a dict"""

View File

@@ -0,0 +1,112 @@
# 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
OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
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): # noqa: E501
"""AdditionalPropertiesInteger - a model defined in OpenAPI""" # noqa: E501
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: str
"""
self._name = name
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = 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.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other

View File

@@ -0,0 +1,112 @@
# 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
OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
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): # noqa: E501
"""AdditionalPropertiesNumber - a model defined in OpenAPI""" # noqa: E501
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: str
"""
self._name = name
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = 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.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other

View File

@@ -0,0 +1,112 @@
# 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
OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
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): # noqa: E501
"""AdditionalPropertiesObject - a model defined in OpenAPI""" # noqa: E501
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: str
"""
self._name = name
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = 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.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other

View File

@@ -0,0 +1,112 @@
# 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
OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
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): # noqa: E501
"""AdditionalPropertiesString - a model defined in OpenAPI""" # noqa: E501
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: str
"""
self._name = name
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = 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.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other