export type DeleteApiV1ProjectsProjectIdAlertsAlertIdArgs = {alert_id: string, project_id: string}; export type DeleteApiV1ProjectsProjectIdAlertsAlertIdOptions = {baseUrl: string, OAuth2AuthorizationCodeBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Alert * * DELETE /v1/projects/{project_id}/alerts/{alert_id}/ */ export const deleteApiV1ProjectsProjectIdAlertsAlertId = async (args: DeleteApiV1ProjectsProjectIdAlertsAlertIdArgs, options: DeleteApiV1ProjectsProjectIdAlertsAlertIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, OAuth2AuthorizationCodeBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuth2AuthorizationCodeBearer !== undefined) headers.set('authorization', `Bearer ${OAuth2AuthorizationCodeBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/projects/${encodeURIComponent(String(args.project_id))}/alerts/${encodeURIComponent(String(args.alert_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 };