Skip to content

Commit

Permalink
Merge pull request #206 from XeroAPI/sid-development
Browse files Browse the repository at this point in the history
Change floats to doubles
  • Loading branch information
SidneyAllen authored May 20, 2020
2 parents 2d5114f + 913a29c commit aaea61c
Show file tree
Hide file tree
Showing 354 changed files with 1,057 additions and 1,059 deletions.
2 changes: 1 addition & 1 deletion 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.0.1</version>
<version>4.0.2</version>
<url>https://github.com/XeroAPI/Xero-Java</url>
<description>This is the official Java SDK for Xero API</description>
<licenses>
Expand Down
128 changes: 63 additions & 65 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.0.1";
private String version = "4.0.2";
final static Logger logger = LoggerFactory.getLogger(AccountingApi.class);

public AccountingApi() {
Expand Down Expand Up @@ -6783,6 +6783,68 @@ public HttpResponse getContactAttachmentsForHttpResponse(String accessToken, St
.setReadTimeout(apiClient.getReadTimeout()).execute();
}

/**
* Allows you to retrieve a single contact by Contact Number in a Xero organisation
* <p><b>200</b> - Success - return response of type Contacts array with a unique Contact
* @param xeroTenantId Xero identifier for Tenant
* @param contactNumber This field is read only on the Xero contact screen, used to identify contacts in external systems (max length &#x3D; 50).
* @param accessToken Authorization token for user set in header of each request
* @return Contacts
* @throws IOException if an error occurs while attempting to invoke the API
**/
public Contacts getContactByContactNumber(String accessToken, String xeroTenantId, String contactNumber) throws IOException {
try {
TypeReference<Contacts> typeRef = new TypeReference<Contacts>() {};
HttpResponse response = getContactByContactNumberForHttpResponse(accessToken, xeroTenantId, contactNumber);
return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
} catch (HttpResponseException e) {
if (logger.isDebugEnabled()) {
logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getContactByContactNumber -------------------");
logger.debug(e.toString());
}
XeroApiExceptionHandler handler = new XeroApiExceptionHandler();
handler.execute(e);
} catch (IOException ioe) {
throw ioe;
}
return null;
}

public HttpResponse getContactByContactNumberForHttpResponse(String accessToken, String xeroTenantId, String contactNumber) throws IOException {
// verify the required parameter 'xeroTenantId' is set
if (xeroTenantId == null) {
throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getContactByContactNumber");
}// verify the required parameter 'contactNumber' is set
if (contactNumber == null) {
throw new IllegalArgumentException("Missing the required parameter 'contactNumber' when calling getContactByContactNumber");
}
if (accessToken == null) {
throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getContactByContactNumber");
}
HttpHeaders headers = new HttpHeaders();
headers.set("xero-tenant-id", xeroTenantId);
headers.setAccept("application/json");
headers.setUserAgent(this.getUserAgent());
// create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("ContactNumber", contactNumber);

UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactNumber}");
String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url);
if (logger.isDebugEnabled()) {
logger.debug("GET " + genericUrl.toString());
}

HttpContent content = null;
Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken);
HttpTransport transport = apiClient.getHttpTransport();
HttpRequestFactory requestFactory = transport.createRequestFactory(credential);
return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers)
.setConnectTimeout(apiClient.getConnectionTimeout())
.setReadTimeout(apiClient.getReadTimeout()).execute();
}

/**
* Allows you to retrieve CISSettings for a contact in a Xero organisation
* <p><b>200</b> - Success - return response of type CISSettings for a specific Contact
Expand Down Expand Up @@ -10375,70 +10437,6 @@ public HttpResponse getPrepaymentForHttpResponse(String accessToken, String xer
.setReadTimeout(apiClient.getReadTimeout()).execute();
}

/**
* Allows you to retrieve prepayments as PDF files
* <p><b>200</b> - Success - return response of byte array pdf version of specified Prepayments
* @param xeroTenantId Xero identifier for Tenant
* @param prepaymentID Unique identifier for a PrePayment
* @param accessToken Authorization token for user set in header of each request
* @return File
* @throws IOException if an error occurs while attempting to invoke the API
**/
public ByteArrayInputStream getPrepaymentAsPdf(String accessToken, String xeroTenantId, UUID prepaymentID) throws IOException {
try {
TypeReference<File> typeRef = new TypeReference<File>() {};
HttpResponse response = getPrepaymentAsPdfForHttpResponse(accessToken, xeroTenantId, prepaymentID);
InputStream is = response.getContent();
return convertInputToByteArray(is);

} catch (HttpResponseException e) {
if (logger.isDebugEnabled()) {
logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPrepaymentAsPdf -------------------");
logger.debug(e.toString());
}
XeroApiExceptionHandler handler = new XeroApiExceptionHandler();
handler.execute(e);
} catch (IOException ioe) {
throw ioe;
}
return null;
}

