Skip to content

Build for OpenAPI spec versions 2.2.1, 2.2.2, 2.2.3 & 2.2.4 #208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>xero-java</artifactId>
<packaging>jar</packaging>
<name>xero-java</name>
<version>4.1.0</version>
<version>4.1.1</version>
<url>https://github.com/XeroAPI/Xero-Java</url>
<description>This is the official Java SDK for Xero API</description>
<licenses>
Expand Down Expand Up @@ -298,7 +298,7 @@
<google-api-client-version>1.23.0</google-api-client-version>
<jersey-common-version>2.25.1</jersey-common-version>
<jackson-version>2.9.10</jackson-version>
<jackson-databind-version>2.9.10.4</jackson-databind-version>
<jackson-databind-version>2.9.10.5</jackson-databind-version>
<jackson-threetenbp-version>2.6.4</jackson-threetenbp-version>
<junit-version>4.12</junit-version>
<org-apache-httpcomponents>4.5.3</org-apache-httpcomponents>
Expand Down
20 changes: 16 additions & 4 deletions src/main/java/com/xero/api/client/AccountingApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public class AccountingApi {
private ApiClient apiClient;
private static AccountingApi instance = null;
private String userAgent = "Default";
private String version = "4.1.0";
private String version = "4.1.1";
final static Logger logger = LoggerFactory.getLogger(AccountingApi.class);

public AccountingApi() {
Expand Down Expand Up @@ -1398,14 +1398,15 @@ public HttpResponse createContactsForHttpResponse(String accessToken, String xe
* @param xeroTenantId Xero identifier for Tenant
* @param creditNoteID Unique identifier for a Credit Note
* @param allocations Allocations with array of Allocation object in body of request.
* @param summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors
* @param accessToken Authorization token for user set in header of each request
* @return Allocations
* @throws IOException if an error occurs while attempting to invoke the API
**/
public Allocations createCreditNoteAllocation(String accessToken, String xeroTenantId, UUID creditNoteID, Allocations allocations) throws IOException {
public Allocations createCreditNoteAllocation(String accessToken, String xeroTenantId, UUID creditNoteID, Allocations allocations, Boolean summarizeErrors) throws IOException {
try {
TypeReference<Allocations> typeRef = new TypeReference<Allocations>() {};
HttpResponse response = createCreditNoteAllocationForHttpResponse(accessToken, xeroTenantId, creditNoteID, allocations);
HttpResponse response = createCreditNoteAllocationForHttpResponse(accessToken, xeroTenantId, creditNoteID, allocations, summarizeErrors);
return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
} catch (HttpResponseException e) {
if (logger.isDebugEnabled()) {
Expand All @@ -1429,7 +1430,7 @@ public Allocations createCreditNoteAllocation(String accessToken, String xeroTe
return null;
}

public HttpResponse createCreditNoteAllocationForHttpResponse(String accessToken, String xeroTenantId, UUID creditNoteID, Allocations allocations) throws IOException {
public HttpResponse createCreditNoteAllocationForHttpResponse(String accessToken, String xeroTenantId, UUID creditNoteID, Allocations allocations, Boolean summarizeErrors) throws IOException {
// verify the required parameter 'xeroTenantId' is set
if (xeroTenantId == null) {
throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createCreditNoteAllocation");
Expand All @@ -1452,6 +1453,17 @@ public HttpResponse createCreditNoteAllocationForHttpResponse(String accessToken
uriVariables.put("CreditNoteID", creditNoteID);

UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/Allocations");
if (summarizeErrors != null) {
String key = "summarizeErrors";
Object value = summarizeErrors;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
uriBuilder = uriBuilder.queryParam(key, value);
}
}
String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url);
if (logger.isDebugEnabled()) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/xero/api/client/AssetApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class AssetApi {
private ApiClient apiClient;
private static AssetApi instance = null;
private String userAgent = "Default";
private String version = "4.1.0";
private String version = "4.1.1";
final static Logger logger = LoggerFactory.getLogger(AssetApi.class);

public AssetApi() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/xero/api/client/BankFeedsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class BankFeedsApi {
private ApiClient apiClient;
private static BankFeedsApi instance = null;
private String userAgent = "Default";
private String version = "4.1.0";
private String version = "4.1.1";
final static Logger logger = LoggerFactory.getLogger(BankFeedsApi.class);

public BankFeedsApi() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/xero/api/client/IdentityApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class IdentityApi {
private ApiClient apiClient;
private static IdentityApi instance = null;
private String userAgent = "Default";
private String version = "4.1.0";
private String version = "4.1.1";
final static Logger logger = LoggerFactory.getLogger(IdentityApi.class);

public IdentityApi() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/xero/api/client/PayrollAuApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class PayrollAuApi {
private ApiClient apiClient;
private static PayrollAuApi instance = null;
private String userAgent = "Default";
private String version = "4.1.0";
private String version = "4.1.1";
final static Logger logger = LoggerFactory.getLogger(PayrollAuApi.class);

public PayrollAuApi() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/xero/api/client/PayrollUkApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public class PayrollUkApi {
private ApiClient apiClient;
private static PayrollUkApi instance = null;
private String userAgent = "Default";
private String version = "4.1.0";
private String version = "4.1.1";
final static Logger logger = LoggerFactory.getLogger(PayrollUkApi.class);

public PayrollUkApi() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/xero/api/client/ProjectApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class ProjectApi {
private ApiClient apiClient;
private static ProjectApi instance = null;
private String userAgent = "Default";
private String version = "4.1.0";
private String version = "4.1.1";
final static Logger logger = LoggerFactory.getLogger(ProjectApi.class);

public ProjectApi() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/xero/models/accounting/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Accounting API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.2.0
* The version of the OpenAPI document: 2.2.4
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/xero/models/accounting/AccountType.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Accounting API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.2.0
* The version of the OpenAPI document: 2.2.4
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/xero/models/accounting/Accounts.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Accounting API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.2.0
* The version of the OpenAPI document: 2.2.4
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Accounting API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.2.0
* The version of the OpenAPI document: 2.2.4
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Accounting API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.2.0
* The version of the OpenAPI document: 2.2.4
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/xero/models/accounting/Address.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Accounting API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.2.0
* The version of the OpenAPI document: 2.2.4
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
135 changes: 132 additions & 3 deletions src/main/java/com/xero/models/accounting/Allocation.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Accounting API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.2.0
* The version of the OpenAPI document: 2.2.4
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand All @@ -19,9 +19,15 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.xero.models.accounting.CreditNote;
import com.xero.models.accounting.Invoice;
import com.xero.models.accounting.Overpayment;
import com.xero.models.accounting.Prepayment;
import com.xero.models.accounting.ValidationError;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import java.io.IOException;

import org.threeten.bp.OffsetDateTime;
Expand All @@ -42,11 +48,26 @@ public class Allocation {
@JsonProperty("Invoice")
private Invoice invoice;

@JsonProperty("Overpayment")
private Overpayment overpayment;

@JsonProperty("Prepayment")
private Prepayment prepayment;

@JsonProperty("CreditNote")
private CreditNote creditNote;

@JsonProperty("Amount")
private Double amount;

@JsonProperty("Date")
private String date;

@JsonProperty("StatusAttributeString")
private String statusAttributeString;

@JsonProperty("ValidationErrors")
private List<ValidationError> validationErrors = new ArrayList<ValidationError>();
public Allocation invoice(Invoice invoice) {
this.invoice = invoice;
return this;
Expand All @@ -65,6 +86,60 @@ public void setInvoice(Invoice invoice) {
this.invoice = invoice;
}

public Allocation overpayment(Overpayment overpayment) {
this.overpayment = overpayment;
return this;
}

/**
* Get overpayment
* @return overpayment
**/
@ApiModelProperty(value = "")
public Overpayment getOverpayment() {
return overpayment;
}

public void setOverpayment(Overpayment overpayment) {
this.overpayment = overpayment;
}

public Allocation prepayment(Prepayment prepayment) {
this.prepayment = prepayment;
return this;
}

/**
* Get prepayment
* @return prepayment
**/
@ApiModelProperty(value = "")
public Prepayment getPrepayment() {
return prepayment;
}

public void setPrepayment(Prepayment prepayment) {
this.prepayment = prepayment;
}

public Allocation creditNote(CreditNote creditNote) {
this.creditNote = creditNote;
return this;
}

/**
* Get creditNote
* @return creditNote
**/
@ApiModelProperty(value = "")
public CreditNote getCreditNote() {
return creditNote;
}

public void setCreditNote(CreditNote creditNote) {
this.creditNote = creditNote;
}

public Allocation amount(Double amount) {
this.amount = amount;
return this;
Expand Down Expand Up @@ -119,6 +194,50 @@ public void setDate(LocalDate date) {
this.date = "/Date(" + Long.toString(timeInMillis) + "+0000)/";
}

public Allocation statusAttributeString(String statusAttributeString) {
this.statusAttributeString = statusAttributeString;
return this;
}

/**
* A string to indicate if a invoice status
* @return statusAttributeString
**/
@ApiModelProperty(value = "A string to indicate if a invoice status")
public String getStatusAttributeString() {
return statusAttributeString;
}

public void setStatusAttributeString(String statusAttributeString) {
this.statusAttributeString = statusAttributeString;
}

public Allocation validationErrors(List<ValidationError> validationErrors) {
this.validationErrors = validationErrors;
return this;
}

public Allocation addValidationErrorsItem(ValidationError validationErrorsItem) {
if (this.validationErrors == null) {
this.validationErrors = new ArrayList<ValidationError>();
}
this.validationErrors.add(validationErrorsItem);
return this;
}

/**
* Displays array of validation error messages from the API
* @return validationErrors
**/
@ApiModelProperty(value = "Displays array of validation error messages from the API")
public List<ValidationError> getValidationErrors() {
return validationErrors;
}

public void setValidationErrors(List<ValidationError> validationErrors) {
this.validationErrors = validationErrors;
}


@Override
public boolean equals(java.lang.Object o) {
Expand All @@ -130,13 +249,18 @@ public boolean equals(java.lang.Object o) {
}
Allocation allocation = (Allocation) o;
return Objects.equals(this.invoice, allocation.invoice) &&
Objects.equals(this.overpayment, allocation.overpayment) &&
Objects.equals(this.prepayment, allocation.prepayment) &&
Objects.equals(this.creditNote, allocation.creditNote) &&
Objects.equals(this.amount, allocation.amount) &&
Objects.equals(this.date, allocation.date);
Objects.equals(this.date, allocation.date) &&
Objects.equals(this.statusAttributeString, allocation.statusAttributeString) &&
Objects.equals(this.validationErrors, allocation.validationErrors);
}

@Override
public int hashCode() {
return Objects.hash(invoice, amount, date);
return Objects.hash(invoice, overpayment, prepayment, creditNote, amount, date, statusAttributeString, validationErrors);
}


Expand All @@ -145,8 +269,13 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Allocation {\n");
sb.append(" invoice: ").append(toIndentedString(invoice)).append("\n");
sb.append(" overpayment: ").append(toIndentedString(overpayment)).append("\n");
sb.append(" prepayment: ").append(toIndentedString(prepayment)).append("\n");
sb.append(" creditNote: ").append(toIndentedString(creditNote)).append("\n");
sb.append(" amount: ").append(toIndentedString(amount)).append("\n");
sb.append(" date: ").append(toIndentedString(date)).append("\n");
sb.append(" statusAttributeString: ").append(toIndentedString(statusAttributeString)).append("\n");
sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/xero/models/accounting/Allocations.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Accounting API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.2.0
* The version of the OpenAPI document: 2.2.4
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/xero/models/accounting/Attachment.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Accounting API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.2.0
* The version of the OpenAPI document: 2.2.4
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Loading