use of com.instructure.canvasapi2.StatusCallback in project instructure-android by instructure.
the class AccountDomainAPI method getAllAccountDomains.
public static void getAllAccountDomains(final StatusCallback<List<AccountDomain>> callback) {
final RestBuilder adapter = new RestBuilder(callback);
final RestParams params = new RestParams.Builder().withShouldIgnoreToken(true).withPerPageQueryParam(true).withForceReadFromCache(false).withForceReadFromNetwork(true).withDomain(DEFAULT_DOMAIN).build();
if (StatusCallback.isFirstPage(callback.getLinkHeaders())) {
callback.addCall(adapter.build(AccountDomainInterface.class, params).getDomains()).enqueue(callback);
} else if (StatusCallback.moreCallsExist(callback.getLinkHeaders()) && callback.getLinkHeaders() != null) {
callback.addCall(adapter.build(AccountDomainInterface.class, params).next(callback.getLinkHeaders().nextUrl)).enqueue(callback);
}
}
use of com.instructure.canvasapi2.StatusCallback in project instructure-android by instructure.
the class AssignmentAPI method getFirstPageGradeableStudentsForAssignment.
public static void getFirstPageGradeableStudentsForAssignment(long courseId, long assignmentId, @NonNull RestBuilder adapter, @NonNull StatusCallback<List<GradeableStudent>> callback) {
RestParams params = new RestParams.Builder().withShouldIgnoreToken(false).withPerPageQueryParam(true).build();
callback.addCall(adapter.build(AssignmentInterface.class, params).getFirstPageGradeableStudentsForAssignment(courseId, assignmentId)).enqueue(callback);
}
use of com.instructure.canvasapi2.StatusCallback in project instructure-android by instructure.
the class AssignmentAPI method getFirstPageSubmissionsForAssignment.
public static void getFirstPageSubmissionsForAssignment(long courseId, long assignmentId, boolean forceNetwork, @NonNull RestBuilder adapter, @NonNull StatusCallback<List<Submission>> callback) {
RestParams params = new RestParams.Builder().withShouldIgnoreToken(false).withPerPageQueryParam(true).withForceReadFromNetwork(forceNetwork).build();
callback.addCall(adapter.build(AssignmentInterface.class, params).getFirstPageSubmissionsForAssignment(courseId, assignmentId)).enqueue(callback);
}
use of com.instructure.canvasapi2.StatusCallback in project instructure-android by instructure.
the class AssignmentAPI method getNextPageAssignmentGroupsWithAssignments.
public static void getNextPageAssignmentGroupsWithAssignments(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).getNextPageAssignmentGroupListWithAssignments(nextUrl)).enqueue(callback);
}
use of com.instructure.canvasapi2.StatusCallback in project instructure-android by instructure.
the class AssignmentAPI method getFirstPageAssignments.
public static void getFirstPageAssignments(long courseId, boolean forceNetwork, @NonNull RestBuilder adapter, @NonNull StatusCallback<List<Assignment>> callback) {
RestParams params = new RestParams.Builder().withShouldIgnoreToken(false).withPerPageQueryParam(true).withForceReadFromNetwork(forceNetwork).build();
callback.addCall(adapter.build(AssignmentInterface.class, params).getAssignments(courseId)).enqueue(callback);
}
Aggregations