public class UserImpl extends BaseImpl<User,UserReader,UserWriter> implements UserReader, UserWriter
apiVersion, canvasBaseUrl, canvasMessenger, masqueradeAs, masqueradeType, oauthToken, paginationPageSize, responseCallback, responseParser, serializeNulls| Constructor and Description |
|---|
UserImpl(String canvasBaseUrl,
Integer apiVersion,
OauthToken oauthToken,
RestClient restClient,
int connectTimeout,
int readTimeout,
Integer paginationPageSize,
Boolean serializeNulls) |
| Modifier and Type | Method and Description |
|---|---|
Optional<User> |
createUser(User user)
Create a new user in Canvas
|
Optional<User> |
createUser(User user,
CreateUserOptions options)
Create a new user in Canvas
|
List<User> |
getUsersInAccount(GetUsersInAccountOptions options)
Retrieve a list of all users for an account.
|
List<User> |
getUsersInCourse(GetUsersInCourseOptions options)
Retrieve a list of users in a course
|
protected Type |
listType() |
protected Class<User> |
objectType() |
Optional<User> |
showUserDetails(String userIdentifier)
Retrieve a specific user details from Canvas by user identifier
|
Optional<User> |
updateUser(User user)
Update user information
|
buildCanvasUrl, encode, getFromCanvas, getListFromCanvas, parseListOfResponses, readAsCanvasUser, readAsSisUser, withCallback, writeAsCanvasUser, writeAsSisUserclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreadAsCanvasUser, readAsSisUser, withCallbackwriteAsCanvasUser, writeAsSisUserpublic UserImpl(String canvasBaseUrl, Integer apiVersion, OauthToken oauthToken, RestClient restClient, int connectTimeout, int readTimeout, Integer paginationPageSize, Boolean serializeNulls)
public Optional<User> createUser(User user) throws InvalidOauthTokenException, IOException
UserWritercreateUser in interface UserWriteruser - user data for creating user accountInvalidOauthTokenException - When the supplied OAuth token is not validIOException - When there is an error communicating with Canvaspublic Optional<User> createUser(User user, CreateUserOptions options) throws InvalidOauthTokenException, IOException
UserWritercreateUser in interface UserWriteruser - user data for creating user accountoptions - the options for the user creationInvalidOauthTokenException - When the supplied OAuth token is not validIOException - When there is an error communicating with Canvaspublic Optional<User> updateUser(User user) throws InvalidOauthTokenException, IOException
UserWriterupdateUser in interface UserWriteruser - The user object with updated data to push to CanvasInvalidOauthTokenException - When the supplied OAuth token is not validIOException - When there is an error communicating with Canvaspublic List<User> getUsersInCourse(GetUsersInCourseOptions options) throws IOException
UserReadergetUsersInCourse in interface UserReaderoptions - API options for this API callIOException - When there is an error communicating with Canvaspublic Optional<User> showUserDetails(String userIdentifier) throws IOException
UserReadershowUserDetails in interface UserReaderuserIdentifier - The object holding a user identifier value, for example:
Numeric Canvas user ID
A string like "sis_integration_id:123" to query by SIS integration ID
A string like "sis_user_id:ABC" to query by SIS ID
The special string "self" that the Canvas API interprets as "the currently logged in user"IOException - When there is an error communicating with Canvaspublic List<User> getUsersInAccount(GetUsersInAccountOptions options) throws IOException
UserReadergetUsersInAccount in interface UserReaderoptions - API options for this call. Acceptable options are:
search_term - what is being used to search for userssort - what order the users are coming back in;
acceptable values here are username, email, sis_id and
last_loginorder - what order the users are coming back in;
acceptable values here are asc and descIOException - When there is an error communicating with Canvasprotected Type listType()
listType in class BaseImpl<User,UserReader,UserWriter>protected Class<User> objectType()
objectType in class BaseImpl<User,UserReader,UserWriter>Copyright © 2021 Kansas State University, Office of Mediated Education. All rights reserved.