export type DeleteApiV1AlertRulesRuleIdArgs = {rule_id: string}; export type DeleteApiV1AlertRulesRuleIdOptions = {baseUrl?: string | undefined, polyApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an alert rule * * DELETE /v1/alert-rules/{rule_id} */ export const deleteApiV1AlertRulesRuleId = async (args: DeleteApiV1AlertRulesRuleIdArgs, options?: DeleteApiV1AlertRulesRuleIdOptions) => { const {baseUrl = "https://api.us.poly.ai", fetch: fetchFn = fetch, polyApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (polyApiKey !== undefined) headers.set("X-API-KEY", polyApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/alert-rules/${encodeURIComponent(String(args.rule_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 };