use of com.instructure.canvasapi2.models.Recipient in project instructure-android by instructure.
the class RecipientManager method searchAllRecipientsNoSyntheticContexts.
/**
* Synthetic contexts == sections and groups, so this will return only actual users, not groups or sections
*
* @param forceNetwork
* @param searchQuery
* @param context
* @param callback
*/
public static void searchAllRecipientsNoSyntheticContexts(final boolean forceNetwork, String searchQuery, String context, StatusCallback<List<Recipient>> callback) {
if (isTesting() || mTesting) {
// TODO...
} else {
final RestBuilder adapter = new RestBuilder(callback);
StatusCallback<List<Recipient>> depaginatedCallback = new ExhaustiveListCallback<Recipient>(callback) {
@Override
public void getNextPage(@NonNull StatusCallback<List<Recipient>> callback, @NonNull String nextUrl, boolean isCached) {
RecipientAPI.getNextPageRecipients(forceNetwork, nextUrl, adapter, callback);
}
};
adapter.setStatusCallback(depaginatedCallback);
RecipientAPI.getFirstPageRecipientsNoSyntheticContexts(forceNetwork, searchQuery, context, adapter, depaginatedCallback);
}
}
use of com.instructure.canvasapi2.models.Recipient in project instructure-android by instructure.
the class RecipientManager method searchRecipients.
public static void searchRecipients(String searchQuery, String context, StatusCallback<List<Recipient>> callback) {
if (isTesting() || mTesting) {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withPerPageQueryParam(true).withShouldIgnoreToken(false).build();
RecipientManager_Test.getFirstPageRecipients(searchQuery, context, callback, adapter, params);
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withPerPageQueryParam(true).withShouldIgnoreToken(false).build();
RecipientAPI.getRecipients(searchQuery, context, callback, adapter, params);
}
}
use of com.instructure.canvasapi2.models.Recipient in project instructure-android by instructure.
the class RecipientAPI method getFirstPageRecipients.
public static void getFirstPageRecipients(boolean forceNetwork, String searchQuery, String context, @NonNull RestBuilder adapter, @NonNull StatusCallback<List<Recipient>> callback) {
RestParams params = new RestParams.Builder().withShouldIgnoreToken(false).withPerPageQueryParam(true).withForceReadFromNetwork(forceNetwork).build();
callback.addCall(adapter.build(RecipientInterface.class, params).getFirstPageRecipientList(searchQuery, context)).enqueue(callback);
}
use of com.instructure.canvasapi2.models.Recipient in project instructure-android by instructure.
the class RecipientAPI method getNextPageRecipients.
public static void getNextPageRecipients(boolean forceNetwork, String nextUrl, @NonNull RestBuilder adapter, @NonNull StatusCallback<List<Recipient>> callback) {
RestParams params = new RestParams.Builder().withShouldIgnoreToken(false).withPerPageQueryParam(true).withForceReadFromNetwork(forceNetwork).build();
adapter.build(RecipientInterface.class, params).getNextPageRecipientList(nextUrl).enqueue(callback);
}
use of com.instructure.canvasapi2.models.Recipient in project instructure-android by instructure.
the class RecipientAPI method getFirstPageRecipientsNoSyntheticContexts.
// Synthetic contexts == groups and sections, so this search will return only users
public static void getFirstPageRecipientsNoSyntheticContexts(boolean forceNetwork, String searchQuery, String context, @NonNull RestBuilder adapter, @NonNull StatusCallback<List<Recipient>> callback) {
RestParams params = new RestParams.Builder().withShouldIgnoreToken(false).withPerPageQueryParam(true).withForceReadFromNetwork(forceNetwork).build();
callback.addCall(adapter.build(RecipientInterface.class, params).getFirstPageRecipientListNoSyntheticContexts(searchQuery, context)).enqueue(callback);
}
Aggregations