/** * 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 { CreateSLAParams, ListSLAsParams, LocateSLAParams, UpdateSLA2Params, UpdateSLAParams, WebitelCasesInputSLA, WebitelCasesInputSLABody, WebitelCasesLocateSLAResponse, WebitelCasesSLA, WebitelCasesSLAList, } from '../_models'; // --- header start // export const // --- title start getSlas = // --- title end (axiosInstance: AxiosInstance = axios) => { // --- header end /** * @summary Retrieve a list of SLAs or search SLA conditions */ const listSLAs = ( params?: ListSLAsParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/cases/slas`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Create a new SLA */ const createSLA = ( webitelCasesInputSLABody: WebitelCasesInputSLABody, params?: CreateSLAParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post(`/cases/slas`, webitelCasesInputSLABody, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Delete an SLA */ const deleteSLA = ( id: string, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.delete(`/cases/slas/${id}`, options); }; /** * @summary Locate an SLA by ID */ const locateSLA = ( id: string, params?: LocateSLAParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/cases/slas/${id}`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Update an existing SLA */ const updateSLA2 = ( id: string, webitelCasesInputSLA: WebitelCasesInputSLA, params?: UpdateSLA2Params, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.patch(`/cases/slas/${id}`, webitelCasesInputSLA, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Update an existing SLA */ const updateSLA = ( id: string, webitelCasesInputSLA: WebitelCasesInputSLA, params?: UpdateSLAParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.put(`/cases/slas/${id}`, webitelCasesInputSLA, { ...options, params: { ...params, ...options?.params, }, }); }; // --- footer start return { listSLAs, createSLA, deleteSLA, locateSLA, updateSLA2, updateSLA, }; }; export type ListSLAsResult = AxiosResponse; export type CreateSLAResult = AxiosResponse; export type DeleteSLAResult = AxiosResponse; export type LocateSLAResult = AxiosResponse; export type UpdateSLA2Result = AxiosResponse; export type UpdateSLAResult = AxiosResponse; // --- footer end