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

/** 创建基础DeviceGroup POST /device_group/createDeviceGroup */
export async function postDeviceGroupCreateDeviceGroup(
  body: API.DeviceGroup,
  options?: { [key: string]: any },
) {
  return request<API.Response & { msg?: string }>(`/api/v1/device_group/createDeviceGroup`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除DeviceGroup DELETE /device_group/deleteDeviceGroup */
export async function deleteDeviceGroupDeleteDeviceGroup(
  body: API.DeviceGroup,
  options?: { [key: string]: any },
) {
  return request<API.Response & { msg?: string }>(`/api/v1/device_group/deleteDeviceGroup`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除选中DeviceGroup DELETE /device_group/deleteDeviceGroupByIds */
export async function deleteDeviceGroupDeleteDeviceGroupByIds(
  body: API.IdsReq,
  options?: { [key: string]: any },
) {
  return request<API.Response & { msg?: string }>(`/api/v1/device_group/deleteDeviceGroupByIds`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 根据id获取DeviceGroup POST /device_group/getDeviceGroupById */
export async function postDeviceGroupGetDeviceGroupById(
  body: API.GetById,
  options?: { [key: string]: any },
) {
  return request<API.Response & { data?: API.DeviceDeviceGroupResponse }>(
    `/api/v1/device_group/getDeviceGroupById`,
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** 获取DeviceGroup外键列表 POST /device_group/getDeviceGroupFkSelect */
export async function postDeviceGroupGetDeviceGroupFkSelect(
  body: API.GetFkSelect,
  options?: { [key: string]: any },
) {
  return request<API.Response & { data?: API.FkResult; msg?: string }>(
    `/api/v1/device_group/getDeviceGroupFkSelect`,
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** 分页获取DeviceGroup列表 POST /device_group/getDeviceGroupList */
export async function postDeviceGroupGetDeviceGroupList(
  body: API.SearchDeviceGroupParams,
  options?: { [key: string]: any },
) {
  return request<API.Response & { data?: API.PageResult; msg?: string }>(
    `/api/v1/device_group/getDeviceGroupList`,
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** 获得DeviceGroup名称列表 POST /device_group/getDeviceGroupNames */
export async function postDeviceGroupGetDeviceGroupNames(
  body: API.IdsReq,
  options?: { [key: string]: any },
) {
  return request<API.Response & { data?: API.NamesResult; msg?: string }>(
    `/api/v1/device_group/getDeviceGroupNames`,
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** 获取设备组树 POST /device_group/getDeviceGroupTree */
export async function postDeviceGroupGetDeviceGroupTree(options?: { [key: string]: any }) {
  return request<API.Response & { data?: API.TreeResponse; msg?: string }>(
    `/api/v1/device_group/getDeviceGroupTree`,
    {
      method: 'POST',
      ...(options || {}),
    },
  );
}

/** 修改基础DeviceGroup PUT /device_group/updateDeviceGroup */
export async function putDeviceGroupUpdateDeviceGroup(
  body: API.DeviceGroup,
  options?: { [key: string]: any },
) {
  return request<API.Response & { msg?: string }>(`/api/v1/device_group/updateDeviceGroup`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
