Skip to content

Commit b4e9a64

Browse files
committed
Add unitdp to queries
Added unitdp param to allow the return of up to 4 decimal points on - invoices - overpayments - banktransactions - prepayements - receipts - items
1 parent e965fc8 commit b4e9a64

27 files changed

Lines changed: 100 additions & 117 deletions

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.3.3</version>
7+
<version>2.3.4</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
@@ -15,7 +15,7 @@
1515

1616
public class JsonConfig implements Config {
1717

18-
private String SDK_VERSION = "2.3.3";
18+
private String SDK_VERSION = "2.3.4";
1919
private String APP_TYPE = "Public";
2020
private String USER_AGENT = "Xero-Java-SDK";
2121
private String ACCEPT = "application/xml";

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

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,7 +1946,7 @@ public Attachments createRepeatingInvoiceAttachmentByFileName(UUID repeatingInvo
19461946
}
19471947
/**
19481948
* Allows you to create history for a repeating invoice
1949-
* <p><b>200</b> - Success - return response of type HistoryRecords array with newly created HistoryRecord for Repeating Invoice
1949+
* <p><b>200</b> - Unsupported - return response incorrect exception, API is not able to create HistoryRecord for Repeating Invoice
19501950
* <p><b>400</b> - A failed request due to validation error
19511951
* @param repeatingInvoiceID Unique identifier for a Repeating Invoice
19521952
* @param historyRecords The historyRecords parameter
@@ -2783,10 +2783,11 @@ public Attachments getBankTransactionAttachments(UUID bankTransactionID) throws
27832783
* @param where Filter by an any element
27842784
* @param order Order by an any element
27852785
* @param page e.g. page&#x3D;1 – Up to 100 bank transactions will be returned in a single API call with line items shown for each bank transaction
2786+
* @param unitdp e.g. unitdp&#x3D;4 – You can opt in to use four decimal places for unit amounts
27862787
* @return BankTransactions
27872788
* @throws IOException if an error occurs while attempting to invoke the API
27882789
**/
2789-
public BankTransactions getBankTransactions(OffsetDateTime ifModifiedSince, String where, String order, Integer page) throws IOException {
2790+
public BankTransactions getBankTransactions(OffsetDateTime ifModifiedSince, String where, String order, Integer page, Integer unitdp) throws IOException {
27902791
try {
27912792
String strBody = null;
27922793
Map<String, String> params = null;
@@ -2800,6 +2801,8 @@ public BankTransactions getBankTransactions(OffsetDateTime ifModifiedSince, Stri
28002801
addToMapIfNotNull(params, "order", order);
28012802
}if (page != null) {
28022803
addToMapIfNotNull(params, "page", page);
2804+
}if (unitdp != null) {
2805+
addToMapIfNotNull(params, "unitdp", unitdp);
28032806
}
28042807

28052808
String response = this.DATA(url, strBody, params, "GET", ifModifiedSince);
@@ -4334,10 +4337,11 @@ public InvoiceReminders getInvoiceReminders() throws IOException {
43344337
* @param page e.g. page&#x3D;1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice
43354338
* @param includeArchived e.g. includeArchived&#x3D;true - Contacts with a status of ARCHIVED will be included in the response
43364339
* @param createdByMyApp When set to true you&#39;ll only retrieve Invoices created by your app
4340+
* @param unitdp e.g. unitdp&#x3D;4 – You can opt in to use four decimal places for unit amounts
43374341
* @return Invoices
43384342
* @throws IOException if an error occurs while attempting to invoke the API
43394343
**/
4340-
public Invoices getInvoices(OffsetDateTime ifModifiedSince, String where, String order, String ids, String invoiceNumbers, String contactIDs, String statuses, Integer page, Boolean includeArchived, Boolean createdByMyApp) throws IOException {
4344+
public Invoices getInvoices(OffsetDateTime ifModifiedSince, String where, String order, String ids, String invoiceNumbers, String contactIDs, String statuses, Integer page, Boolean includeArchived, Boolean createdByMyApp, Integer unitdp) throws IOException {
43414345
try {
43424346
String strBody = null;
43434347
Map<String, String> params = null;
@@ -4363,6 +4367,8 @@ public Invoices getInvoices(OffsetDateTime ifModifiedSince, String where, String
43634367
addToMapIfNotNull(params, "includeArchived", includeArchived);
43644368
}if (createdByMyApp != null) {
43654369
addToMapIfNotNull(params, "createdByMyApp", createdByMyApp);
4370+
}if (unitdp != null) {
4371+
addToMapIfNotNull(params, "unitdp", unitdp);
43664372
}
43674373

43684374
String response = this.DATA(url, strBody, params, "GET", ifModifiedSince);
@@ -4458,10 +4464,11 @@ public HistoryRecords getItemHistory(UUID itemID) throws IOException {
44584464
* @param ifModifiedSince Only records created or modified since this timestamp will be returned
44594465
* @param where Filter by an any element
44604466
* @param order Order by an any element
4467+
* @param unitdp e.g. unitdp&#x3D;4 – You can opt in to use four decimal places for unit amounts
44614468
* @return Items
44624469
* @throws IOException if an error occurs while attempting to invoke the API
44634470
**/
4464-
public Items getItems(OffsetDateTime ifModifiedSince, String where, String order) throws IOException {
4471+
public Items getItems(OffsetDateTime ifModifiedSince, String where, String order, Integer unitdp) throws IOException {
44654472
try {
44664473
String strBody = null;
44674474
Map<String, String> params = null;
@@ -4473,6 +4480,8 @@ public Items getItems(OffsetDateTime ifModifiedSince, String where, String order
44734480
addToMapIfNotNull(params, "where", where);
44744481
}if (order != null) {
44754482
addToMapIfNotNull(params, "order", order);
4483+
}if (unitdp != null) {
4484+
addToMapIfNotNull(params, "unitdp", unitdp);
44764485
}
44774486

44784487
String response = this.DATA(url, strBody, params, "GET", ifModifiedSince);
@@ -5015,10 +5024,11 @@ public HistoryRecords getOverpaymentHistory(UUID overpaymentID) throws IOExcepti
50155024
* @param where Filter by an any element
50165025
* @param order Order by an any element
50175026
* @param page e.g. page&#x3D;1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment
5027+
* @param unitdp e.g. unitdp&#x3D;4 – You can opt in to use four decimal places for unit amounts
50185028
* @return Overpayments
50195029
* @throws IOException if an error occurs while attempting to invoke the API
50205030
**/
5021-
public Overpayments getOverpayments(OffsetDateTime ifModifiedSince, String where, String order, Integer page) throws IOException {
5031+
public Overpayments getOverpayments(OffsetDateTime ifModifiedSince, String where, String order, Integer page, Integer unitdp) throws IOException {
50225032
try {
50235033
String strBody = null;
50245034
Map<String, String> params = null;
@@ -5032,6 +5042,8 @@ public Overpayments getOverpayments(OffsetDateTime ifModifiedSince, String where
50325042
addToMapIfNotNull(params, "order", order);
50335043
}if (page != null) {
50345044
addToMapIfNotNull(params, "page", page);
5045+
}if (unitdp != null) {
5046+
addToMapIfNotNull(params, "unitdp", unitdp);
50355047
}
50365048

50375049
String response = this.DATA(url, strBody, params, "GET", ifModifiedSince);
@@ -5264,10 +5276,11 @@ public HistoryRecords getPrepaymentHistory(UUID prepaymentID) throws IOException
52645276
* @param where Filter by an any element
52655277
* @param order Order by an any element
52665278
* @param page e.g. page&#x3D;1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment
5279+
* @param unitdp e.g. unitdp&#x3D;4 – You can opt in to use four decimal places for unit amounts
52675280
* @return Prepayments
52685281
* @throws IOException if an error occurs while attempting to invoke the API
52695282
**/
5270-
public Prepayments getPrepayments(OffsetDateTime ifModifiedSince, String where, String order, Integer page) throws IOException {
5283+
public Prepayments getPrepayments(OffsetDateTime ifModifiedSince, String where, String order, Integer page, Integer unitdp) throws IOException {
52715284
try {
52725285
String strBody = null;
52735286
Map<String, String> params = null;
@@ -5281,6 +5294,8 @@ public Prepayments getPrepayments(OffsetDateTime ifModifiedSince, String where,
52815294
addToMapIfNotNull(params, "order", order);
52825295
}if (page != null) {
52835296
addToMapIfNotNull(params, "page", page);
5297+
}if (unitdp != null) {
5298+
addToMapIfNotNull(params, "unitdp", unitdp);
52845299
}
52855300

52865301
String response = this.DATA(url, strBody, params, "GET", ifModifiedSince);
@@ -5609,10 +5624,11 @@ public HistoryRecords getReceiptHistory(UUID receiptID) throws IOException {
56095624
* @param ifModifiedSince Only records created or modified since this timestamp will be returned
56105625
* @param where Filter by an any element
56115626
* @param order Order by an any element
5627+
* @param unitdp e.g. unitdp&#x3D;4 – You can opt in to use four decimal places for unit amounts
56125628
* @return Receipts
56135629
* @throws IOException if an error occurs while attempting to invoke the API
56145630
**/
5615-
public Receipts getReceipts(OffsetDateTime ifModifiedSince, String where, String order) throws IOException {
5631+
public Receipts getReceipts(OffsetDateTime ifModifiedSince, String where, String order, Integer unitdp) throws IOException {
56165632
try {
56175633
String strBody = null;
56185634
Map<String, String> params = null;
@@ -5624,6 +5640,8 @@ public Receipts getReceipts(OffsetDateTime ifModifiedSince, String where, String
56245640
addToMapIfNotNull(params, "where", where);
56255641
}if (order != null) {
56265642
addToMapIfNotNull(params, "order", order);
5643+
}if (unitdp != null) {
5644+
addToMapIfNotNull(params, "unitdp", unitdp);
56275645
}
56285646

56295647
String response = this.DATA(url, strBody, params, "GET", ifModifiedSince);

0 commit comments

Comments
 (0)