/** * 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 { AccessStoreToggleDefaultAccessBody, ApiGrantAccessRequestV1, ApiListAccessResponseV1, ApiToggleDefaultAccessResponse, ApiUpdateAccessResponseV1, ListDefaultAccessParams, ListObjectAccessParams, } from '../_models'; // --- header start // export const // --- title start getAccessStore = // --- title end (axiosInstance: AxiosInstance = axios) => { // --- header end /** * @summary default: TODO: indicate objclass=default as a default rights repo */ const listDefaultAccess = ( params?: ListDefaultAccessParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/acl/object.name}/object.id}`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Same as UpdateAccess except for DEFAULT access control system */ const toggleDefaultAccess = ( grantor: string, accessStoreToggleDefaultAccessBody: AccessStoreToggleDefaultAccessBody, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.patch( `/acl/object.name}/object.id}/grantor/${grantor}`, accessStoreToggleDefaultAccessBody, options, ); }; const listObjectAccess = ( params?: ListObjectAccessParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/object.name}/object.id}/acl`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary TODO: replace with GrantAccess API, to become command like GRANT REVOKE ... with empty access rights string */ const toggleObjectAccess = ( apiGrantAccessRequestV1: ApiGrantAccessRequestV1[], options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.patch( `/object.name}/object.id}/acl`, apiGrantAccessRequestV1, options, ); }; // --- footer start return { listDefaultAccess, toggleDefaultAccess, listObjectAccess, toggleObjectAccess, }; }; export type ListDefaultAccessResult = AxiosResponse; export type ToggleDefaultAccessResult = AxiosResponse; export type ListObjectAccessResult = AxiosResponse; export type ToggleObjectAccessResult = AxiosResponse; // --- footer end