/*
 * Swagger of Opencellsoft Api
 * @#Introduction
 *
 * The version of the OpenAPI document: 7.3.1-SNAPSHOT
 * Contact: contact@opencellsoft.fr
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.client.api;

import org.openapitools.client.ApiCallback;
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.ApiResponse;
import org.openapitools.client.Configuration;
import org.openapitools.client.Pair;
import org.openapitools.client.ProgressRequestBody;
import org.openapitools.client.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import org.openapitools.client.model.ActionStatus;
import org.openapitools.client.model.CreateInvoiceResponseDto;
import org.openapitools.client.model.CustomerInvoicesResponse;
import org.openapitools.client.model.GenerateInvoiceRequestDto;
import org.openapitools.client.model.GenerateInvoiceResponseDto;
import org.openapitools.client.model.GetInvoiceResponseDto;
import org.openapitools.client.model.GetPdfInvoiceRequestDto;
import org.openapitools.client.model.GetPdfInvoiceResponseDto;
import org.openapitools.client.model.GetXmlInvoiceRequestDto;
import org.openapitools.client.model.GetXmlInvoiceResponseDto;
import org.openapitools.client.model.InlineObject;
import org.openapitools.client.model.InvoiceDto;
import org.openapitools.client.model.InvoicesDto;
import org.openapitools.client.model.PagingAndFiltering;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class InvoiceApi {
    private ApiClient localVarApiClient;

    public InvoiceApi() {
        this(Configuration.getDefaultApiClient());
    }

    public InvoiceApi(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    /**
     * Build call for gETIBaseVersion80
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Action status with version number as a message  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETIBaseVersion80Call(final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/invoice/version";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call gETIBaseVersion80ValidateBeforeCall(final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = gETIBaseVersion80Call(_callback);
        return localVarCall;

    }

    /**
     *  Get version of application  
     *  Get version of application  
     * @return ActionStatus
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Action status with version number as a message  </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus gETIBaseVersion80() throws ApiException {
        ApiResponse<ActionStatus> localVarResp = gETIBaseVersion80WithHttpInfo();
        return localVarResp.getData();
    }

    /**
     *  Get version of application  
     *  Get version of application  
     * @return ApiResponse&lt;ActionStatus&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Action status with version number as a message  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> gETIBaseVersion80WithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = gETIBaseVersion80ValidateBeforeCall(null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Get version of application   (asynchronously)
     *  Get version of application  
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Action status with version number as a message  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETIBaseVersion80Async(final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = gETIBaseVersion80ValidateBeforeCall(_callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for gETInvoiceList1
     * @param query  query Search criteria. Query is composed of the following: filterKey1:filterValue1|filterKey2:filterValue2  (optional)
     * @param fields  fields Data retrieval options/fieldnames separated by a comma. Specify transactions in fields to include transactions and pdf to generate/include PDF document  (optional)
     * @param offset  offset Pagination - from record number  (optional)
     * @param limit  limit Pagination - number of records to retrieve  (optional)
     * @param sortBy  sortBy Sorting - field to sort by - a field from a main entity being searched. See Data model for a list of fields.  (optional, default to &quot;id&quot;)
     * @param sortOrder  sortOrder Sorting - sort order.  (optional, default to ASCENDING)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  An invoice list  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETInvoiceList1Call(String query, String fields, Integer offset, Integer limit, String sortBy, String sortOrder, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/invoice/list";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (query != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("query", query));
        }

        if (fields != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("fields", fields));
        }

        if (offset != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset));
        }

        if (limit != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit));
        }

        if (sortBy != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("sortBy", sortBy));
        }

        if (sortOrder != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("sortOrder", sortOrder));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call gETInvoiceList1ValidateBeforeCall(String query, String fields, Integer offset, Integer limit, String sortBy, String sortOrder, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = gETInvoiceList1Call(query, fields, offset, limit, sortBy, sortOrder, _callback);
        return localVarCall;

    }

    /**
     *  List invoices matching a given criteria.  
     *  List invoices matching a given criteria.  
     * @param query  query Search criteria. Query is composed of the following: filterKey1:filterValue1|filterKey2:filterValue2  (optional)
     * @param fields  fields Data retrieval options/fieldnames separated by a comma. Specify transactions in fields to include transactions and pdf to generate/include PDF document  (optional)
     * @param offset  offset Pagination - from record number  (optional)
     * @param limit  limit Pagination - number of records to retrieve  (optional)
     * @param sortBy  sortBy Sorting - field to sort by - a field from a main entity being searched. See Data model for a list of fields.  (optional, default to &quot;id&quot;)
     * @param sortOrder  sortOrder Sorting - sort order.  (optional, default to ASCENDING)
     * @return InvoicesDto
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  An invoice list  </td><td>  -  </td></tr>
     </table>
     */
    public InvoicesDto gETInvoiceList1(String query, String fields, Integer offset, Integer limit, String sortBy, String sortOrder) throws ApiException {
        ApiResponse<InvoicesDto> localVarResp = gETInvoiceList1WithHttpInfo(query, fields, offset, limit, sortBy, sortOrder);
        return localVarResp.getData();
    }

    /**
     *  List invoices matching a given criteria.  
     *  List invoices matching a given criteria.  
     * @param query  query Search criteria. Query is composed of the following: filterKey1:filterValue1|filterKey2:filterValue2  (optional)
     * @param fields  fields Data retrieval options/fieldnames separated by a comma. Specify transactions in fields to include transactions and pdf to generate/include PDF document  (optional)
     * @param offset  offset Pagination - from record number  (optional)
     * @param limit  limit Pagination - number of records to retrieve  (optional)
     * @param sortBy  sortBy Sorting - field to sort by - a field from a main entity being searched. See Data model for a list of fields.  (optional, default to &quot;id&quot;)
     * @param sortOrder  sortOrder Sorting - sort order.  (optional, default to ASCENDING)
     * @return ApiResponse&lt;InvoicesDto&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  An invoice list  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<InvoicesDto> gETInvoiceList1WithHttpInfo(String query, String fields, Integer offset, Integer limit, String sortBy, String sortOrder) throws ApiException {
        okhttp3.Call localVarCall = gETInvoiceList1ValidateBeforeCall(query, fields, offset, limit, sortBy, sortOrder, null);
        Type localVarReturnType = new TypeToken<InvoicesDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  List invoices matching a given criteria.   (asynchronously)
     *  List invoices matching a given criteria.  
     * @param query  query Search criteria. Query is composed of the following: filterKey1:filterValue1|filterKey2:filterValue2  (optional)
     * @param fields  fields Data retrieval options/fieldnames separated by a comma. Specify transactions in fields to include transactions and pdf to generate/include PDF document  (optional)
     * @param offset  offset Pagination - from record number  (optional)
     * @param limit  limit Pagination - number of records to retrieve  (optional)
     * @param sortBy  sortBy Sorting - field to sort by - a field from a main entity being searched. See Data model for a list of fields.  (optional, default to &quot;id&quot;)
     * @param sortOrder  sortOrder Sorting - sort order.  (optional, default to ASCENDING)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  An invoice list  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETInvoiceList1Async(String query, String fields, Integer offset, Integer limit, String sortBy, String sortOrder, final ApiCallback<InvoicesDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = gETInvoiceList1ValidateBeforeCall(query, fields, offset, limit, sortBy, sortOrder, _callback);
        Type localVarReturnType = new TypeToken<InvoicesDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for gETInvoiceListInvoiceByCustomerAccount1
     * @param customerAccountCode  customerAccountCode Customer account code  (optional)
     * @param returnPdf  returnPdf true if we want to generate pdf  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  customer invoice.  </td><td>  -  </td></tr>
     </table>
     * @deprecated
     */
    @Deprecated
    public okhttp3.Call gETInvoiceListInvoiceByCustomerAccount1Call(String customerAccountCode, Boolean returnPdf, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/invoice/listInvoiceByCustomerAccount";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (customerAccountCode != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("customerAccountCode", customerAccountCode));
        }

        if (returnPdf != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("returnPdf", returnPdf));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @Deprecated
    @SuppressWarnings("rawtypes")
    private okhttp3.Call gETInvoiceListInvoiceByCustomerAccount1ValidateBeforeCall(String customerAccountCode, Boolean returnPdf, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = gETInvoiceListInvoiceByCustomerAccount1Call(customerAccountCode, returnPdf, _callback);
        return localVarCall;

    }

    /**
     *  Search for a list of invoices given a customer account code
     *  Search for a list of invoices given a customer account code.  Deprecated in v.4.7.2, use list() instead with criteria billingAccount.customerAccount.code&#x3D;xxx  
     * @param customerAccountCode  customerAccountCode Customer account code  (optional)
     * @param returnPdf  returnPdf true if we want to generate pdf  (optional)
     * @return CustomerInvoicesResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  customer invoice.  </td><td>  -  </td></tr>
     </table>
     * @deprecated
     */
    @Deprecated
    public CustomerInvoicesResponse gETInvoiceListInvoiceByCustomerAccount1(String customerAccountCode, Boolean returnPdf) throws ApiException {
        ApiResponse<CustomerInvoicesResponse> localVarResp = gETInvoiceListInvoiceByCustomerAccount1WithHttpInfo(customerAccountCode, returnPdf);
        return localVarResp.getData();
    }

    /**
     *  Search for a list of invoices given a customer account code
     *  Search for a list of invoices given a customer account code.  Deprecated in v.4.7.2, use list() instead with criteria billingAccount.customerAccount.code&#x3D;xxx  
     * @param customerAccountCode  customerAccountCode Customer account code  (optional)
     * @param returnPdf  returnPdf true if we want to generate pdf  (optional)
     * @return ApiResponse&lt;CustomerInvoicesResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  customer invoice.  </td><td>  -  </td></tr>
     </table>
     * @deprecated
     */
    @Deprecated
    public ApiResponse<CustomerInvoicesResponse> gETInvoiceListInvoiceByCustomerAccount1WithHttpInfo(String customerAccountCode, Boolean returnPdf) throws ApiException {
        okhttp3.Call localVarCall = gETInvoiceListInvoiceByCustomerAccount1ValidateBeforeCall(customerAccountCode, returnPdf, null);
        Type localVarReturnType = new TypeToken<CustomerInvoicesResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Search for a list of invoices given a customer account code (asynchronously)
     *  Search for a list of invoices given a customer account code.  Deprecated in v.4.7.2, use list() instead with criteria billingAccount.customerAccount.code&#x3D;xxx  
     * @param customerAccountCode  customerAccountCode Customer account code  (optional)
     * @param returnPdf  returnPdf true if we want to generate pdf  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  customer invoice.  </td><td>  -  </td></tr>
     </table>
     * @deprecated
     */
    @Deprecated
    public okhttp3.Call gETInvoiceListInvoiceByCustomerAccount1Async(String customerAccountCode, Boolean returnPdf, final ApiCallback<CustomerInvoicesResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = gETInvoiceListInvoiceByCustomerAccount1ValidateBeforeCall(customerAccountCode, returnPdf, _callback);
        Type localVarReturnType = new TypeToken<CustomerInvoicesResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for gETInvoiceListPresentInAR1
     * @param customerAccountCode  customerAccountCode Customer account code  (optional)
     * @param includePdf  includePdf true if we want to generate/include pdf  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  List of invoices  </td><td>  -  </td></tr>
     </table>
     * @deprecated
     */
    @Deprecated
    public okhttp3.Call gETInvoiceListPresentInAR1Call(String customerAccountCode, Boolean includePdf, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/invoice/listPresentInAR";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (customerAccountCode != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("customerAccountCode", customerAccountCode));
        }

        if (includePdf != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("includePdf", includePdf));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @Deprecated
    @SuppressWarnings("rawtypes")
    private okhttp3.Call gETInvoiceListPresentInAR1ValidateBeforeCall(String customerAccountCode, Boolean includePdf, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = gETInvoiceListPresentInAR1Call(customerAccountCode, includePdf, _callback);
        return localVarCall;

    }

    /**
     *  List invoices with account operation for a given customer account  Deprecated in v
     *  List invoices with account operation for a given customer account  Deprecated in v.4.8. Use list() instead with criteria recordedInvoice&#x3D;IS_NOT_NULL and billingAccount.customerAccount.code&#x3D;xxx  
     * @param customerAccountCode  customerAccountCode Customer account code  (optional)
     * @param includePdf  includePdf true if we want to generate/include pdf  (optional)
     * @return CustomerInvoicesResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  List of invoices  </td><td>  -  </td></tr>
     </table>
     * @deprecated
     */
    @Deprecated
    public CustomerInvoicesResponse gETInvoiceListPresentInAR1(String customerAccountCode, Boolean includePdf) throws ApiException {
        ApiResponse<CustomerInvoicesResponse> localVarResp = gETInvoiceListPresentInAR1WithHttpInfo(customerAccountCode, includePdf);
        return localVarResp.getData();
    }

    /**
     *  List invoices with account operation for a given customer account  Deprecated in v
     *  List invoices with account operation for a given customer account  Deprecated in v.4.8. Use list() instead with criteria recordedInvoice&#x3D;IS_NOT_NULL and billingAccount.customerAccount.code&#x3D;xxx  
     * @param customerAccountCode  customerAccountCode Customer account code  (optional)
     * @param includePdf  includePdf true if we want to generate/include pdf  (optional)
     * @return ApiResponse&lt;CustomerInvoicesResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  List of invoices  </td><td>  -  </td></tr>
     </table>
     * @deprecated
     */
    @Deprecated
    public ApiResponse<CustomerInvoicesResponse> gETInvoiceListPresentInAR1WithHttpInfo(String customerAccountCode, Boolean includePdf) throws ApiException {
        okhttp3.Call localVarCall = gETInvoiceListPresentInAR1ValidateBeforeCall(customerAccountCode, includePdf, null);
        Type localVarReturnType = new TypeToken<CustomerInvoicesResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  List invoices with account operation for a given customer account  Deprecated in v (asynchronously)
     *  List invoices with account operation for a given customer account  Deprecated in v.4.8. Use list() instead with criteria recordedInvoice&#x3D;IS_NOT_NULL and billingAccount.customerAccount.code&#x3D;xxx  
     * @param customerAccountCode  customerAccountCode Customer account code  (optional)
     * @param includePdf  includePdf true if we want to generate/include pdf  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  List of invoices  </td><td>  -  </td></tr>
     </table>
     * @deprecated
     */
    @Deprecated
    public okhttp3.Call gETInvoiceListPresentInAR1Async(String customerAccountCode, Boolean includePdf, final ApiCallback<CustomerInvoicesResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = gETInvoiceListPresentInAR1ValidateBeforeCall(customerAccountCode, includePdf, _callback);
        Type localVarReturnType = new TypeToken<CustomerInvoicesResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for gETInvoiceSearch1
     * @param id  id invoice id  (optional)
     * @param invoiceNumber  invoiceNumber invoice number  (optional)
     * @param invoiceType  invoiceType invoice type  (optional)
     * @param includeTransactions  includeTransactions Should transactions associated to an invoice be listed  (optional)
     * @param includePdf  includePdf true if we want to generate/include pdf  (optional)
     * @param includeXml  includeXml true if we want to generate/include xml  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  instance of GetInvoiceResponseDto  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETInvoiceSearch1Call(Long id, String invoiceNumber, String invoiceType, Boolean includeTransactions, Boolean includePdf, Boolean includeXml, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/invoice";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (id != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("id", id));
        }

        if (invoiceNumber != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("invoiceNumber", invoiceNumber));
        }

        if (invoiceType != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("invoiceType", invoiceType));
        }

        if (includeTransactions != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("includeTransactions", includeTransactions));
        }

        if (includePdf != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("includePdf", includePdf));
        }

        if (includeXml != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("includeXml", includeXml));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call gETInvoiceSearch1ValidateBeforeCall(Long id, String invoiceNumber, String invoiceType, Boolean includeTransactions, Boolean includePdf, Boolean includeXml, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = gETInvoiceSearch1Call(id, invoiceNumber, invoiceType, includeTransactions, includePdf, includeXml, _callback);
        return localVarCall;

    }

    /**
     *  Search for an invoice given an invoice id or invoice number and invoice type.  
     *  Search for an invoice given an invoice id or invoice number and invoice type.  
     * @param id  id invoice id  (optional)
     * @param invoiceNumber  invoiceNumber invoice number  (optional)
     * @param invoiceType  invoiceType invoice type  (optional)
     * @param includeTransactions  includeTransactions Should transactions associated to an invoice be listed  (optional)
     * @param includePdf  includePdf true if we want to generate/include pdf  (optional)
     * @param includeXml  includeXml true if we want to generate/include xml  (optional)
     * @return GetInvoiceResponseDto
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  instance of GetInvoiceResponseDto  </td><td>  -  </td></tr>
     </table>
     */
    public GetInvoiceResponseDto gETInvoiceSearch1(Long id, String invoiceNumber, String invoiceType, Boolean includeTransactions, Boolean includePdf, Boolean includeXml) throws ApiException {
        ApiResponse<GetInvoiceResponseDto> localVarResp = gETInvoiceSearch1WithHttpInfo(id, invoiceNumber, invoiceType, includeTransactions, includePdf, includeXml);
        return localVarResp.getData();
    }

    /**
     *  Search for an invoice given an invoice id or invoice number and invoice type.  
     *  Search for an invoice given an invoice id or invoice number and invoice type.  
     * @param id  id invoice id  (optional)
     * @param invoiceNumber  invoiceNumber invoice number  (optional)
     * @param invoiceType  invoiceType invoice type  (optional)
     * @param includeTransactions  includeTransactions Should transactions associated to an invoice be listed  (optional)
     * @param includePdf  includePdf true if we want to generate/include pdf  (optional)
     * @param includeXml  includeXml true if we want to generate/include xml  (optional)
     * @return ApiResponse&lt;GetInvoiceResponseDto&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  instance of GetInvoiceResponseDto  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<GetInvoiceResponseDto> gETInvoiceSearch1WithHttpInfo(Long id, String invoiceNumber, String invoiceType, Boolean includeTransactions, Boolean includePdf, Boolean includeXml) throws ApiException {
        okhttp3.Call localVarCall = gETInvoiceSearch1ValidateBeforeCall(id, invoiceNumber, invoiceType, includeTransactions, includePdf, includeXml, null);
        Type localVarReturnType = new TypeToken<GetInvoiceResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Search for an invoice given an invoice id or invoice number and invoice type.   (asynchronously)
     *  Search for an invoice given an invoice id or invoice number and invoice type.  
     * @param id  id invoice id  (optional)
     * @param invoiceNumber  invoiceNumber invoice number  (optional)
     * @param invoiceType  invoiceType invoice type  (optional)
     * @param includeTransactions  includeTransactions Should transactions associated to an invoice be listed  (optional)
     * @param includePdf  includePdf true if we want to generate/include pdf  (optional)
     * @param includeXml  includeXml true if we want to generate/include xml  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  instance of GetInvoiceResponseDto  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETInvoiceSearch1Async(Long id, String invoiceNumber, String invoiceType, Boolean includeTransactions, Boolean includePdf, Boolean includeXml, final ApiCallback<GetInvoiceResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = gETInvoiceSearch1ValidateBeforeCall(id, invoiceNumber, invoiceType, includeTransactions, includePdf, includeXml, _callback);
        Type localVarReturnType = new TypeToken<GetInvoiceResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTInvoiceCancel1
     * @param body  invoiceId Invoice id  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  action status.  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceCancel1Call(Long body, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/invoice/cancel";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json", "application/xml"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pOSTInvoiceCancel1ValidateBeforeCall(Long body, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTInvoiceCancel1Call(body, _callback);
        return localVarCall;

    }

    /**
     *  Cancel an invoice based on invoice id.  
     *  Cancel an invoice based on invoice id.  
     * @param body  invoiceId Invoice id  (optional)
     * @return ActionStatus
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  action status.  </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus pOSTInvoiceCancel1(Long body) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTInvoiceCancel1WithHttpInfo(body);
        return localVarResp.getData();
    }

    /**
     *  Cancel an invoice based on invoice id.  
     *  Cancel an invoice based on invoice id.  
     * @param body  invoiceId Invoice id  (optional)
     * @return ApiResponse&lt;ActionStatus&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  action status.  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> pOSTInvoiceCancel1WithHttpInfo(Long body) throws ApiException {
        okhttp3.Call localVarCall = pOSTInvoiceCancel1ValidateBeforeCall(body, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Cancel an invoice based on invoice id.   (asynchronously)
     *  Cancel an invoice based on invoice id.  
     * @param body  invoiceId Invoice id  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  action status.  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceCancel1Async(Long body, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTInvoiceCancel1ValidateBeforeCall(body, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTInvoiceCreate1
     * @param invoiceDto  invoiceDto invoice dto  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  created invoice  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceCreate1Call(InvoiceDto invoiceDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = invoiceDto;

        // create path and map variables
        String localVarPath = "/invoice";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json", "application/xml"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pOSTInvoiceCreate1ValidateBeforeCall(InvoiceDto invoiceDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTInvoiceCreate1Call(invoiceDto, _callback);
        return localVarCall;

    }

    /**
     *  Create invoice. Invoice number depends on invoice type  
     *  Create invoice. Invoice number depends on invoice type  
     * @param invoiceDto  invoiceDto invoice dto  (optional)
     * @return CreateInvoiceResponseDto
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  created invoice  </td><td>  -  </td></tr>
     </table>
     */
    public CreateInvoiceResponseDto pOSTInvoiceCreate1(InvoiceDto invoiceDto) throws ApiException {
        ApiResponse<CreateInvoiceResponseDto> localVarResp = pOSTInvoiceCreate1WithHttpInfo(invoiceDto);
        return localVarResp.getData();
    }

    /**
     *  Create invoice. Invoice number depends on invoice type  
     *  Create invoice. Invoice number depends on invoice type  
     * @param invoiceDto  invoiceDto invoice dto  (optional)
     * @return ApiResponse&lt;CreateInvoiceResponseDto&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  created invoice  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<CreateInvoiceResponseDto> pOSTInvoiceCreate1WithHttpInfo(InvoiceDto invoiceDto) throws ApiException {
        okhttp3.Call localVarCall = pOSTInvoiceCreate1ValidateBeforeCall(invoiceDto, null);
        Type localVarReturnType = new TypeToken<CreateInvoiceResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Create invoice. Invoice number depends on invoice type   (asynchronously)
     *  Create invoice. Invoice number depends on invoice type  
     * @param invoiceDto  invoiceDto invoice dto  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  created invoice  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceCreate1Async(InvoiceDto invoiceDto, final ApiCallback<CreateInvoiceResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTInvoiceCreate1ValidateBeforeCall(invoiceDto, _callback);
        Type localVarReturnType = new TypeToken<CreateInvoiceResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTInvoiceFetchPdfInvoice1
     * @param getPdfInvoiceRequestDto  pdfInvoiceRequestDto contains an invoice number and optionally an invoice type  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  pdf invoice  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceFetchPdfInvoice1Call(GetPdfInvoiceRequestDto getPdfInvoiceRequestDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = getPdfInvoiceRequestDto;

        // create path and map variables
        String localVarPath = "/invoice/fetchPdfInvoice";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json", "application/xml"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pOSTInvoiceFetchPdfInvoice1ValidateBeforeCall(GetPdfInvoiceRequestDto getPdfInvoiceRequestDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTInvoiceFetchPdfInvoice1Call(getPdfInvoiceRequestDto, _callback);
        return localVarCall;

    }

    /**
     *  Finds an invoice based on invoice number and optionally an invoice type and return it as pdf as byte []
     *  Finds an invoice based on invoice number and optionally an invoice type and return it as pdf as byte []. Invoice is not recreated, instead invoice stored as pdf in database is returned. 
     * @param getPdfInvoiceRequestDto  pdfInvoiceRequestDto contains an invoice number and optionally an invoice type  (optional)
     * @return GetPdfInvoiceResponseDto
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  pdf invoice  </td><td>  -  </td></tr>
     </table>
     */
    public GetPdfInvoiceResponseDto pOSTInvoiceFetchPdfInvoice1(GetPdfInvoiceRequestDto getPdfInvoiceRequestDto) throws ApiException {
        ApiResponse<GetPdfInvoiceResponseDto> localVarResp = pOSTInvoiceFetchPdfInvoice1WithHttpInfo(getPdfInvoiceRequestDto);
        return localVarResp.getData();
    }

    /**
     *  Finds an invoice based on invoice number and optionally an invoice type and return it as pdf as byte []
     *  Finds an invoice based on invoice number and optionally an invoice type and return it as pdf as byte []. Invoice is not recreated, instead invoice stored as pdf in database is returned. 
     * @param getPdfInvoiceRequestDto  pdfInvoiceRequestDto contains an invoice number and optionally an invoice type  (optional)
     * @return ApiResponse&lt;GetPdfInvoiceResponseDto&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  pdf invoice  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<GetPdfInvoiceResponseDto> pOSTInvoiceFetchPdfInvoice1WithHttpInfo(GetPdfInvoiceRequestDto getPdfInvoiceRequestDto) throws ApiException {
        okhttp3.Call localVarCall = pOSTInvoiceFetchPdfInvoice1ValidateBeforeCall(getPdfInvoiceRequestDto, null);
        Type localVarReturnType = new TypeToken<GetPdfInvoiceResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Finds an invoice based on invoice number and optionally an invoice type and return it as pdf as byte [] (asynchronously)
     *  Finds an invoice based on invoice number and optionally an invoice type and return it as pdf as byte []. Invoice is not recreated, instead invoice stored as pdf in database is returned. 
     * @param getPdfInvoiceRequestDto  pdfInvoiceRequestDto contains an invoice number and optionally an invoice type  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  pdf invoice  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceFetchPdfInvoice1Async(GetPdfInvoiceRequestDto getPdfInvoiceRequestDto, final ApiCallback<GetPdfInvoiceResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTInvoiceFetchPdfInvoice1ValidateBeforeCall(getPdfInvoiceRequestDto, _callback);
        Type localVarReturnType = new TypeToken<GetPdfInvoiceResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTInvoiceFetchXMLInvoice1
     * @param getXmlInvoiceRequestDto  xmlInvoiceRequestDto contains invoice number and optionally an invoice type  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  xml invoice  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceFetchXMLInvoice1Call(GetXmlInvoiceRequestDto getXmlInvoiceRequestDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = getXmlInvoiceRequestDto;

        // create path and map variables
        String localVarPath = "/invoice/fetchXMLInvoice";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json", "application/xml"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pOSTInvoiceFetchXMLInvoice1ValidateBeforeCall(GetXmlInvoiceRequestDto getXmlInvoiceRequestDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTInvoiceFetchXMLInvoice1Call(getXmlInvoiceRequestDto, _callback);
        return localVarCall;

    }

    /**
     *  Finds an invoice based on its invoice number and optionally an invoice type and return it as xml string. 
     *  Finds an invoice based on its invoice number and optionally an invoice type and return it as xml string. 
     * @param getXmlInvoiceRequestDto  xmlInvoiceRequestDto contains invoice number and optionally an invoice type  (optional)
     * @return GetXmlInvoiceResponseDto
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  xml invoice  </td><td>  -  </td></tr>
     </table>
     */
    public GetXmlInvoiceResponseDto pOSTInvoiceFetchXMLInvoice1(GetXmlInvoiceRequestDto getXmlInvoiceRequestDto) throws ApiException {
        ApiResponse<GetXmlInvoiceResponseDto> localVarResp = pOSTInvoiceFetchXMLInvoice1WithHttpInfo(getXmlInvoiceRequestDto);
        return localVarResp.getData();
    }

    /**
     *  Finds an invoice based on its invoice number and optionally an invoice type and return it as xml string. 
     *  Finds an invoice based on its invoice number and optionally an invoice type and return it as xml string. 
     * @param getXmlInvoiceRequestDto  xmlInvoiceRequestDto contains invoice number and optionally an invoice type  (optional)
     * @return ApiResponse&lt;GetXmlInvoiceResponseDto&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  xml invoice  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<GetXmlInvoiceResponseDto> pOSTInvoiceFetchXMLInvoice1WithHttpInfo(GetXmlInvoiceRequestDto getXmlInvoiceRequestDto) throws ApiException {
        okhttp3.Call localVarCall = pOSTInvoiceFetchXMLInvoice1ValidateBeforeCall(getXmlInvoiceRequestDto, null);
        Type localVarReturnType = new TypeToken<GetXmlInvoiceResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Finds an invoice based on its invoice number and optionally an invoice type and return it as xml string.  (asynchronously)
     *  Finds an invoice based on its invoice number and optionally an invoice type and return it as xml string. 
     * @param getXmlInvoiceRequestDto  xmlInvoiceRequestDto contains invoice number and optionally an invoice type  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  xml invoice  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceFetchXMLInvoice1Async(GetXmlInvoiceRequestDto getXmlInvoiceRequestDto, final ApiCallback<GetXmlInvoiceResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTInvoiceFetchXMLInvoice1ValidateBeforeCall(getXmlInvoiceRequestDto, _callback);
        Type localVarReturnType = new TypeToken<GetXmlInvoiceResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTInvoiceGenerateDraftInvoice1
     * @param generateInvoiceRequestDto  generateInvoiceRequestDto Post data  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  action status.  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceGenerateDraftInvoice1Call(GenerateInvoiceRequestDto generateInvoiceRequestDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = generateInvoiceRequestDto;

        // create path and map variables
        String localVarPath = "/invoice/generateDraftInvoice";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json", "application/xml"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pOSTInvoiceGenerateDraftInvoice1ValidateBeforeCall(GenerateInvoiceRequestDto generateInvoiceRequestDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTInvoiceGenerateDraftInvoice1Call(generateInvoiceRequestDto, _callback);
        return localVarCall;

    }

    /**
     *  Generate a Draft invoice  
     *  Generate a Draft invoice  
     * @param generateInvoiceRequestDto  generateInvoiceRequestDto Post data  (optional)
     * @return GenerateInvoiceResponseDto
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  action status.  </td><td>  -  </td></tr>
     </table>
     */
    public GenerateInvoiceResponseDto pOSTInvoiceGenerateDraftInvoice1(GenerateInvoiceRequestDto generateInvoiceRequestDto) throws ApiException {
        ApiResponse<GenerateInvoiceResponseDto> localVarResp = pOSTInvoiceGenerateDraftInvoice1WithHttpInfo(generateInvoiceRequestDto);
        return localVarResp.getData();
    }

    /**
     *  Generate a Draft invoice  
     *  Generate a Draft invoice  
     * @param generateInvoiceRequestDto  generateInvoiceRequestDto Post data  (optional)
     * @return ApiResponse&lt;GenerateInvoiceResponseDto&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  action status.  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<GenerateInvoiceResponseDto> pOSTInvoiceGenerateDraftInvoice1WithHttpInfo(GenerateInvoiceRequestDto generateInvoiceRequestDto) throws ApiException {
        okhttp3.Call localVarCall = pOSTInvoiceGenerateDraftInvoice1ValidateBeforeCall(generateInvoiceRequestDto, null);
        Type localVarReturnType = new TypeToken<GenerateInvoiceResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Generate a Draft invoice   (asynchronously)
     *  Generate a Draft invoice  
     * @param generateInvoiceRequestDto  generateInvoiceRequestDto Post data  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  action status.  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceGenerateDraftInvoice1Async(GenerateInvoiceRequestDto generateInvoiceRequestDto, final ApiCallback<GenerateInvoiceResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTInvoiceGenerateDraftInvoice1ValidateBeforeCall(generateInvoiceRequestDto, _callback);
        Type localVarReturnType = new TypeToken<GenerateInvoiceResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTInvoiceGenerateInvoice1
     * @param generateInvoiceRequestDto  generateInvoiceRequestDto Contains the code of the billing account invoicing and last transaction date  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  invoice response  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceGenerateInvoice1Call(GenerateInvoiceRequestDto generateInvoiceRequestDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = generateInvoiceRequestDto;

        // create path and map variables
        String localVarPath = "/invoice/generateInvoice";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json", "application/xml"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pOSTInvoiceGenerateInvoice1ValidateBeforeCall(GenerateInvoiceRequestDto generateInvoiceRequestDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTInvoiceGenerateInvoice1Call(generateInvoiceRequestDto, _callback);
        return localVarCall;

    }

    /**
     *  Launch all the invoicing process for a given billingAccount, that&#39;s mean
     *  Launch all the invoicing process for a given billingAccount, that&#39;s mean.  &lt;ul&gt; &lt;li&gt;Create rated transactions &lt;li&gt;Create an exceptional billingRun with given dates &lt;li&gt;Validate the pre-invoicing report &lt;li&gt;Validate the post-invoicing report &lt;li&gt;Validate the BillingRun  &lt;/ul&gt;  
     * @param generateInvoiceRequestDto  generateInvoiceRequestDto Contains the code of the billing account invoicing and last transaction date  (optional)
     * @return GenerateInvoiceResponseDto
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  invoice response  </td><td>  -  </td></tr>
     </table>
     */
    public GenerateInvoiceResponseDto pOSTInvoiceGenerateInvoice1(GenerateInvoiceRequestDto generateInvoiceRequestDto) throws ApiException {
        ApiResponse<GenerateInvoiceResponseDto> localVarResp = pOSTInvoiceGenerateInvoice1WithHttpInfo(generateInvoiceRequestDto);
        return localVarResp.getData();
    }

    /**
     *  Launch all the invoicing process for a given billingAccount, that&#39;s mean
     *  Launch all the invoicing process for a given billingAccount, that&#39;s mean.  &lt;ul&gt; &lt;li&gt;Create rated transactions &lt;li&gt;Create an exceptional billingRun with given dates &lt;li&gt;Validate the pre-invoicing report &lt;li&gt;Validate the post-invoicing report &lt;li&gt;Validate the BillingRun  &lt;/ul&gt;  
     * @param generateInvoiceRequestDto  generateInvoiceRequestDto Contains the code of the billing account invoicing and last transaction date  (optional)
     * @return ApiResponse&lt;GenerateInvoiceResponseDto&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  invoice response  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<GenerateInvoiceResponseDto> pOSTInvoiceGenerateInvoice1WithHttpInfo(GenerateInvoiceRequestDto generateInvoiceRequestDto) throws ApiException {
        okhttp3.Call localVarCall = pOSTInvoiceGenerateInvoice1ValidateBeforeCall(generateInvoiceRequestDto, null);
        Type localVarReturnType = new TypeToken<GenerateInvoiceResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Launch all the invoicing process for a given billingAccount, that&#39;s mean (asynchronously)
     *  Launch all the invoicing process for a given billingAccount, that&#39;s mean.  &lt;ul&gt; &lt;li&gt;Create rated transactions &lt;li&gt;Create an exceptional billingRun with given dates &lt;li&gt;Validate the pre-invoicing report &lt;li&gt;Validate the post-invoicing report &lt;li&gt;Validate the BillingRun  &lt;/ul&gt;  
     * @param generateInvoiceRequestDto  generateInvoiceRequestDto Contains the code of the billing account invoicing and last transaction date  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  invoice response  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceGenerateInvoice1Async(GenerateInvoiceRequestDto generateInvoiceRequestDto, final ApiCallback<GenerateInvoiceResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTInvoiceGenerateInvoice1ValidateBeforeCall(generateInvoiceRequestDto, _callback);
        Type localVarReturnType = new TypeToken<GenerateInvoiceResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTInvoiceGetPdfInvoice1
     * @param body  invoiceId invoice&#39;s id  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  pdf invoice  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceGetPdfInvoice1Call(Long body, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/invoice/getPdfInvoice";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json", "application/xml"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pOSTInvoiceGetPdfInvoice1ValidateBeforeCall(Long body, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTInvoiceGetPdfInvoice1Call(body, _callback);
        return localVarCall;

    }

    /**
     *  Finds an invoice based on invoice number and return it as pdf as byte []
     *  Finds an invoice based on invoice number and return it as pdf as byte []. Invoice is not recreated, instead invoice stored as pdf in database is returned.  
     * @param body  invoiceId invoice&#39;s id  (optional)
     * @return GetPdfInvoiceResponseDto
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  pdf invoice  </td><td>  -  </td></tr>
     </table>
     */
    public GetPdfInvoiceResponseDto pOSTInvoiceGetPdfInvoice1(Long body) throws ApiException {
        ApiResponse<GetPdfInvoiceResponseDto> localVarResp = pOSTInvoiceGetPdfInvoice1WithHttpInfo(body);
        return localVarResp.getData();
    }

    /**
     *  Finds an invoice based on invoice number and return it as pdf as byte []
     *  Finds an invoice based on invoice number and return it as pdf as byte []. Invoice is not recreated, instead invoice stored as pdf in database is returned.  
     * @param body  invoiceId invoice&#39;s id  (optional)
     * @return ApiResponse&lt;GetPdfInvoiceResponseDto&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  pdf invoice  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<GetPdfInvoiceResponseDto> pOSTInvoiceGetPdfInvoice1WithHttpInfo(Long body) throws ApiException {
        okhttp3.Call localVarCall = pOSTInvoiceGetPdfInvoice1ValidateBeforeCall(body, null);
        Type localVarReturnType = new TypeToken<GetPdfInvoiceResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Finds an invoice based on invoice number and return it as pdf as byte [] (asynchronously)
     *  Finds an invoice based on invoice number and return it as pdf as byte []. Invoice is not recreated, instead invoice stored as pdf in database is returned.  
     * @param body  invoiceId invoice&#39;s id  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  pdf invoice  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceGetPdfInvoice1Async(Long body, final ApiCallback<GetPdfInvoiceResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTInvoiceGetPdfInvoice1ValidateBeforeCall(body, _callback);
        Type localVarReturnType = new TypeToken<GetPdfInvoiceResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTInvoiceGetPdfInvoiceWithType1
     * @param body  invoiceId invoice&#39;s id  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  pdf invoice  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceGetPdfInvoiceWithType1Call(Long body, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/invoice/getPdfInvoiceWithType";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json", "application/xml"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pOSTInvoiceGetPdfInvoiceWithType1ValidateBeforeCall(Long body, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTInvoiceGetPdfInvoiceWithType1Call(body, _callback);
        return localVarCall;

    }

    /**
     *  Finds an invoice based on invoice number and invoice type and return it as pdf as byte []
     *  Finds an invoice based on invoice number and invoice type and return it as pdf as byte []. Invoice is not recreated, instead invoice stored as pdf in database is returned. 
     * @param body  invoiceId invoice&#39;s id  (optional)
     * @return GetPdfInvoiceResponseDto
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  pdf invoice  </td><td>  -  </td></tr>
     </table>
     */
    public GetPdfInvoiceResponseDto pOSTInvoiceGetPdfInvoiceWithType1(Long body) throws ApiException {
        ApiResponse<GetPdfInvoiceResponseDto> localVarResp = pOSTInvoiceGetPdfInvoiceWithType1WithHttpInfo(body);
        return localVarResp.getData();
    }

    /**
     *  Finds an invoice based on invoice number and invoice type and return it as pdf as byte []
     *  Finds an invoice based on invoice number and invoice type and return it as pdf as byte []. Invoice is not recreated, instead invoice stored as pdf in database is returned. 
     * @param body  invoiceId invoice&#39;s id  (optional)
     * @return ApiResponse&lt;GetPdfInvoiceResponseDto&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  pdf invoice  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<GetPdfInvoiceResponseDto> pOSTInvoiceGetPdfInvoiceWithType1WithHttpInfo(Long body) throws ApiException {
        okhttp3.Call localVarCall = pOSTInvoiceGetPdfInvoiceWithType1ValidateBeforeCall(body, null);
        Type localVarReturnType = new TypeToken<GetPdfInvoiceResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Finds an invoice based on invoice number and invoice type and return it as pdf as byte [] (asynchronously)
     *  Finds an invoice based on invoice number and invoice type and return it as pdf as byte []. Invoice is not recreated, instead invoice stored as pdf in database is returned. 
     * @param body  invoiceId invoice&#39;s id  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  pdf invoice  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceGetPdfInvoiceWithType1Async(Long body, final ApiCallback<GetPdfInvoiceResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTInvoiceGetPdfInvoiceWithType1ValidateBeforeCall(body, _callback);
        Type localVarReturnType = new TypeToken<GetPdfInvoiceResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTInvoiceGetXMLInvoice1
     * @param body  invoiceId invoice&#39;s id  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  xml invoice  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceGetXMLInvoice1Call(Long body, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/invoice/getXMLInvoice";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json", "application/xml"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pOSTInvoiceGetXMLInvoice1ValidateBeforeCall(Long body, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTInvoiceGetXMLInvoice1Call(body, _callback);
        return localVarCall;

    }

    /**
     *  Finds an invoice based on its invoice number and return it as xml string.  
     *  Finds an invoice based on its invoice number and return it as xml string.  
     * @param body  invoiceId invoice&#39;s id  (optional)
     * @return GetXmlInvoiceResponseDto
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  xml invoice  </td><td>  -  </td></tr>
     </table>
     */
    public GetXmlInvoiceResponseDto pOSTInvoiceGetXMLInvoice1(Long body) throws ApiException {
        ApiResponse<GetXmlInvoiceResponseDto> localVarResp = pOSTInvoiceGetXMLInvoice1WithHttpInfo(body);
        return localVarResp.getData();
    }

    /**
     *  Finds an invoice based on its invoice number and return it as xml string.  
     *  Finds an invoice based on its invoice number and return it as xml string.  
     * @param body  invoiceId invoice&#39;s id  (optional)
     * @return ApiResponse&lt;GetXmlInvoiceResponseDto&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  xml invoice  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<GetXmlInvoiceResponseDto> pOSTInvoiceGetXMLInvoice1WithHttpInfo(Long body) throws ApiException {
        okhttp3.Call localVarCall = pOSTInvoiceGetXMLInvoice1ValidateBeforeCall(body, null);
        Type localVarReturnType = new TypeToken<GetXmlInvoiceResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Finds an invoice based on its invoice number and return it as xml string.   (asynchronously)
     *  Finds an invoice based on its invoice number and return it as xml string.  
     * @param body  invoiceId invoice&#39;s id  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  xml invoice  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceGetXMLInvoice1Async(Long body, final ApiCallback<GetXmlInvoiceResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTInvoiceGetXMLInvoice1ValidateBeforeCall(body, _callback);
        Type localVarReturnType = new TypeToken<GetXmlInvoiceResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTInvoiceGetXMLInvoiceWithType1
     * @param body  invoiceId invoice&#39;s id.  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  xml invoice  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceGetXMLInvoiceWithType1Call(Long body, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/invoice/getXMLInvoiceWithType";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json", "application/xml"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pOSTInvoiceGetXMLInvoiceWithType1ValidateBeforeCall(Long body, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTInvoiceGetXMLInvoiceWithType1Call(body, _callback);
        return localVarCall;

    }

    /**
     *  Finds an invoice based on invoice number and invoice type. It returns the result as xml string 
     *  Finds an invoice based on invoice number and invoice type. It returns the result as xml string 
     * @param body  invoiceId invoice&#39;s id.  (optional)
     * @return GetXmlInvoiceResponseDto
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  xml invoice  </td><td>  -  </td></tr>
     </table>
     */
    public GetXmlInvoiceResponseDto pOSTInvoiceGetXMLInvoiceWithType1(Long body) throws ApiException {
        ApiResponse<GetXmlInvoiceResponseDto> localVarResp = pOSTInvoiceGetXMLInvoiceWithType1WithHttpInfo(body);
        return localVarResp.getData();
    }

    /**
     *  Finds an invoice based on invoice number and invoice type. It returns the result as xml string 
     *  Finds an invoice based on invoice number and invoice type. It returns the result as xml string 
     * @param body  invoiceId invoice&#39;s id.  (optional)
     * @return ApiResponse&lt;GetXmlInvoiceResponseDto&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  xml invoice  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<GetXmlInvoiceResponseDto> pOSTInvoiceGetXMLInvoiceWithType1WithHttpInfo(Long body) throws ApiException {
        okhttp3.Call localVarCall = pOSTInvoiceGetXMLInvoiceWithType1ValidateBeforeCall(body, null);
        Type localVarReturnType = new TypeToken<GetXmlInvoiceResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Finds an invoice based on invoice number and invoice type. It returns the result as xml string  (asynchronously)
     *  Finds an invoice based on invoice number and invoice type. It returns the result as xml string 
     * @param body  invoiceId invoice&#39;s id.  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  xml invoice  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceGetXMLInvoiceWithType1Async(Long body, final ApiCallback<GetXmlInvoiceResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTInvoiceGetXMLInvoiceWithType1ValidateBeforeCall(body, _callback);
        Type localVarReturnType = new TypeToken<GetXmlInvoiceResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTInvoiceList1
     * @param pagingAndFiltering  pagingAndFiltering Pagination and filtering criteria. Specify transactions in fields to include transactions and pdf to generate/include PDF document  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  An invoice list  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceList1Call(PagingAndFiltering pagingAndFiltering, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = pagingAndFiltering;

        // create path and map variables
        String localVarPath = "/invoice/list";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json", "application/xml"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pOSTInvoiceList1ValidateBeforeCall(PagingAndFiltering pagingAndFiltering, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTInvoiceList1Call(pagingAndFiltering, _callback);
        return localVarCall;

    }

    /**
     *  List invoices matching a given criteria.  
     *  List invoices matching a given criteria.  
     * @param pagingAndFiltering  pagingAndFiltering Pagination and filtering criteria. Specify transactions in fields to include transactions and pdf to generate/include PDF document  (optional)
     * @return InvoicesDto
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  An invoice list  </td><td>  -  </td></tr>
     </table>
     */
    public InvoicesDto pOSTInvoiceList1(PagingAndFiltering pagingAndFiltering) throws ApiException {
        ApiResponse<InvoicesDto> localVarResp = pOSTInvoiceList1WithHttpInfo(pagingAndFiltering);
        return localVarResp.getData();
    }

    /**
     *  List invoices matching a given criteria.  
     *  List invoices matching a given criteria.  
     * @param pagingAndFiltering  pagingAndFiltering Pagination and filtering criteria. Specify transactions in fields to include transactions and pdf to generate/include PDF document  (optional)
     * @return ApiResponse&lt;InvoicesDto&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  An invoice list  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<InvoicesDto> pOSTInvoiceList1WithHttpInfo(PagingAndFiltering pagingAndFiltering) throws ApiException {
        okhttp3.Call localVarCall = pOSTInvoiceList1ValidateBeforeCall(pagingAndFiltering, null);
        Type localVarReturnType = new TypeToken<InvoicesDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  List invoices matching a given criteria.   (asynchronously)
     *  List invoices matching a given criteria.  
     * @param pagingAndFiltering  pagingAndFiltering Pagination and filtering criteria. Specify transactions in fields to include transactions and pdf to generate/include PDF document  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  An invoice list  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceList1Async(PagingAndFiltering pagingAndFiltering, final ApiCallback<InvoicesDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTInvoiceList1ValidateBeforeCall(pagingAndFiltering, _callback);
        Type localVarReturnType = new TypeToken<InvoicesDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTInvoiceSendByEmail1
     * @param invoiceDto  invoiceDto  the invoice DTO  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  SUCCESS if sent, FAIL else  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceSendByEmail1Call(InvoiceDto invoiceDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = invoiceDto;

        // create path and map variables
        String localVarPath = "/invoice/sendByEmail";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json", "application/xml"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pOSTInvoiceSendByEmail1ValidateBeforeCall(InvoiceDto invoiceDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTInvoiceSendByEmail1Call(invoiceDto, _callback);
        return localVarCall;

    }

    /**
     *  Send invoice by Email. 
     *  Send invoice by Email. 
     * @param invoiceDto  invoiceDto  the invoice DTO  (optional)
     * @return ActionStatus
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  SUCCESS if sent, FAIL else  </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus pOSTInvoiceSendByEmail1(InvoiceDto invoiceDto) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTInvoiceSendByEmail1WithHttpInfo(invoiceDto);
        return localVarResp.getData();
    }

    /**
     *  Send invoice by Email. 
     *  Send invoice by Email. 
     * @param invoiceDto  invoiceDto  the invoice DTO  (optional)
     * @return ApiResponse&lt;ActionStatus&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  SUCCESS if sent, FAIL else  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> pOSTInvoiceSendByEmail1WithHttpInfo(InvoiceDto invoiceDto) throws ApiException {
        okhttp3.Call localVarCall = pOSTInvoiceSendByEmail1ValidateBeforeCall(invoiceDto, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Send invoice by Email.  (asynchronously)
     *  Send invoice by Email. 
     * @param invoiceDto  invoiceDto  the invoice DTO  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  SUCCESS if sent, FAIL else  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceSendByEmail1Async(InvoiceDto invoiceDto, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTInvoiceSendByEmail1ValidateBeforeCall(invoiceDto, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTInvoiceValidate1
     * @param inlineObject  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  action status.  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceValidate1Call(InlineObject inlineObject, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = inlineObject;

        // create path and map variables
        String localVarPath = "/invoice/validate";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json", "application/xml"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pOSTInvoiceValidate1ValidateBeforeCall(InlineObject inlineObject, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTInvoiceValidate1Call(inlineObject, _callback);
        return localVarCall;

    }

    /**
     *  Validate an invoice based on the invoice id.  
     *  Validate an invoice based on the invoice id.  
     * @param inlineObject  (optional)
     * @return ActionStatus
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  action status.  </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus pOSTInvoiceValidate1(InlineObject inlineObject) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTInvoiceValidate1WithHttpInfo(inlineObject);
        return localVarResp.getData();
    }

    /**
     *  Validate an invoice based on the invoice id.  
     *  Validate an invoice based on the invoice id.  
     * @param inlineObject  (optional)
     * @return ApiResponse&lt;ActionStatus&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  action status.  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> pOSTInvoiceValidate1WithHttpInfo(InlineObject inlineObject) throws ApiException {
        okhttp3.Call localVarCall = pOSTInvoiceValidate1ValidateBeforeCall(inlineObject, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Validate an invoice based on the invoice id.   (asynchronously)
     *  Validate an invoice based on the invoice id.  
     * @param inlineObject  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  action status.  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoiceValidate1Async(InlineObject inlineObject, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTInvoiceValidate1ValidateBeforeCall(inlineObject, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for user79
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td> default response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call user79Call(final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/invoice/user";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call user79ValidateBeforeCall(final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = user79Call(_callback);
        return localVarCall;

    }

    /**
     * 
     * 
     * @return ActionStatus
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td> default response </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus user79() throws ApiException {
        ApiResponse<ActionStatus> localVarResp = user79WithHttpInfo();
        return localVarResp.getData();
    }

    /**
     * 
     * 
     * @return ApiResponse&lt;ActionStatus&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td> default response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> user79WithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = user79ValidateBeforeCall(null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  (asynchronously)
     * 
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td> default response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call user79Async(final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = user79ValidateBeforeCall(_callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
}
