/* eslint-disable */
// @ts-ignore
import request from '@/http/vue-query';
import { CustomRequestOptions } from '@/http/types';

import * as API from './types';

/** 获取字典类型列表 获取所有数据字典类型 GET /dictionary/types */
export async function dictionaryTypesUsingGet({
  options,
}: {
  options?: CustomRequestOptions;
}) {
  return request<
    API.Response & {
      data?: API.DictionaryType[];
    }
  >('/dictionary/types', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 创建字典类型 创建新的数据字典类型 POST /dictionary/types */
export async function dictionaryTypesUsingPost({
  body,
  options,
}: {
  body: API.CreateDictionaryTypeRequest;
  options?: CustomRequestOptions;
}) {
  return request<
    API.Response & {
      data?: API.DictionaryType;
    }
  >('/dictionary/types', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取字典类型详情 根据ID获取数据字典类型详情 GET /dictionary/types/${param0} */
export async function dictionaryTypesIdUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.dictionaryTypesIdUsingGetParams;
  options?: CustomRequestOptions;
}) {
  const { id: param0, ...queryParams } = params;

  return request<
    API.Response & {
      data?: API.DictionaryType;
    }
  >(`/dictionary/types/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 更新字典类型 根据ID更新数据字典类型 PUT /dictionary/types/${param0} */
export async function dictionaryTypesIdUsingPut({
  params,
  body,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.dictionaryTypesIdUsingPutParams;
  body: API.UpdateDictionaryTypeRequest;
  options?: CustomRequestOptions;
}) {
  const { id: param0, ...queryParams } = params;

  return request<
    API.Response & {
      data?: API.DictionaryType;
    }
  >(`/dictionary/types/${param0}`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}

/** 删除字典类型 根据ID删除数据字典类型 DELETE /dictionary/types/${param0} */
export async function dictionaryTypesIdUsingDelete({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.dictionaryTypesIdUsingDeleteParams;
  options?: CustomRequestOptions;
}) {
  const { id: param0, ...queryParams } = params;

  return request<
    API.Response & {
      data?: string;
    }
  >(`/dictionary/types/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}
