All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.ksu.canvas.interfaces.UserWriter Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
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;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy