/** * 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 { ContactsInputPhoneNumber, ContactsPhoneList, ContactsPhoneNumber, DeletePhoneParams, DeletePhonesParams, ListPhonesParams, LocatePhoneParams, MergePhonesParams, ResetPhonesParams, UpdatePhone2Body, UpdatePhone2Params, UpdatePhoneBody, UpdatePhoneParams, } from '../_models'; // --- header start // export const // --- title start getPhones = // --- title end (axiosInstance: AxiosInstance = axios) => { // --- header end /** * @summary Remove the Contact's phone number association(s) */ const deletePhones = ( contactId: string, params: DeletePhonesParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.delete(`/contacts/${contactId}/phones`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Search phone number(s) */ const listPhones = ( contactId: string, params?: ListPhonesParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/contacts/${contactId}/phones`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Associate phone number(s) with the Contact */ const mergePhones = ( contactId: string, contactsInputPhoneNumber: ContactsInputPhoneNumber[], params?: MergePhonesParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post( `/contacts/${contactId}/phones`, contactsInputPhoneNumber, { ...options, params: { ...params, ...options?.params, }, }, ); }; /** * @summary Reset the Contact's phone numbers to fit given data set. */ const resetPhones = ( contactId: string, contactsInputPhoneNumber: ContactsInputPhoneNumber[], params?: ResetPhonesParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.put( `/contacts/${contactId}/phones`, contactsInputPhoneNumber, { ...options, params: { ...params, ...options?.params, }, }, ); }; /** * @summary Remove the Contact's phone number */ const deletePhone = ( contactId: string, etag: string, params?: DeletePhoneParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.delete(`/contacts/${contactId}/phones/${etag}`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Locate the Contact's phone number association. */ const locatePhone = ( contactId: string, etag: string, params?: LocatePhoneParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/contacts/${contactId}/phones/${etag}`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Update the Contact's phone number association details */ const updatePhone2 = ( contactId: string, etag: string, updatePhone2Body: UpdatePhone2Body, params?: UpdatePhone2Params, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.patch( `/contacts/${contactId}/phones/${etag}`, updatePhone2Body, { ...options, params: { ...params, ...options?.params, }, }, ); }; /** * @summary Update the Contact's phone number association details */ const updatePhone = ( contactId: string, etag: string, updatePhoneBody: UpdatePhoneBody, params?: UpdatePhoneParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.put( `/contacts/${contactId}/phones/${etag}`, updatePhoneBody, { ...options, params: { ...params, ...options?.params, }, }, ); }; // --- footer start return { deletePhones, listPhones, mergePhones, resetPhones, deletePhone, locatePhone, updatePhone2, updatePhone, }; }; export type DeletePhonesResult = AxiosResponse; export type ListPhonesResult = AxiosResponse; export type MergePhonesResult = AxiosResponse; export type ResetPhonesResult = AxiosResponse; export type DeletePhoneResult = AxiosResponse; export type LocatePhoneResult = AxiosResponse; export type UpdatePhone2Result = AxiosResponse; export type UpdatePhoneResult = AxiosResponse; // --- footer end