/*
 * 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.CreateBillingRunDto;
import org.openapitools.client.model.GetBillingAccountListInRunResponseDto;
import org.openapitools.client.model.GetBillingRunInfoResponseDto;
import org.openapitools.client.model.GetPostInvoicingReportsResponseDto;
import org.openapitools.client.model.GetPreInvoicingReportsResponseDto;

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

public class InvoicingApi {
    private ApiClient localVarApiClient;

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

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

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

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

    /**
     * Build call for gETIBaseVersion37
     * @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 gETIBaseVersion37Call(final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/billing/invoicing/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 gETIBaseVersion37ValidateBeforeCall(final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = gETIBaseVersion37Call(_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 gETIBaseVersion37() throws ApiException {
        ApiResponse<ActionStatus> localVarResp = gETIBaseVersion37WithHttpInfo();
        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> gETIBaseVersion37WithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = gETIBaseVersion37ValidateBeforeCall(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 gETIBaseVersion37Async(final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = gETIBaseVersion37ValidateBeforeCall(_callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTInvoicingCancelBillingRun1
     * @param body  billingRunId Billing run 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>  Request processing status   </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoicingCancelBillingRun1Call(Long body, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/billing/invoicing/cancelBillingRun";

        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 pOSTInvoicingCancelBillingRun1ValidateBeforeCall(Long body, final ApiCallback _callback) throws ApiException {
        

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

    }

    /**
     *  Cancels a billing run
     *  Cancels a billing run. Sets RatedTransaction.status associated to billing run to OPEN. Remove aggregates and invoice associated to the billing run. Set billingAccount.billingRun to null.  
     * @param body  billingRunId Billing run 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>  Request processing status   </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus pOSTInvoicingCancelBillingRun1(Long body) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTInvoicingCancelBillingRun1WithHttpInfo(body);
        return localVarResp.getData();
    }

    /**
     *  Cancels a billing run
     *  Cancels a billing run. Sets RatedTransaction.status associated to billing run to OPEN. Remove aggregates and invoice associated to the billing run. Set billingAccount.billingRun to null.  
     * @param body  billingRunId Billing run 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>  Request processing status   </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> pOSTInvoicingCancelBillingRun1WithHttpInfo(Long body) throws ApiException {
        okhttp3.Call localVarCall = pOSTInvoicingCancelBillingRun1ValidateBeforeCall(body, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Cancels a billing run (asynchronously)
     *  Cancels a billing run. Sets RatedTransaction.status associated to billing run to OPEN. Remove aggregates and invoice associated to the billing run. Set billingAccount.billingRun to null.  
     * @param body  billingRunId Billing run 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>  Request processing status   </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoicingCancelBillingRun1Async(Long body, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTInvoicingCancelBillingRun1ValidateBeforeCall(body, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTInvoicingCreateBillingRun1
     * @param createBillingRunDto  createBillingRunDto The billing run&#39;s 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>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoicingCreateBillingRun1Call(CreateBillingRunDto createBillingRunDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = createBillingRunDto;

        // create path and map variables
        String localVarPath = "/billing/invoicing/createBillingRun";

        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 pOSTInvoicingCreateBillingRun1ValidateBeforeCall(CreateBillingRunDto createBillingRunDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTInvoicingCreateBillingRun1Call(createBillingRunDto, _callback);
        return localVarCall;

    }

    /**
     *  Create a new billing run  
     *  Create a new billing run  
     * @param createBillingRunDto  createBillingRunDto The billing run&#39;s data  (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>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus pOSTInvoicingCreateBillingRun1(CreateBillingRunDto createBillingRunDto) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTInvoicingCreateBillingRun1WithHttpInfo(createBillingRunDto);
        return localVarResp.getData();
    }

    /**
     *  Create a new billing run  
     *  Create a new billing run  
     * @param createBillingRunDto  createBillingRunDto The billing run&#39;s data  (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>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> pOSTInvoicingCreateBillingRun1WithHttpInfo(CreateBillingRunDto createBillingRunDto) throws ApiException {
        okhttp3.Call localVarCall = pOSTInvoicingCreateBillingRun1ValidateBeforeCall(createBillingRunDto, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Create a new billing run   (asynchronously)
     *  Create a new billing run  
     * @param createBillingRunDto  createBillingRunDto The billing run&#39;s 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>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoicingCreateBillingRun1Async(CreateBillingRunDto createBillingRunDto, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTInvoicingCreateBillingRun1ValidateBeforeCall(createBillingRunDto, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTInvoicingGetBillingAccountListInRun1
     * @param body  billingRunId The billing run 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>  A list of billing accounts  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoicingGetBillingAccountListInRun1Call(Long body, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/billing/invoicing/getBillingAccountListInRun";

        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 pOSTInvoicingGetBillingAccountListInRun1ValidateBeforeCall(Long body, final ApiCallback _callback) throws ApiException {
        

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

    }

    /**
     *  Returns the list of billable billing accounts of a billing run  
     *  Returns the list of billable billing accounts of a billing run  
     * @param body  billingRunId The billing run id  (optional)
     * @return GetBillingAccountListInRunResponseDto
     * @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>  A list of billing accounts  </td><td>  -  </td></tr>
     </table>
     */
    public GetBillingAccountListInRunResponseDto pOSTInvoicingGetBillingAccountListInRun1(Long body) throws ApiException {
        ApiResponse<GetBillingAccountListInRunResponseDto> localVarResp = pOSTInvoicingGetBillingAccountListInRun1WithHttpInfo(body);
        return localVarResp.getData();
    }

    /**
     *  Returns the list of billable billing accounts of a billing run  
     *  Returns the list of billable billing accounts of a billing run  
     * @param body  billingRunId The billing run id  (optional)
     * @return ApiResponse&lt;GetBillingAccountListInRunResponseDto&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>  A list of billing accounts  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<GetBillingAccountListInRunResponseDto> pOSTInvoicingGetBillingAccountListInRun1WithHttpInfo(Long body) throws ApiException {
        okhttp3.Call localVarCall = pOSTInvoicingGetBillingAccountListInRun1ValidateBeforeCall(body, null);
        Type localVarReturnType = new TypeToken<GetBillingAccountListInRunResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Returns the list of billable billing accounts of a billing run   (asynchronously)
     *  Returns the list of billable billing accounts of a billing run  
     * @param body  billingRunId The billing run 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>  A list of billing accounts  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoicingGetBillingAccountListInRun1Async(Long body, final ApiCallback<GetBillingAccountListInRunResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTInvoicingGetBillingAccountListInRun1ValidateBeforeCall(body, _callback);
        Type localVarReturnType = new TypeToken<GetBillingAccountListInRunResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTInvoicingGetBillingRunInfo1
     * @param body  billingRunId The billing run&#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>  The billing run info  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoicingGetBillingRunInfo1Call(Long body, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/billing/invoicing/getBillingRunInfo";

        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 pOSTInvoicingGetBillingRunInfo1ValidateBeforeCall(Long body, final ApiCallback _callback) throws ApiException {
        

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

    }

    /**
     *  Search for a billing run info with a given Id   
     *  Search for a billing run info with a given Id   
     * @param body  billingRunId The billing run&#39;s Id  (optional)
     * @return GetBillingRunInfoResponseDto
     * @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>  The billing run info  </td><td>  -  </td></tr>
     </table>
     */
    public GetBillingRunInfoResponseDto pOSTInvoicingGetBillingRunInfo1(Long body) throws ApiException {
        ApiResponse<GetBillingRunInfoResponseDto> localVarResp = pOSTInvoicingGetBillingRunInfo1WithHttpInfo(body);
        return localVarResp.getData();
    }

    /**
     *  Search for a billing run info with a given Id   
     *  Search for a billing run info with a given Id   
     * @param body  billingRunId The billing run&#39;s Id  (optional)
     * @return ApiResponse&lt;GetBillingRunInfoResponseDto&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>  The billing run info  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<GetBillingRunInfoResponseDto> pOSTInvoicingGetBillingRunInfo1WithHttpInfo(Long body) throws ApiException {
        okhttp3.Call localVarCall = pOSTInvoicingGetBillingRunInfo1ValidateBeforeCall(body, null);
        Type localVarReturnType = new TypeToken<GetBillingRunInfoResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Search for a billing run info with a given Id    (asynchronously)
     *  Search for a billing run info with a given Id   
     * @param body  billingRunId The billing run&#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>  The billing run info  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoicingGetBillingRunInfo1Async(Long body, final ApiCallback<GetBillingRunInfoResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTInvoicingGetBillingRunInfo1ValidateBeforeCall(body, _callback);
        Type localVarReturnType = new TypeToken<GetBillingRunInfoResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTInvoicingGetPostInvoicingReport1
     * @param body  billingRunId The billing run 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>  A post-invoicing reports  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoicingGetPostInvoicingReport1Call(Long body, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/billing/invoicing/getPostInvoicingReport";

        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 pOSTInvoicingGetPostInvoicingReport1ValidateBeforeCall(Long body, final ApiCallback _callback) throws ApiException {
        

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

    }

    /**
     *  Returns the post-invoicing report for a given billing run Id  
     *  Returns the post-invoicing report for a given billing run Id  
     * @param body  billingRunId The billing run id  (optional)
     * @return GetPostInvoicingReportsResponseDto
     * @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>  A post-invoicing reports  </td><td>  -  </td></tr>
     </table>
     */
    public GetPostInvoicingReportsResponseDto pOSTInvoicingGetPostInvoicingReport1(Long body) throws ApiException {
        ApiResponse<GetPostInvoicingReportsResponseDto> localVarResp = pOSTInvoicingGetPostInvoicingReport1WithHttpInfo(body);
        return localVarResp.getData();
    }

    /**
     *  Returns the post-invoicing report for a given billing run Id  
     *  Returns the post-invoicing report for a given billing run Id  
     * @param body  billingRunId The billing run id  (optional)
     * @return ApiResponse&lt;GetPostInvoicingReportsResponseDto&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>  A post-invoicing reports  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<GetPostInvoicingReportsResponseDto> pOSTInvoicingGetPostInvoicingReport1WithHttpInfo(Long body) throws ApiException {
        okhttp3.Call localVarCall = pOSTInvoicingGetPostInvoicingReport1ValidateBeforeCall(body, null);
        Type localVarReturnType = new TypeToken<GetPostInvoicingReportsResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Returns the post-invoicing report for a given billing run Id   (asynchronously)
     *  Returns the post-invoicing report for a given billing run Id  
     * @param body  billingRunId The billing run 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>  A post-invoicing reports  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoicingGetPostInvoicingReport1Async(Long body, final ApiCallback<GetPostInvoicingReportsResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTInvoicingGetPostInvoicingReport1ValidateBeforeCall(body, _callback);
        Type localVarReturnType = new TypeToken<GetPostInvoicingReportsResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTInvoicingGetPreInvoicingReport1
     * @param body  billingRunId The billing run 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>  A pre-invoicing reports  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoicingGetPreInvoicingReport1Call(Long body, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/billing/invoicing/getPreInvoicingReport";

        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 pOSTInvoicingGetPreInvoicingReport1ValidateBeforeCall(Long body, final ApiCallback _callback) throws ApiException {
        

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

    }

    /**
     *  Returns the pre-invoicing report for a given billing run Id  
     *  Returns the pre-invoicing report for a given billing run Id  
     * @param body  billingRunId The billing run id  (optional)
     * @return GetPreInvoicingReportsResponseDto
     * @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>  A pre-invoicing reports  </td><td>  -  </td></tr>
     </table>
     */
    public GetPreInvoicingReportsResponseDto pOSTInvoicingGetPreInvoicingReport1(Long body) throws ApiException {
        ApiResponse<GetPreInvoicingReportsResponseDto> localVarResp = pOSTInvoicingGetPreInvoicingReport1WithHttpInfo(body);
        return localVarResp.getData();
    }

    /**
     *  Returns the pre-invoicing report for a given billing run Id  
     *  Returns the pre-invoicing report for a given billing run Id  
     * @param body  billingRunId The billing run id  (optional)
     * @return ApiResponse&lt;GetPreInvoicingReportsResponseDto&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>  A pre-invoicing reports  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<GetPreInvoicingReportsResponseDto> pOSTInvoicingGetPreInvoicingReport1WithHttpInfo(Long body) throws ApiException {
        okhttp3.Call localVarCall = pOSTInvoicingGetPreInvoicingReport1ValidateBeforeCall(body, null);
        Type localVarReturnType = new TypeToken<GetPreInvoicingReportsResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Returns the pre-invoicing report for a given billing run Id   (asynchronously)
     *  Returns the pre-invoicing report for a given billing run Id  
     * @param body  billingRunId The billing run 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>  A pre-invoicing reports  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoicingGetPreInvoicingReport1Async(Long body, final ApiCallback<GetPreInvoicingReportsResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTInvoicingGetPreInvoicingReport1ValidateBeforeCall(body, _callback);
        Type localVarReturnType = new TypeToken<GetPreInvoicingReportsResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTInvoicingValidateBillingRun1
     * @param body  billingRunId The billing run 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>  Request processing status   </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoicingValidateBillingRun1Call(Long body, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/billing/invoicing/validateBillingRun";

        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 pOSTInvoicingValidateBillingRun1ValidateBeforeCall(Long body, final ApiCallback _callback) throws ApiException {
        

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

    }

    /**
     *  Depending on the status of the billing run, produce the pre-invoicing report, the post-Invoicing report or validates a billing run
     *  Depending on the status of the billing run, produce the pre-invoicing report, the post-Invoicing report or validates a billing run. Sets the next invoice date of a billing account to the next calendar date.  
     * @param body  billingRunId The billing run 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>  Request processing status   </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus pOSTInvoicingValidateBillingRun1(Long body) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTInvoicingValidateBillingRun1WithHttpInfo(body);
        return localVarResp.getData();
    }

    /**
     *  Depending on the status of the billing run, produce the pre-invoicing report, the post-Invoicing report or validates a billing run
     *  Depending on the status of the billing run, produce the pre-invoicing report, the post-Invoicing report or validates a billing run. Sets the next invoice date of a billing account to the next calendar date.  
     * @param body  billingRunId The billing run 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>  Request processing status   </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> pOSTInvoicingValidateBillingRun1WithHttpInfo(Long body) throws ApiException {
        okhttp3.Call localVarCall = pOSTInvoicingValidateBillingRun1ValidateBeforeCall(body, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Depending on the status of the billing run, produce the pre-invoicing report, the post-Invoicing report or validates a billing run (asynchronously)
     *  Depending on the status of the billing run, produce the pre-invoicing report, the post-Invoicing report or validates a billing run. Sets the next invoice date of a billing account to the next calendar date.  
     * @param body  billingRunId The billing run 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>  Request processing status   </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTInvoicingValidateBillingRun1Async(Long body, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTInvoicingValidateBillingRun1ValidateBeforeCall(body, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for user13
     * @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 user13Call(final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/billing/invoicing/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 user13ValidateBeforeCall(final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = user13Call(_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 user13() throws ApiException {
        ApiResponse<ActionStatus> localVarResp = user13WithHttpInfo();
        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> user13WithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = user13ValidateBeforeCall(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 user13Async(final ApiCallback<ActionStatus> _callback) throws ApiException {

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