# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#

class Refund(object):
    """A thin wrapper around a refund, providing easy access to its
    attributes.

    Example:
      refund = client.refunds.get()
      refund.id
    """

    def __init__(self, attributes, api_response):
        self.attributes = attributes
        self.api_response = api_response

    @property
    def amount(self):
        return self.attributes.get('amount')

    @property
    def created_at(self):
        return self.attributes.get('created_at')

    @property
    def currency(self):
        return self.attributes.get('currency')

    @property
    def id(self):
        return self.attributes.get('id')

    @property
    def links(self):
        return self.Links(self.attributes.get('links'))

    @property
    def metadata(self):
        return self.attributes.get('metadata')

    class Links(object):
        """Wrapper for the response's 'links' attribute."""

        def __init__(self, attributes):
            self.attributes = attributes

        @property
        def payment(self):
            return self.attributes.get('payment')

