export type UpdateApiActivitiesIdArgs = {id: number, body: {activity_type_id?: number | undefined, status?: number | undefined, owner_id?: number | undefined, deal_id?: number | undefined, requester_id?: number | undefined, title?: string | undefined, description?: string | undefined, comment?: string | undefined, appearin_link?: string | undefined, duration?: number | undefined, start_at?: string | undefined, delivery_date?: string | undefined, end_at?: string | undefined, reminders?: Array | undefined, persons?: Array | undefined, companies?: Array | undefined, time_utilized?: number | undefined, time_estimated?: number | undefined, hash?: string | undefined, google_calendar_id?: string | undefined, outlook_calendar_id?: string | undefined, created_at?: string | undefined}}; export type UpdateApiActivitiesIdOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * Atualizar atividade * * PUT /activities/{id} */ export const updateApiActivitiesId = async (args: UpdateApiActivitiesIdArgs, options?: UpdateApiActivitiesIdOptions) => { const {baseUrl = "https://api.pipe.run/v1", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (sec0 !== undefined) headers.set("token", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/activities/${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 (await res.json()) as unknown };