pub struct Course {Show 22 fields
pub id: u64,
pub name: Option<String>,
pub course_code: Option<String>,
pub workflow_state: Option<WorkflowState>,
pub account_id: Option<u64>,
pub root_account_id: Option<u64>,
pub enrollment_term_id: Option<u64>,
pub sis_course_id: Option<String>,
pub start_at: Option<DateTime<Utc>>,
pub end_at: Option<DateTime<Utc>>,
pub grading_standard_id: Option<u64>,
pub is_public: Option<bool>,
pub license: Option<String>,
pub locale: Option<String>,
pub time_zone: Option<String>,
pub total_students: Option<u64>,
pub default_view: Option<String>,
pub syllabus_body: Option<String>,
pub public_description: Option<String>,
pub hide_final_grades: Option<bool>,
pub apply_assignment_group_weights: Option<bool>,
pub restrict_enrollments_to_course_dates: Option<bool>,
/* private fields */
}Fields§
§id: u64§name: Option<String>§course_code: Option<String>§workflow_state: Option<WorkflowState>§account_id: Option<u64>§root_account_id: Option<u64>§enrollment_term_id: Option<u64>§sis_course_id: Option<String>§start_at: Option<DateTime<Utc>>§end_at: Option<DateTime<Utc>>§grading_standard_id: Option<u64>§is_public: Option<bool>§license: Option<String>§locale: Option<String>§time_zone: Option<String>§total_students: Option<u64>§default_view: Option<String>§syllabus_body: Option<String>§public_description: Option<String>§hide_final_grades: Option<bool>§apply_assignment_group_weights: Option<bool>§restrict_enrollments_to_course_dates: Option<bool>Implementations§
Source§impl Course
impl Course
Sourcepub fn get_assignments(&self) -> PageStream<Assignment>
pub fn get_assignments(&self) -> PageStream<Assignment>
Sourcepub async fn get_assignment(&self, assignment_id: u64) -> Result<Assignment>
pub async fn get_assignment(&self, assignment_id: u64) -> Result<Assignment>
Sourcepub async fn create_assignment(
&self,
params: CreateAssignmentParams,
) -> Result<Assignment>
pub async fn create_assignment( &self, params: CreateAssignmentParams, ) -> Result<Assignment>
Sourcepub fn get_sections(&self) -> PageStream<Section>
pub fn get_sections(&self) -> PageStream<Section>
Sourcepub async fn get_section(&self, section_id: u64) -> Result<Section>
pub async fn get_section(&self, section_id: u64) -> Result<Section>
Sourcepub fn get_enrollments(&self) -> PageStream<Enrollment>
pub fn get_enrollments(&self) -> PageStream<Enrollment>
Sourcepub fn get_users(&self) -> PageStream<User>
pub fn get_users(&self) -> PageStream<User>
Sourcepub async fn update(&self, params: UpdateCourseParams) -> Result<Course>
pub async fn update(&self, params: UpdateCourseParams) -> Result<Course>
Sourcepub async fn delete(&self) -> Result<Course>
pub async fn delete(&self) -> Result<Course>
Delete this course. Canvas returns the deleted course object.
§Canvas API
DELETE /api/v1/courses/:id
Sourcepub fn get_quizzes(&self) -> PageStream<Quiz>
pub fn get_quizzes(&self) -> PageStream<Quiz>
Sourcepub async fn create_quiz(&self, params: CreateQuizParams) -> Result<Quiz>
pub async fn create_quiz(&self, params: CreateQuizParams) -> Result<Quiz>
Sourcepub fn get_modules(&self) -> PageStream<Module>
pub fn get_modules(&self) -> PageStream<Module>
Sourcepub async fn get_module(&self, module_id: u64) -> Result<Module>
pub async fn get_module(&self, module_id: u64) -> Result<Module>
Sourcepub fn get_pages(&self) -> PageStream<Page>
pub fn get_pages(&self) -> PageStream<Page>
Sourcepub fn get_discussion_topics(&self) -> PageStream<DiscussionTopic>
pub fn get_discussion_topics(&self) -> PageStream<DiscussionTopic>
Sourcepub async fn get_discussion_topic(
&self,
topic_id: u64,
) -> Result<DiscussionTopic>
pub async fn get_discussion_topic( &self, topic_id: u64, ) -> Result<DiscussionTopic>
Sourcepub fn get_files(&self) -> PageStream<File>
pub fn get_files(&self) -> PageStream<File>
Sourcepub fn get_tabs(&self) -> PageStream<Tab>
pub fn get_tabs(&self) -> PageStream<Tab>
Sourcepub fn get_collaborations(&self) -> PageStream<Collaboration>
pub fn get_collaborations(&self) -> PageStream<Collaboration>
Sourcepub fn get_groups(&self) -> PageStream<Group>
pub fn get_groups(&self) -> PageStream<Group>
Sourcepub async fn upload_file(
&self,
request: UploadRequest,
data: Vec<u8>,
) -> Result<File>
pub async fn upload_file( &self, request: UploadRequest, data: Vec<u8>, ) -> Result<File>
Upload a file to this course.
Canvas uses a two-step upload: first POSTing metadata to obtain an upload URL, then POSTing the file as multipart form data to that URL.
§Canvas API
POST /api/v1/courses/:id/files
Sourcepub async fn get_external_tool(&self, tool_id: u64) -> Result<ExternalTool>
pub async fn get_external_tool(&self, tool_id: u64) -> Result<ExternalTool>
Sourcepub fn get_external_tools(&self) -> PageStream<ExternalTool>
pub fn get_external_tools(&self) -> PageStream<ExternalTool>
Stream all external tools for this course.
§Canvas API
GET /api/v1/courses/:course_id/external_tools
Sourcepub async fn create_external_tool(
&self,
params: ExternalToolParams,
) -> Result<ExternalTool>
pub async fn create_external_tool( &self, params: ExternalToolParams, ) -> Result<ExternalTool>
Sourcepub async fn get_rubric(&self, rubric_id: u64) -> Result<Rubric>
pub async fn get_rubric(&self, rubric_id: u64) -> Result<Rubric>
Sourcepub fn get_rubrics(&self) -> PageStream<Rubric>
pub fn get_rubrics(&self) -> PageStream<Rubric>
Sourcepub async fn create_rubric(&self, params: RubricParams) -> Result<Rubric>
pub async fn create_rubric(&self, params: RubricParams) -> Result<Rubric>
Sourcepub async fn get_rubric_association(
&self,
association_id: u64,
) -> Result<RubricAssociation>
pub async fn get_rubric_association( &self, association_id: u64, ) -> Result<RubricAssociation>
Fetch a single rubric association by ID.
§Canvas API
GET /api/v1/courses/:course_id/rubric_associations/:id
Sourcepub fn get_rubric_associations(&self) -> PageStream<RubricAssociation>
pub fn get_rubric_associations(&self) -> PageStream<RubricAssociation>
Stream all rubric associations for this course.
§Canvas API
GET /api/v1/courses/:course_id/rubric_associations
Sourcepub async fn get_blueprint(
&self,
template_id: &str,
) -> Result<BlueprintTemplate>
pub async fn get_blueprint( &self, template_id: &str, ) -> Result<BlueprintTemplate>
Fetch the blueprint template for this course.
template_id is typically "default" or a numeric ID.
§Canvas API
GET /api/v1/courses/:course_id/blueprint_templates/:template_id
Sourcepub fn get_blueprint_subscriptions(&self) -> PageStream<BlueprintSubscription>
pub fn get_blueprint_subscriptions(&self) -> PageStream<BlueprintSubscription>
Stream blueprint subscriptions for this (child) course.
§Canvas API
GET /api/v1/courses/:course_id/blueprint_subscriptions
Sourcepub async fn get_content_migration(
&self,
migration_id: u64,
) -> Result<ContentMigration>
pub async fn get_content_migration( &self, migration_id: u64, ) -> Result<ContentMigration>
Fetch a single content migration by ID.
§Canvas API
GET /api/v1/courses/:course_id/content_migrations/:id
Sourcepub fn get_content_migrations(&self) -> PageStream<ContentMigration>
pub fn get_content_migrations(&self) -> PageStream<ContentMigration>
Stream all content migrations for this course.
§Canvas API
GET /api/v1/courses/:course_id/content_migrations
Sourcepub async fn create_content_migration(
&self,
migration_type: &str,
params: &[(String, String)],
) -> Result<ContentMigration>
pub async fn create_content_migration( &self, migration_type: &str, params: &[(String, String)], ) -> Result<ContentMigration>
Create a content migration for this course.
§Canvas API
POST /api/v1/courses/:course_id/content_migrations
Sourcepub fn get_migrators(&self) -> PageStream<Migrator>
pub fn get_migrators(&self) -> PageStream<Migrator>
Stream available content migration types for this course.
§Canvas API
GET /api/v1/courses/:course_id/content_migrations/migrators
Sourcepub fn get_outcome_group_links(&self) -> PageStream<OutcomeLink>
pub fn get_outcome_group_links(&self) -> PageStream<OutcomeLink>
Stream all outcome group links for this course.
§Canvas API
GET /api/v1/courses/:course_id/outcome_group_links
Sourcepub async fn get_outcome_group(&self, group_id: u64) -> Result<OutcomeGroup>
pub async fn get_outcome_group(&self, group_id: u64) -> Result<OutcomeGroup>
Sourcepub async fn create_outcome_group(
&self,
params: UpdateOutcomeGroupParams,
) -> Result<OutcomeGroup>
pub async fn create_outcome_group( &self, params: UpdateOutcomeGroupParams, ) -> Result<OutcomeGroup>
Create a top-level outcome group on this course.
§Canvas API
POST /api/v1/courses/:course_id/outcome_groups
Sourcepub fn get_gradebook_history_dates(&self) -> PageStream<Day>
pub fn get_gradebook_history_dates(&self) -> PageStream<Day>
Stream the days for which there is gradebook history in this course.
§Canvas API
GET /api/v1/courses/:course_id/gradebook_history/days
Sourcepub fn get_gradebook_history_details(&self, date: &str) -> PageStream<Grader>
pub fn get_gradebook_history_details(&self, date: &str) -> PageStream<Grader>
Stream graders who worked in this course on a given date.
date should be formatted as YYYY-MM-DD.
§Canvas API
GET /api/v1/courses/:course_id/gradebook_history/:date
Sourcepub fn get_submission_history(
&self,
date: &str,
grader_id: u64,
assignment_id: u64,
) -> PageStream<SubmissionHistory>
pub fn get_submission_history( &self, date: &str, grader_id: u64, assignment_id: u64, ) -> PageStream<SubmissionHistory>
Stream submission versions graded by a specific grader on a specific assignment and date.
§Canvas API
GET /api/v1/courses/:course_id/gradebook_history/:date/graders/:grader_id/assignments/:assignment_id/submissions
Sourcepub fn get_uncollated_submissions(&self) -> PageStream<SubmissionVersion>
pub fn get_uncollated_submissions(&self) -> PageStream<SubmissionVersion>
Stream all submission versions (uncollated) for this course.
§Canvas API
GET /api/v1/courses/:course_id/gradebook_history/feed
Sourcepub fn get_grading_periods(&self) -> PageStream<GradingPeriod>
pub fn get_grading_periods(&self) -> PageStream<GradingPeriod>
Stream all grading periods for this course.
§Canvas API
GET /api/v1/courses/:course_id/grading_periods
Sourcepub fn get_grading_standards(&self) -> PageStream<GradingStandard>
pub fn get_grading_standards(&self) -> PageStream<GradingStandard>
Stream all grading standards for this course.
§Canvas API
GET /api/v1/courses/:course_id/grading_standards
Sourcepub async fn create_grading_standard(
&self,
params: GradingStandardParams,
) -> Result<GradingStandard>
pub async fn create_grading_standard( &self, params: GradingStandardParams, ) -> Result<GradingStandard>
Create a grading standard for this course.
§Canvas API
POST /api/v1/courses/:course_id/grading_standards
Sourcepub async fn get_content_export(&self, export_id: u64) -> Result<ContentExport>
pub async fn get_content_export(&self, export_id: u64) -> Result<ContentExport>
Sourcepub fn get_content_exports(&self) -> PageStream<ContentExport>
pub fn get_content_exports(&self) -> PageStream<ContentExport>
Stream all content exports for this course.
§Canvas API
GET /api/v1/courses/:course_id/content_exports
Sourcepub async fn create_content_export(
&self,
params: ContentExportParams,
) -> Result<ContentExport>
pub async fn create_content_export( &self, params: ContentExportParams, ) -> Result<ContentExport>
Create a content export for this course.
§Canvas API
POST /api/v1/courses/:course_id/content_exports
Sourcepub fn get_grade_change_events(&self) -> PageStream<GradeChangeEvent>
pub fn get_grade_change_events(&self) -> PageStream<GradeChangeEvent>
Stream grade change audit events for this course.
The Canvas API wraps the array in { "events": [...] }; PageStream
handles this automatically.
§Canvas API
GET /api/v1/audit/grade_change/courses/:course_id
Sourcepub fn get_features(&self) -> PageStream<Feature>
pub fn get_features(&self) -> PageStream<Feature>
Sourcepub async fn get_feature_flag(&self, feature: &str) -> Result<FeatureFlag>
pub async fn get_feature_flag(&self, feature: &str) -> Result<FeatureFlag>
Fetch a specific feature flag for this course by feature name.
§Canvas API
GET /api/v1/courses/:course_id/features/flags/:feature
Sourcepub async fn get_enabled_features(&self) -> Result<Vec<String>>
pub async fn get_enabled_features(&self) -> Result<Vec<String>>
List all enabled feature names for this course.
§Canvas API
GET /api/v1/courses/:course_id/features/enabled
Sourcepub fn get_lti_resource_links(&self) -> PageStream<LtiResourceLink>
pub fn get_lti_resource_links(&self) -> PageStream<LtiResourceLink>
Stream all LTI resource links in this course.
§Canvas API
GET /api/v1/courses/:course_id/lti_resource_links
Sourcepub async fn get_lti_resource_link(
&self,
link_id: u64,
) -> Result<LtiResourceLink>
pub async fn get_lti_resource_link( &self, link_id: u64, ) -> Result<LtiResourceLink>
Sourcepub async fn create_lti_resource_link(
&self,
params: CreateLtiResourceLinkParams,
) -> Result<LtiResourceLink>
pub async fn create_lti_resource_link( &self, params: CreateLtiResourceLinkParams, ) -> Result<LtiResourceLink>
Create a new LTI resource link in this course.
§Canvas API
POST /api/v1/courses/:course_id/lti_resource_links