diff --git a/pom.xml b/pom.xml index 410327b..6eb3ee2 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.testdroid testdroid-api - 3.31.0 + 3.32.0 jar Bitbar API v2 https://github.com/bitbar/testdroid-api @@ -22,7 +22,7 @@ 4.4 2.16.0 1.10.0 - 9.1.0 + 9.2.0 0.8.12 0.10.2 diff --git a/src/main/java/com/testdroid/api/dto/MappingKey.java b/src/main/java/com/testdroid/api/dto/MappingKey.java index b449202..7839ce1 100644 --- a/src/main/java/com/testdroid/api/dto/MappingKey.java +++ b/src/main/java/com/testdroid/api/dto/MappingKey.java @@ -339,6 +339,7 @@ private MappingKey() { public static final String TEST_EXECUTING = "testExecuting"; public static final String TEST_RUN_ID = "testRunId"; public static final String TEST_RUN_NAME = "testRunName"; + public static final String TEST_TIMEOUT = "testTimeout"; public static final String TEST_TIME_LIMIT = "testTimeLimit"; public static final String TETHERING_ON = "tetheringOn"; public static final String TIME_LIMIT = "timeLimit"; @@ -377,7 +378,6 @@ private MappingKey() { public static final String WAITING_DEVICE_COUNT = "waitingDeviceCount"; public static final String WARNING_DEVICE_COUNT = "warningDeviceCount"; public static final String WIDTH = "width"; - public static final String WITH_ADDRESS = "withAddress"; public static final String WITH_BROWSERS = "withBrowsers"; public static final String WITH_DEDICATED = "withDedicated"; public static final String WITH_DEDICATED_DEVICES_INFO = "withDedicatedDevicesInfo"; diff --git a/src/main/java/com/testdroid/api/dto/Operand.java b/src/main/java/com/testdroid/api/dto/Operand.java index a5ff277..05ace2a 100644 --- a/src/main/java/com/testdroid/api/dto/Operand.java +++ b/src/main/java/com/testdroid/api/dto/Operand.java @@ -10,6 +10,7 @@ public enum Operand { BEFORE(2), ON(2), EQ(2), + NOTEQ(2), CONTAINS(2), LIKE(2), NOTLIKE(2), diff --git a/src/main/java/com/testdroid/api/model/APIAccount.java b/src/main/java/com/testdroid/api/model/APIAccount.java index 9a1e891..ce7dc11 100644 --- a/src/main/java/com/testdroid/api/model/APIAccount.java +++ b/src/main/java/com/testdroid/api/model/APIAccount.java @@ -22,6 +22,9 @@ public class APIAccount extends APIEntity { private String userName; + @JsonInclude(Include.NON_NULL) + private APIInvoiceDetails invoiceDetails; + @JsonInclude(Include.NON_NULL) private String activeServiceName; @@ -95,6 +98,14 @@ public void setDedicatedDevicesCount(Long dedicatedDevicesCount) { this.dedicatedDevicesCount = dedicatedDevicesCount; } + public APIInvoiceDetails getInvoiceDetails() { + return invoiceDetails; + } + + public void setInvoiceDetails(APIInvoiceDetails invoiceDetails) { + this.invoiceDetails = invoiceDetails; + } + @Override @JsonIgnore protected void clone(T from) { @@ -106,5 +117,6 @@ protected void clone(T from) { this.comment = account.comment; this.name = account.name; this.userName = account.userName; + this.invoiceDetails = account.invoiceDetails; } } diff --git a/src/main/java/com/testdroid/api/model/APIAccountPreference.java b/src/main/java/com/testdroid/api/model/APIAccountPreference.java index 2baf6c8..b101d9e 100644 --- a/src/main/java/com/testdroid/api/model/APIAccountPreference.java +++ b/src/main/java/com/testdroid/api/model/APIAccountPreference.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.testdroid.api.APIEntity; +import java.io.Serial; import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -13,10 +14,15 @@ */ public class APIAccountPreference extends APIEntity implements Serializable { + @Serial private static final long serialVersionUID = 1L; private List allowedFileExtensions = new ArrayList<>(); + private Long testTimeout; + + private Long defaultTestTimeout; + public List getAllowedFileExtensions() { return allowedFileExtensions; } @@ -26,6 +32,24 @@ public APIAccountPreference setAllowedFileExtensions(List allowedFileExt return this; } + public Long getTestTimeout() { + return testTimeout; + } + + public APIAccountPreference setTestTimeout(Long testTimeout) { + this.testTimeout = testTimeout; + return this; + } + + public Long getDefaultTestTimeout() { + return defaultTestTimeout; + } + + public APIAccountPreference setDefaultTestTimeout(Long defaultTestTimeout) { + this.defaultTestTimeout = defaultTestTimeout; + return this; + } + @Override public void setId(Long id) { super.setId(id); @@ -38,6 +62,8 @@ protected void clone(T from) { APIAccountPreference prototype = (APIAccountPreference) from; cloneBase(from); this.allowedFileExtensions = prototype.allowedFileExtensions; + this.testTimeout = prototype.testTimeout; + this.defaultTestTimeout = prototype.defaultTestTimeout; } @Override @@ -45,15 +71,16 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { + if (!(o instanceof APIAccountPreference that)) { return false; } - APIAccountPreference that = (APIAccountPreference) o; - return allowedFileExtensions.equals(that.allowedFileExtensions); + return Objects.equals(allowedFileExtensions, that.allowedFileExtensions) + && Objects.equals(testTimeout, that.testTimeout) + && Objects.equals(defaultTestTimeout, that.defaultTestTimeout); } @Override public int hashCode() { - return Objects.hash(allowedFileExtensions); + return Objects.hash(allowedFileExtensions, testTimeout, defaultTestTimeout); } } diff --git a/src/main/java/com/testdroid/api/model/APIBillingPeriod.java b/src/main/java/com/testdroid/api/model/APIBillingPeriod.java index 3a1b8b1..923dc6b 100644 --- a/src/main/java/com/testdroid/api/model/APIBillingPeriod.java +++ b/src/main/java/com/testdroid/api/model/APIBillingPeriod.java @@ -13,6 +13,10 @@ */ public class APIBillingPeriod extends APIEntity { + private Long accountId; + + private String accountName; + private Long accountServiceId; private Date startBillingPeriod; @@ -55,7 +59,8 @@ public APIBillingPeriod( LocalDateTime subscriptionStart, LocalDateTime subscriptionEnd, Long additionalHours, Long servicePrice, Long additionalHoursPrice, LocalDateTime paymentDate, LocalDateTime additionalHoursPaymentDate, - LocalDateTime lastPaymentDate, LocalDateTime createTime, APIPaymentMethod paymentMethod) { + LocalDateTime lastPaymentDate, LocalDateTime createTime, APIPaymentMethod paymentMethod, + Long accountId, String accountName) { super(billingPeriodId); this.accountServiceId = accountServiceId; this.plan = plan; @@ -72,6 +77,8 @@ public APIBillingPeriod( this.paymentMethod = paymentMethod; this.createTime = TimeConverter.toDate(createTime); this.apiBillingPeriodType = type(startBillingPeriod, endBillingPeriod, subscriptionStart, subscriptionEnd); + this.setAccountId(accountId); + this.setAccountName(accountName); } private static APIBillingPeriodType type( @@ -216,6 +223,22 @@ public void setUsages(List usages) { this.usages = usages; } + public Long getAccountId() { + return accountId; + } + + public void setAccountId(Long accountId) { + this.accountId = accountId; + } + + public String getAccountName() { + return accountName; + } + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + @Override protected void clone(T from) { APIBillingPeriod period = (APIBillingPeriod) from; @@ -234,5 +257,7 @@ protected void clone(T from) { this.apiBillingPeriodType = period.apiBillingPeriodType; this.accountServiceId = period.accountServiceId; this.usages = period.usages; + this.accountId = period.accountId; + this.accountName = period.accountName; } } diff --git a/src/main/java/com/testdroid/api/model/APIInvoiceDetails.java b/src/main/java/com/testdroid/api/model/APIInvoiceDetails.java new file mode 100644 index 0000000..06a4b97 --- /dev/null +++ b/src/main/java/com/testdroid/api/model/APIInvoiceDetails.java @@ -0,0 +1,97 @@ +package com.testdroid.api.model; + +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + * @author MichaƂ Szpruta + */ +public class APIInvoiceDetails { + + private String address; + + private String city; + + private String code; + + private String country; + + private String state; + + public APIInvoiceDetails() { + + } + + public APIInvoiceDetails(String address, String city, String code, String country, String state) { + this.address = address; + this.city = city; + this.code = code; + this.country = country; + this.state = state; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public boolean isUpdate() { + return ObjectUtils.anyNotNull(address, city, state, country, code); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + + if (!(o instanceof APIInvoiceDetails that)) { + return false; + } + + return new EqualsBuilder().append(address, that.address).append(city, that.city) + .append(code, that.code).append(country, that.country).append(state, that.state).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(address).append(city).append(code).append(country).append(state) + .toHashCode(); + } +} diff --git a/src/main/java/com/testdroid/api/model/APIRole.java b/src/main/java/com/testdroid/api/model/APIRole.java index c043707..bfa8a08 100644 --- a/src/main/java/com/testdroid/api/model/APIRole.java +++ b/src/main/java/com/testdroid/api/model/APIRole.java @@ -24,6 +24,8 @@ public class APIRole extends APIEntity { private boolean valueCalculated; + private boolean userRole; + public APIRole() { } @@ -59,6 +61,7 @@ public APIRole(Long parentId, Long id, String name, String addedByEmail) { this(id, name); this.parentId = parentId; this.addedByEmail = addedByEmail; + this.userRole = true; } public String getName() { @@ -101,6 +104,14 @@ public void setValueCalculated(boolean valueCalculated) { this.valueCalculated = valueCalculated; } + public boolean isUserRole() { + return userRole; + } + + public void setUserRole(boolean userRole) { + this.userRole = userRole; + } + @Override @JsonIgnore protected void clone(T from) { @@ -111,6 +122,7 @@ protected void clone(T from) { this.addedByEmail = apiRole.addedByEmail; this.value = apiRole.value; this.valueCalculated = apiRole.valueCalculated; + this.userRole = apiRole.userRole; } @Override diff --git a/src/main/java/com/testdroid/api/model/APIUserPreference.java b/src/main/java/com/testdroid/api/model/APIUserPreference.java index 8a093d7..e1c4a7d 100644 --- a/src/main/java/com/testdroid/api/model/APIUserPreference.java +++ b/src/main/java/com/testdroid/api/model/APIUserPreference.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.testdroid.api.APIEntity; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -13,16 +14,13 @@ @JsonIgnoreProperties(value = {"id"}) public class APIUserPreference extends APIEntity implements Serializable { + @Serial private static final long serialVersionUID = 1L; private Long httpSessionMaxInactiveInterval; - private Long testTimeout; - private Long defaultHttpSessionMaxInactiveInterval; - private Long defaultTestTimeout; - public void setHttpSessionMaxInactiveInterval(Long httpSessionMaxInactiveInterval) { this.httpSessionMaxInactiveInterval = httpSessionMaxInactiveInterval; } @@ -31,22 +29,6 @@ public Long getHttpSessionMaxInactiveInterval() { return httpSessionMaxInactiveInterval; } - public void setTestTimeout(Long testTimeout) { - this.testTimeout = testTimeout; - } - - public Long getTestTimeout() { - return testTimeout; - } - - public void setDefaultTestTimeout(Long defaultTestTimeout) { - this.defaultTestTimeout = defaultTestTimeout; - } - - public Long getDefaultTestTimeout() { - return defaultTestTimeout; - } - public void setDefaultHttpSessionMaxInactiveInterval(Long defaultHttpSessionMaxInactiveInterval) { this.defaultHttpSessionMaxInactiveInterval = defaultHttpSessionMaxInactiveInterval; } @@ -61,7 +43,6 @@ protected void clone(T from) { APIUserPreference prototype = (APIUserPreference) from; cloneBase(from); this.httpSessionMaxInactiveInterval = prototype.httpSessionMaxInactiveInterval; - this.testTimeout = prototype.testTimeout; } @Override @@ -73,12 +54,11 @@ public boolean equals(Object o) { return false; } APIUserPreference that = (APIUserPreference) o; - return Objects.equals(httpSessionMaxInactiveInterval, that.httpSessionMaxInactiveInterval) && - Objects.equals(testTimeout, that.testTimeout); + return Objects.equals(httpSessionMaxInactiveInterval, that.httpSessionMaxInactiveInterval); } @Override public int hashCode() { - return Objects.hash(httpSessionMaxInactiveInterval, testTimeout); + return Objects.hash(httpSessionMaxInactiveInterval); } }