export type DeleteApiV2AlertRoutesIdArgs = {id: string}; export type DeleteApiV2AlertRoutesIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Destroy Alert Routes V2 * * DELETE /v2/alert_routes/{id} */ export const deleteApiV2AlertRoutesId = async (args: DeleteApiV2AlertRoutesIdArgs, options?: DeleteApiV2AlertRoutesIdOptions) => { const {baseUrl = "https:////api.incident.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v2/alert_routes/${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 };