def get_bank_transfers(info=None): """Returns all bank transfers made for the account. :param info: Will filter the results to get a specific value. 'direction' gives if it was deposit or withdrawl. :type info: Optional[str] :returns: Returns a list of dictionaries of key/value pairs for each transfer. If info parameter is provided, \ a list of strings is returned where the strings are the value of the key that matches info. """ url = urls.banktransfers() data = helper.request_get(url, 'pagination') return(helper.filter(data, info))
def get_bank_transfers(direction=None, info=None): """Returns all bank transfers made for the account. :param direction: Possible values are 'received'. If left blank, function will return all withdrawls and deposits \ that are initiated from Robinhood. If the value is 'received', funciton will return transfers intiated from \ your bank rather than Robinhood. :type direction: Optional[str] :param info: Will filter the results to get a specific value. 'direction' gives if it was deposit or withdrawl. :type info: Optional[str] :returns: Returns a list of dictionaries of key/value pairs for each transfer. If info parameter is provided, \ a list of strings is returned where the strings are the value of the key that matches info. """ url = urls.banktransfers(direction) data = helper.request_get(url, 'pagination') return (helper.filter_data(data, info))
def deposit_funds_to_robinhood_account(ach_relationship, amount, info=None): """Submits a post request to deposit a certain amount of money from a bank account to Robinhood. :param ach_relationship: The url of the bank account you want to deposit the money from. :type ach_relationship: str :param amount: The amount of money you wish to deposit. :type amount: float :param info: Will filter the results to get a specific value. :type info: Optional[str] :returns: Returns a list of dictionaries of key/value pairs for the transaction. """ url = urls.banktransfers() payload = { "amount": amount, "direction": "deposit", "ach_relationship": ach_relationship, "ref_id": str(uuid4()) } data = helper.request_post(url, payload) return (helper.filter_data(data, info))