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

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

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

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

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

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

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

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

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