Skip to content

Commit e964aa0

Browse files
committed
Add missing enums from BatchPayments
Remove req. ReportTaxTypes from TaxRate object
1 parent e72abf6 commit e964aa0

2 files changed

Lines changed: 38 additions & 3 deletions

File tree

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

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,45 @@ public static TypeEnum fromValue(String value) {
119119

120120
@JsonProperty("Type")
121121
private TypeEnum type;
122+
/**
123+
* AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is not possible to delete batch payments via the API.
124+
*/
125+
public enum StatusEnum {
126+
AUTHORISED("AUTHORISED"),
127+
128+
DELETED("DELETED");
129+
130+
private String value;
131+
132+
StatusEnum(String value) {
133+
this.value = value;
134+
}
135+
136+
@JsonValue
137+
public String getValue() {
138+
return value;
139+
}
140+
141+
@Override
142+
public String toString() {
143+
return String.valueOf(value);
144+
}
145+
146+
@JsonCreator
147+
public static StatusEnum fromValue(String value) {
148+
for (StatusEnum b : StatusEnum.values()) {
149+
if (b.value.equals(value)) {
150+
return b;
151+
}
152+
}
153+
throw new IllegalArgumentException("Unexpected value '" + value + "'");
154+
}
155+
}
156+
122157

123158

124159
@JsonProperty("Status")
125-
private String status;
160+
private StatusEnum status;
126161

127162

128163
@JsonProperty("TotalAmount")
@@ -346,7 +381,7 @@ public TypeEnum getType() {
346381
* @return status
347382
**/
348383
@ApiModelProperty(value = "AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is not possible to delete batch payments via the API.")
349-
public String getStatus() {
384+
public StatusEnum getStatus() {
350385
return status;
351386
}
352387

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ public TaxRate reportTaxType(ReportTaxTypeEnum reportTaxType) {
305305
* See ReportTaxTypes
306306
* @return reportTaxType
307307
**/
308-
@ApiModelProperty(required = true, value = "See ReportTaxTypes")
308+
@ApiModelProperty(value = "See ReportTaxTypes")
309309
public ReportTaxTypeEnum getReportTaxType() {
310310
return reportTaxType;
311311
}

0 commit comments

Comments
 (0)