export type CallEventDto = {integration_code: string, external_id?: number | undefined, tmp_id?: number | undefined, task_id?: number | undefined, contact_id?: number | undefined, company_id?: number | undefined, lead_id?: number | undefined, deal_id?: number | undefined, entity_table?: ('empty' | 'leads,' | 'deals' | 'contacts' | 'companies') | undefined, employees?: Array | undefined, contacts?: Array | undefined, companies?: Array | undefined, subject?: string | undefined, call_type: 'outgoing' | 'incoming', ended_call_status?: string | undefined, from: string, to?: string | undefined, begin_time?: number | undefined, end_time?: number | undefined, duration?: number | undefined, call_record_link?: string | undefined, note?: string | undefined}; export type PatchApiCrmV1EventsCallCallEventIdArgs = {body: CallEventDto}; export type PatchApiCrmV1EventsCallCallEventIdOptions = {baseUrl: string, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update call event * * PATCH /crm/v1/events/call/{call_event_id} */ export const patchApiCrmV1EventsCallCallEventId = async (args: PatchApiCrmV1EventsCallCallEventIdArgs, options: PatchApiCrmV1EventsCallCallEventIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/crm/v1/events/call/${encodeURIComponent(String(args.call_event_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };