# 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 Log(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',
        'text': 'str',
        'entered_on_date_time': 'datetime',
        'effective_from_date_time': 'datetime',
        'effective_to_date_time': 'datetime',
        'entered_by_username': 'str'
    }

    attribute_map = {
        'id': 'id',
        'text': 'text',
        'entered_on_date_time': 'enteredOnDateTime',
        'effective_from_date_time': 'effectiveFromDateTime',
        'effective_to_date_time': 'effectiveToDateTime',
        'entered_by_username': 'enteredByUsername'
    }

    def __init__(self, id=None, text=None, entered_on_date_time=None, effective_from_date_time=None, effective_to_date_time=None, entered_by_username=None, local_vars_configuration=None):  # noqa: E501
        """Log - 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._text = None
        self._entered_on_date_time = None
        self._effective_from_date_time = None
        self._effective_to_date_time = None
        self._entered_by_username = None
        self.discriminator = None

        if id is not None:
            self.id = id
        self.text = text
        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 entered_by_username is not None:
            self.entered_by_username = entered_by_username

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


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

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


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

        self._id = id

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


        :return: The text of this Log.  # noqa: E501
        :rtype: str
        """
        return self._text

    @text.setter
    def text(self, text):
        """Sets the text of this Log.


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

        self._text = text

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


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


        :param entered_on_date_time: The entered_on_date_time of this Log.  # 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 Log.  # noqa: E501


        :return: The effective_from_date_time of this Log.  # 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 Log.


        :param effective_from_date_time: The effective_from_date_time of this Log.  # 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 Log.  # noqa: E501


        :return: The effective_to_date_time of this Log.  # 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 Log.


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

        self._effective_to_date_time = effective_to_date_time

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


        :return: The entered_by_username of this Log.  # noqa: E501
        :rtype: str
        """
        return self._entered_by_username

    @entered_by_username.setter
    def entered_by_username(self, entered_by_username):
        """Sets the entered_by_username of this Log.


        :param entered_by_username: The entered_by_username of this Log.  # noqa: E501
        :type: str
        """

        self._entered_by_username = entered_by_username

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

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