Search in sources :

Example 6 with Favorite

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

the class GroupManager method removeGroupFromFavorites.

public static void removeGroupFromFavorites(long groupId, StatusCallback<Favorite> callback) {
    if (isTesting() || mTesting) {
    // TODO
    } else {
        final RestParams params = new RestParams.Builder().withPerPageQueryParam(false).withShouldIgnoreToken(false).build();
        final RestBuilder adapter = new RestBuilder(callback);
        GroupAPI.removeGroupFromFavorites(adapter, callback, params, groupId);
    }
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Example 7 with Favorite

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

the class CourseManager_Test method addCourseToFavorites.

public static void addCourseToFavorites(long courseId, StatusCallback<Favorite> callback) {
    // TODO:
    Response response = new Response.Builder().request(new Request.Builder().url("https://test.com").build()).code(200).message("favorite" + " " + courseId).protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "favorite".getBytes())).addHeader("content-type", "application/json").build();
    Favorite favorite = new Favorite();
    retrofit2.Response<Favorite> response1 = retrofit2.Response.success(favorite, response);
    callback.onResponse(response1, new LinkHeaders(), ApiType.CACHE);
}
Also used : GradingPeriodResponse(com.instructure.canvasapi2.models.GradingPeriodResponse) Response(okhttp3.Response) Favorite(com.instructure.canvasapi2.models.Favorite) LinkHeaders(com.instructure.canvasapi2.utils.LinkHeaders) Request(okhttp3.Request)

Aggregations

RestBuilder (com.instructure.canvasapi2.builders.RestBuilder)4 RestParams (com.instructure.canvasapi2.builders.RestParams)4 Favorite (com.instructure.canvasapi2.models.Favorite)2 GradingPeriodResponse (com.instructure.canvasapi2.models.GradingPeriodResponse)2 LinkHeaders (com.instructure.canvasapi2.utils.LinkHeaders)2 Request (okhttp3.Request)2 Response (okhttp3.Response)2 Intent (android.content.Intent)1 View (android.view.View)1 User (com.instructure.canvasapi2.models.User)1 ZendeskDialogStyled (com.instructure.loginapi.login.api.zendesk.utilities.ZendeskDialogStyled)1