/*
 * Cloudera Manager API
 * <h1>Cloudera Manager API v57</h1>       <p>Introduced in Cloudera Manager 7.13.1</p>       <p><a href=\"http://www.cloudera.com/documentation.html\">Cloudera Product Documentation</a></p>
 *
 * OpenAPI spec version: 7.13.1
 * 
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */

package com.cloudera.api.swagger;

import com.cloudera.api.swagger.client.ApiCallback;
import com.cloudera.api.swagger.client.ApiClient;
import com.cloudera.api.swagger.client.ApiException;
import com.cloudera.api.swagger.client.ApiResponse;
import com.cloudera.api.swagger.client.Configuration;
import com.cloudera.api.swagger.client.Pair;
import com.cloudera.api.swagger.client.ProgressRequestBody;
import com.cloudera.api.swagger.client.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import com.cloudera.api.swagger.model.ApiAddCustomCertsArguments;
import com.cloudera.api.swagger.model.ApiClusterNameList;
import com.cloudera.api.swagger.model.ApiClusterSupportTokenList;
import com.cloudera.api.swagger.model.ApiClusterTemplate;
import com.cloudera.api.swagger.model.ApiClustersPerfInspectorArgs;
import com.cloudera.api.swagger.model.ApiCmServer;
import com.cloudera.api.swagger.model.ApiCmServerList;
import com.cloudera.api.swagger.model.ApiCollectDiagnosticDataArguments;
import com.cloudera.api.swagger.model.ApiCommand;
import com.cloudera.api.swagger.model.ApiCommandList;
import com.cloudera.api.swagger.model.ApiConfigList;
import com.cloudera.api.swagger.model.ApiConfigPolicy;
import com.cloudera.api.swagger.model.ApiDeployment2;
import com.cloudera.api.swagger.model.ApiEnableCspArguments;
import com.cloudera.api.swagger.model.ApiGenerateCmcaArguments;
import com.cloudera.api.swagger.model.ApiHostInstallArguments;
import com.cloudera.api.swagger.model.ApiHostNameList;
import com.cloudera.api.swagger.model.ApiHostsPerfInspectorArgs;
import com.cloudera.api.swagger.model.ApiKerberosInfo;
import com.cloudera.api.swagger.model.ApiLicense;
import com.cloudera.api.swagger.model.ApiLicensedFeatureUsage;
import com.cloudera.api.swagger.model.ApiPrincipalList;
import com.cloudera.api.swagger.model.ApiScmDbInfo;
import com.cloudera.api.swagger.model.ApiShutdownReadiness;
import com.cloudera.api.swagger.model.ApiStringList;
import com.cloudera.api.swagger.model.ApiTestCmExternalAuthArguments;
import com.cloudera.api.swagger.model.ApiUpdateCspTypeArguments;
import com.cloudera.api.swagger.model.ApiUpdateGlobalTruststoreArguments;
import com.cloudera.api.swagger.model.ApiVersionInfo;
import java.io.File;

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

public class ClouderaManagerResourceApi {
    private ApiClient apiClient;

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

    public ClouderaManagerResourceApi(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return apiClient;
    }

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

