/** * 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 { LinkCommunicationParams, ListCommunicationsParams, UnlinkCommunicationParams, WebitelCasesInputCaseCommunication, WebitelCasesLinkCommunicationResponse, WebitelCasesListCommunicationsResponse, WebitelCasesUnlinkCommunicationResponse, } from '../_models'; // --- header start // export const // --- title start getCaseCommunications = // --- title end (axiosInstance: AxiosInstance = axios) => { // --- header end /** * @summary Lists all communications linked to a specific case. Currently a feature for future development. */ const listCommunications = ( caseEtag: string, params?: ListCommunicationsParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/cases/${caseEtag}/communication`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Links a communication to a specific case. */ const linkCommunication = ( caseEtag: string, webitelCasesInputCaseCommunication: WebitelCasesInputCaseCommunication, params?: LinkCommunicationParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post( `/cases/${caseEtag}/communication`, webitelCasesInputCaseCommunication, { ...options, params: { ...params, ...options?.params, }, }, ); }; /** * @summary Unlinks a communication from a specific case. */ const unlinkCommunication = ( caseEtag: string, id: string, params?: UnlinkCommunicationParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.delete(`/cases/${caseEtag}/communication/${id}`, { ...options, params: { ...params, ...options?.params, }, }); }; // --- footer start return { listCommunications, linkCommunication, unlinkCommunication, }; }; export type ListCommunicationsResult = AxiosResponse; export type LinkCommunicationResult = AxiosResponse; export type UnlinkCommunicationResult = AxiosResponse; // --- footer end