use of com.instructure.canvasapi2.models.CanvasContext in project instructure-android by instructure.
the class DiscussionManager method replyToDiscussionEntry.
public static void replyToDiscussionEntry(CanvasContext canvasContext, long topicId, long entryId, String message, StatusCallback<DiscussionEntry> callback) {
if (isTesting() || mTesting) {
// TODO:
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().build();
DiscussionAPI.replyToDiscussionEntry(adapter, canvasContext, topicId, entryId, message, callback, params);
}
}
use of com.instructure.canvasapi2.models.CanvasContext in project instructure-android by instructure.
the class DiscussionManager method getFirstPagePinnedDiscussions.
public static void getFirstPagePinnedDiscussions(@NonNull CanvasContext canvasContext, final boolean forceNetwork, StatusCallback<List<DiscussionTopicHeader>> callback) {
if (isTesting() || mTesting) {
// TODO:
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withForceReadFromNetwork(forceNetwork).withPerPageQueryParam(true).build();
DiscussionAPI.getFirstPagePinnedDiscussions(canvasContext, adapter, callback, params);
}
}
use of com.instructure.canvasapi2.models.CanvasContext in project instructure-android by instructure.
the class FileFolderManager method getFirstPageFoldersRoot.
public static void getFirstPageFoldersRoot(CanvasContext canvasContext, boolean forceNetwork, final StatusCallback<List<FileFolder>> callback) {
if (isTesting() || mTesting) {
// TODO
} else {
final RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withCanvasContext(canvasContext).withForceReadFromNetwork(forceNetwork).withPerPageQueryParam(true).build();
final RestParams folderParams = new RestParams.Builder().withForceReadFromNetwork(forceNetwork).build();
FileFolderAPI.getRootFolderForContext(adapter, canvasContext, new StatusCallback<FileFolder>() {
@Override
public void onResponse(@NonNull Response<FileFolder> response, @NonNull LinkHeaders linkHeaders, @NonNull ApiType type) {
FileFolderAPI.getFirstPageFolders(adapter, response.body().getId(), callback, folderParams);
}
}, params);
}
}
use of com.instructure.canvasapi2.models.CanvasContext in project instructure-android by instructure.
the class FileFolderManager method getAllFilesRoot.
public static void getAllFilesRoot(CanvasContext canvasContext, final boolean forceNetwork, final StatusCallback<List<FileFolder>> callback) {
if (isTesting() || mTesting) {
// TODO
} else {
final RestBuilder adapter = new RestBuilder(callback);
final RestParams params = new RestParams.Builder().withCanvasContext(canvasContext).withForceReadFromNetwork(forceNetwork).withPerPageQueryParam(true).build();
FileFolderAPI.getRootFolderForContext(adapter, canvasContext, new StatusCallback<FileFolder>() {
@Override
public void onResponse(@NonNull Response<FileFolder> response, @NonNull LinkHeaders linkHeaders, @NonNull ApiType type) {
getAllFiles(response.body().getId(), forceNetwork, callback);
}
}, params);
}
}
use of com.instructure.canvasapi2.models.CanvasContext in project instructure-android by instructure.
the class InboxManager method getConversationsFiltered.
public static void getConversationsFiltered(InboxApi.Scope scope, String canvasContext, boolean forceNetwork, StatusCallback<List<Conversation>> callback) {
if (isTesting() || mTesting) {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withPerPageQueryParam(true).withShouldIgnoreToken(false).withForceReadFromNetwork(forceNetwork).build();
InboxManager_Test.getConversationsFiltered(scope, canvasContext, adapter, callback, params);
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withPerPageQueryParam(true).withShouldIgnoreToken(false).withForceReadFromNetwork(forceNetwork).build();
InboxApi.getConversationsFiltered(scope, canvasContext, adapter, callback, params);
}
}
Aggregations