export type CustomerSubscriptionObject = {id?: number | undefined, customer_id?: (number | null) | undefined, customer_person_name: string, customer_nickname?: (string | null) | undefined, customer_cnpj_cpf: string, customer_zipcode: string, customer_email?: (string | null) | undefined, customer_email_cc?: (string | null) | undefined, customer_address: string, customer_city_name: string, customer_state: string, customer_neighborhood: string, customer_address_number?: string | undefined, customer_address_complement?: (string | null) | undefined, customer_phone_number?: (string | null) | undefined, customer_person_type?: ('individual' | 'juridical' | null) | undefined, customer_mobile_local_code?: (string | null) | undefined, customer_mobile_number?: (string | null) | undefined, customer_notes?: (string | null) | undefined, customer_ignore_email?: (boolean | null) | undefined, customer_ignore_sms?: (boolean | null) | undefined, customer_contact_person?: (string | null) | undefined, customer_update?: (string | null) | undefined, bank_billet_account_id: number, amount: number, cycle?: ('biweekly' | 'bimonthly' | 'monthly' | 'quarterly' | 'semiannual' | 'annual' | null) | undefined, next_billing?: string | undefined, end_at?: (string | null) | undefined, description?: (string | null) | undefined, instructions?: (string | null) | undefined, days_in_advance?: number | undefined, fine_type?: (0 | 1 | 2 | null) | undefined, days_for_fine?: (number | null) | undefined, fine_percentage?: (number | null) | undefined, fine_value?: (number | null) | undefined, interest_type?: (0 | 1 | 2 | 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, bank_billet_layout_id?: (number | null) | undefined, notes?: (string | null) | undefined, tags?: (Array | null) | undefined, bank_billet_ids?: (Array | null) | undefined, prevent_registration?: (boolean | 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, divergent_payment_limit?: (number | null) | undefined, custom_attachment_name?: (string | null) | undefined, guarantor_name?: (string | null) | undefined, guarantor_cnpj_cpf?: (string | null) | undefined, guarantor_address_number?: (string | null) | undefined, guarantor_neighborhood?: (string | null) | undefined, guarantor_phone_number?: (string | null) | undefined, guarantor_city_name?: (string | null) | undefined, guarantor_state?: (string | null) | undefined, guarantor_zipcode?: (string | null) | undefined, guarantor_address?: (string | null) | undefined, guarantor_address_complement?: (string | null) | undefined, days_for_revoke?: (number | null) | undefined, days_for_negativation?: (number | null) | undefined, days_for_sue?: (number | null) | undefined, payment_count?: (number | null) | undefined, import_id?: (number | null) | undefined, ignore_whatsapp?: (boolean | null) | undefined, created_at?: (string | null) | undefined, updated_at?: (string | null) | undefined}; export type UpdateApiV1CustomerSubscriptionsIdArgs = {'User-Agent'?: string | undefined, 'X-Idempotency-Key'?: string | undefined, id: string, body: CustomerSubscriptionObject}; export type UpdateApiV1CustomerSubscriptionsIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Atualizar a Assinatura * * PUT /v1/customer_subscriptions/{id} */ export const updateApiV1CustomerSubscriptionsId = async (args: UpdateApiV1CustomerSubscriptionsIdArgs, options?: UpdateApiV1CustomerSubscriptionsIdOptions) => { 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/customer_subscriptions/${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 };