Search in sources :

Example 66 with LinkHeaders

use of com.instructure.canvasapi2.utils.LinkHeaders in project instructure-android by instructure.

the class AnnouncementManager_Test method getAnnouncements.

public static void getAnnouncements(CanvasContext canvasContext, StatusCallback<List<DiscussionTopicHeader>> callback) {
    // TODO:
    Response response = new Response.Builder().code(200).message("todo").protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "todo".getBytes())).addHeader("content-type", "application/json").build();
    List<DiscussionTopicHeader> items = new ArrayList<>();
    retrofit2.Response<List<DiscussionTopicHeader>> response1 = retrofit2.Response.success(items, response);
    callback.onResponse(response1, new LinkHeaders(), ApiType.CACHE);
}
Also used : Response(okhttp3.Response) LinkHeaders(com.instructure.canvasapi2.utils.LinkHeaders) ArrayList(java.util.ArrayList) DiscussionTopicHeader(com.instructure.canvasapi2.models.DiscussionTopicHeader) List(java.util.List) ArrayList(java.util.ArrayList)

Example 67 with LinkHeaders

use of com.instructure.canvasapi2.utils.LinkHeaders in project instructure-android by instructure.

the class AnnouncementManager_Test method getAnnouncements.

public static void getAnnouncements(List<String> contextCodes, String startDate, String endDate, StatusCallback<List<DiscussionTopicHeader>> callback) {
    // TODO:
    Response response = new Response.Builder().code(200).message("todo").protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "todo".getBytes())).addHeader("content-type", "application/json").build();
    List<DiscussionTopicHeader> items = new ArrayList<>();
    retrofit2.Response<List<DiscussionTopicHeader>> response1 = retrofit2.Response.success(items, response);
    callback.onResponse(response1, new LinkHeaders(), ApiType.CACHE);
}
Also used : Response(okhttp3.Response) LinkHeaders(com.instructure.canvasapi2.utils.LinkHeaders) ArrayList(java.util.ArrayList) DiscussionTopicHeader(com.instructure.canvasapi2.models.DiscussionTopicHeader) List(java.util.List) ArrayList(java.util.ArrayList)

Example 68 with LinkHeaders

use of com.instructure.canvasapi2.utils.LinkHeaders in project instructure-android by instructure.

the class AssignmentManager_Test method deleteAssignment.

public static void deleteAssignment(Assignment assignment, StatusCallback<Assignment> callback) {
    // TODO:
    Response httpResponse = 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();
    retrofit2.Response<Assignment> response = retrofit2.Response.success(assignment, httpResponse);
    callback.onResponse(response, new LinkHeaders(), ApiType.CACHE);
}
Also used : Response(okhttp3.Response) Assignment(com.instructure.canvasapi2.models.Assignment) LinkHeaders(com.instructure.canvasapi2.utils.LinkHeaders) Request(okhttp3.Request)

Example 69 with LinkHeaders

use of com.instructure.canvasapi2.utils.LinkHeaders in project instructure-android by instructure.

the class AssignmentManager_Test method getAllSubmissionsForAssignment.

public static void getAllSubmissionsForAssignment(long courseId, long assignmentId, StatusCallback<List<Submission>> callback) {
    // TODO:
    Response httpResponse = 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();
    List<Submission> submissions = new ArrayList<>();
    retrofit2.Response<List<Submission>> response = retrofit2.Response.success(submissions, httpResponse);
    callback.onResponse(response, new LinkHeaders(), ApiType.CACHE);
}
Also used : Response(okhttp3.Response) Submission(com.instructure.canvasapi2.models.Submission) LinkHeaders(com.instructure.canvasapi2.utils.LinkHeaders) Request(okhttp3.Request) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Example 70 with LinkHeaders

use of com.instructure.canvasapi2.utils.LinkHeaders in project instructure-android by instructure.

the class AssignmentManager_Test method getAllGradeableStudentsForAssignment.

public static void getAllGradeableStudentsForAssignment(long courseId, long assignmentId, StatusCallback<List<GradeableStudent>> callback) {
    // TODO:
    Response httpResponse = 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();
    List<GradeableStudent> students = new ArrayList<>();
    retrofit2.Response<List<GradeableStudent>> response = retrofit2.Response.success(students, httpResponse);
    callback.onResponse(response, new LinkHeaders(), ApiType.CACHE);
}
Also used : Response(okhttp3.Response) GradeableStudent(com.instructure.canvasapi2.models.GradeableStudent) LinkHeaders(com.instructure.canvasapi2.utils.LinkHeaders) Request(okhttp3.Request) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

LinkHeaders (com.instructure.canvasapi2.utils.LinkHeaders)87 Response (okhttp3.Response)57 ArrayList (java.util.ArrayList)31 Request (okhttp3.Request)27 List (java.util.List)25 RestBuilder (com.instructure.canvasapi2.builders.RestBuilder)24 ApiType (com.instructure.canvasapi2.utils.ApiType)23 Response (retrofit2.Response)15 QuizSubmissionResponse (com.instructure.canvasapi2.models.QuizSubmissionResponse)13 QuizSubmissionQuestionResponse (com.instructure.canvasapi2.models.QuizSubmissionQuestionResponse)12 ParentResponse (com.instructure.canvasapi2.models.ParentResponse)10 Conversation (com.instructure.canvasapi2.models.Conversation)9 NonNull (android.support.annotation.NonNull)8 GradingPeriodResponse (com.instructure.canvasapi2.models.GradingPeriodResponse)8 StatusCallback (com.instructure.canvasapi2.StatusCallback)7 FileFolder (com.instructure.canvasapi2.models.FileFolder)6 Submission (com.instructure.canvasapi2.models.Submission)6 Assignment (com.instructure.canvasapi2.models.Assignment)5 CourseNickname (com.instructure.canvasapi2.models.CourseNickname)5 ResponseBody (okhttp3.ResponseBody)5