use of com.instructure.canvasapi2.models.ToDo in project instructure-android by instructure.
the class InboxManager_Test method getConversationsFiltered.
public static void getConversationsFiltered(@NonNull InboxApi.Scope scope, @NonNull String canvasContextFilter, @NonNull RestBuilder adapter, @NonNull StatusCallback<List<Conversation>> callback, @NonNull RestParams params) {
// 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<Conversation> conversations = new ArrayList<>();
retrofit2.Response<List<Conversation>> response1 = retrofit2.Response.success(conversations, response);
callback.onResponse(response1, new LinkHeaders(), ApiType.CACHE);
}
use of com.instructure.canvasapi2.models.ToDo in project instructure-android by instructure.
the class InboxManager_Test method updateConversation.
public static void updateConversation(long conversationId, Conversation.WorkflowState workflowState, Boolean starred, StatusCallback<Conversation> callback) {
// TODO:
Response rawResponse = 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();
Conversation conversation = new Conversation();
retrofit2.Response<Conversation> response = retrofit2.Response.success(conversation, rawResponse);
callback.onResponse(response, new LinkHeaders(), ApiType.CACHE);
}
use of com.instructure.canvasapi2.models.ToDo in project instructure-android by instructure.
the class AccountNotificationManager method getAccountNotifications.
public static void getAccountNotifications(StatusCallback<List<AccountNotification>> callback, boolean forceNetwork) {
if (isTesting() || mTesting) {
// TODO
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withForceReadFromNetwork(forceNetwork).withPerPageQueryParam(true).build();
AccountNotificationAPI.getAccountNotifications(adapter, params, callback);
}
}
use of com.instructure.canvasapi2.models.ToDo in project instructure-android by instructure.
the class AccountNotificationManager method getAllAccountNotifications.
public static void getAllAccountNotifications(StatusCallback<List<AccountNotification>> callback, boolean forceNetwork) {
if (isTesting() || mTesting) {
// TODO
} else {
final RestBuilder adapter = new RestBuilder(callback);
final RestParams params = new RestParams.Builder().withForceReadFromNetwork(forceNetwork).withPerPageQueryParam(true).build();
StatusCallback<List<AccountNotification>> depaginatedCallback = new ExhaustiveListCallback<AccountNotification>(callback) {
@Override
public void getNextPage(StatusCallback<List<AccountNotification>> callback, String nextUrl, boolean isCached) {
AccountNotificationAPI.getAccountNotifications(adapter, params, callback);
}
};
adapter.setStatusCallback(depaginatedCallback);
AccountNotificationAPI.getAccountNotifications(adapter, params, depaginatedCallback);
}
}
use of com.instructure.canvasapi2.models.ToDo in project instructure-android by instructure.
the class AlertManager method markAlertAsDismissed.
public static void markAlertAsDismissed(String airwolfDomain, String parentId, String alertId, StatusCallback<ResponseBody> callback) {
if (isTesting() || mTesting) {
// TODO:
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withPerPageQueryParam(false).withDomain(airwolfDomain).withAPIVersion("").build();
AlertAPI.markAlertAsDismissed(parentId, alertId, adapter, callback, params);
}
}
Aggregations