export type DeleteApiV1EnterpriseEnterpriseIdAlarmrulesAlarmIdArgs = {enterprise_id: string, alarm_id: string}; export type DeleteApiV1EnterpriseEnterpriseIdAlarmrulesAlarmIdOptions = {baseUrl?: string | undefined, esperCloudApiApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes alarm rule * * DELETE /v1/enterprise/{enterprise_id}/alarmrules/{alarm_id}/ */ export const deleteApiV1EnterpriseEnterpriseIdAlarmrulesAlarmId = async (args: DeleteApiV1EnterpriseEnterpriseIdAlarmrulesAlarmIdArgs, options?: DeleteApiV1EnterpriseEnterpriseIdAlarmrulesAlarmIdOptions) => { const {baseUrl = "https://develop-api.esper.cloud/api", fetch: fetchFn = fetch, esperCloudApiApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (esperCloudApiApiKey !== undefined) headers.set('authorization', `Bearer ${esperCloudApiApiKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/enterprise/${encodeURIComponent(String(args.enterprise_id))}/alarmrules/${encodeURIComponent(String(args.alarm_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 };