# coding: utf-8

"""
    DigitalRebar Provision Server

    # An RestFUL API-driven Provisioner and DHCP server  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from drppy_client.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 = {
        'action': 'str',
        'key': 'str',
        'object': 'object',
        'original': 'object',
        'principal': 'str',
        'time': 'datetime',
        'type': 'str'
    }

    attribute_map = {
        'action': 'Action',
        'key': 'Key',
        'object': 'Object',
        'original': 'Original',
        'principal': 'Principal',
        'time': 'Time',
        'type': 'Type'
    }

    def __init__(self, action=None, key=None, object=None, original=None, principal=None, time=None, type=None, _configuration=None):  # noqa: E501
        """Event - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._action = None
        self._key = None
        self._object = None
        self._original = None
        self._principal = None
        self._time = None
        self._type = None
        self.discriminator = None

        if action is not None:
            self.action = action
        if key is not None:
            self.key = key
        if object is not None:
            self.object = object
        if original is not None:
            self.original = original
        if principal is not None:
            self.principal = principal
        if time is not None:
            self.time = time
        if type is not None:
            self.type = type

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

        Action - what happened  # noqa: E501

        :return: The action of this Event.  # noqa: E501
        :rtype: str
        """
        return self._action

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

        Action - what happened  # noqa: E501

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

        self._action = action

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

        Key - the id of the object  # noqa: E501

        :return: The key of this Event.  # noqa: E501
        :rtype: str
        """
        return self._key

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

        Key - the id of the object  # noqa: E501

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

        self._key = key

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

        Object - the data of the object.  # noqa: E501

        :return: The object of this Event.  # noqa: E501
        :rtype: object
        """
        return self._object

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

        Object - the data of the object.  # noqa: E501

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

        self._object = object

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

        Original - the data of the object before the operation (update and save only)  # noqa: E501

        :return: The original of this Event.  # noqa: E501
        :rtype: object
        """
        return self._original

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

        Original - the data of the object before the operation (update and save only)  # noqa: E501

        :param original: The original of this Event.  # noqa: E501
        :type: object
        """

        self._original = original

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

        Principal - the user or subsystem that caused the event to be emitted  # noqa: E501

        :return: The principal of this Event.  # noqa: E501
        :rtype: str
        """
        return self._principal

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

        Principal - the user or subsystem that caused the event to be emitted  # noqa: E501

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

        self._principal = principal

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

        Time of the event.  # noqa: E501

        :return: The time of this Event.  # noqa: E501
        :rtype: datetime
        """
        return self._time

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

        Time of the event.  # noqa: E501

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

        self._time = time

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

        Type - object type  # noqa: E501

        :return: The type of this Event.  # noqa: E501
        :rtype: str
        """
        return self._type

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

        Type - object type  # noqa: E501

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

        self._type = type

    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()
