export type FieldAlias = {display: string, fields: Array, group?: (string | null) | undefined, id: string, is_workload_type?: boolean | undefined}; export type UpdateApiApiOrgIdAlertsDeduplicationSemanticGroupsArgs = {org_id: string, body: Array}; export type UpdateApiApiOrgIdAlertsDeduplicationSemanticGroupsOptions = {baseUrl: string, Authorization?: string | undefined, fetch?: typeof fetch | undefined}; /** * Save semantic field groups for an organization * * PUT /api/{org_id}/alerts/deduplication/semantic-groups */ export const updateApiApiOrgIdAlertsDeduplicationSemanticGroups = async (args: UpdateApiApiOrgIdAlertsDeduplicationSemanticGroupsArgs, options: UpdateApiApiOrgIdAlertsDeduplicationSemanticGroupsOptions) => { const {baseUrl, fetch: fetchFn = fetch, Authorization} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Authorization !== undefined) headers.set("Authorization", Authorization) const url = `${baseUrl.replace(/\/+$/, '')}/api/${encodeURIComponent(String(args.org_id))}/alerts/deduplication/semantic-groups${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 };