/** * 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 { CreateServiceParams, ListServicesParams, LocateServiceParams, UpdateService2Params, UpdateServiceParams, WebitelCasesInputCreateService, WebitelCasesInputService, WebitelCasesLocateServiceResponse, WebitelCasesService, WebitelCasesServiceList, } from '../_models'; // --- header start // export const // --- title start getServices = // --- title end (axiosInstance: AxiosInstance = axios) => { // --- header end /** * @summary Retrieve a list of services or search services within a catalog */ const listServices = ( params?: ListServicesParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/cases/services`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Create a new service within a catalog */ const createService = ( webitelCasesInputCreateService: WebitelCasesInputCreateService, params?: CreateServiceParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post( `/cases/services`, webitelCasesInputCreateService, { ...options, params: { ...params, ...options?.params, }, }, ); }; /** * @summary Delete a service */ const deleteService = ( id: string[], options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.delete(`/cases/services/${id}`, options); }; /** * @summary Locate a service by ID */ const locateService = ( id: string, params?: LocateServiceParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/cases/services/${id}`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Update an existing service */ const updateService2 = ( id: string, webitelCasesInputService: WebitelCasesInputService, params?: UpdateService2Params, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.patch( `/cases/services/${id}`, webitelCasesInputService, { ...options, params: { ...params, ...options?.params, }, }, ); }; /** * @summary Update an existing service */ const updateService = ( id: string, webitelCasesInputService: WebitelCasesInputService, params?: UpdateServiceParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.put( `/cases/services/${id}`, webitelCasesInputService, { ...options, params: { ...params, ...options?.params, }, }, ); }; // --- footer start return { listServices, createService, deleteService, locateService, updateService2, updateService, }; }; export type ListServicesResult = AxiosResponse; export type CreateServiceResult = AxiosResponse; export type DeleteServiceResult = AxiosResponse; export type LocateServiceResult = AxiosResponse; export type UpdateService2Result = AxiosResponse; export type UpdateServiceResult = AxiosResponse; // --- footer end