// @ts-ignore
/* eslint-disable */
import request from "../request";

/** 创建协议 POST /operation/createAgreement */
export async function createAgreement(
  body: BusinessAPI.AgreementCreateCmd,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.SingleResponseAgreementVO>(
    "/operation/createAgreement",
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** 协议删除 DELETE /operation/destroyAgreement */
export async function destroyAgreement(
  body: BusinessAPI.AgreementDestroyCmd,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.Response>("/operation/destroyAgreement", {
    method: "DELETE",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 协议列表 GET /operation/listAgreement */
export async function listAgreement(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: BusinessAPI.listAgreementParams,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.MultiResponseAgreementVO>(
    "/operation/listAgreement",
    {
      method: "GET",
      params: {
        ...params,
        agreementListQry: undefined,
        ...params["agreementListQry"],
      },
      ...(options || {}),
    },
  );
}

/** 协议列表 GET /operation/pageAgreement */
export async function pageAgreement(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: BusinessAPI.pageAgreementParams,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.PageResponseAgreementVO>(
    "/operation/pageAgreement",
    {
      method: "GET",
      params: {
        ...params,
        agreementPageQry: undefined,
        ...params["agreementPageQry"],
      },
      ...(options || {}),
    },
  );
}

/** 协议详情 GET /operation/showAgreement */
export async function showAgreement(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: BusinessAPI.showAgreementParams,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.SingleResponseAgreementVO>(
    "/operation/showAgreement",
    {
      method: "GET",
      params: {
        ...params,
        agreementShowQry: undefined,
        ...params["agreementShowQry"],
      },
      ...(options || {}),
    },
  );
}

/** 协议更新 PUT /operation/updateAgreement */
export async function updateAgreement(
  body: BusinessAPI.AgreementUpdateCmd,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.SingleResponseAgreementVO>(
    "/operation/updateAgreement",
    {
      method: "PUT",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** 协议更新 PATCH /operation/updateAgreement */
export async function updateAgreement1(
  body: BusinessAPI.AgreementUpdateCmd,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.SingleResponseAgreementVO>(
    "/operation/updateAgreement",
    {
      method: "PATCH",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    },
  );
}
