-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGroupClient.ts
More file actions
46 lines (40 loc) · 1.74 KB
/
GroupClient.ts
File metadata and controls
46 lines (40 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
import type { AccessToken } from "@itwin/core-bentley";
import type { BentleyAPIResponse, ODataQueryParams } from "../types/CommonApiTypes";
import type { Group, GroupsResponseWithConditionalLinks, SingleGroupResponse } from "../types/Groups";
export interface IGroupsClient {
/** Retrieves a list of groups the for a specified iTwin */
getITwinGroups<T extends Pick<ODataQueryParams, "top" | "skip"> | undefined = undefined>(
accessToken: AccessToken,
iTwinId: string,
arg?: T
): Promise<BentleyAPIResponse<GroupsResponseWithConditionalLinks<T>>>;
/** Retrieves a group for a specified iTwin */
getITwinGroup(
accessToken: AccessToken,
iTwinId: string,
groupId: string
): Promise<BentleyAPIResponse<SingleGroupResponse>>;
/** Creates a new iTwin group */
createITwinGroup(
accessToken: AccessToken,
iTwinId: string,
group: Pick<Group, "name" | "description">
): Promise<BentleyAPIResponse<SingleGroupResponse>>;
/** Removes an existing iTwin group */
deleteITwinGroup(
accessToken: AccessToken,
iTwinId: string,
groupId: string
): Promise<BentleyAPIResponse<undefined>>;
/** Updates an existing iTwin group */
updateITwinGroup(
accessToken: AccessToken,
iTwinId: string,
groupId: string,
group: Partial<Pick<Group, "name" | "description"> & { members: string[]; imsGroups: string[] }>
): Promise<BentleyAPIResponse<SingleGroupResponse>>;
}