import { Logger } from 'winston'; import { IPermitConfig } from '../config'; import { ResourceActionGroupCreate, ResourceActionGroupRead, ResourceActionGroupUpdate } from '../openapi'; import { BasePermitApi, IPagination } from './base'; export { ResourceActionGroupCreate, ResourceActionGroupRead } from '../openapi'; export interface IListActionGroups extends IPagination { resourceKey: string; } /** * Interface representing the Resource Action Groups API. */ export interface IResourceActionGroupsApi { /** * Retrieves a list of all action groups that are defined for a given resource. * @param params - pagination and filtering params, @see {@link IListActionGroups} * @returns A promise that resolves to an array of ResourceActionGroupRead objects representing the action groups. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ list(params: IListActionGroups): Promise; /** * Retrieves an action group based on the resource key and the group key. * * @param resourceKey - The resource key. * @param groupKey - The group key. * @returns A promise that resolves to a ResourceActionGroupRead object representing the action group. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ get(resourceKey: string, groupKey: string): Promise; /** * Retrieves an action group based on the resource key and the group key. * Alias for the {@link get} method. * * @param resourceKey - The resource key. * @param groupKey - The group key. * @returns A promise that resolves to a ResourceActionGroupRead object representing the action group. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ getByKey(resourceKey: string, groupKey: string): Promise; /** * Retrieves an action group based on the resource ID and the group ID. * Alias for the {@link get} method. * * @param resourceId - The resource ID. * @param groupId - The group ID. * @returns A promise that resolves to a ResourceActionGroupRead object representing the action group. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ getById(resourceId: string, groupId: string): Promise; /** * Creates a new action group. * @param resourceKey - The resource key. * @param groupData - The action group data. * @returns A promise that resolves to a ResourceActionGroupRead object representing the created action group. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ create(resourceKey: string, groupData: ResourceActionGroupCreate): Promise; /** * Updates an action group. * @param resourceKey - The resource key. * @param groupKey - The group key. * @param groupData - The action group data. * @returns A promise that resolves to a ResourceActionGroupRead object representing the updated action group. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ update(resourceKey: string, groupKey: string, groupData: ResourceActionGroupUpdate): Promise; /** * Deletes a action group based on the resource key and group key. * @param resourceKey - The resource key. * @param groupKey - The group key. * @returns A promise that resolves when the action group is successfully deleted. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ delete(resourceKey: string, groupKey: string): Promise; } /** * API client for interacting with the Resource Action Groups API. */ export declare class ResourceActionGroupsApi extends BasePermitApi implements IResourceActionGroupsApi { private groupsApi; /** * Creates an instance of the ResourceActionGroupsApi. * @param config - The configuration object for the Permit SDK. * @param logger - The logger instance for logging. */ constructor(config: IPermitConfig, logger: Logger); /** * Retrieves a list of all action groups that are defined for a given resource. * @param params - pagination and filtering params, @see {@link IListActionGroups} * @returns A promise that resolves to an array of ResourceActionGroupRead objects representing the action groups. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ list(params: IListActionGroups): Promise; /** * Retrieves an action group based on the resource key and the group key. * * @param resourceKey - The resource key. * @param groupKey - The group key. * @returns A promise that resolves to a ResourceActionGroupRead object representing the action group. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ get(resourceKey: string, groupKey: string): Promise; /** * Retrieves an action group based on the resource key and the group key. * Alias for the {@link get} method. * * @param resourceKey - The resource key. * @param groupKey - The group key. * @returns A promise that resolves to a ResourceActionGroupRead object representing the action group. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ getByKey(resourceKey: string, groupKey: string): Promise; /** * Retrieves an action group based on the resource ID and the group ID. * Alias for the {@link get} method. * * @param resourceId - The resource ID. * @param groupId - The group ID. * @returns A promise that resolves to a ResourceActionGroupRead object representing the action group. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ getById(resourceId: string, groupId: string): Promise; /** * Creates a new action group. * @param resourceKey - The resource key. * @param groupData - The action group data. * @returns A promise that resolves to a ResourceActionGroupRead object representing the created action group. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ create(resourceKey: string, groupData: ResourceActionGroupCreate): Promise; /** * Updates an action group. * @param resourceKey - The resource key. * @param groupKey - The group key. * @param groupData - The action group data. * @returns A promise that resolves to a ResourceActionGroupRead object representing the updated action group. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ update(resourceKey: string, groupKey: string, groupData: ResourceActionGroupUpdate): Promise; /** * Deletes a action group based on the resource key and group key. * @param resourceKey - The resource key. * @param groupKey - The group key. * @returns A promise that resolves when the action group is successfully deleted. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ delete(resourceKey: string, groupKey: string): Promise; }