Interface UserResources
-
public interface UserResources
This interface provides methods to access User resources.
Thread Safety: Implementation of this interface must be thread safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<AlternateEmail>
addAlternateEmail(long userId, java.util.List<AlternateEmail> altEmails)
Add an alternate email.User
addProfileImage(long userId, java.lang.String file, java.lang.String fileType)
Uploads a profile image for the specified user.User
addUser(User user)
Add a user to the organization, without sending email.User
addUser(User user, boolean sendEmail)
Add a user to the organization, without sending email.void
deleteAlternateEmail(long userId, long altEmailId)
Delete an alternate email.void
deleteUser(long id, DeleteUserParameters parameters)
Delete a user in the organization.AlternateEmail
getAlternateEmail(long userId, long altEmailId)
Get alternate email.UserProfile
getCurrentUser()
Get the current user.UserProfile
getCurrentUser(java.util.EnumSet<UserInclusion> includes)
Get the current user.UserProfile
getUser(long userId)
Get the current user.PagedResult<AlternateEmail>
listAlternateEmails(long userId, PaginationParameters pagination)
List all user alternate email(s).PagedResult<Sheet>
listOrgSheets(PaginationParameters pagination)
List all organisation sheets.PagedResult<Sheet>
listOrgSheets(PaginationParameters pagination, java.util.Date modifiedSince)
List all organisation sheets.PagedResult<User>
listUsers()
List all users.PagedResult<User>
listUsers(java.util.Set<java.lang.String> email, PaginationParameters pagination)
List all users.PagedResult<User>
listUsers(java.util.Set<java.lang.String> email, java.util.EnumSet<ListUserInclusion> includes, PaginationParameters pagination)
List all users.AlternateEmail
promoteAlternateEmail(long userId, long altEmailId)
Promote and alternate email to primary.User
updateUser(User user)
Update a user.
-
-
-
Method Detail
-
listUsers
PagedResult<User> listUsers() throws SmartsheetException
List all users.
It mirrors to the following Smartsheet REST API method: GET /users
- Returns:
- the list of all users
- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
listUsers
PagedResult<User> listUsers(java.util.Set<java.lang.String> email, PaginationParameters pagination) throws SmartsheetException
List all users.
It mirrors to the following Smartsheet REST API method: GET /users
- Parameters:
email
- the list of email addressespagination
- object containing pagination query parameters- Returns:
- the list of all users
- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
listUsers
PagedResult<User> listUsers(java.util.Set<java.lang.String> email, java.util.EnumSet<ListUserInclusion> includes, PaginationParameters pagination) throws SmartsheetException
List all users.
It mirrors to the following Smartsheet REST API method: GET /users
- Parameters:
email
- the list of email addressesincludes
- elements to include in responsepagination
- object containing pagination query parameters- Returns:
- the list of all users
- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
addUser
User addUser(User user) throws SmartsheetException
Add a user to the organization, without sending email.
It mirrors to the following Smartsheet REST API method: POST /users
- Parameters:
user
- the user object- Returns:
- the user
- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
addUser
User addUser(User user, boolean sendEmail) throws SmartsheetException
Add a user to the organization, without sending email.
It mirrors to the following Smartsheet REST API method: POST /users
- Parameters:
user
- the usersendEmail
- the send email flag- Returns:
- the user
- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
getUser
UserProfile getUser(long userId) throws SmartsheetException
Get the current user.
It mirrors to the following Smartsheet REST API method: GET /users/{userId}
- Parameters:
userId
- the user id- Returns:
- the current user
- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
getCurrentUser
UserProfile getCurrentUser() throws SmartsheetException
Get the current user.
It mirrors to the following Smartsheet REST API method: GET /user/me
- Returns:
- the current user
- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
getCurrentUser
UserProfile getCurrentUser(java.util.EnumSet<UserInclusion> includes) throws SmartsheetException
Get the current user.
It mirrors to the following Smartsheet REST API method: GET /user/me
- Parameters:
includes
- used to specify the optional objects to include.- Returns:
- the current user
- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
updateUser
User updateUser(User user) throws SmartsheetException
Update a user.
It mirrors to the following Smartsheet REST API method: PUT /user/{id}
- Parameters:
user
- the user to update- Returns:
- the updated user
- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
deleteUser
void deleteUser(long id, DeleteUserParameters parameters) throws SmartsheetException
Delete a user in the organization.
It mirrors to the following Smartsheet REST API method: DELETE /user/{id}
- Parameters:
id
- the id of the userparameters
- the object containing parameters for deleting users- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
listOrgSheets
PagedResult<Sheet> listOrgSheets(PaginationParameters pagination, java.util.Date modifiedSince) throws SmartsheetException
List all organisation sheets.
It mirrors to the following Smartsheet REST API method: GET /users/sheets
- Parameters:
pagination
- the object containing the pagination query parametersmodifiedSince
- restrict to sheets modified on or after this date- Returns:
- the list of all organisation sheets
- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
listOrgSheets
PagedResult<Sheet> listOrgSheets(PaginationParameters pagination) throws SmartsheetException
List all organisation sheets.
It mirrors to the following Smartsheet REST API method: GET /users/sheets
- Parameters:
pagination
- the object containing the pagination query parameters- Returns:
- the list of all organisation sheets
- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
listAlternateEmails
PagedResult<AlternateEmail> listAlternateEmails(long userId, PaginationParameters pagination) throws SmartsheetException
List all user alternate email(s).
It mirrors to the following Smartsheet REST API method: GET /users/{userId}/alternateemails
- Parameters:
userId
- the userIDpagination
- the pagination parameters- Returns:
- the list of all user alternate email(s)
- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
getAlternateEmail
AlternateEmail getAlternateEmail(long userId, long altEmailId) throws SmartsheetException
Get alternate email.
It mirrors to the following Smartsheet REST API method: GET /users/{userId}/alternateemails/{alternateEmailId}
- Parameters:
userId
- the id of the useraltEmailId
- the alternate email id for the alternate email to retrieve.- Returns:
- the resource. Note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null.
- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
addAlternateEmail
java.util.List<AlternateEmail> addAlternateEmail(long userId, java.util.List<AlternateEmail> altEmails) throws SmartsheetException
Add an alternate email.
It mirrors to the following Smartsheet REST API method: POST /users/{userId}/alternateemails
- Parameters:
userId
- the id of the useraltEmails
- List of alternate email address to add.- Returns:
- List of added alternate email(s).
- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
deleteAlternateEmail
void deleteAlternateEmail(long userId, long altEmailId) throws SmartsheetException
Delete an alternate email.
It mirrors to the following Smartsheet REST API method: DELETE /users/{userId}/alternateemails/{alternateEmailId}
- Parameters:
userId
- the id of the useraltEmailId
- the alternate email id for the alternate email to retrieve.- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
promoteAlternateEmail
AlternateEmail promoteAlternateEmail(long userId, long altEmailId) throws SmartsheetException
Promote and alternate email to primary.
- Parameters:
userId
- id of the useraltEmailId
- alternate email id- Returns:
- alternateEmail of the primary
- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- f there is any other error during the operation
-
addProfileImage
User addProfileImage(long userId, java.lang.String file, java.lang.String fileType) throws SmartsheetException, java.io.FileNotFoundException
Uploads a profile image for the specified user.
- Parameters:
userId
- id of the userfile
- path to the image filefileType
- content type of the image file- Returns:
- user
- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- f there is any other error during the operationjava.io.FileNotFoundException
-
-