def __getattr__(self, key):
        """
        Handles the retrieval of attributes that don't exist on the object
        already. This is used to get API response values. Handles some
        convenience stuff like discarding case and checking the cgi/urlparsed
        response value dict (self.raw).

        :param str key: The response attribute to get a value for.
        :rtype: str
        :returns: The requested value from the API server's response.
        """
        # PayPal response names are always uppercase.
        key = key.upper()
        try:
            value = self.raw[key]
            if len(value) == 1:
                # For some reason, PayPal returns lists for all of the values.
                # I'm not positive as to why, so we'll just take the first
                # of each one. Hasn't failed us so far.
                return value[0]
            return value
        except KeyError:
            # The requested value wasn't returned in the response.
            raise AttributeError(self)
def __getattr__ ( self , key ) : key = key . upper ( ) try : value = self . raw [ key ] if len ( value ) == 1 : return value [ 0 ] return value except KeyError : raise AttributeError ( self )
Handles the retrieval of attributes that don't exist on the object
        already. This is used to get API response values. Handles some
        convenience stuff like discarding case and checking the cgi/urlparsed
        response value dict (self.raw).

        :param str key: The response attribute to get a value for.
        :rtype: str
        :returns: The requested value from the API server's response.