public HttpResponse getPrepaymentAsPdfForHttpResponse(String accessToken, String xeroTenantId, UUID prepaymentID) throws IOException {
// verify the required parameter 'xeroTenantId' is set
if (xeroTenantId == null) {
throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPrepaymentAsPdf");
}// verify the required parameter 'prepaymentID' is set
if (prepaymentID == null) {
throw new IllegalArgumentException("Missing the required parameter 'prepaymentID' when calling getPrepaymentAsPdf");
}
if (accessToken == null) {
throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPrepaymentAsPdf");
}
HttpHeaders headers = new HttpHeaders();
headers.set("xero-tenant-id", xeroTenantId);
headers.setAccept("application/pdf");
headers.setUserAgent(this.getUserAgent());
// create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("PrepaymentID", prepaymentID);

UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Prepayments/{PrepaymentID}");
String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url);
if (logger.isDebugEnabled()) {
logger.debug("GET " + genericUrl.toString());
}

HttpContent content = null;
Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken);
HttpTransport transport = apiClient.getHttpTransport();
HttpRequestFactory requestFactory = transport.createRequestFactory(credential);
return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers)
.setConnectTimeout(apiClient.getConnectionTimeout())
.setReadTimeout(apiClient.getReadTimeout()).execute();
}

/**
* Allows you to retrieve a history records of an Prepayment
* <p><b>200</b> - Success - return response of HistoryRecords array of 0 to N HistoryRecord
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.0.1";
private String version = "4.0.2";
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.0.1";
private String version = "4.0.2";
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.0.1";
private String version = "4.0.2";
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.0.1";
private String version = "4.0.2";
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 @@ -104,7 +104,7 @@ public class PayrollUkApi {
private ApiClient apiClient;
private static PayrollUkApi instance = null;
private String userAgent = "Default";
private String version = "4.0.1";
private String version = "4.0.2";
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.0.1";
private String version = "4.0.2";
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.1.3
* The version of the OpenAPI document: 2.1.5
* 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.1.3
* The version of the OpenAPI document: 2.1.5
* 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.1.3
* The version of the OpenAPI document: 2.1.5
* 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.1.3
* The version of the OpenAPI document: 2.1.5
* 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.1.3
* The version of the OpenAPI document: 2.1.5
* 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.1.3
* The version of the OpenAPI document: 2.1.5
* 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/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.1.3
* The version of the OpenAPI document: 2.1.5
* 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/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.1.3
* The version of the OpenAPI document: 2.1.5
* 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.1.3
* The version of the OpenAPI document: 2.1.5
* 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/Attachments.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.1.3
* The version of the OpenAPI document: 2.1.5
* 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/Balances.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.1.3
* The version of the OpenAPI document: 2.1.5
* 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.1.3
* The version of the OpenAPI document: 2.1.5
* 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.1.3
* The version of the OpenAPI document: 2.1.5
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/xero/models/accounting/BankTransfer.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.1.3
* The version of the OpenAPI document: 2.1.5
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -49,7 +49,7 @@ public class BankTransfer {
private Account toBankAccount = null;

@JsonProperty("Amount")
private String amount;
private Double amount;

@JsonProperty("Date")
private String date;
Expand Down Expand Up @@ -110,7 +110,7 @@ public void setToBankAccount(Account toBankAccount) {
this.toBankAccount = toBankAccount;
}

public BankTransfer amount(String amount) {
public BankTransfer amount(Double amount) {
this.amount = amount;
return this;
}
Expand All @@ -120,11 +120,11 @@ public BankTransfer amount(String amount) {
* @return amount
**/
@ApiModelProperty(required = true, value = "amount of the transaction")
public String getAmount() {
public Double getAmount() {
return amount;
}

public void setAmount(String amount) {
public void setAmount(Double amount) {
this.amount = amount;
}

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.1.3
* The version of the OpenAPI document: 2.1.5
* 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/BatchPayment.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.1.3
* The version of the OpenAPI document: 2.1.5
* 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.1.3
* The version of the OpenAPI document: 2.1.5
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Loading

0 comments on commit aaea61c

Please sign in to comment.