/*
 * 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.AccountHierarchyDto;
import org.openapitools.client.model.ActionStatus;
import org.openapitools.client.model.CRMAccountHierarchyDto;
import org.openapitools.client.model.CustomerHierarchyDto;
import org.openapitools.client.model.CustomerListResponse;
import org.openapitools.client.model.FindAccountHierachyRequestDto;
import org.openapitools.client.model.GetAccountHierarchyResponseDto;

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

public class AccountHierarchyApi {
    private ApiClient localVarApiClient;

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

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

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

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

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

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

        okhttp3.Call localVarCall = gETIBaseVersion26Call(_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 gETIBaseVersion26() throws ApiException {
        ApiResponse<ActionStatus> localVarResp = gETIBaseVersion26WithHttpInfo();
        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> gETIBaseVersion26WithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = gETIBaseVersion26ValidateBeforeCall(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 gETIBaseVersion26Async(final ApiCallback<ActionStatus> _callback) throws ApiException {

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

        // create path and map variables
        String localVarPath = "/account/accountHierarchy";

        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 pOSTAccountHierarchyCreate1ValidateBeforeCall(AccountHierarchyDto accountHierarchyDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTAccountHierarchyCreate1Call(accountHierarchyDto, _callback);
        return localVarCall;

    }

    /**
     *  Create account hierarchy.  
     *  Create account hierarchy.  
     * @param accountHierarchyDto  accountHierarchyDto account hierarchy dto  (optional)
     * @return ActionStatus
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  action status  </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus pOSTAccountHierarchyCreate1(AccountHierarchyDto accountHierarchyDto) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTAccountHierarchyCreate1WithHttpInfo(accountHierarchyDto);
        return localVarResp.getData();
    }

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

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

        okhttp3.Call localVarCall = pOSTAccountHierarchyCreate1ValidateBeforeCall(accountHierarchyDto, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTAccountHierarchyCreateCRMAccountHierarchy1
     * @param crMAccountHierarchyDto  postData posted 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>  acion status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTAccountHierarchyCreateCRMAccountHierarchy1Call(CRMAccountHierarchyDto crMAccountHierarchyDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = crMAccountHierarchyDto;

        // create path and map variables
        String localVarPath = "/account/accountHierarchy/createCRMAccountHierarchy";

        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 pOSTAccountHierarchyCreateCRMAccountHierarchy1ValidateBeforeCall(CRMAccountHierarchyDto crMAccountHierarchyDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTAccountHierarchyCreateCRMAccountHierarchy1Call(crMAccountHierarchyDto, _callback);
        return localVarCall;

    }

    /**
     *  Create a CRMAccountHerarchy. 
     *  Create a CRMAccountHerarchy. 
     * @param crMAccountHierarchyDto  postData posted 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>  acion status  </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus pOSTAccountHierarchyCreateCRMAccountHierarchy1(CRMAccountHierarchyDto crMAccountHierarchyDto) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTAccountHierarchyCreateCRMAccountHierarchy1WithHttpInfo(crMAccountHierarchyDto);
        return localVarResp.getData();
    }

    /**
     *  Create a CRMAccountHerarchy. 
     *  Create a CRMAccountHerarchy. 
     * @param crMAccountHierarchyDto  postData posted 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>  acion status  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> pOSTAccountHierarchyCreateCRMAccountHierarchy1WithHttpInfo(CRMAccountHierarchyDto crMAccountHierarchyDto) throws ApiException {
        okhttp3.Call localVarCall = pOSTAccountHierarchyCreateCRMAccountHierarchy1ValidateBeforeCall(crMAccountHierarchyDto, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Create a CRMAccountHerarchy.  (asynchronously)
     *  Create a CRMAccountHerarchy. 
     * @param crMAccountHierarchyDto  postData posted 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>  acion status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTAccountHierarchyCreateCRMAccountHierarchy1Async(CRMAccountHierarchyDto crMAccountHierarchyDto, final ApiCallback<ActionStatus> _callback) throws ApiException {

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

        // create path and map variables
        String localVarPath = "/account/accountHierarchy/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 pOSTAccountHierarchyCreateOrUpdate1ValidateBeforeCall(AccountHierarchyDto accountHierarchyDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTAccountHierarchyCreateOrUpdate1Call(accountHierarchyDto, _callback);
        return localVarCall;

    }

    /**
     *  Create or update Account Hierarchy based on code.  
     *  Create or update Account Hierarchy based on code.  
     * @param accountHierarchyDto  accountHierarchyDto account hierarchy dto.  (optional)
     * @return ActionStatus
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  action status.  </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus pOSTAccountHierarchyCreateOrUpdate1(AccountHierarchyDto accountHierarchyDto) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTAccountHierarchyCreateOrUpdate1WithHttpInfo(accountHierarchyDto);
        return localVarResp.getData();
    }

    /**
     *  Create or update Account Hierarchy based on code.  
     *  Create or update Account Hierarchy based on code.  
     * @param accountHierarchyDto  accountHierarchyDto account hierarchy dto.  (optional)
     * @return ApiResponse&lt;ActionStatus&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  action status.  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> pOSTAccountHierarchyCreateOrUpdate1WithHttpInfo(AccountHierarchyDto accountHierarchyDto) throws ApiException {
        okhttp3.Call localVarCall = pOSTAccountHierarchyCreateOrUpdate1ValidateBeforeCall(accountHierarchyDto, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Create or update Account Hierarchy based on code.   (asynchronously)
     *  Create or update Account Hierarchy based on code.  
     * @param accountHierarchyDto  accountHierarchyDto account hierarchy dto.  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  action status.  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTAccountHierarchyCreateOrUpdate1Async(AccountHierarchyDto accountHierarchyDto, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTAccountHierarchyCreateOrUpdate1ValidateBeforeCall(accountHierarchyDto, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTAccountHierarchyCreateOrUpdateCRMAccountHierarchy1
     * @param crMAccountHierarchyDto  postData posted 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>  acion status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTAccountHierarchyCreateOrUpdateCRMAccountHierarchy1Call(CRMAccountHierarchyDto crMAccountHierarchyDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = crMAccountHierarchyDto;

        // create path and map variables
        String localVarPath = "/account/accountHierarchy/createOrUpdateCRMAccountHierarchy";

        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 pOSTAccountHierarchyCreateOrUpdateCRMAccountHierarchy1ValidateBeforeCall(CRMAccountHierarchyDto crMAccountHierarchyDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTAccountHierarchyCreateOrUpdateCRMAccountHierarchy1Call(crMAccountHierarchyDto, _callback);
        return localVarCall;

    }

    /**
     *  Create or update a CRM Account Hierarchy. 
     *  Create or update a CRM Account Hierarchy. 
     * @param crMAccountHierarchyDto  postData posted 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>  acion status  </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus pOSTAccountHierarchyCreateOrUpdateCRMAccountHierarchy1(CRMAccountHierarchyDto crMAccountHierarchyDto) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTAccountHierarchyCreateOrUpdateCRMAccountHierarchy1WithHttpInfo(crMAccountHierarchyDto);
        return localVarResp.getData();
    }

    /**
     *  Create or update a CRM Account Hierarchy. 
     *  Create or update a CRM Account Hierarchy. 
     * @param crMAccountHierarchyDto  postData posted 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>  acion status  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> pOSTAccountHierarchyCreateOrUpdateCRMAccountHierarchy1WithHttpInfo(CRMAccountHierarchyDto crMAccountHierarchyDto) throws ApiException {
        okhttp3.Call localVarCall = pOSTAccountHierarchyCreateOrUpdateCRMAccountHierarchy1ValidateBeforeCall(crMAccountHierarchyDto, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Create or update a CRM Account Hierarchy.  (asynchronously)
     *  Create or update a CRM Account Hierarchy. 
     * @param crMAccountHierarchyDto  postData posted 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>  acion status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTAccountHierarchyCreateOrUpdateCRMAccountHierarchy1Async(CRMAccountHierarchyDto crMAccountHierarchyDto, final ApiCallback<ActionStatus> _callback) throws ApiException {

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

        // create path and map variables
        String localVarPath = "/account/accountHierarchy/customerHierarchyUpdate";

        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 pOSTAccountHierarchyCustomerHierarchyUpdate1ValidateBeforeCall(CustomerHierarchyDto customerHierarchyDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTAccountHierarchyCustomerHierarchyUpdate1Call(customerHierarchyDto, _callback);
        return localVarCall;

    }

    /**
     *  This service allows to create / update (if exist already) and close / terminate (if termination date is set) a list of customer, customer accounts, billing accounts, user accounts, subscriptions, services, and access in one transaction
     *  This service allows to create / update (if exist already) and close / terminate (if termination date is set) a list of customer, customer accounts, billing accounts, user accounts, subscriptions, services, and access in one transaction. It can activate and terminate subscription and service instance. Close customer account. Terminate billing and user account.  
     * @param customerHierarchyDto  postData posted 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>  action status.  </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus pOSTAccountHierarchyCustomerHierarchyUpdate1(CustomerHierarchyDto customerHierarchyDto) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTAccountHierarchyCustomerHierarchyUpdate1WithHttpInfo(customerHierarchyDto);
        return localVarResp.getData();
    }

    /**
     *  This service allows to create / update (if exist already) and close / terminate (if termination date is set) a list of customer, customer accounts, billing accounts, user accounts, subscriptions, services, and access in one transaction
     *  This service allows to create / update (if exist already) and close / terminate (if termination date is set) a list of customer, customer accounts, billing accounts, user accounts, subscriptions, services, and access in one transaction. It can activate and terminate subscription and service instance. Close customer account. Terminate billing and user account.  
     * @param customerHierarchyDto  postData posted 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>  action status.  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> pOSTAccountHierarchyCustomerHierarchyUpdate1WithHttpInfo(CustomerHierarchyDto customerHierarchyDto) throws ApiException {
        okhttp3.Call localVarCall = pOSTAccountHierarchyCustomerHierarchyUpdate1ValidateBeforeCall(customerHierarchyDto, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  This service allows to create / update (if exist already) and close / terminate (if termination date is set) a list of customer, customer accounts, billing accounts, user accounts, subscriptions, services, and access in one transaction (asynchronously)
     *  This service allows to create / update (if exist already) and close / terminate (if termination date is set) a list of customer, customer accounts, billing accounts, user accounts, subscriptions, services, and access in one transaction. It can activate and terminate subscription and service instance. Close customer account. Terminate billing and user account.  
     * @param customerHierarchyDto  postData posted data  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  action status.  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTAccountHierarchyCustomerHierarchyUpdate1Async(CustomerHierarchyDto customerHierarchyDto, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTAccountHierarchyCustomerHierarchyUpdate1ValidateBeforeCall(customerHierarchyDto, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTAccountHierarchyFind1
     * @param calculateBalances  calculateBalances  true if needs  to calculate balances  (optional)
     * @param accountHierarchyDto  customerDto customer dto  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  customer list.  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTAccountHierarchyFind1Call(Boolean calculateBalances, AccountHierarchyDto accountHierarchyDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = accountHierarchyDto;

        // create path and map variables
        String localVarPath = "/account/accountHierarchy/find";

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

        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 pOSTAccountHierarchyFind1ValidateBeforeCall(Boolean calculateBalances, AccountHierarchyDto accountHierarchyDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTAccountHierarchyFind1Call(calculateBalances, accountHierarchyDto, _callback);
        return localVarCall;

    }

    /**
     *  Search for a list of customer accounts given a set of filter. 
     *  Search for a list of customer accounts given a set of filter. 
     * @param calculateBalances  calculateBalances  true if needs  to calculate balances  (optional)
     * @param accountHierarchyDto  customerDto customer dto  (optional)
     * @return CustomerListResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  customer list.  </td><td>  -  </td></tr>
     </table>
     */
    public CustomerListResponse pOSTAccountHierarchyFind1(Boolean calculateBalances, AccountHierarchyDto accountHierarchyDto) throws ApiException {
        ApiResponse<CustomerListResponse> localVarResp = pOSTAccountHierarchyFind1WithHttpInfo(calculateBalances, accountHierarchyDto);
        return localVarResp.getData();
    }

    /**
     *  Search for a list of customer accounts given a set of filter. 
     *  Search for a list of customer accounts given a set of filter. 
     * @param calculateBalances  calculateBalances  true if needs  to calculate balances  (optional)
     * @param accountHierarchyDto  customerDto customer dto  (optional)
     * @return ApiResponse&lt;CustomerListResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  customer list.  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<CustomerListResponse> pOSTAccountHierarchyFind1WithHttpInfo(Boolean calculateBalances, AccountHierarchyDto accountHierarchyDto) throws ApiException {
        okhttp3.Call localVarCall = pOSTAccountHierarchyFind1ValidateBeforeCall(calculateBalances, accountHierarchyDto, null);
        Type localVarReturnType = new TypeToken<CustomerListResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Search for a list of customer accounts given a set of filter.  (asynchronously)
     *  Search for a list of customer accounts given a set of filter. 
     * @param calculateBalances  calculateBalances  true if needs  to calculate balances  (optional)
     * @param accountHierarchyDto  customerDto customer dto  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  customer list.  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTAccountHierarchyFind1Async(Boolean calculateBalances, AccountHierarchyDto accountHierarchyDto, final ApiCallback<CustomerListResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTAccountHierarchyFind1ValidateBeforeCall(calculateBalances, accountHierarchyDto, _callback);
        Type localVarReturnType = new TypeToken<CustomerListResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTAccountHierarchyFindAccountHierarchy1
     * @param findAccountHierachyRequestDto  postData posted data to API  (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>  account hieracy response.  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTAccountHierarchyFindAccountHierarchy1Call(FindAccountHierachyRequestDto findAccountHierachyRequestDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = findAccountHierachyRequestDto;

        // create path and map variables
        String localVarPath = "/account/accountHierarchy/findAccountHierarchy";

        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 pOSTAccountHierarchyFindAccountHierarchy1ValidateBeforeCall(FindAccountHierachyRequestDto findAccountHierachyRequestDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTAccountHierarchyFindAccountHierarchy1Call(findAccountHierachyRequestDto, _callback);
        return localVarCall;

    }

    /**
     *  Is an update of findAccountHierarchy wherein the user can search on 1 or multiple levels of the hierarchy in 1 search
     *  Is an update of findAccountHierarchy wherein the user can search on 1 or multiple levels of the hierarchy in 1 search. These are the modes that can be combined by using bitwise - or |. Example: If we search on level&#x3D;BA for lastName&#x3D;legaspi and found a match, the search will return the hierarchy from BA to CUST. If we search on level&#x3D;UA for address1&#x3D;my_address and found a match, the search will return the hierarchy from UA to CUST., notes &#x3D; CUST &#x3D; 1, CA &#x3D; 2, BA &#x3D; 4, UA &#x3D; 8. 
     * @param findAccountHierachyRequestDto  postData posted data to API  (optional)
     * @return GetAccountHierarchyResponseDto
     * @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>  account hieracy response.  </td><td>  -  </td></tr>
     </table>
     */
    public GetAccountHierarchyResponseDto pOSTAccountHierarchyFindAccountHierarchy1(FindAccountHierachyRequestDto findAccountHierachyRequestDto) throws ApiException {
        ApiResponse<GetAccountHierarchyResponseDto> localVarResp = pOSTAccountHierarchyFindAccountHierarchy1WithHttpInfo(findAccountHierachyRequestDto);
        return localVarResp.getData();
    }

    /**
     *  Is an update of findAccountHierarchy wherein the user can search on 1 or multiple levels of the hierarchy in 1 search
     *  Is an update of findAccountHierarchy wherein the user can search on 1 or multiple levels of the hierarchy in 1 search. These are the modes that can be combined by using bitwise - or |. Example: If we search on level&#x3D;BA for lastName&#x3D;legaspi and found a match, the search will return the hierarchy from BA to CUST. If we search on level&#x3D;UA for address1&#x3D;my_address and found a match, the search will return the hierarchy from UA to CUST., notes &#x3D; CUST &#x3D; 1, CA &#x3D; 2, BA &#x3D; 4, UA &#x3D; 8. 
     * @param findAccountHierachyRequestDto  postData posted data to API  (optional)
     * @return ApiResponse&lt;GetAccountHierarchyResponseDto&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>  account hieracy response.  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<GetAccountHierarchyResponseDto> pOSTAccountHierarchyFindAccountHierarchy1WithHttpInfo(FindAccountHierachyRequestDto findAccountHierachyRequestDto) throws ApiException {
        okhttp3.Call localVarCall = pOSTAccountHierarchyFindAccountHierarchy1ValidateBeforeCall(findAccountHierachyRequestDto, null);
        Type localVarReturnType = new TypeToken<GetAccountHierarchyResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Is an update of findAccountHierarchy wherein the user can search on 1 or multiple levels of the hierarchy in 1 search (asynchronously)
     *  Is an update of findAccountHierarchy wherein the user can search on 1 or multiple levels of the hierarchy in 1 search. These are the modes that can be combined by using bitwise - or |. Example: If we search on level&#x3D;BA for lastName&#x3D;legaspi and found a match, the search will return the hierarchy from BA to CUST. If we search on level&#x3D;UA for address1&#x3D;my_address and found a match, the search will return the hierarchy from UA to CUST., notes &#x3D; CUST &#x3D; 1, CA &#x3D; 2, BA &#x3D; 4, UA &#x3D; 8. 
     * @param findAccountHierachyRequestDto  postData posted data to API  (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>  account hieracy response.  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTAccountHierarchyFindAccountHierarchy1Async(FindAccountHierachyRequestDto findAccountHierachyRequestDto, final ApiCallback<GetAccountHierarchyResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTAccountHierarchyFindAccountHierarchy1ValidateBeforeCall(findAccountHierachyRequestDto, _callback);
        Type localVarReturnType = new TypeToken<GetAccountHierarchyResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTAccountHierarchyUpdateCRMAccountHierarchy1
     * @param crMAccountHierarchyDto  postData posted 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>  acion status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTAccountHierarchyUpdateCRMAccountHierarchy1Call(CRMAccountHierarchyDto crMAccountHierarchyDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = crMAccountHierarchyDto;

        // create path and map variables
        String localVarPath = "/account/accountHierarchy/updateCRMAccountHierarchy";

        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 pOSTAccountHierarchyUpdateCRMAccountHierarchy1ValidateBeforeCall(CRMAccountHierarchyDto crMAccountHierarchyDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTAccountHierarchyUpdateCRMAccountHierarchy1Call(crMAccountHierarchyDto, _callback);
        return localVarCall;

    }

    /**
     *  Update a CRM Account HerarHierarchychy. 
     *  Update a CRM Account HerarHierarchychy. 
     * @param crMAccountHierarchyDto  postData posted 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>  acion status  </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus pOSTAccountHierarchyUpdateCRMAccountHierarchy1(CRMAccountHierarchyDto crMAccountHierarchyDto) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTAccountHierarchyUpdateCRMAccountHierarchy1WithHttpInfo(crMAccountHierarchyDto);
        return localVarResp.getData();
    }

    /**
     *  Update a CRM Account HerarHierarchychy. 
     *  Update a CRM Account HerarHierarchychy. 
     * @param crMAccountHierarchyDto  postData posted 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>  acion status  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> pOSTAccountHierarchyUpdateCRMAccountHierarchy1WithHttpInfo(CRMAccountHierarchyDto crMAccountHierarchyDto) throws ApiException {
        okhttp3.Call localVarCall = pOSTAccountHierarchyUpdateCRMAccountHierarchy1ValidateBeforeCall(crMAccountHierarchyDto, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Update a CRM Account HerarHierarchychy.  (asynchronously)
     *  Update a CRM Account HerarHierarchychy. 
     * @param crMAccountHierarchyDto  postData posted 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>  acion status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTAccountHierarchyUpdateCRMAccountHierarchy1Async(CRMAccountHierarchyDto crMAccountHierarchyDto, final ApiCallback<ActionStatus> _callback) throws ApiException {

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

        // create path and map variables
        String localVarPath = "/account/accountHierarchy";

        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 pUTAccountHierarchyUpdate1ValidateBeforeCall(AccountHierarchyDto accountHierarchyDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pUTAccountHierarchyUpdate1Call(accountHierarchyDto, _callback);
        return localVarCall;

    }

    /**
     *  Update account hierarchy.  
     *  Update account hierarchy.  
     * @param accountHierarchyDto  accountHierarchyDto account hierachy dto  (optional)
     * @return ActionStatus
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  action status  </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus pUTAccountHierarchyUpdate1(AccountHierarchyDto accountHierarchyDto) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pUTAccountHierarchyUpdate1WithHttpInfo(accountHierarchyDto);
        return localVarResp.getData();
    }

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

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

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

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

        okhttp3.Call localVarCall = user1Call(_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 user1() throws ApiException {
        ApiResponse<ActionStatus> localVarResp = user1WithHttpInfo();
        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> user1WithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = user1ValidateBeforeCall(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 user1Async(final ApiCallback<ActionStatus> _callback) throws ApiException {

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