@@ -91,7 +91,7 @@ public class AccountingApi {
9191 private ApiClient apiClient;
9292 private static AccountingApi instance = null;
9393 private String userAgent = "Default";
94- private String version = "3.5.2 ";
94+ private String version = "3.6.0 ";
9595
9696 public AccountingApi() {
9797 this(new ApiClient());
@@ -1263,16 +1263,16 @@ public HttpResponse createCreditNoteAllocationForHttpResponse(String accessToken
12631263 * @param xeroTenantId Xero identifier for Tenant
12641264 * @param creditNoteID Unique identifier for a Credit Note
12651265 * @param fileName Name of the file you are attaching to Credit Note
1266- * @param includeOnline Set an attachment to be included with the invoice when viewed online (through Xero)
12671266 * @param body Byte array of file in body of request
1267+ * @param includeOnline Allows an attachment to be seen by the end customer within their online invoice
12681268 * @param accessToken Authorization token for user set in header of each request
12691269 * @return Attachments
12701270 * @throws IOException if an error occurs while attempting to invoke the API
12711271 **/
1272- public Attachments createCreditNoteAttachmentByFileName(String accessToken, String xeroTenantId, UUID creditNoteID, String fileName, Boolean includeOnline, File body ) throws IOException {
1272+ public Attachments createCreditNoteAttachmentByFileName(String accessToken, String xeroTenantId, UUID creditNoteID, String fileName, File body, Boolean includeOnline ) throws IOException {
12731273 try {
12741274 TypeReference<Attachments> typeRef = new TypeReference<Attachments>() {};
1275- HttpResponse response = createCreditNoteAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, creditNoteID, fileName, includeOnline, body );
1275+ HttpResponse response = createCreditNoteAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, creditNoteID, fileName, body, includeOnline );
12761276 return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
12771277 } catch (HttpResponseException e) {
12781278 XeroApiExceptionHandler handler = new XeroApiExceptionHandler();
@@ -1283,7 +1283,7 @@ public Attachments createCreditNoteAttachmentByFileName(String accessToken, Str
12831283 return null;
12841284 }
12851285
1286- public HttpResponse createCreditNoteAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID creditNoteID, String fileName, Boolean includeOnline, File body ) throws IOException {
1286+ public HttpResponse createCreditNoteAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID creditNoteID, String fileName, File body, Boolean includeOnline ) throws IOException {
12871287 // verify the required parameter 'xeroTenantId' is set
12881288 if (xeroTenantId == null) {
12891289 throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createCreditNoteAttachmentByFileName");
@@ -1293,9 +1293,6 @@ public HttpResponse createCreditNoteAttachmentByFileNameForHttpResponse(String a
12931293 }// verify the required parameter 'fileName' is set
12941294 if (fileName == null) {
12951295 throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createCreditNoteAttachmentByFileName");
1296- }// verify the required parameter 'includeOnline' is set
1297- if (includeOnline == null) {
1298- throw new IllegalArgumentException("Missing the required parameter 'includeOnline' when calling createCreditNoteAttachmentByFileName");
12991296 }// verify the required parameter 'body' is set
13001297 if (body == null) {
13011298 throw new IllegalArgumentException("Missing the required parameter 'body' when calling createCreditNoteAttachmentByFileName");
@@ -1314,9 +1311,19 @@ public HttpResponse createCreditNoteAttachmentByFileNameForHttpResponse(String a
13141311 final Map<String, Object> uriVariables = new HashMap<String, Object>();
13151312 uriVariables.put("CreditNoteID", creditNoteID);
13161313 uriVariables.put("FileName", fileName);
1317- uriVariables.put("IncludeOnline", includeOnline);
13181314
13191315 UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + correctPath);
1316+ if (includeOnline != null) {
1317+ String key = "IncludeOnline";
1318+ Object value = includeOnline;
1319+ if (value instanceof Collection) {
1320+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
1321+ } else if (value instanceof Object[]) {
1322+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
1323+ } else {
1324+ uriBuilder = uriBuilder.queryParam(key, value);
1325+ }
1326+ }
13201327 String url = uriBuilder.buildFromMap(uriVariables).toString();
13211328 GenericUrl genericUrl = new GenericUrl(url);
13221329
@@ -1731,16 +1738,16 @@ public HttpResponse createExpenseClaimsForHttpResponse(String accessToken, Stri
17311738 * @param xeroTenantId Xero identifier for Tenant
17321739 * @param invoiceID Unique identifier for an Invoice
17331740 * @param fileName Name of the file you are attaching
1734- * @param includeOnline Set an attachment to be included with the invoice when viewed online (through Xero)
17351741 * @param body Byte array of file in body of request
1742+ * @param includeOnline Allows an attachment to be seen by the end customer within their online invoice
17361743 * @param accessToken Authorization token for user set in header of each request
17371744 * @return Attachments
17381745 * @throws IOException if an error occurs while attempting to invoke the API
17391746 **/
1740- public Attachments createInvoiceAttachmentByFileName(String accessToken, String xeroTenantId, UUID invoiceID, String fileName, Boolean includeOnline, File body ) throws IOException {
1747+ public Attachments createInvoiceAttachmentByFileName(String accessToken, String xeroTenantId, UUID invoiceID, String fileName, File body, Boolean includeOnline ) throws IOException {
17411748 try {
17421749 TypeReference<Attachments> typeRef = new TypeReference<Attachments>() {};
1743- HttpResponse response = createInvoiceAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, invoiceID, fileName, includeOnline, body );
1750+ HttpResponse response = createInvoiceAttachmentByFileNameForHttpResponse(accessToken, xeroTenantId, invoiceID, fileName, body, includeOnline );
17441751 return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
17451752 } catch (HttpResponseException e) {
17461753 XeroApiExceptionHandler handler = new XeroApiExceptionHandler();
@@ -1751,7 +1758,7 @@ public Attachments createInvoiceAttachmentByFileName(String accessToken, String
17511758 return null;
17521759 }
17531760
1754- public HttpResponse createInvoiceAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID invoiceID, String fileName, Boolean includeOnline, File body ) throws IOException {
1761+ public HttpResponse createInvoiceAttachmentByFileNameForHttpResponse(String accessToken, String xeroTenantId, UUID invoiceID, String fileName, File body, Boolean includeOnline ) throws IOException {
17551762 // verify the required parameter 'xeroTenantId' is set
17561763 if (xeroTenantId == null) {
17571764 throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createInvoiceAttachmentByFileName");
@@ -1761,9 +1768,6 @@ public HttpResponse createInvoiceAttachmentByFileNameForHttpResponse(String acce
17611768 }// verify the required parameter 'fileName' is set
17621769 if (fileName == null) {
17631770 throw new IllegalArgumentException("Missing the required parameter 'fileName' when calling createInvoiceAttachmentByFileName");
1764- }// verify the required parameter 'includeOnline' is set
1765- if (includeOnline == null) {
1766- throw new IllegalArgumentException("Missing the required parameter 'includeOnline' when calling createInvoiceAttachmentByFileName");
17671771 }// verify the required parameter 'body' is set
17681772 if (body == null) {
17691773 throw new IllegalArgumentException("Missing the required parameter 'body' when calling createInvoiceAttachmentByFileName");
@@ -1782,9 +1786,19 @@ public HttpResponse createInvoiceAttachmentByFileNameForHttpResponse(String acce
17821786 final Map<String, Object> uriVariables = new HashMap<String, Object>();
17831787 uriVariables.put("InvoiceID", invoiceID);
17841788 uriVariables.put("FileName", fileName);
1785- uriVariables.put("IncludeOnline", includeOnline);
17861789
17871790 UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + correctPath);
1791+ if (includeOnline != null) {
1792+ String key = "IncludeOnline";
1793+ Object value = includeOnline;
1794+ if (value instanceof Collection) {
1795+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
1796+ } else if (value instanceof Object[]) {
1797+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
1798+ } else {
1799+ uriBuilder = uriBuilder.queryParam(key, value);
1800+ }
1801+ }
17881802 String url = uriBuilder.buildFromMap(uriVariables).toString();
17891803 GenericUrl genericUrl = new GenericUrl(url);
17901804
0 commit comments