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

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

The newest version!
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 specific course from a Canvas account by its Canvas ID number
     * @param accountId The account to look for the course in.
     * @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(String accountId, 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;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy