# coding: utf-8

"""
    Tator REST API

    Interface to the Tator backend.  # noqa: E501

    The version of the OpenAPI document: v1
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from ..configuration import Configuration


class StateTypeSpec(object):
    """
    """

    """
    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 = {
        'association': 'str',
        'attribute_types': 'list[AttributeType]',
        'default_localization': 'int',
        'delete_child_localizations': 'bool',
        'description': 'str',
        'effective_permission': 'int',
        'elemental_id': 'str',
        'grouping_default': 'bool',
        'interpolation': 'str',
        'media_types': 'list[int]',
        'name': 'str',
        'visible': 'bool'
    }

    attribute_map = {
        'association': 'association',
        'attribute_types': 'attribute_types',
        'default_localization': 'default_localization',
        'delete_child_localizations': 'delete_child_localizations',
        'description': 'description',
        'effective_permission': 'effective_permission',
        'elemental_id': 'elemental_id',
        'grouping_default': 'grouping_default',
        'interpolation': 'interpolation',
        'media_types': 'media_types',
        'name': 'name',
        'visible': 'visible'
    }

    def __init__(self, association=None, attribute_types=None, default_localization=None, delete_child_localizations=False, description=None, effective_permission=None, elemental_id=None, grouping_default=True, interpolation='latest', media_types=None, name=None, visible=None, local_vars_configuration=None):  # noqa: E501
        """StateTypeSpec - a model defined in OpenAPI"""
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._association = None
        self._attribute_types = None
        self._default_localization = None
        self._delete_child_localizations = None
        self._description = None
        self._effective_permission = None
        self._elemental_id = None
        self._grouping_default = None
        self._interpolation = None
        self._media_types = None
        self._name = None
        self._visible = None
        self.discriminator = None

        self.association = association
        if attribute_types is not None:
            self.attribute_types = attribute_types
        if default_localization is not None:
            self.default_localization = default_localization
        if delete_child_localizations is not None:
            self.delete_child_localizations = delete_child_localizations
        if description is not None:
            self.description = description
        if effective_permission is not None:
            self.effective_permission = effective_permission
        self.elemental_id = elemental_id
        if grouping_default is not None:
            self.grouping_default = grouping_default
        if interpolation is not None:
            self.interpolation = interpolation
        self.media_types = media_types
        self.name = name
        if visible is not None:
            self.visible = visible

    @property
    def association(self):
        """
        Type of object this state type is associated with.

        :return: The association of this StateTypeSpec. 
        :rtype: str
        """
        return self._association

    @association.setter
    def association(self, association):
        """
        Type of object this state type is associated with.

        :param association: The association of this StateTypeSpec.
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and association is None:  # noqa: E501
            raise ValueError("Invalid value for `association`, must not be `None`")  # noqa: E501
        allowed_values = ["Media", "Frame", "Localization"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and association not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `association` ({0}), must be one of {1}"  # noqa: E501
                .format(association, allowed_values)
            )

        self._association = association

    @property
    def attribute_types(self):
        """
        Attribute type definitions.

        :return: The attribute_types of this StateTypeSpec. 
        :rtype: list[AttributeType]
        """
        return self._attribute_types

    @attribute_types.setter
    def attribute_types(self, attribute_types):
        """
        Attribute type definitions.

        :param attribute_types: The attribute_types of this StateTypeSpec.
        :type: list[AttributeType]
        """

        self._attribute_types = attribute_types

    @property
    def default_localization(self):
        """
        If this is a track type, this is a unique integer identifying the default localization type that is created when a track is created via the web interface.

        :return: The default_localization of this StateTypeSpec. 
        :rtype: int
        """
        return self._default_localization

    @default_localization.setter
    def default_localization(self, default_localization):
        """
        If this is a track type, this is a unique integer identifying the default localization type that is created when a track is created via the web interface.

        :param default_localization: The default_localization of this StateTypeSpec.
        :type: int
        """

        self._default_localization = default_localization

    @property
    def delete_child_localizations(self):
        """
        True if child localizations should be deleted when this state is deleted. Localizations will only be deleted if they are not associated with another state. 

        :return: The delete_child_localizations of this StateTypeSpec. 
        :rtype: bool
        """
        return self._delete_child_localizations

    @delete_child_localizations.setter
    def delete_child_localizations(self, delete_child_localizations):
        """
        True if child localizations should be deleted when this state is deleted. Localizations will only be deleted if they are not associated with another state. 

        :param delete_child_localizations: The delete_child_localizations of this StateTypeSpec.
        :type: bool
        """

        self._delete_child_localizations = delete_child_localizations

    @property
    def description(self):
        """
        Description of the state type.

        :return: The description of this StateTypeSpec. 
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """
        Description of the state type.

        :param description: The description of this StateTypeSpec.
        :type: str
        """

        self._description = description

    @property
    def effective_permission(self):
        """
        Effective permission mask for this entity.

        :return: The effective_permission of this StateTypeSpec. 
        :rtype: int
        """
        return self._effective_permission

    @effective_permission.setter
    def effective_permission(self, effective_permission):
        """
        Effective permission mask for this entity.

        :param effective_permission: The effective_permission of this StateTypeSpec.
        :type: int
        """

        self._effective_permission = effective_permission

    @property
    def elemental_id(self):
        """
        The elemental ID of the object.

        :return: The elemental_id of this StateTypeSpec. 
        :rtype: str
        """
        return self._elemental_id

    @elemental_id.setter
    def elemental_id(self, elemental_id):
        """
        The elemental ID of the object.

        :param elemental_id: The elemental_id of this StateTypeSpec.
        :type: str
        """

        self._elemental_id = elemental_id

    @property
    def grouping_default(self):
        """
        Whether to group elements in the UI by default.

        :return: The grouping_default of this StateTypeSpec. 
        :rtype: bool
        """
        return self._grouping_default

    @grouping_default.setter
    def grouping_default(self, grouping_default):
        """
        Whether to group elements in the UI by default.

        :param grouping_default: The grouping_default of this StateTypeSpec.
        :type: bool
        """

        self._grouping_default = grouping_default

    @property
    def interpolation(self):
        """
        Interpolation method used by the web interface.

        :return: The interpolation of this StateTypeSpec. 
        :rtype: str
        """
        return self._interpolation

    @interpolation.setter
    def interpolation(self, interpolation):
        """
        Interpolation method used by the web interface.

        :param interpolation: The interpolation of this StateTypeSpec.
        :type: str
        """
        allowed_values = ["none", "latest", "attr_style_range"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and interpolation not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `interpolation` ({0}), must be one of {1}"  # noqa: E501
                .format(interpolation, allowed_values)
            )

        self._interpolation = interpolation

    @property
    def media_types(self):
        """
        List of integers identifying media types that this state type may apply to.

        :return: The media_types of this StateTypeSpec. 
        :rtype: list[int]
        """
        return self._media_types

    @media_types.setter
    def media_types(self, media_types):
        """
        List of integers identifying media types that this state type may apply to.

        :param media_types: The media_types of this StateTypeSpec.
        :type: list[int]
        """
        if self.local_vars_configuration.client_side_validation and media_types is None:  # noqa: E501
            raise ValueError("Invalid value for `media_types`, must not be `None`")  # noqa: E501

        self._media_types = media_types

    @property
    def name(self):
        """
        Name of the state type.

        :return: The name of this StateTypeSpec. 
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """
        Name of the state type.

        :param name: The name of this StateTypeSpec.
        :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

        self._name = name

    @property
    def visible(self):
        """
        Whether this state type should be displayed.

        :return: The visible of this StateTypeSpec. 
        :rtype: bool
        """
        return self._visible

    @visible.setter
    def visible(self, visible):
        """
        Whether this state type should be displayed.

        :param visible: The visible of this StateTypeSpec.
        :type: bool
        """

        self._visible = visible

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

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