Search in sources :

Example 1 with ParentResponse

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

the class UserManager_Test method authenticateParentAirwolf.

public static void authenticateParentAirwolf(String airwolfDomain, RestBuilder adapter, RestParams params, String email, String password, StatusCallback<ParentResponse> 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);
}
Also used : Response(okhttp3.Response) ParentResponse(com.instructure.canvasapi2.models.ParentResponse) LinkHeaders(com.instructure.canvasapi2.utils.LinkHeaders) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Example 2 with ParentResponse

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

the class UserManager_Test method addParentAirwolf.

public static void addParentAirwolf(String airwolfDomain, RestBuilder adapter, RestParams params, Parent parent, StatusCallback<ParentResponse> 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);
}
Also used : Response(okhttp3.Response) ParentResponse(com.instructure.canvasapi2.models.ParentResponse) LinkHeaders(com.instructure.canvasapi2.utils.LinkHeaders) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Example 3 with ParentResponse

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

the class UserAPI method authenticateParentAirwolf.

public static void authenticateParentAirwolf(@NonNull RestBuilder adapter, @NonNull RestParams params, @NonNull String email, @NonNull String password, @NonNull StatusCallback<ParentResponse> callback) {
    Parent parent = new Parent();
    parent.setUsername(email);
    parent.setPassword(password);
    callback.addCall(adapter.build(UsersInterface.class, params).authenticateParentAirwolf(parent)).enqueue(callback);
}
Also used : Parent(com.instructure.canvasapi2.models.Parent) ResetParent(com.instructure.canvasapi2.models.ResetParent)

Example 4 with ParentResponse

use of com.instructure.canvasapi2.models.ParentResponse 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);
}
Also used : ParentWrapper(com.instructure.canvasapi2.models.ParentWrapper)

Example 5 with ParentResponse

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

the class UserManager_Test method authenticateCanvasParentAirwolf.

public static void authenticateCanvasParentAirwolf(String domain, RestBuilder adapter, RestParams params, StatusCallback<ParentResponse> 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);
}
Also used : Response(okhttp3.Response) ParentResponse(com.instructure.canvasapi2.models.ParentResponse) LinkHeaders(com.instructure.canvasapi2.utils.LinkHeaders) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Aggregations

RestBuilder (com.instructure.canvasapi2.builders.RestBuilder)6 RestParams (com.instructure.canvasapi2.builders.RestParams)3 ParentResponse (com.instructure.canvasapi2.models.ParentResponse)3 LinkHeaders (com.instructure.canvasapi2.utils.LinkHeaders)3 Response (okhttp3.Response)3 Parent (com.instructure.canvasapi2.models.Parent)1 ParentWrapper (com.instructure.canvasapi2.models.ParentWrapper)1 ResetParent (com.instructure.canvasapi2.models.ResetParent)1