diff --git a/pom.xml b/pom.xml
index f25d448..0ff0d08 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2,7 +2,7 @@
4.0.0
com.testdroid
testdroid-api
- 2.102
+ 2.103
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 7a59034..8168696 100644
--- a/src/main/java/com/testdroid/api/dto/MappingKey.java
+++ b/src/main/java/com/testdroid/api/dto/MappingKey.java
@@ -83,6 +83,7 @@ public class MappingKey {
public static final String DEVICE_DOT_ARCHIVE_TIME = "device.archiveTime";
public static final String DEVICE_DOT_DISPLAY_NAME = "device.displayName";
public static final String DEVICE_DOT_ID = "device.id";
+ public static final String DEVICE_FILTER_GROUP_NAME= "deviceFilterGroup.name";
public static final String DEVICE_ID = "deviceId";
public static final String DEVICE_IDS_ARR = "deviceIds[]";
public static final String DEVICE_MODEL_DOT_ID = "deviceModel.id";
diff --git a/src/main/java/com/testdroid/api/model/APIAccountConcurrencyStatus.java b/src/main/java/com/testdroid/api/model/APIAccountConcurrencyStatus.java
new file mode 100644
index 0000000..2f005ff
--- /dev/null
+++ b/src/main/java/com/testdroid/api/model/APIAccountConcurrencyStatus.java
@@ -0,0 +1,78 @@
+package com.testdroid.api.model;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.testdroid.api.APIEntity;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.Objects;
+
+/**
+ * @author Damian Sniezek
+ */
+@XmlRootElement
+public class APIAccountConcurrencyStatus extends APIEntity {
+
+ private Long runningSessions;
+
+ private Long waitingSessions;
+
+ private Long sessions;
+
+ private Integer accountConcurrency;
+
+ private String mainUserEmail;
+
+ private Boolean unlimitedConcurrency;
+
+ APIAccountConcurrencyStatus(){
+
+ }
+
+ public Integer getAccountConcurrency() {
+ return accountConcurrency;
+ }
+
+ public Long getRunningSessions() {
+ return runningSessions;
+ }
+
+ public Long getWaitingSessions() {
+ return waitingSessions;
+ }
+
+ public Long getSessions() {
+ return sessions;
+ }
+
+ public String getMainUserEmail() {
+ return mainUserEmail;
+ }
+
+ public Boolean getUnlimitedConcurrency() {
+ return unlimitedConcurrency;
+ }
+
+ public APIAccountConcurrencyStatus(
+ Long accountId, String mainUserEmail, Long waitingSessions, Long runningSessions,
+ Integer accountConcurrency, Boolean hasMobileConcurrencyRole) {
+ super(accountId);
+ this.runningSessions = runningSessions;
+ this.waitingSessions = waitingSessions;
+ this.sessions = runningSessions + waitingSessions;
+ this.mainUserEmail = mainUserEmail;
+ this.accountConcurrency = accountConcurrency;
+ this.unlimitedConcurrency = hasMobileConcurrencyRole && Objects.isNull(accountConcurrency);
+ }
+
+ @Override
+ @JsonIgnore
+ protected void clone(T from) {
+ APIAccountConcurrencyStatus origin = (APIAccountConcurrencyStatus) from;
+ cloneBase(from);
+ this.runningSessions = origin.runningSessions;
+ this.waitingSessions = origin.waitingSessions;
+ this.sessions = origin.sessions;
+ this.accountConcurrency = origin.accountConcurrency;
+ this.mainUserEmail = origin.mainUserEmail;
+ }
+}
diff --git a/src/main/java/com/testdroid/api/model/APIAccountPreference.java b/src/main/java/com/testdroid/api/model/APIAccountPreference.java
new file mode 100644
index 0000000..8f7427e
--- /dev/null
+++ b/src/main/java/com/testdroid/api/model/APIAccountPreference.java
@@ -0,0 +1,61 @@
+package com.testdroid.api.model;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.testdroid.api.APIEntity;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * @author Damian Sniezek
+ */
+@XmlRootElement
+public class APIAccountPreference extends APIEntity implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private List allowedFileExtensions = new ArrayList<>();
+
+ public List getAllowedFileExtensions() {
+ return allowedFileExtensions;
+ }
+
+ public APIAccountPreference setAllowedFileExtensions(List allowedFileExtensions) {
+ this.allowedFileExtensions = allowedFileExtensions;
+ return this;
+ }
+
+ @Override
+ public void setId(Long id) {
+ super.setId(id);
+ this.selfURI = String.format("/accounts/%s/preferences", id);
+ }
+
+ @Override
+ @JsonIgnore
+ protected void clone(T from) {
+ APIAccountPreference prototype = (APIAccountPreference) from;
+ cloneBase(from);
+ this.allowedFileExtensions = prototype.allowedFileExtensions;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ APIAccountPreference that = (APIAccountPreference) o;
+ return allowedFileExtensions.equals(that.allowedFileExtensions);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(allowedFileExtensions);
+ }
+}
diff --git a/src/main/java/com/testdroid/api/model/APIDeviceFilter.java b/src/main/java/com/testdroid/api/model/APIDeviceFilter.java
index 2cc8b38..8634898 100644
--- a/src/main/java/com/testdroid/api/model/APIDeviceFilter.java
+++ b/src/main/java/com/testdroid/api/model/APIDeviceFilter.java
@@ -17,14 +17,22 @@ public class APIDeviceFilter extends APIEntity {
private boolean hidden;
+ //Technical field to allow group by it
+ @JsonIgnore
+ private String labelGroupDisplayName;
+
public APIDeviceFilter() {
}
- public APIDeviceFilter(Long id, String name, String displayName, boolean hidden) {
- super(id);
- this.name = name;
- this.displayName = displayName;
+ public APIDeviceFilter(
+ Long labelId, String labelName, String labelDisplayName, Long labelGroupId, String labelGroupDisplayName,
+ boolean hidden, Long order) {
+ super(labelId);
+ this.parentId = labelGroupId;
+ this.name = labelName;
+ this.displayName = labelDisplayName;
this.hidden = hidden;
+ this.labelGroupDisplayName = labelGroupDisplayName;
}
public String getName() {
@@ -51,6 +59,10 @@ public void setHidden(boolean hidden) {
this.hidden = hidden;
}
+ public String getLabelGroupDisplayName() {
+ return labelGroupDisplayName;
+ }
+
@Override
@JsonIgnore
protected void clone(T from) {
diff --git a/src/main/java/com/testdroid/api/model/APIDeviceFilterGroup.java b/src/main/java/com/testdroid/api/model/APIDeviceFilterGroup.java
index 6243b4f..c76ce56 100644
--- a/src/main/java/com/testdroid/api/model/APIDeviceFilterGroup.java
+++ b/src/main/java/com/testdroid/api/model/APIDeviceFilterGroup.java
@@ -37,8 +37,9 @@ public List getDeviceFilters() {
return deviceFilters;
}
- public void setDeviceFilters(List deviceFilters) {
+ public APIDeviceFilterGroup setDeviceFilters(List deviceFilters) {
this.deviceFilters = deviceFilters;
+ return this;
}
@Override
diff --git a/src/main/java/com/testdroid/api/model/APIDeviceSession.java b/src/main/java/com/testdroid/api/model/APIDeviceSession.java
index 6cda643..a96a650 100644
--- a/src/main/java/com/testdroid/api/model/APIDeviceSession.java
+++ b/src/main/java/com/testdroid/api/model/APIDeviceSession.java
@@ -140,13 +140,15 @@ public boolean isFinished() {
private Integer rowIndex;
+ private Long accountId;
+
public APIDeviceSession() {
}
public APIDeviceSession(
- Long id, Long userId, String userEmail, APIDeviceSession.Type type, LocalDateTime createTime,
- LocalDateTime startTime, LocalDateTime installTime, LocalDateTime endTime, Long timeLimit,
- Long launchAppDuration, Long deviceLogFirstTimestamp, APIDeviceSession.State state,
+ Long id, Long userId, String userEmail, Long accountId, APIDeviceSession.Type type,
+ LocalDateTime createTime, LocalDateTime startTime, LocalDateTime installTime, LocalDateTime endTime,
+ Long timeLimit, Long launchAppDuration, Long deviceLogFirstTimestamp, APIDeviceSession.State state,
Integer testCasePassedCount, Integer testCaseFailedCount, Integer testCaseSkippedCount, Boolean billable,
Long deviceModelId, String displayName, Integer creditsPrice, String imagePrefix, Integer imageTop,
Integer imageLeft, Integer imageWidth, Integer imageHeight, Integer frameExtraWidth,
@@ -157,6 +159,7 @@ public APIDeviceSession(
super(id);
this.userId = userId;
this.userEmail = userEmail;
+ this.accountId = accountId;
this.type = type;
this.createTime = TimeConverter.toDate(createTime);
this.startTime = TimeConverter.toDate(startTime);
@@ -446,6 +449,14 @@ public void setRowIndex(Integer rowIndex) {
this.rowIndex = rowIndex;
}
+ public Long getAccountId() {
+ return accountId;
+ }
+
+ public void setAccountId(Long accountId) {
+ this.accountId = accountId;
+ }
+
@JsonIgnore
public APIListResource getDeviceSessionStepsResource() throws APIException {
return getListResource(createUri(selfURI, "/steps"), APIDeviceSessionStep.class);
@@ -481,6 +492,7 @@ protected void clone(T from) {
cloneBase(from);
this.userId = apiDeviceSession.userId;
this.userEmail = apiDeviceSession.userEmail;
+ this.accountId = apiDeviceSession.accountId;
this.createTime = apiDeviceSession.createTime;
this.startTime = apiDeviceSession.startTime;
this.installTime = apiDeviceSession.installTime;
diff --git a/src/main/java/com/testdroid/api/util/TypeReferenceFactory.java b/src/main/java/com/testdroid/api/util/TypeReferenceFactory.java
index b814d0d..4311f24 100644
--- a/src/main/java/com/testdroid/api/util/TypeReferenceFactory.java
+++ b/src/main/java/com/testdroid/api/util/TypeReferenceFactory.java
@@ -166,6 +166,8 @@ public class TypeReferenceFactory {
});
TYPE_REFERENCE_MAP.put(APIAccount.class, new TypeReference() {
});
+ TYPE_REFERENCE_MAP.put(APIAccountPreference.class, new TypeReference() {
+ });
TYPE_REFERENCE_MAP.put(APIAdminOverview.class, new TypeReference() {
});
TYPE_REFERENCE_MAP.put(APICloudInfo.class, new TypeReference() {