/** * 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 { AddContactLanguagesParams, ContactsInputLanguage, ContactsLanguage, ContactsLanguageList, DelContactLanguageParams, DelContactLanguagesParams, GetContactLanguagesParams, SetContactLanguage2Body, SetContactLanguage2Params, SetContactLanguageBody, SetContactLanguageParams, SetContactLanguagesParams, } from '../_models'; // --- header start // export const // --- title start getLanguages = // --- title end (axiosInstance: AxiosInstance = axios) => { // --- header end /** * @summary Remove the Contact's language association(s). */ const delContactLanguages = ( contactId: string, params: DelContactLanguagesParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.delete(`/contacts/${contactId}/languages`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary List of the Contact's language association(s). */ const getContactLanguages = ( contactId: string, params?: GetContactLanguagesParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/contacts/${contactId}/languages`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Associate more language(s) with the Contact. */ const addContactLanguages = ( contactId: string, contactsInputLanguage: ContactsInputLanguage[], params?: AddContactLanguagesParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post( `/contacts/${contactId}/languages`, contactsInputLanguage, { ...options, params: { ...params, ...options?.params, }, }, ); }; /** * @summary Reset all Contact's languages to fit the specified fixed set. */ const setContactLanguages = ( contactId: string, contactsInputLanguage: ContactsInputLanguage[], params?: SetContactLanguagesParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.put( `/contacts/${contactId}/languages`, contactsInputLanguage, { ...options, params: { ...params, ...options?.params, }, }, ); }; /** * @summary Remove the Contact's language association. */ const delContactLanguage = ( contactId: string, etag: string, params?: DelContactLanguageParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.delete( `/contacts/${contactId}/languages/${etag}`, { ...options, params: { ...params, ...options?.params, }, }, ); }; /** * @summary Update the Contact's language association details. */ const setContactLanguage2 = ( contactId: string, etag: string, setContactLanguage2Body: SetContactLanguage2Body, params?: SetContactLanguage2Params, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.patch( `/contacts/${contactId}/languages/${etag}`, setContactLanguage2Body, { ...options, params: { ...params, ...options?.params, }, }, ); }; /** * @summary Update the Contact's language association details. */ const setContactLanguage = ( contactId: string, etag: string, setContactLanguageBody: SetContactLanguageBody, params?: SetContactLanguageParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.put( `/contacts/${contactId}/languages/${etag}`, setContactLanguageBody, { ...options, params: { ...params, ...options?.params, }, }, ); }; // --- footer start return { delContactLanguages, getContactLanguages, addContactLanguages, setContactLanguages, delContactLanguage, setContactLanguage2, setContactLanguage, }; }; export type DelContactLanguagesResult = AxiosResponse; export type GetContactLanguagesResult = AxiosResponse; export type AddContactLanguagesResult = AxiosResponse; export type SetContactLanguagesResult = AxiosResponse; export type DelContactLanguageResult = AxiosResponse; export type SetContactLanguage2Result = AxiosResponse; export type SetContactLanguageResult = AxiosResponse; // --- footer end