    /**
     * Build call for addConfigPolicy
     * @param body  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call addConfigPolicyCall(ApiConfigPolicy body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/configPolicies";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call addConfigPolicyValidateBeforeCall(ApiConfigPolicy body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = addConfigPolicyCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * 
     * 
     * @param body  (optional)
     * @return ApiConfigPolicy
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiConfigPolicy addConfigPolicy(ApiConfigPolicy body) throws ApiException {
        ApiResponse<ApiConfigPolicy> resp = addConfigPolicyWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * 
     * 
     * @param body  (optional)
     * @return ApiResponse&lt;ApiConfigPolicy&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiConfigPolicy> addConfigPolicyWithHttpInfo(ApiConfigPolicy body) throws ApiException {
        okhttp3.Call call = addConfigPolicyValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<ApiConfigPolicy>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     *  (asynchronously)
     * 
     * @param body  (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
     */
    public okhttp3.Call addConfigPolicyAsync(ApiConfigPolicy body, final ApiCallback<ApiConfigPolicy> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = addConfigPolicyValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiConfigPolicy>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for addCustomCerts
     * @param body  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call addCustomCertsCall(ApiAddCustomCertsArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/commands/addCustomCerts";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call addCustomCertsValidateBeforeCall(ApiAddCustomCertsArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = addCustomCertsCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Add custom certificates to the Auto-TLS certificate database.
     * Add custom certificates to the Auto-TLS certificate database
     * @param body  (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand addCustomCerts(ApiAddCustomCertsArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = addCustomCertsWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Add custom certificates to the Auto-TLS certificate database.
     * Add custom certificates to the Auto-TLS certificate database
     * @param body  (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> addCustomCertsWithHttpInfo(ApiAddCustomCertsArguments body) throws ApiException {
        okhttp3.Call call = addCustomCertsValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Add custom certificates to the Auto-TLS certificate database. (asynchronously)
     * Add custom certificates to the Auto-TLS certificate database
     * @param body  (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
     */
    public okhttp3.Call addCustomCertsAsync(ApiAddCustomCertsArguments body, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = addCustomCertsValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for beginTrial
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call beginTrialCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/trial/begin";

        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 = {
            
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call beginTrialValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = beginTrialCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * Begin trial license.
     * Begin trial license.
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void beginTrial() throws ApiException {
        beginTrialWithHttpInfo();
    }

    /**
     * Begin trial license.
     * Begin trial license.
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Void> beginTrialWithHttpInfo() throws ApiException {
        okhttp3.Call call = beginTrialValidateBeforeCall(null, null);
        return apiClient.execute(call);
    }

    /**
     * Begin trial license. (asynchronously)
     * Begin trial license.
     * @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
     */
    public okhttp3.Call beginTrialAsync(final ApiCallback<Void> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = beginTrialValidateBeforeCall(progressListener, progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }
    /**
     * Build call for clustersPerfInspectorCommand
     * @param body Required arguments for the command. See ApiClustersPerfInspectorArgs. (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call clustersPerfInspectorCommandCall(ApiClustersPerfInspectorArgs body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/commands/clustersPerfInspector";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call clustersPerfInspectorCommandValidateBeforeCall(ApiClustersPerfInspectorArgs body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = clustersPerfInspectorCommandCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Run performance diagnostics test against specified clusters in ApiClustersPerfInspectorArgs  User must be Full Administrator or Global Cluster Administrator.
     * Run performance diagnostics test against specified clusters in ApiClustersPerfInspectorArgs  User must be Full Administrator or Global Cluster Administrator.
     * @param body Required arguments for the command. See ApiClustersPerfInspectorArgs. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand clustersPerfInspectorCommand(ApiClustersPerfInspectorArgs body) throws ApiException {
        ApiResponse<ApiCommand> resp = clustersPerfInspectorCommandWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Run performance diagnostics test against specified clusters in ApiClustersPerfInspectorArgs  User must be Full Administrator or Global Cluster Administrator.
     * Run performance diagnostics test against specified clusters in ApiClustersPerfInspectorArgs  User must be Full Administrator or Global Cluster Administrator.
     * @param body Required arguments for the command. See ApiClustersPerfInspectorArgs. (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> clustersPerfInspectorCommandWithHttpInfo(ApiClustersPerfInspectorArgs body) throws ApiException {
        okhttp3.Call call = clustersPerfInspectorCommandValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Run performance diagnostics test against specified clusters in ApiClustersPerfInspectorArgs  User must be Full Administrator or Global Cluster Administrator. (asynchronously)
     * Run performance diagnostics test against specified clusters in ApiClustersPerfInspectorArgs  User must be Full Administrator or Global Cluster Administrator.
     * @param body Required arguments for the command. See ApiClustersPerfInspectorArgs. (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
     */
    public okhttp3.Call clustersPerfInspectorCommandAsync(ApiClustersPerfInspectorArgs body, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = clustersPerfInspectorCommandValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for collectDiagnosticDataCommand
     * @param body The command arguments. (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call collectDiagnosticDataCommandCall(ApiCollectDiagnosticDataArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/commands/collectDiagnosticData";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call collectDiagnosticDataCommandValidateBeforeCall(ApiCollectDiagnosticDataArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = collectDiagnosticDataCommandCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Collect diagnostic data from hosts managed by Cloudera Manager.
     * Collect diagnostic data from hosts managed by Cloudera Manager. &lt;p&gt; After the command has completed, the ApiCommand will contain a resultDataUrl from where you can download the result. &lt;p/&gt; Only available with Cloudera Manager Enterprise Edition.
     * @param body The command arguments. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand collectDiagnosticDataCommand(ApiCollectDiagnosticDataArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = collectDiagnosticDataCommandWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Collect diagnostic data from hosts managed by Cloudera Manager.
     * Collect diagnostic data from hosts managed by Cloudera Manager. &lt;p&gt; After the command has completed, the ApiCommand will contain a resultDataUrl from where you can download the result. &lt;p/&gt; Only available with Cloudera Manager Enterprise Edition.
     * @param body The command arguments. (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> collectDiagnosticDataCommandWithHttpInfo(ApiCollectDiagnosticDataArguments body) throws ApiException {
        okhttp3.Call call = collectDiagnosticDataCommandValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Collect diagnostic data from hosts managed by Cloudera Manager. (asynchronously)
     * Collect diagnostic data from hosts managed by Cloudera Manager. &lt;p&gt; After the command has completed, the ApiCommand will contain a resultDataUrl from where you can download the result. &lt;p/&gt; Only available with Cloudera Manager Enterprise Edition.
     * @param body The command arguments. (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
     */
    public okhttp3.Call collectDiagnosticDataCommandAsync(ApiCollectDiagnosticDataArguments body, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = collectDiagnosticDataCommandValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for deleteConfigPolicy
     * @param name  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call deleteConfigPolicyCall(String name, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/configPolicies";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (name != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("name", name));

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call deleteConfigPolicyValidateBeforeCall(String name, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = deleteConfigPolicyCall(name, progressListener, progressRequestListener);
        return call;

    }

    /**
     * 
     * 
     * @param name  (optional)
     * @return ApiConfigPolicy
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiConfigPolicy deleteConfigPolicy(String name) throws ApiException {
        ApiResponse<ApiConfigPolicy> resp = deleteConfigPolicyWithHttpInfo(name);
        return resp.getData();
    }

    /**
     * 
     * 
     * @param name  (optional)
     * @return ApiResponse&lt;ApiConfigPolicy&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiConfigPolicy> deleteConfigPolicyWithHttpInfo(String name) throws ApiException {
        okhttp3.Call call = deleteConfigPolicyValidateBeforeCall(name, null, null);
        Type localVarReturnType = new TypeToken<ApiConfigPolicy>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     *  (asynchronously)
     * 
     * @param name  (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
     */
    public okhttp3.Call deleteConfigPolicyAsync(String name, final ApiCallback<ApiConfigPolicy> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = deleteConfigPolicyValidateBeforeCall(name, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiConfigPolicy>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for deleteCredentialsCommand
     * @param deleteCredentialsMode this can be set to \&quot;all\&quot; or \&quot;unused\&quot; (optional, default to all)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call deleteCredentialsCommandCall(String deleteCredentialsMode, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/commands/deleteCredentials";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (deleteCredentialsMode != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("deleteCredentialsMode", deleteCredentialsMode));

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call deleteCredentialsCommandValidateBeforeCall(String deleteCredentialsMode, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = deleteCredentialsCommandCall(deleteCredentialsMode, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Delete existing Kerberos credentials.
     * Delete existing Kerberos credentials. &lt;p&gt; This command will affect all services that have been configured to use Kerberos, and have existing credentials. In V18 this takes a new paramater to determine whether it needs to delete all credentials or just unused ones.
     * @param deleteCredentialsMode this can be set to \&quot;all\&quot; or \&quot;unused\&quot; (optional, default to all)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand deleteCredentialsCommand(String deleteCredentialsMode) throws ApiException {
        ApiResponse<ApiCommand> resp = deleteCredentialsCommandWithHttpInfo(deleteCredentialsMode);
        return resp.getData();
    }

    /**
     * Delete existing Kerberos credentials.
     * Delete existing Kerberos credentials. &lt;p&gt; This command will affect all services that have been configured to use Kerberos, and have existing credentials. In V18 this takes a new paramater to determine whether it needs to delete all credentials or just unused ones.
     * @param deleteCredentialsMode this can be set to \&quot;all\&quot; or \&quot;unused\&quot; (optional, default to all)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> deleteCredentialsCommandWithHttpInfo(String deleteCredentialsMode) throws ApiException {
        okhttp3.Call call = deleteCredentialsCommandValidateBeforeCall(deleteCredentialsMode, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Delete existing Kerberos credentials. (asynchronously)
     * Delete existing Kerberos credentials. &lt;p&gt; This command will affect all services that have been configured to use Kerberos, and have existing credentials. In V18 this takes a new paramater to determine whether it needs to delete all credentials or just unused ones.
     * @param deleteCredentialsMode this can be set to \&quot;all\&quot; or \&quot;unused\&quot; (optional, default to all)
     * @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
     */
    public okhttp3.Call deleteCredentialsCommandAsync(String deleteCredentialsMode, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = deleteCredentialsCommandValidateBeforeCall(deleteCredentialsMode, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for deleteInstances
     * @param body  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call deleteInstancesCall(ApiStringList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/deleteInstances";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call deleteInstancesValidateBeforeCall(ApiStringList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = deleteInstancesCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Remove a list of cm servers from ha cluster.
     * Remove a list of cm servers from ha cluster.  &lt;p&gt; Available since API v49. Removes instances of cm server. &lt;/p&gt;
     * @param body  (optional)
     * @return ApiCmServerList
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCmServerList deleteInstances(ApiStringList body) throws ApiException {
        ApiResponse<ApiCmServerList> resp = deleteInstancesWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Remove a list of cm servers from ha cluster.
     * Remove a list of cm servers from ha cluster.  &lt;p&gt; Available since API v49. Removes instances of cm server. &lt;/p&gt;
     * @param body  (optional)
     * @return ApiResponse&lt;ApiCmServerList&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCmServerList> deleteInstancesWithHttpInfo(ApiStringList body) throws ApiException {
        okhttp3.Call call = deleteInstancesValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<ApiCmServerList>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Remove a list of cm servers from ha cluster. (asynchronously)
     * Remove a list of cm servers from ha cluster.  &lt;p&gt; Available since API v49. Removes instances of cm server. &lt;/p&gt;
     * @param body  (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
     */
    public okhttp3.Call deleteInstancesAsync(ApiStringList body, final ApiCallback<ApiCmServerList> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = deleteInstancesValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCmServerList>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for disableCsp
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call disableCspCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/commands/disableCsp";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call disableCspValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = disableCspCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * Disables the CSP by setting csp type to \&quot;none\&quot;, only when currently the csp type is either \&quot;embedded\&quot; or \&quot;vault\&quot;.
     * Disables the CSP by setting csp type to \&quot;none\&quot;, only when currently the csp type is either \&quot;embedded\&quot; or \&quot;vault\&quot;. This will decrypt the encrypted configurations and disable the use of Credential Storage Provider.
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand disableCsp() throws ApiException {
        ApiResponse<ApiCommand> resp = disableCspWithHttpInfo();
        return resp.getData();
    }

    /**
     * Disables the CSP by setting csp type to \&quot;none\&quot;, only when currently the csp type is either \&quot;embedded\&quot; or \&quot;vault\&quot;.
     * Disables the CSP by setting csp type to \&quot;none\&quot;, only when currently the csp type is either \&quot;embedded\&quot; or \&quot;vault\&quot;. This will decrypt the encrypted configurations and disable the use of Credential Storage Provider.
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> disableCspWithHttpInfo() throws ApiException {
        okhttp3.Call call = disableCspValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Disables the CSP by setting csp type to \&quot;none\&quot;, only when currently the csp type is either \&quot;embedded\&quot; or \&quot;vault\&quot;. (asynchronously)
     * Disables the CSP by setting csp type to \&quot;none\&quot;, only when currently the csp type is either \&quot;embedded\&quot; or \&quot;vault\&quot;. This will decrypt the encrypted configurations and disable the use of Credential Storage Provider.
     * @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
     */
    public okhttp3.Call disableCspAsync(final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = disableCspValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for enableCsp
     * @param body  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call enableCspCall(ApiEnableCspArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/commands/enableCsp";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call enableCspValidateBeforeCall(ApiEnableCspArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = enableCspCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Enables the CSP by setting csp type to \&quot;vault\&quot; or \&quot;embedded\&quot; as chosen by the user.
     * Enables the CSP by setting csp type to \&quot;vault\&quot; or \&quot;embedded\&quot; as chosen by the user.
     * @param body  (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand enableCsp(ApiEnableCspArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = enableCspWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Enables the CSP by setting csp type to \&quot;vault\&quot; or \&quot;embedded\&quot; as chosen by the user.
     * Enables the CSP by setting csp type to \&quot;vault\&quot; or \&quot;embedded\&quot; as chosen by the user.
     * @param body  (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> enableCspWithHttpInfo(ApiEnableCspArguments body) throws ApiException {
        okhttp3.Call call = enableCspValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Enables the CSP by setting csp type to \&quot;vault\&quot; or \&quot;embedded\&quot; as chosen by the user. (asynchronously)
     * Enables the CSP by setting csp type to \&quot;vault\&quot; or \&quot;embedded\&quot; as chosen by the user.
     * @param body  (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
     */
    public okhttp3.Call enableCspAsync(ApiEnableCspArguments body, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = enableCspValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for endTrial
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call endTrialCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/trial/end";

        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 = {
            
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call endTrialValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = endTrialCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * End trial license.
     * End trial license.
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void endTrial() throws ApiException {
        endTrialWithHttpInfo();
    }

    /**
     * End trial license.
     * End trial license.
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Void> endTrialWithHttpInfo() throws ApiException {
        okhttp3.Call call = endTrialValidateBeforeCall(null, null);
        return apiClient.execute(call);
    }

    /**
     * End trial license. (asynchronously)
     * End trial license.
     * @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
     */
    public okhttp3.Call endTrialAsync(final ApiCallback<Void> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = endTrialValidateBeforeCall(progressListener, progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }
    /**
     * Build call for generateCmca
     * @param body  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call generateCmcaCall(ApiGenerateCmcaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/commands/generateCmca";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call generateCmcaValidateBeforeCall(ApiGenerateCmcaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = generateCmcaCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Generate a CMCA.
     * Generate a CMCA
     * @param body  (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand generateCmca(ApiGenerateCmcaArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = generateCmcaWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Generate a CMCA.
     * Generate a CMCA
     * @param body  (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> generateCmcaWithHttpInfo(ApiGenerateCmcaArguments body) throws ApiException {
        okhttp3.Call call = generateCmcaValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Generate a CMCA. (asynchronously)
     * Generate a CMCA
     * @param body  (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
     */
    public okhttp3.Call generateCmcaAsync(ApiGenerateCmcaArguments body, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = generateCmcaValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for generateCredentialsAdhoc
     * @param body  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call generateCredentialsAdhocCall(ApiPrincipalList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/commands/generateCredentialsAdhoc";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call generateCredentialsAdhocValidateBeforeCall(ApiPrincipalList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = generateCredentialsAdhocCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Generate missing Kerberos credentials, optionally accepting a list of ad-hoc credentials to generate as well.
     * Generate missing Kerberos credentials, optionally accepting a list of ad-hoc credentials to generate as well.  &lt;p&gt; This command will affect all services that have been configured to use Kerberos, and haven&#x27;t had their credentials generated yet. &lt;/p&gt;
     * @param body  (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand generateCredentialsAdhoc(ApiPrincipalList body) throws ApiException {
        ApiResponse<ApiCommand> resp = generateCredentialsAdhocWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Generate missing Kerberos credentials, optionally accepting a list of ad-hoc credentials to generate as well.
     * Generate missing Kerberos credentials, optionally accepting a list of ad-hoc credentials to generate as well.  &lt;p&gt; This command will affect all services that have been configured to use Kerberos, and haven&#x27;t had their credentials generated yet. &lt;/p&gt;
     * @param body  (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> generateCredentialsAdhocWithHttpInfo(ApiPrincipalList body) throws ApiException {
        okhttp3.Call call = generateCredentialsAdhocValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Generate missing Kerberos credentials, optionally accepting a list of ad-hoc credentials to generate as well. (asynchronously)
     * Generate missing Kerberos credentials, optionally accepting a list of ad-hoc credentials to generate as well.  &lt;p&gt; This command will affect all services that have been configured to use Kerberos, and haven&#x27;t had their credentials generated yet. &lt;/p&gt;
     * @param body  (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
     */
    public okhttp3.Call generateCredentialsAdhocAsync(ApiPrincipalList body, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = generateCredentialsAdhocValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for generateCredentialsCommand
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call generateCredentialsCommandCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/commands/generateCredentials";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call generateCredentialsCommandValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = generateCredentialsCommandCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * Generate missing Kerberos credentials.
     * Generate missing Kerberos credentials. &lt;p&gt; This command will affect all services that have been configured to use Kerberos, and haven&#x27;t had their credentials generated yet.
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand generateCredentialsCommand() throws ApiException {
        ApiResponse<ApiCommand> resp = generateCredentialsCommandWithHttpInfo();
        return resp.getData();
    }

    /**
     * Generate missing Kerberos credentials.
     * Generate missing Kerberos credentials. &lt;p&gt; This command will affect all services that have been configured to use Kerberos, and haven&#x27;t had their credentials generated yet.
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> generateCredentialsCommandWithHttpInfo() throws ApiException {
        okhttp3.Call call = generateCredentialsCommandValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Generate missing Kerberos credentials. (asynchronously)
     * Generate missing Kerberos credentials. &lt;p&gt; This command will affect all services that have been configured to use Kerberos, and haven&#x27;t had their credentials generated yet.
     * @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
     */
    public okhttp3.Call generateCredentialsCommandAsync(final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = generateCredentialsCommandValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for generateUsageReport
     * @param body cluster names to generate usage reports for. By default will generate for all clusters. (optional)
     * @param sendReportToCloudera true/false, automatically send the generated reports to Cloudera or not (optional, default to false)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call generateUsageReportCall(ApiClusterNameList body, Boolean sendReportToCloudera, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/generateUsageReport";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (sendReportToCloudera != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("sendReportToCloudera", sendReportToCloudera));

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call generateUsageReportValidateBeforeCall(ApiClusterNameList body, Boolean sendReportToCloudera, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = generateUsageReportCall(body, sendReportToCloudera, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Generate Usage reports for clusters.
     * Generate Usage reports for clusters
     * @param body cluster names to generate usage reports for. By default will generate for all clusters. (optional)
     * @param sendReportToCloudera true/false, automatically send the generated reports to Cloudera or not (optional, default to false)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand generateUsageReport(ApiClusterNameList body, Boolean sendReportToCloudera) throws ApiException {
        ApiResponse<ApiCommand> resp = generateUsageReportWithHttpInfo(body, sendReportToCloudera);
        return resp.getData();
    }

    /**
     * Generate Usage reports for clusters.
     * Generate Usage reports for clusters
     * @param body cluster names to generate usage reports for. By default will generate for all clusters. (optional)
     * @param sendReportToCloudera true/false, automatically send the generated reports to Cloudera or not (optional, default to false)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> generateUsageReportWithHttpInfo(ApiClusterNameList body, Boolean sendReportToCloudera) throws ApiException {
        okhttp3.Call call = generateUsageReportValidateBeforeCall(body, sendReportToCloudera, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Generate Usage reports for clusters. (asynchronously)
     * Generate Usage reports for clusters
     * @param body cluster names to generate usage reports for. By default will generate for all clusters. (optional)
     * @param sendReportToCloudera true/false, automatically send the generated reports to Cloudera or not (optional, default to false)
     * @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
     */
    public okhttp3.Call generateUsageReportAsync(ApiClusterNameList body, Boolean sendReportToCloudera, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = generateUsageReportValidateBeforeCall(body, sendReportToCloudera, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getClusterSupportTokenList
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call getClusterSupportTokenListCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/clusterSupportTokens";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getClusterSupportTokenListValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = getClusterSupportTokenListCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * Gets the support tokens for all the clusters.
     * Gets the support tokens for all the clusters.
     * @return ApiClusterSupportTokenList
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiClusterSupportTokenList getClusterSupportTokenList() throws ApiException {
        ApiResponse<ApiClusterSupportTokenList> resp = getClusterSupportTokenListWithHttpInfo();
        return resp.getData();
    }

    /**
     * Gets the support tokens for all the clusters.
     * Gets the support tokens for all the clusters.
     * @return ApiResponse&lt;ApiClusterSupportTokenList&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiClusterSupportTokenList> getClusterSupportTokenListWithHttpInfo() throws ApiException {
        okhttp3.Call call = getClusterSupportTokenListValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<ApiClusterSupportTokenList>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Gets the support tokens for all the clusters. (asynchronously)
     * Gets the support tokens for all the clusters.
     * @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
     */
    public okhttp3.Call getClusterSupportTokenListAsync(final ApiCallback<ApiClusterSupportTokenList> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = getClusterSupportTokenListValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiClusterSupportTokenList>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getConfig
     * @param view The view to materialize, either \&quot;summary\&quot; or \&quot;full\&quot;. (optional, default to summary)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call getConfigCall(String view, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/config";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (view != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("view", view));

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getConfigValidateBeforeCall(String view, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = getConfigCall(view, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Retrieve the Cloudera Manager settings.
     * Retrieve the Cloudera Manager settings.
     * @param view The view to materialize, either \&quot;summary\&quot; or \&quot;full\&quot;. (optional, default to summary)
     * @return ApiConfigList
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiConfigList getConfig(String view) throws ApiException {
        ApiResponse<ApiConfigList> resp = getConfigWithHttpInfo(view);
        return resp.getData();
    }

    /**
     * Retrieve the Cloudera Manager settings.
     * Retrieve the Cloudera Manager settings.
     * @param view The view to materialize, either \&quot;summary\&quot; or \&quot;full\&quot;. (optional, default to summary)
     * @return ApiResponse&lt;ApiConfigList&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiConfigList> getConfigWithHttpInfo(String view) throws ApiException {
        okhttp3.Call call = getConfigValidateBeforeCall(view, null, null);
        Type localVarReturnType = new TypeToken<ApiConfigList>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Retrieve the Cloudera Manager settings. (asynchronously)
     * Retrieve the Cloudera Manager settings.
     * @param view The view to materialize, either \&quot;summary\&quot; or \&quot;full\&quot;. (optional, default to summary)
     * @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
     */
    public okhttp3.Call getConfigAsync(String view, final ApiCallback<ApiConfigList> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = getConfigValidateBeforeCall(view, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiConfigList>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getConfigPolicies
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call getConfigPoliciesCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/configPolicies";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getConfigPoliciesValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = getConfigPoliciesCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * 
     * 
     * @return List&lt;ApiConfigPolicy&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<ApiConfigPolicy> getConfigPolicies() throws ApiException {
        ApiResponse<List<ApiConfigPolicy>> resp = getConfigPoliciesWithHttpInfo();
        return resp.getData();
    }

    /**
     * 
     * 
     * @return ApiResponse&lt;List&lt;ApiConfigPolicy&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<ApiConfigPolicy>> getConfigPoliciesWithHttpInfo() throws ApiException {
        okhttp3.Call call = getConfigPoliciesValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<List<ApiConfigPolicy>>(){}.getType();
        return apiClient.execute(call, 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
     */
    public okhttp3.Call getConfigPoliciesAsync(final ApiCallback<List<ApiConfigPolicy>> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = getConfigPoliciesValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<ApiConfigPolicy>>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getDeployment2
     * @param view May be one of \&quot;export\&quot; (default) or \&quot;export_redacted\&quot;.  The latter replaces configurations that are sensitive with the word \&quot;REDACTED\&quot;. Other filter options are not supported. (optional, default to export)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call getDeployment2Call(String view, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/deployment";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (view != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("view", view));

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getDeployment2ValidateBeforeCall(String view, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = getDeployment2Call(view, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Retrieve full description of the entire Cloudera Manager deployment including all hosts, clusters, services, roles, users, settings, etc.
     * Retrieve full description of the entire Cloudera Manager deployment including all hosts, clusters, services, roles, users, settings, etc. &lt;p/&gt; This object can be used to reconstruct your entire deployment &lt;p/&gt; Note: Only users with sufficient privileges are allowed to call this. &lt;ul&gt; &lt;li&gt;Full Administrators&lt;/li&gt; &lt;li&gt;Cluster Administrators (but Navigator config will be redacted)&lt;/li&gt; &lt;/ul&gt; &lt;p/&gt; Note: starting with v19, the deployment information contains a newer version of users ApiUser2 that can hold granular permissions.
     * @param view May be one of \&quot;export\&quot; (default) or \&quot;export_redacted\&quot;.  The latter replaces configurations that are sensitive with the word \&quot;REDACTED\&quot;. Other filter options are not supported. (optional, default to export)
     * @return ApiDeployment2
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiDeployment2 getDeployment2(String view) throws ApiException {
        ApiResponse<ApiDeployment2> resp = getDeployment2WithHttpInfo(view);
        return resp.getData();
    }

    /**
     * Retrieve full description of the entire Cloudera Manager deployment including all hosts, clusters, services, roles, users, settings, etc.
     * Retrieve full description of the entire Cloudera Manager deployment including all hosts, clusters, services, roles, users, settings, etc. &lt;p/&gt; This object can be used to reconstruct your entire deployment &lt;p/&gt; Note: Only users with sufficient privileges are allowed to call this. &lt;ul&gt; &lt;li&gt;Full Administrators&lt;/li&gt; &lt;li&gt;Cluster Administrators (but Navigator config will be redacted)&lt;/li&gt; &lt;/ul&gt; &lt;p/&gt; Note: starting with v19, the deployment information contains a newer version of users ApiUser2 that can hold granular permissions.
     * @param view May be one of \&quot;export\&quot; (default) or \&quot;export_redacted\&quot;.  The latter replaces configurations that are sensitive with the word \&quot;REDACTED\&quot;. Other filter options are not supported. (optional, default to export)
     * @return ApiResponse&lt;ApiDeployment2&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiDeployment2> getDeployment2WithHttpInfo(String view) throws ApiException {
        okhttp3.Call call = getDeployment2ValidateBeforeCall(view, null, null);
        Type localVarReturnType = new TypeToken<ApiDeployment2>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Retrieve full description of the entire Cloudera Manager deployment including all hosts, clusters, services, roles, users, settings, etc. (asynchronously)
     * Retrieve full description of the entire Cloudera Manager deployment including all hosts, clusters, services, roles, users, settings, etc. &lt;p/&gt; This object can be used to reconstruct your entire deployment &lt;p/&gt; Note: Only users with sufficient privileges are allowed to call this. &lt;ul&gt; &lt;li&gt;Full Administrators&lt;/li&gt; &lt;li&gt;Cluster Administrators (but Navigator config will be redacted)&lt;/li&gt; &lt;/ul&gt; &lt;p/&gt; Note: starting with v19, the deployment information contains a newer version of users ApiUser2 that can hold granular permissions.
     * @param view May be one of \&quot;export\&quot; (default) or \&quot;export_redacted\&quot;.  The latter replaces configurations that are sensitive with the word \&quot;REDACTED\&quot;. Other filter options are not supported. (optional, default to export)
     * @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
     */
    public okhttp3.Call getDeployment2Async(String view, final ApiCallback<ApiDeployment2> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = getDeployment2ValidateBeforeCall(view, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiDeployment2>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getKerberosInfo
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call getKerberosInfoCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/kerberosInfo";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getKerberosInfoValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = getKerberosInfoCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * Provides Cloudera Manager Kerberos information.
     * Provides Cloudera Manager Kerberos information
     * @return ApiKerberosInfo
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiKerberosInfo getKerberosInfo() throws ApiException {
        ApiResponse<ApiKerberosInfo> resp = getKerberosInfoWithHttpInfo();
        return resp.getData();
    }

    /**
     * Provides Cloudera Manager Kerberos information.
     * Provides Cloudera Manager Kerberos information
     * @return ApiResponse&lt;ApiKerberosInfo&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiKerberosInfo> getKerberosInfoWithHttpInfo() throws ApiException {
        okhttp3.Call call = getKerberosInfoValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<ApiKerberosInfo>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Provides Cloudera Manager Kerberos information. (asynchronously)
     * Provides Cloudera Manager Kerberos information
     * @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
     */
    public okhttp3.Call getKerberosInfoAsync(final ApiCallback<ApiKerberosInfo> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = getKerberosInfoValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiKerberosInfo>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getKerberosPrincipals
     * @param missingOnly Whether to include only those principals which do not already exist in Cloudera Manager&#x27;s database. (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call getKerberosPrincipalsCall(Boolean missingOnly, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/kerberosPrincipals";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (missingOnly != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("missingOnly", missingOnly));

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getKerberosPrincipalsValidateBeforeCall(Boolean missingOnly, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = getKerberosPrincipalsCall(missingOnly, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Returns the Kerberos principals needed by the services being managed by Cloudera Manager.
     * Returns the Kerberos principals needed by the services being managed by Cloudera Manager.
     * @param missingOnly Whether to include only those principals which do not already exist in Cloudera Manager&#x27;s database. (optional)
     * @return ApiPrincipalList
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiPrincipalList getKerberosPrincipals(Boolean missingOnly) throws ApiException {
        ApiResponse<ApiPrincipalList> resp = getKerberosPrincipalsWithHttpInfo(missingOnly);
        return resp.getData();
    }

    /**
     * Returns the Kerberos principals needed by the services being managed by Cloudera Manager.
     * Returns the Kerberos principals needed by the services being managed by Cloudera Manager.
     * @param missingOnly Whether to include only those principals which do not already exist in Cloudera Manager&#x27;s database. (optional)
     * @return ApiResponse&lt;ApiPrincipalList&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiPrincipalList> getKerberosPrincipalsWithHttpInfo(Boolean missingOnly) throws ApiException {
        okhttp3.Call call = getKerberosPrincipalsValidateBeforeCall(missingOnly, null, null);
        Type localVarReturnType = new TypeToken<ApiPrincipalList>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns the Kerberos principals needed by the services being managed by Cloudera Manager. (asynchronously)
     * Returns the Kerberos principals needed by the services being managed by Cloudera Manager.
     * @param missingOnly Whether to include only those principals which do not already exist in Cloudera Manager&#x27;s database. (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
     */
    public okhttp3.Call getKerberosPrincipalsAsync(Boolean missingOnly, final ApiCallback<ApiPrincipalList> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = getKerberosPrincipalsValidateBeforeCall(missingOnly, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiPrincipalList>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getKrb5Conf
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call getKrb5ConfCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/krb5conf";

        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/octet-stream"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getKrb5ConfValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = getKrb5ConfCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * Retrieves krb5.
     * Retrieves krb5.conf of the CM server host  &lt;p&gt; Available since API v41. &lt;/p&gt;
     * @return File
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public File getKrb5Conf() throws ApiException {
        ApiResponse<File> resp = getKrb5ConfWithHttpInfo();
        return resp.getData();
    }

    /**
     * Retrieves krb5.
     * Retrieves krb5.conf of the CM server host  &lt;p&gt; Available since API v41. &lt;/p&gt;
     * @return ApiResponse&lt;File&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<File> getKrb5ConfWithHttpInfo() throws ApiException {
        okhttp3.Call call = getKrb5ConfValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<File>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Retrieves krb5. (asynchronously)
     * Retrieves krb5.conf of the CM server host  &lt;p&gt; Available since API v41. &lt;/p&gt;
     * @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
     */
    public okhttp3.Call getKrb5ConfAsync(final ApiCallback<File> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = getKrb5ConfValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<File>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getLicensedFeatureUsage
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call getLicensedFeatureUsageCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/licensedFeatureUsage";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getLicensedFeatureUsageValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = getLicensedFeatureUsageCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * Retrieve a summary of licensed feature usage.
     * Retrieve a summary of licensed feature usage. &lt;p/&gt; This command will return information about what Cloudera Enterprise licensed features are in use in the clusters being managed by this Cloudera Manager, as well as totals for usage across all clusters. &lt;p/&gt; The specific features described can vary between different versions of Cloudera Manager. &lt;p/&gt; Available since API v6.
     * @return ApiLicensedFeatureUsage
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiLicensedFeatureUsage getLicensedFeatureUsage() throws ApiException {
        ApiResponse<ApiLicensedFeatureUsage> resp = getLicensedFeatureUsageWithHttpInfo();
        return resp.getData();
    }

    /**
     * Retrieve a summary of licensed feature usage.
     * Retrieve a summary of licensed feature usage. &lt;p/&gt; This command will return information about what Cloudera Enterprise licensed features are in use in the clusters being managed by this Cloudera Manager, as well as totals for usage across all clusters. &lt;p/&gt; The specific features described can vary between different versions of Cloudera Manager. &lt;p/&gt; Available since API v6.
     * @return ApiResponse&lt;ApiLicensedFeatureUsage&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiLicensedFeatureUsage> getLicensedFeatureUsageWithHttpInfo() throws ApiException {
        okhttp3.Call call = getLicensedFeatureUsageValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<ApiLicensedFeatureUsage>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Retrieve a summary of licensed feature usage. (asynchronously)
     * Retrieve a summary of licensed feature usage. &lt;p/&gt; This command will return information about what Cloudera Enterprise licensed features are in use in the clusters being managed by this Cloudera Manager, as well as totals for usage across all clusters. &lt;p/&gt; The specific features described can vary between different versions of Cloudera Manager. &lt;p/&gt; Available since API v6.
     * @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
     */
    public okhttp3.Call getLicensedFeatureUsageAsync(final ApiCallback<ApiLicensedFeatureUsage> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = getLicensedFeatureUsageValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiLicensedFeatureUsage>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getLog
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call getLogCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/log";

        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 = {
            "text/plain"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getLogValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = getLogCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * Returns the entire contents of the Cloudera Manager log file.
     * Returns the entire contents of the Cloudera Manager log file
     * @return String
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public String getLog() throws ApiException {
        ApiResponse<String> resp = getLogWithHttpInfo();
        return resp.getData();
    }

    /**
     * Returns the entire contents of the Cloudera Manager log file.
     * Returns the entire contents of the Cloudera Manager log file
     * @return ApiResponse&lt;String&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<String> getLogWithHttpInfo() throws ApiException {
        okhttp3.Call call = getLogValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<String>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns the entire contents of the Cloudera Manager log file. (asynchronously)
     * Returns the entire contents of the Cloudera Manager log file
     * @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
     */
    public okhttp3.Call getLogAsync(final ApiCallback<String> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = getLogValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<String>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getScmDbInfo
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call getScmDbInfoCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/scmDbInfo";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getScmDbInfoValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = getScmDbInfoCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * Provides Cloudera Manager server&#x27;s database information.
     * Provides Cloudera Manager server&#x27;s database information
     * @return ApiScmDbInfo
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiScmDbInfo getScmDbInfo() throws ApiException {
        ApiResponse<ApiScmDbInfo> resp = getScmDbInfoWithHttpInfo();
        return resp.getData();
    }

    /**
     * Provides Cloudera Manager server&#x27;s database information.
     * Provides Cloudera Manager server&#x27;s database information
     * @return ApiResponse&lt;ApiScmDbInfo&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiScmDbInfo> getScmDbInfoWithHttpInfo() throws ApiException {
        okhttp3.Call call = getScmDbInfoValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<ApiScmDbInfo>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Provides Cloudera Manager server&#x27;s database information. (asynchronously)
     * Provides Cloudera Manager server&#x27;s database information
     * @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
     */
    public okhttp3.Call getScmDbInfoAsync(final ApiCallback<ApiScmDbInfo> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = getScmDbInfoValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiScmDbInfo>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getShutdownReadiness
     * @param lastActivityTime End time of the last known activity/workload against the managed clusters, in ISO 8601 format. (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call getShutdownReadinessCall(String lastActivityTime, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/shutdownReadiness";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (lastActivityTime != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("lastActivityTime", lastActivityTime));

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getShutdownReadinessValidateBeforeCall(String lastActivityTime, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = getShutdownReadinessCall(lastActivityTime, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Retrieve Cloudera Manager&#x27;s readiness for shutdown and destroy.
     * Retrieve Cloudera Manager&#x27;s readiness for shutdown and destroy. Applications that wish to destroy Cloudera Manager and its managed cluster should poll this API, repeatedly if necessary, to respect its readiness.
     * @param lastActivityTime End time of the last known activity/workload against the managed clusters, in ISO 8601 format. (optional)
     * @return ApiShutdownReadiness
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiShutdownReadiness getShutdownReadiness(String lastActivityTime) throws ApiException {
        ApiResponse<ApiShutdownReadiness> resp = getShutdownReadinessWithHttpInfo(lastActivityTime);
        return resp.getData();
    }

    /**
     * Retrieve Cloudera Manager&#x27;s readiness for shutdown and destroy.
     * Retrieve Cloudera Manager&#x27;s readiness for shutdown and destroy. Applications that wish to destroy Cloudera Manager and its managed cluster should poll this API, repeatedly if necessary, to respect its readiness.
     * @param lastActivityTime End time of the last known activity/workload against the managed clusters, in ISO 8601 format. (optional)
     * @return ApiResponse&lt;ApiShutdownReadiness&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiShutdownReadiness> getShutdownReadinessWithHttpInfo(String lastActivityTime) throws ApiException {
        okhttp3.Call call = getShutdownReadinessValidateBeforeCall(lastActivityTime, null, null);
        Type localVarReturnType = new TypeToken<ApiShutdownReadiness>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Retrieve Cloudera Manager&#x27;s readiness for shutdown and destroy. (asynchronously)
     * Retrieve Cloudera Manager&#x27;s readiness for shutdown and destroy. Applications that wish to destroy Cloudera Manager and its managed cluster should poll this API, repeatedly if necessary, to respect its readiness.
     * @param lastActivityTime End time of the last known activity/workload against the managed clusters, in ISO 8601 format. (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
     */
    public okhttp3.Call getShutdownReadinessAsync(String lastActivityTime, final ApiCallback<ApiShutdownReadiness> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = getShutdownReadinessValidateBeforeCall(lastActivityTime, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiShutdownReadiness>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getUsageReport
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call getUsageReportCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/getUsageReport";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getUsageReportValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = getUsageReportCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * Retrieve the latest generated Usage reports for all clusters.
     * Retrieve the latest generated Usage reports for all clusters
     * @return List&lt;String&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<String> getUsageReport() throws ApiException {
        ApiResponse<List<String>> resp = getUsageReportWithHttpInfo();
        return resp.getData();
    }

    /**
     * Retrieve the latest generated Usage reports for all clusters.
     * Retrieve the latest generated Usage reports for all clusters
     * @return ApiResponse&lt;List&lt;String&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<String>> getUsageReportWithHttpInfo() throws ApiException {
        okhttp3.Call call = getUsageReportValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<List<String>>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Retrieve the latest generated Usage reports for all clusters. (asynchronously)
     * Retrieve the latest generated Usage reports for all clusters
     * @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
     */
    public okhttp3.Call getUsageReportAsync(final ApiCallback<List<String>> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = getUsageReportValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<String>>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getVersion
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call getVersionCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getVersionValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = getVersionCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * Provides version information of Cloudera Manager itself.
     * Provides version information of Cloudera Manager itself.
     * @return ApiVersionInfo
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiVersionInfo getVersion() throws ApiException {
        ApiResponse<ApiVersionInfo> resp = getVersionWithHttpInfo();
        return resp.getData();
    }

    /**
     * Provides version information of Cloudera Manager itself.
     * Provides version information of Cloudera Manager itself.
     * @return ApiResponse&lt;ApiVersionInfo&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiVersionInfo> getVersionWithHttpInfo() throws ApiException {
        okhttp3.Call call = getVersionValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<ApiVersionInfo>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Provides version information of Cloudera Manager itself. (asynchronously)
     * Provides version information of Cloudera Manager itself.
     * @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
     */
    public okhttp3.Call getVersionAsync(final ApiCallback<ApiVersionInfo> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = getVersionValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiVersionInfo>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hostInstallCommand
     * @param body Hosts to perform installation on (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call hostInstallCommandCall(ApiHostInstallArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/commands/hostInstall";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call hostInstallCommandValidateBeforeCall(ApiHostInstallArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = hostInstallCommandCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Perform installation on a set of hosts.
     * Perform installation on a set of hosts. &lt;p/&gt; This command installs Cloudera Manager Agent on a set of hosts. &lt;p/&gt; Available since API v6.
     * @param body Hosts to perform installation on (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hostInstallCommand(ApiHostInstallArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = hostInstallCommandWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Perform installation on a set of hosts.
     * Perform installation on a set of hosts. &lt;p/&gt; This command installs Cloudera Manager Agent on a set of hosts. &lt;p/&gt; Available since API v6.
     * @param body Hosts to perform installation on (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> hostInstallCommandWithHttpInfo(ApiHostInstallArguments body) throws ApiException {
        okhttp3.Call call = hostInstallCommandValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Perform installation on a set of hosts. (asynchronously)
     * Perform installation on a set of hosts. &lt;p/&gt; This command installs Cloudera Manager Agent on a set of hosts. &lt;p/&gt; Available since API v6.
     * @param body Hosts to perform installation on (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
     */
    public okhttp3.Call hostInstallCommandAsync(ApiHostInstallArguments body, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = hostInstallCommandValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hostsDecommissionCommand
     * @param body  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call hostsDecommissionCommandCall(ApiHostNameList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/commands/hostsDecommission";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call hostsDecommissionCommandValidateBeforeCall(ApiHostNameList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = hostsDecommissionCommandCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Decommission the given hosts.
     * Decommission the given hosts. All slave roles on the hosts will be decommissioned. All other roles will be stopped. &lt;p&gt; To offline by Upgrade Domain, use the “upgradeDomains” endpoint from the clusters resource to get the list of host names that belong in each Upgrade Domain. Available since API v40.
     * @param body  (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hostsDecommissionCommand(ApiHostNameList body) throws ApiException {
        ApiResponse<ApiCommand> resp = hostsDecommissionCommandWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Decommission the given hosts.
     * Decommission the given hosts. All slave roles on the hosts will be decommissioned. All other roles will be stopped. &lt;p&gt; To offline by Upgrade Domain, use the “upgradeDomains” endpoint from the clusters resource to get the list of host names that belong in each Upgrade Domain. Available since API v40.
     * @param body  (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> hostsDecommissionCommandWithHttpInfo(ApiHostNameList body) throws ApiException {
        okhttp3.Call call = hostsDecommissionCommandValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Decommission the given hosts. (asynchronously)
     * Decommission the given hosts. All slave roles on the hosts will be decommissioned. All other roles will be stopped. &lt;p&gt; To offline by Upgrade Domain, use the “upgradeDomains” endpoint from the clusters resource to get the list of host names that belong in each Upgrade Domain. Available since API v40.
     * @param body  (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
     */
    public okhttp3.Call hostsDecommissionCommandAsync(ApiHostNameList body, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = hostsDecommissionCommandValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hostsOfflineOrDecommissionCommand
     * @param body list of host names to decommission. (optional)
     * @param offlineTimeout offline timeout in seconds. Specify as null to get the default timeout (4 hours). Ignored if service does not support he offline operation. (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call hostsOfflineOrDecommissionCommandCall(ApiHostNameList body, java.math.BigDecimal offlineTimeout, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/commands/hostsOfflineOrDecommission";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (offlineTimeout != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("offlineTimeout", offlineTimeout));

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call hostsOfflineOrDecommissionCommandValidateBeforeCall(ApiHostNameList body, java.math.BigDecimal offlineTimeout, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = hostsOfflineOrDecommissionCommandCall(body, offlineTimeout, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Decommission the given hosts.
     * Decommission the given hosts. All slave roles on the hosts will be offlined or decommissioned with preference being offlined if supported by the service. &lt;p&gt; Currently the offline operation is only supported by HDFS, where the offline operation will put DataNodes into &lt;em&gt;HDFS IN MAINTENANCE&lt;/em&gt; state which prevents unnecessary re-replication which could occur if decommissioned. &lt;p&gt; All other roles on the hosts will be stopped. &lt;p&gt; The &lt;em&gt;offlineTimeout&lt;/em&gt; parameter is used to specify a timeout for offline. For HDFS, when the timeout expires, the DataNode will automatically transition out of &lt;em&gt;HDFS IN MAINTENANCE&lt;/em&gt; state, back to &lt;em&gt;HDFS IN SERVICE&lt;/em&gt; state. &lt;p&gt; To offline or decommission by Upgrade Domain, use the “upgradeDomains” endpoint from the clusters resource to get the list of host names that belong in each Upgrade Domain. Available since API v40.
     * @param body list of host names to decommission. (optional)
     * @param offlineTimeout offline timeout in seconds. Specify as null to get the default timeout (4 hours). Ignored if service does not support he offline operation. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hostsOfflineOrDecommissionCommand(ApiHostNameList body, java.math.BigDecimal offlineTimeout) throws ApiException {
        ApiResponse<ApiCommand> resp = hostsOfflineOrDecommissionCommandWithHttpInfo(body, offlineTimeout);
        return resp.getData();
    }

    /**
     * Decommission the given hosts.
     * Decommission the given hosts. All slave roles on the hosts will be offlined or decommissioned with preference being offlined if supported by the service. &lt;p&gt; Currently the offline operation is only supported by HDFS, where the offline operation will put DataNodes into &lt;em&gt;HDFS IN MAINTENANCE&lt;/em&gt; state which prevents unnecessary re-replication which could occur if decommissioned. &lt;p&gt; All other roles on the hosts will be stopped. &lt;p&gt; The &lt;em&gt;offlineTimeout&lt;/em&gt; parameter is used to specify a timeout for offline. For HDFS, when the timeout expires, the DataNode will automatically transition out of &lt;em&gt;HDFS IN MAINTENANCE&lt;/em&gt; state, back to &lt;em&gt;HDFS IN SERVICE&lt;/em&gt; state. &lt;p&gt; To offline or decommission by Upgrade Domain, use the “upgradeDomains” endpoint from the clusters resource to get the list of host names that belong in each Upgrade Domain. Available since API v40.
     * @param body list of host names to decommission. (optional)
     * @param offlineTimeout offline timeout in seconds. Specify as null to get the default timeout (4 hours). Ignored if service does not support he offline operation. (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> hostsOfflineOrDecommissionCommandWithHttpInfo(ApiHostNameList body, java.math.BigDecimal offlineTimeout) throws ApiException {
        okhttp3.Call call = hostsOfflineOrDecommissionCommandValidateBeforeCall(body, offlineTimeout, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Decommission the given hosts. (asynchronously)
     * Decommission the given hosts. All slave roles on the hosts will be offlined or decommissioned with preference being offlined if supported by the service. &lt;p&gt; Currently the offline operation is only supported by HDFS, where the offline operation will put DataNodes into &lt;em&gt;HDFS IN MAINTENANCE&lt;/em&gt; state which prevents unnecessary re-replication which could occur if decommissioned. &lt;p&gt; All other roles on the hosts will be stopped. &lt;p&gt; The &lt;em&gt;offlineTimeout&lt;/em&gt; parameter is used to specify a timeout for offline. For HDFS, when the timeout expires, the DataNode will automatically transition out of &lt;em&gt;HDFS IN MAINTENANCE&lt;/em&gt; state, back to &lt;em&gt;HDFS IN SERVICE&lt;/em&gt; state. &lt;p&gt; To offline or decommission by Upgrade Domain, use the “upgradeDomains” endpoint from the clusters resource to get the list of host names that belong in each Upgrade Domain. Available since API v40.
     * @param body list of host names to decommission. (optional)
     * @param offlineTimeout offline timeout in seconds. Specify as null to get the default timeout (4 hours). Ignored if service does not support he offline operation. (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
     */
    public okhttp3.Call hostsOfflineOrDecommissionCommandAsync(ApiHostNameList body, java.math.BigDecimal offlineTimeout, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = hostsOfflineOrDecommissionCommandValidateBeforeCall(body, offlineTimeout, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hostsPerfInspectorCommand
     * @param body Required arguments for the command. See ApiHostsPerfInspectorArgs. (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call hostsPerfInspectorCommandCall(ApiHostsPerfInspectorArgs body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/commands/hostsPerfInspector";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call hostsPerfInspectorCommandValidateBeforeCall(ApiHostsPerfInspectorArgs body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = hostsPerfInspectorCommandCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Run performance diagnostics test against specified hosts in ApiHostsPerfInspectorArgs  User must be Full Administrator or Global Cluster Administrator.
     * Run performance diagnostics test against specified hosts in ApiHostsPerfInspectorArgs  User must be Full Administrator or Global Cluster Administrator.
     * @param body Required arguments for the command. See ApiHostsPerfInspectorArgs. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hostsPerfInspectorCommand(ApiHostsPerfInspectorArgs body) throws ApiException {
        ApiResponse<ApiCommand> resp = hostsPerfInspectorCommandWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Run performance diagnostics test against specified hosts in ApiHostsPerfInspectorArgs  User must be Full Administrator or Global Cluster Administrator.
     * Run performance diagnostics test against specified hosts in ApiHostsPerfInspectorArgs  User must be Full Administrator or Global Cluster Administrator.
     * @param body Required arguments for the command. See ApiHostsPerfInspectorArgs. (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> hostsPerfInspectorCommandWithHttpInfo(ApiHostsPerfInspectorArgs body) throws ApiException {
        okhttp3.Call call = hostsPerfInspectorCommandValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Run performance diagnostics test against specified hosts in ApiHostsPerfInspectorArgs  User must be Full Administrator or Global Cluster Administrator. (asynchronously)
     * Run performance diagnostics test against specified hosts in ApiHostsPerfInspectorArgs  User must be Full Administrator or Global Cluster Administrator.
     * @param body Required arguments for the command. See ApiHostsPerfInspectorArgs. (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
     */
    public okhttp3.Call hostsPerfInspectorCommandAsync(ApiHostsPerfInspectorArgs body, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = hostsPerfInspectorCommandValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hostsRecommissionAndExitMaintenanceModeCommand
     * @param body  (optional)
     * @param recommissionType  (optional, default to recommission)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call hostsRecommissionAndExitMaintenanceModeCommandCall(ApiHostNameList body, String recommissionType, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/commands/hostsRecommissionAndExitMaintenanceMode";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (recommissionType != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("recommissionType", recommissionType));

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call hostsRecommissionAndExitMaintenanceModeCommandValidateBeforeCall(ApiHostNameList body, String recommissionType, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = hostsRecommissionAndExitMaintenanceModeCommandCall(body, recommissionType, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Recommission and exit maintenance on the given hosts.
     * Recommission and exit maintenance on the given hosts. The recommission step may optionally start roles as well.
     * @param body  (optional)
     * @param recommissionType  (optional, default to recommission)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hostsRecommissionAndExitMaintenanceModeCommand(ApiHostNameList body, String recommissionType) throws ApiException {
        ApiResponse<ApiCommand> resp = hostsRecommissionAndExitMaintenanceModeCommandWithHttpInfo(body, recommissionType);
        return resp.getData();
    }

    /**
     * Recommission and exit maintenance on the given hosts.
     * Recommission and exit maintenance on the given hosts. The recommission step may optionally start roles as well.
     * @param body  (optional)
     * @param recommissionType  (optional, default to recommission)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> hostsRecommissionAndExitMaintenanceModeCommandWithHttpInfo(ApiHostNameList body, String recommissionType) throws ApiException {
        okhttp3.Call call = hostsRecommissionAndExitMaintenanceModeCommandValidateBeforeCall(body, recommissionType, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Recommission and exit maintenance on the given hosts. (asynchronously)
     * Recommission and exit maintenance on the given hosts. The recommission step may optionally start roles as well.
     * @param body  (optional)
     * @param recommissionType  (optional, default to recommission)
     * @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
     */
    public okhttp3.Call hostsRecommissionAndExitMaintenanceModeCommandAsync(ApiHostNameList body, String recommissionType, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = hostsRecommissionAndExitMaintenanceModeCommandValidateBeforeCall(body, recommissionType, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hostsRecommissionCommand
     * @param body  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call hostsRecommissionCommandCall(ApiHostNameList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/commands/hostsRecommission";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call hostsRecommissionCommandValidateBeforeCall(ApiHostNameList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = hostsRecommissionCommandCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Recommission the given hosts.
     * Recommission the given hosts. All slave roles on the hosts will be recommissioned. Roles are not started after this command. Use hostsStartRoles command for that.
     * @param body  (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hostsRecommissionCommand(ApiHostNameList body) throws ApiException {
        ApiResponse<ApiCommand> resp = hostsRecommissionCommandWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Recommission the given hosts.
     * Recommission the given hosts. All slave roles on the hosts will be recommissioned. Roles are not started after this command. Use hostsStartRoles command for that.
     * @param body  (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> hostsRecommissionCommandWithHttpInfo(ApiHostNameList body) throws ApiException {
        okhttp3.Call call = hostsRecommissionCommandValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Recommission the given hosts. (asynchronously)
     * Recommission the given hosts. All slave roles on the hosts will be recommissioned. Roles are not started after this command. Use hostsStartRoles command for that.
     * @param body  (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
     */
    public okhttp3.Call hostsRecommissionCommandAsync(ApiHostNameList body, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = hostsRecommissionCommandValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hostsRecommissionWithStartCommand
     * @param body  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call hostsRecommissionWithStartCommandCall(ApiHostNameList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/commands/hostsRecommissionWithStart";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call hostsRecommissionWithStartCommandValidateBeforeCall(ApiHostNameList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = hostsRecommissionWithStartCommandCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Recommission the given hosts.
     * Recommission the given hosts. If slave roles support start when decommissioned, start those roles before recommission. All slave roles on the hosts will be recommissioned.  Warning: Evolving. This method may change in the future and does not offer standard compatibility guarantees. Recommission the given hosts. If possible, start those roles before recommission. All slave roles on the hosts will be recommissioned. Do not use without guidance from Cloudera.  Currently, only HDFS DataNodes will be started by this command.
     * @param body  (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hostsRecommissionWithStartCommand(ApiHostNameList body) throws ApiException {
        ApiResponse<ApiCommand> resp = hostsRecommissionWithStartCommandWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Recommission the given hosts.
     * Recommission the given hosts. If slave roles support start when decommissioned, start those roles before recommission. All slave roles on the hosts will be recommissioned.  Warning: Evolving. This method may change in the future and does not offer standard compatibility guarantees. Recommission the given hosts. If possible, start those roles before recommission. All slave roles on the hosts will be recommissioned. Do not use without guidance from Cloudera.  Currently, only HDFS DataNodes will be started by this command.
     * @param body  (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> hostsRecommissionWithStartCommandWithHttpInfo(ApiHostNameList body) throws ApiException {
        okhttp3.Call call = hostsRecommissionWithStartCommandValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Recommission the given hosts. (asynchronously)
     * Recommission the given hosts. If slave roles support start when decommissioned, start those roles before recommission. All slave roles on the hosts will be recommissioned.  Warning: Evolving. This method may change in the future and does not offer standard compatibility guarantees. Recommission the given hosts. If possible, start those roles before recommission. All slave roles on the hosts will be recommissioned. Do not use without guidance from Cloudera.  Currently, only HDFS DataNodes will be started by this command.
     * @param body  (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
     */
    public okhttp3.Call hostsRecommissionWithStartCommandAsync(ApiHostNameList body, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = hostsRecommissionWithStartCommandValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hostsRepairRolesCommand
     * @param body list of hosts (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call hostsRepairRolesCommandCall(ApiHostNameList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/commands/hostsRepairRoles";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call hostsRepairRolesCommandValidateBeforeCall(ApiHostNameList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = hostsRepairRolesCommandCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Execute repair command on the given hosts.
     * Execute repair command on the given hosts. &lt;p&gt; Available since API v51. Repairs roles on the given hosts.
     * @param body list of hosts (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hostsRepairRolesCommand(ApiHostNameList body) throws ApiException {
        ApiResponse<ApiCommand> resp = hostsRepairRolesCommandWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Execute repair command on the given hosts.
     * Execute repair command on the given hosts. &lt;p&gt; Available since API v51. Repairs roles on the given hosts.
     * @param body list of hosts (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> hostsRepairRolesCommandWithHttpInfo(ApiHostNameList body) throws ApiException {
        okhttp3.Call call = hostsRepairRolesCommandValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Execute repair command on the given hosts. (asynchronously)
     * Execute repair command on the given hosts. &lt;p&gt; Available since API v51. Repairs roles on the given hosts.
     * @param body list of hosts (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
     */
    public okhttp3.Call hostsRepairRolesCommandAsync(ApiHostNameList body, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = hostsRepairRolesCommandValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hostsStartRolesCommand
     * @param body  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call hostsStartRolesCommandCall(ApiHostNameList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/commands/hostsStartRoles";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call hostsStartRolesCommandValidateBeforeCall(ApiHostNameList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = hostsStartRolesCommandCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Start all the roles on the given hosts.
     * Start all the roles on the given hosts.
     * @param body  (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hostsStartRolesCommand(ApiHostNameList body) throws ApiException {
        ApiResponse<ApiCommand> resp = hostsStartRolesCommandWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Start all the roles on the given hosts.
     * Start all the roles on the given hosts.
     * @param body  (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> hostsStartRolesCommandWithHttpInfo(ApiHostNameList body) throws ApiException {
        okhttp3.Call call = hostsStartRolesCommandValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Start all the roles on the given hosts. (asynchronously)
     * Start all the roles on the given hosts.
     * @param body  (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
     */
    public okhttp3.Call hostsStartRolesCommandAsync(ApiHostNameList body, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = hostsStartRolesCommandValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hostsStopRolesCommand
     * @param body list of hosts (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call hostsStopRolesCommandCall(ApiHostNameList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/commands/hostsStopRoles";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call hostsStopRolesCommandValidateBeforeCall(ApiHostNameList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = hostsStopRolesCommandCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Stop all the roles on the given hosts.
     * Stop all the roles on the given hosts. &lt;p&gt; Available since API v51. Stops roles on the given hosts.
     * @param body list of hosts (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hostsStopRolesCommand(ApiHostNameList body) throws ApiException {
        ApiResponse<ApiCommand> resp = hostsStopRolesCommandWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Stop all the roles on the given hosts.
     * Stop all the roles on the given hosts. &lt;p&gt; Available since API v51. Stops roles on the given hosts.
     * @param body list of hosts (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> hostsStopRolesCommandWithHttpInfo(ApiHostNameList body) throws ApiException {
        okhttp3.Call call = hostsStopRolesCommandValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Stop all the roles on the given hosts. (asynchronously)
     * Stop all the roles on the given hosts. &lt;p&gt; Available since API v51. Stops roles on the given hosts.
     * @param body list of hosts (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
     */
    public okhttp3.Call hostsStopRolesCommandAsync(ApiHostNameList body, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = hostsStopRolesCommandValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for importAdminCredentials
     * @param password Password for the Account Manager.  return Information about the submitted command. (optional)
     * @param username Username of the Account Manager. Full name including the Kerberos realm must be specified. (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call importAdminCredentialsCall(String password, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/commands/importAdminCredentials";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (password != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("password", password));
        if (username != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("username", username));

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call importAdminCredentialsValidateBeforeCall(String password, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = importAdminCredentialsCall(password, username, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Imports the KDC Account Manager credentials needed by Cloudera Manager to create kerberos principals needed by CDH services.
     * Imports the KDC Account Manager credentials needed by Cloudera Manager to create kerberos principals needed by CDH services.
     * @param password Password for the Account Manager.  return Information about the submitted command. (optional)
     * @param username Username of the Account Manager. Full name including the Kerberos realm must be specified. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand importAdminCredentials(String password, String username) throws ApiException {
        ApiResponse<ApiCommand> resp = importAdminCredentialsWithHttpInfo(password, username);
        return resp.getData();
    }

    /**
     * Imports the KDC Account Manager credentials needed by Cloudera Manager to create kerberos principals needed by CDH services.
     * Imports the KDC Account Manager credentials needed by Cloudera Manager to create kerberos principals needed by CDH services.
     * @param password Password for the Account Manager.  return Information about the submitted command. (optional)
     * @param username Username of the Account Manager. Full name including the Kerberos realm must be specified. (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> importAdminCredentialsWithHttpInfo(String password, String username) throws ApiException {
        okhttp3.Call call = importAdminCredentialsValidateBeforeCall(password, username, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Imports the KDC Account Manager credentials needed by Cloudera Manager to create kerberos principals needed by CDH services. (asynchronously)
     * Imports the KDC Account Manager credentials needed by Cloudera Manager to create kerberos principals needed by CDH services.
     * @param password Password for the Account Manager.  return Information about the submitted command. (optional)
     * @param username Username of the Account Manager. Full name including the Kerberos realm must be specified. (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
     */
    public okhttp3.Call importAdminCredentialsAsync(String password, String username, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = importAdminCredentialsValidateBeforeCall(password, username, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for importClusterTemplate
     * @param body cluster template (optional)
     * @param addRepositories if true the parcels repositories in the cluster template will be added. (optional, default to false)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call importClusterTemplateCall(ApiClusterTemplate body, Boolean addRepositories, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/importClusterTemplate";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (addRepositories != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("addRepositories", addRepositories));

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call importClusterTemplateValidateBeforeCall(ApiClusterTemplate body, Boolean addRepositories, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = importClusterTemplateCall(body, addRepositories, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Create cluster as per the given cluster template.
     * Create cluster as per the given cluster template
     * @param body cluster template (optional)
     * @param addRepositories if true the parcels repositories in the cluster template will be added. (optional, default to false)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand importClusterTemplate(ApiClusterTemplate body, Boolean addRepositories) throws ApiException {
        ApiResponse<ApiCommand> resp = importClusterTemplateWithHttpInfo(body, addRepositories);
        return resp.getData();
    }

    /**
     * Create cluster as per the given cluster template.
     * Create cluster as per the given cluster template
     * @param body cluster template (optional)
     * @param addRepositories if true the parcels repositories in the cluster template will be added. (optional, default to false)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> importClusterTemplateWithHttpInfo(ApiClusterTemplate body, Boolean addRepositories) throws ApiException {
        okhttp3.Call call = importClusterTemplateValidateBeforeCall(body, addRepositories, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Create cluster as per the given cluster template. (asynchronously)
     * Create cluster as per the given cluster template
     * @param body cluster template (optional)
     * @param addRepositories if true the parcels repositories in the cluster template will be added. (optional, default to false)
     * @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
     */
    public okhttp3.Call importClusterTemplateAsync(ApiClusterTemplate body, Boolean addRepositories, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = importClusterTemplateValidateBeforeCall(body, addRepositories, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for importKerberosPrincipal
     * @param kvno Key-version number of the password.  return Information about the submitted command. (optional)
     * @param password Password for the Kerberos principal. Cloudera Manager will encrypt the principal and password and use it when needed for a daemon. (optional)
     * @param principal Name of the principal. Full name including the Kerberos realm must be specified. If it already exists, it will be overwritten. (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call importKerberosPrincipalCall(java.math.BigDecimal kvno, String password, String principal, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/commands/importKerberosPrincipal";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (kvno != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("kvno", kvno));
        if (password != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("password", password));
        if (principal != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("principal", principal));

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call importKerberosPrincipalValidateBeforeCall(java.math.BigDecimal kvno, String password, String principal, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = importKerberosPrincipalCall(kvno, password, principal, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Imports the Kerberos credentials for the specified principal which can then be used to add to a role&#x27;s keytab by running Generate Credentials command.
     * Imports the Kerberos credentials for the specified principal which can then be used to add to a role&#x27;s keytab by running Generate Credentials command.
     * @param kvno Key-version number of the password.  return Information about the submitted command. (optional)
     * @param password Password for the Kerberos principal. Cloudera Manager will encrypt the principal and password and use it when needed for a daemon. (optional)
     * @param principal Name of the principal. Full name including the Kerberos realm must be specified. If it already exists, it will be overwritten. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand importKerberosPrincipal(java.math.BigDecimal kvno, String password, String principal) throws ApiException {
        ApiResponse<ApiCommand> resp = importKerberosPrincipalWithHttpInfo(kvno, password, principal);
        return resp.getData();
    }

    /**
     * Imports the Kerberos credentials for the specified principal which can then be used to add to a role&#x27;s keytab by running Generate Credentials command.
     * Imports the Kerberos credentials for the specified principal which can then be used to add to a role&#x27;s keytab by running Generate Credentials command.
     * @param kvno Key-version number of the password.  return Information about the submitted command. (optional)
     * @param password Password for the Kerberos principal. Cloudera Manager will encrypt the principal and password and use it when needed for a daemon. (optional)
     * @param principal Name of the principal. Full name including the Kerberos realm must be specified. If it already exists, it will be overwritten. (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> importKerberosPrincipalWithHttpInfo(java.math.BigDecimal kvno, String password, String principal) throws ApiException {
        okhttp3.Call call = importKerberosPrincipalValidateBeforeCall(kvno, password, principal, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Imports the Kerberos credentials for the specified principal which can then be used to add to a role&#x27;s keytab by running Generate Credentials command. (asynchronously)
     * Imports the Kerberos credentials for the specified principal which can then be used to add to a role&#x27;s keytab by running Generate Credentials command.
     * @param kvno Key-version number of the password.  return Information about the submitted command. (optional)
     * @param password Password for the Kerberos principal. Cloudera Manager will encrypt the principal and password and use it when needed for a daemon. (optional)
     * @param principal Name of the principal. Full name including the Kerberos realm must be specified. If it already exists, it will be overwritten. (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
     */
    public okhttp3.Call importKerberosPrincipalAsync(java.math.BigDecimal kvno, String password, String principal, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = importKerberosPrincipalValidateBeforeCall(kvno, password, principal, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for inspectHostsCommand
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call inspectHostsCommandCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/commands/inspectHosts";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call inspectHostsCommandValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = inspectHostsCommandCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * Runs the host inspector on the configured hosts.
     * Runs the host inspector on the configured hosts.
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand inspectHostsCommand() throws ApiException {
        ApiResponse<ApiCommand> resp = inspectHostsCommandWithHttpInfo();
        return resp.getData();
    }

    /**
     * Runs the host inspector on the configured hosts.
     * Runs the host inspector on the configured hosts.
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> inspectHostsCommandWithHttpInfo() throws ApiException {
        okhttp3.Call call = inspectHostsCommandValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Runs the host inspector on the configured hosts. (asynchronously)
     * Runs the host inspector on the configured hosts.
     * @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
     */
    public okhttp3.Call inspectHostsCommandAsync(final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = inspectHostsCommandValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for listActiveCommands
     * @param view The view of the data to materialize, either \&quot;summary\&quot; or \&quot;full\&quot;. (optional, default to summary)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call listActiveCommandsCall(String view, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/commands";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (view != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("view", view));

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call listActiveCommandsValidateBeforeCall(String view, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = listActiveCommandsCall(view, progressListener, progressRequestListener);
        return call;

    }

    /**
     * List active global commands.
     * List active global commands.
     * @param view The view of the data to materialize, either \&quot;summary\&quot; or \&quot;full\&quot;. (optional, default to summary)
     * @return ApiCommandList
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommandList listActiveCommands(String view) throws ApiException {
        ApiResponse<ApiCommandList> resp = listActiveCommandsWithHttpInfo(view);
        return resp.getData();
    }

    /**
     * List active global commands.
     * List active global commands.
     * @param view The view of the data to materialize, either \&quot;summary\&quot; or \&quot;full\&quot;. (optional, default to summary)
     * @return ApiResponse&lt;ApiCommandList&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommandList> listActiveCommandsWithHttpInfo(String view) throws ApiException {
        okhttp3.Call call = listActiveCommandsValidateBeforeCall(view, null, null);
        Type localVarReturnType = new TypeToken<ApiCommandList>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * List active global commands. (asynchronously)
     * List active global commands.
     * @param view The view of the data to materialize, either \&quot;summary\&quot; or \&quot;full\&quot;. (optional, default to summary)
     * @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
     */
    public okhttp3.Call listActiveCommandsAsync(String view, final ApiCallback<ApiCommandList> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = listActiveCommandsValidateBeforeCall(view, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommandList>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for listAllGeneratedUsageReports
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call listAllGeneratedUsageReportsCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/listAllGeneratedUsageReports";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call listAllGeneratedUsageReportsValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = listAllGeneratedUsageReportsCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * retrieve all generated cluster usage reports currently on disk.
     * retrieve all generated cluster usage reports currently on disk
     * @return String
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public String listAllGeneratedUsageReports() throws ApiException {
        ApiResponse<String> resp = listAllGeneratedUsageReportsWithHttpInfo();
        return resp.getData();
    }

    /**
     * retrieve all generated cluster usage reports currently on disk.
     * retrieve all generated cluster usage reports currently on disk
     * @return ApiResponse&lt;String&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<String> listAllGeneratedUsageReportsWithHttpInfo() throws ApiException {
        okhttp3.Call call = listAllGeneratedUsageReportsValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<String>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * retrieve all generated cluster usage reports currently on disk. (asynchronously)
     * retrieve all generated cluster usage reports currently on disk
     * @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
     */
    public okhttp3.Call listAllGeneratedUsageReportsAsync(final ApiCallback<String> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = listAllGeneratedUsageReportsValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<String>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for migrateCmcaToDb
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call migrateCmcaToDbCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/commands/migrateCmcaToDb";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call migrateCmcaToDbValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = migrateCmcaToDbCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * Migrate CMCA to the DB.
     * Migrate CMCA to the DB
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand migrateCmcaToDb() throws ApiException {
        ApiResponse<ApiCommand> resp = migrateCmcaToDbWithHttpInfo();
        return resp.getData();
    }

    /**
     * Migrate CMCA to the DB.
     * Migrate CMCA to the DB
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> migrateCmcaToDbWithHttpInfo() throws ApiException {
        okhttp3.Call call = migrateCmcaToDbValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Migrate CMCA to the DB. (asynchronously)
     * Migrate CMCA to the DB
     * @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
     */
    public okhttp3.Call migrateCmcaToDbAsync(final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = migrateCmcaToDbValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for readInstance
     * @param cmServerId The CM server ID. (required)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call readInstanceCall(String cmServerId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/instances/{cmServerId}"
            .replaceAll("\\{" + "cmServerId" + "\\}", apiClient.escapeString(cmServerId.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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call readInstanceValidateBeforeCall(String cmServerId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'cmServerId' is set
        if (cmServerId == null) {
            throw new ApiException("Missing the required parameter 'cmServerId' when calling readInstance(Async)");
        }

        okhttp3.Call call = readInstanceCall(cmServerId, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Retrieves the CM server information.
     * Retrieves the CM server information.  &lt;p&gt; Available since API v41. &lt;/p&gt;
     * @param cmServerId The CM server ID. (required)
     * @return ApiCmServer
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCmServer readInstance(String cmServerId) throws ApiException {
        ApiResponse<ApiCmServer> resp = readInstanceWithHttpInfo(cmServerId);
        return resp.getData();
    }

    /**
     * Retrieves the CM server information.
     * Retrieves the CM server information.  &lt;p&gt; Available since API v41. &lt;/p&gt;
     * @param cmServerId The CM server ID. (required)
     * @return ApiResponse&lt;ApiCmServer&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCmServer> readInstanceWithHttpInfo(String cmServerId) throws ApiException {
        okhttp3.Call call = readInstanceValidateBeforeCall(cmServerId, null, null);
        Type localVarReturnType = new TypeToken<ApiCmServer>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Retrieves the CM server information. (asynchronously)
     * Retrieves the CM server information.  &lt;p&gt; Available since API v41. &lt;/p&gt;
     * @param cmServerId The CM server ID. (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
     */
    public okhttp3.Call readInstanceAsync(String cmServerId, final ApiCallback<ApiCmServer> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = readInstanceValidateBeforeCall(cmServerId, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCmServer>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for readInstances
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call readInstancesCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/instances";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call readInstancesValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = readInstancesCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * Retrieves all CM server information.
     * Retrieves all CM server information.  &lt;p&gt; Available since API v41. &lt;/p&gt;
     * @return ApiCmServerList
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCmServerList readInstances() throws ApiException {
        ApiResponse<ApiCmServerList> resp = readInstancesWithHttpInfo();
        return resp.getData();
    }

    /**
     * Retrieves all CM server information.
     * Retrieves all CM server information.  &lt;p&gt; Available since API v41. &lt;/p&gt;
     * @return ApiResponse&lt;ApiCmServerList&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCmServerList> readInstancesWithHttpInfo() throws ApiException {
        okhttp3.Call call = readInstancesValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<ApiCmServerList>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Retrieves all CM server information. (asynchronously)
     * Retrieves all CM server information.  &lt;p&gt; Available since API v41. &lt;/p&gt;
     * @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
     */
    public okhttp3.Call readInstancesAsync(final ApiCallback<ApiCmServerList> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = readInstancesValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCmServerList>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for readLicense
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call readLicenseCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/license";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call readLicenseValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = readLicenseCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * Retrieve information about the Cloudera Manager license.
     * Retrieve information about the Cloudera Manager license.
     * @return ApiLicense
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiLicense readLicense() throws ApiException {
        ApiResponse<ApiLicense> resp = readLicenseWithHttpInfo();
        return resp.getData();
    }

    /**
     * Retrieve information about the Cloudera Manager license.
     * Retrieve information about the Cloudera Manager license.
     * @return ApiResponse&lt;ApiLicense&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiLicense> readLicenseWithHttpInfo() throws ApiException {
        okhttp3.Call call = readLicenseValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<ApiLicense>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Retrieve information about the Cloudera Manager license. (asynchronously)
     * Retrieve information about the Cloudera Manager license.
     * @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
     */
    public okhttp3.Call readLicenseAsync(final ApiCallback<ApiLicense> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = readLicenseValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiLicense>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for refreshParcelRepos
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call refreshParcelReposCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/commands/refreshParcelRepos";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call refreshParcelReposValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = refreshParcelReposCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * .
     * &lt;p&gt; Submit a command to refresh parcels information. &lt;/p&gt; &lt;p&gt; This API could be used following two scenarios.&lt;br&gt; - User updated Cloudera Manager&#x27;s local parcel repository. &lt;br&gt; - User updated remote parcel locations. &lt;p&gt; User wants to invoke this API to make sure that Cloudera Manager gets latest parcels information. User can then monitor the returned command before proceeding to the next step. &lt;/p&gt;
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand refreshParcelRepos() throws ApiException {
        ApiResponse<ApiCommand> resp = refreshParcelReposWithHttpInfo();
        return resp.getData();
    }

    /**
     * .
     * &lt;p&gt; Submit a command to refresh parcels information. &lt;/p&gt; &lt;p&gt; This API could be used following two scenarios.&lt;br&gt; - User updated Cloudera Manager&#x27;s local parcel repository. &lt;br&gt; - User updated remote parcel locations. &lt;p&gt; User wants to invoke this API to make sure that Cloudera Manager gets latest parcels information. User can then monitor the returned command before proceeding to the next step. &lt;/p&gt;
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> refreshParcelReposWithHttpInfo() throws ApiException {
        okhttp3.Call call = refreshParcelReposValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * . (asynchronously)
     * &lt;p&gt; Submit a command to refresh parcels information. &lt;/p&gt; &lt;p&gt; This API could be used following two scenarios.&lt;br&gt; - User updated Cloudera Manager&#x27;s local parcel repository. &lt;br&gt; - User updated remote parcel locations. &lt;p&gt; User wants to invoke this API to make sure that Cloudera Manager gets latest parcels information. User can then monitor the returned command before proceeding to the next step. &lt;/p&gt;
     * @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
     */
    public okhttp3.Call refreshParcelReposAsync(final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = refreshParcelReposValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for retrieveKeytab
     * @param body  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call retrieveKeytabCall(ApiPrincipalList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/retrieveKeytab";

        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/octet-stream"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call retrieveKeytabValidateBeforeCall(ApiPrincipalList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = retrieveKeytabCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Retrieves a keytab for a list of principals.
     * Retrieves a keytab for a list of principals. The principals must already exist.
     * @param body  (optional)
     * @return File
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public File retrieveKeytab(ApiPrincipalList body) throws ApiException {
        ApiResponse<File> resp = retrieveKeytabWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Retrieves a keytab for a list of principals.
     * Retrieves a keytab for a list of principals. The principals must already exist.
     * @param body  (optional)
     * @return ApiResponse&lt;File&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<File> retrieveKeytabWithHttpInfo(ApiPrincipalList body) throws ApiException {
        okhttp3.Call call = retrieveKeytabValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<File>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Retrieves a keytab for a list of principals. (asynchronously)
     * Retrieves a keytab for a list of principals. The principals must already exist.
     * @param body  (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
     */
    public okhttp3.Call retrieveKeytabAsync(ApiPrincipalList body, final ApiCallback<File> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = retrieveKeytabValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<File>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for rotateCspKeys
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call rotateCspKeysCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/commands/rotateCspKeys";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call rotateCspKeysValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = rotateCspKeysCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * Perform rotation of the CSP key.
     * Perform rotation of the CSP key. The previously encrypted text will be decrypted using the older key. Then It will be re-encrypted using the new CSP key.The new encrypted text will be stored in the database.
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand rotateCspKeys() throws ApiException {
        ApiResponse<ApiCommand> resp = rotateCspKeysWithHttpInfo();
        return resp.getData();
    }

    /**
     * Perform rotation of the CSP key.
     * Perform rotation of the CSP key. The previously encrypted text will be decrypted using the older key. Then It will be re-encrypted using the new CSP key.The new encrypted text will be stored in the database.
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> rotateCspKeysWithHttpInfo() throws ApiException {
        okhttp3.Call call = rotateCspKeysValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Perform rotation of the CSP key. (asynchronously)
     * Perform rotation of the CSP key. The previously encrypted text will be decrypted using the older key. Then It will be re-encrypted using the new CSP key.The new encrypted text will be stored in the database.
     * @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
     */
    public okhttp3.Call rotateCspKeysAsync(final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = rotateCspKeysValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for sendUsageReport
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call sendUsageReportCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/sendUsageReport";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call sendUsageReportValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = sendUsageReportCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * Send Usage reports for clusters to cloudera ops.
     * Send Usage reports for clusters to cloudera ops
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand sendUsageReport() throws ApiException {
        ApiResponse<ApiCommand> resp = sendUsageReportWithHttpInfo();
        return resp.getData();
    }

    /**
     * Send Usage reports for clusters to cloudera ops.
     * Send Usage reports for clusters to cloudera ops
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> sendUsageReportWithHttpInfo() throws ApiException {
        okhttp3.Call call = sendUsageReportValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Send Usage reports for clusters to cloudera ops. (asynchronously)
     * Send Usage reports for clusters to cloudera ops
     * @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
     */
    public okhttp3.Call sendUsageReportAsync(final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = sendUsageReportValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for testExternalAuthentication
     * @param body  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call testExternalAuthenticationCall(ApiTestCmExternalAuthArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/commands/testExternalAuthentication";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call testExternalAuthenticationValidateBeforeCall(ApiTestCmExternalAuthArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = testExternalAuthenticationCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Launches a command to test the currently configured external authentication.
     * Launches a command to test the currently configured external authentication
     * @param body  (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand testExternalAuthentication(ApiTestCmExternalAuthArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = testExternalAuthenticationWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Launches a command to test the currently configured external authentication.
     * Launches a command to test the currently configured external authentication
     * @param body  (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> testExternalAuthenticationWithHttpInfo(ApiTestCmExternalAuthArguments body) throws ApiException {
        okhttp3.Call call = testExternalAuthenticationValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Launches a command to test the currently configured external authentication. (asynchronously)
     * Launches a command to test the currently configured external authentication
     * @param body  (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
     */
    public okhttp3.Call testExternalAuthenticationAsync(ApiTestCmExternalAuthArguments body, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = testExternalAuthenticationValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for updateConfig
     * @param body Settings to update. (optional)
     * @param message Optional message describing the changes. (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call updateConfigCall(ApiConfigList body, String message, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/config";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (message != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("message", message));

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call updateConfigValidateBeforeCall(ApiConfigList body, String message, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = updateConfigCall(body, message, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Update the Cloudera Manager settings.
     * Update the Cloudera Manager settings. &lt;p&gt; If a value is set in the given configuration, it will be added to the manager&#x27;s settings, replacing any existing entry. If a value is unset (its value is null), the existing the setting will be erased. &lt;p&gt; Settings that are not listed in the input will maintain their current values.
     * @param body Settings to update. (optional)
     * @param message Optional message describing the changes. (optional)
     * @return ApiConfigList
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiConfigList updateConfig(ApiConfigList body, String message) throws ApiException {
        ApiResponse<ApiConfigList> resp = updateConfigWithHttpInfo(body, message);
        return resp.getData();
    }

    /**
     * Update the Cloudera Manager settings.
     * Update the Cloudera Manager settings. &lt;p&gt; If a value is set in the given configuration, it will be added to the manager&#x27;s settings, replacing any existing entry. If a value is unset (its value is null), the existing the setting will be erased. &lt;p&gt; Settings that are not listed in the input will maintain their current values.
     * @param body Settings to update. (optional)
     * @param message Optional message describing the changes. (optional)
     * @return ApiResponse&lt;ApiConfigList&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiConfigList> updateConfigWithHttpInfo(ApiConfigList body, String message) throws ApiException {
        okhttp3.Call call = updateConfigValidateBeforeCall(body, message, null, null);
        Type localVarReturnType = new TypeToken<ApiConfigList>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Update the Cloudera Manager settings. (asynchronously)
     * Update the Cloudera Manager settings. &lt;p&gt; If a value is set in the given configuration, it will be added to the manager&#x27;s settings, replacing any existing entry. If a value is unset (its value is null), the existing the setting will be erased. &lt;p&gt; Settings that are not listed in the input will maintain their current values.
     * @param body Settings to update. (optional)
     * @param message Optional message describing the changes. (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
     */
    public okhttp3.Call updateConfigAsync(ApiConfigList body, String message, final ApiCallback<ApiConfigList> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = updateConfigValidateBeforeCall(body, message, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiConfigList>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for updateCspType
     * @param body  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call updateCspTypeCall(ApiUpdateCspTypeArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/commands/updateCspType";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call updateCspTypeValidateBeforeCall(ApiUpdateCspTypeArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = updateCspTypeCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Updates the CSP type from previous csp type to new csp type, by copying the key_id (used for encryption of configs) from previous csp type to new csp type or from one location to another in same CSP type.
     * Updates the CSP type from previous csp type to new csp type, by copying the key_id (used for encryption of configs) from previous csp type to new csp type or from one location to another in same CSP type.
     * @param body  (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand updateCspType(ApiUpdateCspTypeArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = updateCspTypeWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Updates the CSP type from previous csp type to new csp type, by copying the key_id (used for encryption of configs) from previous csp type to new csp type or from one location to another in same CSP type.
     * Updates the CSP type from previous csp type to new csp type, by copying the key_id (used for encryption of configs) from previous csp type to new csp type or from one location to another in same CSP type.
     * @param body  (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> updateCspTypeWithHttpInfo(ApiUpdateCspTypeArguments body) throws ApiException {
        okhttp3.Call call = updateCspTypeValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Updates the CSP type from previous csp type to new csp type, by copying the key_id (used for encryption of configs) from previous csp type to new csp type or from one location to another in same CSP type. (asynchronously)
     * Updates the CSP type from previous csp type to new csp type, by copying the key_id (used for encryption of configs) from previous csp type to new csp type or from one location to another in same CSP type.
     * @param body  (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
     */
    public okhttp3.Call updateCspTypeAsync(ApiUpdateCspTypeArguments body, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = updateCspTypeValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for updateDeployment2
     * @param body The deployment to create (optional)
     * @param deleteCurrentDeployment If true, the current deployment is deleted before the specified deployment is applied (optional, default to false)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call updateDeployment2Call(ApiDeployment2 body, Boolean deleteCurrentDeployment, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/deployment";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (deleteCurrentDeployment != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("deleteCurrentDeployment", deleteCurrentDeployment));

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call updateDeployment2ValidateBeforeCall(ApiDeployment2 body, Boolean deleteCurrentDeployment, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = updateDeployment2Call(body, deleteCurrentDeployment, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Apply the supplied deployment description to the system.
     * Apply the supplied deployment description to the system. This will create the clusters, services, hosts and other objects specified in the argument. This call does not allow for any merge conflicts. If an entity already exists in the system, this call will fail. You can request, however, that all entities in the system are deleted before instantiating the new ones. &lt;p/&gt; You may specify a complete or partial deployment, e.g. you can provide host info with no clusters.  However, if you request that the current deployment be deleted, you are required to specify at least one admin user or this call will fail. This is to protect you from creating a system that cannot be logged into again. &lt;p/&gt; If there are any errors creating (or optionally deleting) a deployment, all changes will be rolled back leaving the system exactly as it was before calling this method.  The system will never be left in a state where part of the deployment is created and other parts are not. &lt;p/&gt; If the submitted deployment contains entities that require Cloudera Enterprise license, then the license should be provided to Cloudera Manager before making this API call.
     * @param body The deployment to create (optional)
     * @param deleteCurrentDeployment If true, the current deployment is deleted before the specified deployment is applied (optional, default to false)
     * @return ApiDeployment2
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiDeployment2 updateDeployment2(ApiDeployment2 body, Boolean deleteCurrentDeployment) throws ApiException {
        ApiResponse<ApiDeployment2> resp = updateDeployment2WithHttpInfo(body, deleteCurrentDeployment);
        return resp.getData();
    }

    /**
     * Apply the supplied deployment description to the system.
     * Apply the supplied deployment description to the system. This will create the clusters, services, hosts and other objects specified in the argument. This call does not allow for any merge conflicts. If an entity already exists in the system, this call will fail. You can request, however, that all entities in the system are deleted before instantiating the new ones. &lt;p/&gt; You may specify a complete or partial deployment, e.g. you can provide host info with no clusters.  However, if you request that the current deployment be deleted, you are required to specify at least one admin user or this call will fail. This is to protect you from creating a system that cannot be logged into again. &lt;p/&gt; If there are any errors creating (or optionally deleting) a deployment, all changes will be rolled back leaving the system exactly as it was before calling this method.  The system will never be left in a state where part of the deployment is created and other parts are not. &lt;p/&gt; If the submitted deployment contains entities that require Cloudera Enterprise license, then the license should be provided to Cloudera Manager before making this API call.
     * @param body The deployment to create (optional)
     * @param deleteCurrentDeployment If true, the current deployment is deleted before the specified deployment is applied (optional, default to false)
     * @return ApiResponse&lt;ApiDeployment2&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiDeployment2> updateDeployment2WithHttpInfo(ApiDeployment2 body, Boolean deleteCurrentDeployment) throws ApiException {
        okhttp3.Call call = updateDeployment2ValidateBeforeCall(body, deleteCurrentDeployment, null, null);
        Type localVarReturnType = new TypeToken<ApiDeployment2>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Apply the supplied deployment description to the system. (asynchronously)
     * Apply the supplied deployment description to the system. This will create the clusters, services, hosts and other objects specified in the argument. This call does not allow for any merge conflicts. If an entity already exists in the system, this call will fail. You can request, however, that all entities in the system are deleted before instantiating the new ones. &lt;p/&gt; You may specify a complete or partial deployment, e.g. you can provide host info with no clusters.  However, if you request that the current deployment be deleted, you are required to specify at least one admin user or this call will fail. This is to protect you from creating a system that cannot be logged into again. &lt;p/&gt; If there are any errors creating (or optionally deleting) a deployment, all changes will be rolled back leaving the system exactly as it was before calling this method.  The system will never be left in a state where part of the deployment is created and other parts are not. &lt;p/&gt; If the submitted deployment contains entities that require Cloudera Enterprise license, then the license should be provided to Cloudera Manager before making this API call.
     * @param body The deployment to create (optional)
     * @param deleteCurrentDeployment If true, the current deployment is deleted before the specified deployment is applied (optional, default to false)
     * @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
     */
    public okhttp3.Call updateDeployment2Async(ApiDeployment2 body, Boolean deleteCurrentDeployment, final ApiCallback<ApiDeployment2> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = updateDeployment2ValidateBeforeCall(body, deleteCurrentDeployment, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiDeployment2>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for updateGlobalTruststore
     * @param body  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call updateGlobalTruststoreCall(ApiUpdateGlobalTruststoreArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/cm/commands/updateGlobalTruststore";

        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"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

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

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call updateGlobalTruststoreValidateBeforeCall(ApiUpdateGlobalTruststoreArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = updateGlobalTruststoreCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Add/remove certificates to the Auto-TLS certificate truststore.
     * Add/remove certificates to the Auto-TLS certificate truststore
     * @param body  (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand updateGlobalTruststore(ApiUpdateGlobalTruststoreArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = updateGlobalTruststoreWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Add/remove certificates to the Auto-TLS certificate truststore.
     * Add/remove certificates to the Auto-TLS certificate truststore
     * @param body  (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> updateGlobalTruststoreWithHttpInfo(ApiUpdateGlobalTruststoreArguments body) throws ApiException {
        okhttp3.Call call = updateGlobalTruststoreValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Add/remove certificates to the Auto-TLS certificate truststore. (asynchronously)
     * Add/remove certificates to the Auto-TLS certificate truststore
     * @param body  (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
     */
    public okhttp3.Call updateGlobalTruststoreAsync(ApiUpdateGlobalTruststoreArguments body, final ApiCallback<ApiCommand> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = updateGlobalTruststoreValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for updateLicense
     * @param license  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call updateLicenseCall(File license, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/cm/license";

        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>();
        if (license != null)
        localVarFormParams.put("license", license);

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

        final String[] localVarContentTypes = {
            "multipart/form-data"
        };
        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
                @Override
                public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
                    okhttp3.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

        String[] localVarAuthNames = new String[] { "basic" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call updateLicenseValidateBeforeCall(File license, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        okhttp3.Call call = updateLicenseCall(license, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Updates the Cloudera Manager license.
     * Updates the Cloudera Manager license. &lt;p&gt; After a new license is installed, the Cloudera Manager needs to be restarted for the changes to take effect. &lt;p&gt; The license file should be uploaded using a request with content type \&quot;multipart/form-data\&quot;, instead of being encoded into a JSON representation.
     * @param license  (optional)
     * @return ApiLicense
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiLicense updateLicense(File license) throws ApiException {
        ApiResponse<ApiLicense> resp = updateLicenseWithHttpInfo(license);
        return resp.getData();
    }

    /**
     * Updates the Cloudera Manager license.
     * Updates the Cloudera Manager license. &lt;p&gt; After a new license is installed, the Cloudera Manager needs to be restarted for the changes to take effect. &lt;p&gt; The license file should be uploaded using a request with content type \&quot;multipart/form-data\&quot;, instead of being encoded into a JSON representation.
     * @param license  (optional)
     * @return ApiResponse&lt;ApiLicense&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiLicense> updateLicenseWithHttpInfo(File license) throws ApiException {
        okhttp3.Call call = updateLicenseValidateBeforeCall(license, null, null);
        Type localVarReturnType = new TypeToken<ApiLicense>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Updates the Cloudera Manager license. (asynchronously)
     * Updates the Cloudera Manager license. &lt;p&gt; After a new license is installed, the Cloudera Manager needs to be restarted for the changes to take effect. &lt;p&gt; The license file should be uploaded using a request with content type \&quot;multipart/form-data\&quot;, instead of being encoded into a JSON representation.
     * @param license  (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
     */
    public okhttp3.Call updateLicenseAsync(File license, final ApiCallback<ApiLicense> callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        okhttp3.Call call = updateLicenseValidateBeforeCall(license, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiLicense>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
}
