export type DeleteApiApiOrgIdRumAnalyticsNamedEventsIdArgs = {org_id: string, id: string, app: string, force?: boolean | undefined}; export type DeleteApiApiOrgIdRumAnalyticsNamedEventsIdOptions = {baseUrl: string, Authorization?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a named event * * DELETE /api/{org_id}/rum/analytics/named_events/{id} */ export const deleteApiApiOrgIdRumAnalyticsNamedEventsId = async (args: DeleteApiApiOrgIdRumAnalyticsNamedEventsIdArgs, options: DeleteApiApiOrgIdRumAnalyticsNamedEventsIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, Authorization} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.app != null) query.append("app", String(args.app)) if (args.force != null) query.append("force", String(args.force)) if (Authorization !== undefined) headers.set("Authorization", Authorization) const url = `${baseUrl.replace(/\/+$/, '')}/api/${encodeURIComponent(String(args.org_id))}/rum/analytics/named_events/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };