Search in sources :

Example 26 with Message

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

the class AssignmentManager_Test method getAssignmentGroupsWithAssignments.

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

Example 27 with Message

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

the class AssignmentManager_Test method getAssignmentGroupsWithAssignmentsForGradingPeriod.

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

Example 28 with Message

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

the class AssignmentManager_Test method getAssignmentGroup.

public static void getAssignmentGroup(long courseId, long assignmentGroupId, StatusCallback<AssignmentGroup> 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();
    AssignmentGroup assignmentGroup = new AssignmentGroup();
    retrofit2.Response<AssignmentGroup> response = retrofit2.Response.success(assignmentGroup, httpResponse);
    callback.onResponse(response, new LinkHeaders(), ApiType.CACHE);
}
Also used : Response(okhttp3.Response) LinkHeaders(com.instructure.canvasapi2.utils.LinkHeaders) Request(okhttp3.Request) AssignmentGroup(com.instructure.canvasapi2.models.AssignmentGroup)

Example 29 with Message

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

the class AssignmentManager_Test method getAllAssignments.

public static void getAllAssignments(long courseId, StatusCallback<List<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();
    List<Assignment> assignments = new ArrayList<>();
    retrofit2.Response<List<Assignment>> response = retrofit2.Response.success(assignments, 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) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Example 30 with Message

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

the class AssignmentManager_Test method getAssignment.

public static void getAssignment(long assignmentId, long courseId, 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();
    Assignment assignment = new Assignment();
    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)

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