public class CourseImpl extends BaseImpl<Course,CourseReader,CourseWriter> implements CourseReader, CourseWriter
apiVersion, canvasBaseUrl, canvasMessenger, masqueradeAs, masqueradeType, oauthToken, paginationPageSize, responseCallback, responseParser, serializeNulls| Constructor and Description |
|---|
CourseImpl(String canvasBaseUrl,
Integer apiVersion,
OauthToken oauthToken,
RestClient restClient,
int connectTimeout,
int readTimeout,
Integer paginationPageSize,
Boolean serializeNulls) |
| Modifier and Type | Method and Description |
|---|---|
Optional<Progress> |
batchUpdateCourseState(String accountId,
Course.CourseEvent event,
String... courseIds)
Change the workflow state of multiple courses at once
This operation happens asynchronously and returns a Progress object to monitor its execution.
|
Optional<Course> |
createCourse(String accountId,
Course course)
Create a new course in Canvas
|
Boolean |
deleteCourse(DeleteCourseOptions options)
Delete or conclude a course in Canvas.
|
Boolean |
deleteCourse(String courseId) |
Optional<Course> |
getSingleCourse(GetSingleCourseOptions options)
Retrieve a specific course from Canvas by its Canvas ID number
|
Optional<Course> |
getSingleCourse(String accountId,
GetSingleCourseOptions options)
Retrieve a specific course from a Canvas account by its Canvas ID number
|
List<Course> |
listActiveCoursesInAccount(ListActiveCoursesInAccountOptions options)
Retrieve a list of all courses on a given account
|
List<Course> |
listCurrentUserCourses(ListCurrentUserCoursesOptions options)
Returns the list of active courses for the current user
|
protected Type |
listType() |
List<Course> |
listUserCourses(ListUserCoursesOptions options)
Returns the list of active courses for the a user
|
protected Class<Course> |
objectType() |
Optional<Course> |
updateCourse(Course course)
Update a course in Canvas
|
Optional<Course> |
updateCourse(String id,
Course course)
Update a course in Canvas
|
Optional<Deposit> |
uploadFile(String courseId,
UploadOptions uploadOptions)
Start a file upload to a course.
|
buildCanvasUrl, encode, getFromCanvas, getListFromCanvas, parseListOfResponses, readAsCanvasUser, readAsSisUser, withCallback, writeAsCanvasUser, writeAsSisUserclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreadAsCanvasUser, readAsSisUser, withCallbackwriteAsCanvasUser, writeAsSisUserpublic CourseImpl(String canvasBaseUrl, Integer apiVersion, OauthToken oauthToken, RestClient restClient, int connectTimeout, int readTimeout, Integer paginationPageSize, Boolean serializeNulls)
public List<Course> listCurrentUserCourses(ListCurrentUserCoursesOptions options) throws IOException
CourseReaderlistCurrentUserCourses in interface CourseReaderoptions - The object holding options for this API callIOException - When there is an error communicating with Canvaspublic List<Course> listUserCourses(ListUserCoursesOptions options) throws IOException
CourseReaderlistUserCourses in interface CourseReaderoptions - The object holding options for this API callIOException - When there is an error communicating with Canvaspublic Optional<Course> getSingleCourse(GetSingleCourseOptions options) throws IOException
CourseReadergetSingleCourse in interface CourseReaderoptions - The object holding options for this API callIOException - When there is an error communicating with Canvaspublic Optional<Course> getSingleCourse(String accountId, GetSingleCourseOptions options) throws IOException
CourseReadergetSingleCourse in interface CourseReaderaccountId - The account to look for the course in.options - The object holding options for this API callIOException - When there is an error communicating with Canvaspublic Optional<Course> createCourse(String accountId, Course course) throws IOException
CourseWritercreateCourse in interface CourseWriteraccountId - the account ID of the account under which to place this coursecourse - A course object containing the information needed to create a course in CanvasIOException - When there is an error communicating with Canvaspublic Optional<Course> updateCourse(Course course) throws IOException
CourseWriterupdateCourse in interface CourseWritercourse - A course object containing the information needed to update a course in CanvasIOException - When there is an error communicating with Canvaspublic Optional<Course> updateCourse(String id, Course course) throws IOException
CourseWriterupdateCourse in interface CourseWriterid - The ID of the course to update, this is useful when you want to update a course
by it's SIS ID, for example with "sis_course_id:id-123"course - A course object containing the information needed to update a course in CanvasIOException - When there is an error communicating with Canvaspublic Boolean deleteCourse(String courseId) throws IOException
deleteCourse in interface CourseWritercourseId - The ID of the course you wish to deleteIOException - When there is an error communicating with Canvaspublic Boolean deleteCourse(DeleteCourseOptions options) throws IOException
CourseWriterdeleteCourse in interface CourseWriteroptions - (specifying the ID and whether to delete or conclude the course)IOException - When there is an error communicating with Canvaspublic List<Course> listActiveCoursesInAccount(ListActiveCoursesInAccountOptions options) throws IOException
CourseReaderlistActiveCoursesInAccount in interface CourseReaderoptions - AccountCourseListOptions object representing params to this API callIOException - When there is an error communicating with Canvaspublic Optional<Deposit> uploadFile(String courseId, UploadOptions uploadOptions) throws IOException
CourseWriteruploadFile in interface CourseWritercourseId - The id of the course where the file upload will be doneuploadOptions - Upload file configurationIOException - When there is an error communicating with Canvaspublic Optional<Progress> batchUpdateCourseState(String accountId, Course.CourseEvent event, String... courseIds) throws IOException
CourseWriterbatchUpdateCourseState in interface CourseWriteraccountId - The ID of the account in which to perform this bulk operationevent - The course event type to pushcourseIds - A list of course IDs to perform this operation onIOException - When there is an error communicating with Canvasprotected Type listType()
listType in class BaseImpl<Course,CourseReader,CourseWriter>protected Class<Course> objectType()
objectType in class BaseImpl<Course,CourseReader,CourseWriter>Copyright © 2021 Kansas State University, Office of Mediated Education. All rights reserved.