/** * 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 { CreateCaseParams, DeleteCaseParams, ExportCases200, ExportCasesParams, LocateCaseParams, SearchCases2Params, SearchCasesParams, UpdateCase2Body, UpdateCase2Params, UpdateCaseBody, UpdateCaseParams, WebitelCasesCase, WebitelCasesCaseList, WebitelCasesInputCreateCase, WebitelCasesUpdateCaseResponse, } from '../_models'; // --- header start // export const // --- title start getCases = // --- title end (axiosInstance: AxiosInstance = axios) => { // --- header end /** * @summary RPC method for searching cases. */ const searchCases = ( params?: SearchCasesParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/cases`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary RPC method for creating a new case. */ const createCase = ( webitelCasesInputCreateCase: WebitelCasesInputCreateCase, params?: CreateCaseParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post(`/cases`, webitelCasesInputCreateCase, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary RPC method for exporting cases to CSV or XLSX format (server-side streaming). */ const exportCases = ( params?: ExportCasesParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/cases/export`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary RPC method for deleting an existing case by its etag. */ const deleteCase = ( etag: string, params?: DeleteCaseParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.delete(`/cases/${etag}`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary RPC method to retrieve a specific case by its etag identifier. */ const locateCase = ( etag: string, params?: LocateCaseParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/cases/${etag}`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary RPC method for updating an existing case. */ const updateCase2 = ( updateCase2Body: UpdateCase2Body, params?: UpdateCase2Params, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.patch(`/cases/input.etag}`, updateCase2Body, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary RPC method for updating an existing case. */ const updateCase = ( updateCaseBody: UpdateCaseBody, params?: UpdateCaseParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.put(`/cases/input.etag}`, updateCaseBody, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary RPC method for searching cases. */ const searchCases2 = ( contactId: string, params?: SearchCases2Params, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/contacts/${contactId}/cases`, { ...options, params: { ...params, ...options?.params, }, }); }; // --- footer start return { searchCases, createCase, exportCases, deleteCase, locateCase, updateCase2, updateCase, searchCases2, }; }; export type SearchCasesResult = AxiosResponse; export type CreateCaseResult = AxiosResponse; export type ExportCasesResult = AxiosResponse; export type DeleteCaseResult = AxiosResponse; export type LocateCaseResult = AxiosResponse; export type UpdateCase2Result = AxiosResponse; export type UpdateCaseResult = AxiosResponse; export type SearchCases2Result = AxiosResponse; // --- footer end