edu.ksu.canvas.interfaces.CourseWriter 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.model.Course;
import edu.ksu.canvas.requestOptions.DeleteCourseOptions;
import java.io.IOException;
import java.util.Optional;
public interface CourseWriter extends CanvasWriter {
/**
* Create a new course in Canvas
* @param accountId the account ID of the account under which to place this course
* @param course A course object containing the information needed to create a course in Canvas
* @return The newly created course
* @throws IOException When there is an error communicating with Canvas
*/
Optional createCourse(String accountId, Course course) throws IOException;
/**
* Update a course in Canvas
* @param course A course object containing the information needed to update a course in Canvas
* @return The newly updated course
* @throws IOException When there is an error communicating with Canvas
*/
Optional updateCourse(Course course) throws IOException;
/**
* @param courseId The ID of the course you wish to delete
* @return true if the course was deleted
* @throws IOException When there is an error communicating with Canvas
*/
Boolean deleteCourse(String courseId) throws IOException;
/**
* Delete or conclude a course in Canvas.
*
* @param options (specifying the ID and whether to delete or conclude the course)
* @return true if the operation was successful
* @throws IOException When there is an error communicating with Canvas
*/
Boolean deleteCourse(DeleteCourseOptions options) throws IOException;
}