export type NotesPayload = {name?: string | undefined, display_name?: string | undefined, json_value?: Record | undefined}; export type UpdateApiApiPublicV1IncidentsIncidentNumberNotesNoteNameArgs = {'X-VO-Api-Id': string, 'X-VO-Api-Key': string, incidentNumber: number, noteName: string, body: NotesPayload}; export type UpdateApiApiPublicV1IncidentsIncidentNumberNotesNoteNameOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a Note * * PUT /api-public/v1/incidents/{incidentNumber}/notes/{noteName} */ export const updateApiApiPublicV1IncidentsIncidentNumberNotesNoteName = async (args: UpdateApiApiPublicV1IncidentsIncidentNumberNotesNoteNameArgs, options?: UpdateApiApiPublicV1IncidentsIncidentNumberNotesNoteNameOptions) => { const {baseUrl = "https://api.victorops.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['X-VO-Api-Id'] != null) headers.set("X-VO-Api-Id", String(args['X-VO-Api-Id'])) if (args['X-VO-Api-Key'] != null) headers.set("X-VO-Api-Key", String(args['X-VO-Api-Key'])) const url = `${baseUrl.replace(/\/+$/, '')}/api-public/v1/incidents/${encodeURIComponent(String(args.incidentNumber))}/notes/${encodeURIComponent(String(args.noteName))}${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 };