# coding: utf-8

"""
    Component Database API

    The API that provides access to Component Database data.  # noqa: E501

    The version of the OpenAPI document: 3.15.4
    Contact: djarosz@anl.gov
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from cdbApi.configuration import Configuration


class ItemElementHistory(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    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 = {
        'id': 'int',
        'item_element': 'ItemElement',
        'snapshot_element_name': 'str',
        'is_required': 'bool',
        'is_housed': 'bool',
        'description': 'str',
        'sort_order': 'float',
        'derived_from_item_element': 'ItemElement',
        'represents_item_element': 'ItemElement',
        'parent_item': 'Item',
        'snapshot_parent_name': 'str',
        'contained_item2': 'Item',
        'snapshot_contained_item2_name': 'str',
        'entered_by_user': 'UserInfo',
        'entered_on_date_time': 'datetime',
        'snapshot_contained_item_name': 'str',
        'contained_item': 'Item'
    }

    attribute_map = {
        'id': 'id',
        'item_element': 'itemElement',
        'snapshot_element_name': 'snapshotElementName',
        'is_required': 'isRequired',
        'is_housed': 'isHoused',
        'description': 'description',
        'sort_order': 'sortOrder',
        'derived_from_item_element': 'derivedFromItemElement',
        'represents_item_element': 'representsItemElement',
        'parent_item': 'parentItem',
        'snapshot_parent_name': 'snapshotParentName',
        'contained_item2': 'containedItem2',
        'snapshot_contained_item2_name': 'snapshotContainedItem2Name',
        'entered_by_user': 'enteredByUser',
        'entered_on_date_time': 'enteredOnDateTime',
        'snapshot_contained_item_name': 'snapshotContainedItemName',
        'contained_item': 'containedItem'
    }

    def __init__(self, id=None, item_element=None, snapshot_element_name=None, is_required=None, is_housed=None, description=None, sort_order=None, derived_from_item_element=None, represents_item_element=None, parent_item=None, snapshot_parent_name=None, contained_item2=None, snapshot_contained_item2_name=None, entered_by_user=None, entered_on_date_time=None, snapshot_contained_item_name=None, contained_item=None, local_vars_configuration=None):  # noqa: E501
        """ItemElementHistory - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._id = None
        self._item_element = None
        self._snapshot_element_name = None
        self._is_required = None
        self._is_housed = None
        self._description = None
        self._sort_order = None
        self._derived_from_item_element = None
        self._represents_item_element = None
        self._parent_item = None
        self._snapshot_parent_name = None
        self._contained_item2 = None
        self._snapshot_contained_item2_name = None
        self._entered_by_user = None
        self._entered_on_date_time = None
        self._snapshot_contained_item_name = None
        self._contained_item = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if item_element is not None:
            self.item_element = item_element
        if snapshot_element_name is not None:
            self.snapshot_element_name = snapshot_element_name
        if is_required is not None:
            self.is_required = is_required
        if is_housed is not None:
            self.is_housed = is_housed
        if description is not None:
            self.description = description
        if sort_order is not None:
            self.sort_order = sort_order
        if derived_from_item_element is not None:
            self.derived_from_item_element = derived_from_item_element
        if represents_item_element is not None:
            self.represents_item_element = represents_item_element
        if parent_item is not None:
            self.parent_item = parent_item
        if snapshot_parent_name is not None:
            self.snapshot_parent_name = snapshot_parent_name
        if contained_item2 is not None:
            self.contained_item2 = contained_item2
        if snapshot_contained_item2_name is not None:
            self.snapshot_contained_item2_name = snapshot_contained_item2_name
        if entered_by_user is not None:
            self.entered_by_user = entered_by_user
        if entered_on_date_time is not None:
            self.entered_on_date_time = entered_on_date_time
        if snapshot_contained_item_name is not None:
            self.snapshot_contained_item_name = snapshot_contained_item_name
        if contained_item is not None:
            self.contained_item = contained_item

    @property
    def id(self):
        """Gets the id of this ItemElementHistory.  # noqa: E501


        :return: The id of this ItemElementHistory.  # noqa: E501
        :rtype: int
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this ItemElementHistory.


        :param id: The id of this ItemElementHistory.  # noqa: E501
        :type: int
        """

        self._id = id

    @property
    def item_element(self):
        """Gets the item_element of this ItemElementHistory.  # noqa: E501


        :return: The item_element of this ItemElementHistory.  # noqa: E501
        :rtype: ItemElement
        """
        return self._item_element

    @item_element.setter
    def item_element(self, item_element):
        """Sets the item_element of this ItemElementHistory.


        :param item_element: The item_element of this ItemElementHistory.  # noqa: E501
        :type: ItemElement
        """

        self._item_element = item_element

    @property
    def snapshot_element_name(self):
        """Gets the snapshot_element_name of this ItemElementHistory.  # noqa: E501


        :return: The snapshot_element_name of this ItemElementHistory.  # noqa: E501
        :rtype: str
        """
        return self._snapshot_element_name

    @snapshot_element_name.setter
    def snapshot_element_name(self, snapshot_element_name):
        """Sets the snapshot_element_name of this ItemElementHistory.


        :param snapshot_element_name: The snapshot_element_name of this ItemElementHistory.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                snapshot_element_name is not None and len(snapshot_element_name) > 64):
            raise ValueError("Invalid value for `snapshot_element_name`, length must be less than or equal to `64`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                snapshot_element_name is not None and len(snapshot_element_name) < 0):
            raise ValueError("Invalid value for `snapshot_element_name`, length must be greater than or equal to `0`")  # noqa: E501

        self._snapshot_element_name = snapshot_element_name

    @property
    def is_required(self):
        """Gets the is_required of this ItemElementHistory.  # noqa: E501


        :return: The is_required of this ItemElementHistory.  # noqa: E501
        :rtype: bool
        """
        return self._is_required

    @is_required.setter
    def is_required(self, is_required):
        """Sets the is_required of this ItemElementHistory.


        :param is_required: The is_required of this ItemElementHistory.  # noqa: E501
        :type: bool
        """

        self._is_required = is_required

    @property
    def is_housed(self):
        """Gets the is_housed of this ItemElementHistory.  # noqa: E501


        :return: The is_housed of this ItemElementHistory.  # noqa: E501
        :rtype: bool
        """
        return self._is_housed

    @is_housed.setter
    def is_housed(self, is_housed):
        """Sets the is_housed of this ItemElementHistory.


        :param is_housed: The is_housed of this ItemElementHistory.  # noqa: E501
        :type: bool
        """

        self._is_housed = is_housed

    @property
    def description(self):
        """Gets the description of this ItemElementHistory.  # noqa: E501


        :return: The description of this ItemElementHistory.  # noqa: E501
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this ItemElementHistory.


        :param description: The description of this ItemElementHistory.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                description is not None and len(description) > 256):
            raise ValueError("Invalid value for `description`, length must be less than or equal to `256`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                description is not None and len(description) < 0):
            raise ValueError("Invalid value for `description`, length must be greater than or equal to `0`")  # noqa: E501

        self._description = description

    @property
    def sort_order(self):
        """Gets the sort_order of this ItemElementHistory.  # noqa: E501


        :return: The sort_order of this ItemElementHistory.  # noqa: E501
        :rtype: float
        """
        return self._sort_order

    @sort_order.setter
    def sort_order(self, sort_order):
        """Sets the sort_order of this ItemElementHistory.


        :param sort_order: The sort_order of this ItemElementHistory.  # noqa: E501
        :type: float
        """

        self._sort_order = sort_order

    @property
    def derived_from_item_element(self):
        """Gets the derived_from_item_element of this ItemElementHistory.  # noqa: E501


        :return: The derived_from_item_element of this ItemElementHistory.  # noqa: E501
        :rtype: ItemElement
        """
        return self._derived_from_item_element

    @derived_from_item_element.setter
    def derived_from_item_element(self, derived_from_item_element):
        """Sets the derived_from_item_element of this ItemElementHistory.


        :param derived_from_item_element: The derived_from_item_element of this ItemElementHistory.  # noqa: E501
        :type: ItemElement
        """

        self._derived_from_item_element = derived_from_item_element

    @property
    def represents_item_element(self):
        """Gets the represents_item_element of this ItemElementHistory.  # noqa: E501


        :return: The represents_item_element of this ItemElementHistory.  # noqa: E501
        :rtype: ItemElement
        """
        return self._represents_item_element

    @represents_item_element.setter
    def represents_item_element(self, represents_item_element):
        """Sets the represents_item_element of this ItemElementHistory.


        :param represents_item_element: The represents_item_element of this ItemElementHistory.  # noqa: E501
        :type: ItemElement
        """

        self._represents_item_element = represents_item_element

    @property
    def parent_item(self):
        """Gets the parent_item of this ItemElementHistory.  # noqa: E501


        :return: The parent_item of this ItemElementHistory.  # noqa: E501
        :rtype: Item
        """
        return self._parent_item

    @parent_item.setter
    def parent_item(self, parent_item):
        """Sets the parent_item of this ItemElementHistory.


        :param parent_item: The parent_item of this ItemElementHistory.  # noqa: E501
        :type: Item
        """

        self._parent_item = parent_item

    @property
    def snapshot_parent_name(self):
        """Gets the snapshot_parent_name of this ItemElementHistory.  # noqa: E501


        :return: The snapshot_parent_name of this ItemElementHistory.  # noqa: E501
        :rtype: str
        """
        return self._snapshot_parent_name

    @snapshot_parent_name.setter
    def snapshot_parent_name(self, snapshot_parent_name):
        """Sets the snapshot_parent_name of this ItemElementHistory.


        :param snapshot_parent_name: The snapshot_parent_name of this ItemElementHistory.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                snapshot_parent_name is not None and len(snapshot_parent_name) > 256):
            raise ValueError("Invalid value for `snapshot_parent_name`, length must be less than or equal to `256`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                snapshot_parent_name is not None and len(snapshot_parent_name) < 0):
            raise ValueError("Invalid value for `snapshot_parent_name`, length must be greater than or equal to `0`")  # noqa: E501

        self._snapshot_parent_name = snapshot_parent_name

    @property
    def contained_item2(self):
        """Gets the contained_item2 of this ItemElementHistory.  # noqa: E501


        :return: The contained_item2 of this ItemElementHistory.  # noqa: E501
        :rtype: Item
        """
        return self._contained_item2

    @contained_item2.setter
    def contained_item2(self, contained_item2):
        """Sets the contained_item2 of this ItemElementHistory.


        :param contained_item2: The contained_item2 of this ItemElementHistory.  # noqa: E501
        :type: Item
        """

        self._contained_item2 = contained_item2

    @property
    def snapshot_contained_item2_name(self):
        """Gets the snapshot_contained_item2_name of this ItemElementHistory.  # noqa: E501


        :return: The snapshot_contained_item2_name of this ItemElementHistory.  # noqa: E501
        :rtype: str
        """
        return self._snapshot_contained_item2_name

    @snapshot_contained_item2_name.setter
    def snapshot_contained_item2_name(self, snapshot_contained_item2_name):
        """Sets the snapshot_contained_item2_name of this ItemElementHistory.


        :param snapshot_contained_item2_name: The snapshot_contained_item2_name of this ItemElementHistory.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                snapshot_contained_item2_name is not None and len(snapshot_contained_item2_name) > 256):
            raise ValueError("Invalid value for `snapshot_contained_item2_name`, length must be less than or equal to `256`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                snapshot_contained_item2_name is not None and len(snapshot_contained_item2_name) < 0):
            raise ValueError("Invalid value for `snapshot_contained_item2_name`, length must be greater than or equal to `0`")  # noqa: E501

        self._snapshot_contained_item2_name = snapshot_contained_item2_name

    @property
    def entered_by_user(self):
        """Gets the entered_by_user of this ItemElementHistory.  # noqa: E501


        :return: The entered_by_user of this ItemElementHistory.  # noqa: E501
        :rtype: UserInfo
        """
        return self._entered_by_user

    @entered_by_user.setter
    def entered_by_user(self, entered_by_user):
        """Sets the entered_by_user of this ItemElementHistory.


        :param entered_by_user: The entered_by_user of this ItemElementHistory.  # noqa: E501
        :type: UserInfo
        """

        self._entered_by_user = entered_by_user

    @property
    def entered_on_date_time(self):
        """Gets the entered_on_date_time of this ItemElementHistory.  # noqa: E501


        :return: The entered_on_date_time of this ItemElementHistory.  # noqa: E501
        :rtype: datetime
        """
        return self._entered_on_date_time

    @entered_on_date_time.setter
    def entered_on_date_time(self, entered_on_date_time):
        """Sets the entered_on_date_time of this ItemElementHistory.


        :param entered_on_date_time: The entered_on_date_time of this ItemElementHistory.  # noqa: E501
        :type: datetime
        """

        self._entered_on_date_time = entered_on_date_time

    @property
    def snapshot_contained_item_name(self):
        """Gets the snapshot_contained_item_name of this ItemElementHistory.  # noqa: E501


        :return: The snapshot_contained_item_name of this ItemElementHistory.  # noqa: E501
        :rtype: str
        """
        return self._snapshot_contained_item_name

    @snapshot_contained_item_name.setter
    def snapshot_contained_item_name(self, snapshot_contained_item_name):
        """Sets the snapshot_contained_item_name of this ItemElementHistory.


        :param snapshot_contained_item_name: The snapshot_contained_item_name of this ItemElementHistory.  # noqa: E501
        :type: str
        """

        self._snapshot_contained_item_name = snapshot_contained_item_name

    @property
    def contained_item(self):
        """Gets the contained_item of this ItemElementHistory.  # noqa: E501


        :return: The contained_item of this ItemElementHistory.  # noqa: E501
        :rtype: Item
        """
        return self._contained_item

    @contained_item.setter
    def contained_item(self, contained_item):
        """Sets the contained_item of this ItemElementHistory.


        :param contained_item: The contained_item of this ItemElementHistory.  # noqa: E501
        :type: Item
        """

        self._contained_item = contained_item

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

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