/** * 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 { ContactsInputPhoto, ContactsPhoto, ContactsPhotoList, CreatePhotosParams, DeletePhotoParams, DeletePhotosParams, LocatePhotoParams, SearchPhotosParams, UpdatePhoto2Body, UpdatePhoto2Params, UpdatePhotoBody, UpdatePhotoParams, UpdatePhotosParams, } from '../_models'; // --- header start // export const // --- title start getPhotos = // --- title end (axiosInstance: AxiosInstance = axios) => { // --- header end /** * @summary Remove the contact's photo link(s) */ const deletePhotos = ( contactId: string, params: DeletePhotosParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.delete(`/contacts/${contactId}/photos`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Search the contact's photo(s) */ const searchPhotos = ( contactId: string, params?: SearchPhotosParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/contacts/${contactId}/photos`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Link photo(s) with the contact */ const createPhotos = ( contactId: string, contactsInputPhoto: ContactsInputPhoto[], params?: CreatePhotosParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post( `/contacts/${contactId}/photos`, contactsInputPhoto, { ...options, params: { ...params, ...options?.params, }, }, ); }; /** * @summary Reset the contact's photos to fit given data set. */ const updatePhotos = ( contactId: string, contactsInputPhoto: ContactsInputPhoto[], params?: UpdatePhotosParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.put( `/contacts/${contactId}/photos`, contactsInputPhoto, { ...options, params: { ...params, ...options?.params, }, }, ); }; /** * @summary Remove the contact's photo */ const deletePhoto = ( contactId: string, etag: string, params?: DeletePhotoParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.delete(`/contacts/${contactId}/photos/${etag}`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Update the contact's photo link details */ const updatePhoto2 = ( contactId: string, etag: string, updatePhoto2Body: UpdatePhoto2Body, params?: UpdatePhoto2Params, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.patch( `/contacts/${contactId}/photos/${etag}`, updatePhoto2Body, { ...options, params: { ...params, ...options?.params, }, }, ); }; /** * @summary Update the contact's photo link details */ const updatePhoto = ( contactId: string, etag: string, updatePhotoBody: UpdatePhotoBody, params?: UpdatePhotoParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.put( `/contacts/${contactId}/photos/${etag}`, updatePhotoBody, { ...options, params: { ...params, ...options?.params, }, }, ); }; /** * @summary Locate the contact's photo link. */ const locatePhoto = ( contactId: string, id: string, params?: LocatePhotoParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/contacts/${contactId}/photos/${id}`, { ...options, params: { ...params, ...options?.params, }, }); }; // --- footer start return { deletePhotos, searchPhotos, createPhotos, updatePhotos, deletePhoto, updatePhoto2, updatePhoto, locatePhoto, }; }; export type DeletePhotosResult = AxiosResponse; export type SearchPhotosResult = AxiosResponse; export type CreatePhotosResult = AxiosResponse; export type UpdatePhotosResult = AxiosResponse; export type DeletePhotoResult = AxiosResponse; export type UpdatePhoto2Result = AxiosResponse; export type UpdatePhotoResult = AxiosResponse; export type LocatePhotoResult = AxiosResponse; // --- footer end