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

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

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

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

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

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

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

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

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

/** 根据id获取所有的版本 POST /algorithm_model/getAllVersionsById */
export async function postAlgorithmModelGetAllVersionsById(
    body: API.GetById,
    options?: { [key: string]: any },
) {
    return request<API.Response & { data?: API.ResourceModelVersionFkSelectResponse }>(
        `/api/v1/algorithm_model/getAllVersionsById`,
        {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
            },
            data: body,
            ...(options || {}),
        },
    );
}
