// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 告警列表 */
export async function getAlarmRules(
  params: API.SearchAlarmRulesParams,
  options?: { [key: string]: any },
) {
  return request<API.Response & { data?: API.PageResult; msg?: string }>(
    `/api/warning_rule/`,
    {
      method: 'GET',
      headers: {
        'Content-Type': 'application/json',
      },
      params: {
        ...params,
      },
      ...(options || {}),
    },
  );
}

/** 更新告警列表 */
export async function postAlarmRules(
    body: API.UpdateAlarmRulesParams,
    options?: { [key: string]: any },
  ) {
    return request<API.Response & { data?: API.PageResult; msg?: string }>(
      `/api/warning_rule/`,
      {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
      },
    );
}
