# coding: utf-8

"""
    Quant Trading Network API

    This API will use JSON.         JSON looks like this:                {         \"key\": \"value\",         \"anotherKey\": \"anotherValue\"       }  # noqa: E501

    OpenAPI spec version: 1.0.0
    Contact: support@quant-trading.network
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six


class ExecAlgoResponse(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 = {
        'decision': 'str',
        'decision_timestamp': 'datetime',
        'next_decision_timestamp': 'datetime',
        'milliseconds_to_next_decision': 'int'
    }

    attribute_map = {
        'decision': 'decision',
        'decision_timestamp': 'decisionTimestamp',
        'next_decision_timestamp': 'nextDecisionTimestamp',
        'milliseconds_to_next_decision': 'millisecondsToNextDecision'
    }

    def __init__(self, decision=None, decision_timestamp=None, next_decision_timestamp=None, milliseconds_to_next_decision=None):  # noqa: E501
        """ExecAlgoResponse - a model defined in Swagger"""  # noqa: E501
        self._decision = None
        self._decision_timestamp = None
        self._next_decision_timestamp = None
        self._milliseconds_to_next_decision = None
        self.discriminator = None
        if decision is not None:
            self.decision = decision
        if decision_timestamp is not None:
            self.decision_timestamp = decision_timestamp
        if next_decision_timestamp is not None:
            self.next_decision_timestamp = next_decision_timestamp
        if milliseconds_to_next_decision is not None:
            self.milliseconds_to_next_decision = milliseconds_to_next_decision

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

        The decision taken by the algorithm. Whether to open a long/short position or to cancel the previous attempt.  # noqa: E501

        :return: The decision of this ExecAlgoResponse.  # noqa: E501
        :rtype: str
        """
        return self._decision

    @decision.setter
    def decision(self, decision):
        """Sets the decision of this ExecAlgoResponse.

        The decision taken by the algorithm. Whether to open a long/short position or to cancel the previous attempt.  # noqa: E501

        :param decision: The decision of this ExecAlgoResponse.  # noqa: E501
        :type: str
        """
        allowed_values = ["NONE", "OPEN_LONG", "OPEN_SHORT", "CANCEL_LONG", "CANCEL_SHORT"]  # noqa: E501
        if decision not in allowed_values:
            raise ValueError(
                "Invalid value for `decision` ({0}), must be one of {1}"  # noqa: E501
                .format(decision, allowed_values)
            )

        self._decision = decision

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

        The timestamp this decision was taken by the algorithm.  # noqa: E501

        :return: The decision_timestamp of this ExecAlgoResponse.  # noqa: E501
        :rtype: datetime
        """
        return self._decision_timestamp

    @decision_timestamp.setter
    def decision_timestamp(self, decision_timestamp):
        """Sets the decision_timestamp of this ExecAlgoResponse.

        The timestamp this decision was taken by the algorithm.  # noqa: E501

        :param decision_timestamp: The decision_timestamp of this ExecAlgoResponse.  # noqa: E501
        :type: datetime
        """

        self._decision_timestamp = decision_timestamp

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

        The timestamp when the user will be able to get a new decision from the algorithm.  # noqa: E501

        :return: The next_decision_timestamp of this ExecAlgoResponse.  # noqa: E501
        :rtype: datetime
        """
        return self._next_decision_timestamp

    @next_decision_timestamp.setter
    def next_decision_timestamp(self, next_decision_timestamp):
        """Sets the next_decision_timestamp of this ExecAlgoResponse.

        The timestamp when the user will be able to get a new decision from the algorithm.  # noqa: E501

        :param next_decision_timestamp: The next_decision_timestamp of this ExecAlgoResponse.  # noqa: E501
        :type: datetime
        """

        self._next_decision_timestamp = next_decision_timestamp

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

        The milliseconds left for the new decision when user will be able to get a new decision from the algorithm.  # noqa: E501

        :return: The milliseconds_to_next_decision of this ExecAlgoResponse.  # noqa: E501
        :rtype: int
        """
        return self._milliseconds_to_next_decision

    @milliseconds_to_next_decision.setter
    def milliseconds_to_next_decision(self, milliseconds_to_next_decision):
        """Sets the milliseconds_to_next_decision of this ExecAlgoResponse.

        The milliseconds left for the new decision when user will be able to get a new decision from the algorithm.  # noqa: E501

        :param milliseconds_to_next_decision: The milliseconds_to_next_decision of this ExecAlgoResponse.  # noqa: E501
        :type: int
        """

        self._milliseconds_to_next_decision = milliseconds_to_next_decision

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

        return self.__dict__ == other.__dict__

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