Skip to content

Commit aaea61c

Browse files
authored
Merge pull request #206 from XeroAPI/sid-development
Change floats to doubles
2 parents 2d5114f + 913a29c commit aaea61c

File tree

354 files changed

+1057
-1059
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

354 files changed

+1057
-1059
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>xero-java</artifactId>
66
<packaging>jar</packaging>
77
<name>xero-java</name>
8-
<version>4.0.1</version>
8+
<version>4.0.2</version>
99
<url>https://github.com/XeroAPI/Xero-Java</url>
1010
<description>This is the official Java SDK for Xero API</description>
1111
<licenses>

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

Lines changed: 63 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public class AccountingApi {
9393
private ApiClient apiClient;
9494
private static AccountingApi instance = null;
9595
private String userAgent = "Default";
96-
private String version = "4.0.1";
96+
private String version = "4.0.2";
9797
final static Logger logger = LoggerFactory.getLogger(AccountingApi.class);
9898

9999
public AccountingApi() {
@@ -6783,6 +6783,68 @@ public HttpResponse getContactAttachmentsForHttpResponse(String accessToken, St
67836783
.setReadTimeout(apiClient.getReadTimeout()).execute();
67846784
}
67856785

6786+
/**
6787+
* Allows you to retrieve a single contact by Contact Number in a Xero organisation
6788+
* <p><b>200</b> - Success - return response of type Contacts array with a unique Contact
6789+
* @param xeroTenantId Xero identifier for Tenant
6790+
* @param contactNumber This field is read only on the Xero contact screen, used to identify contacts in external systems (max length &#x3D; 50).
6791+
* @param accessToken Authorization token for user set in header of each request
6792+
* @return Contacts
6793+
* @throws IOException if an error occurs while attempting to invoke the API
6794+
**/
6795+
public Contacts getContactByContactNumber(String accessToken, String xeroTenantId, String contactNumber) throws IOException {
6796+
try {
6797+
TypeReference<Contacts> typeRef = new TypeReference<Contacts>() {};
6798+
HttpResponse response = getContactByContactNumberForHttpResponse(accessToken, xeroTenantId, contactNumber);
6799+
return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
6800+
} catch (HttpResponseException e) {
6801+
if (logger.isDebugEnabled()) {
6802+
logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getContactByContactNumber -------------------");
6803+
logger.debug(e.toString());
6804+
}
6805+
XeroApiExceptionHandler handler = new XeroApiExceptionHandler();
6806+
handler.execute(e);
6807+
} catch (IOException ioe) {
6808+
throw ioe;
6809+
}
6810+
return null;
6811+
}
6812+
6813+
public HttpResponse getContactByContactNumberForHttpResponse(String accessToken, String xeroTenantId, String contactNumber) throws IOException {
6814+
// verify the required parameter 'xeroTenantId' is set
6815+
if (xeroTenantId == null) {
6816+
throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getContactByContactNumber");
6817+
}// verify the required parameter 'contactNumber' is set
6818+
if (contactNumber == null) {
6819+
throw new IllegalArgumentException("Missing the required parameter 'contactNumber' when calling getContactByContactNumber");
6820+
}
6821+
if (accessToken == null) {
6822+
throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getContactByContactNumber");
6823+
}
6824+
HttpHeaders headers = new HttpHeaders();
6825+
headers.set("xero-tenant-id", xeroTenantId);
6826+
headers.setAccept("application/json");
6827+
headers.setUserAgent(this.getUserAgent());
6828+
// create a map of path variables
6829+
final Map<String, Object> uriVariables = new HashMap<String, Object>();
6830+
uriVariables.put("ContactNumber", contactNumber);
6831+
6832+
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Contacts/{ContactNumber}");
6833+
String url = uriBuilder.buildFromMap(uriVariables).toString();
6834+
GenericUrl genericUrl = new GenericUrl(url);
6835+
if (logger.isDebugEnabled()) {
6836+
logger.debug("GET " + genericUrl.toString());
6837+
}
6838+
6839+
HttpContent content = null;
6840+
Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken);
6841+
HttpTransport transport = apiClient.getHttpTransport();
6842+
HttpRequestFactory requestFactory = transport.createRequestFactory(credential);
6843+
return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers)
6844+
.setConnectTimeout(apiClient.getConnectionTimeout())
6845+
.setReadTimeout(apiClient.getReadTimeout()).execute();
6846+
}
6847+
67866848
/**
67876849
* Allows you to retrieve CISSettings for a contact in a Xero organisation
67886850
* <p><b>200</b> - Success - return response of type CISSettings for a specific Contact
@@ -10375,70 +10437,6 @@ public HttpResponse getPrepaymentForHttpResponse(String accessToken, String xer
1037510437
.setReadTimeout(apiClient.getReadTimeout()).execute();
1037610438
}
1037710439

10378-
/**
10379-
* Allows you to retrieve prepayments as PDF files
10380-
* <p><b>200</b> - Success - return response of byte array pdf version of specified Prepayments
10381-
* @param xeroTenantId Xero identifier for Tenant
10382-
* @param prepaymentID Unique identifier for a PrePayment
10383-
* @param accessToken Authorization token for user set in header of each request
10384-
* @return File
10385-
* @throws IOException if an error occurs while attempting to invoke the API
10386-
**/
10387-
public ByteArrayInputStream getPrepaymentAsPdf(String accessToken, String xeroTenantId, UUID prepaymentID) throws IOException {
10388-
try {
10389-
TypeReference<File> typeRef = new TypeReference<File>() {};
10390-
HttpResponse response = getPrepaymentAsPdfForHttpResponse(accessToken, xeroTenantId, prepaymentID);
10391-
InputStream is = response.getContent();
10392-
return convertInputToByteArray(is);
10393-
10394-
} catch (HttpResponseException e) {
10395-
if (logger.isDebugEnabled()) {
10396-
logger.debug("------------------ HttpResponseException " + e.getStatusCode() + " : getPrepaymentAsPdf -------------------");
10397-
logger.debug(e.toString());
10398-
}
10399-
XeroApiExceptionHandler handler = new XeroApiExceptionHandler();
10400-
handler.execute(e);
10401-
} catch (IOException ioe) {
10402-
throw ioe;
10403-
}
10404-
return null;
10405-
}
10406-
10407-
public HttpResponse getPrepaymentAsPdfForHttpResponse(String accessToken, String xeroTenantId, UUID prepaymentID) throws IOException {
10408-
// verify the required parameter 'xeroTenantId' is set
10409-
if (xeroTenantId == null) {
10410-
throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling getPrepaymentAsPdf");
10411-
}// verify the required parameter 'prepaymentID' is set
10412-
if (prepaymentID == null) {
10413-
throw new IllegalArgumentException("Missing the required parameter 'prepaymentID' when calling getPrepaymentAsPdf");
10414-
}
10415-
if (accessToken == null) {
10416-
throw new IllegalArgumentException("Missing the required parameter 'accessToken' when calling getPrepaymentAsPdf");
10417-
}
10418-
HttpHeaders headers = new HttpHeaders();
10419-
headers.set("xero-tenant-id", xeroTenantId);
10420-
headers.setAccept("application/pdf");
10421-
headers.setUserAgent(this.getUserAgent());
10422-
// create a map of path variables
10423-
final Map<String, Object> uriVariables = new HashMap<String, Object>();
10424-
uriVariables.put("PrepaymentID", prepaymentID);
10425-
10426-
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Prepayments/{PrepaymentID}");
10427-
String url = uriBuilder.buildFromMap(uriVariables).toString();
10428-
GenericUrl genericUrl = new GenericUrl(url);
10429-
if (logger.isDebugEnabled()) {
10430-
logger.debug("GET " + genericUrl.toString());
10431-
}
10432-
10433-
HttpContent content = null;
10434-
Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken);
10435-
HttpTransport transport = apiClient.getHttpTransport();
10436-
HttpRequestFactory requestFactory = transport.createRequestFactory(credential);
10437-
return requestFactory.buildRequest(HttpMethods.GET, genericUrl, content).setHeaders(headers)
10438-
.setConnectTimeout(apiClient.getConnectionTimeout())
10439-
.setReadTimeout(apiClient.getReadTimeout()).execute();
10440-
}
10441-
1044210440
/**
1044310441
* Allows you to retrieve a history records of an Prepayment
1044410442
* <p><b>200</b> - Success - return response of HistoryRecords array of 0 to N HistoryRecord

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class AssetApi {
4747
private ApiClient apiClient;
4848
private static AssetApi instance = null;
4949
private String userAgent = "Default";
50-
private String version = "4.0.1";
50+
private String version = "4.0.2";
5151
final static Logger logger = LoggerFactory.getLogger(AssetApi.class);
5252

5353
public AssetApi() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class BankFeedsApi {
4747
private ApiClient apiClient;
4848
private static BankFeedsApi instance = null;
4949
private String userAgent = "Default";
50-
private String version = "4.0.1";
50+
private String version = "4.0.2";
5151
final static Logger logger = LoggerFactory.getLogger(BankFeedsApi.class);
5252

5353
public BankFeedsApi() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class IdentityApi {
4343
private ApiClient apiClient;
4444
private static IdentityApi instance = null;
4545
private String userAgent = "Default";
46-
private String version = "4.0.1";
46+
private String version = "4.0.2";
4747
final static Logger logger = LoggerFactory.getLogger(IdentityApi.class);
4848

4949
public IdentityApi() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public class PayrollAuApi {
6363
private ApiClient apiClient;
6464
private static PayrollAuApi instance = null;
6565
private String userAgent = "Default";
66-
private String version = "4.0.1";
66+
private String version = "4.0.2";
6767
final static Logger logger = LoggerFactory.getLogger(PayrollAuApi.class);
6868

6969
public PayrollAuApi() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public class PayrollUkApi {
104104
private ApiClient apiClient;
105105
private static PayrollUkApi instance = null;
106106
private String userAgent = "Default";
107-
private String version = "4.0.1";
107+
private String version = "4.0.2";
108108
final static Logger logger = LoggerFactory.getLogger(PayrollUkApi.class);
109109

110110
public PayrollUkApi() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class ProjectApi {
5454
private ApiClient apiClient;
5555
private static ProjectApi instance = null;
5656
private String userAgent = "Default";
57-
private String version = "4.0.1";
57+
private String version = "4.0.2";
5858
final static Logger logger = LoggerFactory.getLogger(ProjectApi.class);
5959

6060
public ProjectApi() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Accounting API
33
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
44
*
5-
* The version of the OpenAPI document: 2.1.3
5+
* The version of the OpenAPI document: 2.1.5
66
* Contact: [email protected]
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Accounting API
33
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
44
*
5-
* The version of the OpenAPI document: 2.1.3
5+
* The version of the OpenAPI document: 2.1.5
66
* Contact: [email protected]
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

0 commit comments

Comments
 (0)