export type CreateApiApiV2OrgIdAlertCalibrationDigestsRunArgs = {org_id: string}; export type CreateApiApiV2OrgIdAlertCalibrationDigestsRunOptions = {baseUrl: string, Authorization?: string | undefined, fetch?: typeof fetch | undefined}; /** * Request an alert calibration run now * * POST /api/v2/{org_id}/alert_calibration/digests/run */ export const createApiApiV2OrgIdAlertCalibrationDigestsRun = async (args: CreateApiApiV2OrgIdAlertCalibrationDigestsRunArgs, options: CreateApiApiV2OrgIdAlertCalibrationDigestsRunOptions) => { const {baseUrl, fetch: fetchFn = fetch, Authorization} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Authorization !== undefined) headers.set("Authorization", Authorization) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/${encodeURIComponent(String(args.org_id))}/alert_calibration/digests/run${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };