edu.ksu.canvas.interfaces.UserWriter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of canvas-api Show documentation
Show all versions of canvas-api Show documentation
A native Java library to talk to the Canvas REST API
package edu.ksu.canvas.interfaces;
import edu.ksu.canvas.exception.InvalidOauthTokenException;
import edu.ksu.canvas.model.User;
import edu.ksu.canvas.requestOptions.CreateUserOptions;
import java.io.IOException;
import java.util.Optional;
public interface UserWriter extends CanvasWriter {
/**
* Create a new user in Canvas
* @param user user data for creating user account
* @return The newly created user
* @throws InvalidOauthTokenException When the supplied OAuth token is not valid
* @throws IOException When there is an error communicating with Canvas
*/
Optional createUser(User user) throws InvalidOauthTokenException, IOException;
/**
* Create a new user in Canvas
* @param user user data for creating user account
* @param options the options for the user creation
* @return The newly created user
* @throws InvalidOauthTokenException When the supplied OAuth token is not valid
* @throws IOException When there is an error communicating with Canvas
*/
Optional createUser (User user, CreateUserOptions options) throws InvalidOauthTokenException, IOException;
/**
* Update user information
* @param user The user object with updated data to push to Canvas
* @return The updated user
* @throws InvalidOauthTokenException When the supplied OAuth token is not valid
* @throws IOException When there is an error communicating with Canvas
*/
Optional updateUser(User user) throws InvalidOauthTokenException, IOException;
}