diff --git a/README.md b/README.md index 04ed88f2..545e11ee 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Add this dependency to your project's POM: com.wallee wallee-java-sdk - 4.0.5 + 4.0.6 compile ``` @@ -33,7 +33,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "com.wallee:wallee-java-sdk:4.0.5" +compile "com.wallee:wallee-java-sdk:4.0.6" ``` ### Others @@ -46,7 +46,7 @@ mvn clean package Then manually install the following JARs: -* `target/wallee-java-sdk-4.0.5.jar` +* `target/wallee-java-sdk-4.0.6.jar` * `target/lib/*.jar` ## Usage diff --git a/build.gradle b/build.gradle index 5a60ffef..525d6238 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' group = 'com.wallee' -version = '4.0.5' +version = '4.0.6' buildscript { repositories { diff --git a/build.sbt b/build.sbt index 371298e0..01d89053 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "com.wallee", name := "wallee-java-sdk", - version := "4.0.5", + version := "4.0.6", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), javacOptions in compile ++= Seq("-Xlint:deprecation"), diff --git a/pom.xml b/pom.xml index 0a43aba4..bf1289ae 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ wallee-java-sdk jar wallee-java-sdk - 4.0.5 + 4.0.6 https://www.wallee.com The SDK for simplifying the integration with wallee API. diff --git a/src/main/java/com/wallee/sdk/ApiClient.java b/src/main/java/com/wallee/sdk/ApiClient.java index cf6601e6..c05b43f4 100644 --- a/src/main/java/com/wallee/sdk/ApiClient.java +++ b/src/main/java/com/wallee/sdk/ApiClient.java @@ -373,6 +373,14 @@ public InternalTransferBankTransactionService getInternalTransferBankTransaction return this.internalTransferBankTransactionService; } + private InvoiceReconciliationRecordInvoiceLinkService invoiceReconciliationRecordInvoiceLinkService; + public InvoiceReconciliationRecordInvoiceLinkService getInvoiceReconciliationRecordInvoiceLinkService() { + if (this.invoiceReconciliationRecordInvoiceLinkService == null) { + this.invoiceReconciliationRecordInvoiceLinkService = new InvoiceReconciliationRecordInvoiceLinkService(this); + } + return this.invoiceReconciliationRecordInvoiceLinkService; + } + private InvoiceReconciliationRecordService invoiceReconciliationRecordService; public InvoiceReconciliationRecordService getInvoiceReconciliationRecordService() { if (this.invoiceReconciliationRecordService == null) { diff --git a/src/main/java/com/wallee/sdk/model/InvoiceReconciliationRecord.java b/src/main/java/com/wallee/sdk/model/InvoiceReconciliationRecord.java index 2bf7d466..0b0ce261 100644 --- a/src/main/java/com/wallee/sdk/model/InvoiceReconciliationRecord.java +++ b/src/main/java/com/wallee/sdk/model/InvoiceReconciliationRecord.java @@ -108,6 +108,10 @@ public class InvoiceReconciliationRecord extends TransactionAwareEntity { protected String paymentFeeCurrency = null; + @JsonProperty("paymentReason") + protected String paymentReason = null; + + @JsonProperty("plannedPurgeDate") protected OffsetDateTime plannedPurgeDate = null; @@ -321,6 +325,16 @@ public String getPaymentFeeCurrency() { } + /** + * + * @return paymentReason + **/ + @ApiModelProperty(value = "") + public String getPaymentReason() { + return paymentReason; + } + + /** * The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed. * @return plannedPurgeDate @@ -480,6 +494,7 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.participantNumber, invoiceReconciliationRecord.participantNumber) && Objects.equals(this.paymentFeeAmount, invoiceReconciliationRecord.paymentFeeAmount) && Objects.equals(this.paymentFeeCurrency, invoiceReconciliationRecord.paymentFeeCurrency) && + Objects.equals(this.paymentReason, invoiceReconciliationRecord.paymentReason) && Objects.equals(this.plannedPurgeDate, invoiceReconciliationRecord.plannedPurgeDate) && Objects.equals(this.postCode, invoiceReconciliationRecord.postCode) && Objects.equals(this.referenceNumber, invoiceReconciliationRecord.referenceNumber) && @@ -498,7 +513,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(id, linkedSpaceId, linkedTransaction, address, amount, city, country, createdOn, currency, discardedBy, discardedOn, environment, familyName, givenName, iban, lastResolutionFailure, participantNumber, paymentFeeAmount, paymentFeeCurrency, plannedPurgeDate, postCode, referenceNumber, rejectionStatus, resolvedBy, resolvedOn, senderBankAccount, state, street, type, uniqueId, valueDate, version, super.hashCode()); + return Objects.hash(id, linkedSpaceId, linkedTransaction, address, amount, city, country, createdOn, currency, discardedBy, discardedOn, environment, familyName, givenName, iban, lastResolutionFailure, participantNumber, paymentFeeAmount, paymentFeeCurrency, paymentReason, plannedPurgeDate, postCode, referenceNumber, rejectionStatus, resolvedBy, resolvedOn, senderBankAccount, state, street, type, uniqueId, valueDate, version, super.hashCode()); } @@ -526,6 +541,7 @@ public String toString() { sb.append(" participantNumber: ").append(toIndentedString(participantNumber)).append("\n"); sb.append(" paymentFeeAmount: ").append(toIndentedString(paymentFeeAmount)).append("\n"); sb.append(" paymentFeeCurrency: ").append(toIndentedString(paymentFeeCurrency)).append("\n"); + sb.append(" paymentReason: ").append(toIndentedString(paymentReason)).append("\n"); sb.append(" plannedPurgeDate: ").append(toIndentedString(plannedPurgeDate)).append("\n"); sb.append(" postCode: ").append(toIndentedString(postCode)).append("\n"); sb.append(" referenceNumber: ").append(toIndentedString(referenceNumber)).append("\n"); diff --git a/src/main/java/com/wallee/sdk/model/InvoiceReconciliationRecordInvoiceLink.java b/src/main/java/com/wallee/sdk/model/InvoiceReconciliationRecordInvoiceLink.java new file mode 100644 index 00000000..a669df2a --- /dev/null +++ b/src/main/java/com/wallee/sdk/model/InvoiceReconciliationRecordInvoiceLink.java @@ -0,0 +1,179 @@ +/** +* wallee SDK +* +* This library allows to interact with the wallee payment service. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + + +package com.wallee.sdk.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.wallee.sdk.model.InvoiceReconciliationRecord; +import com.wallee.sdk.model.TransactionInvoice; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.util.*; +import java.time.OffsetDateTime; + +/** + * + */ +@ApiModel(description = "") + +public class InvoiceReconciliationRecordInvoiceLink { + + @JsonProperty("amount") + protected BigDecimal amount = null; + + + @JsonProperty("createdOn") + protected OffsetDateTime createdOn = null; + + + @JsonProperty("id") + protected Long id = null; + + + @JsonProperty("invoice") + protected TransactionInvoice invoice = null; + + + @JsonProperty("linkedSpaceId") + protected Long linkedSpaceId = null; + + + @JsonProperty("record") + protected InvoiceReconciliationRecord record = null; + + + + /** + * + * @return amount + **/ + @ApiModelProperty(value = "") + public BigDecimal getAmount() { + return amount; + } + + + /** + * The created on date indicates the date on which the entity was stored into the database. + * @return createdOn + **/ + @ApiModelProperty(value = "The created on date indicates the date on which the entity was stored into the database.") + public OffsetDateTime getCreatedOn() { + return createdOn; + } + + + /** + * The ID is the primary key of the entity. The ID identifies the entity uniquely. + * @return id + **/ + @ApiModelProperty(value = "The ID is the primary key of the entity. The ID identifies the entity uniquely.") + public Long getId() { + return id; + } + + + /** + * + * @return invoice + **/ + @ApiModelProperty(value = "") + public TransactionInvoice getInvoice() { + return invoice; + } + + + /** + * The linked space id holds the ID of the space to which the entity belongs to. + * @return linkedSpaceId + **/ + @ApiModelProperty(value = "The linked space id holds the ID of the space to which the entity belongs to.") + public Long getLinkedSpaceId() { + return linkedSpaceId; + } + + + /** + * + * @return record + **/ + @ApiModelProperty(value = "") + public InvoiceReconciliationRecord getRecord() { + return record; + } + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvoiceReconciliationRecordInvoiceLink invoiceReconciliationRecordInvoiceLink = (InvoiceReconciliationRecordInvoiceLink) o; + return Objects.equals(this.amount, invoiceReconciliationRecordInvoiceLink.amount) && + Objects.equals(this.createdOn, invoiceReconciliationRecordInvoiceLink.createdOn) && + Objects.equals(this.id, invoiceReconciliationRecordInvoiceLink.id) && + Objects.equals(this.invoice, invoiceReconciliationRecordInvoiceLink.invoice) && + Objects.equals(this.linkedSpaceId, invoiceReconciliationRecordInvoiceLink.linkedSpaceId) && + Objects.equals(this.record, invoiceReconciliationRecordInvoiceLink.record); + } + + @Override + public int hashCode() { + return Objects.hash(amount, createdOn, id, invoice, linkedSpaceId, record); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvoiceReconciliationRecordInvoiceLink {\n"); + + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" createdOn: ").append(toIndentedString(createdOn)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" invoice: ").append(toIndentedString(invoice)).append("\n"); + sb.append(" linkedSpaceId: ").append(toIndentedString(linkedSpaceId)).append("\n"); + sb.append(" record: ").append(toIndentedString(record)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/wallee/sdk/service/InvoiceReconciliationRecordInvoiceLinkService.java b/src/main/java/com/wallee/sdk/service/InvoiceReconciliationRecordInvoiceLinkService.java new file mode 100644 index 00000000..e1e805f3 --- /dev/null +++ b/src/main/java/com/wallee/sdk/service/InvoiceReconciliationRecordInvoiceLinkService.java @@ -0,0 +1,781 @@ +package com.wallee.sdk.service; + +import com.wallee.sdk.ApiClient; + +import java.math.BigDecimal; +import com.wallee.sdk.model.ClientError; +import com.wallee.sdk.model.EntityQuery; +import com.wallee.sdk.model.EntityQueryFilter; +import com.wallee.sdk.model.InvoiceReconciliationRecordInvoiceLink; +import com.wallee.sdk.model.ServerError; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.google.api.client.http.*; +import com.google.api.client.json.Json; + +import javax.ws.rs.core.UriBuilder; +import java.io.IOException; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.List; +import java.util.ArrayList; + + +public class InvoiceReconciliationRecordInvoiceLinkService { + private ApiClient apiClient; + + public InvoiceReconciliationRecordInvoiceLinkService(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Count + * Counts the number of items in the database as restricted by the given filter. + *

200 - This status code indicates that a client request was successfully received, understood, and accepted. + *

442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error. + *

542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request. + * @param spaceId + * @param filter The filter which restricts the entities which are used to calculate the count. + * @return Long + * @throws IOException if an error occurs while attempting to invoke the API + * For more information visit this link. + * @see Count Documentation + + **/ + public Long count(Long spaceId, EntityQueryFilter filter) throws IOException { + HttpResponse response = countForHttpResponse(spaceId, filter); + String returnType = "Long"; + if(returnType.equals("String")){ + return (Long) (Object) response.parseAsString(); + } + TypeReference typeRef = new TypeReference() {}; + return (Long)apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } + + /** + * Count + * Counts the number of items in the database as restricted by the given filter. + *

200 - This status code indicates that a client request was successfully received, understood, and accepted. + *

442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error. + *

542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request. + * @param spaceId + * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. + * @return Long + * @throws IOException if an error occurs while attempting to invoke the API + * For more information visit this link. + * @see Count Documentation + + **/ + public Long count(EntityQueryFilter filter, Long spaceId, Map params) throws IOException { + HttpResponse response = countForHttpResponse(filter, spaceId, params); + String returnType = "Long"; + if(returnType.equals("String")){ + return (Long) (Object) response.parseAsString(); + } + TypeReference typeRef = new TypeReference() {}; + return (Long)apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } + + public HttpResponse countForHttpResponse(Long spaceId, EntityQueryFilter filter) throws IOException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling count"); + } + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/invoice-reconciliation-record-invoice-link-service/count"); + if (spaceId != null) { + String key = "spaceId"; + Object value = spaceId; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + + HttpContent content = apiClient.new JacksonJsonHttpContent(filter); + HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); + + + httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT); + return httpRequest.execute(); + } + + public HttpResponse countForHttpResponse(Long spaceId, java.io.InputStream filter, String mediaType) throws IOException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling count"); + } + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/invoice-reconciliation-record-invoice-link-service/count"); + if (spaceId != null) { + String key = "spaceId"; + Object value = spaceId; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + + HttpContent content = filter == null ? + apiClient.new JacksonJsonHttpContent(null) : + new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, filter); + HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); + + httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT); + return httpRequest.execute(); + } + + public HttpResponse countForHttpResponse(EntityQueryFilter filter, Long spaceId, Map params) throws IOException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling count"); + } + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/invoice-reconciliation-record-invoice-link-service/count"); + + // Copy the params argument if present, to allow passing in immutable maps + Map allParams = params == null ? new HashMap() : new HashMap(params); + // Add the required query param 'spaceId' to the map of query params + allParams.put("spaceId", spaceId); + + for (Map.Entry entryMap: allParams.entrySet()) { + String key = entryMap.getKey(); + Object value = entryMap.getValue(); + + if (key != null && value != null) { + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + } + + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + + HttpContent content = apiClient.new JacksonJsonHttpContent(filter); + HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); + + + httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT); + return httpRequest.execute(); + } + + /** + * Link Invoice + * Links the invoice reconciliation record with the provided invoice. + *

200 - This status code indicates that a client request was successfully received, understood, and accepted. + *

409 - This status code indicates that there was a conflict with the current version of the data in the database and the provided data in the request. + *

442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error. + *

542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request. + * @param spaceId + * @param recordId The ID of the invoice reconciliation record which should be linked. + * @param completionId The ID of the completion which should be linked. + * @param amount The amount of the invoice reconciliation record linked completion which should be changed. + * @return InvoiceReconciliationRecordInvoiceLink + * @throws IOException if an error occurs while attempting to invoke the API + * For more information visit this link. + * @see Link Invoice Documentation + + **/ + public InvoiceReconciliationRecordInvoiceLink link(Long spaceId, Long recordId, Long completionId, BigDecimal amount) throws IOException { + HttpResponse response = linkForHttpResponse(spaceId, recordId, completionId, amount); + String returnType = "InvoiceReconciliationRecordInvoiceLink"; + if(returnType.equals("String")){ + return (InvoiceReconciliationRecordInvoiceLink) (Object) response.parseAsString(); + } + TypeReference typeRef = new TypeReference() {}; + return (InvoiceReconciliationRecordInvoiceLink)apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } + + /** + * Link Invoice + * Links the invoice reconciliation record with the provided invoice. + *

200 - This status code indicates that a client request was successfully received, understood, and accepted. + *

409 - This status code indicates that there was a conflict with the current version of the data in the database and the provided data in the request. + *

442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error. + *

542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request. + * @param spaceId + * @param recordId The ID of the invoice reconciliation record which should be linked. + * @param completionId The ID of the completion which should be linked. + * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. + * @return InvoiceReconciliationRecordInvoiceLink + * @throws IOException if an error occurs while attempting to invoke the API + * For more information visit this link. + * @see Link Invoice Documentation + + **/ + public InvoiceReconciliationRecordInvoiceLink link(Long spaceId, Long recordId, Long completionId, Map params) throws IOException { + HttpResponse response = linkForHttpResponse(spaceId, recordId, completionId, params); + String returnType = "InvoiceReconciliationRecordInvoiceLink"; + if(returnType.equals("String")){ + return (InvoiceReconciliationRecordInvoiceLink) (Object) response.parseAsString(); + } + TypeReference typeRef = new TypeReference() {}; + return (InvoiceReconciliationRecordInvoiceLink)apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } + + public HttpResponse linkForHttpResponse(Long spaceId, Long recordId, Long completionId, BigDecimal amount) throws IOException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling link"); + }// verify the required parameter 'recordId' is set + if (recordId == null) { + throw new IllegalArgumentException("Missing the required parameter 'recordId' when calling link"); + }// verify the required parameter 'completionId' is set + if (completionId == null) { + throw new IllegalArgumentException("Missing the required parameter 'completionId' when calling link"); + } + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/invoice-reconciliation-record-invoice-link-service/link"); + if (spaceId != null) { + String key = "spaceId"; + Object value = spaceId; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (recordId != null) { + String key = "recordId"; + Object value = recordId; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (completionId != null) { + String key = "completionId"; + Object value = completionId; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (amount != null) { + String key = "amount"; + Object value = amount; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + + HttpContent content = apiClient.new JacksonJsonHttpContent(null); + HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); + + + httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT); + return httpRequest.execute(); + } + + public HttpResponse linkForHttpResponse(Long spaceId, Long recordId, Long completionId, Map params) throws IOException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling link"); + }// verify the required parameter 'recordId' is set + if (recordId == null) { + throw new IllegalArgumentException("Missing the required parameter 'recordId' when calling link"); + }// verify the required parameter 'completionId' is set + if (completionId == null) { + throw new IllegalArgumentException("Missing the required parameter 'completionId' when calling link"); + } + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/invoice-reconciliation-record-invoice-link-service/link"); + + // Copy the params argument if present, to allow passing in immutable maps + Map allParams = params == null ? new HashMap() : new HashMap(params); + // Add the required query param 'spaceId' to the map of query params + allParams.put("spaceId", spaceId); + // Add the required query param 'recordId' to the map of query params + allParams.put("recordId", recordId); + // Add the required query param 'completionId' to the map of query params + allParams.put("completionId", completionId); + + for (Map.Entry entryMap: allParams.entrySet()) { + String key = entryMap.getKey(); + Object value = entryMap.getValue(); + + if (key != null && value != null) { + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + } + + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + + HttpContent content = apiClient.new JacksonJsonHttpContent(null); + HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); + + + httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT); + return httpRequest.execute(); + } + + /** + * Read + * Reads the entity with the given 'id' and returns it. + *

