# coding: utf-8

"""
    Zarban API

    API for Zarban 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.service.openapi_client.configuration import Configuration


class DutchAmount(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 = {
        'token': 'Token',
        'start_amount': 'dict(str, str)',
        'end_amount': 'dict(str, str)',
        'recipient': 'str'
    }

    attribute_map = {
        'token': 'token',
        'start_amount': 'startAmount',
        'end_amount': 'endAmount',
        'recipient': 'recipient'
    }

    def __init__(self, token=None, start_amount=None, end_amount=None, recipient=None, local_vars_configuration=None):  # noqa: E501
        """DutchAmount - 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._token = None
        self._start_amount = None
        self._end_amount = None
        self._recipient = None
        self.discriminator = None

        self.token = token
        self.start_amount = start_amount
        self.end_amount = end_amount
        if recipient is not None:
            self.recipient = recipient

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


        :return: The token of this DutchAmount.  # noqa: E501
        :rtype: Token
        """
        return self._token

    @token.setter
    def token(self, token):
        """Sets the token of this DutchAmount.


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

        self._token = token

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


        :return: The start_amount of this DutchAmount.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._start_amount

    @start_amount.setter
    def start_amount(self, start_amount):
        """Sets the start_amount of this DutchAmount.


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

        self._start_amount = start_amount

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


        :return: The end_amount of this DutchAmount.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._end_amount

    @end_amount.setter
    def end_amount(self, end_amount):
        """Sets the end_amount of this DutchAmount.


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

        self._end_amount = end_amount

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


        :return: The recipient of this DutchAmount.  # noqa: E501
        :rtype: str
        """
        return self._recipient

    @recipient.setter
    def recipient(self, recipient):
        """Sets the recipient of this DutchAmount.


        :param recipient: The recipient of this DutchAmount.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                recipient is not None and not re.search(r'^(0x)?[0-9a-fA-F]{40}$', recipient)):  # noqa: E501
            raise ValueError(r"Invalid value for `recipient`, must be a follow pattern or equal to `/^(0x)?[0-9a-fA-F]{40}$/`")  # noqa: E501

        self._recipient = recipient

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

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