# coding: utf-8

"""
    Gate API v4

    Welcome to Gate.io API  APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.  # noqa: E501

    Contact: support@mail.gate.io
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from gate_api.configuration import Configuration


class SpotPriceTriggeredOrder(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 = {
        'trigger': 'SpotPriceTrigger',
        'put': 'SpotPricePutOrder',
        'id': 'int',
        'user': 'int',
        'market': 'str',
        'ctime': 'int',
        'ftime': 'int',
        'fired_order_id': 'int',
        'status': 'str',
        'reason': 'str',
    }

    attribute_map = {
        'trigger': 'trigger',
        'put': 'put',
        'id': 'id',
        'user': 'user',
        'market': 'market',
        'ctime': 'ctime',
        'ftime': 'ftime',
        'fired_order_id': 'fired_order_id',
        'status': 'status',
        'reason': 'reason',
    }

    def __init__(
        self,
        trigger=None,
        put=None,
        id=None,
        user=None,
        market=None,
        ctime=None,
        ftime=None,
        fired_order_id=None,
        status=None,
        reason=None,
        local_vars_configuration=None,
    ):  # noqa: E501
        # type: (SpotPriceTrigger, SpotPricePutOrder, int, int, str, int, int, int, str, str, Configuration) -> None
        """SpotPriceTriggeredOrder - 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._trigger = None
        self._put = None
        self._id = None
        self._user = None
        self._market = None
        self._ctime = None
        self._ftime = None
        self._fired_order_id = None
        self._status = None
        self._reason = None
        self.discriminator = None

        self.trigger = trigger
        self.put = put
        if id is not None:
            self.id = id
        if user is not None:
            self.user = user
        self.market = market
        if ctime is not None:
            self.ctime = ctime
        if ftime is not None:
            self.ftime = ftime
        if fired_order_id is not None:
            self.fired_order_id = fired_order_id
        if status is not None:
            self.status = status
        if reason is not None:
            self.reason = reason

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


        :return: The trigger of this SpotPriceTriggeredOrder.  # noqa: E501
        :rtype: SpotPriceTrigger
        """
        return self._trigger

    @trigger.setter
    def trigger(self, trigger):
        """Sets the trigger of this SpotPriceTriggeredOrder.


        :param trigger: The trigger of this SpotPriceTriggeredOrder.  # noqa: E501
        :type: SpotPriceTrigger
        """
        if self.local_vars_configuration.client_side_validation and trigger is None:  # noqa: E501
            raise ValueError("Invalid value for `trigger`, must not be `None`")  # noqa: E501

        self._trigger = trigger

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


        :return: The put of this SpotPriceTriggeredOrder.  # noqa: E501
        :rtype: SpotPricePutOrder
        """
        return self._put

    @put.setter
    def put(self, put):
        """Sets the put of this SpotPriceTriggeredOrder.


        :param put: The put of this SpotPriceTriggeredOrder.  # noqa: E501
        :type: SpotPricePutOrder
        """
        if self.local_vars_configuration.client_side_validation and put is None:  # noqa: E501
            raise ValueError("Invalid value for `put`, must not be `None`")  # noqa: E501

        self._put = put

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

        Auto order ID  # noqa: E501

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

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

        Auto order ID  # noqa: E501

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

        self._id = id

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

        User ID  # noqa: E501

        :return: The user of this SpotPriceTriggeredOrder.  # noqa: E501
        :rtype: int
        """
        return self._user

    @user.setter
    def user(self, user):
        """Sets the user of this SpotPriceTriggeredOrder.

        User ID  # noqa: E501

        :param user: The user of this SpotPriceTriggeredOrder.  # noqa: E501
        :type: int
        """

        self._user = user

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

        Currency pair  # noqa: E501

        :return: The market of this SpotPriceTriggeredOrder.  # noqa: E501
        :rtype: str
        """
        return self._market

    @market.setter
    def market(self, market):
        """Sets the market of this SpotPriceTriggeredOrder.

        Currency pair  # noqa: E501

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

        self._market = market

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

        Creation time  # noqa: E501

        :return: The ctime of this SpotPriceTriggeredOrder.  # noqa: E501
        :rtype: int
        """
        return self._ctime

    @ctime.setter
    def ctime(self, ctime):
        """Sets the ctime of this SpotPriceTriggeredOrder.

        Creation time  # noqa: E501

        :param ctime: The ctime of this SpotPriceTriggeredOrder.  # noqa: E501
        :type: int
        """

        self._ctime = ctime

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

        Finished time  # noqa: E501

        :return: The ftime of this SpotPriceTriggeredOrder.  # noqa: E501
        :rtype: int
        """
        return self._ftime

    @ftime.setter
    def ftime(self, ftime):
        """Sets the ftime of this SpotPriceTriggeredOrder.

        Finished time  # noqa: E501

        :param ftime: The ftime of this SpotPriceTriggeredOrder.  # noqa: E501
        :type: int
        """

        self._ftime = ftime

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

        ID of the newly created order on condition triggered  # noqa: E501

        :return: The fired_order_id of this SpotPriceTriggeredOrder.  # noqa: E501
        :rtype: int
        """
        return self._fired_order_id

    @fired_order_id.setter
    def fired_order_id(self, fired_order_id):
        """Sets the fired_order_id of this SpotPriceTriggeredOrder.

        ID of the newly created order on condition triggered  # noqa: E501

        :param fired_order_id: The fired_order_id of this SpotPriceTriggeredOrder.  # noqa: E501
        :type: int
        """

        self._fired_order_id = fired_order_id

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

        Status  - open: open - cancelled: being manually cancelled - finish: successfully executed - failed: failed to execute - expired - expired   # noqa: E501

        :return: The status of this SpotPriceTriggeredOrder.  # noqa: E501
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this SpotPriceTriggeredOrder.

        Status  - open: open - cancelled: being manually cancelled - finish: successfully executed - failed: failed to execute - expired - expired   # noqa: E501

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

        self._status = status

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

        Additional remarks on how the order was finished  # noqa: E501

        :return: The reason of this SpotPriceTriggeredOrder.  # noqa: E501
        :rtype: str
        """
        return self._reason

    @reason.setter
    def reason(self, reason):
        """Sets the reason of this SpotPriceTriggeredOrder.

        Additional remarks on how the order was finished  # noqa: E501

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

        self._reason = reason

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

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