200 - This status code indicates that a client request was successfully received, understood, and accepted. + *

442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error. + *

542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request. + * @param spaceId + * @param id The ID of the invoice reconciliation record invoice link which should be returned. + * @return InvoiceReconciliationRecordInvoiceLink + * @throws IOException if an error occurs while attempting to invoke the API + * For more information visit this link. + * @see Read Documentation + + **/ + public InvoiceReconciliationRecordInvoiceLink read(Long spaceId, Long id) throws IOException { + HttpResponse response = readForHttpResponse(spaceId, id); + String returnType = "InvoiceReconciliationRecordInvoiceLink"; + if(returnType.equals("String")){ + return (InvoiceReconciliationRecordInvoiceLink) (Object) response.parseAsString(); + } + TypeReference typeRef = new TypeReference() {}; + return (InvoiceReconciliationRecordInvoiceLink)apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } + + /** + * Read + * Reads the entity with the given 'id' and returns it. + *

200 - This status code indicates that a client request was successfully received, understood, and accepted. + *

442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error. + *

542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request. + * @param spaceId + * @param id The ID of the invoice reconciliation record invoice link which should be returned. + * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. + * @return InvoiceReconciliationRecordInvoiceLink + * @throws IOException if an error occurs while attempting to invoke the API + * For more information visit this link. + * @see Read Documentation + + **/ + public InvoiceReconciliationRecordInvoiceLink read(Long spaceId, Long id, Map params) throws IOException { + HttpResponse response = readForHttpResponse(spaceId, id, params); + String returnType = "InvoiceReconciliationRecordInvoiceLink"; + if(returnType.equals("String")){ + return (InvoiceReconciliationRecordInvoiceLink) (Object) response.parseAsString(); + } + TypeReference typeRef = new TypeReference() {}; + return (InvoiceReconciliationRecordInvoiceLink)apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } + + public HttpResponse readForHttpResponse(Long spaceId, Long id) throws IOException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling read"); + }// verify the required parameter 'id' is set + if (id == null) { + throw new IllegalArgumentException("Missing the required parameter 'id' when calling read"); + } + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/invoice-reconciliation-record-invoice-link-service/read"); + if (spaceId != null) { + String key = "spaceId"; + Object value = spaceId; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (id != null) { + String key = "id"; + Object value = id; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + + HttpContent content = null; + HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content); + httpRequest.getHeaders().setContentType("*/*"); + + httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT); + return httpRequest.execute(); + } + + public HttpResponse readForHttpResponse(Long spaceId, Long id, Map params) throws IOException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling read"); + }// verify the required parameter 'id' is set + if (id == null) { + throw new IllegalArgumentException("Missing the required parameter 'id' when calling read"); + } + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/invoice-reconciliation-record-invoice-link-service/read"); + + // Copy the params argument if present, to allow passing in immutable maps + Map allParams = params == null ? new HashMap() : new HashMap(params); + // Add the required query param 'spaceId' to the map of query params + allParams.put("spaceId", spaceId); + // Add the required query param 'id' to the map of query params + allParams.put("id", id); + + for (Map.Entry entryMap: allParams.entrySet()) { + String key = entryMap.getKey(); + Object value = entryMap.getValue(); + + if (key != null && value != null) { + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + } + + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + + HttpContent content = null; + HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content); + httpRequest.getHeaders().setContentType("*/*"); + + httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT); + return httpRequest.execute(); + } + + /** + * Search + * Searches for the entities as specified by the given query. + *

