Package com.vonage.client.users
Class UsersClient
java.lang.Object
com.vonage.client.users.UsersClient
A client for talking to the Vonage Users API. The standard way to obtain an instance of
this class is to use
VonageClient.getUsersClient().-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateUser(User user) Create a new user.voiddeleteUser(String userId) Delete a user.Retrieve a user.getUserDetails(BaseUser minimalUser) Convenience method that uses the metadata from the base user object to obtain all known fields about the user.getUserDetails(List<BaseUser> minimalUsers) Convenience method that uses the metadata from the base users list to obtain all known fields about the users.Lists the first 100 users in the application, from newest to oldest.listUsers(ListUsersRequest request) Lists users in the application based on the filter criteria.updateUser(String userId, User user) Update an existing user.
-
Constructor Details
-
UsersClient
-
-
Method Details
-
createUser
Create a new user.- Parameters:
user- The properties for the user to be created with.- Returns:
- The user which has been created.
- Throws:
UsersResponseException- If there was an error processing the request.
-
updateUser
Update an existing user.- Parameters:
userId- Unique ID of the user to update.user- The properties for the user to be updated with.- Returns:
- The user which has been updated.
- Throws:
UsersResponseException- If there was an error processing the request.
-
getUser
Retrieve a user.- Parameters:
userId- Unique ID of the user to retrieve.- Returns:
- The corresponding user.
- Throws:
UsersResponseException- If there was an error processing the request.
-
deleteUser
Delete a user.- Parameters:
userId- Unique ID of the user to delete.- Throws:
UsersResponseException- If there was an error processing the request.
-
listUsers
Lists users in the application based on the filter criteria.- Parameters:
request- Optional parameters to customise the search results.- Returns:
- The HAL response containing the users.
- Throws:
UsersResponseException- If there was an error processing the request.
-
listUsers
Lists the first 100 users in the application, from newest to oldest.
NOTE: The users returned from this method will only contain the name and ID, not the full record.- Returns:
- The list of available users in creation order.
- Throws:
UsersResponseException- If there was an error processing the request.- See Also:
-
getUserDetails
Convenience method that uses the metadata from the base user object to obtain all known fields about the user.- Parameters:
minimalUser- The user metadata.- Returns:
- A new User object with all known fields populated.
- Throws:
UsersResponseException- If there was an error processing the request.
-
getUserDetails
Convenience method that uses the metadata from the base users list to obtain all known fields about the users. You may use this method to convert the minimal data returned fromlistUsers()orListUsersResponse.getUsers()into fully populated records.- Parameters:
minimalUsers- The list of users' metadata.- Returns:
- A list of users with all known fields populated in the same encounter order.
- Throws:
UsersResponseException- If there was an error processing the request.
-