Search in sources :

Example 31 with Message

use of com.instructure.canvasapi2.models.Message in project instructure-android by instructure.

the class CourseManager_Test method getCourseStudent.

public static void getCourseStudent(long courseId, long studentId, StatusCallback<User> callback) {
    // TODO:
    Response response = new Response.Builder().request(new Request.Builder().url("https://test.com").build()).code(200).message("todo").protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "todo".getBytes())).addHeader("content-type", "application/json").build();
    User user = new User();
    retrofit2.Response<User> response1 = retrofit2.Response.success(user, response);
    callback.onResponse(response1, new LinkHeaders(), ApiType.CACHE);
}
Also used : GradingPeriodResponse(com.instructure.canvasapi2.models.GradingPeriodResponse) Response(okhttp3.Response) User(com.instructure.canvasapi2.models.User) LinkHeaders(com.instructure.canvasapi2.utils.LinkHeaders) Request(okhttp3.Request)

Example 32 with Message

use of com.instructure.canvasapi2.models.Message in project instructure-android by instructure.

the class CourseManager_Test method removeCourseFromFavorites.

public static void removeCourseFromFavorites(long courseId, StatusCallback<Favorite> callback) {
    // TODO:
    Response response = new Response.Builder().request(new Request.Builder().url("https://test.com").build()).code(200).message("favorite" + " " + courseId).protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "favorite".getBytes())).addHeader("content-type", "application/json").build();
    Favorite favorite = new Favorite();
    retrofit2.Response<Favorite> response1 = retrofit2.Response.success(favorite, response);
    callback.onResponse(response1, new LinkHeaders(), ApiType.CACHE);
}
Also used : GradingPeriodResponse(com.instructure.canvasapi2.models.GradingPeriodResponse) Response(okhttp3.Response) Favorite(com.instructure.canvasapi2.models.Favorite) LinkHeaders(com.instructure.canvasapi2.utils.LinkHeaders) Request(okhttp3.Request)

Example 33 with Message

use of com.instructure.canvasapi2.models.Message in project instructure-android by instructure.

the class CourseManager_Test method getCourse.

public static void getCourse(long courseId, StatusCallback<Course> callback) {
    // TODO:
    Response response = new Response.Builder().request(new Request.Builder().url("https://test.com").build()).code(200).message("todo").protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "todo".getBytes())).addHeader("content-type", "application/json").build();
    Course course = new Course();
    course.setId(courseId);
    retrofit2.Response<Course> response1 = retrofit2.Response.success(course, response);
    callback.onResponse(response1, new LinkHeaders(), ApiType.CACHE);
}
Also used : GradingPeriodResponse(com.instructure.canvasapi2.models.GradingPeriodResponse) Response(okhttp3.Response) LinkHeaders(com.instructure.canvasapi2.utils.LinkHeaders) Request(okhttp3.Request) Course(com.instructure.canvasapi2.models.Course)

Example 34 with Message

use of com.instructure.canvasapi2.models.Message in project instructure-android by instructure.

the class CourseNicknameManager_Test method getNickname.

public static void getNickname(long courseId, StatusCallback<CourseNickname> callback) {
    Response response = new Response.Builder().request(new Request.Builder().url("https://test.com").build()).code(200).message("todo").protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "todo".getBytes())).addHeader("content-type", "application/json").build();
    CourseNickname courseNickname = new CourseNickname();
    courseNickname.setId(courseId);
    retrofit2.Response<CourseNickname> response1 = retrofit2.Response.success(courseNickname, response);
    callback.onResponse(response1, new LinkHeaders(), ApiType.CACHE);
}
Also used : Response(okhttp3.Response) LinkHeaders(com.instructure.canvasapi2.utils.LinkHeaders) Request(okhttp3.Request) CourseNickname(com.instructure.canvasapi2.models.CourseNickname)

Example 35 with Message

use of com.instructure.canvasapi2.models.Message in project instructure-android by instructure.

the class CourseNicknameManager_Test method deleteAllNicknames.

public static void deleteAllNicknames(StatusCallback<CourseNickname> callback) {
    Response response = new Response.Builder().request(new Request.Builder().url("https://test.com").build()).code(200).message("todo").protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "todo".getBytes())).addHeader("content-type", "application/json").build();
    CourseNickname courseNickname = new CourseNickname();
    retrofit2.Response<CourseNickname> response1 = retrofit2.Response.success(courseNickname, response);
    callback.onResponse(response1, new LinkHeaders(), ApiType.CACHE);
}
Also used : Response(okhttp3.Response) LinkHeaders(com.instructure.canvasapi2.utils.LinkHeaders) Request(okhttp3.Request) CourseNickname(com.instructure.canvasapi2.models.CourseNickname)

Aggregations

LinkHeaders (com.instructure.canvasapi2.utils.LinkHeaders)59 Response (okhttp3.Response)57 RestBuilder (com.instructure.canvasapi2.builders.RestBuilder)28 ArrayList (java.util.ArrayList)27 Request (okhttp3.Request)27 List (java.util.List)22 Conversation (com.instructure.canvasapi2.models.Conversation)12 ParentResponse (com.instructure.canvasapi2.models.ParentResponse)10 RestParams (com.instructure.canvasapi2.builders.RestParams)8 GradingPeriodResponse (com.instructure.canvasapi2.models.GradingPeriodResponse)8 QuizSubmissionQuestionResponse (com.instructure.canvasapi2.models.QuizSubmissionQuestionResponse)8 QuizSubmissionResponse (com.instructure.canvasapi2.models.QuizSubmissionResponse)8 Submission (com.instructure.canvasapi2.models.Submission)7 Course (com.instructure.canvasapi2.models.Course)6 View (android.view.View)5 AdapterView (android.widget.AdapterView)5 TextView (android.widget.TextView)5 Assignment (com.instructure.canvasapi2.models.Assignment)5 CourseNickname (com.instructure.canvasapi2.models.CourseNickname)5 ImageView (android.widget.ImageView)4