-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCoursesApi.java
104 lines (91 loc) · 3.35 KB
/
CoursesApi.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
package com.deange.uwaterlooapi.api;
import com.deange.uwaterlooapi.model.common.Responses;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query;
public interface CoursesApi {
/**
* This method returns all the coures offered under a given subject
*
* @param subject Valid uWaterloo subject name
*/
@GET("courses/{subject}.json")
Call<Responses.Courses> getCourseInfo(@Path("subject") String subject);
/**
* This method returns all available information for a given course
*
* @param courseId Valid uWaterloo course ID
*/
@GET("courses/{course_id}.json")
Call<Responses.CoursesInfo> getCourseInfo(@Path("course_id") int courseId);
/**
* This method returns the class schedule for a given course and term
*
* @param classNumber Valid uWaterloo course number
*/
@GET("courses/{class_number}/schedule.json")
Call<Responses.CoursesSchedule> getCourseSchedule(@Path("class_number") int classNumber);
/**
* This method returns the class schedule for a given course and term
*
* @param classNumber Valid uWaterloo course number
* @param term Four digit term representation
*/
@GET("courses/{class_number}/schedule.json")
Call<Responses.CoursesSchedule> getCourseSchedule(
@Path("class_number") int classNumber,
@Query("term") int term);
/**
* This method returns all available information for a given course
*
* @param subject Valid uWaterloo subject name
* @param courseCode Valid uWaterloo course number
*/
@GET("courses/{subject}/{catalog_number}.json")
Call<Responses.CoursesInfo> getCourseInfo(
@Path("subject") String subject,
@Path("catalog_number") String courseCode);
/**
* This method returns the class schedule for a given course and term
*
* @param subject Valid uWaterloo subject name
* @param courseCode Valid uWaterloo course number
*/
@GET("courses/{subject}/{catalog_number}/schedule.json")
Call<Responses.CoursesSchedule> getCourseSchedule(
@Path("subject") String subject,
@Path("catalog_number") String courseCode);
/**
* This method returns the class schedule for a given course and term
*
* @param subject Valid uWaterloo subject name
* @param courseCode Valid uWaterloo course number
* @param term Four digit term representation
*/
@GET("courses/{subject}/{catalog_number}/schedule.json")
Call<Responses.CoursesSchedule> getCourseSchedule(
@Path("subject") String subject,
@Path("catalog_number") String courseCode,
@Query("term") int term);
/**
* This method returns parsed and raw representation of prerequsites for a given course
*
* @param subject Valid uWaterloo subject name
* @param courseCode Valid uWaterloo course number
*/
@GET("courses/{subject}/{catalog_number}/prerequisites.json")
Call<Responses.Prerequisites> getPrerequisites(
@Path("subject") String subject,
@Path("catalog_number") String courseCode);
/**
* This method returns a given course's exam schedule
*
* @param subject Valid uWaterloo subject name
* @param courseCode Valid uWaterloo course number
*/
@GET("courses/{subject}/{catalog_number}/examschedule.json")
Call<Responses.ExamSchedule> getExamSchedule(
@Path("subject") String subject,
@Path("catalog_number") String courseCode);
}