Interface UserResources
-
public interface UserResourcesThis 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.UseraddProfileImage(long userId, java.lang.String file, java.lang.String fileType)Uploads a profile image for the specified user.UseraddUser(User user)Add a user to the organization, without sending email.UseraddUser(User user, boolean sendEmail)Add a user to the organization, without sending email.voiddeleteAlternateEmail(long userId, long altEmailId)Delete an alternate email.voiddeleteUser(long id, DeleteUserParameters parameters)Delete a user in the organization.voiddowngradeUser(long userId, long planId, DowngradeSeatType seatType)Upgrades a user's seat type.AlternateEmailgetAlternateEmail(long userId, long altEmailId)Get alternate email.UserProfilegetCurrentUser()Get the current user.UserProfilegetCurrentUser(java.util.EnumSet<UserInclusion> includes)Get the current user.UserProfilegetUser(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.TokenPaginatedResult<UserPlan>listUserPlans(long userId, java.lang.String lastKey, java.lang.Long maxItems)Fetch all user's plans.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.lang.Long planId, SeatType seatType, 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.AlternateEmailpromoteAlternateEmail(long userId, long altEmailId)Promote and alternate email to primary.voidremoveUserFromPlan(long userId, long planId)Remove's a user from a plan.UserupdateUser(User user)Update a user.voidupgradeUser(long userId, long planId, UpgradeSeatType seatType)Upgrades a user's seat type.
-
-
-
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
-
listUsers
PagedResult<User> listUsers(java.util.Set<java.lang.String> email, java.lang.Long planId, SeatType seatType, PaginationParameters pagination) throws SmartsheetException
List all users.It mirrors to the following Smartsheet REST API method: GET /users
Exceptions: - InvalidRequestException : if there is any problem with the REST API request - AuthorizationException : if there is any problem with the REST API authorization(access token) - ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting) - SmartsheetRestException : if there is any other REST API related error occurred during the operation - SmartsheetException : if there is any other error occurred during the operation
- Parameters:
email- the list of email addressespagination- the object containing the pagination query parametersplanId- filtering all users part of the specific planseatType- filter users by seat type- Returns:
- all users (note that empty list will be returned if there is none)
- Throws:
SmartsheetException- the smartsheet exception
-
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
-
listUserPlans
TokenPaginatedResult<UserPlan> listUserPlans(long userId, java.lang.String lastKey, java.lang.Long maxItems) throws SmartsheetException
Fetch all user's plans.
It mirrors to the following Smartsheet REST API method: GET /users/{userId}/plans
- Parameters:
userId- the id of the user whose plans to fetchlastKey- lastKey from previous response to get next page of results- Returns:
- UserPlansResponse json response
- 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
-
removeUserFromPlan
void removeUserFromPlan(long userId, long planId) throws SmartsheetExceptionRemove's a user from a plan.
It mirrors to the following Smartsheet REST API method: DELETE /2.0/users/{userId}/plans/{planId}
- Parameters:
userId- the id of the user whose plans to fetchplanId- the id of the plan from which to remove 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
-
upgradeUser
void upgradeUser(long userId, long planId, UpgradeSeatType seatType) throws SmartsheetExceptionUpgrades a user's seat type.
It mirrors to the following Smartsheet REST API method: POST /users/{userId}/plans/{planId}/upgrade
- Parameters:
userId- the ID of the user to upgradeplanId- the ID of the plan to upgrade toseatType- the new seat type for 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 authorizationResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not availableSmartsheetException- if there is any other error during the operation
-
downgradeUser
void downgradeUser(long userId, long planId, DowngradeSeatType seatType) throws SmartsheetExceptionUpgrades a user's seat type.
It mirrors to the following Smartsheet REST API method: POST /users/{userId}/plans/{planId}/downgrade
- Parameters:
userId- the ID of the user to downgradeplanId- the ID of the plan to downgrade toseatType- the new seat type for 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 authorizationResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not availableSmartsheetException- if there is any other error during the operation
-
deleteUser
void deleteUser(long id, DeleteUserParameters parameters) throws SmartsheetExceptionDelete 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 SmartsheetExceptionDelete 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
-
-