export type DeleteApiV1BankBilletAccountsIdArgs = {'User-Agent'?: string | undefined, 'X-Idempotency-Key'?: string | undefined, id: string, delete_financial_account?: boolean | undefined}; export type DeleteApiV1BankBilletAccountsIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Excluir a Carteira de Cobrança * * DELETE /v1/bank_billet_accounts/{id} */ export const deleteApiV1BankBilletAccountsId = async (args: DeleteApiV1BankBilletAccountsIdArgs, options?: DeleteApiV1BankBilletAccountsIdOptions) => { const {baseUrl = "https://api-sandbox.kobana.com.br", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args['User-Agent'] != null) headers.set("User-Agent", String(args['User-Agent'])) if (args['X-Idempotency-Key'] != null) headers.set("X-Idempotency-Key", String(args['X-Idempotency-Key'])) if (args.delete_financial_account != null) query.append("delete_financial_account", String(args.delete_financial_account)) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/bank_billet_accounts/${encodeURIComponent(String(args.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 (await res.json()) as unknown };