200 - This status code indicates that a client request was successfully received, understood, and accepted. + *

442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error. + *

542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request. + * @param spaceId + * @param query The query restricts the invoice reconciliation record invoice link which are returned by the search. + * @return List<InvoiceReconciliationRecordInvoiceLink> + * @throws IOException if an error occurs while attempting to invoke the API + * For more information visit this link. + * @see Search Documentation + + **/ + public List search(Long spaceId, EntityQuery query) throws IOException { + HttpResponse response = searchForHttpResponse(spaceId, query); + String returnType = "List<InvoiceReconciliationRecordInvoiceLink>"; + if(returnType.equals("String")){ + return (List) (Object) response.parseAsString(); + } + TypeReference typeRef = new TypeReference>() {}; + return (List)apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } + + /** + * Search + * Searches for the entities as specified by the given query. + *

200 - This status code indicates that a client request was successfully received, understood, and accepted. + *

442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error. + *

542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request. + * @param spaceId + * @param query The query restricts the invoice reconciliation record invoice link which are returned by the search. + * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. + * @return List<InvoiceReconciliationRecordInvoiceLink> + * @throws IOException if an error occurs while attempting to invoke the API + * For more information visit this link. + * @see Search Documentation + + **/ + public List search(Long spaceId, EntityQuery query, Map params) throws IOException { + HttpResponse response = searchForHttpResponse(spaceId, query, params); + String returnType = "List<InvoiceReconciliationRecordInvoiceLink>"; + if(returnType.equals("String")){ + return (List) (Object) response.parseAsString(); + } + TypeReference typeRef = new TypeReference>() {}; + return (List)apiClient.getObjectMapper().readValue(response.getContent(), typeRef); + } + + public HttpResponse searchForHttpResponse(Long spaceId, EntityQuery query) throws IOException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling search"); + }// verify the required parameter 'query' is set + if (query == null) { + throw new IllegalArgumentException("Missing the required parameter 'query' when calling search"); + } + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/invoice-reconciliation-record-invoice-link-service/search"); + if (spaceId != null) { + String key = "spaceId"; + Object value = spaceId; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + + HttpContent content = apiClient.new JacksonJsonHttpContent(query); + HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); + + + httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT); + return httpRequest.execute(); + } + + public HttpResponse searchForHttpResponse(Long spaceId, java.io.InputStream query, String mediaType) throws IOException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling search"); + }// verify the required parameter 'query' is set + if (query == null) { + throw new IllegalArgumentException("Missing the required parameter 'query' when calling search"); + } + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/invoice-reconciliation-record-invoice-link-service/search"); + if (spaceId != null) { + String key = "spaceId"; + Object value = spaceId; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + + HttpContent content = query == null ? + apiClient.new JacksonJsonHttpContent(null) : + new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, query); + HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); + + httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT); + return httpRequest.execute(); + } + + public HttpResponse searchForHttpResponse(Long spaceId, EntityQuery query, Map params) throws IOException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling search"); + }// verify the required parameter 'query' is set + if (query == null) { + throw new IllegalArgumentException("Missing the required parameter 'query' when calling search"); + } + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/invoice-reconciliation-record-invoice-link-service/search"); + + // Copy the params argument if present, to allow passing in immutable maps + Map allParams = params == null ? new HashMap() : new HashMap(params); + // Add the required query param 'spaceId' to the map of query params + allParams.put("spaceId", spaceId); + + for (Map.Entry entryMap: allParams.entrySet()) { + String key = entryMap.getKey(); + Object value = entryMap.getValue(); + + if (key != null && value != null) { + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + } + + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + + HttpContent content = apiClient.new JacksonJsonHttpContent(query); + HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); + + + httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT); + return httpRequest.execute(); + } + + /** + * Unlink Invoice + * Unlinks the invoice reconciliation record from the provided invoice. + *

