Skip to content

Commit

Permalink
Version 3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
szprutamich committed Aug 30, 2022
1 parent b6fda9d commit 46396d5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.testdroid</groupId>
<artifactId>testdroid-api</artifactId>
<version>3.3</version>
<version>3.4</version>
<packaging>jar</packaging>
<name>Bitbar API v2</name>
<url>https://github.com/bitbar/testdroid-api</url>
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/testdroid/api/dto/MappingKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
18 changes: 15 additions & 3 deletions src/main/java/com/testdroid/api/model/APIDeviceSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ public boolean isSettable() {

private String externalId;

private String clientSideId;

private Long userId;

private String userEmail;
Expand All @@ -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,
Expand All @@ -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;
Expand Down Expand Up @@ -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<APIDeviceSessionStep> getDeviceSessionStepsResource() throws APIException {
return getListResource(createUri(selfURI, "/steps"), APIDeviceSessionStep.class);
Expand Down Expand Up @@ -530,6 +541,7 @@ protected <T extends APIEntity> 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;
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/com/testdroid/api/model/APIUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,11 @@ private Map<String, Object> getCreateProjectParams(String name) {
return result;
}

private Map<String, Object> getUpdateDeviceSessionParams(final String name, final APIDeviceSession.State state) {
private Map<String, Object> getUpdateDeviceSessionParams(
final String name, final String clientSideId, final APIDeviceSession.State state) {
Map<String, Object> map = new HashMap<>();
map.put(NAME, name);
map.put(CLIENT_SIDE_ID, clientSideId);
map.put(STATE, state);
return map;
}
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 46396d5

Please sign in to comment.