export type DeleteApiV1CustomersCustomerIdExternalAccountsExternalAccountIdArgs = {customer_id: string, external_account_id: string}; export type DeleteApiV1CustomersCustomerIdExternalAccountsExternalAccountIdOptions = {baseUrl?: string | undefined, Authorization?: string | undefined, fetch?: typeof fetch | undefined}; /** * DELETE /v1/customers/{customer_id}/external-accounts/{external_account_id} */ export const deleteApiV1CustomersCustomerIdExternalAccountsExternalAccountId = async (args: DeleteApiV1CustomersCustomerIdExternalAccountsExternalAccountIdArgs, options?: DeleteApiV1CustomersCustomerIdExternalAccountsExternalAccountIdOptions) => { const {baseUrl = "https://api.1money.com", fetch: fetchFn = fetch, Authorization} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Authorization !== undefined) headers.set('authorization', `Bearer ${Authorization}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/customers/${encodeURIComponent(String(args.customer_id))}/external-accounts/${encodeURIComponent(String(args.external_account_id))}${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 };