409 - This status code indicates that there was a conflict with the current version of the data in the database and the provided data in the request. + *

442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error. + *

542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request. + * @param spaceId + * @param recordId The ID of the invoice reconciliation record which should be unlinked. + * @param completionId The ID of the completion which should be unlinked. + * @throws IOException if an error occurs while attempting to invoke the API + * For more information visit this link. + * @see Unlink Invoice Documentation + + **/ + public void unlinkTransaction(Long spaceId, Long recordId, Long completionId) throws IOException { + unlinkTransactionForHttpResponse(spaceId, recordId, completionId); + } + + /** + * Unlink Invoice + * Unlinks the invoice reconciliation record from the provided invoice. + *

409 - This status code indicates that there was a conflict with the current version of the data in the database and the provided data in the request. + *

442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error. + *

542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request. + * @param spaceId + * @param recordId The ID of the invoice reconciliation record which should be unlinked. + * @param completionId The ID of the completion which should be unlinked. + * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. + * @throws IOException if an error occurs while attempting to invoke the API + * For more information visit this link. + * @see Unlink Invoice Documentation + + **/ + public void unlinkTransaction(Long spaceId, Long recordId, Long completionId, Map params) throws IOException { + unlinkTransactionForHttpResponse(spaceId, recordId, completionId, params); + } + + public HttpResponse unlinkTransactionForHttpResponse(Long spaceId, Long recordId, Long completionId) throws IOException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling unlinkTransaction"); + }// verify the required parameter 'recordId' is set + if (recordId == null) { + throw new IllegalArgumentException("Missing the required parameter 'recordId' when calling unlinkTransaction"); + }// verify the required parameter 'completionId' is set + if (completionId == null) { + throw new IllegalArgumentException("Missing the required parameter 'completionId' when calling unlinkTransaction"); + } + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/invoice-reconciliation-record-invoice-link-service/unlink-transaction"); + if (spaceId != null) { + String key = "spaceId"; + Object value = spaceId; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (recordId != null) { + String key = "recordId"; + Object value = recordId; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (completionId != null) { + String key = "completionId"; + Object value = completionId; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + + HttpContent content = apiClient.new JacksonJsonHttpContent(null); + HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); + + + httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT); + return httpRequest.execute(); + } + + public HttpResponse unlinkTransactionForHttpResponse(Long spaceId, Long recordId, Long completionId, Map params) throws IOException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling unlinkTransaction"); + }// verify the required parameter 'recordId' is set + if (recordId == null) { + throw new IllegalArgumentException("Missing the required parameter 'recordId' when calling unlinkTransaction"); + }// verify the required parameter 'completionId' is set + if (completionId == null) { + throw new IllegalArgumentException("Missing the required parameter 'completionId' when calling unlinkTransaction"); + } + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/invoice-reconciliation-record-invoice-link-service/unlink-transaction"); + + // Copy the params argument if present, to allow passing in immutable maps + Map allParams = params == null ? new HashMap() : new HashMap(params); + // Add the required query param 'spaceId' to the map of query params + allParams.put("spaceId", spaceId); + // Add the required query param 'recordId' to the map of query params + allParams.put("recordId", recordId); + // Add the required query param 'completionId' to the map of query params + allParams.put("completionId", completionId); + + for (Map.Entry entryMap: allParams.entrySet()) { + String key = entryMap.getKey(); + Object value = entryMap.getValue(); + + if (key != null && value != null) { + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + } + + String url = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(url); + + HttpContent content = apiClient.new JacksonJsonHttpContent(null); + HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); + + + httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT); + return httpRequest.execute(); + } + +} diff --git a/src/main/java/com/wallee/sdk/service/InvoiceReconciliationRecordService.java b/src/main/java/com/wallee/sdk/service/InvoiceReconciliationRecordService.java index 5008cbff..505fac6c 100644 --- a/src/main/java/com/wallee/sdk/service/InvoiceReconciliationRecordService.java +++ b/src/main/java/com/wallee/sdk/service/InvoiceReconciliationRecordService.java @@ -2,7 +2,6 @@ import com.wallee.sdk.ApiClient; -import java.math.BigDecimal; import com.wallee.sdk.model.ClientError; import com.wallee.sdk.model.EntityQuery; import com.wallee.sdk.model.EntityQueryFilter; @@ -299,157 +298,6 @@ public HttpResponse discardForHttpResponse(Long spaceId, Long id, Map409 - This status code indicates that there was a conflict with the current version of the data in the database and the provided data in the request. - *

