export type BankBilletAccountUpdateObject = {kind?: ('cnab400' | 'cnab240') | undefined, bank_contract_slug?: string | undefined, financial_account?: ({uid?: string | undefined} | null) | undefined, payment_place?: (string | null) | undefined, custom_name?: string | undefined, allow_expiration_on_weekends?: (boolean | null) | undefined, beneficiary_name?: string | undefined, beneficiary_cnpj_cpf?: string | undefined, agency_number?: string | undefined, agency_digit?: (string | null) | undefined, account_number?: string | undefined, account_digit?: string | undefined, extra1?: (string | null) | undefined, extra1_digit?: (string | null) | undefined, extra2?: (string | null) | undefined, extra2_digit?: (string | null) | undefined, contract?: string | undefined, contract_type?: string | undefined, extra3?: (string | null) | undefined, beneficiary_address_street?: (string | null) | undefined, beneficiary_address_street_number?: (string | null) | undefined, beneficiary_address_complement?: (string | null) | undefined, beneficiary_address_neighborhood?: (string | null) | undefined, beneficiary_address_city?: (string | null) | undefined, beneficiary_address_state?: (string | null) | undefined, beneficiary_address_zipcode?: (string | null) | undefined, beneficiary_address?: (string | null) | undefined, bolepix_enabled?: (boolean | null) | undefined, bolepix?: ({pix_mode?: (number | null) | undefined, pix_account?: ({uid?: string | undefined} | {id?: string | undefined}) | undefined, pix_billing_options?: ({kind?: string | undefined, interest?: (boolean | null) | undefined, fine?: (boolean | null) | undefined, discount?: (boolean | null) | undefined, revoke_days?: (boolean | null) | undefined} | null) | undefined} | null) | undefined, bolepix_key?: (string | null) | undefined, default?: (boolean | null) | undefined, remittance_disabled?: (boolean | null) | undefined, next_our_number?: (number | null) | undefined, next_remittance_number?: (number | null) | undefined, bank_billet_account_next_our_number_attributes?: ({next_our_number: number | null}) | undefined, bank_billet_account_next_remittance_number_attributes?: ({next_remittance_number: number | null}) | undefined}; export type UpdateApiV1BankBilletAccountsIdArgs = {'User-Agent'?: string | undefined, 'X-Idempotency-Key'?: string | undefined, id: string, body: BankBilletAccountUpdateObject}; export type UpdateApiV1BankBilletAccountsIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Atualizar a Carteira * * PUT /v1/bank_billet_accounts/{id} */ export const updateApiV1BankBilletAccountsId = async (args: UpdateApiV1BankBilletAccountsIdArgs, options?: UpdateApiV1BankBilletAccountsIdOptions) => { 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_accounts/${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 };