# coding: utf-8

"""
    Sparks OpenAPI

    Generated documentation for the Logicdrop Sparks API and OpenAPI clients.  Logicdrop Sparks lets users build rules, analyze data, and automate documents.  Use it to make decisions faster, generate documents better, and learn from your data.  ### Documentation - [User Documentation](https://docs.logicdrop.com)  ### Modules - [Sparks Compute](https://docs.logicdrop.com/rules/introduction) - [Sparks Decision Tables](https://docs.logicdrop.com/rules/authoring-decision-tables) - [Sparks Documents](https://docs.logicdrop.com/documents/introduction)  ### Clients - [OpenAPI Clients](https://docs.logicdrop.com/development/sample-clients)  ### Security - [Authorizing API Requests](https://docs.logicdrop.com/development/authorization)   # noqa: E501

    The version of the OpenAPI document: v_VERSION_._BUILD_
    Contact: support@logicdrop.com
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from logicdrop.sparks.openapi.configuration import Configuration


class DesignerEvent(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 = {
        'event': 'str',
        'type': 'str',
        'message': 'str',
        'rule': 'str',
        'path': 'str',
        'name': 'str',
        'source': 'str',
        'row': 'int',
        'id': 'str',
        'timestamp': 'int',
        'triggers': 'list[object]',
        'current': 'RuleEventData',
        'previous': 'RuleEventData'
    }

    attribute_map = {
        'event': 'event',
        'type': 'type',
        'message': 'message',
        'rule': 'rule',
        'path': 'path',
        'name': 'name',
        'source': 'source',
        'row': 'row',
        'id': 'id',
        'timestamp': 'timestamp',
        'triggers': 'triggers',
        'current': 'current',
        'previous': 'previous'
    }

    def __init__(self, event=None, type=None, message=None, rule=None, path=None, name=None, source=None, row=None, id=None, timestamp=None, triggers=None, current=None, previous=None, local_vars_configuration=None):  # noqa: E501
        """DesignerEvent - 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._event = None
        self._type = None
        self._message = None
        self._rule = None
        self._path = None
        self._name = None
        self._source = None
        self._row = None
        self._id = None
        self._timestamp = None
        self._triggers = None
        self._current = None
        self._previous = None
        self.discriminator = None

        if event is not None:
            self.event = event
        if type is not None:
            self.type = type
        if message is not None:
            self.message = message
        if rule is not None:
            self.rule = rule
        if path is not None:
            self.path = path
        if name is not None:
            self.name = name
        if source is not None:
            self.source = source
        if row is not None:
            self.row = row
        if id is not None:
            self.id = id
        if timestamp is not None:
            self.timestamp = timestamp
        if triggers is not None:
            self.triggers = triggers
        if current is not None:
            self.current = current
        if previous is not None:
            self.previous = previous

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

        Event type  # noqa: E501

        :return: The event of this DesignerEvent.  # noqa: E501
        :rtype: str
        """
        return self._event

    @event.setter
    def event(self, event):
        """Sets the event of this DesignerEvent.

        Event type  # noqa: E501

        :param event: The event of this DesignerEvent.  # noqa: E501
        :type: str
        """
        allowed_values = ["INSERT", "DELETE", "UPDATE", "BEFORE_MATCH", "AFTER_MATCH", "MATCH_CREATED", "MATCH_CANCELLED"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and event not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `event` ({0}), must be one of {1}"  # noqa: E501
                .format(event, allowed_values)
            )

        self._event = event

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

        Rule type  # noqa: E501

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

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

        Rule type  # noqa: E501

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

        self._type = type

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

        Event message  # noqa: E501

        :return: The message of this DesignerEvent.  # noqa: E501
        :rtype: str
        """
        return self._message

    @message.setter
    def message(self, message):
        """Sets the message of this DesignerEvent.

        Event message  # noqa: E501

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

        self._message = message

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

        Rule name  # noqa: E501

        :return: The rule of this DesignerEvent.  # noqa: E501
        :rtype: str
        """
        return self._rule

    @rule.setter
    def rule(self, rule):
        """Sets the rule of this DesignerEvent.

        Rule name  # noqa: E501

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

        self._rule = rule

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

        Rule path  # noqa: E501

        :return: The path of this DesignerEvent.  # noqa: E501
        :rtype: str
        """
        return self._path

    @path.setter
    def path(self, path):
        """Sets the path of this DesignerEvent.

        Rule path  # noqa: E501

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

        self._path = path

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

        User rule name  # noqa: E501

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

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

        User rule name  # noqa: E501

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

        self._name = name

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

        User rule source  # noqa: E501

        :return: The source of this DesignerEvent.  # noqa: E501
        :rtype: str
        """
        return self._source

    @source.setter
    def source(self, source):
        """Sets the source of this DesignerEvent.

        User rule source  # noqa: E501

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

        self._source = source

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

        User rule row (if applicable)  # noqa: E501

        :return: The row of this DesignerEvent.  # noqa: E501
        :rtype: int
        """
        return self._row

    @row.setter
    def row(self, row):
        """Sets the row of this DesignerEvent.

        User rule row (if applicable)  # noqa: E501

        :param row: The row of this DesignerEvent.  # noqa: E501
        :type: int
        """

        self._row = row

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

        Rule Id  # noqa: E501

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

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

        Rule Id  # noqa: E501

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

        self._id = id

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

        Timestamp  # noqa: E501

        :return: The timestamp of this DesignerEvent.  # noqa: E501
        :rtype: int
        """
        return self._timestamp

    @timestamp.setter
    def timestamp(self, timestamp):
        """Sets the timestamp of this DesignerEvent.

        Timestamp  # noqa: E501

        :param timestamp: The timestamp of this DesignerEvent.  # noqa: E501
        :type: int
        """

        self._timestamp = timestamp

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

        Match triggers  # noqa: E501

        :return: The triggers of this DesignerEvent.  # noqa: E501
        :rtype: list[object]
        """
        return self._triggers

    @triggers.setter
    def triggers(self, triggers):
        """Sets the triggers of this DesignerEvent.

        Match triggers  # noqa: E501

        :param triggers: The triggers of this DesignerEvent.  # noqa: E501
        :type: list[object]
        """

        self._triggers = triggers

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


        :return: The current of this DesignerEvent.  # noqa: E501
        :rtype: RuleEventData
        """
        return self._current

    @current.setter
    def current(self, current):
        """Sets the current of this DesignerEvent.


        :param current: The current of this DesignerEvent.  # noqa: E501
        :type: RuleEventData
        """

        self._current = current

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


        :return: The previous of this DesignerEvent.  # noqa: E501
        :rtype: RuleEventData
        """
        return self._previous

    @previous.setter
    def previous(self, previous):
        """Sets the previous of this DesignerEvent.


        :param previous: The previous of this DesignerEvent.  # noqa: E501
        :type: RuleEventData
        """

        self._previous = previous

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

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