Skip to content

Commit

Permalink
Merge pull request #534 from szprutamich/master
Browse files Browse the repository at this point in the history
Version 3.32.0
  • Loading branch information
szprutamich authored Jul 15, 2024
2 parents db91f4d + 2ab9a45 commit 1de65f6
Show file tree
Hide file tree
Showing 9 changed files with 186 additions and 32 deletions.
4 changes: 2 additions & 2 deletions 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.31.0</version>
<version>3.32.0</version>
<packaging>jar</packaging>
<name>Bitbar API v2</name>
<url>https://github.com/bitbar/testdroid-api</url>
Expand All @@ -22,7 +22,7 @@
<org.apache.commons.collections4.version>4.4</org.apache.commons.collections4.version>
<org.apache.commons.io.version>2.16.0</org.apache.commons.io.version>
<commons-text.version>1.10.0</commons-text.version>
<dependency-check-maven.version>9.1.0</dependency-check-maven.version>
<dependency-check-maven.version>9.2.0</dependency-check-maven.version>
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
<org.reflections.version>0.10.2</org.reflections.version>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/testdroid/api/dto/MappingKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/testdroid/api/dto/Operand.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public enum Operand {
BEFORE(2),
ON(2),
EQ(2),
NOTEQ(2),
CONTAINS(2),
LIKE(2),
NOTLIKE(2),
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/com/testdroid/api/model/APIAccount.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 <T extends APIEntity> void clone(T from) {
Expand All @@ -106,5 +117,6 @@ protected <T extends APIEntity> void clone(T from) {
this.comment = account.comment;
this.name = account.name;
this.userName = account.userName;
this.invoiceDetails = account.invoiceDetails;
}
}
35 changes: 31 additions & 4 deletions src/main/java/com/testdroid/api/model/APIAccountPreference.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -13,10 +14,15 @@
*/
public class APIAccountPreference extends APIEntity implements Serializable {

@Serial
private static final long serialVersionUID = 1L;

private List<String> allowedFileExtensions = new ArrayList<>();

private Long testTimeout;

private Long defaultTestTimeout;

public List<String> getAllowedFileExtensions() {
return allowedFileExtensions;
}
Expand All @@ -26,6 +32,24 @@ public APIAccountPreference setAllowedFileExtensions(List<String> 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);
Expand All @@ -38,22 +62,25 @@ protected <T extends APIEntity> void clone(T from) {
APIAccountPreference prototype = (APIAccountPreference) from;
cloneBase(from);
this.allowedFileExtensions = prototype.allowedFileExtensions;
this.testTimeout = prototype.testTimeout;
this.defaultTestTimeout = prototype.defaultTestTimeout;
}

@Override
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);
}
}
27 changes: 26 additions & 1 deletion src/main/java/com/testdroid/api/model/APIBillingPeriod.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
*/
public class APIBillingPeriod extends APIEntity {

private Long accountId;

private String accountName;

private Long accountServiceId;

private Date startBillingPeriod;
Expand Down Expand Up @@ -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;
Expand All @@ -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(
Expand Down Expand Up @@ -216,6 +223,22 @@ public void setUsages(List<APIBillingPeriodUsage> 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 <T extends APIEntity> void clone(T from) {
APIBillingPeriod period = (APIBillingPeriod) from;
Expand All @@ -234,5 +257,7 @@ protected <T extends APIEntity> void clone(T from) {
this.apiBillingPeriodType = period.apiBillingPeriodType;
this.accountServiceId = period.accountServiceId;
this.usages = period.usages;
this.accountId = period.accountId;
this.accountName = period.accountName;
}
}
97 changes: 97 additions & 0 deletions src/main/java/com/testdroid/api/model/APIInvoiceDetails.java
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
*/
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();
}
}
12 changes: 12 additions & 0 deletions src/main/java/com/testdroid/api/model/APIRole.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class APIRole extends APIEntity {

private boolean valueCalculated;

private boolean userRole;

public APIRole() {
}

Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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 <T extends APIEntity> void clone(T from) {
Expand All @@ -111,6 +122,7 @@ protected <T extends APIEntity> void clone(T from) {
this.addedByEmail = apiRole.addedByEmail;
this.value = apiRole.value;
this.valueCalculated = apiRole.valueCalculated;
this.userRole = apiRole.userRole;
}

@Override
Expand Down
Loading

0 comments on commit 1de65f6

Please sign in to comment.