442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error. - *

542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request. - * @param spaceId - * @param id The ID of the invoice reconciliation record which should be linked. - * @param invoiceId The ID of the transaction invoice which should be linked. - * @param amount The amount of the invoice reconciliation record linked completion which should be changed. - * @throws IOException if an error occurs while attempting to invoke the API - * For more information visit this link. - * @see Link transaction Documentation - - **/ - public void linkTransaction(Long spaceId, Long id, Long invoiceId, BigDecimal amount) throws IOException { - linkTransactionForHttpResponse(spaceId, id, invoiceId, amount); - } - - /** - * Link transaction - * Updates the invoice reconciliation record with the newly selected invoice and amount of its linked completion. - *

409 - This status code indicates that there was a conflict with the current version of the data in the database and the provided data in the request. - *

442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error. - *

542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request. - * @param spaceId - * @param id The ID of the invoice reconciliation record which should be linked. - * @param invoiceId The ID of the transaction invoice which should be linked. - * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. - * @throws IOException if an error occurs while attempting to invoke the API - * For more information visit this link. - * @see Link transaction Documentation - - **/ - public void linkTransaction(Long spaceId, Long id, Long invoiceId, Map params) throws IOException { - linkTransactionForHttpResponse(spaceId, id, invoiceId, params); - } - - public HttpResponse linkTransactionForHttpResponse(Long spaceId, Long id, Long invoiceId, BigDecimal amount) throws IOException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling linkTransaction"); - }// verify the required parameter 'id' is set - if (id == null) { - throw new IllegalArgumentException("Missing the required parameter 'id' when calling linkTransaction"); - }// verify the required parameter 'invoiceId' is set - if (invoiceId == null) { - throw new IllegalArgumentException("Missing the required parameter 'invoiceId' when calling linkTransaction"); - } - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/invoice-reconciliation-record-service/link-transaction"); - if (spaceId != null) { - String key = "spaceId"; - Object value = spaceId; - if (value instanceof Collection) { - uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } if (id != null) { - String key = "id"; - Object value = id; - if (value instanceof Collection) { - uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } if (invoiceId != null) { - String key = "invoiceId"; - Object value = invoiceId; - if (value instanceof Collection) { - uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } if (amount != null) { - String key = "amount"; - Object value = amount; - if (value instanceof Collection) { - uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - - HttpContent content = apiClient.new JacksonJsonHttpContent(null); - HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); - - - httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT); - return httpRequest.execute(); - } - - public HttpResponse linkTransactionForHttpResponse(Long spaceId, Long id, Long invoiceId, Map params) throws IOException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling linkTransaction"); - }// verify the required parameter 'id' is set - if (id == null) { - throw new IllegalArgumentException("Missing the required parameter 'id' when calling linkTransaction"); - }// verify the required parameter 'invoiceId' is set - if (invoiceId == null) { - throw new IllegalArgumentException("Missing the required parameter 'invoiceId' when calling linkTransaction"); - } - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/invoice-reconciliation-record-service/link-transaction"); - - // Copy the params argument if present, to allow passing in immutable maps - Map allParams = params == null ? new HashMap() : new HashMap(params); - // Add the required query param 'spaceId' to the map of query params - allParams.put("spaceId", spaceId); - // Add the required query param 'id' to the map of query params - allParams.put("id", id); - // Add the required query param 'invoiceId' to the map of query params - allParams.put("invoiceId", invoiceId); - - for (Map.Entry entryMap: allParams.entrySet()) { - String key = entryMap.getKey(); - Object value = entryMap.getValue(); - - if (key != null && value != null) { - if (value instanceof Collection) { - uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - } - - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - - HttpContent content = apiClient.new JacksonJsonHttpContent(null); - HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); - - httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT); return httpRequest.execute(); } @@ -1016,146 +864,6 @@ public HttpResponse searchForInvoicesByQueryForHttpResponse(Long spaceId, Entity HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); - httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT); - return httpRequest.execute(); - } - - /** - * Unlink transaction - * Unlinks the invoice reconciliation record linked completion from invoice reconciliation record. - *

409 - This status code indicates that there was a conflict with the current version of the data in the database and the provided data in the request. - *

442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error. - *

542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request. - * @param spaceId - * @param id The ID of the invoice reconciliation record which should be unlinked. - * @param linkedCompletionId The ID of the invoice reconciliation record linked completion which should be unlinked. - * @throws IOException if an error occurs while attempting to invoke the API - * For more information visit this link. - * @see Unlink transaction Documentation - - **/ - public void unlinkTransaction(Long spaceId, Long id, Long linkedCompletionId) throws IOException { - unlinkTransactionForHttpResponse(spaceId, id, linkedCompletionId); - } - - /** - * Unlink transaction - * Unlinks the invoice reconciliation record linked completion from invoice reconciliation record. - *

409 - This status code indicates that there was a conflict with the current version of the data in the database and the provided data in the request. - *

442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error. - *

542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request. - * @param spaceId - * @param id The ID of the invoice reconciliation record which should be unlinked. - * @param linkedCompletionId The ID of the invoice reconciliation record linked completion which should be unlinked. - * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. - * @throws IOException if an error occurs while attempting to invoke the API - * For more information visit this link. - * @see Unlink transaction Documentation - - **/ - public void unlinkTransaction(Long spaceId, Long id, Long linkedCompletionId, Map params) throws IOException { - unlinkTransactionForHttpResponse(spaceId, id, linkedCompletionId, params); - } - - public HttpResponse unlinkTransactionForHttpResponse(Long spaceId, Long id, Long linkedCompletionId) throws IOException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling unlinkTransaction"); - }// verify the required parameter 'id' is set - if (id == null) { - throw new IllegalArgumentException("Missing the required parameter 'id' when calling unlinkTransaction"); - }// verify the required parameter 'linkedCompletionId' is set - if (linkedCompletionId == null) { - throw new IllegalArgumentException("Missing the required parameter 'linkedCompletionId' when calling unlinkTransaction"); - } - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/invoice-reconciliation-record-service/unlink-transaction"); - if (spaceId != null) { - String key = "spaceId"; - Object value = spaceId; - if (value instanceof Collection) { - uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } if (id != null) { - String key = "id"; - Object value = id; - if (value instanceof Collection) { - uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } if (linkedCompletionId != null) { - String key = "linkedCompletionId"; - Object value = linkedCompletionId; - if (value instanceof Collection) { - uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - - HttpContent content = apiClient.new JacksonJsonHttpContent(null); - HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); - - - httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT); - return httpRequest.execute(); - } - - public HttpResponse unlinkTransactionForHttpResponse(Long spaceId, Long id, Long linkedCompletionId, Map params) throws IOException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling unlinkTransaction"); - }// verify the required parameter 'id' is set - if (id == null) { - throw new IllegalArgumentException("Missing the required parameter 'id' when calling unlinkTransaction"); - }// verify the required parameter 'linkedCompletionId' is set - if (linkedCompletionId == null) { - throw new IllegalArgumentException("Missing the required parameter 'linkedCompletionId' when calling unlinkTransaction"); - } - UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/invoice-reconciliation-record-service/unlink-transaction"); - - // Copy the params argument if present, to allow passing in immutable maps - Map allParams = params == null ? new HashMap() : new HashMap(params); - // Add the required query param 'spaceId' to the map of query params - allParams.put("spaceId", spaceId); - // Add the required query param 'id' to the map of query params - allParams.put("id", id); - // Add the required query param 'linkedCompletionId' to the map of query params - allParams.put("linkedCompletionId", linkedCompletionId); - - for (Map.Entry entryMap: allParams.entrySet()) { - String key = entryMap.getKey(); - Object value = entryMap.getValue(); - - if (key != null && value != null) { - if (value instanceof Collection) { - uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); - } else if (value instanceof Object[]) { - uriBuilder = uriBuilder.queryParam(key, (Object[]) value); - } else { - uriBuilder = uriBuilder.queryParam(key, value); - } - } - } - - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); - - HttpContent content = apiClient.new JacksonJsonHttpContent(null); - HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); - - httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT); return httpRequest.execute(); }