export type UpdateApiV1BankBilletBatchesIdAddBankBilletsArgs = {'User-Agent'?: string | undefined, 'X-Idempotency-Key'?: string | undefined, id: string, body: {bank_billet_ids: string | null}}; export type UpdateApiV1BankBilletBatchesIdAddBankBilletsOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Incluir Boletos no Lote * * PUT /v1/bank_billet_batches/{id}/add_bank_billets */ export const updateApiV1BankBilletBatchesIdAddBankBillets = async (args: UpdateApiV1BankBilletBatchesIdAddBankBilletsArgs, options?: UpdateApiV1BankBilletBatchesIdAddBankBilletsOptions) => { const {baseUrl = "https://api-sandbox.kobana.com.br", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "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 (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/bank_billet_batches/${encodeURIComponent(String(args.id))}/add_bank_billets${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };