use of com.instructure.canvasapi2.models.Conversation in project instructure-android by instructure.
the class InboxManager_Test method getConversation.
public static void getConversation(RestBuilder adapter, StatusCallback<Conversation> callback, RestParams params, long conversationId) {
// 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();
Conversation conversation = new Conversation();
retrofit2.Response<Conversation> retrofitResponse = retrofit2.Response.success(conversation, response);
callback.onResponse(retrofitResponse, new LinkHeaders(), ApiType.CACHE);
}
use of com.instructure.canvasapi2.models.Conversation in project instructure-android by instructure.
the class InboxManager_Test method deleteMessages.
public static void deleteMessages(long conversationId, List<Long> messageIds, 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.Conversation 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.Conversation 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.Conversation in project instructure-android by instructure.
the class InboxManager method archiveConversation.
public static void archiveConversation(long conversationId, boolean archive, StatusCallback<Conversation> callback) {
if (isTesting() || mTesting) {
InboxManager_Test.updateConversation(conversationId, archive ? Conversation.WorkflowState.ARCHIVED : Conversation.WorkflowState.READ, null, callback);
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withShouldIgnoreToken(false).withPerPageQueryParam(false).build();
InboxApi.updateConversation(adapter, callback, params, conversationId, archive ? Conversation.WorkflowState.ARCHIVED : Conversation.WorkflowState.READ, null);
}
}
Aggregations