# 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 StateUpdate(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',
        'in_place': 'int',
        'localization_ids_add': 'list[int]',
        'localization_ids_remove': 'list[int]',
        'mark': 'int',
        'null_attributes': 'list[str]',
        'parent': 'float',
        'pedantic': 'int',
        'reset_attributes': 'list[str]',
        'user_elemental_id': 'str'
    }

    attribute_map = {
        'attributes': 'attributes',
        'elemental_id': 'elemental_id',
        'frame': 'frame',
        'in_place': 'in_place',
        'localization_ids_add': 'localization_ids_add',
        'localization_ids_remove': 'localization_ids_remove',
        'mark': 'mark',
        'null_attributes': 'null_attributes',
        'parent': 'parent',
        'pedantic': 'pedantic',
        'reset_attributes': 'reset_attributes',
        'user_elemental_id': 'user_elemental_id'
    }

    def __init__(self, attributes=None, elemental_id=None, frame=None, in_place=0, localization_ids_add=None, localization_ids_remove=None, mark=None, null_attributes=None, parent=None, pedantic=0, reset_attributes=None, user_elemental_id=None, local_vars_configuration=None):  # noqa: E501
        """StateUpdate - 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._in_place = None
        self._localization_ids_add = None
        self._localization_ids_remove = None
        self._mark = None
        self._null_attributes = None
        self._parent = None
        self._pedantic = None
        self._reset_attributes = None
        self._user_elemental_id = None
        self.discriminator = None

        if attributes is not None:
            self.attributes = attributes
        self.elemental_id = elemental_id
        if frame is not None:
            self.frame = frame
        if in_place is not None:
            self.in_place = in_place
        if localization_ids_add is not None:
            self.localization_ids_add = localization_ids_add
        if localization_ids_remove is not None:
            self.localization_ids_remove = localization_ids_remove
        if mark is not None:
            self.mark = mark
        if null_attributes is not None:
            self.null_attributes = null_attributes
        self.parent = parent
        if pedantic is not None:
            self.pedantic = pedantic
        if reset_attributes is not None:
            self.reset_attributes = reset_attributes
        if user_elemental_id is not None:
            self.user_elemental_id = user_elemental_id

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

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

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

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

        self._attributes = attributes

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

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

        self._elemental_id = elemental_id

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

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

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

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

        self._frame = frame

    @property
    def in_place(self):
        """
        Set to 1 to edit this record in-place, else mark-based versioning rules apply. This changes to 1 for authorship changes automatically.

        :return: The in_place of this StateUpdate. 
        :rtype: int
        """
        return self._in_place

    @in_place.setter
    def in_place(self, in_place):
        """
        Set to 1 to edit this record in-place, else mark-based versioning rules apply. This changes to 1 for authorship changes automatically.

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

        self._in_place = in_place

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

        :return: The localization_ids_add of this StateUpdate. 
        :rtype: list[int]
        """
        return self._localization_ids_add

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

        :param localization_ids_add: The localization_ids_add of this StateUpdate.
        :type: list[int]
        """

        self._localization_ids_add = localization_ids_add

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

        :return: The localization_ids_remove of this StateUpdate. 
        :rtype: list[int]
        """
        return self._localization_ids_remove

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

        :param localization_ids_remove: The localization_ids_remove of this StateUpdate.
        :type: list[int]
        """

        self._localization_ids_remove = localization_ids_remove

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

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

        self._mark = mark

    @property
    def null_attributes(self):
        """
        Null a value in the attributes body

        :return: The null_attributes of this StateUpdate. 
        :rtype: list[str]
        """
        return self._null_attributes

    @null_attributes.setter
    def null_attributes(self, null_attributes):
        """
        Null a value in the attributes body

        :param null_attributes: The null_attributes of this StateUpdate.
        :type: list[str]
        """

        self._null_attributes = null_attributes

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

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

        self._parent = parent

    @property
    def pedantic(self):
        """
        Set to 1 to enforce that this is the latest mark; else push edits to end of branch.

        :return: The pedantic of this StateUpdate. 
        :rtype: int
        """
        return self._pedantic

    @pedantic.setter
    def pedantic(self, pedantic):
        """
        Set to 1 to enforce that this is the latest mark; else push edits to end of branch.

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

        self._pedantic = pedantic

    @property
    def reset_attributes(self):
        """
        Reset an attribute to the default value specified in the Type object

        :return: The reset_attributes of this StateUpdate. 
        :rtype: list[str]
        """
        return self._reset_attributes

    @reset_attributes.setter
    def reset_attributes(self, reset_attributes):
        """
        Reset an attribute to the default value specified in the Type object

        :param reset_attributes: The reset_attributes of this StateUpdate.
        :type: list[str]
        """

        self._reset_attributes = reset_attributes

    @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 StateUpdate. 
        :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 StateUpdate.
        :type: str
        """

        self._user_elemental_id = user_elemental_id

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

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