Commit f5be9d34 authored by Ivan Del Pino's avatar Ivan Del Pino Committed by Rafael Jesus Hernández Vasquez

feat: improve interface callback response

Signed-off-by: default avatarIvan Del Pino <idelpino@teclib.com>
parent 8efdffcf
......@@ -27,7 +27,7 @@ public class GLPITest {
public void initSessionTest() throws Exception {
if (!BuildConfig.GLPI_URL.equals("")) {
GLPI glpi = new GLPI(appContext, BuildConfig.GLPI_URL);
glpi.initSessionByCredentials(BuildConfig.GLPI_USER, BuildConfig.GLPI_PASSWORD, new GLPI.InitSessionCallback() {
glpi.initSessionByCredentials(BuildConfig.GLPI_USER, BuildConfig.GLPI_PASSWORD, new GLPI.ResponseHandle<InitSession, String>() {
@Override
public void onResponse(InitSession response) {
String sessionToken = response.getSessionToken();
......
This diff is collapsed.
......@@ -32,6 +32,7 @@ import org.glpi.api.request.ChangeActiveEntitiesRequest;
import org.glpi.api.request.ChangeActiveProfileRequest;
import org.glpi.api.request.RecoveryPasswordRequest;
import org.glpi.api.request.ResetPasswordRequest;
import org.glpi.api.response.FullSessionModel;
import org.glpi.api.response.InitSession;
import java.util.Map;
......@@ -59,6 +60,10 @@ public interface Routes {
@GET("initSession")
Call<InitSession> initSessionByCredentials(@Header("Authorization") String authorization);
@Headers("Content-Type: application/json")
@GET("getFullSession")
Call<FullSessionModel> fullSession(@HeaderMap Map<String, String> headers);
@Headers("Content-Type: application/json")
@GET("killSession")
Call<Void> killSession(@HeaderMap Map<String, String> headers);
......
package org.glpi.api.response;
import com.google.gson.annotations.SerializedName;
public class FullSessionModel {
@SerializedName("session")
private Session session;
public void setSession(Session session) {
this.session = session;
}
public Session getSession() {
return session;
}
}
\ No newline at end of file
package org.glpi.api.response;
import com.google.gson.annotations.SerializedName;
public class Session {
@SerializedName("plugin_flyvemdm_guest_profiles_id")
private String pluginFlyvemdmGuestProfilesId;
public void setPluginFlyvemdmGuestProfilesId(String pluginFlyvemdmGuestProfilesId) {
this.pluginFlyvemdmGuestProfilesId = pluginFlyvemdmGuestProfilesId;
}
public String getPluginFlyvemdmGuestProfilesId() {
return pluginFlyvemdmGuestProfilesId;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment