Interface UserApi
public interface UserApi
Contains all api operations for handling users.
-
Method Summary
Modifier and TypeMethodDescriptionaddUser
(AddUserRequest addUserRequest) Adds a new user.addUsers
(List<AddUserRequest> addUserRequests) Adds new users.addUserToUserGroups
(AddUserToUserGroupsRequest addUserToUserGroupsRequest) Adds user to given user groups.changeUser
(ChangeUserRequest changeUserRequest) Change the user with the information present in the input.changeUserAvatar
(ChangeUserAvatarRequest changeUserAvatarRequest) Change the avatar for the given user.boolean
Returns true if a user with givenuserId
exists.findUsers
(FindUsersRequest findUsersRequest) Returns users matching the given input.Returns the currently logged in user.Returns the user with the given id.getUserByEmailAddress
(String emailAddress) Deprecated, for removal: This API element is subject to removal in a future version.this method will be removed.getUserByUsername
(String username) Returns user with given username.getUserRequiredLicenseType
(UUID userId) Deprecated, for removal: This API element is subject to removal in a future version.This returns the pricebook version 3 required license type.void
removeAvatar
(UUID userId) Remove the avatar of the given user.void
removeUser
(UUID userId) Remove the user with the given ID.void
removeUserFromUserGroups
(RemoveUserFromUserGroupsRequest removeUserFromUserGroupsRequest) Remove user from given user groups.setGroupsForUser
(SetUserGroupsForUserRequest setUserGroupsForUserRequest) Sets the list of user groups this user should belong to.
-
Method Details
-
addUser
Adds a new user. The username can contain only unicode printable characters and cannot contain leading and trailing spaces.- Parameters:
addUserRequest
- the properties of the user to be added- Returns:
- the newly added user
-
addUsers
@SecurityAuditMethod(resultFormatter=com.collibra.audit.formatter.CollectionCountFormatter.class) List<User> addUsers(List<AddUserRequest> addUserRequests) Adds new users. The username can contain only unicode printable characters and cannot contain leading and trailing spaces.- Parameters:
addUserRequests
- the properties of users to be added- Returns:
- the newly added users
-
getUser
@SecurityAuditMethod(resultFormatter=com.collibra.dgc.core.api.internal.security.audit.formatter.ApiUserFormatter.class) User getUser(UUID userId) Returns the user with the given id.- Parameters:
userId
- the id of the user- Returns:
- the found user
-
getUserByEmailAddress
@SecurityAuditMethod(resultFormatter=com.collibra.dgc.core.api.internal.security.audit.formatter.ApiUserFormatter.class) @Deprecated(forRemoval=true) User getUserByEmailAddress(String emailAddress) Deprecated, for removal: This API element is subject to removal in a future version.this method will be removed. UsefindUsers(FindUsersRequest)
(com.collibra.dgc.core.api.component.user.UserApi instead.)}Returns user with given email address. This method should not be used when multiple users have the same email.- Parameters:
emailAddress
- email address of the user- Returns:
- user with given email address
-
getUserByUsername
@SecurityAuditMethod(resultFormatter=com.collibra.dgc.core.api.internal.security.audit.formatter.ApiUserFormatter.class) User getUserByUsername(String username) Returns user with given username.- Parameters:
username
- Username of the user- Returns:
- user with given username
-
getCurrentUser
Returns the currently logged in user.- Returns:
- The currently logged in user or empty Optional object if not logged in.
-
findUsers
@SecurityAuditMethod(resultFormatter=com.collibra.dgc.core.api.internal.security.audit.formatter.PagedResponseCountFormatter.class) PagedResponse<User> findUsers(FindUsersRequest findUsersRequest) Returns users matching the given input.- Parameters:
findUsersRequest
- specified inputs in order to search for users- Returns:
- the list with found users
-
exists
Returns true if a user with givenuserId
exists.- Parameters:
userId
- the ID of the user being tested- Returns:
- true if a user with given
userId
exists
-
changeUser
@SecurityAuditMethod(resultFormatter=com.collibra.dgc.core.api.internal.security.audit.formatter.ApiUserFormatter.class) User changeUser(ChangeUserRequest changeUserRequest) Change the user with the information present in the input. The username can contain only unicode printable characters and cannot contain leading and trailing spaces.- Parameters:
changeUserRequest
- changes that need to be performed on the user- Returns:
- the changed user
-
changeUserAvatar
@SecurityAuditMethod(resultFormatter=com.collibra.dgc.core.api.internal.security.audit.formatter.ApiUserFormatter.class) User changeUserAvatar(ChangeUserAvatarRequest changeUserAvatarRequest) Change the avatar for the given user.- Parameters:
changeUserAvatarRequest
- the request containing all the necessary information for the change.- Returns:
- the changed user.
-
removeAvatar
Remove the avatar of the given user.- Parameters:
userId
- the user ID for whom the avatar will be removed
-
removeUser
Remove the user with the given ID.- Parameters:
userId
- The ID of the user that will be removed.
-
setGroupsForUser
@SecurityAuditMethod(resultFormatter=com.collibra.dgc.core.api.internal.security.audit.formatter.ApiUserFormatter.class) User setGroupsForUser(SetUserGroupsForUserRequest setUserGroupsForUserRequest) Sets the list of user groups this user should belong to.If user belongs to any user groups that are not specified in this request then it will be removed from those groups after request is executed.
- Parameters:
setUserGroupsForUserRequest
- the list of user groups that this user should belong to- Returns:
- the user
-
removeUserFromUserGroups
Remove user from given user groups.- Parameters:
removeUserFromUserGroupsRequest
- the properties needed to remove the user from given user groups
-
addUserToUserGroups
@SecurityAuditMethod(resultFormatter=com.collibra.audit.formatter.CollectionCountFormatter.class) List<UserGroup> addUserToUserGroups(AddUserToUserGroupsRequest addUserToUserGroupsRequest) Adds user to given user groups.- Parameters:
addUserToUserGroupsRequest
- the properties needed to add the user to given user groups- Returns:
- the list of user groups the user has been assigned to
-
getUserRequiredLicenseType
Deprecated, for removal: This API element is subject to removal in a future version.This returns the pricebook version 3 required license type. A public API is not available for later pricebook versions.Get the pricebook version 3 required license type for the user.The required LicenseType is the maximum license type of any permission included in a global role or resource role of that user (or group of that user). Returns a value if on pricebook v3, otherwise returns null.
- Parameters:
userId
- the id of the user- Returns:
- the required LicenseType, or
null
-