#NEWLINE# def _request( self , method , path , **kwargs ) : #NEWLINE# #INDENT# '\n        Send a request to the GoCardless API servers.\n\n        :param method: the HTTP method to use (e.g. +:get+, +:post+)\n        :param path: the path fragment of the URL\n        ' #NEWLINE# request_url = ( self . get_base_url ( ) + path ) #NEWLINE# request = Request ( method , request_url , params = kwargs . get ( 'params' ) ) #NEWLINE# logger . debug ( 'Executing request to {0}' . format ( request_url ) ) #NEWLINE# if ( 'auth' in kwargs ) : #NEWLINE# #INDENT# request . use_http_auth ( * kwargs [ 'auth' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# request . use_bearer_auth ( self . _access_token ) #NEWLINE# #UNINDENT# request . set_payload ( kwargs . get ( 'data' ) ) #NEWLINE# response = request . perform ( ) #NEWLINE# if ( ( type ( response ) == dict ) and ( 'errors' in response . keys ( ) ) ) : #NEWLINE# #INDENT# raise ClientError ( 'Error calling api, message was ' , response [ 'errors' ] ) #NEWLINE# #UNINDENT# if ( ( type ( response ) == dict ) and ( 'error' in response . keys ( ) ) ) : #NEWLINE# #INDENT# raise ClientError ( 'Error calling api, message was ' , response [ 'error' ] ) #NEWLINE# #UNINDENT# return request_url