/** * Generated by orval v8.19.0 🍺 * Do not edit manually. * Webitel API * OpenAPI spec version: 24.04.0 */ import axios from '@aliasedDeps/api-services/axios'; import type { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'; import type { CreateCatalogParams, ListCatalogsParams, LocateCatalogParams, UpdateCatalog2Params, UpdateCatalogParams, WebitelCasesCatalog, WebitelCasesCatalogList, WebitelCasesInputCatalog, WebitelCasesLocateCatalogResponse, } from '../_models'; // --- header start // export const // --- title start getCatalogs = // --- title end (axiosInstance: AxiosInstance = axios) => { // --- header end /** * @summary Retrieve a list of catalogs or search catalogs */ const listCatalogs = ( params?: ListCatalogsParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/cases/catalogs`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Create a new catalog */ const createCatalog = ( webitelCasesInputCatalog: WebitelCasesInputCatalog, params?: CreateCatalogParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post(`/cases/catalogs`, webitelCasesInputCatalog, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Delete a catalog */ const deleteCatalog = ( id: string[], options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.delete(`/cases/catalogs/${id}`, options); }; /** * @summary Locate a catalog by ID */ const locateCatalog = ( id: string, params?: LocateCatalogParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/cases/catalogs/${id}`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Update an existing catalog */ const updateCatalog2 = ( id: string, webitelCasesInputCatalog: WebitelCasesInputCatalog, params?: UpdateCatalog2Params, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.patch( `/cases/catalogs/${id}`, webitelCasesInputCatalog, { ...options, params: { ...params, ...options?.params, }, }, ); }; /** * @summary Update an existing catalog */ const updateCatalog = ( id: string, webitelCasesInputCatalog: WebitelCasesInputCatalog, params?: UpdateCatalogParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.put( `/cases/catalogs/${id}`, webitelCasesInputCatalog, { ...options, params: { ...params, ...options?.params, }, }, ); }; // --- footer start return { listCatalogs, createCatalog, deleteCatalog, locateCatalog, updateCatalog2, updateCatalog, }; }; export type ListCatalogsResult = AxiosResponse; export type CreateCatalogResult = AxiosResponse; export type DeleteCatalogResult = AxiosResponse; export type LocateCatalogResult = AxiosResponse; export type UpdateCatalog2Result = AxiosResponse; export type UpdateCatalogResult = AxiosResponse; // --- footer end