/** * 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 { ContactsComment, ContactsCommentList, ContactsInputComment, DeleteCommentCommentsParams, PublishCommentCommentsParams, SearchCommentsParams, UpdateCommentCommentsBody, UpdateCommentCommentsParams, } from '../_models'; // --- header start // export const // --- title start getComments = // --- title end (axiosInstance: AxiosInstance = axios) => { // --- header end /** * @summary Search for Contact Comment(s) ... */ const searchComments = ( contactId: string, params?: SearchCommentsParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/contacts/${contactId}/comments`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Publish comment for a Contact. */ const publishCommentComments = ( contactId: string, contactsInputComment: ContactsInputComment, params?: PublishCommentCommentsParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post( `/contacts/${contactId}/comments`, contactsInputComment, { ...options, params: { ...params, ...options?.params, }, }, ); }; /** * @summary Delete Comment(s) for Contact ... */ const deleteCommentComments = ( contactId: string, etag: string[], params?: DeleteCommentCommentsParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.delete(`/contacts/${contactId}/comments/${etag}`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Update (edit) specific Comment text owned */ const updateCommentComments = ( contactId: string, etag: string, updateCommentCommentsBody: UpdateCommentCommentsBody, params?: UpdateCommentCommentsParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.put( `/contacts/${contactId}/comments/${etag}`, updateCommentCommentsBody, { ...options, params: { ...params, ...options?.params, }, }, ); }; // --- footer start return { searchComments, publishCommentComments, deleteCommentComments, updateCommentComments, }; }; export type SearchCommentsResult = AxiosResponse; export type PublishCommentCommentsResult = AxiosResponse; export type DeleteCommentCommentsResult = AxiosResponse; export type UpdateCommentCommentsResult = AxiosResponse; // --- footer end