@@ -32,23 +32,38 @@ public async Task<Subject[]> GetAllSubjectsAsync(string id = "getSubjects", Canc
3232 }
3333
3434 /// <summary>
35- /// Get all classes on the school
35+ /// Get all classes on the school from the current school year
3636 /// </summary>
3737 /// <param name="id">Identifier of the request</param>
3838 /// <param name="ct">Cancellation token</param>
39- /// <returns>All classes on the school</returns>
39+ /// <returns>All classes on the school from current school year </returns>
4040 /// <exception cref="ObjectDisposedException">Thrown when the instance was disposed</exception>
4141 /// <exception cref="UnauthorizedAccessException">Thrown when you're not logged in</exception>
4242 /// <exception cref="HttpRequestException">Thrown when an error happend while the hppt request</exception>
4343 /// <exception cref="WebUntisException">Thrown when the WebUntis API returned an error</exception>
4444 public async Task < Class [ ] > GetAllClassesAsync ( string id = "getClasses" , CancellationToken ct = default )
4545 {
46- //TODO: School year overload
47-
4846 List < Class > classes = await MakeRequestAsync < object , List < Class > > ( id , "getKlassen" , new object ( ) , ct ) ;
4947 return classes . ToArray ( ) ;
5048 }
5149
50+ /// <summary>
51+ /// Get all classes on the school from the selected school year
52+ /// </summary>
53+ /// <param name="id">Identifier of the request</param>
54+ /// <param name="ct">Cancellation token</param>
55+ /// <param name="schoolYear">The school year from the classes</param>
56+ /// <returns>All classes on the school for the school year</returns>
57+ /// <exception cref="ObjectDisposedException">Thrown when the instance was disposed</exception>
58+ /// <exception cref="UnauthorizedAccessException">Thrown when you're not logged in</exception>
59+ /// <exception cref="HttpRequestException">Thrown when an error happend while the hppt request</exception>
60+ /// <exception cref="WebUntisException">Thrown when the WebUntis API returned an error</exception>
61+ public async Task < Class [ ] > GetClassesAsync ( SchoolYear schoolYear , string id = "getClassesBySchoolYear" , CancellationToken ct = default )
62+ {
63+ List < Class > classes = await MakeRequestAsync < SchoolYearModel , List < Class > > ( id , "getKlassen" , new SchoolYearModel ( ) { Id = schoolYear . Id } , ct ) ;
64+ return classes . ToArray ( ) ;
65+ }
66+
5267 /// <summary>
5368 /// Get all rooms on the school
5469 /// </summary>
0 commit comments