All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.wallee.sdk.service.TransactionInvoiceService Maven / Gradle / Ivy

The newest version!
package com.wallee.sdk.service;

import static com.wallee.sdk.ErrorCode.*;

import com.wallee.sdk.ApiClient;
import com.wallee.sdk.ErrorCode;
import com.wallee.sdk.exception.WalleeSdkException;
import com.wallee.sdk.util.URIBuilderUtil;
import com.wallee.sdk.StringUtil;

import com.wallee.sdk.model.ClientError;
import com.wallee.sdk.model.EntityQuery;
import com.wallee.sdk.model.EntityQueryFilter;
import com.wallee.sdk.model.RenderedDocument;
import com.wallee.sdk.model.ServerError;
import com.wallee.sdk.model.TransactionInvoice;
import com.wallee.sdk.model.TransactionInvoiceReplacement;


import com.fasterxml.jackson.core.type.TypeReference;
import com.google.api.client.http.*;
import com.google.api.client.json.Json;

import org.apache.http.client.utils.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;
import java.util.Objects;



public class TransactionInvoiceService {
    private ApiClient apiClient;

    public TransactionInvoiceService(ApiClient apiClient) {
        this.apiClient = Objects.requireNonNull(apiClient, "ApiClient must be non null");
    }

    public ApiClient getApiClient() {
        return apiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.apiClient = Objects.requireNonNull(apiClient, "ApiClient must be non null");
    }

  /**
    * 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() {}; if (isNoBodyResponse(response)) { throw new WalleeSdkException(ErrorCode.ENTITY_NOT_FOUND, "Entity was not found for: " + typeRef.getType().getTypeName()); } 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() {}; if (isNoBodyResponse(response)) { throw new WalleeSdkException(ErrorCode.ENTITY_NOT_FOUND, "Entity was not found for: " + typeRef.getType().getTypeName()); } 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 = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/count"); if (spaceId != null) { String key = "spaceId"; Object value = spaceId; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); HttpContent content = apiClient.new JacksonJsonHttpContent(filter); HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); 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 = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/count"); if (spaceId != null) { String key = "spaceId"; Object value = spaceId; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); 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); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); 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 = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/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) { uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); HttpContent content = apiClient.new JacksonJsonHttpContent(filter); HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); return httpRequest.execute(); } /** * getInvoiceDocument * Returns the PDF document for the transaction invoice with given id. *

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 transaction invoice to get the document for. * @return RenderedDocument * @throws IOException if an error occurs while attempting to invoke the API * For more information visit this link. * @see getInvoiceDocument Documentation **/ public RenderedDocument getInvoiceDocument(Long spaceId, Long id) throws IOException { HttpResponse response = getInvoiceDocumentForHttpResponse(spaceId, id); String returnType = "RenderedDocument"; if(returnType.equals("String")){ return (RenderedDocument) (Object) response.parseAsString(); } TypeReference typeRef = new TypeReference() {}; if (isNoBodyResponse(response)) { throw new WalleeSdkException(ErrorCode.ENTITY_NOT_FOUND, "Entity was not found for: " + typeRef.getType().getTypeName()); } return (RenderedDocument)apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } /** * getInvoiceDocument * Returns the PDF document for the transaction invoice with given id. *

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 transaction invoice to get the document for. * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @return RenderedDocument * @throws IOException if an error occurs while attempting to invoke the API * For more information visit this link. * @see getInvoiceDocument Documentation **/ public RenderedDocument getInvoiceDocument(Long spaceId, Long id, Map params) throws IOException { HttpResponse response = getInvoiceDocumentForHttpResponse(spaceId, id, params); String returnType = "RenderedDocument"; if(returnType.equals("String")){ return (RenderedDocument) (Object) response.parseAsString(); } TypeReference typeRef = new TypeReference() {}; if (isNoBodyResponse(response)) { throw new WalleeSdkException(ErrorCode.ENTITY_NOT_FOUND, "Entity was not found for: " + typeRef.getType().getTypeName()); } return (RenderedDocument)apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } public HttpResponse getInvoiceDocumentForHttpResponse(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 getInvoiceDocument"); } // verify the required parameter 'id' is set if (id == null) { throw new IllegalArgumentException("Missing the required parameter 'id' when calling getInvoiceDocument"); } URIBuilder uriBuilder = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/getInvoiceDocument"); if (spaceId != null) { String key = "spaceId"; Object value = spaceId; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } if (id != null) { String key = "id"; Object value = id; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); HttpContent content = null; HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content); httpRequest.getHeaders().setContentType("*/*"); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); return httpRequest.execute(); } public HttpResponse getInvoiceDocumentForHttpResponse(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 getInvoiceDocument"); } // verify the required parameter 'id' is set if (id == null) { throw new IllegalArgumentException("Missing the required parameter 'id' when calling getInvoiceDocument"); } URIBuilder uriBuilder = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/getInvoiceDocument"); // 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) { uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); HttpContent content = null; HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content); httpRequest.getHeaders().setContentType("*/*"); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); return httpRequest.execute(); } /** * getInvoiceDocumentWithTargetMediaType * Returns the PDF document for the transaction invoice with given id and target media type id. *

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 transaction invoice to get the document for. * @param targetMediaTypeId The id of the target media type for which the invoice should be generated for. * @return RenderedDocument * @throws IOException if an error occurs while attempting to invoke the API * For more information visit this link. * @see getInvoiceDocumentWithTargetMediaType Documentation **/ public RenderedDocument getInvoiceDocumentWithTargetMediaType(Long spaceId, Long id, Long targetMediaTypeId) throws IOException { HttpResponse response = getInvoiceDocumentWithTargetMediaTypeForHttpResponse(spaceId, id, targetMediaTypeId); String returnType = "RenderedDocument"; if(returnType.equals("String")){ return (RenderedDocument) (Object) response.parseAsString(); } TypeReference typeRef = new TypeReference() {}; if (isNoBodyResponse(response)) { throw new WalleeSdkException(ErrorCode.ENTITY_NOT_FOUND, "Entity was not found for: " + typeRef.getType().getTypeName()); } return (RenderedDocument)apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } /** * getInvoiceDocumentWithTargetMediaType * Returns the PDF document for the transaction invoice with given id and target media type id. *

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 transaction invoice to get the document for. * @param targetMediaTypeId The id of the target media type for which the invoice should be generated for. * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @return RenderedDocument * @throws IOException if an error occurs while attempting to invoke the API * For more information visit this link. * @see getInvoiceDocumentWithTargetMediaType Documentation **/ public RenderedDocument getInvoiceDocumentWithTargetMediaType(Long spaceId, Long id, Long targetMediaTypeId, Map params) throws IOException { HttpResponse response = getInvoiceDocumentWithTargetMediaTypeForHttpResponse(spaceId, id, targetMediaTypeId, params); String returnType = "RenderedDocument"; if(returnType.equals("String")){ return (RenderedDocument) (Object) response.parseAsString(); } TypeReference typeRef = new TypeReference() {}; if (isNoBodyResponse(response)) { throw new WalleeSdkException(ErrorCode.ENTITY_NOT_FOUND, "Entity was not found for: " + typeRef.getType().getTypeName()); } return (RenderedDocument)apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } public HttpResponse getInvoiceDocumentWithTargetMediaTypeForHttpResponse(Long spaceId, Long id, Long targetMediaTypeId) throws IOException { // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling getInvoiceDocumentWithTargetMediaType"); } // verify the required parameter 'id' is set if (id == null) { throw new IllegalArgumentException("Missing the required parameter 'id' when calling getInvoiceDocumentWithTargetMediaType"); } // verify the required parameter 'targetMediaTypeId' is set if (targetMediaTypeId == null) { throw new IllegalArgumentException("Missing the required parameter 'targetMediaTypeId' when calling getInvoiceDocumentWithTargetMediaType"); } URIBuilder uriBuilder = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/getInvoiceDocumentWithTargetMediaType"); if (spaceId != null) { String key = "spaceId"; Object value = spaceId; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } if (id != null) { String key = "id"; Object value = id; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } if (targetMediaTypeId != null) { String key = "targetMediaTypeId"; Object value = targetMediaTypeId; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); HttpContent content = null; HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content); httpRequest.getHeaders().setContentType("*/*"); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); return httpRequest.execute(); } public HttpResponse getInvoiceDocumentWithTargetMediaTypeForHttpResponse(Long spaceId, Long id, Long targetMediaTypeId, Map params) throws IOException { // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling getInvoiceDocumentWithTargetMediaType"); } // verify the required parameter 'id' is set if (id == null) { throw new IllegalArgumentException("Missing the required parameter 'id' when calling getInvoiceDocumentWithTargetMediaType"); } // verify the required parameter 'targetMediaTypeId' is set if (targetMediaTypeId == null) { throw new IllegalArgumentException("Missing the required parameter 'targetMediaTypeId' when calling getInvoiceDocumentWithTargetMediaType"); } URIBuilder uriBuilder = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/getInvoiceDocumentWithTargetMediaType"); // 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 'targetMediaTypeId' to the map of query params allParams.put("targetMediaTypeId", targetMediaTypeId); for (Map.Entry entryMap: allParams.entrySet()) { String key = entryMap.getKey(); Object value = entryMap.getValue(); if (key != null && value != null) { uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); HttpContent content = null; HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content); httpRequest.getHeaders().setContentType("*/*"); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); return httpRequest.execute(); } /** * isReplacementPossible * Returns whether the transaction invoice with the given id can be replaced. *

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 invoice which should be checked if a replacement is possible. * @return Boolean * @throws IOException if an error occurs while attempting to invoke the API * For more information visit this link. * @see isReplacementPossible Documentation **/ public Boolean isReplacementPossible(Long spaceId, Long id) throws IOException { HttpResponse response = isReplacementPossibleForHttpResponse(spaceId, id); String returnType = "Boolean"; if(returnType.equals("String")){ return (Boolean) (Object) response.parseAsString(); } TypeReference typeRef = new TypeReference() {}; if (isNoBodyResponse(response)) { throw new WalleeSdkException(ErrorCode.ENTITY_NOT_FOUND, "Entity was not found for: " + typeRef.getType().getTypeName()); } return (Boolean)apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } /** * isReplacementPossible * Returns whether the transaction invoice with the given id can be replaced. *

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 invoice which should be checked if a replacement is possible. * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @return Boolean * @throws IOException if an error occurs while attempting to invoke the API * For more information visit this link. * @see isReplacementPossible Documentation **/ public Boolean isReplacementPossible(Long spaceId, Long id, Map params) throws IOException { HttpResponse response = isReplacementPossibleForHttpResponse(spaceId, id, params); String returnType = "Boolean"; if(returnType.equals("String")){ return (Boolean) (Object) response.parseAsString(); } TypeReference typeRef = new TypeReference() {}; if (isNoBodyResponse(response)) { throw new WalleeSdkException(ErrorCode.ENTITY_NOT_FOUND, "Entity was not found for: " + typeRef.getType().getTypeName()); } return (Boolean)apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } public HttpResponse isReplacementPossibleForHttpResponse(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 isReplacementPossible"); } // verify the required parameter 'id' is set if (id == null) { throw new IllegalArgumentException("Missing the required parameter 'id' when calling isReplacementPossible"); } URIBuilder uriBuilder = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/isReplacementPossible"); if (spaceId != null) { String key = "spaceId"; Object value = spaceId; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } if (id != null) { String key = "id"; Object value = id; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); HttpContent content = null; HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content); httpRequest.getHeaders().setContentType("*/*"); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); return httpRequest.execute(); } public HttpResponse isReplacementPossibleForHttpResponse(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 isReplacementPossible"); } // verify the required parameter 'id' is set if (id == null) { throw new IllegalArgumentException("Missing the required parameter 'id' when calling isReplacementPossible"); } URIBuilder uriBuilder = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/isReplacementPossible"); // 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) { uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); HttpContent content = null; HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content); httpRequest.getHeaders().setContentType("*/*"); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); return httpRequest.execute(); } /** * Mark as Derecognized * Marks the transaction invoice with the given id as derecognized. *

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 transaction invoice which should be marked as derecognized. * @return TransactionInvoice * @throws IOException if an error occurs while attempting to invoke the API * For more information visit this link. * @see Mark as Derecognized Documentation **/ public TransactionInvoice markAsDerecognized(Long spaceId, Long id) throws IOException { HttpResponse response = markAsDerecognizedForHttpResponse(spaceId, id); String returnType = "TransactionInvoice"; if(returnType.equals("String")){ return (TransactionInvoice) (Object) response.parseAsString(); } TypeReference typeRef = new TypeReference() {}; if (isNoBodyResponse(response)) { throw new WalleeSdkException(ErrorCode.ENTITY_NOT_FOUND, "Entity was not found for: " + typeRef.getType().getTypeName()); } return (TransactionInvoice)apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } /** * Mark as Derecognized * Marks the transaction invoice with the given id as derecognized. *

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 transaction invoice which should be marked as derecognized. * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @return TransactionInvoice * @throws IOException if an error occurs while attempting to invoke the API * For more information visit this link. * @see Mark as Derecognized Documentation **/ public TransactionInvoice markAsDerecognized(Long spaceId, Long id, Map params) throws IOException { HttpResponse response = markAsDerecognizedForHttpResponse(spaceId, id, params); String returnType = "TransactionInvoice"; if(returnType.equals("String")){ return (TransactionInvoice) (Object) response.parseAsString(); } TypeReference typeRef = new TypeReference() {}; if (isNoBodyResponse(response)) { throw new WalleeSdkException(ErrorCode.ENTITY_NOT_FOUND, "Entity was not found for: " + typeRef.getType().getTypeName()); } return (TransactionInvoice)apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } public HttpResponse markAsDerecognizedForHttpResponse(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 markAsDerecognized"); } // verify the required parameter 'id' is set if (id == null) { throw new IllegalArgumentException("Missing the required parameter 'id' when calling markAsDerecognized"); } URIBuilder uriBuilder = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/markAsDerecognized"); if (spaceId != null) { String key = "spaceId"; Object value = spaceId; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } if (id != null) { String key = "id"; Object value = id; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); HttpContent content = apiClient.new JacksonJsonHttpContent(null); HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); return httpRequest.execute(); } public HttpResponse markAsDerecognizedForHttpResponse(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 markAsDerecognized"); } // verify the required parameter 'id' is set if (id == null) { throw new IllegalArgumentException("Missing the required parameter 'id' when calling markAsDerecognized"); } URIBuilder uriBuilder = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/markAsDerecognized"); // 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) { uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); HttpContent content = apiClient.new JacksonJsonHttpContent(null); HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); return httpRequest.execute(); } /** * Mark as Paid * Marks the transaction invoice with the given id as paid. *

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 transaction invoice which should be marked as paid. * @return TransactionInvoice * @throws IOException if an error occurs while attempting to invoke the API * For more information visit this link. * @see Mark as Paid Documentation **/ public TransactionInvoice markAsPaid(Long spaceId, Long id) throws IOException { HttpResponse response = markAsPaidForHttpResponse(spaceId, id); String returnType = "TransactionInvoice"; if(returnType.equals("String")){ return (TransactionInvoice) (Object) response.parseAsString(); } TypeReference typeRef = new TypeReference() {}; if (isNoBodyResponse(response)) { throw new WalleeSdkException(ErrorCode.ENTITY_NOT_FOUND, "Entity was not found for: " + typeRef.getType().getTypeName()); } return (TransactionInvoice)apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } /** * Mark as Paid * Marks the transaction invoice with the given id as paid. *

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 transaction invoice which should be marked as paid. * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @return TransactionInvoice * @throws IOException if an error occurs while attempting to invoke the API * For more information visit this link. * @see Mark as Paid Documentation **/ public TransactionInvoice markAsPaid(Long spaceId, Long id, Map params) throws IOException { HttpResponse response = markAsPaidForHttpResponse(spaceId, id, params); String returnType = "TransactionInvoice"; if(returnType.equals("String")){ return (TransactionInvoice) (Object) response.parseAsString(); } TypeReference typeRef = new TypeReference() {}; if (isNoBodyResponse(response)) { throw new WalleeSdkException(ErrorCode.ENTITY_NOT_FOUND, "Entity was not found for: " + typeRef.getType().getTypeName()); } return (TransactionInvoice)apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } public HttpResponse markAsPaidForHttpResponse(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 markAsPaid"); } // verify the required parameter 'id' is set if (id == null) { throw new IllegalArgumentException("Missing the required parameter 'id' when calling markAsPaid"); } URIBuilder uriBuilder = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/markAsPaid"); if (spaceId != null) { String key = "spaceId"; Object value = spaceId; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } if (id != null) { String key = "id"; Object value = id; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); HttpContent content = apiClient.new JacksonJsonHttpContent(null); HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); return httpRequest.execute(); } public HttpResponse markAsPaidForHttpResponse(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 markAsPaid"); } // verify the required parameter 'id' is set if (id == null) { throw new IllegalArgumentException("Missing the required parameter 'id' when calling markAsPaid"); } URIBuilder uriBuilder = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/markAsPaid"); // 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) { uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); HttpContent content = apiClient.new JacksonJsonHttpContent(null); HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); 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 transaction invoices which should be returned. * @return TransactionInvoice * @throws IOException if an error occurs while attempting to invoke the API * For more information visit this link. * @see Read Documentation **/ public TransactionInvoice read(Long spaceId, Long id) throws IOException { HttpResponse response = readForHttpResponse(spaceId, id); String returnType = "TransactionInvoice"; if(returnType.equals("String")){ return (TransactionInvoice) (Object) response.parseAsString(); } TypeReference typeRef = new TypeReference() {}; if (isNoBodyResponse(response)) { throw new WalleeSdkException(ErrorCode.ENTITY_NOT_FOUND, "Entity was not found for: " + typeRef.getType().getTypeName()); } return (TransactionInvoice)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 transaction invoices 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 TransactionInvoice * @throws IOException if an error occurs while attempting to invoke the API * For more information visit this link. * @see Read Documentation **/ public TransactionInvoice read(Long spaceId, Long id, Map params) throws IOException { HttpResponse response = readForHttpResponse(spaceId, id, params); String returnType = "TransactionInvoice"; if(returnType.equals("String")){ return (TransactionInvoice) (Object) response.parseAsString(); } TypeReference typeRef = new TypeReference() {}; if (isNoBodyResponse(response)) { throw new WalleeSdkException(ErrorCode.ENTITY_NOT_FOUND, "Entity was not found for: " + typeRef.getType().getTypeName()); } return (TransactionInvoice)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 = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/read"); if (spaceId != null) { String key = "spaceId"; Object value = spaceId; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } if (id != null) { String key = "id"; Object value = id; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); HttpContent content = null; HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content); httpRequest.getHeaders().setContentType("*/*"); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); 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 = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/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) { uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); HttpContent content = null; HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content); httpRequest.getHeaders().setContentType("*/*"); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); return httpRequest.execute(); } /** * replace * Replaces the transaction invoice with given id with the replacement and returns the new transaction invoice. *

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 transaction invoices which should be replaced. * @param replacement * @return TransactionInvoice * @throws IOException if an error occurs while attempting to invoke the API * For more information visit this link. * @see replace Documentation **/ public TransactionInvoice replace(Long spaceId, Long id, TransactionInvoiceReplacement replacement) throws IOException { HttpResponse response = replaceForHttpResponse(spaceId, id, replacement); String returnType = "TransactionInvoice"; if(returnType.equals("String")){ return (TransactionInvoice) (Object) response.parseAsString(); } TypeReference typeRef = new TypeReference() {}; if (isNoBodyResponse(response)) { throw new WalleeSdkException(ErrorCode.ENTITY_NOT_FOUND, "Entity was not found for: " + typeRef.getType().getTypeName()); } return (TransactionInvoice)apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } /** * replace * Replaces the transaction invoice with given id with the replacement and returns the new transaction invoice. *

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 transaction invoices which should be replaced. * @param replacement * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @return TransactionInvoice * @throws IOException if an error occurs while attempting to invoke the API * For more information visit this link. * @see replace Documentation **/ public TransactionInvoice replace(Long spaceId, Long id, TransactionInvoiceReplacement replacement, Map params) throws IOException { HttpResponse response = replaceForHttpResponse(spaceId, id, replacement, params); String returnType = "TransactionInvoice"; if(returnType.equals("String")){ return (TransactionInvoice) (Object) response.parseAsString(); } TypeReference typeRef = new TypeReference() {}; if (isNoBodyResponse(response)) { throw new WalleeSdkException(ErrorCode.ENTITY_NOT_FOUND, "Entity was not found for: " + typeRef.getType().getTypeName()); } return (TransactionInvoice)apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } public HttpResponse replaceForHttpResponse(Long spaceId, Long id, TransactionInvoiceReplacement replacement) throws IOException { // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling replace"); } // verify the required parameter 'id' is set if (id == null) { throw new IllegalArgumentException("Missing the required parameter 'id' when calling replace"); } // verify the required parameter 'replacement' is set if (replacement == null) { throw new IllegalArgumentException("Missing the required parameter 'replacement' when calling replace"); } URIBuilder uriBuilder = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/replace"); if (spaceId != null) { String key = "spaceId"; Object value = spaceId; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } if (id != null) { String key = "id"; Object value = id; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); HttpContent content = apiClient.new JacksonJsonHttpContent(replacement); HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); return httpRequest.execute(); } public HttpResponse replaceForHttpResponse(Long spaceId, Long id, java.io.InputStream replacement, String mediaType) throws IOException { // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling replace"); } // verify the required parameter 'id' is set if (id == null) { throw new IllegalArgumentException("Missing the required parameter 'id' when calling replace"); } // verify the required parameter 'replacement' is set if (replacement == null) { throw new IllegalArgumentException("Missing the required parameter 'replacement' when calling replace"); } URIBuilder uriBuilder = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/replace"); if (spaceId != null) { String key = "spaceId"; Object value = spaceId; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } if (id != null) { String key = "id"; Object value = id; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); HttpContent content = replacement == null ? apiClient.new JacksonJsonHttpContent(null) : new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, replacement); HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); return httpRequest.execute(); } public HttpResponse replaceForHttpResponse(Long spaceId, Long id, TransactionInvoiceReplacement replacement, Map params) throws IOException { // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling replace"); } // verify the required parameter 'id' is set if (id == null) { throw new IllegalArgumentException("Missing the required parameter 'id' when calling replace"); } // verify the required parameter 'replacement' is set if (replacement == null) { throw new IllegalArgumentException("Missing the required parameter 'replacement' when calling replace"); } URIBuilder uriBuilder = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/replace"); // 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) { uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); HttpContent content = apiClient.new JacksonJsonHttpContent(replacement); HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); 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 transaction invoices which are returned by the search. * @return List<TransactionInvoice> * @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<TransactionInvoice>"; if(returnType.equals("String")){ return (List) (Object) response.parseAsString(); } TypeReference typeRef = new TypeReference>() {}; if (isNoBodyResponse(response)) { throw new WalleeSdkException(ErrorCode.ENTITY_NOT_FOUND, "Entity was not found for: " + typeRef.getType().getTypeName()); } 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 transaction invoices 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<TransactionInvoice> * @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<TransactionInvoice>"; if(returnType.equals("String")){ return (List) (Object) response.parseAsString(); } TypeReference typeRef = new TypeReference>() {}; if (isNoBodyResponse(response)) { throw new WalleeSdkException(ErrorCode.ENTITY_NOT_FOUND, "Entity was not found for: " + typeRef.getType().getTypeName()); } 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 = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/search"); if (spaceId != null) { String key = "spaceId"; Object value = spaceId; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); HttpContent content = apiClient.new JacksonJsonHttpContent(query); HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); 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 = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/search"); if (spaceId != null) { String key = "spaceId"; Object value = spaceId; uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); 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); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); 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 = URIBuilderUtil.create(apiClient.getBasePath() + "/transaction-invoice/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) { uriBuilder = URIBuilderUtil.applyQueryParam(uriBuilder, key, value); } } GenericUrl genericUrl = new GenericUrl(URIBuilderUtil.build(uriBuilder)); HttpContent content = apiClient.new JacksonJsonHttpContent(query); HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content); int readTimeOut = apiClient.getReadTimeOut() * 1000; httpRequest.setReadTimeout(readTimeOut); return httpRequest.execute(); } private boolean isNoBodyResponse(HttpResponse response) throws IOException { java.io.InputStream content = response.getContent(); return content.available() == 0; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy