Skip to content

Commit

Permalink
Added course image field to course object
Browse files Browse the repository at this point in the history
  • Loading branch information
allomanta authored and goomens committed Oct 21, 2024
1 parent d1294ea commit f287fab
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Types/Course.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class Course : CanvasObject
[JsonProperty("start_at")]
public DateTime? StartDate { get; set; }
[JsonProperty("end_at")]
public DateTime? EndDate{ get; set; }
public DateTime? EndDate { get; set; }
[JsonProperty("course_code")]
public string CourseCode { get; set; }
[JsonProperty("sis_course_id")]
Expand All @@ -76,6 +76,9 @@ public class Course : CanvasObject
[JsonProperty("workflow_state")]
public CourseState State { get; set; }

[JsonProperty("course_image")]
public string Image { get; set; }

[JsonProperty("grading_standard_enabled")]
public bool? EnableGradingScheme { get; set; }
[JsonProperty("grading_standard_id")]
Expand Down Expand Up @@ -144,7 +147,7 @@ public class Course : CanvasObject
public List<Enrollment> UserEnrollments => _UserEnrollments ?? (_UserEnrollments = Connector.RetrieveCollection<Enrollment>(this, param: ("user_id", "self")));

public List<Enrollment> GetEnrollmentsByType(EnrollmentType type) => Connector.RetrieveCollection<Enrollment>(this, null, ("type", ToCanvasString(type)));
public List<Enrollment> GetEnrollmentsByType(EnrollmentType type, string[] sisuserIds)
public List<Enrollment> GetEnrollmentsByType(EnrollmentType type, string[] sisuserIds)
=> Connector.RetrieveCollection<Enrollment>(this, sisuserIds.Select(i => ("sis_user_id[]", i)).Append(("type", ToCanvasString(type))).ToArray());

public List<User> GetUsersByType(EnrollmentType type) => Connector.RetrieveCollection<User>(this, null, ("enrollment_type", type.ToString().ToLower()));
Expand Down

0 comments on commit f287fab

Please sign in to comment.