# coding: utf-8

"""
    Component Database API

    The API that provides access to Component Database data.  # noqa: E501

    The version of the OpenAPI document: 3.8.0
    Contact: djarosz@anl.gov
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from cdbApi.configuration import Configuration


class PropertyType(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',
        'description': 'str',
        'prompt_description': 'str',
        'default_value': 'str',
        'default_units': 'str',
        'is_user_writeable': 'bool',
        'is_dynamic': 'bool',
        'is_internal': 'bool',
        'is_active': 'bool',
        'is_metadata_dynamic': 'bool',
        'sorted_allowed_property_value_list': 'list[AllowedPropertyValue]'
    }

    attribute_map = {
        'id': 'id',
        'name': 'name',
        'description': 'description',
        'prompt_description': 'promptDescription',
        'default_value': 'defaultValue',
        'default_units': 'defaultUnits',
        'is_user_writeable': 'isUserWriteable',
        'is_dynamic': 'isDynamic',
        'is_internal': 'isInternal',
        'is_active': 'isActive',
        'is_metadata_dynamic': 'isMetadataDynamic',
        'sorted_allowed_property_value_list': 'sortedAllowedPropertyValueList'
    }

    def __init__(self, id=None, name=None, description=None, prompt_description=None, default_value=None, default_units=None, is_user_writeable=None, is_dynamic=None, is_internal=None, is_active=None, is_metadata_dynamic=None, sorted_allowed_property_value_list=None, local_vars_configuration=None):  # noqa: E501
        """PropertyType - 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._description = None
        self._prompt_description = None
        self._default_value = None
        self._default_units = None
        self._is_user_writeable = None
        self._is_dynamic = None
        self._is_internal = None
        self._is_active = None
        self._is_metadata_dynamic = None
        self._sorted_allowed_property_value_list = None
        self.discriminator = None

        if id is not None:
            self.id = id
        self.name = name
        if description is not None:
            self.description = description
        if prompt_description is not None:
            self.prompt_description = prompt_description
        if default_value is not None:
            self.default_value = default_value
        if default_units is not None:
            self.default_units = default_units
        if is_user_writeable is not None:
            self.is_user_writeable = is_user_writeable
        if is_dynamic is not None:
            self.is_dynamic = is_dynamic
        if is_internal is not None:
            self.is_internal = is_internal
        if is_active is not None:
            self.is_active = is_active
        if is_metadata_dynamic is not None:
            self.is_metadata_dynamic = is_metadata_dynamic
        if sorted_allowed_property_value_list is not None:
            self.sorted_allowed_property_value_list = sorted_allowed_property_value_list

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


        :return: The id of this PropertyType.  # noqa: E501
        :rtype: int
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this PropertyType.


        :param id: The id of this PropertyType.  # noqa: E501
        :type: int
        """

        self._id = id

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


        :return: The name of this PropertyType.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this PropertyType.


        :param name: The name of this PropertyType.  # noqa: E501
        :type: 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
        if (self.local_vars_configuration.client_side_validation and
                name is not None and len(name) > 64):
            raise ValueError("Invalid value for `name`, length must be less than or equal to `64`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                name is not None and len(name) < 1):
            raise ValueError("Invalid value for `name`, length must be greater than or equal to `1`")  # noqa: E501

        self._name = name

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


        :return: The description of this PropertyType.  # noqa: E501
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this PropertyType.


        :param description: The description of this PropertyType.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                description is not None and len(description) > 256):
            raise ValueError("Invalid value for `description`, length must be less than or equal to `256`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                description is not None and len(description) < 0):
            raise ValueError("Invalid value for `description`, length must be greater than or equal to `0`")  # noqa: E501

        self._description = description

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


        :return: The prompt_description of this PropertyType.  # noqa: E501
        :rtype: str
        """
        return self._prompt_description

    @prompt_description.setter
    def prompt_description(self, prompt_description):
        """Sets the prompt_description of this PropertyType.


        :param prompt_description: The prompt_description of this PropertyType.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                prompt_description is not None and len(prompt_description) > 256):
            raise ValueError("Invalid value for `prompt_description`, length must be less than or equal to `256`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                prompt_description is not None and len(prompt_description) < 0):
            raise ValueError("Invalid value for `prompt_description`, length must be greater than or equal to `0`")  # noqa: E501

        self._prompt_description = prompt_description

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


        :return: The default_value of this PropertyType.  # noqa: E501
        :rtype: str
        """
        return self._default_value

    @default_value.setter
    def default_value(self, default_value):
        """Sets the default_value of this PropertyType.


        :param default_value: The default_value of this PropertyType.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                default_value is not None and len(default_value) > 64):
            raise ValueError("Invalid value for `default_value`, length must be less than or equal to `64`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                default_value is not None and len(default_value) < 0):
            raise ValueError("Invalid value for `default_value`, length must be greater than or equal to `0`")  # noqa: E501

        self._default_value = default_value

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


        :return: The default_units of this PropertyType.  # noqa: E501
        :rtype: str
        """
        return self._default_units

    @default_units.setter
    def default_units(self, default_units):
        """Sets the default_units of this PropertyType.


        :param default_units: The default_units of this PropertyType.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                default_units is not None and len(default_units) > 16):
            raise ValueError("Invalid value for `default_units`, length must be less than or equal to `16`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                default_units is not None and len(default_units) < 0):
            raise ValueError("Invalid value for `default_units`, length must be greater than or equal to `0`")  # noqa: E501

        self._default_units = default_units

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


        :return: The is_user_writeable of this PropertyType.  # noqa: E501
        :rtype: bool
        """
        return self._is_user_writeable

    @is_user_writeable.setter
    def is_user_writeable(self, is_user_writeable):
        """Sets the is_user_writeable of this PropertyType.


        :param is_user_writeable: The is_user_writeable of this PropertyType.  # noqa: E501
        :type: bool
        """

        self._is_user_writeable = is_user_writeable

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


        :return: The is_dynamic of this PropertyType.  # noqa: E501
        :rtype: bool
        """
        return self._is_dynamic

    @is_dynamic.setter
    def is_dynamic(self, is_dynamic):
        """Sets the is_dynamic of this PropertyType.


        :param is_dynamic: The is_dynamic of this PropertyType.  # noqa: E501
        :type: bool
        """

        self._is_dynamic = is_dynamic

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


        :return: The is_internal of this PropertyType.  # noqa: E501
        :rtype: bool
        """
        return self._is_internal

    @is_internal.setter
    def is_internal(self, is_internal):
        """Sets the is_internal of this PropertyType.


        :param is_internal: The is_internal of this PropertyType.  # noqa: E501
        :type: bool
        """

        self._is_internal = is_internal

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


        :return: The is_active of this PropertyType.  # noqa: E501
        :rtype: bool
        """
        return self._is_active

    @is_active.setter
    def is_active(self, is_active):
        """Sets the is_active of this PropertyType.


        :param is_active: The is_active of this PropertyType.  # noqa: E501
        :type: bool
        """

        self._is_active = is_active

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


        :return: The is_metadata_dynamic of this PropertyType.  # noqa: E501
        :rtype: bool
        """
        return self._is_metadata_dynamic

    @is_metadata_dynamic.setter
    def is_metadata_dynamic(self, is_metadata_dynamic):
        """Sets the is_metadata_dynamic of this PropertyType.


        :param is_metadata_dynamic: The is_metadata_dynamic of this PropertyType.  # noqa: E501
        :type: bool
        """

        self._is_metadata_dynamic = is_metadata_dynamic

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


        :return: The sorted_allowed_property_value_list of this PropertyType.  # noqa: E501
        :rtype: list[AllowedPropertyValue]
        """
        return self._sorted_allowed_property_value_list

    @sorted_allowed_property_value_list.setter
    def sorted_allowed_property_value_list(self, sorted_allowed_property_value_list):
        """Sets the sorted_allowed_property_value_list of this PropertyType.


        :param sorted_allowed_property_value_list: The sorted_allowed_property_value_list of this PropertyType.  # noqa: E501
        :type: list[AllowedPropertyValue]
        """

        self._sorted_allowed_property_value_list = sorted_allowed_property_value_list

    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, PropertyType):
            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, PropertyType):
            return True

        return self.to_dict() != other.to_dict()
