# 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 Refund(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, id=None, location_id=None, transaction_id=None, tender_id=None, created_at=None, reason=None, amount_money=None, status=None, processing_fee_money=None, additional_recipients=None):
        """
        Refund - 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',
            'location_id': 'str',
            'transaction_id': 'str',
            'tender_id': 'str',
            'created_at': 'str',
            'reason': 'str',
            'amount_money': 'Money',
            'status': 'str',
            'processing_fee_money': 'Money',
            'additional_recipients': 'list[AdditionalRecipient]'
        }

        self.attribute_map = {
            'id': 'id',
            'location_id': 'location_id',
            'transaction_id': 'transaction_id',
            'tender_id': 'tender_id',
            'created_at': 'created_at',
            'reason': 'reason',
            'amount_money': 'amount_money',
            'status': 'status',
            'processing_fee_money': 'processing_fee_money',
            'additional_recipients': 'additional_recipients'
        }

        self._id = id
        self._location_id = location_id
        self._transaction_id = transaction_id
        self._tender_id = tender_id
        self._created_at = created_at
        self._reason = reason
        self._amount_money = amount_money
        self._status = status
        self._processing_fee_money = processing_fee_money
        self._additional_recipients = additional_recipients

    @property
    def id(self):
        """
        Gets the id of this Refund.
        The refund's unique ID.

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

    @id.setter
    def id(self, id):
        """
        Sets the id of this Refund.
        The refund's unique ID.

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

        self._id = id

    @property
    def location_id(self):
        """
        Gets the location_id of this Refund.
        The ID of the refund's associated location.

        :return: The location_id of this Refund.
        :rtype: str
        """
        return self._location_id

    @location_id.setter
    def location_id(self, location_id):
        """
        Sets the location_id of this Refund.
        The ID of the refund's associated location.

        :param location_id: The location_id of this Refund.
        :type: str
        """

        self._location_id = location_id

    @property
    def transaction_id(self):
        """
        Gets the transaction_id of this Refund.
        The ID of the transaction that the refunded tender is part of.

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

    @transaction_id.setter
    def transaction_id(self, transaction_id):
        """
        Sets the transaction_id of this Refund.
        The ID of the transaction that the refunded tender is part of.

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

        self._transaction_id = transaction_id

    @property
    def tender_id(self):
        """
        Gets the tender_id of this Refund.
        The ID of the refunded tender.

        :return: The tender_id of this Refund.
        :rtype: str
        """
        return self._tender_id

    @tender_id.setter
    def tender_id(self, tender_id):
        """
        Sets the tender_id of this Refund.
        The ID of the refunded tender.

        :param tender_id: The tender_id of this Refund.
        :type: str
        """

        self._tender_id = tender_id

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

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

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

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

        self._created_at = created_at

    @property
    def reason(self):
        """
        Gets the reason of this Refund.
        The reason for the refund being issued.

        :return: The reason of this Refund.
        :rtype: str
        """
        return self._reason

    @reason.setter
    def reason(self, reason):
        """
        Sets the reason of this Refund.
        The reason for the refund being issued.

        :param reason: The reason of this Refund.
        :type: str
        """

        self._reason = reason

    @property
    def amount_money(self):
        """
        Gets the amount_money of this Refund.
        The amount of money refunded to the buyer.

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

    @amount_money.setter
    def amount_money(self, amount_money):
        """
        Sets the amount_money of this Refund.
        The amount of money refunded to the buyer.

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

        self._amount_money = amount_money

    @property
    def status(self):
        """
        Gets the status of this Refund.
        The current status of the refund (`PENDING`, `APPROVED`, `REJECTED`, or `FAILED`). See [RefundStatus](#type-refundstatus) for possible values

        :return: The status of this Refund.
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """
        Sets the status of this Refund.
        The current status of the refund (`PENDING`, `APPROVED`, `REJECTED`, or `FAILED`). See [RefundStatus](#type-refundstatus) for possible values

        :param status: The status of this Refund.
        :type: str
        """

        self._status = status

    @property
    def processing_fee_money(self):
        """
        Gets the processing_fee_money of this Refund.
        The amount of Square processing fee money refunded to the *merchant*.

        :return: The processing_fee_money of this Refund.
        :rtype: Money
        """
        return self._processing_fee_money

    @processing_fee_money.setter
    def processing_fee_money(self, processing_fee_money):
        """
        Sets the processing_fee_money of this Refund.
        The amount of Square processing fee money refunded to the *merchant*.

        :param processing_fee_money: The processing_fee_money of this Refund.
        :type: Money
        """

        self._processing_fee_money = processing_fee_money

    @property
    def additional_recipients(self):
        """
        Gets the additional_recipients of this Refund.
        Additional recipients (other than the merchant) receiving a portion of this refund. For example, fees assessed on a refund of a purchase by a third party integration.

        :return: The additional_recipients of this Refund.
        :rtype: list[AdditionalRecipient]
        """
        return self._additional_recipients

    @additional_recipients.setter
    def additional_recipients(self, additional_recipients):
        """
        Sets the additional_recipients of this Refund.
        Additional recipients (other than the merchant) receiving a portion of this refund. For example, fees assessed on a refund of a purchase by a third party integration.

        :param additional_recipients: The additional_recipients of this Refund.
        :type: list[AdditionalRecipient]
        """

        self._additional_recipients = additional_recipients

    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
