Skip to content

Commit edbfbf9

Browse files
committed
Fix BalanceSheet report and Employee
Employee - Missing UpdatedDateUTC - Status changed from string to ENUM BalanceSheet Report - timeframe changed from Int to String/Enum
1 parent 8ad8904 commit edbfbf9

5 files changed

Lines changed: 74 additions & 12 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Add the dependency to your pom.xml. Gradle, sbt and other build tools can be fo
7474
<dependency>
7575
<groupId>com.github.xeroapi</groupId>
7676
<artifactId>xero-java</artifactId>
77-
<version>2.2.9</version>
77+
<version>2.2.10</version>
7878
</dependency>
7979

8080

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>com.github.xeroapi</groupId>
55
<artifactId>xero-java</artifactId>
66
<packaging>jar</packaging>
7-
<version>2.2.9</version>
7+
<version>2.2.10</version>
88
<name>Xero-Java SDK</name>
99
<description>This is the official Java SDK for Xero API</description>
1010
<url>https://github.com/XeroAPI/Xero-Java</url>

src/main/java/com/xero/api/JsonConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public String getAccessTokenUrl() {
132132

133133
@Override
134134
public String getUserAgent() {
135-
return USER_AGENT + " " + CONSUMER_KEY + " [Xero-Java-2.2.9]";
135+
return USER_AGENT + " " + CONSUMER_KEY + " [Xero-Java-2.2.10]";
136136
}
137137

138138
@Override

src/main/java/com/xero/api/client/AccountingApi.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5829,15 +5829,15 @@ public ReportWithRows getReportBASorGSTList() throws IOException {
58295829
* <p><b>200</b> - A successful request
58305830
* @param date The date parameter
58315831
* @param periods The periods parameter
5832-
* @param timeframe The period size to compare to (1&#x3D;month, 3&#x3D;quarter, 12&#x3D;year)
5832+
* @param timeframe The period size to compare to (MONTH, QUARTER, YEAR)
58335833
* @param trackingOptionID1 The trackingOptionID1 parameter
58345834
* @param trackingOptionID2 The trackingOptionID2 parameter
58355835
* @param standardLayout The standardLayout parameter
58365836
* @param paymentsOnly The paymentsOnly parameter
58375837
* @return ReportWithRows
58385838
* @throws IOException if an error occurs while attempting to invoke the API
58395839
**/
5840-
public ReportWithRows getReportBalanceSheet(String date, Integer periods, Integer timeframe, String trackingOptionID1, String trackingOptionID2, Boolean standardLayout, Boolean paymentsOnly) throws IOException {
5840+
public ReportWithRows getReportBalanceSheet(String date, Integer periods, String timeframe, String trackingOptionID1, String trackingOptionID2, Boolean standardLayout, Boolean paymentsOnly) throws IOException {
58415841
try {
58425842
String strBody = null;
58435843
Map<String, String> params = null;
@@ -5941,7 +5941,7 @@ public ReportWithRows getReportExecutiveSummary(String date) throws IOException
59415941
* @param fromDate The fromDate parameter
59425942
* @param toDate The toDate parameter
59435943
* @param periods The number of periods to compare (integer between 1 and 12)
5944-
* @param timeframe The period size to compare to (1&#x3D;month, 3&#x3D;quarter, 12&#x3D;year)
5944+
* @param timeframe The period size to compare to (MONTH, QUARTER, YEAR)
59455945
* @param trackingCategoryID The trackingCategoryID parameter
59465946
* @param trackingCategoryID2 The trackingCategoryID2 parameter
59475947
* @param trackingOptionID The trackingOptionID parameter

src/main/java/com/xero/models/accounting/Employee.java

Lines changed: 68 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import io.swagger.annotations.ApiModel;
2323
import io.swagger.annotations.ApiModelProperty;
2424
import java.util.UUID;
25+
import org.threeten.bp.OffsetDateTime;
2526

2627
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
2728

@@ -34,9 +35,46 @@ public class Employee {
3435
@JsonProperty("EmployeeID")
3536
private UUID employeeID = null;
3637

38+
/**
39+
* Current status of an employee – see contact status types
40+
*/
41+
public enum StatusEnum {
42+
ACTIVE("ACTIVE"),
43+
44+
ARCHIVED("ARCHIVED"),
45+
46+
GDPRREQUEST("GDPRREQUEST");
47+
48+
private String value;
49+
50+
StatusEnum(String value) {
51+
this.value = value;
52+
}
53+
54+
@JsonValue
55+
public String getValue() {
56+
return value;
57+
}
58+
59+
@Override
60+
public String toString() {
61+
return String.valueOf(value);
62+
}
63+
64+
@JsonCreator
65+
public static StatusEnum fromValue(String text) {
66+
for (StatusEnum b : StatusEnum.values()) {
67+
if (String.valueOf(b.value).equals(text)) {
68+
return b;
69+
}
70+
}
71+
throw new IllegalArgumentException("Unexpected value '" + text + "'");
72+
}
73+
}
74+
3775

3876
@JsonProperty("Status")
39-
private String status = null;
77+
private StatusEnum status = null;
4078

4179

4280
@JsonProperty("FirstName")
@@ -50,6 +88,10 @@ public class Employee {
5088
@JsonProperty("ExternalLink")
5189
private ExternalLink externalLink = null;
5290

91+
@JsonDeserialize(using = com.xero.api.CustomOffsetDateTimeDeserializer.class)
92+
@JsonProperty("UpdatedDateUTC")
93+
private OffsetDateTime updatedDateUTC = null;
94+
5395
public Employee employeeID(UUID employeeID) {
5496
this.employeeID = employeeID;
5597
return this;
@@ -68,7 +110,7 @@ public void setEmployeeID(UUID employeeID) {
68110
this.employeeID = employeeID;
69111
}
70112

71-
public Employee status(String status) {
113+
public Employee status(StatusEnum status) {
72114
this.status = status;
73115
return this;
74116
}
@@ -78,11 +120,11 @@ public Employee status(String status) {
78120
* @return status
79121
**/
80122
@ApiModelProperty(value = "Current status of an employee – see contact status types")
81-
public String getStatus() {
123+
public StatusEnum getStatus() {
82124
return status;
83125
}
84126

85-
public void setStatus(String status) {
127+
public void setStatus(StatusEnum status) {
86128
this.status = status;
87129
}
88130

@@ -140,6 +182,24 @@ public void setExternalLink(ExternalLink externalLink) {
140182
this.externalLink = externalLink;
141183
}
142184

185+
public Employee updatedDateUTC(OffsetDateTime updatedDateUTC) {
186+
this.updatedDateUTC = updatedDateUTC;
187+
return this;
188+
}
189+
190+
/**
191+
* Get updatedDateUTC
192+
* @return updatedDateUTC
193+
**/
194+
@ApiModelProperty(value = "")
195+
public OffsetDateTime getUpdatedDateUTC() {
196+
return updatedDateUTC;
197+
}
198+
199+
public void setUpdatedDateUTC(OffsetDateTime updatedDateUTC) {
200+
this.updatedDateUTC = updatedDateUTC;
201+
}
202+
143203

144204
@Override
145205
public boolean equals(java.lang.Object o) {
@@ -154,12 +214,13 @@ public boolean equals(java.lang.Object o) {
154214
Objects.equals(this.status, employee.status) &&
155215
Objects.equals(this.firstName, employee.firstName) &&
156216
Objects.equals(this.lastName, employee.lastName) &&
157-
Objects.equals(this.externalLink, employee.externalLink);
217+
Objects.equals(this.externalLink, employee.externalLink) &&
218+
Objects.equals(this.updatedDateUTC, employee.updatedDateUTC);
158219
}
159220

160221
@Override
161222
public int hashCode() {
162-
return Objects.hash(employeeID, status, firstName, lastName, externalLink);
223+
return Objects.hash(employeeID, status, firstName, lastName, externalLink, updatedDateUTC);
163224
}
164225

165226

@@ -173,6 +234,7 @@ public String toString() {
173234
sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n");
174235
sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n");
175236
sb.append(" externalLink: ").append(toIndentedString(externalLink)).append("\n");
237+
sb.append(" updatedDateUTC: ").append(toIndentedString(updatedDateUTC)).append("\n");
176238
sb.append("}");
177239
return sb.toString();
178240
}

0 commit comments

Comments
 (0)