From 16c54e32ae9e7b46caa9946b7a212d1b99e7a0b8 Mon Sep 17 00:00:00 2001 From: Bertie van Hinsbergen Date: Tue, 22 Sep 2020 12:39:37 +0200 Subject: [PATCH 1/3] add field isExternalTokenDisabled to User object --- .../opcon/restapiclient/model/User.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/smatechnologies/opcon/restapiclient/model/User.java b/src/main/java/com/smatechnologies/opcon/restapiclient/model/User.java index 5a66d87..80bd059 100644 --- a/src/main/java/com/smatechnologies/opcon/restapiclient/model/User.java +++ b/src/main/java/com/smatechnologies/opcon/restapiclient/model/User.java @@ -42,6 +42,7 @@ public class User { public static final String PROPERTY_LAST_LOGGED_IN = "lastLoggedIn"; public static final String PROPERTY_LAST_LOGGED_OUT = "lastLoggedOut"; public static final String PROPERTY_IS_SELF_SERVICE_USER = "isSelfServiceUser"; + public static final String PROPERTY_IS_EXTERNAL_TOKEN_DISABLED = "isExternalTokenDisabled"; public static final int MAX_CHARS_PASSWORD = 12; public static final int MAX_CHARS_EXTERNAL_PASSWORD = 20; @@ -68,6 +69,7 @@ public class User { private String lastLoggedIn; private String lastLoggedOut; private Boolean isSelfServiceUser; + private Boolean isExternalTokenDisabled; public Integer getId() { return id; @@ -221,7 +223,15 @@ public void setIsSelfServiceUser(Boolean isSelfServiceUser) { this.isSelfServiceUser = isSelfServiceUser; } - @JsonIgnore + public Boolean getIsExternalTokenDisabled() { + return isExternalTokenDisabled; + } + + public void setIsExternalTokenDisabled(Boolean isExternalTokenDisabled) { + this.isExternalTokenDisabled = isExternalTokenDisabled; + } + + @JsonIgnore public boolean isOCADMUser() { return id == User.OCADM_ID; } From 1e8a8b9a708d57edc9cfe5e39d36b5d0ab08272d Mon Sep 17 00:00:00 2001 From: Bertie van Hinsbergen Date: Tue, 22 Sep 2020 15:37:30 +0200 Subject: [PATCH 2/3] remove user updates --- .../opcon/restapiclient/model/User.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/main/java/com/smatechnologies/opcon/restapiclient/model/User.java b/src/main/java/com/smatechnologies/opcon/restapiclient/model/User.java index 80bd059..2fbf460 100644 --- a/src/main/java/com/smatechnologies/opcon/restapiclient/model/User.java +++ b/src/main/java/com/smatechnologies/opcon/restapiclient/model/User.java @@ -42,7 +42,6 @@ public class User { public static final String PROPERTY_LAST_LOGGED_IN = "lastLoggedIn"; public static final String PROPERTY_LAST_LOGGED_OUT = "lastLoggedOut"; public static final String PROPERTY_IS_SELF_SERVICE_USER = "isSelfServiceUser"; - public static final String PROPERTY_IS_EXTERNAL_TOKEN_DISABLED = "isExternalTokenDisabled"; public static final int MAX_CHARS_PASSWORD = 12; public static final int MAX_CHARS_EXTERNAL_PASSWORD = 20; @@ -69,7 +68,6 @@ public class User { private String lastLoggedIn; private String lastLoggedOut; private Boolean isSelfServiceUser; - private Boolean isExternalTokenDisabled; public Integer getId() { return id; @@ -223,14 +221,6 @@ public void setIsSelfServiceUser(Boolean isSelfServiceUser) { this.isSelfServiceUser = isSelfServiceUser; } - public Boolean getIsExternalTokenDisabled() { - return isExternalTokenDisabled; - } - - public void setIsExternalTokenDisabled(Boolean isExternalTokenDisabled) { - this.isExternalTokenDisabled = isExternalTokenDisabled; - } - @JsonIgnore public boolean isOCADMUser() { return id == User.OCADM_ID; From b25e0d947b6ace7af7ea6d98aec61b84d6921b0b Mon Sep 17 00:00:00 2001 From: Bertie van Hinsbergen Date: Fri, 30 Oct 2020 12:31:55 +0100 Subject: [PATCH 3/3] feature/WsDailySchedulesProperties added new schedule instance properties endpoint --- .../api/dailyschedules/WsDailySchedules.java | 6 ++++ .../WsDailySchedulesProperties.java | 30 +++++++++++++++++++ .../opcon/restapiclient/model/User.java | 4 --- 3 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 src/main/java/com/smatechnologies/opcon/restapiclient/api/dailyschedules/properties/WsDailySchedulesProperties.java diff --git a/src/main/java/com/smatechnologies/opcon/restapiclient/api/dailyschedules/WsDailySchedules.java b/src/main/java/com/smatechnologies/opcon/restapiclient/api/dailyschedules/WsDailySchedules.java index 0f1c1bd..ce614fe 100644 --- a/src/main/java/com/smatechnologies/opcon/restapiclient/api/dailyschedules/WsDailySchedules.java +++ b/src/main/java/com/smatechnologies/opcon/restapiclient/api/dailyschedules/WsDailySchedules.java @@ -5,6 +5,7 @@ import com.smatechnologies.opcon.restapiclient.WsFactory; import com.smatechnologies.opcon.restapiclient.WsResult; import com.smatechnologies.opcon.restapiclient.api.dailyschedules.dates.WsDates; +import com.smatechnologies.opcon.restapiclient.api.dailyschedules.properties.WsDailySchedulesProperties; import com.smatechnologies.opcon.restapiclient.model.DailySchedule; import com.smatechnologies.opcon.restapiclient.model.ScheduleDailyStatusCount; @@ -59,4 +60,9 @@ public DailySchedule get(String dailyScheduleId) throws WsException { public ScheduleDailyStatusCount countByStatus(DailySchedulesCriteria criteria) throws WsException { return wsFactory.create(Ws.Type.GET).path("count_by_status").criteria(criteria).run(ScheduleDailyStatusCount.class); } + + public WsDailySchedulesProperties properties(String dailyScheduleId) { + return new WsDailySchedulesProperties(wsFactory.path(dailyScheduleId)); + } + } \ No newline at end of file diff --git a/src/main/java/com/smatechnologies/opcon/restapiclient/api/dailyschedules/properties/WsDailySchedulesProperties.java b/src/main/java/com/smatechnologies/opcon/restapiclient/api/dailyschedules/properties/WsDailySchedulesProperties.java new file mode 100644 index 0000000..aa0ca05 --- /dev/null +++ b/src/main/java/com/smatechnologies/opcon/restapiclient/api/dailyschedules/properties/WsDailySchedulesProperties.java @@ -0,0 +1,30 @@ +package com.smatechnologies.opcon.restapiclient.api.dailyschedules.properties; + +import com.smatechnologies.opcon.commons.util.HtmlUtil; +import com.smatechnologies.opcon.restapiclient.Ws; +import com.smatechnologies.opcon.restapiclient.WsException; +import com.smatechnologies.opcon.restapiclient.WsFactory; +import com.smatechnologies.opcon.restapiclient.model.Property; + +import javax.ws.rs.core.GenericType; +import java.util.List; + +public class WsDailySchedulesProperties { + + private final WsFactory wsFactory; + + public WsDailySchedulesProperties(WsFactory wsFactory) { + this.wsFactory = wsFactory.path("properties"); + } + + public List get() throws WsException { + return wsFactory.create(Ws.Type.GET).run(new GenericType>() { + + }); + } + + public Property get(String name) throws WsException { + return wsFactory.create(Ws.Type.GET).path(HtmlUtil.doubleUrlEncodeSlash(name)).run(Property.class); + } + +} diff --git a/src/main/java/com/smatechnologies/opcon/restapiclient/model/User.java b/src/main/java/com/smatechnologies/opcon/restapiclient/model/User.java index 19098ba..733c687 100644 --- a/src/main/java/com/smatechnologies/opcon/restapiclient/model/User.java +++ b/src/main/java/com/smatechnologies/opcon/restapiclient/model/User.java @@ -225,9 +225,6 @@ public void setIsSelfServiceUser(Boolean isSelfServiceUser) { this.isSelfServiceUser = isSelfServiceUser; } -<<<<<<< HEAD - @JsonIgnore -======= public Boolean getIsUserTokenDisabled() { return isUserTokenDisabled; } @@ -245,7 +242,6 @@ public void setIsExternalTokenDisabled(Boolean externalTokenDisabled) { } @JsonIgnore ->>>>>>> e97de5edc1ad50cd80169e331c0bbeea8e6d73ee public boolean isOCADMUser() { return id == User.OCADM_ID; }