@@ -25,13 +25,18 @@ pub struct ErrorResponse {
2525 pub obsolete_client : bool ,
2626}
2727
28- /// OAuth2 credentials
28+ /// OAuth2 credentials.
29+ /// get /api/v8/application/{client_name}/credentials
2930#[ derive( Debug , Deserialize ) ]
3031pub struct Credentials {
3132 pub application_id : String ,
3233 pub secret : String ,
3334}
3435
36+ /// get /api/v8/users/{user_id}
37+ /// get /api/v8/users/current
38+ /// post /api/v8/users/basic_info_by_usernames
39+ /// post /api/v8/users/basic_info_by_emails
3540#[ derive( Debug , Deserialize ) ]
3641pub struct User {
3742 pub id : u32 ,
@@ -40,7 +45,8 @@ pub struct User {
4045 pub administrator : bool ,
4146}
4247
43- /// Organization information.
48+ /// get /api/v8/org.json
49+ /// get /api/v8/org/{organization_slug}.json
4450#[ derive( Debug , Serialize , Deserialize , JsonSchema ) ]
4551pub struct Organization {
4652 pub name : String ,
@@ -50,7 +56,7 @@ pub struct Organization {
5056 pub pinned : bool ,
5157}
5258
53- /// Information for a course.
59+ /// get /api/v8/core/org/{organization_slug}/courses
5460#[ derive( Debug , Deserialize , Serialize , JsonSchema ) ]
5561pub struct Course {
5662 pub id : u32 ,
@@ -64,7 +70,8 @@ pub struct Course {
6470 pub spyware_urls : Vec < String > ,
6571}
6672
67- /// Data for a course.
73+ /// get /api/v8/courses/{course_id}
74+ /// get /api/v8/org/{organization_slug}/courses/{course_name}
6875#[ derive( Debug , Deserialize , Serialize , JsonSchema ) ]
6976pub struct CourseData {
7077 pub name : String ,
@@ -106,7 +113,7 @@ struct CourseDetailsInner {
106113 pub exercises : Vec < Exercise > ,
107114}
108115
109- /// Details for a course.
116+ /// get /api/v8/core/courses/{course_id}
110117#[ derive( Debug , Deserialize , Serialize , JsonSchema ) ]
111118#[ serde( from = "CourseDetailsWrapper" ) ]
112119pub struct CourseDetails {
@@ -154,7 +161,7 @@ pub struct Exercise {
154161 pub solution_zip_url : Option < String > ,
155162}
156163
157- /// Exercise for a course.
164+ /// get /api/v8/courses/{course_id}/exercises
158165#[ derive( Debug , Deserialize , Serialize , JsonSchema ) ]
159166pub struct CourseExercise {
160167 pub id : u32 ,
@@ -169,6 +176,7 @@ pub struct CourseExercise {
169176 pub unlocked : bool ,
170177}
171178
179+ /// get /api/v8/org/{organization_slug}/courses/{course_name}/exercises
172180#[ derive( Debug , Deserialize ) ]
173181pub struct CourseDataExercise {
174182 pub id : u32 ,
@@ -188,6 +196,16 @@ pub struct ExercisePoint {
188196 pub requires_review : bool ,
189197}
190198
199+ /// get /api/v8/courses/{course_id}/points
200+ /// get /api/v8/courses/{course_id}/exercises/{exercise_name}/points
201+ /// get /api/v8/courses/{course_id}/exercises/{exercise_name}/users/{user_id}/
202+ /// get /api/v8/courses/{course_id}/exercises/{exercise_name}/users/current/points
203+ /// get /api/v8/courses/{course_id}/users/{user_id}/points
204+ /// get /api/v8/courses/{course_id}/users/current/points
205+ /// get /api/v8/org/{organization_slug}/courses/{course_name}/points
206+ /// get /api/v8/org/{organization_slug}/courses/{course_name}/exercises/{exercise_name}/points
207+ /// get /api/v8/org/{organization_slug}/courses/{course_name}/users/{user_id}/points
208+ /// get /api/v8/org/{organization_slug}/courses/{course_name}/users/current/points
191209#[ derive( Debug , Deserialize ) ]
192210pub struct CourseDataExercisePoint {
193211 awarded_point : AwardedPoint ,
@@ -204,7 +222,7 @@ pub struct AwardedPoint {
204222 created_at : DateTime < FixedOffset > ,
205223}
206224
207- /// Details for an exercise.
225+ /// get /api/v8/core/exercises/{exercise_id}
208226#[ derive( Debug , Deserialize , Serialize , JsonSchema ) ]
209227pub struct ExerciseDetails {
210228 pub course_name : String ,
@@ -218,6 +236,7 @@ pub struct ExerciseDetails {
218236 pub submissions : Vec < ExerciseSubmission > ,
219237}
220238
239+ /// get /api/v8/core/exercises/details
221240#[ derive( Debug , Deserialize , Serialize , JsonSchema ) ]
222241pub struct ExercisesDetails {
223242 pub id : u32 ,
@@ -226,7 +245,16 @@ pub struct ExercisesDetails {
226245 pub checksum : String ,
227246}
228247
229- /// Exercise submission.
248+ /// get /api/v8/courses/{course_id}/submissions
249+ /// get /api/v8/courses/{course_id}/users/{user_id}/submissions
250+ /// get /api/v8/courses/{course_id}/users/current/submissions
251+ /// get api/v8/exercises/{exercise_id}/users/{user_id}/submissions
252+ /// get api/v8/exercises/{exercise_id}/users/current/submissions
253+ /// get /api/v8/org/{organization_slug}/courses/{course_name}/submissions
254+ /// get /api/v8/org/{organization_slug}/courses/{course_name}/users/{user_id}/submissions
255+ /// get /api/v8/org/{organization_slug}/courses/{course_name}/users/current/submissions
256+ /// get api/v8/exercises/{exercise_id}/users/{user_id}/submissions
257+ /// get api/v8/exercises/{exercise_id}/users/current/submissions
230258#[ derive( Debug , Deserialize , Serialize , JsonSchema ) ]
231259pub struct Submission {
232260 pub id : u32 ,
@@ -271,14 +299,15 @@ pub struct ExerciseSubmission {
271299 pub requests_review : bool ,
272300}
273301
274- /// Exercise submission.
302+ /// post /api/v8/core/exercises/{exercise_id}/submissions
275303#[ derive( Debug , Deserialize , Serialize , JsonSchema , Clone ) ]
276304pub struct NewSubmission {
277305 pub show_submission_url : String ,
278306 pub paste_url : String , // use Option and serde_with::string_empty_as_none ?
279307 pub submission_url : String ,
280308}
281309
310+ /// get /api/v8/core/submission/{submission_id}
282311#[ derive( Debug , Deserialize , Serialize ) ]
283312#[ serde( untagged) ] // TODO: tag
284313pub enum SubmissionProcessingStatus {
@@ -300,7 +329,6 @@ pub enum SandboxStatus {
300329 ProcessingOnSandbox ,
301330}
302331
303- /// Finished submission.
304332#[ derive( Debug , Deserialize , Serialize , PartialEq , Eq , JsonSchema ) ]
305333pub struct SubmissionFinished {
306334 pub api_version : u32 ,
@@ -338,7 +366,7 @@ pub enum SubmissionStatus {
338366 Hidden ,
339367}
340368
341- /// Response to feedback.
369+ /// post /api/v8/core/submissions/{submission_id}/ feedback
342370#[ derive( Debug , Deserialize , Serialize , JsonSchema ) ]
343371pub struct SubmissionFeedbackResponse {
344372 pub api_version : u32 ,
@@ -431,7 +459,7 @@ impl<'de> Visitor<'de> for SubmissionFeedbackKindVisitor {
431459 }
432460}
433461
434- /// Code review.
462+ /// get /api/v8/core/courses/{course_id}/reviews
435463#[ derive( Debug , Deserialize , Serialize , JsonSchema ) ]
436464pub struct Review {
437465 pub submission_id : u32 ,
@@ -448,13 +476,6 @@ pub struct Review {
448476 pub updated_at : DateTime < FixedOffset > ,
449477}
450478
451- /// Updated exercises.
452- #[ derive( Debug , Deserialize , Serialize , JsonSchema ) ]
453- pub struct UpdateResult {
454- pub created : Vec < Exercise > ,
455- pub updated : Vec < Exercise > ,
456- }
457-
458479#[ cfg( test) ]
459480#[ allow( clippy:: clippy:: unwrap_used) ]
460481mod test {
0 commit comments