# coding: utf-8

"""
    Trackside Software TeamDB API v2.0

    This API enables you to access TeamDB data  # noqa: E501

    OpenAPI spec version: 2.0
    Contact: support@trackside.fr
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from teamdbapi.configuration import Configuration


class Event(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_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.
    """
    swagger_types = {
        'id': 'str',
        'name': 'str',
        'event_date': 'datetime',
        'track_id': 'str',
        'event_type': 'str',
        'lock_status': 'str',
        'lock_host_name': 'str',
        'last_update_date_utc': 'datetime',
        'last_update_user': 'str',
        'revision': 'int',
        'replication_filter': 'str'
    }

    attribute_map = {
        'id': 'Id',
        'name': 'Name',
        'event_date': 'EventDate',
        'track_id': 'TrackId',
        'event_type': 'EventType',
        'lock_status': 'LockStatus',
        'lock_host_name': 'LockHostName',
        'last_update_date_utc': 'LastUpdateDateUtc',
        'last_update_user': 'LastUpdateUser',
        'revision': 'Revision',
        'replication_filter': 'ReplicationFilter'
    }

    def __init__(self, id=None, name=None, event_date=None, track_id=None, event_type=None, lock_status=None, lock_host_name=None, last_update_date_utc=None, last_update_user=None, revision=None, replication_filter=None, _configuration=None):  # noqa: E501
        """Event - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._id = None
        self._name = None
        self._event_date = None
        self._track_id = None
        self._event_type = None
        self._lock_status = None
        self._lock_host_name = None
        self._last_update_date_utc = None
        self._last_update_user = None
        self._revision = None
        self._replication_filter = None
        self.discriminator = None

        self.id = id
        self.name = name
        self.event_date = event_date
        self.track_id = track_id
        if event_type is not None:
            self.event_type = event_type
        if lock_status is not None:
            self.lock_status = lock_status
        if lock_host_name is not None:
            self.lock_host_name = lock_host_name
        if last_update_date_utc is not None:
            self.last_update_date_utc = last_update_date_utc
        if last_update_user is not None:
            self.last_update_user = last_update_user
        if revision is not None:
            self.revision = revision
        if replication_filter is not None:
            self.replication_filter = replication_filter

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

        The unique event Id.  Set the Id to Guid.Empty (00000000-0000-0000-0000-000000000000) if you want to create a new Event.  # noqa: E501

        :return: The id of this Event.  # noqa: E501
        :rtype: str
        """
        return self._id

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

        The unique event Id.  Set the Id to Guid.Empty (00000000-0000-0000-0000-000000000000) if you want to create a new Event.  # noqa: E501

        :param id: The id of this Event.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and id is None:
            raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501

        self._id = id

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

        The event name  # noqa: E501

        :return: The name of this Event.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this Event.

        The event name  # noqa: E501

        :param name: The name of this Event.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and name is None:
            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                name is not None and len(name) < 1):
            raise ValueError("Invalid value for `name`, length must be greater than or equal to `1`")  # noqa: E501

        self._name = name

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

        The event date.  The date must be an UTC date time. Here is an example : 2018-06-05T12:36:34.168Z  # noqa: E501

        :return: The event_date of this Event.  # noqa: E501
        :rtype: datetime
        """
        return self._event_date

    @event_date.setter
    def event_date(self, event_date):
        """Sets the event_date of this Event.

        The event date.  The date must be an UTC date time. Here is an example : 2018-06-05T12:36:34.168Z  # noqa: E501

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

        self._event_date = event_date

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

        The track unique id where the event takes place.  # noqa: E501

        :return: The track_id of this Event.  # noqa: E501
        :rtype: str
        """
        return self._track_id

    @track_id.setter
    def track_id(self, track_id):
        """Sets the track_id of this Event.

        The track unique id where the event takes place.  # noqa: E501

        :param track_id: The track_id of this Event.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and track_id is None:
            raise ValueError("Invalid value for `track_id`, must not be `None`")  # noqa: E501

        self._track_id = track_id

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

        The type of the event.  # noqa: E501

        :return: The event_type of this Event.  # noqa: E501
        :rtype: str
        """
        return self._event_type

    @event_type.setter
    def event_type(self, event_type):
        """Sets the event_type of this Event.

        The type of the event.  # noqa: E501

        :param event_type: The event_type of this Event.  # noqa: E501
        :type: str
        """

        self._event_type = event_type

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

        The lock status of the event.  # noqa: E501

        :return: The lock_status of this Event.  # noqa: E501
        :rtype: str
        """
        return self._lock_status

    @lock_status.setter
    def lock_status(self, lock_status):
        """Sets the lock_status of this Event.

        The lock status of the event.  # noqa: E501

        :param lock_status: The lock_status of this Event.  # noqa: E501
        :type: str
        """
        allowed_values = ["Free", "LockedByAnotherServer", "LockedByMyServer"]  # noqa: E501
        if (self._configuration.client_side_validation and
                lock_status not in allowed_values):
            raise ValueError(
                "Invalid value for `lock_status` ({0}), must be one of {1}"  # noqa: E501
                .format(lock_status, allowed_values)
            )

        self._lock_status = lock_status

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

        The name of the serveur which has locked the event.  # noqa: E501

        :return: The lock_host_name of this Event.  # noqa: E501
        :rtype: str
        """
        return self._lock_host_name

    @lock_host_name.setter
    def lock_host_name(self, lock_host_name):
        """Sets the lock_host_name of this Event.

        The name of the serveur which has locked the event.  # noqa: E501

        :param lock_host_name: The lock_host_name of this Event.  # noqa: E501
        :type: str
        """

        self._lock_host_name = lock_host_name

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

        The last utc date time when the properties of this object have been updated.  This field will be automatically updated from the server side each time you update the object.  # noqa: E501

        :return: The last_update_date_utc of this Event.  # noqa: E501
        :rtype: datetime
        """
        return self._last_update_date_utc

    @last_update_date_utc.setter
    def last_update_date_utc(self, last_update_date_utc):
        """Sets the last_update_date_utc of this Event.

        The last utc date time when the properties of this object have been updated.  This field will be automatically updated from the server side each time you update the object.  # noqa: E501

        :param last_update_date_utc: The last_update_date_utc of this Event.  # noqa: E501
        :type: datetime
        """

        self._last_update_date_utc = last_update_date_utc

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

        The name of the last user having updated this object.  This field will be automatically updated from the server side each time you update the object.  # noqa: E501

        :return: The last_update_user of this Event.  # noqa: E501
        :rtype: str
        """
        return self._last_update_user

    @last_update_user.setter
    def last_update_user(self, last_update_user):
        """Sets the last_update_user of this Event.

        The name of the last user having updated this object.  This field will be automatically updated from the server side each time you update the object.  # noqa: E501

        :param last_update_user: The last_update_user of this Event.  # noqa: E501
        :type: str
        """

        self._last_update_user = last_update_user

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

        The revision number of the object.  # noqa: E501

        :return: The revision of this Event.  # noqa: E501
        :rtype: int
        """
        return self._revision

    @revision.setter
    def revision(self, revision):
        """Sets the revision of this Event.

        The revision number of the object.  # noqa: E501

        :param revision: The revision of this Event.  # noqa: E501
        :type: int
        """

        self._revision = revision

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

        The level of the filter used for the replication  # noqa: E501

        :return: The replication_filter of this Event.  # noqa: E501
        :rtype: str
        """
        return self._replication_filter

    @replication_filter.setter
    def replication_filter(self, replication_filter):
        """Sets the replication_filter of this Event.

        The level of the filter used for the replication  # noqa: E501

        :param replication_filter: The replication_filter of this Event.  # noqa: E501
        :type: str
        """
        allowed_values = ["NotForReplication", "ForReplication"]  # noqa: E501
        if (self._configuration.client_side_validation and
                replication_filter not in allowed_values):
            raise ValueError(
                "Invalid value for `replication_filter` ({0}), must be one of {1}"  # noqa: E501
                .format(replication_filter, allowed_values)
            )

        self._replication_filter = replication_filter

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.swagger_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
        if issubclass(Event, dict):
            for key, value in self.items():
                result[key] = 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, Event):
            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, Event):
            return True

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