/*
 * 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.threeten.bp.OffsetDateTime;
import org.openapitools.client.model.UsageChargeAggregateResponseDto;
import org.openapitools.client.model.UsageResponseDto;

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

public class UsageApi {
    private ApiClient localVarApiClient;

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

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

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

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

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

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

        okhttp3.Call localVarCall = gETIBaseVersion23Call(_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 gETIBaseVersion23() throws ApiException {
        ApiResponse<ActionStatus> localVarResp = gETIBaseVersion23WithHttpInfo();
        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> gETIBaseVersion23WithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = gETIBaseVersion23ValidateBeforeCall(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 gETIBaseVersion23Async(final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = gETIBaseVersion23ValidateBeforeCall(_callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for gETUsageChargeAggregate1
     * @param userAccountCode  userAccountCode user account&#39;s code  (optional)
     * @param fromDate  fromDate from date  (optional)
     * @param toDate  toDate to 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>  usage charge aggregate  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETUsageChargeAggregate1Call(String userAccountCode, OffsetDateTime fromDate, OffsetDateTime toDate, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/usage/chargeAggregate";

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

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

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

        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 gETUsageChargeAggregate1ValidateBeforeCall(String userAccountCode, OffsetDateTime fromDate, OffsetDateTime toDate, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = gETUsageChargeAggregate1Call(userAccountCode, fromDate, toDate, _callback);
        return localVarCall;

    }

    /**
     *  Search for charge aggregate isage from a user account code during a period of time. 
     *  Search for charge aggregate isage from a user account code during a period of time. 
     * @param userAccountCode  userAccountCode user account&#39;s code  (optional)
     * @param fromDate  fromDate from date  (optional)
     * @param toDate  toDate to date  (optional)
     * @return UsageChargeAggregateResponseDto
     * @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>  usage charge aggregate  </td><td>  -  </td></tr>
     </table>
     */
    public UsageChargeAggregateResponseDto gETUsageChargeAggregate1(String userAccountCode, OffsetDateTime fromDate, OffsetDateTime toDate) throws ApiException {
        ApiResponse<UsageChargeAggregateResponseDto> localVarResp = gETUsageChargeAggregate1WithHttpInfo(userAccountCode, fromDate, toDate);
        return localVarResp.getData();
    }

    /**
     *  Search for charge aggregate isage from a user account code during a period of time. 
     *  Search for charge aggregate isage from a user account code during a period of time. 
     * @param userAccountCode  userAccountCode user account&#39;s code  (optional)
     * @param fromDate  fromDate from date  (optional)
     * @param toDate  toDate to date  (optional)
     * @return ApiResponse&lt;UsageChargeAggregateResponseDto&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>  usage charge aggregate  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<UsageChargeAggregateResponseDto> gETUsageChargeAggregate1WithHttpInfo(String userAccountCode, OffsetDateTime fromDate, OffsetDateTime toDate) throws ApiException {
        okhttp3.Call localVarCall = gETUsageChargeAggregate1ValidateBeforeCall(userAccountCode, fromDate, toDate, null);
        Type localVarReturnType = new TypeToken<UsageChargeAggregateResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Search for charge aggregate isage from a user account code during a period of time.  (asynchronously)
     *  Search for charge aggregate isage from a user account code during a period of time. 
     * @param userAccountCode  userAccountCode user account&#39;s code  (optional)
     * @param fromDate  fromDate from date  (optional)
     * @param toDate  toDate to 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>  usage charge aggregate  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETUsageChargeAggregate1Async(String userAccountCode, OffsetDateTime fromDate, OffsetDateTime toDate, final ApiCallback<UsageChargeAggregateResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = gETUsageChargeAggregate1ValidateBeforeCall(userAccountCode, fromDate, toDate, _callback);
        Type localVarReturnType = new TypeToken<UsageChargeAggregateResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for gETUsageSearch1
     * @param userAccountCode  userAccountCode user account&#39;s code  (optional)
     * @param fromDate  fromDate from date  (optional)
     * @param toDate  toDate to 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>  usage  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETUsageSearch1Call(String userAccountCode, OffsetDateTime fromDate, OffsetDateTime toDate, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

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

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

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

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

        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 gETUsageSearch1ValidateBeforeCall(String userAccountCode, OffsetDateTime fromDate, OffsetDateTime toDate, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = gETUsageSearch1Call(userAccountCode, fromDate, toDate, _callback);
        return localVarCall;

    }

    /**
     *  Search for all opened ratedTransactions with a given userAccountCode,fromDate and toDate .  
     *  Search for all opened ratedTransactions with a given userAccountCode,fromDate and toDate .  
     * @param userAccountCode  userAccountCode user account&#39;s code  (optional)
     * @param fromDate  fromDate from date  (optional)
     * @param toDate  toDate to date  (optional)
     * @return UsageResponseDto
     * @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>  usage  </td><td>  -  </td></tr>
     </table>
     */
    public UsageResponseDto gETUsageSearch1(String userAccountCode, OffsetDateTime fromDate, OffsetDateTime toDate) throws ApiException {
        ApiResponse<UsageResponseDto> localVarResp = gETUsageSearch1WithHttpInfo(userAccountCode, fromDate, toDate);
        return localVarResp.getData();
    }

    /**
     *  Search for all opened ratedTransactions with a given userAccountCode,fromDate and toDate .  
     *  Search for all opened ratedTransactions with a given userAccountCode,fromDate and toDate .  
     * @param userAccountCode  userAccountCode user account&#39;s code  (optional)
     * @param fromDate  fromDate from date  (optional)
     * @param toDate  toDate to date  (optional)
     * @return ApiResponse&lt;UsageResponseDto&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>  usage  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<UsageResponseDto> gETUsageSearch1WithHttpInfo(String userAccountCode, OffsetDateTime fromDate, OffsetDateTime toDate) throws ApiException {
        okhttp3.Call localVarCall = gETUsageSearch1ValidateBeforeCall(userAccountCode, fromDate, toDate, null);
        Type localVarReturnType = new TypeToken<UsageResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Search for all opened ratedTransactions with a given userAccountCode,fromDate and toDate .   (asynchronously)
     *  Search for all opened ratedTransactions with a given userAccountCode,fromDate and toDate .  
     * @param userAccountCode  userAccountCode user account&#39;s code  (optional)
     * @param fromDate  fromDate from date  (optional)
     * @param toDate  toDate to 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>  usage  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETUsageSearch1Async(String userAccountCode, OffsetDateTime fromDate, OffsetDateTime toDate, final ApiCallback<UsageResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = gETUsageSearch1ValidateBeforeCall(userAccountCode, fromDate, toDate, _callback);
        Type localVarReturnType = new TypeToken<UsageResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for user76
     * @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 user76Call(final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

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

        okhttp3.Call localVarCall = user76Call(_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 user76() throws ApiException {
        ApiResponse<ActionStatus> localVarResp = user76WithHttpInfo();
        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> user76WithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = user76ValidateBeforeCall(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 user76Async(final ApiCallback<ActionStatus> _callback) throws ApiException {

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