Search in sources :

Example 6 with PollSessionResponse

use of com.instructure.canvasapi2.models.PollSessionResponse in project instructure-android by instructure.

the class PollsManager method getOpenSessions.

public static void getOpenSessions(StatusCallback<PollSessionResponse> callback, boolean forceNetwork) {
    if (isTesting() || mTesting) {
    // TODO:
    } else {
        final RestBuilder adapter = new RestBuilder(callback);
        final RestParams params = new RestParams.Builder().withPerPageQueryParam(true).withShouldIgnoreToken(false).withForceReadFromNetwork(forceNetwork).build();
        PollsSessionAPI.getOpenSessions(adapter, params, callback);
    }
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Example 7 with PollSessionResponse

use of com.instructure.canvasapi2.models.PollSessionResponse in project instructure-android by instructure.

the class PollsManager method getSinglePollSession.

public static void getSinglePollSession(long pollId, long pollSessionId, StatusCallback<PollSessionResponse> callback, boolean forceNetwork) {
    if (isTesting() || mTesting) {
    // TODO:
    } else {
        final RestBuilder adapter = new RestBuilder(callback);
        final RestParams params = new RestParams.Builder().withPerPageQueryParam(true).withShouldIgnoreToken(false).withForceReadFromNetwork(forceNetwork).build();
        PollsSessionAPI.getSinglePollSession(pollId, pollSessionId, adapter, params, callback);
    }
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Example 8 with PollSessionResponse

use of com.instructure.canvasapi2.models.PollSessionResponse in project instructure-android by instructure.

the class PollsManager method createPollSession.

public static void createPollSession(long pollId, long courseId, long sectionId, StatusCallback<PollSessionResponse> callback, boolean forceNetwork) {
    if (isTesting() || mTesting) {
    // TODO:
    } else {
        final RestBuilder adapter = new RestBuilder(callback);
        final RestParams params = new RestParams.Builder().withPerPageQueryParam(true).withShouldIgnoreToken(false).withForceReadFromNetwork(forceNetwork).build();
        PollsSessionAPI.createPollSession(pollId, courseId, sectionId, adapter, params, callback);
    }
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Example 9 with PollSessionResponse

use of com.instructure.canvasapi2.models.PollSessionResponse in project instructure-android by instructure.

the class PollsManager method getClosedSessions.

public static void getClosedSessions(StatusCallback<PollSessionResponse> callback, boolean forceNetwork) {
    if (isTesting() || mTesting) {
    // TODO:
    } else {
        final RestBuilder adapter = new RestBuilder(callback);
        final RestParams params = new RestParams.Builder().withPerPageQueryParam(true).withShouldIgnoreToken(false).withForceReadFromNetwork(forceNetwork).build();
        PollsSessionAPI.getClosedSessions(adapter, params, callback);
    }
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Aggregations

RestBuilder (com.instructure.canvasapi2.builders.RestBuilder)7 RestParams (com.instructure.canvasapi2.builders.RestParams)7 Bundle (android.os.Bundle)2 PollChoiceResponse (com.instructure.canvasapi2.models.PollChoiceResponse)2 PollSession (com.instructure.canvasapi2.models.PollSession)2 PollSessionResponse (com.instructure.canvasapi2.models.PollSessionResponse)2 ApiType (com.instructure.canvasapi2.utils.ApiType)2 LinkHeaders (com.instructure.canvasapi2.utils.LinkHeaders)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 ResponseBody (okhttp3.ResponseBody)2 Response (retrofit2.Response)2 Poll (com.instructure.canvasapi2.models.Poll)1 PollChoice (com.instructure.canvasapi2.models.PollChoice)1 PollResponse (com.instructure.canvasapi2.models.PollResponse)1 Section (com.instructure.canvasapi2.models.Section)1