use of com.instructure.canvasapi2.models.Parent in project instructure-android by instructure.
the class UserAPI method resetParentPassword.
/**
* The API call to actually reset the parent's password to the one they just created.
*
* @param userName
* @param password
* @param callback
*/
public static void resetParentPassword(@NonNull RestBuilder adapter, @NonNull RestParams params, @NonNull String userName, @NonNull String password, @NonNull StatusCallback<ResetParent> callback) {
Parent parent = new Parent();
parent.setUsername(userName);
parent.setPassword(password);
callback.addCall(adapter.build(UsersInterface.class, params).resetParentPasswordAirwolf(parent)).enqueue(callback);
}
use of com.instructure.canvasapi2.models.Parent in project instructure-android by instructure.
the class UserAPI method addParentAirwolf.
/**
* Add parent to Airwolf/Canvas. Currently only used in the Parent App.
* @param body
* @param callback
*/
public static void addParentAirwolf(@NonNull RestBuilder adapter, @NonNull RestParams params, @NonNull Parent body, @NonNull StatusCallback<ParentResponse> callback) {
ParentWrapper parentWrapper = new ParentWrapper();
parentWrapper.setParent(body);
callback.addCall(adapter.build(UsersInterface.class, params).addParentAirwolf(parentWrapper)).enqueue(callback);
}
use of com.instructure.canvasapi2.models.Parent in project instructure-android by instructure.
the class DiscussionEntryTest method initTest_Unread.
@Test
public void initTest_Unread() throws Exception {
DiscussionTopic topic = new DiscussionTopic();
DiscussionEntry parent = new DiscussionEntry();
DiscussionEntry entry = new DiscussionEntry();
entry.init(topic, parent);
assertEquals(0, entry.getUnreadChildren());
}
use of com.instructure.canvasapi2.models.Parent in project instructure-android by instructure.
the class UserManager method addParentAirwolf.
public static void addParentAirwolf(String airwolfDomain, Parent parent, StatusCallback<ParentResponse> callback) {
if (isTesting() || mTesting) {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withShouldIgnoreToken(false).withPerPageQueryParam(false).withDomain(airwolfDomain).withAPIVersion("").withForceReadFromNetwork(true).build();
UserManager_Test.addParentAirwolf(airwolfDomain, adapter, params, parent, callback);
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withShouldIgnoreToken(false).withPerPageQueryParam(false).withDomain(airwolfDomain).withAPIVersion("").withForceReadFromNetwork(true).build();
UserAPI.addParentAirwolf(adapter, params, parent, callback);
}
}
use of com.instructure.canvasapi2.models.Parent in project instructure-android by instructure.
the class RoboTesting method setAppStatePrefs.
static void setAppStatePrefs(Context context) {
// save parent id and user name
Prefs prefs = new Prefs(context, context.getString(R.string.app_name_parent));
prefs.save(com.instructure.pandautils.utils.Const.ID, BuildConfig.ROBO_TEST_USER_ID);
prefs.save(com.instructure.pandautils.utils.Const.NAME, BuildConfig.ROBO_TEST_USERNAME);
// save token
ApiPrefs.setToken(BuildConfig.ROBO_TEST_API_KEY);
// Set domain to gamma
ApiPrefs.setAirwolfDomain(BuildConfig.GAMMA_DOMAIN);
}
Aggregations