# coding: utf-8

"""
Copyright 2017 Square, Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""


from pprint import pformat
from six import iteritems
import re


class AdditionalRecipientReceivable(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, id=None, transaction_id=None, transaction_location_id=None, amount_money=None, created_at=None, refunds=None):
        """
        AdditionalRecipientReceivable - a model defined in Swagger

        :param dict swaggerTypes: The key is attribute name
                                  and the value is attribute type.
        :param dict attributeMap: The key is attribute name
                                  and the value is json key in definition.
        """
        self.swagger_types = {
            'id': 'str',
            'transaction_id': 'str',
            'transaction_location_id': 'str',
            'amount_money': 'Money',
            'created_at': 'str',
            'refunds': 'list[AdditionalRecipientReceivableRefund]'
        }

        self.attribute_map = {
            'id': 'id',
            'transaction_id': 'transaction_id',
            'transaction_location_id': 'transaction_location_id',
            'amount_money': 'amount_money',
            'created_at': 'created_at',
            'refunds': 'refunds'
        }

        self._id = id
        self._transaction_id = transaction_id
        self._transaction_location_id = transaction_location_id
        self._amount_money = amount_money
        self._created_at = created_at
        self._refunds = refunds

    @property
    def id(self):
        """
        Gets the id of this AdditionalRecipientReceivable.
        The additional recipient receivable's unique ID, issued by Square payments servers.

        :return: The id of this AdditionalRecipientReceivable.
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """
        Sets the id of this AdditionalRecipientReceivable.
        The additional recipient receivable's unique ID, issued by Square payments servers.

        :param id: The id of this AdditionalRecipientReceivable.
        :type: str
        """

        if id is None:
            raise ValueError("Invalid value for `id`, must not be `None`")
        if len(id) < 1:
            raise ValueError("Invalid value for `id`, length must be greater than or equal to `1`")

        self._id = id

    @property
    def transaction_id(self):
        """
        Gets the transaction_id of this AdditionalRecipientReceivable.
        The ID of the transaction that the additional recipient receivable was applied to.

        :return: The transaction_id of this AdditionalRecipientReceivable.
        :rtype: str
        """
        return self._transaction_id

    @transaction_id.setter
    def transaction_id(self, transaction_id):
        """
        Sets the transaction_id of this AdditionalRecipientReceivable.
        The ID of the transaction that the additional recipient receivable was applied to.

        :param transaction_id: The transaction_id of this AdditionalRecipientReceivable.
        :type: str
        """

        if transaction_id is None:
            raise ValueError("Invalid value for `transaction_id`, must not be `None`")
        if len(transaction_id) < 1:
            raise ValueError("Invalid value for `transaction_id`, length must be greater than or equal to `1`")

        self._transaction_id = transaction_id

    @property
    def transaction_location_id(self):
        """
        Gets the transaction_location_id of this AdditionalRecipientReceivable.
        The ID of the location that created the receivable. This is the location ID on the associated transaction.

        :return: The transaction_location_id of this AdditionalRecipientReceivable.
        :rtype: str
        """
        return self._transaction_location_id

    @transaction_location_id.setter
    def transaction_location_id(self, transaction_location_id):
        """
        Sets the transaction_location_id of this AdditionalRecipientReceivable.
        The ID of the location that created the receivable. This is the location ID on the associated transaction.

        :param transaction_location_id: The transaction_location_id of this AdditionalRecipientReceivable.
        :type: str
        """

        if transaction_location_id is None:
            raise ValueError("Invalid value for `transaction_location_id`, must not be `None`")
        if len(transaction_location_id) < 1:
            raise ValueError("Invalid value for `transaction_location_id`, length must be greater than or equal to `1`")

        self._transaction_location_id = transaction_location_id

    @property
    def amount_money(self):
        """
        Gets the amount_money of this AdditionalRecipientReceivable.
        The amount of the receivable. This will always be non-negative.

        :return: The amount_money of this AdditionalRecipientReceivable.
        :rtype: Money
        """
        return self._amount_money

    @amount_money.setter
    def amount_money(self, amount_money):
        """
        Sets the amount_money of this AdditionalRecipientReceivable.
        The amount of the receivable. This will always be non-negative.

        :param amount_money: The amount_money of this AdditionalRecipientReceivable.
        :type: Money
        """

        self._amount_money = amount_money

    @property
    def created_at(self):
        """
        Gets the created_at of this AdditionalRecipientReceivable.
        The time when the additional recipient receivable was created, in RFC 3339 format.

        :return: The created_at of this AdditionalRecipientReceivable.
        :rtype: str
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at):
        """
        Sets the created_at of this AdditionalRecipientReceivable.
        The time when the additional recipient receivable was created, in RFC 3339 format.

        :param created_at: The created_at of this AdditionalRecipientReceivable.
        :type: str
        """

        self._created_at = created_at

    @property
    def refunds(self):
        """
        Gets the refunds of this AdditionalRecipientReceivable.
        Any refunds of the receivable that have been applied.

        :return: The refunds of this AdditionalRecipientReceivable.
        :rtype: list[AdditionalRecipientReceivableRefund]
        """
        return self._refunds

    @refunds.setter
    def refunds(self, refunds):
        """
        Sets the refunds of this AdditionalRecipientReceivable.
        Any refunds of the receivable that have been applied.

        :param refunds: The refunds of this AdditionalRecipientReceivable.
        :type: list[AdditionalRecipientReceivableRefund]
        """

        self._refunds = refunds

    def to_dict(self):
        """
        Returns the model properties as a dict
        """
        result = {}

        for attr, _ in 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

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return 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
        """
        return self.__dict__ == other.__dict__

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