use of com.instructure.canvasapi2.models.ResetParent 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.ResetParent in project instructure-android by instructure.
the class UserManager_Test method resetParentPassword.
public static void resetParentPassword(String airwolfDomain, RestBuilder adapter, RestParams params, String email, String password, StatusCallback<ResetParent> callback) {
adapter.setStatusCallback(callback);
Response response = new Response.Builder().code(200).message("success").protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "success".getBytes())).addHeader("content-type", "application/json").build();
retrofit2.Response response1 = retrofit2.Response.success(response);
callback.onResponse(response1, new LinkHeaders(), ApiType.API);
}
use of com.instructure.canvasapi2.models.ResetParent in project instructure-android by instructure.
the class UserManager method resetParentPasswordAirwolf.
public static void resetParentPasswordAirwolf(String airwolfDomain, String username, String password, StatusCallback<ResetParent> 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.resetParentPassword(airwolfDomain, adapter, params, username, password, callback);
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withShouldIgnoreToken(false).withPerPageQueryParam(false).withDomain(airwolfDomain).withAPIVersion("").withForceReadFromNetwork(true).build();
UserAPI.resetParentPassword(adapter, params, username, password, callback);
}
}
Aggregations