export type DeleteApiPublicMonitoringV3AlertAlertNameArgs = {appInstance?: string | undefined, group?: string | undefined, user?: string | undefined, 'alert-name': string}; export type DeleteApiPublicMonitoringV3AlertAlertNameOptions = {baseUrl: string, httpAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a Alert * * DELETE /public/monitoring/v3/alert/{alert-name} */ export const deleteApiPublicMonitoringV3AlertAlertName = async (args: DeleteApiPublicMonitoringV3AlertAlertNameArgs, options: DeleteApiPublicMonitoringV3AlertAlertNameOptions) => { const {baseUrl, fetch: fetchFn = fetch, httpAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.appInstance != null) query.append("appInstance", String(args.appInstance)) if (args.group != null) query.append("group", String(args.group)) if (args.user != null) query.append("user", String(args.user)) if (httpAuth !== undefined) headers.set('authorization', `Bearer ${httpAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/public/monitoring/v3/alert/${encodeURIComponent(String(args['alert-name']))}${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 };