# coding: utf-8

"""
    Zarban Wallet API

    API for Zarban wallet services.  # noqa: E501

    The version of the OpenAPI document: 2.0.0
    Contact: info@zarban.io
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from zarban.wallet.openapi_client.configuration import Configuration


class SwapResponse(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 = {
        'id': 'str',
        'trade_type': 'str',
        '_in': 'Symbol',
        'out': 'Symbol',
        'amount': 'str',
        'quote': 'str',
        'rate': 'str',
        'input_balance_after_swap': 'str',
        'output_balance_after_swap': 'str',
        'created_at': 'Timestamp',
        'expires_at': 'Timestamp',
        'executed_at': 'Timestamp',
        'value': 'Currency'
    }

    attribute_map = {
        'id': 'id',
        'trade_type': 'tradeType',
        '_in': 'in',
        'out': 'out',
        'amount': 'amount',
        'quote': 'quote',
        'rate': 'rate',
        'input_balance_after_swap': 'inputBalanceAfterSwap',
        'output_balance_after_swap': 'outputBalanceAfterSwap',
        'created_at': 'createdAt',
        'expires_at': 'expiresAt',
        'executed_at': 'executedAt',
        'value': 'value'
    }

    def __init__(self, id=None, trade_type=None, _in=None, out=None, amount=None, quote=None, rate=None, input_balance_after_swap=None, output_balance_after_swap=None, created_at=None, expires_at=None, executed_at=None, value=None, local_vars_configuration=None):  # noqa: E501
        """SwapResponse - 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._id = None
        self._trade_type = None
        self.__in = None
        self._out = None
        self._amount = None
        self._quote = None
        self._rate = None
        self._input_balance_after_swap = None
        self._output_balance_after_swap = None
        self._created_at = None
        self._expires_at = None
        self._executed_at = None
        self._value = None
        self.discriminator = None

        self.id = id
        self.trade_type = trade_type
        self._in = _in
        self.out = out
        self.amount = amount
        self.quote = quote
        self.rate = rate
        if input_balance_after_swap is not None:
            self.input_balance_after_swap = input_balance_after_swap
        if output_balance_after_swap is not None:
            self.output_balance_after_swap = output_balance_after_swap
        self.created_at = created_at
        self.expires_at = expires_at
        if executed_at is not None:
            self.executed_at = executed_at
        self.value = value

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


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

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


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

        self._id = id

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


        :return: The trade_type of this SwapResponse.  # noqa: E501
        :rtype: str
        """
        return self._trade_type

    @trade_type.setter
    def trade_type(self, trade_type):
        """Sets the trade_type of this SwapResponse.


        :param trade_type: The trade_type of this SwapResponse.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and trade_type is None:  # noqa: E501
            raise ValueError("Invalid value for `trade_type`, must not be `None`")  # noqa: E501
        allowed_values = ["ExactInput", "ExactOutput"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and trade_type not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `trade_type` ({0}), must be one of {1}"  # noqa: E501
                .format(trade_type, allowed_values)
            )

        self._trade_type = trade_type

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


        :return: The _in of this SwapResponse.  # noqa: E501
        :rtype: Symbol
        """
        return self.__in

    @_in.setter
    def _in(self, _in):
        """Sets the _in of this SwapResponse.


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

        self.__in = _in

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


        :return: The out of this SwapResponse.  # noqa: E501
        :rtype: Symbol
        """
        return self._out

    @out.setter
    def out(self, out):
        """Sets the out of this SwapResponse.


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

        self._out = out

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


        :return: The amount of this SwapResponse.  # noqa: E501
        :rtype: str
        """
        return self._amount

    @amount.setter
    def amount(self, amount):
        """Sets the amount of this SwapResponse.


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

        self._amount = amount

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


        :return: The quote of this SwapResponse.  # noqa: E501
        :rtype: str
        """
        return self._quote

    @quote.setter
    def quote(self, quote):
        """Sets the quote of this SwapResponse.


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

        self._quote = quote

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


        :return: The rate of this SwapResponse.  # noqa: E501
        :rtype: str
        """
        return self._rate

    @rate.setter
    def rate(self, rate):
        """Sets the rate of this SwapResponse.


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

        self._rate = rate

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


        :return: The input_balance_after_swap of this SwapResponse.  # noqa: E501
        :rtype: str
        """
        return self._input_balance_after_swap

    @input_balance_after_swap.setter
    def input_balance_after_swap(self, input_balance_after_swap):
        """Sets the input_balance_after_swap of this SwapResponse.


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

        self._input_balance_after_swap = input_balance_after_swap

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


        :return: The output_balance_after_swap of this SwapResponse.  # noqa: E501
        :rtype: str
        """
        return self._output_balance_after_swap

    @output_balance_after_swap.setter
    def output_balance_after_swap(self, output_balance_after_swap):
        """Sets the output_balance_after_swap of this SwapResponse.


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

        self._output_balance_after_swap = output_balance_after_swap

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


        :return: The created_at of this SwapResponse.  # noqa: E501
        :rtype: Timestamp
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at):
        """Sets the created_at of this SwapResponse.


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

        self._created_at = created_at

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


        :return: The expires_at of this SwapResponse.  # noqa: E501
        :rtype: Timestamp
        """
        return self._expires_at

    @expires_at.setter
    def expires_at(self, expires_at):
        """Sets the expires_at of this SwapResponse.


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

        self._expires_at = expires_at

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


        :return: The executed_at of this SwapResponse.  # noqa: E501
        :rtype: Timestamp
        """
        return self._executed_at

    @executed_at.setter
    def executed_at(self, executed_at):
        """Sets the executed_at of this SwapResponse.


        :param executed_at: The executed_at of this SwapResponse.  # noqa: E501
        :type: Timestamp
        """

        self._executed_at = executed_at

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


        :return: The value of this SwapResponse.  # noqa: E501
        :rtype: Currency
        """
        return self._value

    @value.setter
    def value(self, value):
        """Sets the value of this SwapResponse.


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

        self._value = value

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

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