export type DeleteApiMoneyTransferAccountsMoneyTransferAccountIdArgs = {token: unknown, moneyTransferAccountId: number}; export type DeleteApiMoneyTransferAccountsMoneyTransferAccountIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete money transfer account * * DELETE /money_transfer_accounts/{moneyTransferAccountId} */ export const deleteApiMoneyTransferAccountsMoneyTransferAccountId = async (args: DeleteApiMoneyTransferAccountsMoneyTransferAccountIdArgs, options: DeleteApiMoneyTransferAccountsMoneyTransferAccountIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.token != null) query.append("token", String(args.token)) const url = `${baseUrl.replace(/\/+$/, '')}/money_transfer_accounts/${encodeURIComponent(String(args.moneyTransferAccountId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };