public class SectionsImpl extends BaseImpl<Section,SectionReader,SectionWriter> implements SectionReader, SectionWriter
apiVersion, canvasBaseUrl, canvasMessenger, masqueradeAs, masqueradeType, oauthToken, paginationPageSize, responseCallback, responseParser, serializeNulls| Constructor and Description |
|---|
SectionsImpl(String canvasBaseUrl,
Integer apiVersion,
OauthToken oauthToken,
RestClient restClient,
int connectTimeout,
int readTimeout,
Integer paginationPageSize,
Boolean serializeNulls) |
| Modifier and Type | Method and Description |
|---|---|
Optional<Section> |
createSection(String courseId,
Section section,
Boolean enableSisReactivation)
Create a new section in Canvas.
|
Optional<Section> |
crosslist(String sectionId,
String courseId)
Move the Section to another course in Canvas.
|
Optional<Section> |
deleteSection(String sectionId)
Delete an existing section in Canvas.
|
Optional<Section> |
getSingleSection(String sectionId)
Return a single section with a given section ID
|
List<Section> |
listCourseSections(String courseId,
List<SectionIncludes> includes)
Return a list of sections in a given course
|
protected Type |
listType() |
protected Class<Section> |
objectType() |
Optional<Section> |
updateSection(Section section)
Update a section in Canvas.
|
buildCanvasUrl, encode, getFromCanvas, getListFromCanvas, parseListOfResponses, readAsCanvasUser, readAsSisUser, withCallback, writeAsCanvasUser, writeAsSisUserclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreadAsCanvasUser, readAsSisUser, withCallbackwriteAsCanvasUser, writeAsSisUserpublic SectionsImpl(String canvasBaseUrl, Integer apiVersion, OauthToken oauthToken, RestClient restClient, int connectTimeout, int readTimeout, Integer paginationPageSize, Boolean serializeNulls)
public List<Section> listCourseSections(String courseId, List<SectionIncludes> includes) throws IOException
SectionReaderlistCourseSections in interface SectionReadercourseId - Canvas ID of courseincludes - Optional information to include in the returned sectionsIOException - When there is an error communicating with Canvaspublic Optional<Section> getSingleSection(String sectionId) throws IOException
SectionReadergetSingleSection in interface SectionReadersectionId - Section ID of sectionIOException - When there is an error communicating with Canvasprotected Type listType()
listType in class BaseImpl<Section,SectionReader,SectionWriter>protected Class<Section> objectType()
objectType in class BaseImpl<Section,SectionReader,SectionWriter>public Optional<Section> createSection(String courseId, Section section, Boolean enableSisReactivation) throws IOException
SectionWritercreateSection in interface SectionWritercourseId - identifies the parent course we are adding this section tosection - a section object containing the information needed to create
the section in CanvasenableSisReactivation - when true, will first try to re-activate a
deleted section with matching sis_section_id if possible. Ignored if nullIOException - When there is an error communicating with Canvaspublic Optional<Section> updateSection(Section section) throws IOException
SectionWriterupdateSection in interface SectionWritersection - section object with changes made that will be persistedIOException - when there is an error communicating with Canvaspublic Optional<Section> deleteSection(String sectionId) throws IOException
SectionWriterdeleteSection in interface SectionWritersectionId - identifies the section to deleteIOException - When there is an error communicating with Canvaspublic Optional<Section> crosslist(String sectionId, String courseId) throws IOException
SectionWritercrosslist in interface SectionWritersectionId - identifies the section to movecourseId - identifies the course to move the section intoIOException - When there is an error communicating with CanvasCopyright © 2021 Kansas State University, Office of Mediated Education. All rights reserved.