use of com.instructure.canvasapi2.StatusCallback in project instructure-android by instructure.
the class AssignmentAPI method getNextPageAssignmentGroupsWithAssignmentsForGradingPeriod.
public static void getNextPageAssignmentGroupsWithAssignmentsForGradingPeriod(boolean forceNetwork, @NonNull String nextUrl, @NonNull RestBuilder adapter, @NonNull StatusCallback<List<AssignmentGroup>> callback) {
RestParams params = new RestParams.Builder().withShouldIgnoreToken(false).withPerPageQueryParam(true).withForceReadFromNetwork(forceNetwork).build();
callback.addCall(adapter.build(AssignmentInterface.class, params).getNextPageAssignmentGroupListWithAssignmentsForGradingPeriod(nextUrl)).enqueue(callback);
}
use of com.instructure.canvasapi2.StatusCallback in project instructure-android by instructure.
the class CourseAPI method getNextPageCourseStudents.
public static void getNextPageCourseStudents(boolean forceNetwork, String nextUrl, RestBuilder adapter, StatusCallback<List<User>> callback) {
RestParams params = new RestParams.Builder().withShouldIgnoreToken(false).withPerPageQueryParam(true).withForceReadFromNetwork(forceNetwork).build();
callback.addCall(adapter.build(CoursesInterface.class, params).getNextPageStudents(nextUrl)).enqueue(callback);
}
use of com.instructure.canvasapi2.StatusCallback in project instructure-android by instructure.
the class EnrollmentAPI method getNextPageEnrollments.
public static void getNextPageEnrollments(boolean forceNetwork, String nextUrl, RestBuilder adapter, StatusCallback<List<Enrollment>> callback) {
RestParams params = new RestParams.Builder().withShouldIgnoreToken(false).withPerPageQueryParam(true).withForceReadFromNetwork(forceNetwork).build();
callback.addCall(adapter.build(EnrollmentInterface.class, params).getNextPage(nextUrl)).enqueue(callback);
}
use of com.instructure.canvasapi2.StatusCallback in project instructure-android by instructure.
the class ErrorReportAPI method buildInterface.
private static ErrorReportInterface buildInterface(StatusCallback<?> callback) {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withShouldIgnoreToken(true).withPerPageQueryParam(false).withForceReadFromCache(false).withForceReadFromNetwork(true).build();
return adapter.build(ErrorReportInterface.class, params);
}
use of com.instructure.canvasapi2.StatusCallback in project instructure-android by instructure.
the class QuizManager_Test method getQuizQuestions.
public static void getQuizQuestions(long courseId, long quizId, StatusCallback<List<QuizQuestion>> 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<QuizQuestion> quizQuestions = new ArrayList<>();
retrofit2.Response<List<QuizQuestion>> response1 = retrofit2.Response.success(quizQuestions, response);
callback.onResponse(response1, new LinkHeaders(), ApiType.CACHE);
}
Aggregations