export type DeleteApiApiV2StatuspagesPageIdDegradationTemplatesTemplateIdArgs = {page_id: string, template_id: string}; export type DeleteApiApiV2StatuspagesPageIdDegradationTemplatesTemplateIdOptions = {baseUrl?: string | undefined, apiKeyAuth?: string | undefined, appKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete degradation template * * DELETE /api/v2/statuspages/{page_id}/degradation_templates/{template_id} * * Also accepts auth: AuthZ */ export const deleteApiApiV2StatuspagesPageIdDegradationTemplatesTemplateId = async (args: DeleteApiApiV2StatuspagesPageIdDegradationTemplatesTemplateIdArgs, options?: DeleteApiApiV2StatuspagesPageIdDegradationTemplatesTemplateIdOptions) => { const {baseUrl = "https://api.datadoghq.com", fetch: fetchFn = fetch, apiKeyAuth, appKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKeyAuth !== undefined) headers.set("DD-API-KEY", apiKeyAuth) if (appKeyAuth !== undefined) headers.set("DD-APPLICATION-KEY", appKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/statuspages/${encodeURIComponent(String(args.page_id))}/degradation_templates/${encodeURIComponent(String(args.template_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 };