# coding: utf-8

"""
    Modern Logic Api

    Manage and version your customer decision logic outside of your codebase  # noqa: E501

    OpenAPI spec version: 1.0.0
    Contact: info@usemodernlogic.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six

class Execution(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': 'int',
        'alert_id': 'int',
        'runtime': 'int',
        'date_time_executed': 'datetime',
        'workflow_id': 'int',
        'request': 'ExecutionInput',
        'response': 'WorkflowExecutionResult'
    }

    attribute_map = {
        'id': 'id',
        'alert_id': 'alertId',
        'runtime': 'runtime',
        'date_time_executed': 'dateTimeExecuted',
        'workflow_id': 'workflowId',
        'request': 'request',
        'response': 'response'
    }

    def __init__(self, id=None, alert_id=None, runtime=None, date_time_executed=None, workflow_id=None, request=None, response=None):  # noqa: E501
        """Execution - a model defined in Swagger"""  # noqa: E501
        self._id = None
        self._alert_id = None
        self._runtime = None
        self._date_time_executed = None
        self._workflow_id = None
        self._request = None
        self._response = None
        self.discriminator = None
        if id is not None:
            self.id = id
        if alert_id is not None:
            self.alert_id = alert_id
        if runtime is not None:
            self.runtime = runtime
        if date_time_executed is not None:
            self.date_time_executed = date_time_executed
        if workflow_id is not None:
            self.workflow_id = workflow_id
        if request is not None:
            self.request = request
        if response is not None:
            self.response = response

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


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

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


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

        self._id = id

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


        :return: The alert_id of this Execution.  # noqa: E501
        :rtype: int
        """
        return self._alert_id

    @alert_id.setter
    def alert_id(self, alert_id):
        """Sets the alert_id of this Execution.


        :param alert_id: The alert_id of this Execution.  # noqa: E501
        :type: int
        """

        self._alert_id = alert_id

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

        Time it took to execute the workflow in milliseconds  # noqa: E501

        :return: The runtime of this Execution.  # noqa: E501
        :rtype: int
        """
        return self._runtime

    @runtime.setter
    def runtime(self, runtime):
        """Sets the runtime of this Execution.

        Time it took to execute the workflow in milliseconds  # noqa: E501

        :param runtime: The runtime of this Execution.  # noqa: E501
        :type: int
        """

        self._runtime = runtime

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

        When the execution happened  # noqa: E501

        :return: The date_time_executed of this Execution.  # noqa: E501
        :rtype: datetime
        """
        return self._date_time_executed

    @date_time_executed.setter
    def date_time_executed(self, date_time_executed):
        """Sets the date_time_executed of this Execution.

        When the execution happened  # noqa: E501

        :param date_time_executed: The date_time_executed of this Execution.  # noqa: E501
        :type: datetime
        """

        self._date_time_executed = date_time_executed

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


        :return: The workflow_id of this Execution.  # noqa: E501
        :rtype: int
        """
        return self._workflow_id

    @workflow_id.setter
    def workflow_id(self, workflow_id):
        """Sets the workflow_id of this Execution.


        :param workflow_id: The workflow_id of this Execution.  # noqa: E501
        :type: int
        """

        self._workflow_id = workflow_id

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


        :return: The request of this Execution.  # noqa: E501
        :rtype: ExecutionInput
        """
        return self._request

    @request.setter
    def request(self, request):
        """Sets the request of this Execution.


        :param request: The request of this Execution.  # noqa: E501
        :type: ExecutionInput
        """

        self._request = request

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


        :return: The response of this Execution.  # noqa: E501
        :rtype: WorkflowExecutionResult
        """
        return self._response

    @response.setter
    def response(self, response):
        """Sets the response of this Execution.


        :param response: The response of this Execution.  # noqa: E501
        :type: WorkflowExecutionResult
        """

        self._response = response

    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(Execution, 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, Execution):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        return not self == other
