diff --git a/samples/client/petstore/python/docs/Cat.md b/samples/client/petstore/python/docs/Cat.md index d052c5615b8..8d30565d014 100644 --- a/samples/client/petstore/python/docs/Cat.md +++ b/samples/client/petstore/python/docs/Cat.md @@ -3,8 +3,6 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**class_name** | **str** | | -**color** | **str** | | [optional] [default to 'red'] **declawed** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/Dog.md b/samples/client/petstore/python/docs/Dog.md index ac70f17e668..f727487975c 100644 --- a/samples/client/petstore/python/docs/Dog.md +++ b/samples/client/petstore/python/docs/Dog.md @@ -3,8 +3,6 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**class_name** | **str** | | -**color** | **str** | | [optional] [default to 'red'] **breed** | **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) diff --git a/samples/client/petstore/python/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python/petstore_api/models/additional_properties_class.py index 2e8bb951d46..a5329b411cd 100644 --- a/samples/client/petstore/python/petstore_api/models/additional_properties_class.py +++ b/samples/client/petstore/python/petstore_api/models/additional_properties_class.py @@ -47,6 +47,7 @@ class AdditionalPropertiesClass(object): self._map_property = None self._map_of_map_property = None + self.discriminator = None if map_property is not None: self.map_property = map_property diff --git a/samples/client/petstore/python/petstore_api/models/animal.py b/samples/client/petstore/python/petstore_api/models/animal.py index d96d06f9331..13d8276713d 100644 --- a/samples/client/petstore/python/petstore_api/models/animal.py +++ b/samples/client/petstore/python/petstore_api/models/animal.py @@ -40,6 +40,11 @@ class Animal(object): 'color': 'color' } + discriminator_value_class_map = { + '': 'Dog', + '': 'Cat' + } + def __init__(self, class_name=None, color='red'): """ Animal - a model defined in Swagger @@ -47,6 +52,7 @@ class Animal(object): self._class_name = None self._color = None + self.discriminator = 'className' self.class_name = class_name if color is not None: @@ -96,6 +102,16 @@ class Animal(object): self._color = color + def get_real_child_model(self, data): + """ + Returns the real base class specified by the discriminator + """ + discriminator_value = data[self.discriminator].lower() + if self.discriminator_value_class_map.has_key(discriminator_value): + return self.discriminator_value_class_map[discriminator_value] + else: + return None + def to_dict(self): """ Returns the model properties as a dict diff --git a/samples/client/petstore/python/petstore_api/models/animal_farm.py b/samples/client/petstore/python/petstore_api/models/animal_farm.py index eab98db2799..fa47d63f881 100644 --- a/samples/client/petstore/python/petstore_api/models/animal_farm.py +++ b/samples/client/petstore/python/petstore_api/models/animal_farm.py @@ -43,6 +43,7 @@ class AnimalFarm(object): AnimalFarm - a model defined in Swagger """ + self.discriminator = None def to_dict(self): diff --git a/samples/client/petstore/python/petstore_api/models/api_response.py b/samples/client/petstore/python/petstore_api/models/api_response.py index f62b2bc1eed..b2d784d8020 100644 --- a/samples/client/petstore/python/petstore_api/models/api_response.py +++ b/samples/client/petstore/python/petstore_api/models/api_response.py @@ -50,6 +50,7 @@ class ApiResponse(object): self._code = None self._type = None self._message = None + self.discriminator = None if code is not None: self.code = code diff --git a/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py b/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py index 9cd0262ede7..0792f5a8a23 100644 --- a/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py @@ -44,6 +44,7 @@ class ArrayOfArrayOfNumberOnly(object): """ self._array_array_number = None + self.discriminator = None if array_array_number is not None: self.array_array_number = array_array_number diff --git a/samples/client/petstore/python/petstore_api/models/array_of_number_only.py b/samples/client/petstore/python/petstore_api/models/array_of_number_only.py index cf2bdcb9982..9d00e1b37a2 100644 --- a/samples/client/petstore/python/petstore_api/models/array_of_number_only.py +++ b/samples/client/petstore/python/petstore_api/models/array_of_number_only.py @@ -44,6 +44,7 @@ class ArrayOfNumberOnly(object): """ self._array_number = None + self.discriminator = None if array_number is not None: self.array_number = array_number diff --git a/samples/client/petstore/python/petstore_api/models/array_test.py b/samples/client/petstore/python/petstore_api/models/array_test.py index 1b3fa642d5f..ac3079087c8 100644 --- a/samples/client/petstore/python/petstore_api/models/array_test.py +++ b/samples/client/petstore/python/petstore_api/models/array_test.py @@ -50,6 +50,7 @@ class ArrayTest(object): 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 diff --git a/samples/client/petstore/python/petstore_api/models/capitalization.py b/samples/client/petstore/python/petstore_api/models/capitalization.py index 185f27fe1a9..c9be6ed4d15 100644 --- a/samples/client/petstore/python/petstore_api/models/capitalization.py +++ b/samples/client/petstore/python/petstore_api/models/capitalization.py @@ -59,6 +59,7 @@ class Capitalization(object): 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 diff --git a/samples/client/petstore/python/petstore_api/models/cat.py b/samples/client/petstore/python/petstore_api/models/cat.py index bb85ecd2c31..76dfdc0e5b1 100644 --- a/samples/client/petstore/python/petstore_api/models/cat.py +++ b/samples/client/petstore/python/petstore_api/models/cat.py @@ -31,76 +31,24 @@ class Cat(object): and the value is json key in definition. """ swagger_types = { - 'class_name': 'str', - 'color': 'str', 'declawed': 'bool' } attribute_map = { - 'class_name': 'className', - 'color': 'color', 'declawed': 'declawed' } - def __init__(self, class_name=None, color='red', declawed=None): + def __init__(self, declawed=None): """ Cat - a model defined in Swagger """ - self._class_name = None - self._color = None self._declawed = None + self.discriminator = None - self.class_name = class_name - if color is not None: - self.color = color if declawed is not None: self.declawed = declawed - @property - def class_name(self): - """ - Gets the class_name of this Cat. - - :return: The class_name of this Cat. - :rtype: str - """ - return self._class_name - - @class_name.setter - def class_name(self, class_name): - """ - Sets the class_name of this Cat. - - :param class_name: The class_name of this Cat. - :type: str - """ - if class_name is None: - raise ValueError("Invalid value for `class_name`, must not be `None`") - - self._class_name = class_name - - @property - def color(self): - """ - Gets the color of this Cat. - - :return: The color of this Cat. - :rtype: str - """ - return self._color - - @color.setter - def color(self, color): - """ - Sets the color of this Cat. - - :param color: The color of this Cat. - :type: str - """ - - self._color = color - @property def declawed(self): """ diff --git a/samples/client/petstore/python/petstore_api/models/category.py b/samples/client/petstore/python/petstore_api/models/category.py index 8e7c828917f..859283a3f77 100644 --- a/samples/client/petstore/python/petstore_api/models/category.py +++ b/samples/client/petstore/python/petstore_api/models/category.py @@ -47,6 +47,7 @@ class Category(object): self._id = None self._name = None + self.discriminator = None if id is not None: self.id = id diff --git a/samples/client/petstore/python/petstore_api/models/class_model.py b/samples/client/petstore/python/petstore_api/models/class_model.py index 89a0b67a7d2..7b39d38abe9 100644 --- a/samples/client/petstore/python/petstore_api/models/class_model.py +++ b/samples/client/petstore/python/petstore_api/models/class_model.py @@ -44,6 +44,7 @@ class ClassModel(object): """ self.__class = None + self.discriminator = None if _class is not None: self._class = _class diff --git a/samples/client/petstore/python/petstore_api/models/client.py b/samples/client/petstore/python/petstore_api/models/client.py index a44f2a92ef5..395f77913cc 100644 --- a/samples/client/petstore/python/petstore_api/models/client.py +++ b/samples/client/petstore/python/petstore_api/models/client.py @@ -44,6 +44,7 @@ class Client(object): """ self._client = None + self.discriminator = None if client is not None: self.client = client diff --git a/samples/client/petstore/python/petstore_api/models/dog.py b/samples/client/petstore/python/petstore_api/models/dog.py index be2fab3e8c0..3c159ad0d6f 100644 --- a/samples/client/petstore/python/petstore_api/models/dog.py +++ b/samples/client/petstore/python/petstore_api/models/dog.py @@ -31,76 +31,24 @@ class Dog(object): and the value is json key in definition. """ swagger_types = { - 'class_name': 'str', - 'color': 'str', 'breed': 'str' } attribute_map = { - 'class_name': 'className', - 'color': 'color', 'breed': 'breed' } - def __init__(self, class_name=None, color='red', breed=None): + def __init__(self, breed=None): """ Dog - a model defined in Swagger """ - self._class_name = None - self._color = None self._breed = None + self.discriminator = None - self.class_name = class_name - if color is not None: - self.color = color if breed is not None: self.breed = breed - @property - def class_name(self): - """ - Gets the class_name of this Dog. - - :return: The class_name of this Dog. - :rtype: str - """ - return self._class_name - - @class_name.setter - def class_name(self, class_name): - """ - Sets the class_name of this Dog. - - :param class_name: The class_name of this Dog. - :type: str - """ - if class_name is None: - raise ValueError("Invalid value for `class_name`, must not be `None`") - - self._class_name = class_name - - @property - def color(self): - """ - Gets the color of this Dog. - - :return: The color of this Dog. - :rtype: str - """ - return self._color - - @color.setter - def color(self, color): - """ - Sets the color of this Dog. - - :param color: The color of this Dog. - :type: str - """ - - self._color = color - @property def breed(self): """ diff --git a/samples/client/petstore/python/petstore_api/models/enum_arrays.py b/samples/client/petstore/python/petstore_api/models/enum_arrays.py index 2a6ef69d544..893085ea235 100644 --- a/samples/client/petstore/python/petstore_api/models/enum_arrays.py +++ b/samples/client/petstore/python/petstore_api/models/enum_arrays.py @@ -47,6 +47,7 @@ class EnumArrays(object): self._just_symbol = None self._array_enum = None + self.discriminator = None if just_symbol is not None: self.just_symbol = just_symbol diff --git a/samples/client/petstore/python/petstore_api/models/enum_class.py b/samples/client/petstore/python/petstore_api/models/enum_class.py index 6c801aa3ad9..d9e0b771a7d 100644 --- a/samples/client/petstore/python/petstore_api/models/enum_class.py +++ b/samples/client/petstore/python/petstore_api/models/enum_class.py @@ -49,6 +49,7 @@ class EnumClass(object): EnumClass - a model defined in Swagger """ + self.discriminator = None def to_dict(self): diff --git a/samples/client/petstore/python/petstore_api/models/enum_test.py b/samples/client/petstore/python/petstore_api/models/enum_test.py index e7cff9b9282..6d7caa1f4bc 100644 --- a/samples/client/petstore/python/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python/petstore_api/models/enum_test.py @@ -53,6 +53,7 @@ class EnumTest(object): 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 diff --git a/samples/client/petstore/python/petstore_api/models/format_test.py b/samples/client/petstore/python/petstore_api/models/format_test.py index 3a6f07ea254..139d1733b35 100644 --- a/samples/client/petstore/python/petstore_api/models/format_test.py +++ b/samples/client/petstore/python/petstore_api/models/format_test.py @@ -80,6 +80,7 @@ class FormatTest(object): self._date_time = None self._uuid = None self._password = None + self.discriminator = None if integer is not None: self.integer = integer diff --git a/samples/client/petstore/python/petstore_api/models/has_only_read_only.py b/samples/client/petstore/python/petstore_api/models/has_only_read_only.py index bd13435949c..da0c14ec5b1 100644 --- a/samples/client/petstore/python/petstore_api/models/has_only_read_only.py +++ b/samples/client/petstore/python/petstore_api/models/has_only_read_only.py @@ -47,6 +47,7 @@ class HasOnlyReadOnly(object): self._bar = None self._foo = None + self.discriminator = None if bar is not None: self.bar = bar diff --git a/samples/client/petstore/python/petstore_api/models/list.py b/samples/client/petstore/python/petstore_api/models/list.py index 39b59e96fd1..2ac0e51fb12 100644 --- a/samples/client/petstore/python/petstore_api/models/list.py +++ b/samples/client/petstore/python/petstore_api/models/list.py @@ -44,6 +44,7 @@ class List(object): """ self.__123_list = None + self.discriminator = None if _123_list is not None: self._123_list = _123_list diff --git a/samples/client/petstore/python/petstore_api/models/map_test.py b/samples/client/petstore/python/petstore_api/models/map_test.py index 5ce5354fc54..3cb936e0db8 100644 --- a/samples/client/petstore/python/petstore_api/models/map_test.py +++ b/samples/client/petstore/python/petstore_api/models/map_test.py @@ -47,6 +47,7 @@ class MapTest(object): self._map_map_of_string = None self._map_of_enum_string = None + self.discriminator = None if map_map_of_string is not None: self.map_map_of_string = map_map_of_string diff --git a/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py index 901a3a09e1b..4b773deacef 100644 --- a/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -50,6 +50,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): self._uuid = None self._date_time = None self._map = None + self.discriminator = None if uuid is not None: self.uuid = uuid diff --git a/samples/client/petstore/python/petstore_api/models/model_200_response.py b/samples/client/petstore/python/petstore_api/models/model_200_response.py index f0d98568473..2b6aeb090c0 100644 --- a/samples/client/petstore/python/petstore_api/models/model_200_response.py +++ b/samples/client/petstore/python/petstore_api/models/model_200_response.py @@ -47,6 +47,7 @@ class Model200Response(object): self._name = None self.__class = None + self.discriminator = None if name is not None: self.name = name diff --git a/samples/client/petstore/python/petstore_api/models/model_return.py b/samples/client/petstore/python/petstore_api/models/model_return.py index 16ecd7e40b8..a2160d21dd1 100644 --- a/samples/client/petstore/python/petstore_api/models/model_return.py +++ b/samples/client/petstore/python/petstore_api/models/model_return.py @@ -44,6 +44,7 @@ class ModelReturn(object): """ self.__return = None + self.discriminator = None if _return is not None: self._return = _return diff --git a/samples/client/petstore/python/petstore_api/models/name.py b/samples/client/petstore/python/petstore_api/models/name.py index 2c351e266a6..52b51890dde 100644 --- a/samples/client/petstore/python/petstore_api/models/name.py +++ b/samples/client/petstore/python/petstore_api/models/name.py @@ -53,6 +53,7 @@ class Name(object): self._snake_case = None self.__property = None self.__123_number = None + self.discriminator = None self.name = name if snake_case is not None: diff --git a/samples/client/petstore/python/petstore_api/models/number_only.py b/samples/client/petstore/python/petstore_api/models/number_only.py index 7d2cda69227..b0e279b53a5 100644 --- a/samples/client/petstore/python/petstore_api/models/number_only.py +++ b/samples/client/petstore/python/petstore_api/models/number_only.py @@ -44,6 +44,7 @@ class NumberOnly(object): """ self._just_number = None + self.discriminator = None if just_number is not None: self.just_number = just_number diff --git a/samples/client/petstore/python/petstore_api/models/order.py b/samples/client/petstore/python/petstore_api/models/order.py index 77841dc50ca..52c7b6c227e 100644 --- a/samples/client/petstore/python/petstore_api/models/order.py +++ b/samples/client/petstore/python/petstore_api/models/order.py @@ -59,6 +59,7 @@ class Order(object): self._ship_date = None self._status = None self._complete = None + self.discriminator = None if id is not None: self.id = id diff --git a/samples/client/petstore/python/petstore_api/models/outer_boolean.py b/samples/client/petstore/python/petstore_api/models/outer_boolean.py index 8d2e12e9210..aa9aee11973 100644 --- a/samples/client/petstore/python/petstore_api/models/outer_boolean.py +++ b/samples/client/petstore/python/petstore_api/models/outer_boolean.py @@ -43,6 +43,7 @@ class OuterBoolean(object): OuterBoolean - a model defined in Swagger """ + self.discriminator = None def to_dict(self): diff --git a/samples/client/petstore/python/petstore_api/models/outer_composite.py b/samples/client/petstore/python/petstore_api/models/outer_composite.py index f8faa39bc3e..81611c17688 100644 --- a/samples/client/petstore/python/petstore_api/models/outer_composite.py +++ b/samples/client/petstore/python/petstore_api/models/outer_composite.py @@ -50,6 +50,7 @@ class OuterComposite(object): 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 diff --git a/samples/client/petstore/python/petstore_api/models/outer_enum.py b/samples/client/petstore/python/petstore_api/models/outer_enum.py index 98a43f5df54..8772472c655 100644 --- a/samples/client/petstore/python/petstore_api/models/outer_enum.py +++ b/samples/client/petstore/python/petstore_api/models/outer_enum.py @@ -49,6 +49,7 @@ class OuterEnum(object): OuterEnum - a model defined in Swagger """ + self.discriminator = None def to_dict(self): diff --git a/samples/client/petstore/python/petstore_api/models/outer_number.py b/samples/client/petstore/python/petstore_api/models/outer_number.py index 946e0ab0690..04c44923fb0 100644 --- a/samples/client/petstore/python/petstore_api/models/outer_number.py +++ b/samples/client/petstore/python/petstore_api/models/outer_number.py @@ -43,6 +43,7 @@ class OuterNumber(object): OuterNumber - a model defined in Swagger """ + self.discriminator = None def to_dict(self): diff --git a/samples/client/petstore/python/petstore_api/models/outer_string.py b/samples/client/petstore/python/petstore_api/models/outer_string.py index a92ba3984c9..fd2d7c7623e 100644 --- a/samples/client/petstore/python/petstore_api/models/outer_string.py +++ b/samples/client/petstore/python/petstore_api/models/outer_string.py @@ -43,6 +43,7 @@ class OuterString(object): OuterString - a model defined in Swagger """ + self.discriminator = None def to_dict(self): diff --git a/samples/client/petstore/python/petstore_api/models/pet.py b/samples/client/petstore/python/petstore_api/models/pet.py index e33c0144ead..e1afa26f785 100644 --- a/samples/client/petstore/python/petstore_api/models/pet.py +++ b/samples/client/petstore/python/petstore_api/models/pet.py @@ -59,6 +59,7 @@ class Pet(object): self._photo_urls = None self._tags = None self._status = None + self.discriminator = None if id is not None: self.id = id diff --git a/samples/client/petstore/python/petstore_api/models/read_only_first.py b/samples/client/petstore/python/petstore_api/models/read_only_first.py index d4e9053ffe4..a26d1f33c87 100644 --- a/samples/client/petstore/python/petstore_api/models/read_only_first.py +++ b/samples/client/petstore/python/petstore_api/models/read_only_first.py @@ -47,6 +47,7 @@ class ReadOnlyFirst(object): self._bar = None self._baz = None + self.discriminator = None if bar is not None: self.bar = bar diff --git a/samples/client/petstore/python/petstore_api/models/special_model_name.py b/samples/client/petstore/python/petstore_api/models/special_model_name.py index 5970dbbbd0d..6be888fb9e3 100644 --- a/samples/client/petstore/python/petstore_api/models/special_model_name.py +++ b/samples/client/petstore/python/petstore_api/models/special_model_name.py @@ -44,6 +44,7 @@ class SpecialModelName(object): """ self._special_property_name = None + self.discriminator = None if special_property_name is not None: self.special_property_name = special_property_name diff --git a/samples/client/petstore/python/petstore_api/models/tag.py b/samples/client/petstore/python/petstore_api/models/tag.py index 2406ca40f4d..d59a490a07d 100644 --- a/samples/client/petstore/python/petstore_api/models/tag.py +++ b/samples/client/petstore/python/petstore_api/models/tag.py @@ -47,6 +47,7 @@ class Tag(object): self._id = None self._name = None + self.discriminator = None if id is not None: self.id = id diff --git a/samples/client/petstore/python/petstore_api/models/user.py b/samples/client/petstore/python/petstore_api/models/user.py index 54280c00cfe..21993e90521 100644 --- a/samples/client/petstore/python/petstore_api/models/user.py +++ b/samples/client/petstore/python/petstore_api/models/user.py @@ -65,6 +65,7 @@ class User(object): self._password = None self._phone = None self._user_status = None + self.discriminator = None if id is not None: self.id = id