export type BankBilletUpdateObject = {amount?: number | undefined, expire_at?: string | undefined, tags?: (Array | null) | undefined, notes?: (string | null) | undefined, days_for_sue_type?: ( | 0 | 1 | null) | undefined, days_for_sue?: (number | null) | undefined, days_for_revoke?: (number | null) | undefined, sue_code?: (string | null) | undefined, instructions?: (string | null) | undefined, description?: (string | null) | undefined, interest_type?: (0 | 1 | 2 | 7 | null) | undefined, days_for_interest?: (number | null) | undefined, interest_percentage?: (number | null) | undefined, interest_value?: (number | null) | undefined, discount_type?: (0 | 1 | 2 | null) | undefined, days_for_discount?: (number | null) | undefined, discount_percentage?: (number | null) | undefined, discount_value?: (number | null) | undefined, days_for_second_discount?: (number | null) | undefined, second_discount_percentage?: (number | null) | undefined, second_discount_value?: (number | null) | undefined, days_for_third_discount?: (number | null) | undefined, third_discount_percentage?: (number | null) | undefined, third_discount_value?: (number | null) | undefined, reduction_type?: (1 | 2 | 3 | null) | undefined, reduction_amount?: number | undefined, reduction_percentage?: (number | null) | undefined, divergent_payment_type?: ( | 1 | 2 | 3 | 4 | null) | undefined, divergent_payment_value_type?: ( | 1 | 2 | null) | undefined, divergent_payment_maximum_value?: (number | null) | undefined, divergent_payment_minimum_value?: (number | null) | undefined, divergent_payment_maximum_percentage?: (number | null) | undefined, divergent_payment_minimum_percentage?: (number | null) | undefined, fine_type?: (0 | 1 | 2 | null) | undefined, days_for_fine?: (number | null) | undefined, credit_bureau?: ( | 0 | 1 | 2 | null) | undefined, days_for_negativation?: (number | null) | undefined, fine_percentage?: (number | null) | undefined, fine_value?: (number | null) | undefined, document_number?: (string | null) | undefined, customer_person_name?: string | undefined, customer_cnpj_cpf?: string | undefined, customer_state?: string | undefined, customer_city_name?: string | undefined, customer_zipcode?: string | undefined, customer_address?: string | undefined, customer_neighborhood?: string | undefined, guarantor_name?: (string | null) | undefined, guarantor_cnpj_cpf?: (string | null) | undefined, document_type?: ('01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12' | '13' | '14' | '15' | '16' | '17' | '18' | '19' | '20' | '21' | '22' | '23' | '24' | '25' | '26' | '27' | '28' | '29' | '30' | '31' | '32' | '33' | '34' | '35' | '36' | '37' | '38' | '39' | '40' | '41' | '42' | '43' | '44' | '45' | '99') | undefined, control_number?: (string | null) | undefined, payment_count?: (number | null) | undefined, issued_at?: (string | null) | undefined, bolepix_key?: (string | null) | undefined, pix_txid?: (string | null) | undefined}; export type UpdateApiV1BankBilletsIdArgs = {'User-Agent'?: string | undefined, 'X-Idempotency-Key'?: string | undefined, id: string, body: BankBilletUpdateObject}; export type UpdateApiV1BankBilletsIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Atualizar o Boleto * * PUT /v1/bank_billets/{id} */ export const updateApiV1BankBilletsId = async (args: UpdateApiV1BankBilletsIdArgs, options?: UpdateApiV1BankBilletsIdOptions) => { 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_billets/${encodeURIComponent(String(args.id))}${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 };