edu.ksu.canvas.interfaces.CourseReader 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 java.io.IOException;
import java.util.List;
import java.util.Optional;
import edu.ksu.canvas.model.Course;
import edu.ksu.canvas.requestOptions.GetSingleCourseOptions;
import edu.ksu.canvas.requestOptions.ListActiveCoursesInAccountOptions;
import edu.ksu.canvas.requestOptions.ListCurrentUserCoursesOptions;
import edu.ksu.canvas.requestOptions.ListUserCoursesOptions;
/**
* Methods to read information from and about courses
*/
public interface CourseReader extends CanvasReader {
/**
* Returns the list of active courses for the current user
* @param options The object holding options for this API call
* @return List of courses for the user matching any optional criteria
* @throws IOException When there is an error communicating with Canvas
*/
List listCurrentUserCourses(ListCurrentUserCoursesOptions options) throws IOException;
/**
* Returns the list of active courses for the a user
* @param options The object holding options for this API call
* @return List of courses for the user matching any optional criteria
* @throws IOException When there is an error communicating with Canvas
*/
List listUserCourses(ListUserCoursesOptions options) throws IOException;
/**
* Retrieve a specific course from Canvas by its Canvas ID number
* @param options The object holding options for this API call
* @return The course returned by Canvas or an empty Optional
* @throws IOException When there is an error communicating with Canvas
*/
Optional getSingleCourse(GetSingleCourseOptions options) throws IOException;
/**
* Retrieve a list of all courses on a given account
* @param options AccountCourseListOptions object representing params to this API call
* @return List of courses in the account
* @throws IOException When there is an error communicating with Canvas
*/
List listActiveCoursesInAccount(ListActiveCoursesInAccountOptions options) throws IOException;
}