# 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 State(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)',
        'created_by': 'int',
        'created_datetime': 'datetime',
        'elemental_id': 'str',
        'frame': 'int',
        'id': 'int',
        'localizations': 'list[int]',
        'mark': 'int',
        'media': 'list[int]',
        'modified_by': 'int',
        'modified_datetime': 'datetime',
        'parent': 'float',
        'segments': 'list[list[int]]',
        'type': 'int',
        'variant_deleted': 'bool',
        'version': 'int'
    }

    attribute_map = {
        'attributes': 'attributes',
        'created_by': 'created_by',
        'created_datetime': 'created_datetime',
        'elemental_id': 'elemental_id',
        'frame': 'frame',
        'id': 'id',
        'localizations': 'localizations',
        'mark': 'mark',
        'media': 'media',
        'modified_by': 'modified_by',
        'modified_datetime': 'modified_datetime',
        'parent': 'parent',
        'segments': 'segments',
        'type': 'type',
        'variant_deleted': 'variant_deleted',
        'version': 'version'
    }

    def __init__(self, attributes=None, created_by=None, created_datetime=None, elemental_id=None, frame=None, id=None, localizations=None, mark=None, media=None, modified_by=None, modified_datetime=None, parent=None, segments=None, type=None, variant_deleted=None, version=None, local_vars_configuration=None):  # noqa: E501
        """State - 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._created_by = None
        self._created_datetime = None
        self._elemental_id = None
        self._frame = None
        self._id = None
        self._localizations = None
        self._mark = None
        self._media = None
        self._modified_by = None
        self._modified_datetime = None
        self._parent = None
        self._segments = None
        self._type = None
        self._variant_deleted = None
        self._version = None
        self.discriminator = None

        if attributes is not None:
            self.attributes = attributes
        if created_by is not None:
            self.created_by = created_by
        if created_datetime is not None:
            self.created_datetime = created_datetime
        self.elemental_id = elemental_id
        if frame is not None:
            self.frame = frame
        if id is not None:
            self.id = id
        if localizations is not None:
            self.localizations = localizations
        if mark is not None:
            self.mark = mark
        if media is not None:
            self.media = media
        if modified_by is not None:
            self.modified_by = modified_by
        if modified_datetime is not None:
            self.modified_datetime = modified_datetime
        self.parent = parent
        if segments is not None:
            self.segments = segments
        if type is not None:
            self.type = type
        if variant_deleted is not None:
            self.variant_deleted = variant_deleted
        if version is not None:
            self.version = version

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

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

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

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

        self._attributes = attributes

    @property
    def created_by(self):
        """
        Unique integer identifying the user who created this state.

        :return: The created_by of this State. 
        :rtype: int
        """
        return self._created_by

    @created_by.setter
    def created_by(self, created_by):
        """
        Unique integer identifying the user who created this state.

        :param created_by: The created_by of this State.
        :type: int
        """

        self._created_by = created_by

    @property
    def created_datetime(self):
        """
        Datetime this state was created.

        :return: The created_datetime of this State. 
        :rtype: datetime
        """
        return self._created_datetime

    @created_datetime.setter
    def created_datetime(self, created_datetime):
        """
        Datetime this state was created.

        :param created_datetime: The created_datetime of this State.
        :type: datetime
        """

        self._created_datetime = created_datetime

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

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

        self._elemental_id = elemental_id

    @property
    def frame(self):
        """
        Frame number this state applies to.

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

    @frame.setter
    def frame(self, frame):
        """
        Frame number this state applies to.

        :param frame: The frame of this State.
        :type: int
        """

        self._frame = frame

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

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

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

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

        self._id = id

    @property
    def localizations(self):
        """
        List of localization IDs that this state applies to.

        :return: The localizations of this State. 
        :rtype: list[int]
        """
        return self._localizations

    @localizations.setter
    def localizations(self, localizations):
        """
        List of localization IDs that this state applies to.

        :param localizations: The localizations of this State.
        :type: list[int]
        """

        self._localizations = localizations

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

        :return: The mark of this State. 
        :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 State.
        :type: int
        """

        self._mark = mark

    @property
    def media(self):
        """
        List of media IDs that this state applies to.

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

    @media.setter
    def media(self, media):
        """
        List of media IDs that this state applies to.

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

        self._media = media

    @property
    def modified_by(self):
        """
        Unique integer identifying the user who last modified this state.

        :return: The modified_by of this State. 
        :rtype: int
        """
        return self._modified_by

    @modified_by.setter
    def modified_by(self, modified_by):
        """
        Unique integer identifying the user who last modified this state.

        :param modified_by: The modified_by of this State.
        :type: int
        """

        self._modified_by = modified_by

    @property
    def modified_datetime(self):
        """
        Datetime this state was last modified.

        :return: The modified_datetime of this State. 
        :rtype: datetime
        """
        return self._modified_datetime

    @modified_datetime.setter
    def modified_datetime(self, modified_datetime):
        """
        Datetime this state was last modified.

        :param modified_datetime: The modified_datetime of this State.
        :type: datetime
        """

        self._modified_datetime = modified_datetime

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

        :return: The parent of this State. 
        :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 State.
        :type: float
        """

        self._parent = parent

    @property
    def segments(self):
        """
        List of contiguous frame ranges where a localization associated state has localization data.

        :return: The segments of this State. 
        :rtype: list[list[int]]
        """
        return self._segments

    @segments.setter
    def segments(self, segments):
        """
        List of contiguous frame ranges where a localization associated state has localization data.

        :param segments: The segments of this State.
        :type: list[list[int]]
        """

        self._segments = segments

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

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

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

        :param type: The type of this State.
        :type: int
        """

        self._type = type

    @property
    def variant_deleted(self):
        """
        Unique integer identifying the user who created this localization.

        :return: The variant_deleted of this State. 
        :rtype: bool
        """
        return self._variant_deleted

    @variant_deleted.setter
    def variant_deleted(self, variant_deleted):
        """
        Unique integer identifying the user who created this localization.

        :param variant_deleted: The variant_deleted of this State.
        :type: bool
        """

        self._variant_deleted = variant_deleted

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

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

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

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

        self._version = version

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

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