/*
 * 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.CurrencyDto;
import org.openapitools.client.model.GetTradingCurrencyResponse;

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

public class CurrencyApi {
    private ApiClient localVarApiClient;

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

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

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

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

    /**
     * Build call for dELETECurrencyCurrencyCode1
     * @param currencyCode  currencyCode currency code  (required)
     * @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 dELETECurrencyCurrencyCode1Call(String currencyCode, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/currency/{currencyCode}"
            .replaceAll("\\{" + "currencyCode" + "\\}", localVarApiClient.escapeString(currencyCode.toString()));

        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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call dELETECurrencyCurrencyCode1ValidateBeforeCall(String currencyCode, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'currencyCode' is set
        if (currencyCode == null) {
            throw new ApiException("Missing the required parameter 'currencyCode' when calling dELETECurrencyCurrencyCode1(Async)");
        }
        

        okhttp3.Call localVarCall = dELETECurrencyCurrencyCode1Call(currencyCode, _callback);
        return localVarCall;

    }

    /**
     *  Remove currency with a given currency code.  
     *  Remove currency with a given currency code.  
     * @param currencyCode  currencyCode currency code  (required)
     * @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 dELETECurrencyCurrencyCode1(String currencyCode) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = dELETECurrencyCurrencyCode1WithHttpInfo(currencyCode);
        return localVarResp.getData();
    }

    /**
     *  Remove currency with a given currency code.  
     *  Remove currency with a given currency code.  
     * @param currencyCode  currencyCode currency code  (required)
     * @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> dELETECurrencyCurrencyCode1WithHttpInfo(String currencyCode) throws ApiException {
        okhttp3.Call localVarCall = dELETECurrencyCurrencyCode1ValidateBeforeCall(currencyCode, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Remove currency with a given currency code.   (asynchronously)
     *  Remove currency with a given currency code.  
     * @param currencyCode  currencyCode currency code  (required)
     * @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 dELETECurrencyCurrencyCode1Async(String currencyCode, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = dELETECurrencyCurrencyCode1ValidateBeforeCall(currencyCode, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for gETCurrencySearch1
     * @param currencyCode  currencyCode currency code  (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>  currency if exists  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETCurrencySearch1Call(String currencyCode, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

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

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

        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 gETCurrencySearch1ValidateBeforeCall(String currencyCode, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = gETCurrencySearch1Call(currencyCode, _callback);
        return localVarCall;

    }

    /**
     *  Search currency with a given currency code.  
     *  Search currency with a given currency code.  
     * @param currencyCode  currencyCode currency code  (optional)
     * @return GetTradingCurrencyResponse
     * @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>  currency if exists  </td><td>  -  </td></tr>
     </table>
     */
    public GetTradingCurrencyResponse gETCurrencySearch1(String currencyCode) throws ApiException {
        ApiResponse<GetTradingCurrencyResponse> localVarResp = gETCurrencySearch1WithHttpInfo(currencyCode);
        return localVarResp.getData();
    }

    /**
     *  Search currency with a given currency code.  
     *  Search currency with a given currency code.  
     * @param currencyCode  currencyCode currency code  (optional)
     * @return ApiResponse&lt;GetTradingCurrencyResponse&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>  currency if exists  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<GetTradingCurrencyResponse> gETCurrencySearch1WithHttpInfo(String currencyCode) throws ApiException {
        okhttp3.Call localVarCall = gETCurrencySearch1ValidateBeforeCall(currencyCode, null);
        Type localVarReturnType = new TypeToken<GetTradingCurrencyResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Search currency with a given currency code.   (asynchronously)
     *  Search currency with a given currency code.  
     * @param currencyCode  currencyCode currency code  (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>  currency if exists  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETCurrencySearch1Async(String currencyCode, final ApiCallback<GetTradingCurrencyResponse> _callback) throws ApiException {

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

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

        okhttp3.Call localVarCall = gETIBaseVersion5Call(_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 gETIBaseVersion5() throws ApiException {
        ApiResponse<ActionStatus> localVarResp = gETIBaseVersion5WithHttpInfo();
        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> gETIBaseVersion5WithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = gETIBaseVersion5ValidateBeforeCall(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 gETIBaseVersion5Async(final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = gETIBaseVersion5ValidateBeforeCall(_callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTCurrencyCodeDisable1
     * @param code  code Currency code  (required)
     * @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 pOSTCurrencyCodeDisable1Call(String code, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/currency/{code}/disable"
            .replaceAll("\\{" + "code" + "\\}", localVarApiClient.escapeString(code.toString()));

        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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pOSTCurrencyCodeDisable1ValidateBeforeCall(String code, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'code' is set
        if (code == null) {
            throw new ApiException("Missing the required parameter 'code' when calling pOSTCurrencyCodeDisable1(Async)");
        }
        

        okhttp3.Call localVarCall = pOSTCurrencyCodeDisable1Call(code, _callback);
        return localVarCall;

    }

    /**
     *  Disable a Trading currency with a given currency code  
     *  Disable a Trading currency with a given currency code  
     * @param code  code Currency code  (required)
     * @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 pOSTCurrencyCodeDisable1(String code) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTCurrencyCodeDisable1WithHttpInfo(code);
        return localVarResp.getData();
    }

    /**
     *  Disable a Trading currency with a given currency code  
     *  Disable a Trading currency with a given currency code  
     * @param code  code Currency code  (required)
     * @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> pOSTCurrencyCodeDisable1WithHttpInfo(String code) throws ApiException {
        okhttp3.Call localVarCall = pOSTCurrencyCodeDisable1ValidateBeforeCall(code, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Disable a Trading currency with a given currency code   (asynchronously)
     *  Disable a Trading currency with a given currency code  
     * @param code  code Currency code  (required)
     * @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 pOSTCurrencyCodeDisable1Async(String code, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTCurrencyCodeDisable1ValidateBeforeCall(code, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTCurrencyCodeEnable1
     * @param code  code Currency code  (required)
     * @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 pOSTCurrencyCodeEnable1Call(String code, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/currency/{code}/enable"
            .replaceAll("\\{" + "code" + "\\}", localVarApiClient.escapeString(code.toString()));

        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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pOSTCurrencyCodeEnable1ValidateBeforeCall(String code, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'code' is set
        if (code == null) {
            throw new ApiException("Missing the required parameter 'code' when calling pOSTCurrencyCodeEnable1(Async)");
        }
        

        okhttp3.Call localVarCall = pOSTCurrencyCodeEnable1Call(code, _callback);
        return localVarCall;

    }

    /**
     *  Enable a Trading currency with a given currency code  
     *  Enable a Trading currency with a given currency code  
     * @param code  code Currency code  (required)
     * @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 pOSTCurrencyCodeEnable1(String code) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTCurrencyCodeEnable1WithHttpInfo(code);
        return localVarResp.getData();
    }

    /**
     *  Enable a Trading currency with a given currency code  
     *  Enable a Trading currency with a given currency code  
     * @param code  code Currency code  (required)
     * @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> pOSTCurrencyCodeEnable1WithHttpInfo(String code) throws ApiException {
        okhttp3.Call localVarCall = pOSTCurrencyCodeEnable1ValidateBeforeCall(code, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Enable a Trading currency with a given currency code   (asynchronously)
     *  Enable a Trading currency with a given currency code  
     * @param code  code Currency code  (required)
     * @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 pOSTCurrencyCodeEnable1Async(String code, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTCurrencyCodeEnable1ValidateBeforeCall(code, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTCurrencyCreate1
     * @param currencyDto  postData currency to be created  (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 pOSTCurrencyCreate1Call(CurrencyDto currencyDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = currencyDto;

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

        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 pOSTCurrencyCreate1ValidateBeforeCall(CurrencyDto currencyDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTCurrencyCreate1Call(currencyDto, _callback);
        return localVarCall;

    }

    /**
     *  Creates tradingCurrency base on currency code. If the currency code does not exists, a currency record is created  
     *  Creates tradingCurrency base on currency code. If the currency code does not exists, a currency record is created  
     * @param currencyDto  postData currency to be created  (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 pOSTCurrencyCreate1(CurrencyDto currencyDto) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTCurrencyCreate1WithHttpInfo(currencyDto);
        return localVarResp.getData();
    }

    /**
     *  Creates tradingCurrency base on currency code. If the currency code does not exists, a currency record is created  
     *  Creates tradingCurrency base on currency code. If the currency code does not exists, a currency record is created  
     * @param currencyDto  postData currency to be created  (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> pOSTCurrencyCreate1WithHttpInfo(CurrencyDto currencyDto) throws ApiException {
        okhttp3.Call localVarCall = pOSTCurrencyCreate1ValidateBeforeCall(currencyDto, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Creates tradingCurrency base on currency code. If the currency code does not exists, a currency record is created   (asynchronously)
     *  Creates tradingCurrency base on currency code. If the currency code does not exists, a currency record is created  
     * @param currencyDto  postData currency to be created  (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 pOSTCurrencyCreate1Async(CurrencyDto currencyDto, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTCurrencyCreate1ValidateBeforeCall(currencyDto, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTCurrencyCreateOrUpdate1
     * @param currencyDto  postData currency to be created or updated  (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 pOSTCurrencyCreateOrUpdate1Call(CurrencyDto currencyDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = currencyDto;

        // create path and map variables
        String localVarPath = "/currency/createOrUpdate";

        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 pOSTCurrencyCreateOrUpdate1ValidateBeforeCall(CurrencyDto currencyDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTCurrencyCreateOrUpdate1Call(currencyDto, _callback);
        return localVarCall;

    }

    /**
     *  Create or Update tradingCurrency base on currency code. If the currency code does not exists, a currency record is created 
     *  Create or Update tradingCurrency base on currency code. If the currency code does not exists, a currency record is created 
     * @param currencyDto  postData currency to be created or updated  (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 pOSTCurrencyCreateOrUpdate1(CurrencyDto currencyDto) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTCurrencyCreateOrUpdate1WithHttpInfo(currencyDto);
        return localVarResp.getData();
    }

    /**
     *  Create or Update tradingCurrency base on currency code. If the currency code does not exists, a currency record is created 
     *  Create or Update tradingCurrency base on currency code. If the currency code does not exists, a currency record is created 
     * @param currencyDto  postData currency to be created or updated  (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> pOSTCurrencyCreateOrUpdate1WithHttpInfo(CurrencyDto currencyDto) throws ApiException {
        okhttp3.Call localVarCall = pOSTCurrencyCreateOrUpdate1ValidateBeforeCall(currencyDto, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Create or Update tradingCurrency base on currency code. If the currency code does not exists, a currency record is created  (asynchronously)
     *  Create or Update tradingCurrency base on currency code. If the currency code does not exists, a currency record is created 
     * @param currencyDto  postData currency to be created or updated  (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 pOSTCurrencyCreateOrUpdate1Async(CurrencyDto currencyDto, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTCurrencyCreateOrUpdate1ValidateBeforeCall(currencyDto, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pUTCurrencyUpdate1
     * @param currencyDto  Modify a tradingCurrency. Same input eter as create. The currency and tradingCurrency are created if they don&#39;t exists. The operation fails if the tradingCurrency is null   (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 pUTCurrencyUpdate1Call(CurrencyDto currencyDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = currencyDto;

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

        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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pUTCurrencyUpdate1ValidateBeforeCall(CurrencyDto currencyDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pUTCurrencyUpdate1Call(currencyDto, _callback);
        return localVarCall;

    }

    /**
     *  Modify a tradingCurrency
     *  Modify a tradingCurrency. Same input parameter as create. The currency and tradingCurrency are created if they don&#39;t exists. The operation fails if the tradingCurrency is null  
     * @param currencyDto  Modify a tradingCurrency. Same input eter as create. The currency and tradingCurrency are created if they don&#39;t exists. The operation fails if the tradingCurrency is null   (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 pUTCurrencyUpdate1(CurrencyDto currencyDto) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pUTCurrencyUpdate1WithHttpInfo(currencyDto);
        return localVarResp.getData();
    }

    /**
     *  Modify a tradingCurrency
     *  Modify a tradingCurrency. Same input parameter as create. The currency and tradingCurrency are created if they don&#39;t exists. The operation fails if the tradingCurrency is null  
     * @param currencyDto  Modify a tradingCurrency. Same input eter as create. The currency and tradingCurrency are created if they don&#39;t exists. The operation fails if the tradingCurrency is null   (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> pUTCurrencyUpdate1WithHttpInfo(CurrencyDto currencyDto) throws ApiException {
        okhttp3.Call localVarCall = pUTCurrencyUpdate1ValidateBeforeCall(currencyDto, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Modify a tradingCurrency (asynchronously)
     *  Modify a tradingCurrency. Same input parameter as create. The currency and tradingCurrency are created if they don&#39;t exists. The operation fails if the tradingCurrency is null  
     * @param currencyDto  Modify a tradingCurrency. Same input eter as create. The currency and tradingCurrency are created if they don&#39;t exists. The operation fails if the tradingCurrency is null   (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 pUTCurrencyUpdate1Async(CurrencyDto currencyDto, final ApiCallback<ActionStatus> _callback) throws ApiException {

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

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

        okhttp3.Call localVarCall = user58Call(_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 user58() throws ApiException {
        ApiResponse<ActionStatus> localVarResp = user58WithHttpInfo();
        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> user58WithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = user58ValidateBeforeCall(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 user58Async(final ApiCallback<ActionStatus> _callback) throws ApiException {

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