Search in sources :

Example 71 with CanvasContext

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

the class SubmissionManager method postUrlSubmission.

public static void postUrlSubmission(CanvasContext canvasContext, long assignmentId, String url, boolean isLti, StatusCallback<Submission> callback) {
    if (isTesting() || mTesting) {
    // TODO
    } else {
        RestBuilder adapter = new RestBuilder(callback);
        RestParams params = new RestParams.Builder().withCanvasContext(canvasContext).build();
        String type = isLti ? "basic_lti_launch" : "online_url";
        SubmissionAPI.postUrlSubmission(canvasContext.getId(), assignmentId, type, url, adapter, params, callback);
    }
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Example 72 with CanvasContext

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

the class SubmissionManager method postMediaSubmission.

public static void postMediaSubmission(CanvasContext canvasContext, long assignmentId, String submissionType, String mediaId, String mediaType, StatusCallback<Submission> callback) {
    if (isTesting() || mTesting) {
    // TODO
    } else {
        RestBuilder adapter = new RestBuilder(callback);
        RestParams params = new RestParams.Builder().withCanvasContext(canvasContext).build();
        SubmissionAPI.postMediaSubmission(canvasContext.getId(), assignmentId, submissionType, mediaId, mediaType, adapter, params, callback);
    }
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Example 73 with CanvasContext

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

the class TabManager method getTabs.

public static void getTabs(CanvasContext canvasContext, StatusCallback<List<Tab>> callback, boolean forceNetwork) {
    if (isTesting() || mTesting) {
    // TODO: Add testing
    // TabManager_Test.getTabs(callback, courseId)
    } else {
        RestBuilder adapter = new RestBuilder(callback);
        RestParams params = new RestParams.Builder().withCanvasContext(canvasContext).withForceReadFromNetwork(forceNetwork).withShouldIgnoreToken(false).build();
        TabAPI.getTabs(canvasContext.getId(), adapter, callback, params);
    }
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Example 74 with CanvasContext

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

the class UserManager method getPeopleList.

public static void getPeopleList(CanvasContext canvasContext, StatusCallback<List<User>> callback, boolean forceNetwork) {
    if (isTesting() || mTesting) {
        RestBuilder adapter = new RestBuilder(callback);
        RestParams params = new RestParams.Builder().withForceReadFromNetwork(forceNetwork).build();
        UserManager_Test.getPeopleList(adapter, params, canvasContext.getId(), callback);
    } else {
        RestBuilder adapter = new RestBuilder(callback);
        RestParams params = new RestParams.Builder().withCanvasContext(canvasContext).withPerPageQueryParam(false).withForceReadFromNetwork(forceNetwork).build();
        UserAPI.getPeopleList(adapter, params, canvasContext.getId(), callback);
    }
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Example 75 with CanvasContext

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

the class UserManager method getFirstPagePeopleList.

public static void getFirstPagePeopleList(@NonNull CanvasContext canvasContext, boolean forceNetwork, @NonNull StatusCallback<List<User>> callback) {
    if (isTesting() || mTesting) {
    // TODO
    } else {
        final RestParams params = new RestParams.Builder().withForceReadFromNetwork(forceNetwork).withPerPageQueryParam(true).withShouldIgnoreToken(false).withCanvasContext(canvasContext).build();
        final RestBuilder adapter = new RestBuilder(callback);
        UserAPI.getFirstPagePeopleList(adapter, params, canvasContext.getId(), callback);
    }
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Aggregations

RestBuilder (com.instructure.canvasapi2.builders.RestBuilder)60 RestParams (com.instructure.canvasapi2.builders.RestParams)55 CanvasContext (com.instructure.canvasapi2.models.CanvasContext)19 StatusCallback (com.instructure.canvasapi2.StatusCallback)8 LinkHeaders (com.instructure.canvasapi2.utils.LinkHeaders)7 List (java.util.List)7 ApiType (com.instructure.canvasapi2.utils.ApiType)6 ExhaustiveListCallback (com.instructure.canvasapi2.utils.ExhaustiveListCallback)6 DiscussionTopicHeader (com.instructure.canvasapi2.models.DiscussionTopicHeader)5 FileFolder (com.instructure.canvasapi2.models.FileFolder)5 ArrayList (java.util.ArrayList)5 NotNull (org.jetbrains.annotations.NotNull)5 NonNull (android.support.annotation.NonNull)4 View (android.view.View)4 TextView (android.widget.TextView)4 UpdateFileFolder (com.instructure.canvasapi2.models.UpdateFileFolder)4 Bundle (android.os.Bundle)3 ImageView (android.widget.ImageView)3 BindView (butterknife.BindView)3 Course (com.instructure.canvasapi2.models.Course)3