/** * 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 { ContactsInputLabel, ContactsLabelList, ContactsLabelTags, DeleteLabelsParams, GetLabelsParams, ListLabelsParams, MergeLabelsParams, ResetLabelsParams, } from '../_models'; // --- header start // export const // --- title start getLabels = // --- title end (axiosInstance: AxiosInstance = axios) => { // --- header end /** * @summary Search for Contacts engaged Label(s). */ const getLabels = ( params?: GetLabelsParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/contacts/labels`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Remove Contact Labels associations. */ const deleteLabels = ( contactId: string, params: DeleteLabelsParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.delete(`/contacts/${contactId}/labels`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Locate the Contact's associated Label(s). */ const listLabels = ( contactId: string, params?: ListLabelsParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/contacts/${contactId}/labels`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Associate NEW Labels to the Contact. */ const mergeLabels = ( contactId: string, contactsInputLabel: ContactsInputLabel[], params?: MergeLabelsParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post( `/contacts/${contactId}/labels`, contactsInputLabel, { ...options, params: { ...params, ...options?.params, }, }, ); }; /** * @summary Reset Labels to fit the specified final set. */ const resetLabels = ( contactId: string, contactsInputLabel: ContactsInputLabel[], params?: ResetLabelsParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.put( `/contacts/${contactId}/labels`, contactsInputLabel, { ...options, params: { ...params, ...options?.params, }, }, ); }; // --- footer start return { getLabels, deleteLabels, listLabels, mergeLabels, resetLabels, }; }; export type GetLabelsResult = AxiosResponse; export type DeleteLabelsResult = AxiosResponse; export type ListLabelsResult = AxiosResponse; export type MergeLabelsResult = AxiosResponse; export type ResetLabelsResult = AxiosResponse; // --- footer end