UNPKG

@itwin/access-control-client

Version:

Access control client for the iTwin platform

54 lines 2.69 kB
/** @packageDocumentation * @module AccessControlClient */ import type { AccessToken } from "@itwin/core-bentley"; import type { IGroupsClient } from "../accessControlClientInterfaces/GroupClient"; import type { BentleyAPIResponse } from "../types/CommonApiTypes"; import type { Group, MultipleGroupsResponse, SingleGroupResponse } from "../types/Groups"; import { BaseClient } from "./BaseClient"; /** Client API to perform iTwin group operations. */ export declare class GroupsClient extends BaseClient implements IGroupsClient { /** Create a new GroupsClient instance * @param url Optional base URL for the access control service. If not provided, defaults to base url. */ constructor(url?: string); /** Retrieves a list of available user roles that are defined for a specified iTwin * @param accessToken The client access token string * @param iTwinId The id of the iTwin * @returns Group[] */ getITwinGroups(accessToken: AccessToken, iTwinId: string): Promise<BentleyAPIResponse<MultipleGroupsResponse>>; /** Retrieves the specified role for the specified iTwin * @param accessToken The client access token string * @param iTwinId The id of the iTwin * @returns Group */ getITwinGroup(accessToken: AccessToken, iTwinId: string, groupId: string): Promise<BentleyAPIResponse<SingleGroupResponse>>; /** Creates a new iTwin group * @param accessToken The client access token string * @param iTwinId The id of the iTwin * @param group The group to be created * @returns Group */ createITwinGroup(accessToken: AccessToken, iTwinId: string, group: Pick<Group, "name" | "description">): Promise<BentleyAPIResponse<SingleGroupResponse>>; /** Delete the specified iTwin group * @param accessToken The client access token string * @param iTwinId The id of the iTwin * @param groupId The id of the group to remove * @returns No Content */ deleteITwinGroup(accessToken: AccessToken, iTwinId: string, groupId: string): Promise<BentleyAPIResponse<undefined>>; /** Update the specified iTwin group * @param accessToken The client access token string * @param iTwinId The id of the iTwin * @param groupId The id of the role to update * @param group The updated group * @returns Group that was updated */ updateITwinGroup(accessToken: AccessToken, iTwinId: string, groupId: string, group: Partial<Pick<Group, "name" | "description"> & { members: string[]; imsGroups: string[]; }>): Promise<BentleyAPIResponse<SingleGroupResponse>>; } //# sourceMappingURL=GroupsClient.d.ts.map