use of com.instructure.canvasapi2.models.CourseNickname in project instructure-android by instructure.
the class CourseNicknameManager method getCourseNickname.
public static void getCourseNickname(long courseId, StatusCallback<CourseNickname> callback, boolean forceNetwork) {
if (isTesting() || mTesting) {
CourseNicknameManager_Test.getNickname(courseId, callback);
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withPerPageQueryParam(false).withShouldIgnoreToken(false).withForceReadFromNetwork(forceNetwork).build();
CourseNicknameAPI.getNickname(courseId, adapter, callback, params);
}
}
use of com.instructure.canvasapi2.models.CourseNickname in project instructure-android by instructure.
the class CourseNicknameManager method deleteNickname.
public static void deleteNickname(long courseId, final StatusCallback<CourseNickname> callback) {
if (isTesting() || mTesting) {
CourseNicknameManager_Test.deleteNickname(courseId, callback);
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withPerPageQueryParam(true).withShouldIgnoreToken(false).build();
CourseNicknameAPI.deleteNickname(courseId, adapter, callback, params);
}
}
use of com.instructure.canvasapi2.models.CourseNickname in project instructure-android by instructure.
the class CourseNicknameManager method getAllNicknames.
public static void getAllNicknames(StatusCallback<List<CourseNickname>> callback, boolean forceNetwork) {
if (isTesting() || mTesting) {
CourseNicknameManager_Test.getAllNicknames(callback);
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withPerPageQueryParam(true).withShouldIgnoreToken(false).withForceReadFromNetwork(forceNetwork).build();
CourseNicknameAPI.getAllNicknames(adapter, callback, params);
}
}
use of com.instructure.canvasapi2.models.CourseNickname in project instructure-android by instructure.
the class CourseNicknameManager_Test method getNickname.
public static void getNickname(long courseId, StatusCallback<CourseNickname> callback) {
Response response = new Response.Builder().request(new Request.Builder().url("https://test.com").build()).code(200).message("todo").protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "todo".getBytes())).addHeader("content-type", "application/json").build();
CourseNickname courseNickname = new CourseNickname();
courseNickname.setId(courseId);
retrofit2.Response<CourseNickname> response1 = retrofit2.Response.success(courseNickname, response);
callback.onResponse(response1, new LinkHeaders(), ApiType.CACHE);
}
use of com.instructure.canvasapi2.models.CourseNickname in project instructure-android by instructure.
the class CourseNicknameManager_Test method deleteAllNicknames.
public static void deleteAllNicknames(StatusCallback<CourseNickname> callback) {
Response response = new Response.Builder().request(new Request.Builder().url("https://test.com").build()).code(200).message("todo").protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "todo".getBytes())).addHeader("content-type", "application/json").build();
CourseNickname courseNickname = new CourseNickname();
retrofit2.Response<CourseNickname> response1 = retrofit2.Response.success(courseNickname, response);
callback.onResponse(response1, new LinkHeaders(), ApiType.CACHE);
}
Aggregations