# 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 LocalizationType(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 = {
        'attribute_types': 'list[AttributeType]',
        'color_map': 'ColorMap',
        'description': 'str',
        'dtype': 'str',
        'grouping_default': 'bool',
        'id': 'int',
        'line_width': 'int',
        'media': 'list[int]',
        'name': 'str',
        'project': 'int',
        'visible': 'bool'
    }

    attribute_map = {
        'attribute_types': 'attribute_types',
        'color_map': 'colorMap',
        'description': 'description',
        'dtype': 'dtype',
        'grouping_default': 'grouping_default',
        'id': 'id',
        'line_width': 'line_width',
        'media': 'media',
        'name': 'name',
        'project': 'project',
        'visible': 'visible'
    }

    def __init__(self, attribute_types=None, color_map=None, description=None, dtype=None, grouping_default=True, id=None, line_width=None, media=None, name=None, project=None, visible=True, local_vars_configuration=None):  # noqa: E501
        """LocalizationType - a model defined in OpenAPI"""
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._attribute_types = None
        self._color_map = None
        self._description = None
        self._dtype = None
        self._grouping_default = None
        self._id = None
        self._line_width = None
        self._media = None
        self._name = None
        self._project = None
        self._visible = None
        self.discriminator = None

        if attribute_types is not None:
            self.attribute_types = attribute_types
        if color_map is not None:
            self.color_map = color_map
        if description is not None:
            self.description = description
        if dtype is not None:
            self.dtype = dtype
        if grouping_default is not None:
            self.grouping_default = grouping_default
        if id is not None:
            self.id = id
        if line_width is not None:
            self.line_width = line_width
        if media is not None:
            self.media = media
        if name is not None:
            self.name = name
        if project is not None:
            self.project = project
        if visible is not None:
            self.visible = visible

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

        :return: The attribute_types of this LocalizationType. 
        :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 LocalizationType.
        :type: list[AttributeType]
        """

        self._attribute_types = attribute_types

    @property
    def color_map(self):
        """

        :return: The color_map of this LocalizationType. 
        :rtype: ColorMap
        """
        return self._color_map

    @color_map.setter
    def color_map(self, color_map):
        """

        :param color_map: The color_map of this LocalizationType.
        :type: ColorMap
        """

        self._color_map = color_map

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

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

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

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

        self._description = description

    @property
    def dtype(self):
        """
        Shape of this localization type.

        :return: The dtype of this LocalizationType. 
        :rtype: str
        """
        return self._dtype

    @dtype.setter
    def dtype(self, dtype):
        """
        Shape of this localization type.

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

        self._dtype = dtype

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

        :return: The grouping_default of this LocalizationType. 
        :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 LocalizationType.
        :type: bool
        """

        self._grouping_default = grouping_default

    @property
    def id(self):
        """
        Unique integer identifying a localization type.

        :return: The id of this LocalizationType. 
        :rtype: int
        """
        return self._id

    @id.setter
    def id(self, id):
        """
        Unique integer identifying a localization type.

        :param id: The id of this LocalizationType.
        :type: int
        """

        self._id = id

    @property
    def line_width(self):
        """
        Width of the line used to draw the localization.

        :return: The line_width of this LocalizationType. 
        :rtype: int
        """
        return self._line_width

    @line_width.setter
    def line_width(self, line_width):
        """
        Width of the line used to draw the localization.

        :param line_width: The line_width of this LocalizationType.
        :type: int
        """
        if (self.local_vars_configuration.client_side_validation and
                line_width is not None and line_width < 1):  # noqa: E501
            raise ValueError("Invalid value for `line_width`, must be a value greater than or equal to `1`")  # noqa: E501

        self._line_width = line_width

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

        :return: The media of this LocalizationType. 
        :rtype: list[int]
        """
        return self._media

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

        :param media: The media of this LocalizationType.
        :type: list[int]
        """

        self._media = media

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

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

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

        :param name: The name of this LocalizationType.
        :type: str
        """

        self._name = name

    @property
    def project(self):
        """
        Unique integer identifying project for this leaf type.

        :return: The project of this LocalizationType. 
        :rtype: int
        """
        return self._project

    @project.setter
    def project(self, project):
        """
        Unique integer identifying project for this leaf type.

        :param project: The project of this LocalizationType.
        :type: int
        """

        self._project = project

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

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

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

        :param visible: The visible of this LocalizationType.
        :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, LocalizationType):
            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, LocalizationType):
            return True

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