# coding: utf-8

"""
    AristaFlowREST/WorklistManager

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: 6.0.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six
from af_worklist_manager.models.dummy_parent import DummyParent  # noqa: F401,E501

class UdtValue(DummyParent):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """
    """
    Attributes:
      swagger_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.
    """
    swagger_types = {
        'sub_class': 'str',
        'value': 'str',
        'udt_name': 'str'
    }
    if hasattr(DummyParent, "swagger_types"):
        swagger_types.update(DummyParent.swagger_types)

    attribute_map = {
        'sub_class': 'subClass',
        'value': 'value',
        'udt_name': 'udtName'
    }
    if hasattr(DummyParent, "attribute_map"):
        attribute_map.update(DummyParent.attribute_map)

    discriminator_value_class_map = {
          'IdentifiedUdtValue': 'IdentifiedUdtValue'    }

    def __init__(self, sub_class=None, value=None, udt_name=None, *args, **kwargs):  # noqa: E501
        """UdtValue - a model defined in Swagger"""  # noqa: E501
        self._sub_class = None
        self._value = None
        self._udt_name = None
        if not(hasattr(self, "discriminator")) or not(self.discriminator):
            self.discriminator = 'sub_class'
        if sub_class is not None:
            self.sub_class = sub_class
        if value is not None:
            self.value = value
        self.udt_name = udt_name
        DummyParent.__init__(self, *args, **kwargs)

    @property
    def sub_class(self):
        """Gets the sub_class of this UdtValue.  # noqa: E501


        :return: The sub_class of this UdtValue.  # noqa: E501
        :rtype: str
        """
        return self._sub_class

    @sub_class.setter
    def sub_class(self, sub_class):
        """Sets the sub_class of this UdtValue.


        :param sub_class: The sub_class of this UdtValue.  # noqa: E501
        :type: str
        """

        self._sub_class = sub_class

    @property
    def value(self):
        """Gets the value of this UdtValue.  # noqa: E501


        :return: The value of this UdtValue.  # noqa: E501
        :rtype: str
        """
        return self._value

    @value.setter
    def value(self, value):
        """Sets the value of this UdtValue.


        :param value: The value of this UdtValue.  # noqa: E501
        :type: str
        """

        self._value = value

    @property
    def udt_name(self):
        """Gets the udt_name of this UdtValue.  # noqa: E501


        :return: The udt_name of this UdtValue.  # noqa: E501
        :rtype: str
        """
        return self._udt_name

    @udt_name.setter
    def udt_name(self, udt_name):
        """Sets the udt_name of this UdtValue.


        :param udt_name: The udt_name of this UdtValue.  # noqa: E501
        :type: str
        """
        if udt_name is None:
            raise ValueError("Invalid value for `udt_name`, must not be `None`")  # noqa: E501

        self._udt_name = udt_name

    def get_real_child_model(self, data):
        """Returns the real base class specified by the discriminator"""
        discriminator_value = data[self.attribute_map[self.discriminator]]
        return discriminator_value if not(self.__class__.__name__ == discriminator_value) else None

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.swagger_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
        if issubclass(UdtValue, dict):
            for key, value in self.items():
                result[key] = 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, UdtValue):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        return not self == other
