diff --git a/pom.xml b/pom.xml index 1ba48af..03fac0d 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.testdroid testdroid-api - 3.3 + 3.4 jar Bitbar API v2 https://github.com/bitbar/testdroid-api diff --git a/src/main/java/com/testdroid/api/dto/MappingKey.java b/src/main/java/com/testdroid/api/dto/MappingKey.java index e060276..d5da958 100644 --- a/src/main/java/com/testdroid/api/dto/MappingKey.java +++ b/src/main/java/com/testdroid/api/dto/MappingKey.java @@ -50,6 +50,7 @@ public class MappingKey { public static final String CENT_PRICE = "centPrice"; public static final String CHARGE_TYPE = "chargeType"; public static final String CITY = "city"; + public static final String CLIENT_SIDE_ID = "clientSideId"; public static final String CLOSE_TIME = "closeTime"; public static final String CLUSTER_DOT_NAME = "cluster.name"; public static final String CLUSTER_ID = "clusterId"; diff --git a/src/main/java/com/testdroid/api/model/APIDeviceSession.java b/src/main/java/com/testdroid/api/model/APIDeviceSession.java index f6c5d12..303e3f2 100644 --- a/src/main/java/com/testdroid/api/model/APIDeviceSession.java +++ b/src/main/java/com/testdroid/api/model/APIDeviceSession.java @@ -150,6 +150,8 @@ public boolean isSettable() { private String externalId; + private String clientSideId; + private Long userId; private String userEmail; @@ -164,9 +166,9 @@ public APIDeviceSession() { } public APIDeviceSession( - Long id, String externalId, Long userId, String userEmail, Long accountId, APIDeviceSession.Type type, - LocalDateTime createTime, LocalDateTime startTime, LocalDateTime installTime, LocalDateTime endTime, - Long timeLimit, Long deviceLogFirstTimestamp, APIDeviceSession.State state, + Long id, String externalId, String clientSideId, Long userId, String userEmail, Long accountId, + APIDeviceSession.Type type, LocalDateTime createTime, LocalDateTime startTime, LocalDateTime installTime, + LocalDateTime endTime, Long timeLimit, Long deviceLogFirstTimestamp, APIDeviceSession.State state, Integer testCasePassedCount, Integer testCaseFailedCount, Integer testCaseSkippedCount, Boolean billable, Long deviceModelId, String displayName, String deviceManufacturer, Integer creditsPrice, String imagePrefix, Integer imageTop, Integer imageLeft, Integer imageWidth, Integer imageHeight, Integer frameExtraWidth, @@ -177,6 +179,7 @@ public APIDeviceSession( APIDeviceSessionConfig config) { super(id); this.externalId = externalId; + this.clientSideId = clientSideId; this.userId = userId; this.userEmail = userEmail; this.accountId = accountId; @@ -485,6 +488,14 @@ public void setConfig(APIDeviceSessionConfig config) { this.config = config; } + public String getClientSideId() { + return clientSideId; + } + + public void setClientSideId(String clientSideId) { + this.clientSideId = clientSideId; + } + @JsonIgnore public APIListResource getDeviceSessionStepsResource() throws APIException { return getListResource(createUri(selfURI, "/steps"), APIDeviceSessionStep.class); @@ -530,6 +541,7 @@ protected void clone(T from) { APIDeviceSession apiDeviceSession = (APIDeviceSession) from; cloneBase(from); this.externalId = apiDeviceSession.externalId; + this.clientSideId = apiDeviceSession.clientSideId; this.userId = apiDeviceSession.userId; this.userEmail = apiDeviceSession.userEmail; this.accountId = apiDeviceSession.accountId; diff --git a/src/main/java/com/testdroid/api/model/APIUser.java b/src/main/java/com/testdroid/api/model/APIUser.java index 5de641b..9c0bf8c 100644 --- a/src/main/java/com/testdroid/api/model/APIUser.java +++ b/src/main/java/com/testdroid/api/model/APIUser.java @@ -478,9 +478,11 @@ private Map getCreateProjectParams(String name) { return result; } - private Map getUpdateDeviceSessionParams(final String name, final APIDeviceSession.State state) { + private Map getUpdateDeviceSessionParams( + final String name, final String clientSideId, final APIDeviceSession.State state) { Map map = new HashMap<>(); map.put(NAME, name); + map.put(CLIENT_SIDE_ID, clientSideId); map.put(STATE, state); return map; } @@ -553,9 +555,10 @@ public APIDeviceGroup createDeviceGroup(String displayName, APIDevice.OsType osT } @JsonIgnore - public APIDeviceSession updateDeviceSession(String sessionId, String name, APIDeviceSession.State state) + public APIDeviceSession updateDeviceSession( + String sessionId, String name, String clientSideId, APIDeviceSession.State state) throws APIException { - return postResource(getDeviceSessionURI(sessionId), getUpdateDeviceSessionParams(name, state), + return postResource(getDeviceSessionURI(sessionId), getUpdateDeviceSessionParams(name, clientSideId, state), APIDeviceSession.class); }