# 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 LocalizationSpec(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 = {
        'attributes': 'dict(str, object)',
        'elemental_id': 'str',
        'frame': 'int',
        'height': 'float',
        'mark': 'int',
        'media_id': 'int',
        'parent': 'float',
        'points': 'list[list[float]]',
        'type': 'int',
        'u': 'float',
        'user_elemental_id': 'str',
        'v': 'float',
        'version': 'int',
        'width': 'float',
        'x': 'float',
        'y': 'float'
    }

    attribute_map = {
        'attributes': 'attributes',
        'elemental_id': 'elemental_id',
        'frame': 'frame',
        'height': 'height',
        'mark': 'mark',
        'media_id': 'media_id',
        'parent': 'parent',
        'points': 'points',
        'type': 'type',
        'u': 'u',
        'user_elemental_id': 'user_elemental_id',
        'v': 'v',
        'version': 'version',
        'width': 'width',
        'x': 'x',
        'y': 'y'
    }

    def __init__(self, attributes=None, elemental_id=None, frame=None, height=None, mark=None, media_id=None, parent=None, points=None, type=None, u=None, user_elemental_id=None, v=None, version=None, width=None, x=None, y=None, local_vars_configuration=None):  # noqa: E501
        """LocalizationSpec - a model defined in OpenAPI"""
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._attributes = None
        self._elemental_id = None
        self._frame = None
        self._height = None
        self._mark = None
        self._media_id = None
        self._parent = None
        self._points = None
        self._type = None
        self._u = None
        self._user_elemental_id = None
        self._v = None
        self._version = None
        self._width = None
        self._x = None
        self._y = None
        self.discriminator = None

        if attributes is not None:
            self.attributes = attributes
        self.elemental_id = elemental_id
        self.frame = frame
        self.height = height
        if mark is not None:
            self.mark = mark
        self.media_id = media_id
        self.parent = parent
        self.points = points
        self.type = type
        self.u = u
        if user_elemental_id is not None:
            self.user_elemental_id = user_elemental_id
        self.v = v
        if version is not None:
            self.version = version
        self.width = width
        self.x = x
        self.y = y

    @property
    def attributes(self):
        """
        Object containing attribute values.

        :return: The attributes of this LocalizationSpec. 
        :rtype: dict(str, object)
        """
        return self._attributes

    @attributes.setter
    def attributes(self, attributes):
        """
        Object containing attribute values.

        :param attributes: The attributes of this LocalizationSpec.
        :type: dict(str, object)
        """

        self._attributes = attributes

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

        :return: The elemental_id of this LocalizationSpec. 
        :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 LocalizationSpec.
        :type: str
        """

        self._elemental_id = elemental_id

    @property
    def frame(self):
        """
        Frame number of this localization if it is in a video.

        :return: The frame of this LocalizationSpec. 
        :rtype: int
        """
        return self._frame

    @frame.setter
    def frame(self, frame):
        """
        Frame number of this localization if it is in a video.

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

        self._frame = frame

    @property
    def height(self):
        """
        Normalized height of bounding box for `box` localization types.

        :return: The height of this LocalizationSpec. 
        :rtype: float
        """
        return self._height

    @height.setter
    def height(self, height):
        """
        Normalized height of bounding box for `box` localization types.

        :param height: The height of this LocalizationSpec.
        :type: float
        """
        if (self.local_vars_configuration.client_side_validation and
                height is not None and height > 1.0):  # noqa: E501
            raise ValueError("Invalid value for `height`, must be a value less than or equal to `1.0`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                height is not None and height < 0.0):  # noqa: E501
            raise ValueError("Invalid value for `height`, must be a value greater than or equal to `0.0`")  # noqa: E501

        self._height = height

    @property
    def mark(self):
        """
        Revision number of this object on this version branch

        :return: The mark of this LocalizationSpec. 
        :rtype: int
        """
        return self._mark

    @mark.setter
    def mark(self, mark):
        """
        Revision number of this object on this version branch

        :param mark: The mark of this LocalizationSpec.
        :type: int
        """

        self._mark = mark

    @property
    def media_id(self):
        """
        Unique integer identifying a media.

        :return: The media_id of this LocalizationSpec. 
        :rtype: int
        """
        return self._media_id

    @media_id.setter
    def media_id(self, media_id):
        """
        Unique integer identifying a media.

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

        self._media_id = media_id

    @property
    def parent(self):
        """
        If a clone, the pk of the parent.

        :return: The parent of this LocalizationSpec. 
        :rtype: float
        """
        return self._parent

    @parent.setter
    def parent(self, parent):
        """
        If a clone, the pk of the parent.

        :param parent: The parent of this LocalizationSpec.
        :type: float
        """

        self._parent = parent

    @property
    def points(self):
        """
        List of normalized [x, y] pairs for `poly` localization types.

        :return: The points of this LocalizationSpec. 
        :rtype: list[list[float]]
        """
        return self._points

    @points.setter
    def points(self, points):
        """
        List of normalized [x, y] pairs for `poly` localization types.

        :param points: The points of this LocalizationSpec.
        :type: list[list[float]]
        """

        self._points = points

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

        :return: The type of this LocalizationSpec. 
        :rtype: int
        """
        return self._type

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

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

        self._type = type

    @property
    def u(self):
        """
        Horizontal vector component for `line` localization types.

        :return: The u of this LocalizationSpec. 
        :rtype: float
        """
        return self._u

    @u.setter
    def u(self, u):
        """
        Horizontal vector component for `line` localization types.

        :param u: The u of this LocalizationSpec.
        :type: float
        """
        if (self.local_vars_configuration.client_side_validation and
                u is not None and u > 1.0):  # noqa: E501
            raise ValueError("Invalid value for `u`, must be a value less than or equal to `1.0`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                u is not None and u < -1.0):  # noqa: E501
            raise ValueError("Invalid value for `u`, must be a value greater than or equal to `-1.0`")  # noqa: E501

        self._u = u

    @property
    def user_elemental_id(self):
        """
        Unique ID of the original user who created this. If permissions allow, will change the creating user to the one referenced by this elemental_id

        :return: The user_elemental_id of this LocalizationSpec. 
        :rtype: str
        """
        return self._user_elemental_id

    @user_elemental_id.setter
    def user_elemental_id(self, user_elemental_id):
        """
        Unique ID of the original user who created this. If permissions allow, will change the creating user to the one referenced by this elemental_id

        :param user_elemental_id: The user_elemental_id of this LocalizationSpec.
        :type: str
        """

        self._user_elemental_id = user_elemental_id

    @property
    def v(self):
        """
        Vertical vector component for `line` localization types.

        :return: The v of this LocalizationSpec. 
        :rtype: float
        """
        return self._v

    @v.setter
    def v(self, v):
        """
        Vertical vector component for `line` localization types.

        :param v: The v of this LocalizationSpec.
        :type: float
        """
        if (self.local_vars_configuration.client_side_validation and
                v is not None and v > 1.0):  # noqa: E501
            raise ValueError("Invalid value for `v`, must be a value less than or equal to `1.0`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                v is not None and v < -1.0):  # noqa: E501
            raise ValueError("Invalid value for `v`, must be a value greater than or equal to `-1.0`")  # noqa: E501

        self._v = v

    @property
    def version(self):
        """
        Unique integer identifying the version.

        :return: The version of this LocalizationSpec. 
        :rtype: int
        """
        return self._version

    @version.setter
    def version(self, version):
        """
        Unique integer identifying the version.

        :param version: The version of this LocalizationSpec.
        :type: int
        """

        self._version = version

    @property
    def width(self):
        """
        Normalized width of bounding box for `box` localization types.

        :return: The width of this LocalizationSpec. 
        :rtype: float
        """
        return self._width

    @width.setter
    def width(self, width):
        """
        Normalized width of bounding box for `box` localization types.

        :param width: The width of this LocalizationSpec.
        :type: float
        """
        if (self.local_vars_configuration.client_side_validation and
                width is not None and width > 1.0):  # noqa: E501
            raise ValueError("Invalid value for `width`, must be a value less than or equal to `1.0`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                width is not None and width < 0.0):  # noqa: E501
            raise ValueError("Invalid value for `width`, must be a value greater than or equal to `0.0`")  # noqa: E501

        self._width = width

    @property
    def x(self):
        """
        Normalized horizontal position of left edge of bounding box for `box` localization types, start of line for `line` localization types, or position of dot for `dot` localization types.

        :return: The x of this LocalizationSpec. 
        :rtype: float
        """
        return self._x

    @x.setter
    def x(self, x):
        """
        Normalized horizontal position of left edge of bounding box for `box` localization types, start of line for `line` localization types, or position of dot for `dot` localization types.

        :param x: The x of this LocalizationSpec.
        :type: float
        """
        if (self.local_vars_configuration.client_side_validation and
                x is not None and x > 1.0):  # noqa: E501
            raise ValueError("Invalid value for `x`, must be a value less than or equal to `1.0`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                x is not None and x < 0.0):  # noqa: E501
            raise ValueError("Invalid value for `x`, must be a value greater than or equal to `0.0`")  # noqa: E501

        self._x = x

    @property
    def y(self):
        """
        Normalized vertical position of top edge of bounding box for `box` localization types, start of line for `line` localization types, or position of dot for `dot` localization types.

        :return: The y of this LocalizationSpec. 
        :rtype: float
        """
        return self._y

    @y.setter
    def y(self, y):
        """
        Normalized vertical position of top edge of bounding box for `box` localization types, start of line for `line` localization types, or position of dot for `dot` localization types.

        :param y: The y of this LocalizationSpec.
        :type: float
        """
        if (self.local_vars_configuration.client_side_validation and
                y is not None and y > 1.0):  # noqa: E501
            raise ValueError("Invalid value for `y`, must be a value less than or equal to `1.0`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                y is not None and y < 0.0):  # noqa: E501
            raise ValueError("Invalid value for `y`, must be a value greater than or equal to `0.0`")  # noqa: E501

        self._y = y

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

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