import { type IOrganizationUser, type IOrganizationUserGroup, type IUser, type IUserGroup } from "@gooddata/sdk-model"; import { type IPagedResource } from "../../common/paging.js"; /** * This service provides access to organization users. * * @alpha */ export interface IOrganizationUserService { /** * Get user by ID. * * @param id - ID of the user. * * @returns promise */ getUser(id: string): Promise; /** * Creates a new user. * * @param user - user to create */ createUser(user: IUser): Promise; /** * Get user group by ID. * * @param id - ID of the user group. * * @returns promise */ getUserGroup(id: string): Promise; /** * Update user. * * @param user - The user that must be updated. * * @returns promise */ updateUser(user: IUser): Promise; /** * Create user group. * * @param group - The user group that must be created. * * @returns promise */ createUserGroup(group: IUserGroup): Promise; /** * Update user group. * * @param group - The user group that must be updated. * * @returns promise */ updateUserGroup(group: IUserGroup): Promise; /** * Delete users by ID. * * @param ids - ID of the user. * * @returns promise */ deleteUsers(ids: string[]): Promise; /** * Delete user groups by ID. * * @param ids - ID of the user group. * * @returns promise */ deleteUserGroups(ids: string[]): Promise; /** * Get list of users. * * @returns promise */ getUsers(): Promise; /** * Get list of users with basic information only. * * This method provides a lightweight alternative to {@link IOrganizationUserService.getUsers} * that fetches only basic user information (id, email, name) * * @returns promise */ getUsersSummary(): Promise; /** * Get user by email. * * @param email - email of the user. * * @returns promise of array of users */ getUsersByEmail(email: string): Promise; /** * List users. * * @returns promise */ getUsersQuery(): IOrganizationUsersQuery; /** * Get list of users groups. * * @returns promise */ getUserGroups(): Promise; /** * List user groups. * * @returns promise */ getUserGroupsQuery(): IOrganizationUserGroupsQuery; /** * Get groups assigned to the user. * * @param userId - ID of the user. * * @returns promise */ getUserGroupsOfUser(userId: string): Promise; /** * Get users assigned to the user group. * * @param userGroupId - ID of the user group. * * @returns promise */ getUsersOfUserGroup(userGroupId: string): Promise; /** * Add users to multiple user groups. * * @param userIds - IDs of the users that will be assigned to user groups. * @param userGroupIds - IDs of the users groups to which user will be assigned. * * @returns promise */ addUsersToUserGroups(userIds: string[], userGroupIds: string[]): Promise; /** * Remove users from user groups. * * @param userIds - IDs of the users. * @param userGroupIds - IDs of the user groups. * * @returns promise */ removeUsersFromUserGroups(userIds: string[], userGroupIds: string[]): Promise; } /** * Service to query valid filter elements for particular filter. * * @public */ export interface IOrganizationUsersQuery { /** * Sets number of users to return per page. * Default size is specific per backend * * @param size - desired max number of organization users per page; must be a positive number * @returns organization users query */ withSize(size: number): IOrganizationUsersQuery; /** * Sets starting page for the query. Backend WILL return no data if the page is greater than * total number of pages. * Default page: 0 * * @param page - zero indexed, must be non-negative * @returns organization users query */ withPage(page: number): IOrganizationUsersQuery; /** * Sets filter for the query. * * @param filter - filter to apply * @returns organization users query */ withFilter(filter: { workspace?: string; group?: string; name?: string; dataSource?: string; email?: string; }): IOrganizationUsersQuery; /** * Starts the organization users query. * * @returns promise of first page of the results */ query(): Promise; } /** * Paged result of organization users query. Last page of data returns empty items. * * @public */ export type IOrganizationUsersQueryResult = IPagedResource; /** * Service to query valid filter elements for particular filter. * * @public */ export interface IOrganizationUserGroupsQuery { /** * Sets number of users to return per page. * Default size is specific per backend * * @param size - desired max number of organization users per page; must be a positive number * @returns organization users query */ withSize(size: number): IOrganizationUserGroupsQuery; /** * Sets starting page for the query. Backend WILL return no data if the page is greater than * total number of pages. * Default page: 0 * * @param page - zero indexed, must be non-negative * @returns organization users query */ withPage(page: number): IOrganizationUserGroupsQuery; /** * Sets filter for the query. * * @param filter - filter to apply * @returns organization user groups query */ withFilter(filter: { workspace?: string; group?: string; name?: string; dataSource?: string; }): IOrganizationUserGroupsQuery; /** * Starts the organization users query. * * @returns promise of first page of the results */ query(): Promise; } /** * Paged result of organization users query. Last page of data returns empty items. * * @public */ export type IOrganizationUserGroupsQueryResult = IPagedResource; //# sourceMappingURL=index.d.ts.map