@@ -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.1.0 ";
96+ private String version = "4.1.1 ";
9797 final static Logger logger = LoggerFactory.getLogger(AccountingApi.class);
9898
9999 public AccountingApi() {
@@ -1398,14 +1398,15 @@ public HttpResponse createContactsForHttpResponse(String accessToken, String xe
13981398 * @param xeroTenantId Xero identifier for Tenant
13991399 * @param creditNoteID Unique identifier for a Credit Note
14001400 * @param allocations Allocations with array of Allocation object in body of request.
1401+ * @param summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors
14011402 * @param accessToken Authorization token for user set in header of each request
14021403 * @return Allocations
14031404 * @throws IOException if an error occurs while attempting to invoke the API
14041405 **/
1405- public Allocations createCreditNoteAllocation(String accessToken, String xeroTenantId, UUID creditNoteID, Allocations allocations) throws IOException {
1406+ public Allocations createCreditNoteAllocation(String accessToken, String xeroTenantId, UUID creditNoteID, Allocations allocations, Boolean summarizeErrors ) throws IOException {
14061407 try {
14071408 TypeReference<Allocations> typeRef = new TypeReference<Allocations>() {};
1408- HttpResponse response = createCreditNoteAllocationForHttpResponse(accessToken, xeroTenantId, creditNoteID, allocations);
1409+ HttpResponse response = createCreditNoteAllocationForHttpResponse(accessToken, xeroTenantId, creditNoteID, allocations, summarizeErrors );
14091410 return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
14101411 } catch (HttpResponseException e) {
14111412 if (logger.isDebugEnabled()) {
@@ -1429,7 +1430,7 @@ public Allocations createCreditNoteAllocation(String accessToken, String xeroTe
14291430 return null;
14301431 }
14311432
1432- public HttpResponse createCreditNoteAllocationForHttpResponse(String accessToken, String xeroTenantId, UUID creditNoteID, Allocations allocations) throws IOException {
1433+ public HttpResponse createCreditNoteAllocationForHttpResponse(String accessToken, String xeroTenantId, UUID creditNoteID, Allocations allocations, Boolean summarizeErrors ) throws IOException {
14331434 // verify the required parameter 'xeroTenantId' is set
14341435 if (xeroTenantId == null) {
14351436 throw new IllegalArgumentException("Missing the required parameter 'xeroTenantId' when calling createCreditNoteAllocation");
@@ -1452,6 +1453,17 @@ public HttpResponse createCreditNoteAllocationForHttpResponse(String accessToken
14521453 uriVariables.put("CreditNoteID", creditNoteID);
14531454
14541455 UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/CreditNotes/{CreditNoteID}/Allocations");
1456+ if (summarizeErrors != null) {
1457+ String key = "summarizeErrors";
1458+ Object value = summarizeErrors;
1459+ if (value instanceof Collection) {
1460+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
1461+ } else if (value instanceof Object[]) {
1462+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
1463+ } else {
1464+ uriBuilder = uriBuilder.queryParam(key, value);
1465+ }
1466+ }
14551467 String url = uriBuilder.buildFromMap(uriVariables).toString();
14561468 GenericUrl genericUrl = new GenericUrl(url);
14571469 if (logger.isDebugEnabled()) {
0 commit comments