export type CreateApiBankingAccountsAccountIdTransfersTransferIdCancelArgs = {account_id: string, transfer_id: string}; export type CreateApiBankingAccountsAccountIdTransfersTransferIdCancelOptions = {baseUrl?: string | undefined, publicApiKey?: string | undefined, privateSecretKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Cancel Entity Transfer (Banking Connectivity) * * POST /banking/accounts/{account_id}/transfers/{transfer_id}/cancel */ export const createApiBankingAccountsAccountIdTransfersTransferIdCancel = async (args: CreateApiBankingAccountsAccountIdTransfersTransferIdCancelArgs, options?: CreateApiBankingAccountsAccountIdTransfersTransferIdCancelOptions) => { const {baseUrl = "https://api-sandbox.y.uno/v1", fetch: fetchFn = fetch, publicApiKey, privateSecretKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (publicApiKey !== undefined) headers.set("PUBLIC-API-KEY", publicApiKey) if (privateSecretKey !== undefined) headers.set("PRIVATE-SECRET-KEY", privateSecretKey) const url = `${baseUrl.replace(/\/+$/, '')}/banking/accounts/${encodeURIComponent(String(args.account_id))}/transfers/${encodeURIComponent(String(args.transfer_id))}/cancel${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };