fix: expose all fields of course structs

This commit is contained in:
Youwen Wu 2024-09-12 02:09:03 -07:00
parent 892112e568
commit 288c4cbfe9
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3

View file

@ -19,65 +19,65 @@ impl CanvasClient {
/// HTML. Some JSON objects which have not yet been typed are deserialized into plaintext instead. /// HTML. Some JSON objects which have not yet been typed are deserialized into plaintext instead.
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct Course { pub struct Course {
id: u32, pub id: u32,
name: String, pub name: String,
account_id: u32, pub account_id: u32,
uuid: String, pub uuid: String,
start_at: Option<String>, pub start_at: Option<String>,
grading_standard_id: Option<u32>, pub grading_standard_id: Option<u32>,
is_public: bool, pub is_public: bool,
created_at: String, pub created_at: String,
course_code: String, pub course_code: String,
default_view: Option<String>, pub default_view: Option<String>,
root_account_id: u32, pub root_account_id: u32,
enrollment_term_id: u32, pub enrollment_term_id: u32,
term: Option<String>, pub term: Option<String>,
permissions: Option<Permissions>, pub permissions: Option<Permissions>,
course_progress: Option<String>, pub course_progress: Option<String>,
license: String, pub license: String,
public_description: Option<String>, pub public_description: Option<String>,
access_restricted_by_date: Option<bool>, pub access_restricted_by_date: Option<bool>,
blueprint_restrictions: Option<String>, pub blueprint_restrictions: Option<String>,
blueprint_restrictions_by_object_type: Option<String>, pub blueprint_restrictions_by_object_type: Option<String>,
syllabus_body: Option<String>, pub syllabus_body: Option<String>,
needs_grading_count: Option<u32>, pub needs_grading_count: Option<u32>,
grade_passback_setting: Option<String>, pub grade_passback_setting: Option<String>,
end_at: Option<String>, pub end_at: Option<String>,
public_syllabus: bool, pub public_syllabus: bool,
public_syllabus_to_auth: bool, pub public_syllabus_to_auth: bool,
storage_quota_mb: usize, pub storage_quota_mb: usize,
is_public_to_auth_users: bool, pub is_public_to_auth_users: bool,
homeroom_course: bool, pub homeroom_course: bool,
course_color: Option<String>, pub course_color: Option<String>,
friendly_name: Option<String>, pub friendly_name: Option<String>,
apply_assignment_group_weights: bool, pub apply_assignment_group_weights: bool,
calendar: Calendar, pub calendar: Calendar,
time_zone: String, pub time_zone: String,
blueprint: bool, pub blueprint: bool,
template: bool, pub template: bool,
enrollments: Option<Vec<Enrollment>>, pub enrollments: Option<Vec<Enrollment>>,
hide_final_grades: bool, pub hide_final_grades: bool,
workflow_state: String, pub workflow_state: String,
restrict_enrollments_to_course_dates: bool, pub restrict_enrollments_to_course_dates: bool,
} }
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct Enrollment { pub struct Enrollment {
r#type: String, pub r#type: String,
role: String, pub role: String,
role_id: u32, pub role_id: u32,
user_id: u32, pub user_id: u32,
enrollment_state: String, pub enrollment_state: String,
limit_privileges_to_course_section: bool, pub limit_privileges_to_course_section: bool,
} }
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct Calendar { pub struct Calendar {
ics: String, pub ics: String,
} }
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct Permissions { pub struct Permissions {
create_discussion_topic: bool, pub create_discussion_topic: bool,
create_announcement: bool, pub create_announcement: bool,
} }