# 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 PropertyValueHistory(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',
        'tag': 'str',
        'value': 'str',
        'units': 'str',
        'description': 'str',
        'entered_on_date_time': 'datetime',
        'effective_from_date_time': 'datetime',
        'effective_to_date_time': 'datetime',
        'display_value': 'str',
        'target_value': 'str',
        'entered_by_user': 'UserInfo'
    }

    attribute_map = {
        'id': 'id',
        'tag': 'tag',
        'value': 'value',
        'units': 'units',
        'description': 'description',
        'entered_on_date_time': 'enteredOnDateTime',
        'effective_from_date_time': 'effectiveFromDateTime',
        'effective_to_date_time': 'effectiveToDateTime',
        'display_value': 'displayValue',
        'target_value': 'targetValue',
        'entered_by_user': 'enteredByUser'
    }

    def __init__(self, id=None, tag=None, value=None, units=None, description=None, entered_on_date_time=None, effective_from_date_time=None, effective_to_date_time=None, display_value=None, target_value=None, entered_by_user=None, local_vars_configuration=None):  # noqa: E501
        """PropertyValueHistory - 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._tag = None
        self._value = None
        self._units = None
        self._description = None
        self._entered_on_date_time = None
        self._effective_from_date_time = None
        self._effective_to_date_time = None
        self._display_value = None
        self._target_value = None
        self._entered_by_user = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if tag is not None:
            self.tag = tag
        if value is not None:
            self.value = value
        if units is not None:
            self.units = units
        if description is not None:
            self.description = description
        self.entered_on_date_time = entered_on_date_time
        if effective_from_date_time is not None:
            self.effective_from_date_time = effective_from_date_time
        if effective_to_date_time is not None:
            self.effective_to_date_time = effective_to_date_time
        if display_value is not None:
            self.display_value = display_value
        if target_value is not None:
            self.target_value = target_value
        if entered_by_user is not None:
            self.entered_by_user = entered_by_user

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


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

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


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

        self._id = id

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


        :return: The tag of this PropertyValueHistory.  # noqa: E501
        :rtype: str
        """
        return self._tag

    @tag.setter
    def tag(self, tag):
        """Sets the tag of this PropertyValueHistory.


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

        self._tag = tag

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


        :return: The value of this PropertyValueHistory.  # noqa: E501
        :rtype: str
        """
        return self._value

    @value.setter
    def value(self, value):
        """Sets the value of this PropertyValueHistory.


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

        self._value = value

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


        :return: The units of this PropertyValueHistory.  # noqa: E501
        :rtype: str
        """
        return self._units

    @units.setter
    def units(self, units):
        """Sets the units of this PropertyValueHistory.


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

        self._units = units

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


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

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


        :param description: The description of this PropertyValueHistory.  # 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 entered_on_date_time(self):
        """Gets the entered_on_date_time of this PropertyValueHistory.  # noqa: E501


        :return: The entered_on_date_time of this PropertyValueHistory.  # 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 PropertyValueHistory.


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

        self._entered_on_date_time = entered_on_date_time

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


        :return: The effective_from_date_time of this PropertyValueHistory.  # noqa: E501
        :rtype: datetime
        """
        return self._effective_from_date_time

    @effective_from_date_time.setter
    def effective_from_date_time(self, effective_from_date_time):
        """Sets the effective_from_date_time of this PropertyValueHistory.


        :param effective_from_date_time: The effective_from_date_time of this PropertyValueHistory.  # noqa: E501
        :type: datetime
        """

        self._effective_from_date_time = effective_from_date_time

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


        :return: The effective_to_date_time of this PropertyValueHistory.  # noqa: E501
        :rtype: datetime
        """
        return self._effective_to_date_time

    @effective_to_date_time.setter
    def effective_to_date_time(self, effective_to_date_time):
        """Sets the effective_to_date_time of this PropertyValueHistory.


        :param effective_to_date_time: The effective_to_date_time of this PropertyValueHistory.  # noqa: E501
        :type: datetime
        """

        self._effective_to_date_time = effective_to_date_time

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


        :return: The display_value of this PropertyValueHistory.  # noqa: E501
        :rtype: str
        """
        return self._display_value

    @display_value.setter
    def display_value(self, display_value):
        """Sets the display_value of this PropertyValueHistory.


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

        self._display_value = display_value

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


        :return: The target_value of this PropertyValueHistory.  # noqa: E501
        :rtype: str
        """
        return self._target_value

    @target_value.setter
    def target_value(self, target_value):
        """Sets the target_value of this PropertyValueHistory.


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

        self._target_value = target_value

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


        :return: The entered_by_user of this PropertyValueHistory.  # 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 PropertyValueHistory.


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

        self._entered_by_user = entered_by_user

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

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