/*
 * 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.ApiAddSBNNToNSArguments;
import com.cloudera.api.swagger.model.ApiCommand;
import com.cloudera.api.swagger.model.ApiCommandList;
import com.cloudera.api.swagger.model.ApiCommandMetadataList;
import com.cloudera.api.swagger.model.ApiDisableCatalogStatestoreHaArguments;
import com.cloudera.api.swagger.model.ApiDisableJtHaArguments;
import com.cloudera.api.swagger.model.ApiDisableLlamaHaArguments;
import com.cloudera.api.swagger.model.ApiDisableNnHaArguments;
import com.cloudera.api.swagger.model.ApiDisableOozieHaArguments;
import com.cloudera.api.swagger.model.ApiDisableRmHaArguments;
import com.cloudera.api.swagger.model.ApiDisableSentryHaArgs;
import com.cloudera.api.swagger.model.ApiEnableCatalogStatestoreHaArguments;
import com.cloudera.api.swagger.model.ApiEnableJtHaArguments;
import com.cloudera.api.swagger.model.ApiEnableLlamaHaArguments;
import com.cloudera.api.swagger.model.ApiEnableLlamaRmArguments;
import com.cloudera.api.swagger.model.ApiEnableNnHaArguments;
import com.cloudera.api.swagger.model.ApiEnableOozieHaArguments;
import com.cloudera.api.swagger.model.ApiEnableRmHaArguments;
import com.cloudera.api.swagger.model.ApiEnableSentryHaArgs;
import com.cloudera.api.swagger.model.ApiEntityTag;
import com.cloudera.api.swagger.model.ApiHBaseReplicationSetupCleanAndResetArgs;
import com.cloudera.api.swagger.model.ApiHBaseReplicationSetupCommandArgs;
import com.cloudera.api.swagger.model.ApiHBaseReplicationSetupOneClusterOnlyCmdArgs;
import com.cloudera.api.swagger.model.ApiHBaseReplicationSetupStatus;
import com.cloudera.api.swagger.model.ApiHBaseShellCommand;
import com.cloudera.api.swagger.model.ApiHdfsDisableHaArguments;
import com.cloudera.api.swagger.model.ApiHdfsFailoverArguments;
import com.cloudera.api.swagger.model.ApiHdfsHaArguments;
import com.cloudera.api.swagger.model.ApiHdfsUsageReport;
import com.cloudera.api.swagger.model.ApiIcebergReplicationAccessStatus;
import com.cloudera.api.swagger.model.ApiImpalaUtilization;
import com.cloudera.api.swagger.model.ApiMetricList;
import com.cloudera.api.swagger.model.ApiMrUsageReport;
import com.cloudera.api.swagger.model.ApiRangerPolicyList;
import com.cloudera.api.swagger.model.ApiRangerServiceList;
import com.cloudera.api.swagger.model.ApiRangerUserList;
import com.cloudera.api.swagger.model.ApiRoleNameList;
import com.cloudera.api.swagger.model.ApiRoleTypeList;
import com.cloudera.api.swagger.model.ApiRollEditsArgs;
import com.cloudera.api.swagger.model.ApiRollingRestartArgs;
import com.cloudera.api.swagger.model.ApiService;
import com.cloudera.api.swagger.model.ApiServiceConfig;
import com.cloudera.api.swagger.model.ApiServiceList;
import com.cloudera.api.swagger.model.ApiServiceRef;
import com.cloudera.api.swagger.model.ApiStringList;
import com.cloudera.api.swagger.model.ApiYarnApplicationDiagnosticsCollectionArgs;
import com.cloudera.api.swagger.model.ApiYarnUtilization;
import com.cloudera.api.swagger.model.DeleteHdfsPathResult;
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 ServicesResourceApi {
    private ApiClient apiClient;

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

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

    public ApiClient getApiClient() {
        return apiClient;
    }

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

    /**
     * Build call for addTags
     * @param clusterName  (required)
     * @param serviceName Name of the service (required)
     * @param body List of tags to add to the service (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 addTagsCall(String clusterName, String serviceName, List<ApiEntityTag> body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/tags"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 addTagsValidateBeforeCall(String clusterName, String serviceName, List<ApiEntityTag> body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling addTags(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling addTags(Async)");
        }

        okhttp3.Call call = addTagsCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Attach tags to the service.
     * Attach tags to the service. Tag names beginning with the prefix _cldr_ (case insensitive) are reserved for internal use by Cloudera.
     * @param clusterName  (required)
     * @param serviceName Name of the service (required)
     * @param body List of tags to add to the service (optional)
     * @return List&lt;ApiEntityTag&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<ApiEntityTag> addTags(String clusterName, String serviceName, List<ApiEntityTag> body) throws ApiException {
        ApiResponse<List<ApiEntityTag>> resp = addTagsWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Attach tags to the service.
     * Attach tags to the service. Tag names beginning with the prefix _cldr_ (case insensitive) are reserved for internal use by Cloudera.
     * @param clusterName  (required)
     * @param serviceName Name of the service (required)
     * @param body List of tags to add to the service (optional)
     * @return ApiResponse&lt;List&lt;ApiEntityTag&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<ApiEntityTag>> addTagsWithHttpInfo(String clusterName, String serviceName, List<ApiEntityTag> body) throws ApiException {
        okhttp3.Call call = addTagsValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<List<ApiEntityTag>>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Attach tags to the service. (asynchronously)
     * Attach tags to the service. Tag names beginning with the prefix _cldr_ (case insensitive) are reserved for internal use by Cloudera.
     * @param clusterName  (required)
     * @param serviceName Name of the service (required)
     * @param body List of tags to add to the service (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 addTagsAsync(String clusterName, String serviceName, List<ApiEntityTag> body, final ApiCallback<List<ApiEntityTag>> 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 = addTagsValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<ApiEntityTag>>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for collectYarnApplicationDiagnostics
     * @param clusterName  (required)
     * @param serviceName Name of the YARN service on which to run the command. (required)
     * @param body Arguments used for collecting diagnostics data for Yarn applications (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 collectYarnApplicationDiagnosticsCall(String clusterName, String serviceName, ApiYarnApplicationDiagnosticsCollectionArgs body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/yarnApplicationDiagnosticsCollection"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 collectYarnApplicationDiagnosticsValidateBeforeCall(String clusterName, String serviceName, ApiYarnApplicationDiagnosticsCollectionArgs body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling collectYarnApplicationDiagnostics(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling collectYarnApplicationDiagnostics(Async)");
        }

        okhttp3.Call call = collectYarnApplicationDiagnosticsCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Collect the Diagnostics data for Yarn applications.
     * Collect the Diagnostics data for Yarn applications &lt;p&gt; Available since API v8.
     * @param clusterName  (required)
     * @param serviceName Name of the YARN service on which to run the command. (required)
     * @param body Arguments used for collecting diagnostics data for Yarn applications (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand collectYarnApplicationDiagnostics(String clusterName, String serviceName, ApiYarnApplicationDiagnosticsCollectionArgs body) throws ApiException {
        ApiResponse<ApiCommand> resp = collectYarnApplicationDiagnosticsWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Collect the Diagnostics data for Yarn applications.
     * Collect the Diagnostics data for Yarn applications &lt;p&gt; Available since API v8.
     * @param clusterName  (required)
     * @param serviceName Name of the YARN service on which to run the command. (required)
     * @param body Arguments used for collecting diagnostics data for Yarn applications (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> collectYarnApplicationDiagnosticsWithHttpInfo(String clusterName, String serviceName, ApiYarnApplicationDiagnosticsCollectionArgs body) throws ApiException {
        okhttp3.Call call = collectYarnApplicationDiagnosticsValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Collect the Diagnostics data for Yarn applications. (asynchronously)
     * Collect the Diagnostics data for Yarn applications &lt;p&gt; Available since API v8.
     * @param clusterName  (required)
     * @param serviceName Name of the YARN service on which to run the command. (required)
     * @param body Arguments used for collecting diagnostics data for Yarn applications (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 collectYarnApplicationDiagnosticsAsync(String clusterName, String serviceName, ApiYarnApplicationDiagnosticsCollectionArgs 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 = collectYarnApplicationDiagnosticsValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for copyHdfsFile
     * @param clusterName  (required)
     * @param serviceName The source HDFS service (required)
     * @param body ApiServiceRef for the destination (optional)
     * @param destinationPath HDFS full path at destination (optional)
     * @param sourcePath HDFS full path at source (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 copyHdfsFileCall(String clusterName, String serviceName, ApiServiceRef body, String destinationPath, String sourcePath, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/copyHdfsFile"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

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

        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 copyHdfsFileValidateBeforeCall(String clusterName, String serviceName, ApiServiceRef body, String destinationPath, String sourcePath, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling copyHdfsFile(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling copyHdfsFile(Async)");
        }

        okhttp3.Call call = copyHdfsFileCall(clusterName, serviceName, body, destinationPath, sourcePath, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Copies source HDFS file to destination cluster HDFS.
     * Copies source HDFS file to destination cluster HDFS
     * @param clusterName  (required)
     * @param serviceName The source HDFS service (required)
     * @param body ApiServiceRef for the destination (optional)
     * @param destinationPath HDFS full path at destination (optional)
     * @param sourcePath HDFS full path at source (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand copyHdfsFile(String clusterName, String serviceName, ApiServiceRef body, String destinationPath, String sourcePath) throws ApiException {
        ApiResponse<ApiCommand> resp = copyHdfsFileWithHttpInfo(clusterName, serviceName, body, destinationPath, sourcePath);
        return resp.getData();
    }

    /**
     * Copies source HDFS file to destination cluster HDFS.
     * Copies source HDFS file to destination cluster HDFS
     * @param clusterName  (required)
     * @param serviceName The source HDFS service (required)
     * @param body ApiServiceRef for the destination (optional)
     * @param destinationPath HDFS full path at destination (optional)
     * @param sourcePath HDFS full path at source (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> copyHdfsFileWithHttpInfo(String clusterName, String serviceName, ApiServiceRef body, String destinationPath, String sourcePath) throws ApiException {
        okhttp3.Call call = copyHdfsFileValidateBeforeCall(clusterName, serviceName, body, destinationPath, sourcePath, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Copies source HDFS file to destination cluster HDFS. (asynchronously)
     * Copies source HDFS file to destination cluster HDFS
     * @param clusterName  (required)
     * @param serviceName The source HDFS service (required)
     * @param body ApiServiceRef for the destination (optional)
     * @param destinationPath HDFS full path at destination (optional)
     * @param sourcePath HDFS full path at source (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 copyHdfsFileAsync(String clusterName, String serviceName, ApiServiceRef body, String destinationPath, String sourcePath, 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 = copyHdfsFileValidateBeforeCall(clusterName, serviceName, body, destinationPath, sourcePath, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createBeeswaxWarehouseCommand
     * @param clusterName  (required)
     * @param serviceName The Hue service name. (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 createBeeswaxWarehouseCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hueCreateHiveWarehouse"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = createBeeswaxWarehouseCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Create the Beeswax role&#x27;s Hive warehouse directory, on Hue services.
     * Create the Beeswax role&#x27;s Hive warehouse directory, on Hue services.
     * @param clusterName  (required)
     * @param serviceName The Hue service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand createBeeswaxWarehouseCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = createBeeswaxWarehouseCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Create the Beeswax role&#x27;s Hive warehouse directory, on Hue services.
     * Create the Beeswax role&#x27;s Hive warehouse directory, on Hue services.
     * @param clusterName  (required)
     * @param serviceName The Hue service name. (required)
     * @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> createBeeswaxWarehouseCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = createBeeswaxWarehouseCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Create the Beeswax role&#x27;s Hive warehouse directory, on Hue services. (asynchronously)
     * Create the Beeswax role&#x27;s Hive warehouse directory, on Hue services.
     * @param clusterName  (required)
     * @param serviceName The Hue service name. (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 createBeeswaxWarehouseCommandAsync(String clusterName, String serviceName, 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 = createBeeswaxWarehouseCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createHBaseRootCommand
     * @param clusterName  (required)
     * @param serviceName The HBase service name. (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 createHBaseRootCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hbaseCreateRoot"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = createHBaseRootCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Creates the root directory of an HBase service.
     * Creates the root directory of an HBase service.
     * @param clusterName  (required)
     * @param serviceName The HBase service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand createHBaseRootCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = createHBaseRootCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Creates the root directory of an HBase service.
     * Creates the root directory of an HBase service.
     * @param clusterName  (required)
     * @param serviceName The HBase service name. (required)
     * @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> createHBaseRootCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = createHBaseRootCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Creates the root directory of an HBase service. (asynchronously)
     * Creates the root directory of an HBase service.
     * @param clusterName  (required)
     * @param serviceName The HBase service name. (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 createHBaseRootCommandAsync(String clusterName, String serviceName, 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 = createHBaseRootCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createHdfsFile
     * @param clusterName  (required)
     * @param serviceName The HDFS service name (required)
     * @param body Content to be put in the file to be created (optional)
     * @param overwrite If true overwrite the file (optional, default to false)
     * @param path full path to the HDFS file to be created (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 createHdfsFileCall(String clusterName, String serviceName, String body, Boolean overwrite, String path, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/createHdfsFile"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

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

        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 createHdfsFileValidateBeforeCall(String clusterName, String serviceName, String body, Boolean overwrite, String path, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling createHdfsFile(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling createHdfsFile(Async)");
        }

        okhttp3.Call call = createHdfsFileCall(clusterName, serviceName, body, overwrite, path, progressListener, progressRequestListener);
        return call;

    }

    /**
     * 
     * 
     * @param clusterName  (required)
     * @param serviceName The HDFS service name (required)
     * @param body Content to be put in the file to be created (optional)
     * @param overwrite If true overwrite the file (optional, default to false)
     * @param path full path to the HDFS file to be created (optional)
     * @return String
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public String createHdfsFile(String clusterName, String serviceName, String body, Boolean overwrite, String path) throws ApiException {
        ApiResponse<String> resp = createHdfsFileWithHttpInfo(clusterName, serviceName, body, overwrite, path);
        return resp.getData();
    }

    /**
     * 
     * 
     * @param clusterName  (required)
     * @param serviceName The HDFS service name (required)
     * @param body Content to be put in the file to be created (optional)
     * @param overwrite If true overwrite the file (optional, default to false)
     * @param path full path to the HDFS file to be created (optional)
     * @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> createHdfsFileWithHttpInfo(String clusterName, String serviceName, String body, Boolean overwrite, String path) throws ApiException {
        okhttp3.Call call = createHdfsFileValidateBeforeCall(clusterName, serviceName, body, overwrite, path, null, null);
        Type localVarReturnType = new TypeToken<String>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     *  (asynchronously)
     * 
     * @param clusterName  (required)
     * @param serviceName The HDFS service name (required)
     * @param body Content to be put in the file to be created (optional)
     * @param overwrite If true overwrite the file (optional, default to false)
     * @param path full path to the HDFS file to be created (optional)
     * @param callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     */
    public okhttp3.Call createHdfsFileAsync(String clusterName, String serviceName, String body, Boolean overwrite, String path, 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 = createHdfsFileValidateBeforeCall(clusterName, serviceName, body, overwrite, path, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<String>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createHiveUserDirCommand
     * @param clusterName  (required)
     * @param serviceName The Hive service name. (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 createHiveUserDirCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hiveCreateHiveUserDir"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = createHiveUserDirCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Create the Hive user directory.
     * Create the Hive user directory &lt;p&gt; Available since API v4. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The Hive service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand createHiveUserDirCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = createHiveUserDirCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Create the Hive user directory.
     * Create the Hive user directory &lt;p&gt; Available since API v4. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The Hive service name. (required)
     * @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> createHiveUserDirCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = createHiveUserDirCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Create the Hive user directory. (asynchronously)
     * Create the Hive user directory &lt;p&gt; Available since API v4. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The Hive service name. (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 createHiveUserDirCommandAsync(String clusterName, String serviceName, 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 = createHiveUserDirCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createHiveWarehouseCommand
     * @param clusterName  (required)
     * @param serviceName The Hive service name. (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 createHiveWarehouseCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hiveCreateHiveWarehouse"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = createHiveWarehouseCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Create the Hive warehouse directory, on Hive services.
     * Create the Hive warehouse directory, on Hive services. &lt;p&gt; Available since API v3. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The Hive service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand createHiveWarehouseCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = createHiveWarehouseCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Create the Hive warehouse directory, on Hive services.
     * Create the Hive warehouse directory, on Hive services. &lt;p&gt; Available since API v3. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The Hive service name. (required)
     * @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> createHiveWarehouseCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = createHiveWarehouseCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Create the Hive warehouse directory, on Hive services. (asynchronously)
     * Create the Hive warehouse directory, on Hive services. &lt;p&gt; Available since API v3. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The Hive service name. (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 createHiveWarehouseCommandAsync(String clusterName, String serviceName, 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 = createHiveWarehouseCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createHiveWarehouseExternalCommand
     * @param clusterName  (required)
     * @param serviceName The Hive service name. (required)
     * @param directory Name of the warehouse external directory. (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 createHiveWarehouseExternalCommandCall(String clusterName, String serviceName, String directory, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hiveCreateHiveWarehouseExternal"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

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

        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 createHiveWarehouseExternalCommandValidateBeforeCall(String clusterName, String serviceName, String directory, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling createHiveWarehouseExternalCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling createHiveWarehouseExternalCommand(Async)");
        }

        okhttp3.Call call = createHiveWarehouseExternalCommandCall(clusterName, serviceName, directory, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Create the Hive warehouse external directory for Private Cloud.
     * Create the Hive warehouse external directory for Private Cloud.
     * @param clusterName  (required)
     * @param serviceName The Hive service name. (required)
     * @param directory Name of the warehouse external directory. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand createHiveWarehouseExternalCommand(String clusterName, String serviceName, String directory) throws ApiException {
        ApiResponse<ApiCommand> resp = createHiveWarehouseExternalCommandWithHttpInfo(clusterName, serviceName, directory);
        return resp.getData();
    }

    /**
     * Create the Hive warehouse external directory for Private Cloud.
     * Create the Hive warehouse external directory for Private Cloud.
     * @param clusterName  (required)
     * @param serviceName The Hive service name. (required)
     * @param directory Name of the warehouse external directory. (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> createHiveWarehouseExternalCommandWithHttpInfo(String clusterName, String serviceName, String directory) throws ApiException {
        okhttp3.Call call = createHiveWarehouseExternalCommandValidateBeforeCall(clusterName, serviceName, directory, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Create the Hive warehouse external directory for Private Cloud. (asynchronously)
     * Create the Hive warehouse external directory for Private Cloud.
     * @param clusterName  (required)
     * @param serviceName The Hive service name. (required)
     * @param directory Name of the warehouse external directory. (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 createHiveWarehouseExternalCommandAsync(String clusterName, String serviceName, String directory, 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 = createHiveWarehouseExternalCommandValidateBeforeCall(clusterName, serviceName, directory, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createImpalaUserDirCommand
     * @param clusterName  (required)
     * @param serviceName The Impala service name. (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 createImpalaUserDirCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/impalaCreateUserDir"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = createImpalaUserDirCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Create the Impala user directory.
     * Create the Impala user directory &lt;p&gt; Available since API v6. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The Impala service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand createImpalaUserDirCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = createImpalaUserDirCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Create the Impala user directory.
     * Create the Impala user directory &lt;p&gt; Available since API v6. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The Impala service name. (required)
     * @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> createImpalaUserDirCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = createImpalaUserDirCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Create the Impala user directory. (asynchronously)
     * Create the Impala user directory &lt;p&gt; Available since API v6. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The Impala service name. (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 createImpalaUserDirCommandAsync(String clusterName, String serviceName, 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 = createImpalaUserDirCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createOozieDb
     * @param clusterName  (required)
     * @param serviceName Name of the Oozie service on which to run the command. (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 createOozieDbCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/createOozieDb"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = createOozieDbCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Creates the Oozie Database Schema in the configured database.
     * Creates the Oozie Database Schema in the configured database. This command does not create database. This command creates only tables required by Oozie. To create database, please refer to oozieCreateEmbeddedDatabase()  &lt;p&gt; Available since API v2. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName Name of the Oozie service on which to run the command. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand createOozieDb(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = createOozieDbWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Creates the Oozie Database Schema in the configured database.
     * Creates the Oozie Database Schema in the configured database. This command does not create database. This command creates only tables required by Oozie. To create database, please refer to oozieCreateEmbeddedDatabase()  &lt;p&gt; Available since API v2. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName Name of the Oozie service on which to run the command. (required)
     * @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> createOozieDbWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = createOozieDbValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Creates the Oozie Database Schema in the configured database. (asynchronously)
     * Creates the Oozie Database Schema in the configured database. This command does not create database. This command creates only tables required by Oozie. To create database, please refer to oozieCreateEmbeddedDatabase()  &lt;p&gt; Available since API v2. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName Name of the Oozie service on which to run the command. (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 createOozieDbAsync(String clusterName, String serviceName, 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 = createOozieDbValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createServices
     * @param clusterName  (required)
     * @param body Details of the services to create. (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 createServicesCall(String clusterName, ApiServiceList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.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 = {
            "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 createServicesValidateBeforeCall(String clusterName, ApiServiceList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling createServices(Async)");
        }

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

    }

    /**
     * Creates a list of services.
     * Creates a list of services. &lt;p&gt; There are typically two service creation strategies: &lt;ol&gt; &lt;li&gt; The caller may choose to set up a new service piecemeal, by first creating the service itself (without any roles or configuration), and then create the roles, and then specify configuration. &lt;/li&gt; &lt;li&gt; Alternatively, the caller can pack all the information in one call, by fully specifying the fields in the com.cloudera.api.model.ApiService object, with &lt;ul&gt; &lt;li&gt;service config and role type config, and&lt;/li&gt; &lt;li&gt;role to host assignment.&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ol&gt;  &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Cluster Version&lt;/th&gt; &lt;th&gt;Available Service Types&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;CDH4&lt;/td&gt; &lt;td&gt;HDFS, MAPREDUCE, HBASE, OOZIE, ZOOKEEPER, HUE, YARN, IMPALA, FLUME, HIVE, SOLR, SQOOP, KS_INDEXER&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;CDH5&lt;/td&gt; &lt;td&gt;HDFS, MAPREDUCE, HBASE, OOZIE, ZOOKEEPER, HUE, YARN, IMPALA, FLUME, HIVE, SOLR, SQOOP, KS_INDEXER, SQOOP_CLIENT, SENTRY, ACCUMULO16, KMS, SPARK_ON_YARN, KAFKA &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;  As of V6, GET /{clusterName}/serviceTypes should be used to get the service types available to the cluster.
     * @param clusterName  (required)
     * @param body Details of the services to create. (optional)
     * @return ApiServiceList
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiServiceList createServices(String clusterName, ApiServiceList body) throws ApiException {
        ApiResponse<ApiServiceList> resp = createServicesWithHttpInfo(clusterName, body);
        return resp.getData();
    }

    /**
     * Creates a list of services.
     * Creates a list of services. &lt;p&gt; There are typically two service creation strategies: &lt;ol&gt; &lt;li&gt; The caller may choose to set up a new service piecemeal, by first creating the service itself (without any roles or configuration), and then create the roles, and then specify configuration. &lt;/li&gt; &lt;li&gt; Alternatively, the caller can pack all the information in one call, by fully specifying the fields in the com.cloudera.api.model.ApiService object, with &lt;ul&gt; &lt;li&gt;service config and role type config, and&lt;/li&gt; &lt;li&gt;role to host assignment.&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ol&gt;  &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Cluster Version&lt;/th&gt; &lt;th&gt;Available Service Types&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;CDH4&lt;/td&gt; &lt;td&gt;HDFS, MAPREDUCE, HBASE, OOZIE, ZOOKEEPER, HUE, YARN, IMPALA, FLUME, HIVE, SOLR, SQOOP, KS_INDEXER&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;CDH5&lt;/td&gt; &lt;td&gt;HDFS, MAPREDUCE, HBASE, OOZIE, ZOOKEEPER, HUE, YARN, IMPALA, FLUME, HIVE, SOLR, SQOOP, KS_INDEXER, SQOOP_CLIENT, SENTRY, ACCUMULO16, KMS, SPARK_ON_YARN, KAFKA &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;  As of V6, GET /{clusterName}/serviceTypes should be used to get the service types available to the cluster.
     * @param clusterName  (required)
     * @param body Details of the services to create. (optional)
     * @return ApiResponse&lt;ApiServiceList&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiServiceList> createServicesWithHttpInfo(String clusterName, ApiServiceList body) throws ApiException {
        okhttp3.Call call = createServicesValidateBeforeCall(clusterName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiServiceList>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Creates a list of services. (asynchronously)
     * Creates a list of services. &lt;p&gt; There are typically two service creation strategies: &lt;ol&gt; &lt;li&gt; The caller may choose to set up a new service piecemeal, by first creating the service itself (without any roles or configuration), and then create the roles, and then specify configuration. &lt;/li&gt; &lt;li&gt; Alternatively, the caller can pack all the information in one call, by fully specifying the fields in the com.cloudera.api.model.ApiService object, with &lt;ul&gt; &lt;li&gt;service config and role type config, and&lt;/li&gt; &lt;li&gt;role to host assignment.&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ol&gt;  &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Cluster Version&lt;/th&gt; &lt;th&gt;Available Service Types&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;CDH4&lt;/td&gt; &lt;td&gt;HDFS, MAPREDUCE, HBASE, OOZIE, ZOOKEEPER, HUE, YARN, IMPALA, FLUME, HIVE, SOLR, SQOOP, KS_INDEXER&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;CDH5&lt;/td&gt; &lt;td&gt;HDFS, MAPREDUCE, HBASE, OOZIE, ZOOKEEPER, HUE, YARN, IMPALA, FLUME, HIVE, SOLR, SQOOP, KS_INDEXER, SQOOP_CLIENT, SENTRY, ACCUMULO16, KMS, SPARK_ON_YARN, KAFKA &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;  As of V6, GET /{clusterName}/serviceTypes should be used to get the service types available to the cluster.
     * @param clusterName  (required)
     * @param body Details of the services to create. (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 createServicesAsync(String clusterName, ApiServiceList body, final ApiCallback<ApiServiceList> 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 = createServicesValidateBeforeCall(clusterName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiServiceList>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createSolrHdfsHomeDirCommand
     * @param clusterName  (required)
     * @param serviceName The Solr service name. (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 createSolrHdfsHomeDirCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/createSolrHdfsHomeDir"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = createSolrHdfsHomeDirCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Creates the home directory of a Solr service in HDFS.
     * Creates the home directory of a Solr service in HDFS.  &lt;p&gt; Available since API v4.
     * @param clusterName  (required)
     * @param serviceName The Solr service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand createSolrHdfsHomeDirCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = createSolrHdfsHomeDirCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Creates the home directory of a Solr service in HDFS.
     * Creates the home directory of a Solr service in HDFS.  &lt;p&gt; Available since API v4.
     * @param clusterName  (required)
     * @param serviceName The Solr service name. (required)
     * @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> createSolrHdfsHomeDirCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = createSolrHdfsHomeDirCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Creates the home directory of a Solr service in HDFS. (asynchronously)
     * Creates the home directory of a Solr service in HDFS.  &lt;p&gt; Available since API v4.
     * @param clusterName  (required)
     * @param serviceName The Solr service name. (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 createSolrHdfsHomeDirCommandAsync(String clusterName, String serviceName, 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 = createSolrHdfsHomeDirCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createSqoopUserDirCommand
     * @param clusterName  (required)
     * @param serviceName The Sqoop service name. (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 createSqoopUserDirCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/createSqoopUserDir"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = createSqoopUserDirCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Creates the user directory of a Sqoop service in HDFS.
     * Creates the user directory of a Sqoop service in HDFS.  &lt;p&gt; Available since API v4.
     * @param clusterName  (required)
     * @param serviceName The Sqoop service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand createSqoopUserDirCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = createSqoopUserDirCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Creates the user directory of a Sqoop service in HDFS.
     * Creates the user directory of a Sqoop service in HDFS.  &lt;p&gt; Available since API v4.
     * @param clusterName  (required)
     * @param serviceName The Sqoop service name. (required)
     * @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> createSqoopUserDirCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = createSqoopUserDirCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Creates the user directory of a Sqoop service in HDFS. (asynchronously)
     * Creates the user directory of a Sqoop service in HDFS.  &lt;p&gt; Available since API v4.
     * @param clusterName  (required)
     * @param serviceName The Sqoop service name. (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 createSqoopUserDirCommandAsync(String clusterName, String serviceName, 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 = createSqoopUserDirCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createYarnCmContainerUsageInputDirCommand
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (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 createYarnCmContainerUsageInputDirCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/yarnCreateCmContainerUsageInputDirCommand"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = createYarnCmContainerUsageInputDirCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Creates the HDFS directory where YARN container usage metrics are stored by NodeManagers for CM to read and aggregate into app usage metrics.
     * Creates the HDFS directory where YARN container usage metrics are stored by NodeManagers for CM to read and aggregate into app usage metrics. &lt;p&gt; Available since API v13. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand createYarnCmContainerUsageInputDirCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = createYarnCmContainerUsageInputDirCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Creates the HDFS directory where YARN container usage metrics are stored by NodeManagers for CM to read and aggregate into app usage metrics.
     * Creates the HDFS directory where YARN container usage metrics are stored by NodeManagers for CM to read and aggregate into app usage metrics. &lt;p&gt; Available since API v13. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (required)
     * @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> createYarnCmContainerUsageInputDirCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = createYarnCmContainerUsageInputDirCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Creates the HDFS directory where YARN container usage metrics are stored by NodeManagers for CM to read and aggregate into app usage metrics. (asynchronously)
     * Creates the HDFS directory where YARN container usage metrics are stored by NodeManagers for CM to read and aggregate into app usage metrics. &lt;p&gt; Available since API v13. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (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 createYarnCmContainerUsageInputDirCommandAsync(String clusterName, String serviceName, 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 = createYarnCmContainerUsageInputDirCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createYarnJobHistoryDirCommand
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (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 createYarnJobHistoryDirCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/yarnCreateJobHistoryDirCommand"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = createYarnJobHistoryDirCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Create the Yarn job history directory.
     * Create the Yarn job history directory &lt;p&gt; Available since API v6. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand createYarnJobHistoryDirCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = createYarnJobHistoryDirCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Create the Yarn job history directory.
     * Create the Yarn job history directory &lt;p&gt; Available since API v6. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (required)
     * @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> createYarnJobHistoryDirCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = createYarnJobHistoryDirCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Create the Yarn job history directory. (asynchronously)
     * Create the Yarn job history directory &lt;p&gt; Available since API v6. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (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 createYarnJobHistoryDirCommandAsync(String clusterName, String serviceName, 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 = createYarnJobHistoryDirCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createYarnNodeManagerRemoteAppLogDirCommand
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (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 createYarnNodeManagerRemoteAppLogDirCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/yarnNodeManagerRemoteAppLogDirCommand"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = createYarnNodeManagerRemoteAppLogDirCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Create the Yarn NodeManager remote application log directory.
     * Create the Yarn NodeManager remote application log directory &lt;p&gt; Available since API v6. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand createYarnNodeManagerRemoteAppLogDirCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = createYarnNodeManagerRemoteAppLogDirCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Create the Yarn NodeManager remote application log directory.
     * Create the Yarn NodeManager remote application log directory &lt;p&gt; Available since API v6. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (required)
     * @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> createYarnNodeManagerRemoteAppLogDirCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = createYarnNodeManagerRemoteAppLogDirCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Create the Yarn NodeManager remote application log directory. (asynchronously)
     * Create the Yarn NodeManager remote application log directory &lt;p&gt; Available since API v6. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (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 createYarnNodeManagerRemoteAppLogDirCommandAsync(String clusterName, String serviceName, 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 = createYarnNodeManagerRemoteAppLogDirCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for decommissionCommand
     * @param clusterName  (required)
     * @param serviceName The HBase service name. (required)
     * @param body List of role names to decommision. (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 decommissionCommandCall(String clusterName, String serviceName, ApiRoleNameList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/decommission"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 decommissionCommandValidateBeforeCall(String clusterName, String serviceName, ApiRoleNameList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling decommissionCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling decommissionCommand(Async)");
        }

        okhttp3.Call call = decommissionCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Decommission roles of a service.
     * Decommission roles of a service. &lt;p&gt; For HBase services, the list should contain names of RegionServers to decommission. &lt;p&gt; For HDFS services, the list should contain names of DataNodes to decommission.
     * @param clusterName  (required)
     * @param serviceName The HBase service name. (required)
     * @param body List of role names to decommision. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand decommissionCommand(String clusterName, String serviceName, ApiRoleNameList body) throws ApiException {
        ApiResponse<ApiCommand> resp = decommissionCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Decommission roles of a service.
     * Decommission roles of a service. &lt;p&gt; For HBase services, the list should contain names of RegionServers to decommission. &lt;p&gt; For HDFS services, the list should contain names of DataNodes to decommission.
     * @param clusterName  (required)
     * @param serviceName The HBase service name. (required)
     * @param body List of role names to decommision. (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> decommissionCommandWithHttpInfo(String clusterName, String serviceName, ApiRoleNameList body) throws ApiException {
        okhttp3.Call call = decommissionCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Decommission roles of a service. (asynchronously)
     * Decommission roles of a service. &lt;p&gt; For HBase services, the list should contain names of RegionServers to decommission. &lt;p&gt; For HDFS services, the list should contain names of DataNodes to decommission.
     * @param clusterName  (required)
     * @param serviceName The HBase service name. (required)
     * @param body List of role names to decommision. (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 decommissionCommandAsync(String clusterName, String serviceName, ApiRoleNameList 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 = decommissionCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for deleteHdfsPath
     * @param clusterName  (required)
     * @param serviceName The HDFS service name (required)
     * @param path path of the file or directory to be deleted (optional)
     * @param recursive If the path is a directory and this is set to true, then deletes the directory and its contents, otherwise the call will fail if the directory is not empty (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 deleteHdfsPathCall(String clusterName, String serviceName, String path, Boolean recursive, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/deleteHdfsPath"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

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

        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 deleteHdfsPathValidateBeforeCall(String clusterName, String serviceName, String path, Boolean recursive, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling deleteHdfsPath(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling deleteHdfsPath(Async)");
        }

        okhttp3.Call call = deleteHdfsPathCall(clusterName, serviceName, path, recursive, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Deletes the file or directory, specified by the given path, on the given HDFS service.
     * Deletes the file or directory, specified by the given path, on the given HDFS service.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name (required)
     * @param path path of the file or directory to be deleted (optional)
     * @param recursive If the path is a directory and this is set to true, then deletes the directory and its contents, otherwise the call will fail if the directory is not empty (optional)
     * @return DeleteHdfsPathResult
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public DeleteHdfsPathResult deleteHdfsPath(String clusterName, String serviceName, String path, Boolean recursive) throws ApiException {
        ApiResponse<DeleteHdfsPathResult> resp = deleteHdfsPathWithHttpInfo(clusterName, serviceName, path, recursive);
        return resp.getData();
    }

    /**
     * Deletes the file or directory, specified by the given path, on the given HDFS service.
     * Deletes the file or directory, specified by the given path, on the given HDFS service.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name (required)
     * @param path path of the file or directory to be deleted (optional)
     * @param recursive If the path is a directory and this is set to true, then deletes the directory and its contents, otherwise the call will fail if the directory is not empty (optional)
     * @return ApiResponse&lt;DeleteHdfsPathResult&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<DeleteHdfsPathResult> deleteHdfsPathWithHttpInfo(String clusterName, String serviceName, String path, Boolean recursive) throws ApiException {
        okhttp3.Call call = deleteHdfsPathValidateBeforeCall(clusterName, serviceName, path, recursive, null, null);
        Type localVarReturnType = new TypeToken<DeleteHdfsPathResult>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Deletes the file or directory, specified by the given path, on the given HDFS service. (asynchronously)
     * Deletes the file or directory, specified by the given path, on the given HDFS service.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name (required)
     * @param path path of the file or directory to be deleted (optional)
     * @param recursive If the path is a directory and this is set to true, then deletes the directory and its contents, otherwise the call will fail if the directory is not empty (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 deleteHdfsPathAsync(String clusterName, String serviceName, String path, Boolean recursive, final ApiCallback<DeleteHdfsPathResult> 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 = deleteHdfsPathValidateBeforeCall(clusterName, serviceName, path, recursive, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<DeleteHdfsPathResult>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for deleteService
     * @param clusterName  (required)
     * @param serviceName The name of the service to delete. (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 deleteServiceCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = deleteServiceCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Deletes a service from the system.
     * Deletes a service from the system.
     * @param clusterName  (required)
     * @param serviceName The name of the service to delete. (required)
     * @return ApiService
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiService deleteService(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiService> resp = deleteServiceWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Deletes a service from the system.
     * Deletes a service from the system.
     * @param clusterName  (required)
     * @param serviceName The name of the service to delete. (required)
     * @return ApiResponse&lt;ApiService&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiService> deleteServiceWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = deleteServiceValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiService>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Deletes a service from the system. (asynchronously)
     * Deletes a service from the system.
     * @param clusterName  (required)
     * @param serviceName The name of the service to delete. (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 deleteServiceAsync(String clusterName, String serviceName, final ApiCallback<ApiService> 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 = deleteServiceValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiService>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for deleteTags
     * @param clusterName  (required)
     * @param serviceName Name of the service to remove tags from (required)
     * @param body List of tags to remove from the service (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 deleteTagsCall(String clusterName, String serviceName, List<ApiEntityTag> body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/tags"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call deleteTagsValidateBeforeCall(String clusterName, String serviceName, List<ApiEntityTag> body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling deleteTags(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling deleteTags(Async)");
        }

        okhttp3.Call call = deleteTagsCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Remove the tags associated with the service.
     * Remove the tags associated with the service. Tag names beginning with the prefix _cldr_ (case insensitive) are reserved for internal use by Cloudera.
     * @param clusterName  (required)
     * @param serviceName Name of the service to remove tags from (required)
     * @param body List of tags to remove from the service (optional)
     * @return List&lt;ApiEntityTag&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<ApiEntityTag> deleteTags(String clusterName, String serviceName, List<ApiEntityTag> body) throws ApiException {
        ApiResponse<List<ApiEntityTag>> resp = deleteTagsWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Remove the tags associated with the service.
     * Remove the tags associated with the service. Tag names beginning with the prefix _cldr_ (case insensitive) are reserved for internal use by Cloudera.
     * @param clusterName  (required)
     * @param serviceName Name of the service to remove tags from (required)
     * @param body List of tags to remove from the service (optional)
     * @return ApiResponse&lt;List&lt;ApiEntityTag&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<ApiEntityTag>> deleteTagsWithHttpInfo(String clusterName, String serviceName, List<ApiEntityTag> body) throws ApiException {
        okhttp3.Call call = deleteTagsValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<List<ApiEntityTag>>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Remove the tags associated with the service. (asynchronously)
     * Remove the tags associated with the service. Tag names beginning with the prefix _cldr_ (case insensitive) are reserved for internal use by Cloudera.
     * @param clusterName  (required)
     * @param serviceName Name of the service to remove tags from (required)
     * @param body List of tags to remove from the service (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 deleteTagsAsync(String clusterName, String serviceName, List<ApiEntityTag> body, final ApiCallback<List<ApiEntityTag>> 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 = deleteTagsValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<ApiEntityTag>>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for deployClientConfigCommand
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body List of role names. (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 deployClientConfigCommandCall(String clusterName, String serviceName, ApiRoleNameList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/deployClientConfig"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 deployClientConfigCommandValidateBeforeCall(String clusterName, String serviceName, ApiRoleNameList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling deployClientConfigCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling deployClientConfigCommand(Async)");
        }

        okhttp3.Call call = deployClientConfigCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Deploy a service&#x27;s client configuration.
     * Deploy a service&#x27;s client configuration. &lt;p&gt; The client configuration is deployed to the hosts where the given roles are running. &lt;p/&gt; Added in v3: passing null for the role name list will deploy client configs to all known service roles. Added in v6: passing an empty role name list will deploy client configs to all known service roles. &lt;p/&gt; In Cloudera Manager 5.3 and newer, client configurations are fully managed, meaning that the server maintains state about which client configurations should exist and be managed by alternatives, and the agents actively rectify their hosts with this state. Consequently, if this API call is made with a specific set of roles, Cloudera Manager will deactivate, from alternatives, any deployed client configs from any non-gateway roles that are &lt;em&gt;not&lt;/em&gt; specified as arguments. Gateway roles are always preserved, and calling this API with an empty or null argument continues to deploy to all roles. &lt;p/&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body List of role names. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand deployClientConfigCommand(String clusterName, String serviceName, ApiRoleNameList body) throws ApiException {
        ApiResponse<ApiCommand> resp = deployClientConfigCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Deploy a service&#x27;s client configuration.
     * Deploy a service&#x27;s client configuration. &lt;p&gt; The client configuration is deployed to the hosts where the given roles are running. &lt;p/&gt; Added in v3: passing null for the role name list will deploy client configs to all known service roles. Added in v6: passing an empty role name list will deploy client configs to all known service roles. &lt;p/&gt; In Cloudera Manager 5.3 and newer, client configurations are fully managed, meaning that the server maintains state about which client configurations should exist and be managed by alternatives, and the agents actively rectify their hosts with this state. Consequently, if this API call is made with a specific set of roles, Cloudera Manager will deactivate, from alternatives, any deployed client configs from any non-gateway roles that are &lt;em&gt;not&lt;/em&gt; specified as arguments. Gateway roles are always preserved, and calling this API with an empty or null argument continues to deploy to all roles. &lt;p/&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body List of role names. (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> deployClientConfigCommandWithHttpInfo(String clusterName, String serviceName, ApiRoleNameList body) throws ApiException {
        okhttp3.Call call = deployClientConfigCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Deploy a service&#x27;s client configuration. (asynchronously)
     * Deploy a service&#x27;s client configuration. &lt;p&gt; The client configuration is deployed to the hosts where the given roles are running. &lt;p/&gt; Added in v3: passing null for the role name list will deploy client configs to all known service roles. Added in v6: passing an empty role name list will deploy client configs to all known service roles. &lt;p/&gt; In Cloudera Manager 5.3 and newer, client configurations are fully managed, meaning that the server maintains state about which client configurations should exist and be managed by alternatives, and the agents actively rectify their hosts with this state. Consequently, if this API call is made with a specific set of roles, Cloudera Manager will deactivate, from alternatives, any deployed client configs from any non-gateway roles that are &lt;em&gt;not&lt;/em&gt; specified as arguments. Gateway roles are always preserved, and calling this API with an empty or null argument continues to deploy to all roles. &lt;p/&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body List of role names. (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 deployClientConfigCommandAsync(String clusterName, String serviceName, ApiRoleNameList 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 = deployClientConfigCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for disableCatalogStatestoreHaCommand
     * @param clusterName  (required)
     * @param serviceName A String representing the Impala service name. (required)
     * @param body An instance of ApiDisableCatalogStatestoreHaArguments
representing the arguments to the command. (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 disableCatalogStatestoreHaCommandCall(String clusterName, String serviceName, ApiDisableCatalogStatestoreHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/disableCatalogStatestoreHa"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 disableCatalogStatestoreHaCommandValidateBeforeCall(String clusterName, String serviceName, ApiDisableCatalogStatestoreHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling disableCatalogStatestoreHaCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling disableCatalogStatestoreHaCommand(Async)");
        }

        okhttp3.Call call = disableCatalogStatestoreHaCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Disable high availability (HA) for Catalog and Statestore service.
     * Disable high availability (HA) for Catalog and Statestore service. &lt;p&gt; This command only applies to CDH 7.1.9SP1+ Impala Catalog and Statestore services. &lt;p&gt; The command will keep exactly one Catalog and Statestore server on the specified host. &lt;p&gt; All services that depend on Impala will be restarted after disabling Catalog and Statestore HA.
     * @param clusterName  (required)
     * @param serviceName A String representing the Impala service name. (required)
     * @param body An instance of ApiDisableCatalogStatestoreHaArguments
representing the arguments to the command. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand disableCatalogStatestoreHaCommand(String clusterName, String serviceName, ApiDisableCatalogStatestoreHaArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = disableCatalogStatestoreHaCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Disable high availability (HA) for Catalog and Statestore service.
     * Disable high availability (HA) for Catalog and Statestore service. &lt;p&gt; This command only applies to CDH 7.1.9SP1+ Impala Catalog and Statestore services. &lt;p&gt; The command will keep exactly one Catalog and Statestore server on the specified host. &lt;p&gt; All services that depend on Impala will be restarted after disabling Catalog and Statestore HA.
     * @param clusterName  (required)
     * @param serviceName A String representing the Impala service name. (required)
     * @param body An instance of ApiDisableCatalogStatestoreHaArguments
representing the arguments to the command. (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> disableCatalogStatestoreHaCommandWithHttpInfo(String clusterName, String serviceName, ApiDisableCatalogStatestoreHaArguments body) throws ApiException {
        okhttp3.Call call = disableCatalogStatestoreHaCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Disable high availability (HA) for Catalog and Statestore service. (asynchronously)
     * Disable high availability (HA) for Catalog and Statestore service. &lt;p&gt; This command only applies to CDH 7.1.9SP1+ Impala Catalog and Statestore services. &lt;p&gt; The command will keep exactly one Catalog and Statestore server on the specified host. &lt;p&gt; All services that depend on Impala will be restarted after disabling Catalog and Statestore HA.
     * @param clusterName  (required)
     * @param serviceName A String representing the Impala service name. (required)
     * @param body An instance of ApiDisableCatalogStatestoreHaArguments
representing the arguments to the command. (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 disableCatalogStatestoreHaCommandAsync(String clusterName, String serviceName, ApiDisableCatalogStatestoreHaArguments 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 = disableCatalogStatestoreHaCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for disableJtHaCommand
     * @param clusterName  (required)
     * @param serviceName The MapReduce service name. (required)
     * @param body Arguments for the command. (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 disableJtHaCommandCall(String clusterName, String serviceName, ApiDisableJtHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/disableJtHa"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 disableJtHaCommandValidateBeforeCall(String clusterName, String serviceName, ApiDisableJtHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling disableJtHaCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling disableJtHaCommand(Async)");
        }

        okhttp3.Call call = disableJtHaCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Disable high availability (HA) for JobTracker.
     * Disable high availability (HA) for JobTracker.  As part of disabling HA, any services that depend on the MapReduce service being modified will be stopped. The command arguments provide options to specify name of JobTracker that will be preserved. The Command will redeploy the client configurations for services of the cluster after HA has been disabled.
     * @param clusterName  (required)
     * @param serviceName The MapReduce service name. (required)
     * @param body Arguments for the command. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand disableJtHaCommand(String clusterName, String serviceName, ApiDisableJtHaArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = disableJtHaCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Disable high availability (HA) for JobTracker.
     * Disable high availability (HA) for JobTracker.  As part of disabling HA, any services that depend on the MapReduce service being modified will be stopped. The command arguments provide options to specify name of JobTracker that will be preserved. The Command will redeploy the client configurations for services of the cluster after HA has been disabled.
     * @param clusterName  (required)
     * @param serviceName The MapReduce service name. (required)
     * @param body Arguments for the command. (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> disableJtHaCommandWithHttpInfo(String clusterName, String serviceName, ApiDisableJtHaArguments body) throws ApiException {
        okhttp3.Call call = disableJtHaCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Disable high availability (HA) for JobTracker. (asynchronously)
     * Disable high availability (HA) for JobTracker.  As part of disabling HA, any services that depend on the MapReduce service being modified will be stopped. The command arguments provide options to specify name of JobTracker that will be preserved. The Command will redeploy the client configurations for services of the cluster after HA has been disabled.
     * @param clusterName  (required)
     * @param serviceName The MapReduce service name. (required)
     * @param body Arguments for the command. (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 disableJtHaCommandAsync(String clusterName, String serviceName, ApiDisableJtHaArguments 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 = disableJtHaCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for disableLlamaHaCommand
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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 disableLlamaHaCommandCall(String clusterName, String serviceName, ApiDisableLlamaHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/impalaDisableLlamaHa"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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);
    }

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

        okhttp3.Call call = disableLlamaHaCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Not Supported.
     * Not Supported. Llama was removed.
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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 disableLlamaHaCommand(String clusterName, String serviceName, ApiDisableLlamaHaArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = disableLlamaHaCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Not Supported.
     * Not Supported. Llama was removed.
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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> disableLlamaHaCommandWithHttpInfo(String clusterName, String serviceName, ApiDisableLlamaHaArguments body) throws ApiException {
        okhttp3.Call call = disableLlamaHaCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Not Supported. (asynchronously)
     * Not Supported. Llama was removed.
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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 disableLlamaHaCommandAsync(String clusterName, String serviceName, ApiDisableLlamaHaArguments 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 = disableLlamaHaCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for disableLlamaRmCommand
     * @param clusterName  (required)
     * @param serviceName  (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 disableLlamaRmCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/impalaDisableLlamaRm"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = disableLlamaRmCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Not Supported.
     * Not Supported. Llama was removed.
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand disableLlamaRmCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = disableLlamaRmCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Not Supported.
     * Not Supported. Llama was removed.
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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> disableLlamaRmCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = disableLlamaRmCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Not Supported. (asynchronously)
     * Not Supported. Llama was removed.
     * @param clusterName  (required)
     * @param serviceName  (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 disableLlamaRmCommandAsync(String clusterName, String serviceName, 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 = disableLlamaRmCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for disableOozieHaCommand
     * @param clusterName  (required)
     * @param serviceName The Oozie service name. (required)
     * @param body Arguments for the command. (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 disableOozieHaCommandCall(String clusterName, String serviceName, ApiDisableOozieHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/oozieDisableHa"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 disableOozieHaCommandValidateBeforeCall(String clusterName, String serviceName, ApiDisableOozieHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling disableOozieHaCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling disableOozieHaCommand(Async)");
        }

        okhttp3.Call call = disableOozieHaCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Disable high availability (HA) for Oozie.
     * Disable high availability (HA) for Oozie.  As part of disabling HA, any services that depend on the Oozie service being modified will be stopped. The command arguments provide options to specify name of Oozie Server that will be preserved. After deleting, other Oozie servers, all the services that were stopped are restarted.
     * @param clusterName  (required)
     * @param serviceName The Oozie service name. (required)
     * @param body Arguments for the command. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand disableOozieHaCommand(String clusterName, String serviceName, ApiDisableOozieHaArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = disableOozieHaCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Disable high availability (HA) for Oozie.
     * Disable high availability (HA) for Oozie.  As part of disabling HA, any services that depend on the Oozie service being modified will be stopped. The command arguments provide options to specify name of Oozie Server that will be preserved. After deleting, other Oozie servers, all the services that were stopped are restarted.
     * @param clusterName  (required)
     * @param serviceName The Oozie service name. (required)
     * @param body Arguments for the command. (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> disableOozieHaCommandWithHttpInfo(String clusterName, String serviceName, ApiDisableOozieHaArguments body) throws ApiException {
        okhttp3.Call call = disableOozieHaCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Disable high availability (HA) for Oozie. (asynchronously)
     * Disable high availability (HA) for Oozie.  As part of disabling HA, any services that depend on the Oozie service being modified will be stopped. The command arguments provide options to specify name of Oozie Server that will be preserved. After deleting, other Oozie servers, all the services that were stopped are restarted.
     * @param clusterName  (required)
     * @param serviceName The Oozie service name. (required)
     * @param body Arguments for the command. (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 disableOozieHaCommandAsync(String clusterName, String serviceName, ApiDisableOozieHaArguments 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 = disableOozieHaCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for disableRmHaCommand
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (required)
     * @param body Arguments for the command. (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 disableRmHaCommandCall(String clusterName, String serviceName, ApiDisableRmHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/disableRmHa"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 disableRmHaCommandValidateBeforeCall(String clusterName, String serviceName, ApiDisableRmHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling disableRmHaCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling disableRmHaCommand(Async)");
        }

        okhttp3.Call call = disableRmHaCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Disable high availability (HA) for ResourceManager.
     * Disable high availability (HA) for ResourceManager.  As part of disabling HA, any services that depend on the YARN service being modified will be stopped. The command arguments provide options to specify name of ResourceManager that will be preserved. The command will redeploy the client configurations for services of the cluster after HA has been disabled.
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (required)
     * @param body Arguments for the command. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand disableRmHaCommand(String clusterName, String serviceName, ApiDisableRmHaArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = disableRmHaCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Disable high availability (HA) for ResourceManager.
     * Disable high availability (HA) for ResourceManager.  As part of disabling HA, any services that depend on the YARN service being modified will be stopped. The command arguments provide options to specify name of ResourceManager that will be preserved. The command will redeploy the client configurations for services of the cluster after HA has been disabled.
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (required)
     * @param body Arguments for the command. (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> disableRmHaCommandWithHttpInfo(String clusterName, String serviceName, ApiDisableRmHaArguments body) throws ApiException {
        okhttp3.Call call = disableRmHaCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Disable high availability (HA) for ResourceManager. (asynchronously)
     * Disable high availability (HA) for ResourceManager.  As part of disabling HA, any services that depend on the YARN service being modified will be stopped. The command arguments provide options to specify name of ResourceManager that will be preserved. The command will redeploy the client configurations for services of the cluster after HA has been disabled.
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (required)
     * @param body Arguments for the command. (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 disableRmHaCommandAsync(String clusterName, String serviceName, ApiDisableRmHaArguments 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 = disableRmHaCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for disableSentryHaCommand
     * @param clusterName  (required)
     * @param serviceName A String representing the Sentry service name. (required)
     * @param body An instance of ApiDisableSentryHaArgs
representing the arguments to the command. (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 disableSentryHaCommandCall(String clusterName, String serviceName, ApiDisableSentryHaArgs body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/disableSentryHa"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 disableSentryHaCommandValidateBeforeCall(String clusterName, String serviceName, ApiDisableSentryHaArgs body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling disableSentryHaCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling disableSentryHaCommand(Async)");
        }

        okhttp3.Call call = disableSentryHaCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Disable high availability (HA) for Sentry service.
     * Disable high availability (HA) for Sentry service. &lt;p&gt; This command only applies to CDH 5.13+ Sentry services. &lt;p&gt; The command will keep exactly one Sentry server, on the specified host, and update the ZooKeeper configs needed for Sentry. &lt;p&gt; All services that depend on HDFS will be restarted after enabling Sentry HA. &lt;p&gt; Note: Sentry doesn&#x27;t support Rolling Restart.
     * @param clusterName  (required)
     * @param serviceName A String representing the Sentry service name. (required)
     * @param body An instance of ApiDisableSentryHaArgs
representing the arguments to the command. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand disableSentryHaCommand(String clusterName, String serviceName, ApiDisableSentryHaArgs body) throws ApiException {
        ApiResponse<ApiCommand> resp = disableSentryHaCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Disable high availability (HA) for Sentry service.
     * Disable high availability (HA) for Sentry service. &lt;p&gt; This command only applies to CDH 5.13+ Sentry services. &lt;p&gt; The command will keep exactly one Sentry server, on the specified host, and update the ZooKeeper configs needed for Sentry. &lt;p&gt; All services that depend on HDFS will be restarted after enabling Sentry HA. &lt;p&gt; Note: Sentry doesn&#x27;t support Rolling Restart.
     * @param clusterName  (required)
     * @param serviceName A String representing the Sentry service name. (required)
     * @param body An instance of ApiDisableSentryHaArgs
representing the arguments to the command. (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> disableSentryHaCommandWithHttpInfo(String clusterName, String serviceName, ApiDisableSentryHaArgs body) throws ApiException {
        okhttp3.Call call = disableSentryHaCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Disable high availability (HA) for Sentry service. (asynchronously)
     * Disable high availability (HA) for Sentry service. &lt;p&gt; This command only applies to CDH 5.13+ Sentry services. &lt;p&gt; The command will keep exactly one Sentry server, on the specified host, and update the ZooKeeper configs needed for Sentry. &lt;p&gt; All services that depend on HDFS will be restarted after enabling Sentry HA. &lt;p&gt; Note: Sentry doesn&#x27;t support Rolling Restart.
     * @param clusterName  (required)
     * @param serviceName A String representing the Sentry service name. (required)
     * @param body An instance of ApiDisableSentryHaArgs
representing the arguments to the command. (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 disableSentryHaCommandAsync(String clusterName, String serviceName, ApiDisableSentryHaArgs 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 = disableSentryHaCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for ecsUpgradeAudit
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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 ecsUpgradeAuditCall(String clusterName, String serviceName, ApiStringList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/ecsUpgradeAudit"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 ecsUpgradeAuditValidateBeforeCall(String clusterName, String serviceName, ApiStringList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling ecsUpgradeAudit(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling ecsUpgradeAudit(Async)");
        }

        okhttp3.Call call = ecsUpgradeAuditCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * 
     * 
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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 ecsUpgradeAudit(String clusterName, String serviceName, ApiStringList body) throws ApiException {
        ApiResponse<ApiCommand> resp = ecsUpgradeAuditWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * 
     * 
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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> ecsUpgradeAuditWithHttpInfo(String clusterName, String serviceName, ApiStringList body) throws ApiException {
        okhttp3.Call call = ecsUpgradeAuditValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     *  (asynchronously)
     * 
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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 ecsUpgradeAuditAsync(String clusterName, String serviceName, ApiStringList 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 = ecsUpgradeAuditValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for enableCatalogStatestoreHaCommand
     * @param clusterName  (required)
     * @param serviceName A String representing the Impala service name. (required)
     * @param body An instance of ApiEnableCatalogStatestoreHaArguments
representing the arguments to the command. (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 enableCatalogStatestoreHaCommandCall(String clusterName, String serviceName, ApiEnableCatalogStatestoreHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/enableCatalogStatestoreHa"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 enableCatalogStatestoreHaCommandValidateBeforeCall(String clusterName, String serviceName, ApiEnableCatalogStatestoreHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling enableCatalogStatestoreHaCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling enableCatalogStatestoreHaCommand(Async)");
        }

        okhttp3.Call call = enableCatalogStatestoreHaCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Enable high availability (HA) for Catalog and Statestore service.
     * Enable high availability (HA) for Catalog and Statestore service. &lt;p&gt; This command only applies to CDH 7.1.9SP1+ Impala Catalog and Statestore services. &lt;p&gt; The command will create a new Catalog and Statestore server on the specified host for Catalog and Statestore HA. &lt;p&gt; All services that depend on Impala will be restarted after enabling Catalog and Statestore HA.
     * @param clusterName  (required)
     * @param serviceName A String representing the Impala service name. (required)
     * @param body An instance of ApiEnableCatalogStatestoreHaArguments
representing the arguments to the command. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand enableCatalogStatestoreHaCommand(String clusterName, String serviceName, ApiEnableCatalogStatestoreHaArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = enableCatalogStatestoreHaCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Enable high availability (HA) for Catalog and Statestore service.
     * Enable high availability (HA) for Catalog and Statestore service. &lt;p&gt; This command only applies to CDH 7.1.9SP1+ Impala Catalog and Statestore services. &lt;p&gt; The command will create a new Catalog and Statestore server on the specified host for Catalog and Statestore HA. &lt;p&gt; All services that depend on Impala will be restarted after enabling Catalog and Statestore HA.
     * @param clusterName  (required)
     * @param serviceName A String representing the Impala service name. (required)
     * @param body An instance of ApiEnableCatalogStatestoreHaArguments
representing the arguments to the command. (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> enableCatalogStatestoreHaCommandWithHttpInfo(String clusterName, String serviceName, ApiEnableCatalogStatestoreHaArguments body) throws ApiException {
        okhttp3.Call call = enableCatalogStatestoreHaCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Enable high availability (HA) for Catalog and Statestore service. (asynchronously)
     * Enable high availability (HA) for Catalog and Statestore service. &lt;p&gt; This command only applies to CDH 7.1.9SP1+ Impala Catalog and Statestore services. &lt;p&gt; The command will create a new Catalog and Statestore server on the specified host for Catalog and Statestore HA. &lt;p&gt; All services that depend on Impala will be restarted after enabling Catalog and Statestore HA.
     * @param clusterName  (required)
     * @param serviceName A String representing the Impala service name. (required)
     * @param body An instance of ApiEnableCatalogStatestoreHaArguments
representing the arguments to the command. (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 enableCatalogStatestoreHaCommandAsync(String clusterName, String serviceName, ApiEnableCatalogStatestoreHaArguments 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 = enableCatalogStatestoreHaCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for enableJtHaCommand
     * @param clusterName  (required)
     * @param serviceName The MapReduce service name. (required)
     * @param body Arguments for the command. (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 enableJtHaCommandCall(String clusterName, String serviceName, ApiEnableJtHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/enableJtHa"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 enableJtHaCommandValidateBeforeCall(String clusterName, String serviceName, ApiEnableJtHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling enableJtHaCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling enableJtHaCommand(Async)");
        }

        okhttp3.Call call = enableJtHaCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Enable high availability (HA) for a JobTracker.
     * Enable high availability (HA) for a JobTracker. &lt;p&gt; This command only applies to CDH4 MapReduce services. &lt;p&gt; The command will create a new JobTracker on the specified host and then create an active/standby pair with the existing JobTracker. Autofailover will be enabled using ZooKeeper. A ZNode will be created for this purpose. Command arguments provide option to forcefully create this ZNode if one already exists. A node may already exists if JobTracker was previously enabled in HA mode but HA mode was disabled later on. The ZNode is not deleted when HA is disabled. &lt;p&gt; As part of enabling HA, any services that depends on the MapReduce service being modified will be stopped. Command will redeploy the client configurations for services of the cluster after HA has been enabled.
     * @param clusterName  (required)
     * @param serviceName The MapReduce service name. (required)
     * @param body Arguments for the command. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand enableJtHaCommand(String clusterName, String serviceName, ApiEnableJtHaArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = enableJtHaCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Enable high availability (HA) for a JobTracker.
     * Enable high availability (HA) for a JobTracker. &lt;p&gt; This command only applies to CDH4 MapReduce services. &lt;p&gt; The command will create a new JobTracker on the specified host and then create an active/standby pair with the existing JobTracker. Autofailover will be enabled using ZooKeeper. A ZNode will be created for this purpose. Command arguments provide option to forcefully create this ZNode if one already exists. A node may already exists if JobTracker was previously enabled in HA mode but HA mode was disabled later on. The ZNode is not deleted when HA is disabled. &lt;p&gt; As part of enabling HA, any services that depends on the MapReduce service being modified will be stopped. Command will redeploy the client configurations for services of the cluster after HA has been enabled.
     * @param clusterName  (required)
     * @param serviceName The MapReduce service name. (required)
     * @param body Arguments for the command. (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> enableJtHaCommandWithHttpInfo(String clusterName, String serviceName, ApiEnableJtHaArguments body) throws ApiException {
        okhttp3.Call call = enableJtHaCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Enable high availability (HA) for a JobTracker. (asynchronously)
     * Enable high availability (HA) for a JobTracker. &lt;p&gt; This command only applies to CDH4 MapReduce services. &lt;p&gt; The command will create a new JobTracker on the specified host and then create an active/standby pair with the existing JobTracker. Autofailover will be enabled using ZooKeeper. A ZNode will be created for this purpose. Command arguments provide option to forcefully create this ZNode if one already exists. A node may already exists if JobTracker was previously enabled in HA mode but HA mode was disabled later on. The ZNode is not deleted when HA is disabled. &lt;p&gt; As part of enabling HA, any services that depends on the MapReduce service being modified will be stopped. Command will redeploy the client configurations for services of the cluster after HA has been enabled.
     * @param clusterName  (required)
     * @param serviceName The MapReduce service name. (required)
     * @param body Arguments for the command. (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 enableJtHaCommandAsync(String clusterName, String serviceName, ApiEnableJtHaArguments 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 = enableJtHaCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for enableLlamaHaCommand
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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 enableLlamaHaCommandCall(String clusterName, String serviceName, ApiEnableLlamaHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/impalaEnableLlamaHa"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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);
    }

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

        okhttp3.Call call = enableLlamaHaCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Not Supported.
     * Not Supported. Llama was removed.
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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 enableLlamaHaCommand(String clusterName, String serviceName, ApiEnableLlamaHaArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = enableLlamaHaCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Not Supported.
     * Not Supported. Llama was removed.
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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> enableLlamaHaCommandWithHttpInfo(String clusterName, String serviceName, ApiEnableLlamaHaArguments body) throws ApiException {
        okhttp3.Call call = enableLlamaHaCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Not Supported. (asynchronously)
     * Not Supported. Llama was removed.
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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 enableLlamaHaCommandAsync(String clusterName, String serviceName, ApiEnableLlamaHaArguments 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 = enableLlamaHaCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for enableLlamaRmCommand
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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 enableLlamaRmCommandCall(String clusterName, String serviceName, ApiEnableLlamaRmArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/impalaEnableLlamaRm"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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);
    }

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

        okhttp3.Call call = enableLlamaRmCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Not Supported.
     * Not Supported. Llama was removed.
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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 enableLlamaRmCommand(String clusterName, String serviceName, ApiEnableLlamaRmArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = enableLlamaRmCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Not Supported.
     * Not Supported. Llama was removed.
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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> enableLlamaRmCommandWithHttpInfo(String clusterName, String serviceName, ApiEnableLlamaRmArguments body) throws ApiException {
        okhttp3.Call call = enableLlamaRmCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Not Supported. (asynchronously)
     * Not Supported. Llama was removed.
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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 enableLlamaRmCommandAsync(String clusterName, String serviceName, ApiEnableLlamaRmArguments 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 = enableLlamaRmCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for enableOozieHaCommand
     * @param clusterName  (required)
     * @param serviceName The Oozie service name. (required)
     * @param body Arguments for the command. (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 enableOozieHaCommandCall(String clusterName, String serviceName, ApiEnableOozieHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/oozieEnableHa"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 enableOozieHaCommandValidateBeforeCall(String clusterName, String serviceName, ApiEnableOozieHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling enableOozieHaCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling enableOozieHaCommand(Async)");
        }

        okhttp3.Call call = enableOozieHaCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Enable high availability (HA) for Oozie service.
     * Enable high availability (HA) for Oozie service. &lt;p&gt; This command only applies to CDH5+ Oozie services. &lt;p&gt; The command will create new Oozie Servers on the specified hosts and set the ZooKeeper and Load Balancer configs needed for Oozie HA. &lt;p&gt; As part of enabling HA, any services that depends on the Oozie service being modified will be stopped and restarted after enabling Oozie HA.
     * @param clusterName  (required)
     * @param serviceName The Oozie service name. (required)
     * @param body Arguments for the command. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand enableOozieHaCommand(String clusterName, String serviceName, ApiEnableOozieHaArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = enableOozieHaCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Enable high availability (HA) for Oozie service.
     * Enable high availability (HA) for Oozie service. &lt;p&gt; This command only applies to CDH5+ Oozie services. &lt;p&gt; The command will create new Oozie Servers on the specified hosts and set the ZooKeeper and Load Balancer configs needed for Oozie HA. &lt;p&gt; As part of enabling HA, any services that depends on the Oozie service being modified will be stopped and restarted after enabling Oozie HA.
     * @param clusterName  (required)
     * @param serviceName The Oozie service name. (required)
     * @param body Arguments for the command. (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> enableOozieHaCommandWithHttpInfo(String clusterName, String serviceName, ApiEnableOozieHaArguments body) throws ApiException {
        okhttp3.Call call = enableOozieHaCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Enable high availability (HA) for Oozie service. (asynchronously)
     * Enable high availability (HA) for Oozie service. &lt;p&gt; This command only applies to CDH5+ Oozie services. &lt;p&gt; The command will create new Oozie Servers on the specified hosts and set the ZooKeeper and Load Balancer configs needed for Oozie HA. &lt;p&gt; As part of enabling HA, any services that depends on the Oozie service being modified will be stopped and restarted after enabling Oozie HA.
     * @param clusterName  (required)
     * @param serviceName The Oozie service name. (required)
     * @param body Arguments for the command. (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 enableOozieHaCommandAsync(String clusterName, String serviceName, ApiEnableOozieHaArguments 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 = enableOozieHaCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for enableRmHaCommand
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (required)
     * @param body Arguments for the command. (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 enableRmHaCommandCall(String clusterName, String serviceName, ApiEnableRmHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/enableRmHa"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 enableRmHaCommandValidateBeforeCall(String clusterName, String serviceName, ApiEnableRmHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling enableRmHaCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling enableRmHaCommand(Async)");
        }

        okhttp3.Call call = enableRmHaCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Enable high availability (HA) for a YARN ResourceManager.
     * Enable high availability (HA) for a YARN ResourceManager. &lt;p&gt; This command only applies to CDH5+ YARN services. &lt;p&gt; The command will create a new ResourceManager on the specified host and then create an active/standby pair with the existing ResourceManager. Autofailover will be enabled using ZooKeeper. &lt;p&gt; As part of enabling HA, any services that depends on the YARN service being modified will be stopped. Command will redeploy the client configurations for services of the cluster after HA has been enabled.
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (required)
     * @param body Arguments for the command. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand enableRmHaCommand(String clusterName, String serviceName, ApiEnableRmHaArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = enableRmHaCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Enable high availability (HA) for a YARN ResourceManager.
     * Enable high availability (HA) for a YARN ResourceManager. &lt;p&gt; This command only applies to CDH5+ YARN services. &lt;p&gt; The command will create a new ResourceManager on the specified host and then create an active/standby pair with the existing ResourceManager. Autofailover will be enabled using ZooKeeper. &lt;p&gt; As part of enabling HA, any services that depends on the YARN service being modified will be stopped. Command will redeploy the client configurations for services of the cluster after HA has been enabled.
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (required)
     * @param body Arguments for the command. (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> enableRmHaCommandWithHttpInfo(String clusterName, String serviceName, ApiEnableRmHaArguments body) throws ApiException {
        okhttp3.Call call = enableRmHaCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Enable high availability (HA) for a YARN ResourceManager. (asynchronously)
     * Enable high availability (HA) for a YARN ResourceManager. &lt;p&gt; This command only applies to CDH5+ YARN services. &lt;p&gt; The command will create a new ResourceManager on the specified host and then create an active/standby pair with the existing ResourceManager. Autofailover will be enabled using ZooKeeper. &lt;p&gt; As part of enabling HA, any services that depends on the YARN service being modified will be stopped. Command will redeploy the client configurations for services of the cluster after HA has been enabled.
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (required)
     * @param body Arguments for the command. (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 enableRmHaCommandAsync(String clusterName, String serviceName, ApiEnableRmHaArguments 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 = enableRmHaCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for enableSentryHaCommand
     * @param clusterName  (required)
     * @param serviceName A String representing the Sentry service name. (required)
     * @param body An instance of ApiEnableSentryHaArgs
representing the arguments to the command. (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 enableSentryHaCommandCall(String clusterName, String serviceName, ApiEnableSentryHaArgs body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/enableSentryHa"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 enableSentryHaCommandValidateBeforeCall(String clusterName, String serviceName, ApiEnableSentryHaArgs body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling enableSentryHaCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling enableSentryHaCommand(Async)");
        }

        okhttp3.Call call = enableSentryHaCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Enable high availability (HA) for Sentry service.
     * Enable high availability (HA) for Sentry service. &lt;p&gt; This command only applies to CDH 5.13+ Sentry services. &lt;p&gt; The command will create a new Sentry server on the specified host and set the ZooKeeper configs needed for Sentry HA. &lt;p&gt; As part of enabling HA, all services that depend on HDFS will be restarted after enabling Sentry HA. &lt;p&gt; Note: Sentry doesn&#x27;t support Rolling Restart.
     * @param clusterName  (required)
     * @param serviceName A String representing the Sentry service name. (required)
     * @param body An instance of ApiEnableSentryHaArgs
representing the arguments to the command. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand enableSentryHaCommand(String clusterName, String serviceName, ApiEnableSentryHaArgs body) throws ApiException {
        ApiResponse<ApiCommand> resp = enableSentryHaCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Enable high availability (HA) for Sentry service.
     * Enable high availability (HA) for Sentry service. &lt;p&gt; This command only applies to CDH 5.13+ Sentry services. &lt;p&gt; The command will create a new Sentry server on the specified host and set the ZooKeeper configs needed for Sentry HA. &lt;p&gt; As part of enabling HA, all services that depend on HDFS will be restarted after enabling Sentry HA. &lt;p&gt; Note: Sentry doesn&#x27;t support Rolling Restart.
     * @param clusterName  (required)
     * @param serviceName A String representing the Sentry service name. (required)
     * @param body An instance of ApiEnableSentryHaArgs
representing the arguments to the command. (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> enableSentryHaCommandWithHttpInfo(String clusterName, String serviceName, ApiEnableSentryHaArgs body) throws ApiException {
        okhttp3.Call call = enableSentryHaCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Enable high availability (HA) for Sentry service. (asynchronously)
     * Enable high availability (HA) for Sentry service. &lt;p&gt; This command only applies to CDH 5.13+ Sentry services. &lt;p&gt; The command will create a new Sentry server on the specified host and set the ZooKeeper configs needed for Sentry HA. &lt;p&gt; As part of enabling HA, all services that depend on HDFS will be restarted after enabling Sentry HA. &lt;p&gt; Note: Sentry doesn&#x27;t support Rolling Restart.
     * @param clusterName  (required)
     * @param serviceName A String representing the Sentry service name. (required)
     * @param body An instance of ApiEnableSentryHaArgs
representing the arguments to the command. (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 enableSentryHaCommandAsync(String clusterName, String serviceName, ApiEnableSentryHaArgs 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 = enableSentryHaCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for enterMaintenanceMode
     * @param clusterName  (required)
     * @param serviceName The service name. (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 enterMaintenanceModeCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/enterMaintenanceMode"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = enterMaintenanceModeCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Put the service into maintenance mode.
     * Put the service into maintenance mode. This is a synchronous command. The result is known immediately upon return.  &lt;p&gt; Available since API v2. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand enterMaintenanceMode(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = enterMaintenanceModeWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Put the service into maintenance mode.
     * Put the service into maintenance mode. This is a synchronous command. The result is known immediately upon return.  &lt;p&gt; Available since API v2. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @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> enterMaintenanceModeWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = enterMaintenanceModeValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Put the service into maintenance mode. (asynchronously)
     * Put the service into maintenance mode. This is a synchronous command. The result is known immediately upon return.  &lt;p&gt; Available since API v2. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (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 enterMaintenanceModeAsync(String clusterName, String serviceName, 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 = enterMaintenanceModeValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for exitMaintenanceMode
     * @param clusterName  (required)
     * @param serviceName The service name. (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 exitMaintenanceModeCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/exitMaintenanceMode"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = exitMaintenanceModeCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Take the service out of maintenance mode.
     * Take the service out of maintenance mode. This is a synchronous command. The result is known immediately upon return.  &lt;p&gt; Available since API v2. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand exitMaintenanceMode(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = exitMaintenanceModeWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Take the service out of maintenance mode.
     * Take the service out of maintenance mode. This is a synchronous command. The result is known immediately upon return.  &lt;p&gt; Available since API v2. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @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> exitMaintenanceModeWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = exitMaintenanceModeValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Take the service out of maintenance mode. (asynchronously)
     * Take the service out of maintenance mode. This is a synchronous command. The result is known immediately upon return.  &lt;p&gt; Available since API v2. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (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 exitMaintenanceModeAsync(String clusterName, String serviceName, 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 = exitMaintenanceModeValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for exportSentryPermissionsCommand
     * @param clusterName  (required)
     * @param serviceName The service name. (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 exportSentryPermissionsCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/exportSentryPermissions"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = exportSentryPermissionsCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Export Sentry Permissions.
     * Export Sentry Permissions.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand exportSentryPermissionsCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = exportSentryPermissionsCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Export Sentry Permissions.
     * Export Sentry Permissions.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @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> exportSentryPermissionsCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = exportSentryPermissionsCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Export Sentry Permissions. (asynchronously)
     * Export Sentry Permissions.
     * @param clusterName  (required)
     * @param serviceName The service name. (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 exportSentryPermissionsCommandAsync(String clusterName, String serviceName, 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 = exportSentryPermissionsCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for firstRun
     * @param clusterName  (required)
     * @param serviceName The name of the cluster. (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 firstRunCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/firstRun"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = firstRunCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Prepare and start a service.
     * Prepare and start a service.  &lt;p&gt; Perform all the steps needed to prepare the service and start it. &lt;/p&gt;  &lt;p&gt; Available since API v7. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The name of the cluster. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand firstRun(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = firstRunWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Prepare and start a service.
     * Prepare and start a service.  &lt;p&gt; Perform all the steps needed to prepare the service and start it. &lt;/p&gt;  &lt;p&gt; Available since API v7. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The name of the cluster. (required)
     * @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> firstRunWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = firstRunValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Prepare and start a service. (asynchronously)
     * Prepare and start a service.  &lt;p&gt; Perform all the steps needed to prepare the service and start it. &lt;/p&gt;  &lt;p&gt; Available since API v7. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The name of the cluster. (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 firstRunAsync(String clusterName, String serviceName, 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 = firstRunValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getClientConfig
     * @param clusterName  (required)
     * @param serviceName The service name. (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 getClientConfigCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/clientConfig"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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/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 getClientConfigValidateBeforeCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling getClientConfig(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling getClientConfig(Async)");
        }

        okhttp3.Call call = getClientConfigCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Download a zip-compressed archive of the client configuration, of a specific service.
     * Download a zip-compressed archive of the client configuration, of a specific service. This resource does not require any authentication.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @return File
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public File getClientConfig(String clusterName, String serviceName) throws ApiException {
        ApiResponse<File> resp = getClientConfigWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Download a zip-compressed archive of the client configuration, of a specific service.
     * Download a zip-compressed archive of the client configuration, of a specific service. This resource does not require any authentication.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @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> getClientConfigWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = getClientConfigValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<File>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Download a zip-compressed archive of the client configuration, of a specific service. (asynchronously)
     * Download a zip-compressed archive of the client configuration, of a specific service. This resource does not require any authentication.
     * @param clusterName  (required)
     * @param serviceName The service name. (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 getClientConfigAsync(String clusterName, String serviceName, 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 = getClientConfigValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<File>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getHdfsUsageReport
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param aggregation The (optional) aggregation period for the data. Supports \&quot;hourly\&quot;, \&quot;daily\&quot; (default) and \&quot;weekly\&quot;. (optional, default to daily)
     * @param from The (optional) start time of the report in ISO 8601 format ( defaults to 24 hours before \&quot;to\&quot; time). (optional)
     * @param nameservice The (optional) HDFS nameservice. Required for HA setup. (optional)
     * @param to The (optional) end time of the report in ISO 8601 format ( defaults to now). (optional, default to now)
     * @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 getHdfsUsageReportCall(String clusterName, String serviceName, String aggregation, String from, String nameservice, String to, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/reports/hdfsUsageReport"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

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

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

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

        final String[] localVarAccepts = {
            "text/csv", "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 getHdfsUsageReportValidateBeforeCall(String clusterName, String serviceName, String aggregation, String from, String nameservice, String to, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling getHdfsUsageReport(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling getHdfsUsageReport(Async)");
        }

        okhttp3.Call call = getHdfsUsageReportCall(clusterName, serviceName, aggregation, from, nameservice, to, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Fetch the HDFS usage report.
     * Fetch the HDFS usage report. For the requested time range, at the specified aggregation intervals, the report shows HDFS disk usages per user. &lt;p&gt; This call supports returning JSON or CSV, as determined by the \&quot;Accept\&quot; header of application/json or text/csv. &lt;p&gt; Available since API v4. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param aggregation The (optional) aggregation period for the data. Supports \&quot;hourly\&quot;, \&quot;daily\&quot; (default) and \&quot;weekly\&quot;. (optional, default to daily)
     * @param from The (optional) start time of the report in ISO 8601 format ( defaults to 24 hours before \&quot;to\&quot; time). (optional)
     * @param nameservice The (optional) HDFS nameservice. Required for HA setup. (optional)
     * @param to The (optional) end time of the report in ISO 8601 format ( defaults to now). (optional, default to now)
     * @return ApiHdfsUsageReport
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiHdfsUsageReport getHdfsUsageReport(String clusterName, String serviceName, String aggregation, String from, String nameservice, String to) throws ApiException {
        ApiResponse<ApiHdfsUsageReport> resp = getHdfsUsageReportWithHttpInfo(clusterName, serviceName, aggregation, from, nameservice, to);
        return resp.getData();
    }

    /**
     * Fetch the HDFS usage report.
     * Fetch the HDFS usage report. For the requested time range, at the specified aggregation intervals, the report shows HDFS disk usages per user. &lt;p&gt; This call supports returning JSON or CSV, as determined by the \&quot;Accept\&quot; header of application/json or text/csv. &lt;p&gt; Available since API v4. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param aggregation The (optional) aggregation period for the data. Supports \&quot;hourly\&quot;, \&quot;daily\&quot; (default) and \&quot;weekly\&quot;. (optional, default to daily)
     * @param from The (optional) start time of the report in ISO 8601 format ( defaults to 24 hours before \&quot;to\&quot; time). (optional)
     * @param nameservice The (optional) HDFS nameservice. Required for HA setup. (optional)
     * @param to The (optional) end time of the report in ISO 8601 format ( defaults to now). (optional, default to now)
     * @return ApiResponse&lt;ApiHdfsUsageReport&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiHdfsUsageReport> getHdfsUsageReportWithHttpInfo(String clusterName, String serviceName, String aggregation, String from, String nameservice, String to) throws ApiException {
        okhttp3.Call call = getHdfsUsageReportValidateBeforeCall(clusterName, serviceName, aggregation, from, nameservice, to, null, null);
        Type localVarReturnType = new TypeToken<ApiHdfsUsageReport>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Fetch the HDFS usage report. (asynchronously)
     * Fetch the HDFS usage report. For the requested time range, at the specified aggregation intervals, the report shows HDFS disk usages per user. &lt;p&gt; This call supports returning JSON or CSV, as determined by the \&quot;Accept\&quot; header of application/json or text/csv. &lt;p&gt; Available since API v4. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param aggregation The (optional) aggregation period for the data. Supports \&quot;hourly\&quot;, \&quot;daily\&quot; (default) and \&quot;weekly\&quot;. (optional, default to daily)
     * @param from The (optional) start time of the report in ISO 8601 format ( defaults to 24 hours before \&quot;to\&quot; time). (optional)
     * @param nameservice The (optional) HDFS nameservice. Required for HA setup. (optional)
     * @param to The (optional) end time of the report in ISO 8601 format ( defaults to now). (optional, default to now)
     * @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 getHdfsUsageReportAsync(String clusterName, String serviceName, String aggregation, String from, String nameservice, String to, final ApiCallback<ApiHdfsUsageReport> 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 = getHdfsUsageReportValidateBeforeCall(clusterName, serviceName, aggregation, from, nameservice, to, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiHdfsUsageReport>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getIcebergReplicationAccessStatus
     * @param clusterName  (required)
     * @param serviceName The name of the ICEBERG_REPLICATION service. (required)
     * @param hmsWarehouseDir The hmsWarehouseDir whose status is required. (optional)
     * @param path The cloudPath whose status is required in conjunction with hmsWarehouseDir. (optional)
     * @param sourceCluster The name of the cluster on remote. (optional)
     * @param sourcePeer The name of the peer. (optional)
     * @param sourceService The name of the ICEBERG_REPLICATION service on remote. (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 getIcebergReplicationAccessStatusCall(String clusterName, String serviceName, String hmsWarehouseDir, String path, String sourceCluster, String sourcePeer, String sourceService, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/icebergReplicationCheckAccess"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (hmsWarehouseDir != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("hmsWarehouseDir", hmsWarehouseDir));
        if (path != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("path", path));
        if (sourceCluster != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("sourceCluster", sourceCluster));
        if (sourcePeer != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("sourcePeer", sourcePeer));
        if (sourceService != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("sourceService", sourceService));

        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 getIcebergReplicationAccessStatusValidateBeforeCall(String clusterName, String serviceName, String hmsWarehouseDir, String path, String sourceCluster, String sourcePeer, String sourceService, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling getIcebergReplicationAccessStatus(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling getIcebergReplicationAccessStatus(Async)");
        }

        okhttp3.Call call = getIcebergReplicationAccessStatusCall(clusterName, serviceName, hmsWarehouseDir, path, sourceCluster, sourcePeer, sourceService, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Retrieves the access status for the given path.
     * Retrieves the access status for the given path.
     * @param clusterName  (required)
     * @param serviceName The name of the ICEBERG_REPLICATION service. (required)
     * @param hmsWarehouseDir The hmsWarehouseDir whose status is required. (optional)
     * @param path The cloudPath whose status is required in conjunction with hmsWarehouseDir. (optional)
     * @param sourceCluster The name of the cluster on remote. (optional)
     * @param sourcePeer The name of the peer. (optional)
     * @param sourceService The name of the ICEBERG_REPLICATION service on remote. (optional)
     * @return ApiIcebergReplicationAccessStatus
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiIcebergReplicationAccessStatus getIcebergReplicationAccessStatus(String clusterName, String serviceName, String hmsWarehouseDir, String path, String sourceCluster, String sourcePeer, String sourceService) throws ApiException {
        ApiResponse<ApiIcebergReplicationAccessStatus> resp = getIcebergReplicationAccessStatusWithHttpInfo(clusterName, serviceName, hmsWarehouseDir, path, sourceCluster, sourcePeer, sourceService);
        return resp.getData();
    }

    /**
     * Retrieves the access status for the given path.
     * Retrieves the access status for the given path.
     * @param clusterName  (required)
     * @param serviceName The name of the ICEBERG_REPLICATION service. (required)
     * @param hmsWarehouseDir The hmsWarehouseDir whose status is required. (optional)
     * @param path The cloudPath whose status is required in conjunction with hmsWarehouseDir. (optional)
     * @param sourceCluster The name of the cluster on remote. (optional)
     * @param sourcePeer The name of the peer. (optional)
     * @param sourceService The name of the ICEBERG_REPLICATION service on remote. (optional)
     * @return ApiResponse&lt;ApiIcebergReplicationAccessStatus&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiIcebergReplicationAccessStatus> getIcebergReplicationAccessStatusWithHttpInfo(String clusterName, String serviceName, String hmsWarehouseDir, String path, String sourceCluster, String sourcePeer, String sourceService) throws ApiException {
        okhttp3.Call call = getIcebergReplicationAccessStatusValidateBeforeCall(clusterName, serviceName, hmsWarehouseDir, path, sourceCluster, sourcePeer, sourceService, null, null);
        Type localVarReturnType = new TypeToken<ApiIcebergReplicationAccessStatus>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Retrieves the access status for the given path. (asynchronously)
     * Retrieves the access status for the given path.
     * @param clusterName  (required)
     * @param serviceName The name of the ICEBERG_REPLICATION service. (required)
     * @param hmsWarehouseDir The hmsWarehouseDir whose status is required. (optional)
     * @param path The cloudPath whose status is required in conjunction with hmsWarehouseDir. (optional)
     * @param sourceCluster The name of the cluster on remote. (optional)
     * @param sourcePeer The name of the peer. (optional)
     * @param sourceService The name of the ICEBERG_REPLICATION service on remote. (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 getIcebergReplicationAccessStatusAsync(String clusterName, String serviceName, String hmsWarehouseDir, String path, String sourceCluster, String sourcePeer, String sourceService, final ApiCallback<ApiIcebergReplicationAccessStatus> 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 = getIcebergReplicationAccessStatusValidateBeforeCall(clusterName, serviceName, hmsWarehouseDir, path, sourceCluster, sourcePeer, sourceService, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiIcebergReplicationAccessStatus>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getImpalaUtilization
     * @param clusterName  (required)
     * @param serviceName service name (required)
     * @param daysOfWeek The days of the week for which the user wants to report utilization. Days is a list of number between 1 to 7, where 1 corresponds to Mon. and 7 corresponds to Sun. All 7 days are included if this is not specified. (optional)
     * @param endHourOfDay The end hour of a day for which the user wants to report utilization. The hour is a number between [0-23]. Default value is 23 if this is not specified. (optional, default to 23)
     * @param from Start of the time range to report utilization in ISO 8601 format. (optional)
     * @param startHourOfDay The start hour of a day for which the user wants to report utilization. The hour is a number between [0-23]. Default value is 0 if this is not specified. (optional, default to 0)
     * @param tenantType The type of the tenant (POOL or USER). (optional, default to POOL)
     * @param to End of the the time range to report utilization in ISO 8601 format (defaults to now). (optional, default to now)
     * @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 getImpalaUtilizationCall(String clusterName, String serviceName, List<String> daysOfWeek, java.math.BigDecimal endHourOfDay, String from, java.math.BigDecimal startHourOfDay, String tenantType, String to, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/impalaUtilization"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (daysOfWeek != null)
        localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "daysOfWeek", daysOfWeek));
        if (endHourOfDay != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("endHourOfDay", endHourOfDay));
        if (from != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("from", from));
        if (startHourOfDay != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("startHourOfDay", startHourOfDay));
        if (tenantType != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("tenantType", tenantType));
        if (to != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("to", to));

        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 getImpalaUtilizationValidateBeforeCall(String clusterName, String serviceName, List<String> daysOfWeek, java.math.BigDecimal endHourOfDay, String from, java.math.BigDecimal startHourOfDay, String tenantType, String to, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling getImpalaUtilization(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling getImpalaUtilization(Async)");
        }

        okhttp3.Call call = getImpalaUtilizationCall(clusterName, serviceName, daysOfWeek, endHourOfDay, from, startHourOfDay, tenantType, to, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Provides the resource utilization of the Impala service as well as the resource utilization per tenant.
     * Provides the resource utilization of the Impala service as well as the resource utilization per tenant. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName service name (required)
     * @param daysOfWeek The days of the week for which the user wants to report utilization. Days is a list of number between 1 to 7, where 1 corresponds to Mon. and 7 corresponds to Sun. All 7 days are included if this is not specified. (optional)
     * @param endHourOfDay The end hour of a day for which the user wants to report utilization. The hour is a number between [0-23]. Default value is 23 if this is not specified. (optional, default to 23)
     * @param from Start of the time range to report utilization in ISO 8601 format. (optional)
     * @param startHourOfDay The start hour of a day for which the user wants to report utilization. The hour is a number between [0-23]. Default value is 0 if this is not specified. (optional, default to 0)
     * @param tenantType The type of the tenant (POOL or USER). (optional, default to POOL)
     * @param to End of the the time range to report utilization in ISO 8601 format (defaults to now). (optional, default to now)
     * @return ApiImpalaUtilization
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiImpalaUtilization getImpalaUtilization(String clusterName, String serviceName, List<String> daysOfWeek, java.math.BigDecimal endHourOfDay, String from, java.math.BigDecimal startHourOfDay, String tenantType, String to) throws ApiException {
        ApiResponse<ApiImpalaUtilization> resp = getImpalaUtilizationWithHttpInfo(clusterName, serviceName, daysOfWeek, endHourOfDay, from, startHourOfDay, tenantType, to);
        return resp.getData();
    }

    /**
     * Provides the resource utilization of the Impala service as well as the resource utilization per tenant.
     * Provides the resource utilization of the Impala service as well as the resource utilization per tenant. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName service name (required)
     * @param daysOfWeek The days of the week for which the user wants to report utilization. Days is a list of number between 1 to 7, where 1 corresponds to Mon. and 7 corresponds to Sun. All 7 days are included if this is not specified. (optional)
     * @param endHourOfDay The end hour of a day for which the user wants to report utilization. The hour is a number between [0-23]. Default value is 23 if this is not specified. (optional, default to 23)
     * @param from Start of the time range to report utilization in ISO 8601 format. (optional)
     * @param startHourOfDay The start hour of a day for which the user wants to report utilization. The hour is a number between [0-23]. Default value is 0 if this is not specified. (optional, default to 0)
     * @param tenantType The type of the tenant (POOL or USER). (optional, default to POOL)
     * @param to End of the the time range to report utilization in ISO 8601 format (defaults to now). (optional, default to now)
     * @return ApiResponse&lt;ApiImpalaUtilization&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiImpalaUtilization> getImpalaUtilizationWithHttpInfo(String clusterName, String serviceName, List<String> daysOfWeek, java.math.BigDecimal endHourOfDay, String from, java.math.BigDecimal startHourOfDay, String tenantType, String to) throws ApiException {
        okhttp3.Call call = getImpalaUtilizationValidateBeforeCall(clusterName, serviceName, daysOfWeek, endHourOfDay, from, startHourOfDay, tenantType, to, null, null);
        Type localVarReturnType = new TypeToken<ApiImpalaUtilization>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Provides the resource utilization of the Impala service as well as the resource utilization per tenant. (asynchronously)
     * Provides the resource utilization of the Impala service as well as the resource utilization per tenant. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName service name (required)
     * @param daysOfWeek The days of the week for which the user wants to report utilization. Days is a list of number between 1 to 7, where 1 corresponds to Mon. and 7 corresponds to Sun. All 7 days are included if this is not specified. (optional)
     * @param endHourOfDay The end hour of a day for which the user wants to report utilization. The hour is a number between [0-23]. Default value is 23 if this is not specified. (optional, default to 23)
     * @param from Start of the time range to report utilization in ISO 8601 format. (optional)
     * @param startHourOfDay The start hour of a day for which the user wants to report utilization. The hour is a number between [0-23]. Default value is 0 if this is not specified. (optional, default to 0)
     * @param tenantType The type of the tenant (POOL or USER). (optional, default to POOL)
     * @param to End of the the time range to report utilization in ISO 8601 format (defaults to now). (optional, default to now)
     * @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 getImpalaUtilizationAsync(String clusterName, String serviceName, List<String> daysOfWeek, java.math.BigDecimal endHourOfDay, String from, java.math.BigDecimal startHourOfDay, String tenantType, String to, final ApiCallback<ApiImpalaUtilization> 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 = getImpalaUtilizationValidateBeforeCall(clusterName, serviceName, daysOfWeek, endHourOfDay, from, startHourOfDay, tenantType, to, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiImpalaUtilization>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getMetrics
     * @param clusterName  (required)
     * @param serviceName The name of the service. (required)
     * @param from Start of the period to query. (optional)
     * @param metrics Filter for which metrics to query. (optional)
     * @param to End of the period to query. (optional, default to now)
     * @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 getMetricsCall(String clusterName, String serviceName, String from, List<String> metrics, String to, String view, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/metrics"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (from != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("from", from));
        if (metrics != null)
        localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "metrics", metrics));
        if (to != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("to", to));
        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);
    }

    @Deprecated
    @SuppressWarnings("rawtypes")
    private okhttp3.Call getMetricsValidateBeforeCall(String clusterName, String serviceName, String from, List<String> metrics, String to, String view, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling getMetrics(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling getMetrics(Async)");
        }

        okhttp3.Call call = getMetricsCall(clusterName, serviceName, from, metrics, to, view, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Fetch metric readings for a particular service.
     * Fetch metric readings for a particular service. &lt;p&gt; By default, this call will look up all metrics available for the service. If only specific metrics are desired, use the &lt;i&gt;metrics&lt;/i&gt; parameter. &lt;p&gt; By default, the returned results correspond to a 5 minute window based on the provided end time (which defaults to the current server time). The &lt;i&gt;from&lt;/i&gt; and &lt;i&gt;to&lt;/i&gt; parameters can be used to control the window being queried. A maximum window of 3 hours is enforced. &lt;p&gt; When requesting a \&quot;full\&quot; view, aside from the extended properties of the returned metric data, the collection will also contain information about all metrics available for the service, even if no readings are available in the requested window. &lt;p&gt; HDFS services that have more than one nameservice will not expose any metrics. Instead, the nameservices should be queried separately. &lt;p/&gt;
     * @param clusterName  (required)
     * @param serviceName The name of the service. (required)
     * @param from Start of the period to query. (optional)
     * @param metrics Filter for which metrics to query. (optional)
     * @param to End of the period to query. (optional, default to now)
     * @param view The view of the data to materialize, either \&quot;summary\&quot; or \&quot;full\&quot;. (optional, default to summary)
     * @return ApiMetricList
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiMetricList getMetrics(String clusterName, String serviceName, String from, List<String> metrics, String to, String view) throws ApiException {
        ApiResponse<ApiMetricList> resp = getMetricsWithHttpInfo(clusterName, serviceName, from, metrics, to, view);
        return resp.getData();
    }

    /**
     * Fetch metric readings for a particular service.
     * Fetch metric readings for a particular service. &lt;p&gt; By default, this call will look up all metrics available for the service. If only specific metrics are desired, use the &lt;i&gt;metrics&lt;/i&gt; parameter. &lt;p&gt; By default, the returned results correspond to a 5 minute window based on the provided end time (which defaults to the current server time). The &lt;i&gt;from&lt;/i&gt; and &lt;i&gt;to&lt;/i&gt; parameters can be used to control the window being queried. A maximum window of 3 hours is enforced. &lt;p&gt; When requesting a \&quot;full\&quot; view, aside from the extended properties of the returned metric data, the collection will also contain information about all metrics available for the service, even if no readings are available in the requested window. &lt;p&gt; HDFS services that have more than one nameservice will not expose any metrics. Instead, the nameservices should be queried separately. &lt;p/&gt;
     * @param clusterName  (required)
     * @param serviceName The name of the service. (required)
     * @param from Start of the period to query. (optional)
     * @param metrics Filter for which metrics to query. (optional)
     * @param to End of the period to query. (optional, default to now)
     * @param view The view of the data to materialize, either \&quot;summary\&quot; or \&quot;full\&quot;. (optional, default to summary)
     * @return ApiResponse&lt;ApiMetricList&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiMetricList> getMetricsWithHttpInfo(String clusterName, String serviceName, String from, List<String> metrics, String to, String view) throws ApiException {
        okhttp3.Call call = getMetricsValidateBeforeCall(clusterName, serviceName, from, metrics, to, view, null, null);
        Type localVarReturnType = new TypeToken<ApiMetricList>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Fetch metric readings for a particular service. (asynchronously)
     * Fetch metric readings for a particular service. &lt;p&gt; By default, this call will look up all metrics available for the service. If only specific metrics are desired, use the &lt;i&gt;metrics&lt;/i&gt; parameter. &lt;p&gt; By default, the returned results correspond to a 5 minute window based on the provided end time (which defaults to the current server time). The &lt;i&gt;from&lt;/i&gt; and &lt;i&gt;to&lt;/i&gt; parameters can be used to control the window being queried. A maximum window of 3 hours is enforced. &lt;p&gt; When requesting a \&quot;full\&quot; view, aside from the extended properties of the returned metric data, the collection will also contain information about all metrics available for the service, even if no readings are available in the requested window. &lt;p&gt; HDFS services that have more than one nameservice will not expose any metrics. Instead, the nameservices should be queried separately. &lt;p/&gt;
     * @param clusterName  (required)
     * @param serviceName The name of the service. (required)
     * @param from Start of the period to query. (optional)
     * @param metrics Filter for which metrics to query. (optional)
     * @param to End of the period to query. (optional, default to now)
     * @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 getMetricsAsync(String clusterName, String serviceName, String from, List<String> metrics, String to, String view, final ApiCallback<ApiMetricList> 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 = getMetricsValidateBeforeCall(clusterName, serviceName, from, metrics, to, view, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiMetricList>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getMrUsageReport
     * @param clusterName  (required)
     * @param serviceName The MR service name. (required)
     * @param aggregation The (optional) aggregation period for the data. Supports \&quot;hourly\&quot;, \&quot;daily\&quot; (default) and \&quot;weekly\&quot;. (optional, default to daily)
     * @param from The (optional) start time of the report in ISO 8601 format (defaults to 24 hours before \&quot;to\&quot; time). (optional)
     * @param to The (optional) end time of the report in ISO 8601 format (defaults to now). (optional, default to now)
     * @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 getMrUsageReportCall(String clusterName, String serviceName, String aggregation, String from, String to, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/reports/mrUsageReport"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

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

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

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

        final String[] localVarAccepts = {
            "text/csv", "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 getMrUsageReportValidateBeforeCall(String clusterName, String serviceName, String aggregation, String from, String to, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling getMrUsageReport(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling getMrUsageReport(Async)");
        }

        okhttp3.Call call = getMrUsageReportCall(clusterName, serviceName, aggregation, from, to, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Fetch the MR usage report.
     * Fetch the MR usage report. For the requested time range, at the specified aggregation intervals, the report shows job CPU usages (and other metrics) per user. &lt;p&gt; This call supports returning JSON or CSV, as determined by the \&quot;Accept\&quot; header of application/json or text/csv. &lt;p&gt; Available since API v4. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName The MR service name. (required)
     * @param aggregation The (optional) aggregation period for the data. Supports \&quot;hourly\&quot;, \&quot;daily\&quot; (default) and \&quot;weekly\&quot;. (optional, default to daily)
     * @param from The (optional) start time of the report in ISO 8601 format (defaults to 24 hours before \&quot;to\&quot; time). (optional)
     * @param to The (optional) end time of the report in ISO 8601 format (defaults to now). (optional, default to now)
     * @return ApiMrUsageReport
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiMrUsageReport getMrUsageReport(String clusterName, String serviceName, String aggregation, String from, String to) throws ApiException {
        ApiResponse<ApiMrUsageReport> resp = getMrUsageReportWithHttpInfo(clusterName, serviceName, aggregation, from, to);
        return resp.getData();
    }

    /**
     * Fetch the MR usage report.
     * Fetch the MR usage report. For the requested time range, at the specified aggregation intervals, the report shows job CPU usages (and other metrics) per user. &lt;p&gt; This call supports returning JSON or CSV, as determined by the \&quot;Accept\&quot; header of application/json or text/csv. &lt;p&gt; Available since API v4. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName The MR service name. (required)
     * @param aggregation The (optional) aggregation period for the data. Supports \&quot;hourly\&quot;, \&quot;daily\&quot; (default) and \&quot;weekly\&quot;. (optional, default to daily)
     * @param from The (optional) start time of the report in ISO 8601 format (defaults to 24 hours before \&quot;to\&quot; time). (optional)
     * @param to The (optional) end time of the report in ISO 8601 format (defaults to now). (optional, default to now)
     * @return ApiResponse&lt;ApiMrUsageReport&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiMrUsageReport> getMrUsageReportWithHttpInfo(String clusterName, String serviceName, String aggregation, String from, String to) throws ApiException {
        okhttp3.Call call = getMrUsageReportValidateBeforeCall(clusterName, serviceName, aggregation, from, to, null, null);
        Type localVarReturnType = new TypeToken<ApiMrUsageReport>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Fetch the MR usage report. (asynchronously)
     * Fetch the MR usage report. For the requested time range, at the specified aggregation intervals, the report shows job CPU usages (and other metrics) per user. &lt;p&gt; This call supports returning JSON or CSV, as determined by the \&quot;Accept\&quot; header of application/json or text/csv. &lt;p&gt; Available since API v4. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName The MR service name. (required)
     * @param aggregation The (optional) aggregation period for the data. Supports \&quot;hourly\&quot;, \&quot;daily\&quot; (default) and \&quot;weekly\&quot;. (optional, default to daily)
     * @param from The (optional) start time of the report in ISO 8601 format (defaults to 24 hours before \&quot;to\&quot; time). (optional)
     * @param to The (optional) end time of the report in ISO 8601 format (defaults to now). (optional, default to now)
     * @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 getMrUsageReportAsync(String clusterName, String serviceName, String aggregation, String from, String to, final ApiCallback<ApiMrUsageReport> 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 = getMrUsageReportValidateBeforeCall(clusterName, serviceName, aggregation, from, to, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiMrUsageReport>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getPoliciesFromRanger
     * @param clusterName  (required)
     * @param serviceName the name of the local Ranger service. (required)
     * @param sourceCluster optional: the source CM cluster name. (optional)
     * @param sourcePeer optional: the source CM peer name. (optional)
     * @param sourceService optional: the Ranger service name on the source CM. (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 getPoliciesFromRangerCall(String clusterName, String serviceName, String sourceCluster, String sourcePeer, String sourceService, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/getPoliciesFromRanger"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

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

        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 getPoliciesFromRangerValidateBeforeCall(String clusterName, String serviceName, String sourceCluster, String sourcePeer, String sourceService, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling getPoliciesFromRanger(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling getPoliciesFromRanger(Async)");
        }

        okhttp3.Call call = getPoliciesFromRangerCall(clusterName, serviceName, sourceCluster, sourcePeer, sourceService, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Collects information about the policies defined in the local Ranger service.
     * Collects information about the policies defined in the local Ranger service. &lt;p&gt; Optionally if sourcePeer, sourceCluster, sourceUser are provided, then it will call the same API endpoint on that given source CM peer, and merges the result of the local (ApiRangerPolicyList#getPolicies()) and remote (ApiRangerPolicyList#getPolicies()) Ranger policies.
     * @param clusterName  (required)
     * @param serviceName the name of the local Ranger service. (required)
     * @param sourceCluster optional: the source CM cluster name. (optional)
     * @param sourcePeer optional: the source CM peer name. (optional)
     * @param sourceService optional: the Ranger service name on the source CM. (optional)
     * @return ApiRangerPolicyList
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiRangerPolicyList getPoliciesFromRanger(String clusterName, String serviceName, String sourceCluster, String sourcePeer, String sourceService) throws ApiException {
        ApiResponse<ApiRangerPolicyList> resp = getPoliciesFromRangerWithHttpInfo(clusterName, serviceName, sourceCluster, sourcePeer, sourceService);
        return resp.getData();
    }

    /**
     * Collects information about the policies defined in the local Ranger service.
     * Collects information about the policies defined in the local Ranger service. &lt;p&gt; Optionally if sourcePeer, sourceCluster, sourceUser are provided, then it will call the same API endpoint on that given source CM peer, and merges the result of the local (ApiRangerPolicyList#getPolicies()) and remote (ApiRangerPolicyList#getPolicies()) Ranger policies.
     * @param clusterName  (required)
     * @param serviceName the name of the local Ranger service. (required)
     * @param sourceCluster optional: the source CM cluster name. (optional)
     * @param sourcePeer optional: the source CM peer name. (optional)
     * @param sourceService optional: the Ranger service name on the source CM. (optional)
     * @return ApiResponse&lt;ApiRangerPolicyList&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiRangerPolicyList> getPoliciesFromRangerWithHttpInfo(String clusterName, String serviceName, String sourceCluster, String sourcePeer, String sourceService) throws ApiException {
        okhttp3.Call call = getPoliciesFromRangerValidateBeforeCall(clusterName, serviceName, sourceCluster, sourcePeer, sourceService, null, null);
        Type localVarReturnType = new TypeToken<ApiRangerPolicyList>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Collects information about the policies defined in the local Ranger service. (asynchronously)
     * Collects information about the policies defined in the local Ranger service. &lt;p&gt; Optionally if sourcePeer, sourceCluster, sourceUser are provided, then it will call the same API endpoint on that given source CM peer, and merges the result of the local (ApiRangerPolicyList#getPolicies()) and remote (ApiRangerPolicyList#getPolicies()) Ranger policies.
     * @param clusterName  (required)
     * @param serviceName the name of the local Ranger service. (required)
     * @param sourceCluster optional: the source CM cluster name. (optional)
     * @param sourcePeer optional: the source CM peer name. (optional)
     * @param sourceService optional: the Ranger service name on the source CM. (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 getPoliciesFromRangerAsync(String clusterName, String serviceName, String sourceCluster, String sourcePeer, String sourceService, final ApiCallback<ApiRangerPolicyList> 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 = getPoliciesFromRangerValidateBeforeCall(clusterName, serviceName, sourceCluster, sourcePeer, sourceService, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiRangerPolicyList>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getServicesFromRanger
     * @param clusterName  (required)
     * @param serviceName the name of the local Ranger service. (required)
     * @param sourceCluster optional: the source CM cluster name. (optional)
     * @param sourcePeer optional: the source CM peer name. (optional)
     * @param sourceService optional: the Ranger service name on the source CM. (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 getServicesFromRangerCall(String clusterName, String serviceName, String sourceCluster, String sourcePeer, String sourceService, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/getServicesFromRanger"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

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

        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 getServicesFromRangerValidateBeforeCall(String clusterName, String serviceName, String sourceCluster, String sourcePeer, String sourceService, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling getServicesFromRanger(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling getServicesFromRanger(Async)");
        }

        okhttp3.Call call = getServicesFromRangerCall(clusterName, serviceName, sourceCluster, sourcePeer, sourceService, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Collects information about the services defined in the local Ranger service.
     * Collects information about the services defined in the local Ranger service. &lt;p&gt; Optionally if sourcePeer, sourceCluster, sourceService are provided, then it will call the same API endpoint on that given source CM peer, and merges the result of the local (ApiRangerServiceList#getServices()) and remote (ApiRangerServiceList#getRemoteServices()) Ranger services.
     * @param clusterName  (required)
     * @param serviceName the name of the local Ranger service. (required)
     * @param sourceCluster optional: the source CM cluster name. (optional)
     * @param sourcePeer optional: the source CM peer name. (optional)
     * @param sourceService optional: the Ranger service name on the source CM. (optional)
     * @return ApiRangerServiceList
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiRangerServiceList getServicesFromRanger(String clusterName, String serviceName, String sourceCluster, String sourcePeer, String sourceService) throws ApiException {
        ApiResponse<ApiRangerServiceList> resp = getServicesFromRangerWithHttpInfo(clusterName, serviceName, sourceCluster, sourcePeer, sourceService);
        return resp.getData();
    }

    /**
     * Collects information about the services defined in the local Ranger service.
     * Collects information about the services defined in the local Ranger service. &lt;p&gt; Optionally if sourcePeer, sourceCluster, sourceService are provided, then it will call the same API endpoint on that given source CM peer, and merges the result of the local (ApiRangerServiceList#getServices()) and remote (ApiRangerServiceList#getRemoteServices()) Ranger services.
     * @param clusterName  (required)
     * @param serviceName the name of the local Ranger service. (required)
     * @param sourceCluster optional: the source CM cluster name. (optional)
     * @param sourcePeer optional: the source CM peer name. (optional)
     * @param sourceService optional: the Ranger service name on the source CM. (optional)
     * @return ApiResponse&lt;ApiRangerServiceList&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiRangerServiceList> getServicesFromRangerWithHttpInfo(String clusterName, String serviceName, String sourceCluster, String sourcePeer, String sourceService) throws ApiException {
        okhttp3.Call call = getServicesFromRangerValidateBeforeCall(clusterName, serviceName, sourceCluster, sourcePeer, sourceService, null, null);
        Type localVarReturnType = new TypeToken<ApiRangerServiceList>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Collects information about the services defined in the local Ranger service. (asynchronously)
     * Collects information about the services defined in the local Ranger service. &lt;p&gt; Optionally if sourcePeer, sourceCluster, sourceService are provided, then it will call the same API endpoint on that given source CM peer, and merges the result of the local (ApiRangerServiceList#getServices()) and remote (ApiRangerServiceList#getRemoteServices()) Ranger services.
     * @param clusterName  (required)
     * @param serviceName the name of the local Ranger service. (required)
     * @param sourceCluster optional: the source CM cluster name. (optional)
     * @param sourcePeer optional: the source CM peer name. (optional)
     * @param sourceService optional: the Ranger service name on the source CM. (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 getServicesFromRangerAsync(String clusterName, String serviceName, String sourceCluster, String sourcePeer, String sourceService, final ApiCallback<ApiRangerServiceList> 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 = getServicesFromRangerValidateBeforeCall(clusterName, serviceName, sourceCluster, sourcePeer, sourceService, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiRangerServiceList>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getUsersFromRanger
     * @param clusterName  (required)
     * @param serviceName the name of the local Ranger service. (required)
     * @param sourceCluster optional: the source CM cluster name. (optional)
     * @param sourcePeer optional: the source CM peer name. (optional)
     * @param sourceService optional: the Ranger service name on the source CM. (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 getUsersFromRangerCall(String clusterName, String serviceName, String sourceCluster, String sourcePeer, String sourceService, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/getUsersFromRanger"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

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

        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 getUsersFromRangerValidateBeforeCall(String clusterName, String serviceName, String sourceCluster, String sourcePeer, String sourceService, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling getUsersFromRanger(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling getUsersFromRanger(Async)");
        }

        okhttp3.Call call = getUsersFromRangerCall(clusterName, serviceName, sourceCluster, sourcePeer, sourceService, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Collects information about the users defined in the local Ranger service.
     * Collects information about the users defined in the local Ranger service. &lt;p&gt; Optionally if sourcePeer, sourceCluster, sourceUser are provided, then it will call the same API endpoint on that given source CM peer, and merges the result of the local (ApiRangerUserList#getUsers()) and remote (ApiRangerUserList#getRemoteUsers()) Ranger users.
     * @param clusterName  (required)
     * @param serviceName the name of the local Ranger service. (required)
     * @param sourceCluster optional: the source CM cluster name. (optional)
     * @param sourcePeer optional: the source CM peer name. (optional)
     * @param sourceService optional: the Ranger service name on the source CM. (optional)
     * @return ApiRangerUserList
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiRangerUserList getUsersFromRanger(String clusterName, String serviceName, String sourceCluster, String sourcePeer, String sourceService) throws ApiException {
        ApiResponse<ApiRangerUserList> resp = getUsersFromRangerWithHttpInfo(clusterName, serviceName, sourceCluster, sourcePeer, sourceService);
        return resp.getData();
    }

    /**
     * Collects information about the users defined in the local Ranger service.
     * Collects information about the users defined in the local Ranger service. &lt;p&gt; Optionally if sourcePeer, sourceCluster, sourceUser are provided, then it will call the same API endpoint on that given source CM peer, and merges the result of the local (ApiRangerUserList#getUsers()) and remote (ApiRangerUserList#getRemoteUsers()) Ranger users.
     * @param clusterName  (required)
     * @param serviceName the name of the local Ranger service. (required)
     * @param sourceCluster optional: the source CM cluster name. (optional)
     * @param sourcePeer optional: the source CM peer name. (optional)
     * @param sourceService optional: the Ranger service name on the source CM. (optional)
     * @return ApiResponse&lt;ApiRangerUserList&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiRangerUserList> getUsersFromRangerWithHttpInfo(String clusterName, String serviceName, String sourceCluster, String sourcePeer, String sourceService) throws ApiException {
        okhttp3.Call call = getUsersFromRangerValidateBeforeCall(clusterName, serviceName, sourceCluster, sourcePeer, sourceService, null, null);
        Type localVarReturnType = new TypeToken<ApiRangerUserList>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Collects information about the users defined in the local Ranger service. (asynchronously)
     * Collects information about the users defined in the local Ranger service. &lt;p&gt; Optionally if sourcePeer, sourceCluster, sourceUser are provided, then it will call the same API endpoint on that given source CM peer, and merges the result of the local (ApiRangerUserList#getUsers()) and remote (ApiRangerUserList#getRemoteUsers()) Ranger users.
     * @param clusterName  (required)
     * @param serviceName the name of the local Ranger service. (required)
     * @param sourceCluster optional: the source CM cluster name. (optional)
     * @param sourcePeer optional: the source CM peer name. (optional)
     * @param sourceService optional: the Ranger service name on the source CM. (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 getUsersFromRangerAsync(String clusterName, String serviceName, String sourceCluster, String sourcePeer, String sourceService, final ApiCallback<ApiRangerUserList> 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 = getUsersFromRangerValidateBeforeCall(clusterName, serviceName, sourceCluster, sourcePeer, sourceService, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiRangerUserList>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getYarnUtilization
     * @param clusterName  (required)
     * @param serviceName service name (required)
     * @param daysOfWeek The days of the week for which the user wants to report utilization. Days is a list of number between 1 to 7, where 1 corresponds to Mon. and 7 corresponds to Sun. All 7 days are included if this is not specified. (optional)
     * @param endHourOfDay The end hour of a day for which the user wants to report utilization. The hour is a number between [0-23]. Default value is 23 if this is not specified. (optional, default to 23)
     * @param from Start of the time range to report utilization in ISO 8601 format. (optional)
     * @param startHourOfDay The start hour of a day for which the user wants to report utilization. The hour is a number between [0-23]. Default value is 0 if this is not specified. (optional, default to 0)
     * @param tenantType The type of the tenant (POOL or USER). (optional, default to POOL)
     * @param to End of the the time range to report utilization in ISO 8601 format (defaults to now). (optional, default to now)
     * @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 getYarnUtilizationCall(String clusterName, String serviceName, List<String> daysOfWeek, java.math.BigDecimal endHourOfDay, String from, java.math.BigDecimal startHourOfDay, String tenantType, String to, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/yarnUtilization"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (daysOfWeek != null)
        localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "daysOfWeek", daysOfWeek));
        if (endHourOfDay != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("endHourOfDay", endHourOfDay));
        if (from != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("from", from));
        if (startHourOfDay != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("startHourOfDay", startHourOfDay));
        if (tenantType != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("tenantType", tenantType));
        if (to != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("to", to));

        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 getYarnUtilizationValidateBeforeCall(String clusterName, String serviceName, List<String> daysOfWeek, java.math.BigDecimal endHourOfDay, String from, java.math.BigDecimal startHourOfDay, String tenantType, String to, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling getYarnUtilization(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling getYarnUtilization(Async)");
        }

        okhttp3.Call call = getYarnUtilizationCall(clusterName, serviceName, daysOfWeek, endHourOfDay, from, startHourOfDay, tenantType, to, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Provides the resource utilization of the yarn service as well as the resource utilization per tenant.
     * Provides the resource utilization of the yarn service as well as the resource utilization per tenant. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName service name (required)
     * @param daysOfWeek The days of the week for which the user wants to report utilization. Days is a list of number between 1 to 7, where 1 corresponds to Mon. and 7 corresponds to Sun. All 7 days are included if this is not specified. (optional)
     * @param endHourOfDay The end hour of a day for which the user wants to report utilization. The hour is a number between [0-23]. Default value is 23 if this is not specified. (optional, default to 23)
     * @param from Start of the time range to report utilization in ISO 8601 format. (optional)
     * @param startHourOfDay The start hour of a day for which the user wants to report utilization. The hour is a number between [0-23]. Default value is 0 if this is not specified. (optional, default to 0)
     * @param tenantType The type of the tenant (POOL or USER). (optional, default to POOL)
     * @param to End of the the time range to report utilization in ISO 8601 format (defaults to now). (optional, default to now)
     * @return ApiYarnUtilization
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiYarnUtilization getYarnUtilization(String clusterName, String serviceName, List<String> daysOfWeek, java.math.BigDecimal endHourOfDay, String from, java.math.BigDecimal startHourOfDay, String tenantType, String to) throws ApiException {
        ApiResponse<ApiYarnUtilization> resp = getYarnUtilizationWithHttpInfo(clusterName, serviceName, daysOfWeek, endHourOfDay, from, startHourOfDay, tenantType, to);
        return resp.getData();
    }

    /**
     * Provides the resource utilization of the yarn service as well as the resource utilization per tenant.
     * Provides the resource utilization of the yarn service as well as the resource utilization per tenant. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName service name (required)
     * @param daysOfWeek The days of the week for which the user wants to report utilization. Days is a list of number between 1 to 7, where 1 corresponds to Mon. and 7 corresponds to Sun. All 7 days are included if this is not specified. (optional)
     * @param endHourOfDay The end hour of a day for which the user wants to report utilization. The hour is a number between [0-23]. Default value is 23 if this is not specified. (optional, default to 23)
     * @param from Start of the time range to report utilization in ISO 8601 format. (optional)
     * @param startHourOfDay The start hour of a day for which the user wants to report utilization. The hour is a number between [0-23]. Default value is 0 if this is not specified. (optional, default to 0)
     * @param tenantType The type of the tenant (POOL or USER). (optional, default to POOL)
     * @param to End of the the time range to report utilization in ISO 8601 format (defaults to now). (optional, default to now)
     * @return ApiResponse&lt;ApiYarnUtilization&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiYarnUtilization> getYarnUtilizationWithHttpInfo(String clusterName, String serviceName, List<String> daysOfWeek, java.math.BigDecimal endHourOfDay, String from, java.math.BigDecimal startHourOfDay, String tenantType, String to) throws ApiException {
        okhttp3.Call call = getYarnUtilizationValidateBeforeCall(clusterName, serviceName, daysOfWeek, endHourOfDay, from, startHourOfDay, tenantType, to, null, null);
        Type localVarReturnType = new TypeToken<ApiYarnUtilization>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Provides the resource utilization of the yarn service as well as the resource utilization per tenant. (asynchronously)
     * Provides the resource utilization of the yarn service as well as the resource utilization per tenant. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName service name (required)
     * @param daysOfWeek The days of the week for which the user wants to report utilization. Days is a list of number between 1 to 7, where 1 corresponds to Mon. and 7 corresponds to Sun. All 7 days are included if this is not specified. (optional)
     * @param endHourOfDay The end hour of a day for which the user wants to report utilization. The hour is a number between [0-23]. Default value is 23 if this is not specified. (optional, default to 23)
     * @param from Start of the time range to report utilization in ISO 8601 format. (optional)
     * @param startHourOfDay The start hour of a day for which the user wants to report utilization. The hour is a number between [0-23]. Default value is 0 if this is not specified. (optional, default to 0)
     * @param tenantType The type of the tenant (POOL or USER). (optional, default to POOL)
     * @param to End of the the time range to report utilization in ISO 8601 format (defaults to now). (optional, default to now)
     * @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 getYarnUtilizationAsync(String clusterName, String serviceName, List<String> daysOfWeek, java.math.BigDecimal endHourOfDay, String from, java.math.BigDecimal startHourOfDay, String tenantType, String to, final ApiCallback<ApiYarnUtilization> 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 = getYarnUtilizationValidateBeforeCall(clusterName, serviceName, daysOfWeek, endHourOfDay, from, startHourOfDay, tenantType, to, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiYarnUtilization>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hbaseReplicationCreateUserDirectory
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (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 hbaseReplicationCreateUserDirectoryCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hbaseCreateUserDirectory"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = hbaseReplicationCreateUserDirectoryCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Create the HBase user directory (usually /user/hbase).
     * Create the HBase user directory (usually /user/hbase).
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hbaseReplicationCreateUserDirectory(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = hbaseReplicationCreateUserDirectoryWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Create the HBase user directory (usually /user/hbase).
     * Create the HBase user directory (usually /user/hbase).
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @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> hbaseReplicationCreateUserDirectoryWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = hbaseReplicationCreateUserDirectoryValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Create the HBase user directory (usually /user/hbase). (asynchronously)
     * Create the HBase user directory (usually /user/hbase).
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (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 hbaseReplicationCreateUserDirectoryAsync(String clusterName, String serviceName, 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 = hbaseReplicationCreateUserDirectoryValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hbaseReplicationFirstTimeSetupAutomatic
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body Replication setup parameters such as
the source peer, source service, passphrase for the keystore, and
optionally the RestartType
for both source and target (default is rolling restart) (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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 hbaseReplicationFirstTimeSetupAutomaticCall(String clusterName, String serviceName, ApiHBaseReplicationSetupCommandArgs body, Boolean force, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationFirstTimeSetupAutomatic"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

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

        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 hbaseReplicationFirstTimeSetupAutomaticValidateBeforeCall(String clusterName, String serviceName, ApiHBaseReplicationSetupCommandArgs body, Boolean force, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling hbaseReplicationFirstTimeSetupAutomatic(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling hbaseReplicationFirstTimeSetupAutomatic(Async)");
        }

        okhttp3.Call call = hbaseReplicationFirstTimeSetupAutomaticCall(clusterName, serviceName, body, force, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Starts an automatic HBase replication first time setup.
     * Starts an automatic HBase replication first time setup. After doing some configuration (see #hbaseReplicationSetup(String, boolean, ApiHBaseReplicationSetupCommandArgs)), it restarts both the source and target clusters.
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body Replication setup parameters such as
the source peer, source service, passphrase for the keystore, and
optionally the RestartType
for both source and target (default is rolling restart) (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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 hbaseReplicationFirstTimeSetupAutomatic(String clusterName, String serviceName, ApiHBaseReplicationSetupCommandArgs body, Boolean force) throws ApiException {
        ApiResponse<ApiCommand> resp = hbaseReplicationFirstTimeSetupAutomaticWithHttpInfo(clusterName, serviceName, body, force);
        return resp.getData();
    }

    /**
     * Starts an automatic HBase replication first time setup.
     * Starts an automatic HBase replication first time setup. After doing some configuration (see #hbaseReplicationSetup(String, boolean, ApiHBaseReplicationSetupCommandArgs)), it restarts both the source and target clusters.
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body Replication setup parameters such as
the source peer, source service, passphrase for the keystore, and
optionally the RestartType
for both source and target (default is rolling restart) (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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> hbaseReplicationFirstTimeSetupAutomaticWithHttpInfo(String clusterName, String serviceName, ApiHBaseReplicationSetupCommandArgs body, Boolean force) throws ApiException {
        okhttp3.Call call = hbaseReplicationFirstTimeSetupAutomaticValidateBeforeCall(clusterName, serviceName, body, force, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Starts an automatic HBase replication first time setup. (asynchronously)
     * Starts an automatic HBase replication first time setup. After doing some configuration (see #hbaseReplicationSetup(String, boolean, ApiHBaseReplicationSetupCommandArgs)), it restarts both the source and target clusters.
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body Replication setup parameters such as
the source peer, source service, passphrase for the keystore, and
optionally the RestartType
for both source and target (default is rolling restart) (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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 hbaseReplicationFirstTimeSetupAutomaticAsync(String clusterName, String serviceName, ApiHBaseReplicationSetupCommandArgs body, Boolean force, 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 = hbaseReplicationFirstTimeSetupAutomaticValidateBeforeCall(clusterName, serviceName, body, force, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hbaseReplicationFirstTimeSetupCleanAndReset
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body contains the source peer, source cluster, source service, and
the restart type of source and target HBase services.
Also, if user wants to reset the HBase replication first time setup
status on the source, then the cmPeerNameOnRemote field should be provided:
The peer name of the local CM in the given source CM peer (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 hbaseReplicationFirstTimeSetupCleanAndResetCall(String clusterName, String serviceName, ApiHBaseReplicationSetupCleanAndResetArgs body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationFirstTimeSetupCleanAndReset"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 hbaseReplicationFirstTimeSetupCleanAndResetValidateBeforeCall(String clusterName, String serviceName, ApiHBaseReplicationSetupCleanAndResetArgs body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling hbaseReplicationFirstTimeSetupCleanAndReset(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling hbaseReplicationFirstTimeSetupCleanAndReset(Async)");
        }

        okhttp3.Call call = hbaseReplicationFirstTimeSetupCleanAndResetCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Cleans and resets the HBase replication first time setup on the given source and target:.
     * Cleans and resets the HBase replication first time setup on the given source and target: &lt;ul&gt; &lt;li&gt; clears the HBase replication auxiliary info and deletes the JCEKS files &lt;/li&gt; &lt;li&gt; Optionally restarts HBase services &lt;/li&gt; &lt;li&gt; Resets the HBase replication first time setup status &lt;/li&gt; &lt;/ul&gt;
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body contains the source peer, source cluster, source service, and
the restart type of source and target HBase services.
Also, if user wants to reset the HBase replication first time setup
status on the source, then the cmPeerNameOnRemote field should be provided:
The peer name of the local CM in the given source CM peer (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hbaseReplicationFirstTimeSetupCleanAndReset(String clusterName, String serviceName, ApiHBaseReplicationSetupCleanAndResetArgs body) throws ApiException {
        ApiResponse<ApiCommand> resp = hbaseReplicationFirstTimeSetupCleanAndResetWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Cleans and resets the HBase replication first time setup on the given source and target:.
     * Cleans and resets the HBase replication first time setup on the given source and target: &lt;ul&gt; &lt;li&gt; clears the HBase replication auxiliary info and deletes the JCEKS files &lt;/li&gt; &lt;li&gt; Optionally restarts HBase services &lt;/li&gt; &lt;li&gt; Resets the HBase replication first time setup status &lt;/li&gt; &lt;/ul&gt;
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body contains the source peer, source cluster, source service, and
the restart type of source and target HBase services.
Also, if user wants to reset the HBase replication first time setup
status on the source, then the cmPeerNameOnRemote field should be provided:
The peer name of the local CM in the given source CM peer (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> hbaseReplicationFirstTimeSetupCleanAndResetWithHttpInfo(String clusterName, String serviceName, ApiHBaseReplicationSetupCleanAndResetArgs body) throws ApiException {
        okhttp3.Call call = hbaseReplicationFirstTimeSetupCleanAndResetValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Cleans and resets the HBase replication first time setup on the given source and target:. (asynchronously)
     * Cleans and resets the HBase replication first time setup on the given source and target: &lt;ul&gt; &lt;li&gt; clears the HBase replication auxiliary info and deletes the JCEKS files &lt;/li&gt; &lt;li&gt; Optionally restarts HBase services &lt;/li&gt; &lt;li&gt; Resets the HBase replication first time setup status &lt;/li&gt; &lt;/ul&gt;
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body contains the source peer, source cluster, source service, and
the restart type of source and target HBase services.
Also, if user wants to reset the HBase replication first time setup
status on the source, then the cmPeerNameOnRemote field should be provided:
The peer name of the local CM in the given source CM peer (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 hbaseReplicationFirstTimeSetupCleanAndResetAsync(String clusterName, String serviceName, ApiHBaseReplicationSetupCleanAndResetArgs 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 = hbaseReplicationFirstTimeSetupCleanAndResetValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hbaseReplicationFirstTimeSetupForAlreadyPairedClusters
     * @param clusterName  (required)
     * @param serviceName The local (target) HBase service name (required)
     * @param body contains the source peer, source cluster, source HBase service name (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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 hbaseReplicationFirstTimeSetupForAlreadyPairedClustersCall(String clusterName, String serviceName, ApiServiceRef body, Boolean force, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationFirstTimeSetupForAlreadyPairedClusters"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

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

        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 hbaseReplicationFirstTimeSetupForAlreadyPairedClustersValidateBeforeCall(String clusterName, String serviceName, ApiServiceRef body, Boolean force, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling hbaseReplicationFirstTimeSetupForAlreadyPairedClusters(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling hbaseReplicationFirstTimeSetupForAlreadyPairedClusters(Async)");
        }

        okhttp3.Call call = hbaseReplicationFirstTimeSetupForAlreadyPairedClustersCall(clusterName, serviceName, body, force, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Starts an HBase replication first time setup for the source and target.
     * Starts an HBase replication first time setup for the source and target. &lt;p&gt; Before using this API endpoint, it&#x27;s assumed that the source and target (local) HBase services already have the HBase replication first time setup executed but with different peers. It starts a command, that checks if the necessary configurations are in place on both source and target (see #hbaseReplicationSetup(String, boolean, ApiHBaseReplicationSetupCommandArgs)). If everything matches, then it sets the setup status to READY.
     * @param clusterName  (required)
     * @param serviceName The local (target) HBase service name (required)
     * @param body contains the source peer, source cluster, source HBase service name (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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 hbaseReplicationFirstTimeSetupForAlreadyPairedClusters(String clusterName, String serviceName, ApiServiceRef body, Boolean force) throws ApiException {
        ApiResponse<ApiCommand> resp = hbaseReplicationFirstTimeSetupForAlreadyPairedClustersWithHttpInfo(clusterName, serviceName, body, force);
        return resp.getData();
    }

    /**
     * Starts an HBase replication first time setup for the source and target.
     * Starts an HBase replication first time setup for the source and target. &lt;p&gt; Before using this API endpoint, it&#x27;s assumed that the source and target (local) HBase services already have the HBase replication first time setup executed but with different peers. It starts a command, that checks if the necessary configurations are in place on both source and target (see #hbaseReplicationSetup(String, boolean, ApiHBaseReplicationSetupCommandArgs)). If everything matches, then it sets the setup status to READY.
     * @param clusterName  (required)
     * @param serviceName The local (target) HBase service name (required)
     * @param body contains the source peer, source cluster, source HBase service name (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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> hbaseReplicationFirstTimeSetupForAlreadyPairedClustersWithHttpInfo(String clusterName, String serviceName, ApiServiceRef body, Boolean force) throws ApiException {
        okhttp3.Call call = hbaseReplicationFirstTimeSetupForAlreadyPairedClustersValidateBeforeCall(clusterName, serviceName, body, force, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Starts an HBase replication first time setup for the source and target. (asynchronously)
     * Starts an HBase replication first time setup for the source and target. &lt;p&gt; Before using this API endpoint, it&#x27;s assumed that the source and target (local) HBase services already have the HBase replication first time setup executed but with different peers. It starts a command, that checks if the necessary configurations are in place on both source and target (see #hbaseReplicationSetup(String, boolean, ApiHBaseReplicationSetupCommandArgs)). If everything matches, then it sets the setup status to READY.
     * @param clusterName  (required)
     * @param serviceName The local (target) HBase service name (required)
     * @param body contains the source peer, source cluster, source HBase service name (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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 hbaseReplicationFirstTimeSetupForAlreadyPairedClustersAsync(String clusterName, String serviceName, ApiServiceRef body, Boolean force, 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 = hbaseReplicationFirstTimeSetupForAlreadyPairedClustersValidateBeforeCall(clusterName, serviceName, body, force, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hbaseReplicationFirstTimeSetupForSourceOnly
     * @param clusterName  (required)
     * @param serviceName The local (target) HBase service name (required)
     * @param body Replication setup parameters such as
the source peer, source cluster, source service, HBase replication user,
and optionally the RestartType for the source HBase service.
If RestartType is:
&lt;ul&gt;
&lt;li&gt;
&lt;b&gt;provided&lt;/b&gt;, then restarts source HBase service accordingly.
This is equivalent to the automatic first time setup:
#hbaseReplicationFirstTimeSetupAutomatic(String, boolean, ApiHBaseReplicationSetupCommandArgs)
&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;not provided&lt;/b&gt;, then the source HBase service must be restarted manually.
This is equivalent to the manual first time setup:
#hbaseReplicationFirstTimeSetupManual(String, boolean, ApiHBaseReplicationSetupCommandArgs).
Similarly, after the source HBase service has been restarted,
the first time setup can be finished by calling:
#hbaseReplicationFirstTimeSetupManualContinue(String, ApiServiceRef)
&lt;/li&gt;
&lt;/ul&gt; (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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 hbaseReplicationFirstTimeSetupForSourceOnlyCall(String clusterName, String serviceName, ApiHBaseReplicationSetupOneClusterOnlyCmdArgs body, Boolean force, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationFirstTimeSetupForSourceOnly"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

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

        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 hbaseReplicationFirstTimeSetupForSourceOnlyValidateBeforeCall(String clusterName, String serviceName, ApiHBaseReplicationSetupOneClusterOnlyCmdArgs body, Boolean force, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling hbaseReplicationFirstTimeSetupForSourceOnly(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling hbaseReplicationFirstTimeSetupForSourceOnly(Async)");
        }

        okhttp3.Call call = hbaseReplicationFirstTimeSetupForSourceOnlyCall(clusterName, serviceName, body, force, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Starts an HBase replication first time setup for the source only.
     * Starts an HBase replication first time setup for the source only. &lt;p&gt; Before using this API endpoint, it&#x27;s assumed that the target (local) HBase service already has HBase replication first time setup executed with another peer&#x27;s HBase. It starts a command, that does some configuration only on the source (see #hbaseReplicationSetup(String, boolean, ApiHBaseReplicationSetupCommandArgs)), then restarts source HBase service if needed.
     * @param clusterName  (required)
     * @param serviceName The local (target) HBase service name (required)
     * @param body Replication setup parameters such as
the source peer, source cluster, source service, HBase replication user,
and optionally the RestartType for the source HBase service.
If RestartType is:
&lt;ul&gt;
&lt;li&gt;
&lt;b&gt;provided&lt;/b&gt;, then restarts source HBase service accordingly.
This is equivalent to the automatic first time setup:
#hbaseReplicationFirstTimeSetupAutomatic(String, boolean, ApiHBaseReplicationSetupCommandArgs)
&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;not provided&lt;/b&gt;, then the source HBase service must be restarted manually.
This is equivalent to the manual first time setup:
#hbaseReplicationFirstTimeSetupManual(String, boolean, ApiHBaseReplicationSetupCommandArgs).
Similarly, after the source HBase service has been restarted,
the first time setup can be finished by calling:
#hbaseReplicationFirstTimeSetupManualContinue(String, ApiServiceRef)
&lt;/li&gt;
&lt;/ul&gt; (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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 hbaseReplicationFirstTimeSetupForSourceOnly(String clusterName, String serviceName, ApiHBaseReplicationSetupOneClusterOnlyCmdArgs body, Boolean force) throws ApiException {
        ApiResponse<ApiCommand> resp = hbaseReplicationFirstTimeSetupForSourceOnlyWithHttpInfo(clusterName, serviceName, body, force);
        return resp.getData();
    }

    /**
     * Starts an HBase replication first time setup for the source only.
     * Starts an HBase replication first time setup for the source only. &lt;p&gt; Before using this API endpoint, it&#x27;s assumed that the target (local) HBase service already has HBase replication first time setup executed with another peer&#x27;s HBase. It starts a command, that does some configuration only on the source (see #hbaseReplicationSetup(String, boolean, ApiHBaseReplicationSetupCommandArgs)), then restarts source HBase service if needed.
     * @param clusterName  (required)
     * @param serviceName The local (target) HBase service name (required)
     * @param body Replication setup parameters such as
the source peer, source cluster, source service, HBase replication user,
and optionally the RestartType for the source HBase service.
If RestartType is:
&lt;ul&gt;
&lt;li&gt;
&lt;b&gt;provided&lt;/b&gt;, then restarts source HBase service accordingly.
This is equivalent to the automatic first time setup:
#hbaseReplicationFirstTimeSetupAutomatic(String, boolean, ApiHBaseReplicationSetupCommandArgs)
&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;not provided&lt;/b&gt;, then the source HBase service must be restarted manually.
This is equivalent to the manual first time setup:
#hbaseReplicationFirstTimeSetupManual(String, boolean, ApiHBaseReplicationSetupCommandArgs).
Similarly, after the source HBase service has been restarted,
the first time setup can be finished by calling:
#hbaseReplicationFirstTimeSetupManualContinue(String, ApiServiceRef)
&lt;/li&gt;
&lt;/ul&gt; (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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> hbaseReplicationFirstTimeSetupForSourceOnlyWithHttpInfo(String clusterName, String serviceName, ApiHBaseReplicationSetupOneClusterOnlyCmdArgs body, Boolean force) throws ApiException {
        okhttp3.Call call = hbaseReplicationFirstTimeSetupForSourceOnlyValidateBeforeCall(clusterName, serviceName, body, force, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Starts an HBase replication first time setup for the source only. (asynchronously)
     * Starts an HBase replication first time setup for the source only. &lt;p&gt; Before using this API endpoint, it&#x27;s assumed that the target (local) HBase service already has HBase replication first time setup executed with another peer&#x27;s HBase. It starts a command, that does some configuration only on the source (see #hbaseReplicationSetup(String, boolean, ApiHBaseReplicationSetupCommandArgs)), then restarts source HBase service if needed.
     * @param clusterName  (required)
     * @param serviceName The local (target) HBase service name (required)
     * @param body Replication setup parameters such as
the source peer, source cluster, source service, HBase replication user,
and optionally the RestartType for the source HBase service.
If RestartType is:
&lt;ul&gt;
&lt;li&gt;
&lt;b&gt;provided&lt;/b&gt;, then restarts source HBase service accordingly.
This is equivalent to the automatic first time setup:
#hbaseReplicationFirstTimeSetupAutomatic(String, boolean, ApiHBaseReplicationSetupCommandArgs)
&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;not provided&lt;/b&gt;, then the source HBase service must be restarted manually.
This is equivalent to the manual first time setup:
#hbaseReplicationFirstTimeSetupManual(String, boolean, ApiHBaseReplicationSetupCommandArgs).
Similarly, after the source HBase service has been restarted,
the first time setup can be finished by calling:
#hbaseReplicationFirstTimeSetupManualContinue(String, ApiServiceRef)
&lt;/li&gt;
&lt;/ul&gt; (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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 hbaseReplicationFirstTimeSetupForSourceOnlyAsync(String clusterName, String serviceName, ApiHBaseReplicationSetupOneClusterOnlyCmdArgs body, Boolean force, 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 = hbaseReplicationFirstTimeSetupForSourceOnlyValidateBeforeCall(clusterName, serviceName, body, force, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hbaseReplicationFirstTimeSetupForTargetOnly
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body Replication setup parameters such as
the source peer, source cluster, source service, HBase replication user,
and optionally the RestartType for the local HBase service
(default is rolling restart) (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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 hbaseReplicationFirstTimeSetupForTargetOnlyCall(String clusterName, String serviceName, ApiHBaseReplicationSetupOneClusterOnlyCmdArgs body, Boolean force, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationFirstTimeSetupForTargetOnly"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

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

        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 hbaseReplicationFirstTimeSetupForTargetOnlyValidateBeforeCall(String clusterName, String serviceName, ApiHBaseReplicationSetupOneClusterOnlyCmdArgs body, Boolean force, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling hbaseReplicationFirstTimeSetupForTargetOnly(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling hbaseReplicationFirstTimeSetupForTargetOnly(Async)");
        }

        okhttp3.Call call = hbaseReplicationFirstTimeSetupForTargetOnlyCall(clusterName, serviceName, body, force, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Starts an HBase replication first time setup for the target only.
     * Starts an HBase replication first time setup for the target only. &lt;p&gt; Before using this API endpoint, it&#x27;s assumed that the given source HBase service, given by ApiHBaseReplicationSetupOneClusterOnlyCmdArgs, already has HBase replication first time setup executed with another peer&#x27;s HBase. It starts a command, that does some configuration only on the target (see #hbaseReplicationSetup(String, boolean, ApiHBaseReplicationSetupCommandArgs)), then restarts target HBase service.
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body Replication setup parameters such as
the source peer, source cluster, source service, HBase replication user,
and optionally the RestartType for the local HBase service
(default is rolling restart) (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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 hbaseReplicationFirstTimeSetupForTargetOnly(String clusterName, String serviceName, ApiHBaseReplicationSetupOneClusterOnlyCmdArgs body, Boolean force) throws ApiException {
        ApiResponse<ApiCommand> resp = hbaseReplicationFirstTimeSetupForTargetOnlyWithHttpInfo(clusterName, serviceName, body, force);
        return resp.getData();
    }

    /**
     * Starts an HBase replication first time setup for the target only.
     * Starts an HBase replication first time setup for the target only. &lt;p&gt; Before using this API endpoint, it&#x27;s assumed that the given source HBase service, given by ApiHBaseReplicationSetupOneClusterOnlyCmdArgs, already has HBase replication first time setup executed with another peer&#x27;s HBase. It starts a command, that does some configuration only on the target (see #hbaseReplicationSetup(String, boolean, ApiHBaseReplicationSetupCommandArgs)), then restarts target HBase service.
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body Replication setup parameters such as
the source peer, source cluster, source service, HBase replication user,
and optionally the RestartType for the local HBase service
(default is rolling restart) (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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> hbaseReplicationFirstTimeSetupForTargetOnlyWithHttpInfo(String clusterName, String serviceName, ApiHBaseReplicationSetupOneClusterOnlyCmdArgs body, Boolean force) throws ApiException {
        okhttp3.Call call = hbaseReplicationFirstTimeSetupForTargetOnlyValidateBeforeCall(clusterName, serviceName, body, force, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Starts an HBase replication first time setup for the target only. (asynchronously)
     * Starts an HBase replication first time setup for the target only. &lt;p&gt; Before using this API endpoint, it&#x27;s assumed that the given source HBase service, given by ApiHBaseReplicationSetupOneClusterOnlyCmdArgs, already has HBase replication first time setup executed with another peer&#x27;s HBase. It starts a command, that does some configuration only on the target (see #hbaseReplicationSetup(String, boolean, ApiHBaseReplicationSetupCommandArgs)), then restarts target HBase service.
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body Replication setup parameters such as
the source peer, source cluster, source service, HBase replication user,
and optionally the RestartType for the local HBase service
(default is rolling restart) (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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 hbaseReplicationFirstTimeSetupForTargetOnlyAsync(String clusterName, String serviceName, ApiHBaseReplicationSetupOneClusterOnlyCmdArgs body, Boolean force, 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 = hbaseReplicationFirstTimeSetupForTargetOnlyValidateBeforeCall(clusterName, serviceName, body, force, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hbaseReplicationFirstTimeSetupForceReady
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body contains the source peer, source cluster, source sourceService (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 hbaseReplicationFirstTimeSetupForceReadyCall(String clusterName, String serviceName, ApiServiceRef body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationFirstTimeSetupForceReady"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            
        };
        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 hbaseReplicationFirstTimeSetupForceReadyValidateBeforeCall(String clusterName, String serviceName, ApiServiceRef body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling hbaseReplicationFirstTimeSetupForceReady(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling hbaseReplicationFirstTimeSetupForceReady(Async)");
        }

        okhttp3.Call call = hbaseReplicationFirstTimeSetupForceReadyCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Force sets the HBase replication first time setup status to be READY for the given source and target.
     * Force sets the HBase replication first time setup status to be READY for the given source and target. Note that after this operation, the pending HBase replication policies, which have the waitForHBaseReplicationSetup flag set to true, will NOT be completed.
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body contains the source peer, source cluster, source sourceService (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void hbaseReplicationFirstTimeSetupForceReady(String clusterName, String serviceName, ApiServiceRef body) throws ApiException {
        hbaseReplicationFirstTimeSetupForceReadyWithHttpInfo(clusterName, serviceName, body);
    }

    /**
     * Force sets the HBase replication first time setup status to be READY for the given source and target.
     * Force sets the HBase replication first time setup status to be READY for the given source and target. Note that after this operation, the pending HBase replication policies, which have the waitForHBaseReplicationSetup flag set to true, will NOT be completed.
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body contains the source peer, source cluster, source sourceService (optional)
     * @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> hbaseReplicationFirstTimeSetupForceReadyWithHttpInfo(String clusterName, String serviceName, ApiServiceRef body) throws ApiException {
        okhttp3.Call call = hbaseReplicationFirstTimeSetupForceReadyValidateBeforeCall(clusterName, serviceName, body, null, null);
        return apiClient.execute(call);
    }

    /**
     * Force sets the HBase replication first time setup status to be READY for the given source and target. (asynchronously)
     * Force sets the HBase replication first time setup status to be READY for the given source and target. Note that after this operation, the pending HBase replication policies, which have the waitForHBaseReplicationSetup flag set to true, will NOT be completed.
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body contains the source peer, source cluster, source sourceService (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 hbaseReplicationFirstTimeSetupForceReadyAsync(String clusterName, String serviceName, ApiServiceRef body, 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 = hbaseReplicationFirstTimeSetupForceReadyValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }
    /**
     * Build call for hbaseReplicationFirstTimeSetupManual
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body Replication setup parameters such as
the source peer, source service, passphrase for the keystore, and
optionally the RestartType
for the target (default is rolling restart) (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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 hbaseReplicationFirstTimeSetupManualCall(String clusterName, String serviceName, ApiHBaseReplicationSetupCommandArgs body, Boolean force, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationFirstTimeSetupManual"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

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

        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 hbaseReplicationFirstTimeSetupManualValidateBeforeCall(String clusterName, String serviceName, ApiHBaseReplicationSetupCommandArgs body, Boolean force, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling hbaseReplicationFirstTimeSetupManual(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling hbaseReplicationFirstTimeSetupManual(Async)");
        }

        okhttp3.Call call = hbaseReplicationFirstTimeSetupManualCall(clusterName, serviceName, body, force, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Starts a manual HBase replication first time setup.
     * Starts a manual HBase replication first time setup. After doing some configuration (see #hbaseReplicationSetup(String, boolean, ApiHBaseReplicationSetupCommandArgs)), it restarts the target cluster only. Source cluster has to be restarted manually, after which the #hbaseReplicationFirstTimeSetupManualContinue(String, ApiServiceRef) API endpoint should be called to finish the HBase replication first time setup.
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body Replication setup parameters such as
the source peer, source service, passphrase for the keystore, and
optionally the RestartType
for the target (default is rolling restart) (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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 hbaseReplicationFirstTimeSetupManual(String clusterName, String serviceName, ApiHBaseReplicationSetupCommandArgs body, Boolean force) throws ApiException {
        ApiResponse<ApiCommand> resp = hbaseReplicationFirstTimeSetupManualWithHttpInfo(clusterName, serviceName, body, force);
        return resp.getData();
    }

    /**
     * Starts a manual HBase replication first time setup.
     * Starts a manual HBase replication first time setup. After doing some configuration (see #hbaseReplicationSetup(String, boolean, ApiHBaseReplicationSetupCommandArgs)), it restarts the target cluster only. Source cluster has to be restarted manually, after which the #hbaseReplicationFirstTimeSetupManualContinue(String, ApiServiceRef) API endpoint should be called to finish the HBase replication first time setup.
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body Replication setup parameters such as
the source peer, source service, passphrase for the keystore, and
optionally the RestartType
for the target (default is rolling restart) (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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> hbaseReplicationFirstTimeSetupManualWithHttpInfo(String clusterName, String serviceName, ApiHBaseReplicationSetupCommandArgs body, Boolean force) throws ApiException {
        okhttp3.Call call = hbaseReplicationFirstTimeSetupManualValidateBeforeCall(clusterName, serviceName, body, force, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Starts a manual HBase replication first time setup. (asynchronously)
     * Starts a manual HBase replication first time setup. After doing some configuration (see #hbaseReplicationSetup(String, boolean, ApiHBaseReplicationSetupCommandArgs)), it restarts the target cluster only. Source cluster has to be restarted manually, after which the #hbaseReplicationFirstTimeSetupManualContinue(String, ApiServiceRef) API endpoint should be called to finish the HBase replication first time setup.
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body Replication setup parameters such as
the source peer, source service, passphrase for the keystore, and
optionally the RestartType
for the target (default is rolling restart) (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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 hbaseReplicationFirstTimeSetupManualAsync(String clusterName, String serviceName, ApiHBaseReplicationSetupCommandArgs body, Boolean force, 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 = hbaseReplicationFirstTimeSetupManualValidateBeforeCall(clusterName, serviceName, body, force, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hbaseReplicationFirstTimeSetupManualContinue
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body contains the source peer, source cluster, source service (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 hbaseReplicationFirstTimeSetupManualContinueCall(String clusterName, String serviceName, ApiServiceRef body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationFirstTimeSetupManualContinue"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 hbaseReplicationFirstTimeSetupManualContinueValidateBeforeCall(String clusterName, String serviceName, ApiServiceRef body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling hbaseReplicationFirstTimeSetupManualContinue(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling hbaseReplicationFirstTimeSetupManualContinue(Async)");
        }

        okhttp3.Call call = hbaseReplicationFirstTimeSetupManualContinueCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Should be called after #hbaseReplicationFirstTimeSetupManual(String, ApiHBaseReplicationSetupCommandArgs) to finish the manual HBase replication first time setup.
     * Should be called after #hbaseReplicationFirstTimeSetupManual(String, ApiHBaseReplicationSetupCommandArgs) to finish the manual HBase replication first time setup.
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body contains the source peer, source cluster, source service (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hbaseReplicationFirstTimeSetupManualContinue(String clusterName, String serviceName, ApiServiceRef body) throws ApiException {
        ApiResponse<ApiCommand> resp = hbaseReplicationFirstTimeSetupManualContinueWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Should be called after #hbaseReplicationFirstTimeSetupManual(String, ApiHBaseReplicationSetupCommandArgs) to finish the manual HBase replication first time setup.
     * Should be called after #hbaseReplicationFirstTimeSetupManual(String, ApiHBaseReplicationSetupCommandArgs) to finish the manual HBase replication first time setup.
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body contains the source peer, source cluster, source service (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> hbaseReplicationFirstTimeSetupManualContinueWithHttpInfo(String clusterName, String serviceName, ApiServiceRef body) throws ApiException {
        okhttp3.Call call = hbaseReplicationFirstTimeSetupManualContinueValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Should be called after #hbaseReplicationFirstTimeSetupManual(String, ApiHBaseReplicationSetupCommandArgs) to finish the manual HBase replication first time setup. (asynchronously)
     * Should be called after #hbaseReplicationFirstTimeSetupManual(String, ApiHBaseReplicationSetupCommandArgs) to finish the manual HBase replication first time setup.
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body contains the source peer, source cluster, source service (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 hbaseReplicationFirstTimeSetupManualContinueAsync(String clusterName, String serviceName, ApiServiceRef 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 = hbaseReplicationFirstTimeSetupManualContinueValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hbaseReplicationFirstTimeSetupReset
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body contains the source peer, source cluster, source sourceService (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 hbaseReplicationFirstTimeSetupResetCall(String clusterName, String serviceName, ApiServiceRef body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationFirstTimeSetupReset"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            
        };
        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 hbaseReplicationFirstTimeSetupResetValidateBeforeCall(String clusterName, String serviceName, ApiServiceRef body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling hbaseReplicationFirstTimeSetupReset(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling hbaseReplicationFirstTimeSetupReset(Async)");
        }

        okhttp3.Call call = hbaseReplicationFirstTimeSetupResetCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Resets/removes the HBase replication first time setup status for the given source and target.
     * Resets/removes the HBase replication first time setup status for the given source and target.
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body contains the source peer, source cluster, source sourceService (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void hbaseReplicationFirstTimeSetupReset(String clusterName, String serviceName, ApiServiceRef body) throws ApiException {
        hbaseReplicationFirstTimeSetupResetWithHttpInfo(clusterName, serviceName, body);
    }

    /**
     * Resets/removes the HBase replication first time setup status for the given source and target.
     * Resets/removes the HBase replication first time setup status for the given source and target.
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body contains the source peer, source cluster, source sourceService (optional)
     * @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> hbaseReplicationFirstTimeSetupResetWithHttpInfo(String clusterName, String serviceName, ApiServiceRef body) throws ApiException {
        okhttp3.Call call = hbaseReplicationFirstTimeSetupResetValidateBeforeCall(clusterName, serviceName, body, null, null);
        return apiClient.execute(call);
    }

    /**
     * Resets/removes the HBase replication first time setup status for the given source and target. (asynchronously)
     * Resets/removes the HBase replication first time setup status for the given source and target.
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param body contains the source peer, source cluster, source sourceService (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 hbaseReplicationFirstTimeSetupResetAsync(String clusterName, String serviceName, ApiServiceRef body, 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 = hbaseReplicationFirstTimeSetupResetValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }
    /**
     * Build call for hbaseReplicationFirstTimeSetupStatus
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param sourceCluster The source cluster&#x27;s name (optional)
     * @param sourcePeer The source peer&#x27;s name (optional)
     * @param sourceService The source service&#x27;s 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 hbaseReplicationFirstTimeSetupStatusCall(String clusterName, String serviceName, String sourceCluster, String sourcePeer, String sourceService, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationFirstTimeSetupStatus"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

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

        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 hbaseReplicationFirstTimeSetupStatusValidateBeforeCall(String clusterName, String serviceName, String sourceCluster, String sourcePeer, String sourceService, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling hbaseReplicationFirstTimeSetupStatus(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling hbaseReplicationFirstTimeSetupStatus(Async)");
        }

        okhttp3.Call call = hbaseReplicationFirstTimeSetupStatusCall(clusterName, serviceName, sourceCluster, sourcePeer, sourceService, progressListener, progressRequestListener);
        return call;

    }

    /**
     * 
     * 
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param sourceCluster The source cluster&#x27;s name (optional)
     * @param sourcePeer The source peer&#x27;s name (optional)
     * @param sourceService The source service&#x27;s name (optional)
     * @return ApiHBaseReplicationSetupStatus
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiHBaseReplicationSetupStatus hbaseReplicationFirstTimeSetupStatus(String clusterName, String serviceName, String sourceCluster, String sourcePeer, String sourceService) throws ApiException {
        ApiResponse<ApiHBaseReplicationSetupStatus> resp = hbaseReplicationFirstTimeSetupStatusWithHttpInfo(clusterName, serviceName, sourceCluster, sourcePeer, sourceService);
        return resp.getData();
    }

    /**
     * 
     * 
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param sourceCluster The source cluster&#x27;s name (optional)
     * @param sourcePeer The source peer&#x27;s name (optional)
     * @param sourceService The source service&#x27;s name (optional)
     * @return ApiResponse&lt;ApiHBaseReplicationSetupStatus&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiHBaseReplicationSetupStatus> hbaseReplicationFirstTimeSetupStatusWithHttpInfo(String clusterName, String serviceName, String sourceCluster, String sourcePeer, String sourceService) throws ApiException {
        okhttp3.Call call = hbaseReplicationFirstTimeSetupStatusValidateBeforeCall(clusterName, serviceName, sourceCluster, sourcePeer, sourceService, null, null);
        Type localVarReturnType = new TypeToken<ApiHBaseReplicationSetupStatus>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     *  (asynchronously)
     * 
     * @param clusterName  (required)
     * @param serviceName The local HBase service name (required)
     * @param sourceCluster The source cluster&#x27;s name (optional)
     * @param sourcePeer The source peer&#x27;s name (optional)
     * @param sourceService The source service&#x27;s 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 hbaseReplicationFirstTimeSetupStatusAsync(String clusterName, String serviceName, String sourceCluster, String sourcePeer, String sourceService, final ApiCallback<ApiHBaseReplicationSetupStatus> 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 = hbaseReplicationFirstTimeSetupStatusValidateBeforeCall(clusterName, serviceName, sourceCluster, sourcePeer, sourceService, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiHBaseReplicationSetupStatus>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hbaseReplicationSetup
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body  (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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 hbaseReplicationSetupCall(String clusterName, String serviceName, ApiHBaseReplicationSetupCommandArgs body, Boolean force, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationSetup"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

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

        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 hbaseReplicationSetupValidateBeforeCall(String clusterName, String serviceName, ApiHBaseReplicationSetupCommandArgs body, Boolean force, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling hbaseReplicationSetup(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling hbaseReplicationSetup(Async)");
        }

        okhttp3.Call call = hbaseReplicationSetupCall(clusterName, serviceName, body, force, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Perform one time setup for HBase replication.
     * Perform one time setup for HBase replication.  Generate the a keystore to HDFS for use by replication and transfer the keystore to HDFS on the the peer.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body  (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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 hbaseReplicationSetup(String clusterName, String serviceName, ApiHBaseReplicationSetupCommandArgs body, Boolean force) throws ApiException {
        ApiResponse<ApiCommand> resp = hbaseReplicationSetupWithHttpInfo(clusterName, serviceName, body, force);
        return resp.getData();
    }

    /**
     * Perform one time setup for HBase replication.
     * Perform one time setup for HBase replication.  Generate the a keystore to HDFS for use by replication and transfer the keystore to HDFS on the the peer.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body  (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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> hbaseReplicationSetupWithHttpInfo(String clusterName, String serviceName, ApiHBaseReplicationSetupCommandArgs body, Boolean force) throws ApiException {
        okhttp3.Call call = hbaseReplicationSetupValidateBeforeCall(clusterName, serviceName, body, force, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Perform one time setup for HBase replication. (asynchronously)
     * Perform one time setup for HBase replication.  Generate the a keystore to HDFS for use by replication and transfer the keystore to HDFS on the the peer.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body  (optional)
     * @param force If true, perform setup even if already setup. (Default false) (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 hbaseReplicationSetupAsync(String clusterName, String serviceName, ApiHBaseReplicationSetupCommandArgs body, Boolean force, 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 = hbaseReplicationSetupValidateBeforeCall(clusterName, serviceName, body, force, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hbaseReplicationSetupAdmin
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @param cmPeerDefinition  (optional)
     * @param op  (optional)
     * @param path  (optional)
     * @param user  (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 hbaseReplicationSetupAdminCall(String clusterName, String serviceName, String cmPeerDefinition, String op, String path, String user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationSetupAdmin"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

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

        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 hbaseReplicationSetupAdminValidateBeforeCall(String clusterName, String serviceName, String cmPeerDefinition, String op, String path, String user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling hbaseReplicationSetupAdmin(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling hbaseReplicationSetupAdmin(Async)");
        }

        okhttp3.Call call = hbaseReplicationSetupAdminCall(clusterName, serviceName, cmPeerDefinition, op, path, user, progressListener, progressRequestListener);
        return call;

    }

    /**
     * 
     * 
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @param cmPeerDefinition  (optional)
     * @param op  (optional)
     * @param path  (optional)
     * @param user  (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hbaseReplicationSetupAdmin(String clusterName, String serviceName, String cmPeerDefinition, String op, String path, String user) throws ApiException {
        ApiResponse<ApiCommand> resp = hbaseReplicationSetupAdminWithHttpInfo(clusterName, serviceName, cmPeerDefinition, op, path, user);
        return resp.getData();
    }

    /**
     * 
     * 
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @param cmPeerDefinition  (optional)
     * @param op  (optional)
     * @param path  (optional)
     * @param user  (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> hbaseReplicationSetupAdminWithHttpInfo(String clusterName, String serviceName, String cmPeerDefinition, String op, String path, String user) throws ApiException {
        okhttp3.Call call = hbaseReplicationSetupAdminValidateBeforeCall(clusterName, serviceName, cmPeerDefinition, op, path, user, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     *  (asynchronously)
     * 
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @param cmPeerDefinition  (optional)
     * @param op  (optional)
     * @param path  (optional)
     * @param user  (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 hbaseReplicationSetupAdminAsync(String clusterName, String serviceName, String cmPeerDefinition, String op, String path, String user, 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 = hbaseReplicationSetupAdminValidateBeforeCall(clusterName, serviceName, cmPeerDefinition, op, path, user, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hbaseShellCommand
     * @param clusterName  (required)
     * @param serviceName The HBase service name (required)
     * @param body hbase shell command to be executed (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 hbaseShellCommandCall(String clusterName, String serviceName, ApiHBaseShellCommand body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hbaseShellCommand"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 hbaseShellCommandValidateBeforeCall(String clusterName, String serviceName, ApiHBaseShellCommand body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling hbaseShellCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling hbaseShellCommand(Async)");
        }

        okhttp3.Call call = hbaseShellCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Execute a hbase shell command.
     * Execute a hbase shell command
     * @param clusterName  (required)
     * @param serviceName The HBase service name (required)
     * @param body hbase shell command to be executed (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hbaseShellCommand(String clusterName, String serviceName, ApiHBaseShellCommand body) throws ApiException {
        ApiResponse<ApiCommand> resp = hbaseShellCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Execute a hbase shell command.
     * Execute a hbase shell command
     * @param clusterName  (required)
     * @param serviceName The HBase service name (required)
     * @param body hbase shell command to be executed (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> hbaseShellCommandWithHttpInfo(String clusterName, String serviceName, ApiHBaseShellCommand body) throws ApiException {
        okhttp3.Call call = hbaseShellCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Execute a hbase shell command. (asynchronously)
     * Execute a hbase shell command
     * @param clusterName  (required)
     * @param serviceName The HBase service name (required)
     * @param body hbase shell command to be executed (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 hbaseShellCommandAsync(String clusterName, String serviceName, ApiHBaseShellCommand 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 = hbaseShellCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hbaseUpgradeCommand
     * @param clusterName  (required)
     * @param serviceName The HBase service name. (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 hbaseUpgradeCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hbaseUpgrade"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = hbaseUpgradeCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Upgrade HBase data in HDFS and ZooKeeper as part of upgrade from CDH4 to CDH5.
     * Upgrade HBase data in HDFS and ZooKeeper as part of upgrade from CDH4 to CDH5. &lt;p/&gt; This is required in order to run HBase after upgrade. &lt;p/&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName The HBase service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hbaseUpgradeCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = hbaseUpgradeCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Upgrade HBase data in HDFS and ZooKeeper as part of upgrade from CDH4 to CDH5.
     * Upgrade HBase data in HDFS and ZooKeeper as part of upgrade from CDH4 to CDH5. &lt;p/&gt; This is required in order to run HBase after upgrade. &lt;p/&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName The HBase service name. (required)
     * @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> hbaseUpgradeCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = hbaseUpgradeCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Upgrade HBase data in HDFS and ZooKeeper as part of upgrade from CDH4 to CDH5. (asynchronously)
     * Upgrade HBase data in HDFS and ZooKeeper as part of upgrade from CDH4 to CDH5. &lt;p/&gt; This is required in order to run HBase after upgrade. &lt;p/&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName The HBase service name. (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 hbaseUpgradeCommandAsync(String clusterName, String serviceName, 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 = hbaseUpgradeCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hdfsAddSBNNToNSCommand
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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 hdfsAddSBNNToNSCommandCall(String clusterName, String serviceName, ApiAddSBNNToNSArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hdfsAddSBNNToNS"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 hdfsAddSBNNToNSCommandValidateBeforeCall(String clusterName, String serviceName, ApiAddSBNNToNSArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling hdfsAddSBNNToNSCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling hdfsAddSBNNToNSCommand(Async)");
        }

        okhttp3.Call call = hdfsAddSBNNToNSCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * 
     * 
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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 hdfsAddSBNNToNSCommand(String clusterName, String serviceName, ApiAddSBNNToNSArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = hdfsAddSBNNToNSCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * 
     * 
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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> hdfsAddSBNNToNSCommandWithHttpInfo(String clusterName, String serviceName, ApiAddSBNNToNSArguments body) throws ApiException {
        okhttp3.Call call = hdfsAddSBNNToNSCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     *  (asynchronously)
     * 
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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 hdfsAddSBNNToNSCommandAsync(String clusterName, String serviceName, ApiAddSBNNToNSArguments 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 = hdfsAddSBNNToNSCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hdfsCreateTmpDir
     * @param clusterName  (required)
     * @param serviceName Name of the HDFS service on which to run the command. (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 hdfsCreateTmpDirCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hdfsCreateTmpDir"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = hdfsCreateTmpDirCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Creates a tmp directory on the HDFS filesystem.
     * Creates a tmp directory on the HDFS filesystem. &lt;p&gt; Available since API v2. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName Name of the HDFS service on which to run the command. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hdfsCreateTmpDir(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = hdfsCreateTmpDirWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Creates a tmp directory on the HDFS filesystem.
     * Creates a tmp directory on the HDFS filesystem. &lt;p&gt; Available since API v2. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName Name of the HDFS service on which to run the command. (required)
     * @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> hdfsCreateTmpDirWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = hdfsCreateTmpDirValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Creates a tmp directory on the HDFS filesystem. (asynchronously)
     * Creates a tmp directory on the HDFS filesystem. &lt;p&gt; Available since API v2. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName Name of the HDFS service on which to run the command. (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 hdfsCreateTmpDirAsync(String clusterName, String serviceName, 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 = hdfsCreateTmpDirValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hdfsDisableAutoFailoverCommand
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body The nameservice 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 hdfsDisableAutoFailoverCommandCall(String clusterName, String serviceName, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hdfsDisableAutoFailover"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "text/plain", "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);
    }

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

        okhttp3.Call call = hdfsDisableAutoFailoverCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Disable auto-failover for a highly available HDFS nameservice.
     * Disable auto-failover for a highly available HDFS nameservice. &lt;p&gt; The command will modify the nameservice&#x27;s NameNodes configuration to disable automatic failover, and delete the existing failover controllers. &lt;p&gt; The ZooKeeper dependency of the service will not be removed.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body The nameservice name. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hdfsDisableAutoFailoverCommand(String clusterName, String serviceName, String body) throws ApiException {
        ApiResponse<ApiCommand> resp = hdfsDisableAutoFailoverCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Disable auto-failover for a highly available HDFS nameservice.
     * Disable auto-failover for a highly available HDFS nameservice. &lt;p&gt; The command will modify the nameservice&#x27;s NameNodes configuration to disable automatic failover, and delete the existing failover controllers. &lt;p&gt; The ZooKeeper dependency of the service will not be removed.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body The nameservice name. (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> hdfsDisableAutoFailoverCommandWithHttpInfo(String clusterName, String serviceName, String body) throws ApiException {
        okhttp3.Call call = hdfsDisableAutoFailoverCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Disable auto-failover for a highly available HDFS nameservice. (asynchronously)
     * Disable auto-failover for a highly available HDFS nameservice. &lt;p&gt; The command will modify the nameservice&#x27;s NameNodes configuration to disable automatic failover, and delete the existing failover controllers. &lt;p&gt; The ZooKeeper dependency of the service will not be removed.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body The nameservice 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 hdfsDisableAutoFailoverCommandAsync(String clusterName, String serviceName, String 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 = hdfsDisableAutoFailoverCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hdfsDisableHaCommand
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments for the command. (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 hdfsDisableHaCommandCall(String clusterName, String serviceName, ApiHdfsDisableHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hdfsDisableHa"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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);
    }

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

        okhttp3.Call call = hdfsDisableHaCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Disable high availability (HA) for an HDFS NameNode.
     * Disable high availability (HA) for an HDFS NameNode. &lt;p&gt; The NameNode to be kept must be running before HA can be disabled. &lt;p&gt; As part of disabling HA, any services that depend on the HDFS service being modified will be stopped. The command arguments provide options to re-start these services and to re-deploy the client configurations for services of the cluster after HA has been disabled.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments for the command. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hdfsDisableHaCommand(String clusterName, String serviceName, ApiHdfsDisableHaArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = hdfsDisableHaCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Disable high availability (HA) for an HDFS NameNode.
     * Disable high availability (HA) for an HDFS NameNode. &lt;p&gt; The NameNode to be kept must be running before HA can be disabled. &lt;p&gt; As part of disabling HA, any services that depend on the HDFS service being modified will be stopped. The command arguments provide options to re-start these services and to re-deploy the client configurations for services of the cluster after HA has been disabled.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments for the command. (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> hdfsDisableHaCommandWithHttpInfo(String clusterName, String serviceName, ApiHdfsDisableHaArguments body) throws ApiException {
        okhttp3.Call call = hdfsDisableHaCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Disable high availability (HA) for an HDFS NameNode. (asynchronously)
     * Disable high availability (HA) for an HDFS NameNode. &lt;p&gt; The NameNode to be kept must be running before HA can be disabled. &lt;p&gt; As part of disabling HA, any services that depend on the HDFS service being modified will be stopped. The command arguments provide options to re-start these services and to re-deploy the client configurations for services of the cluster after HA has been disabled.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments for the command. (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 hdfsDisableHaCommandAsync(String clusterName, String serviceName, ApiHdfsDisableHaArguments 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 = hdfsDisableHaCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hdfsDisableNnHaCommand
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments for the command. (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 hdfsDisableNnHaCommandCall(String clusterName, String serviceName, ApiDisableNnHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hdfsDisableNnHa"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 hdfsDisableNnHaCommandValidateBeforeCall(String clusterName, String serviceName, ApiDisableNnHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling hdfsDisableNnHaCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling hdfsDisableNnHaCommand(Async)");
        }

        okhttp3.Call call = hdfsDisableNnHaCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Disable High Availability (HA) with Automatic Failover for an HDFS NameNode.
     * Disable High Availability (HA) with Automatic Failover for an HDFS NameNode. &lt;p&gt; As part of disabling HA, any services that depend on the HDFS service being modified will be stopped. The command will delete the Standby NameNode associated with the specified NameNode. Any FailoverControllers associated with the NameNode&#x27;s nameservice are also deleted. A SecondaryNameNode is created on the host specified by the arugments. &lt;p&gt; If no nameservices uses Quorum Journal after HA is disabled for the specified nameservice, then all JournalNodes are also deleted. &lt;p&gt; Then, HDFS service is restarted and all services that were stopped are started again afterwards. Finally, client configs for HDFS and its depedents will be re-deployed.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments for the command. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hdfsDisableNnHaCommand(String clusterName, String serviceName, ApiDisableNnHaArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = hdfsDisableNnHaCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Disable High Availability (HA) with Automatic Failover for an HDFS NameNode.
     * Disable High Availability (HA) with Automatic Failover for an HDFS NameNode. &lt;p&gt; As part of disabling HA, any services that depend on the HDFS service being modified will be stopped. The command will delete the Standby NameNode associated with the specified NameNode. Any FailoverControllers associated with the NameNode&#x27;s nameservice are also deleted. A SecondaryNameNode is created on the host specified by the arugments. &lt;p&gt; If no nameservices uses Quorum Journal after HA is disabled for the specified nameservice, then all JournalNodes are also deleted. &lt;p&gt; Then, HDFS service is restarted and all services that were stopped are started again afterwards. Finally, client configs for HDFS and its depedents will be re-deployed.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments for the command. (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> hdfsDisableNnHaCommandWithHttpInfo(String clusterName, String serviceName, ApiDisableNnHaArguments body) throws ApiException {
        okhttp3.Call call = hdfsDisableNnHaCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Disable High Availability (HA) with Automatic Failover for an HDFS NameNode. (asynchronously)
     * Disable High Availability (HA) with Automatic Failover for an HDFS NameNode. &lt;p&gt; As part of disabling HA, any services that depend on the HDFS service being modified will be stopped. The command will delete the Standby NameNode associated with the specified NameNode. Any FailoverControllers associated with the NameNode&#x27;s nameservice are also deleted. A SecondaryNameNode is created on the host specified by the arugments. &lt;p&gt; If no nameservices uses Quorum Journal after HA is disabled for the specified nameservice, then all JournalNodes are also deleted. &lt;p&gt; Then, HDFS service is restarted and all services that were stopped are started again afterwards. Finally, client configs for HDFS and its depedents will be re-deployed.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments for the command. (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 hdfsDisableNnHaCommandAsync(String clusterName, String serviceName, ApiDisableNnHaArguments 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 = hdfsDisableNnHaCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hdfsEnableAutoFailoverCommand
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments for the command. (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 hdfsEnableAutoFailoverCommandCall(String clusterName, String serviceName, ApiHdfsFailoverArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hdfsEnableAutoFailover"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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);
    }

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

        okhttp3.Call call = hdfsEnableAutoFailoverCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Enable auto-failover for an HDFS nameservice.
     * Enable auto-failover for an HDFS nameservice. &lt;p&gt; This command requires that the nameservice exists, and HA has been configured for that nameservice. &lt;p&gt; The command will create the needed failover controllers, perform the needed initialization and configuration, and will start the new roles. The existing NameNodes which are part of the nameservice will be re-started in the process. &lt;p&gt; This process may require changing the service&#x27;s configuration, to add a dependency on the provided ZooKeeper service. This will be done if such a dependency has not been configured yet, and will cause roles that are not affected by this command to show an \&quot;outdated configuration\&quot; status. &lt;p&gt; If a ZooKeeper dependency has already been set up by some other means, it does not need to be provided in the command arguments.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments for the command. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hdfsEnableAutoFailoverCommand(String clusterName, String serviceName, ApiHdfsFailoverArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = hdfsEnableAutoFailoverCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Enable auto-failover for an HDFS nameservice.
     * Enable auto-failover for an HDFS nameservice. &lt;p&gt; This command requires that the nameservice exists, and HA has been configured for that nameservice. &lt;p&gt; The command will create the needed failover controllers, perform the needed initialization and configuration, and will start the new roles. The existing NameNodes which are part of the nameservice will be re-started in the process. &lt;p&gt; This process may require changing the service&#x27;s configuration, to add a dependency on the provided ZooKeeper service. This will be done if such a dependency has not been configured yet, and will cause roles that are not affected by this command to show an \&quot;outdated configuration\&quot; status. &lt;p&gt; If a ZooKeeper dependency has already been set up by some other means, it does not need to be provided in the command arguments.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments for the command. (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> hdfsEnableAutoFailoverCommandWithHttpInfo(String clusterName, String serviceName, ApiHdfsFailoverArguments body) throws ApiException {
        okhttp3.Call call = hdfsEnableAutoFailoverCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Enable auto-failover for an HDFS nameservice. (asynchronously)
     * Enable auto-failover for an HDFS nameservice. &lt;p&gt; This command requires that the nameservice exists, and HA has been configured for that nameservice. &lt;p&gt; The command will create the needed failover controllers, perform the needed initialization and configuration, and will start the new roles. The existing NameNodes which are part of the nameservice will be re-started in the process. &lt;p&gt; This process may require changing the service&#x27;s configuration, to add a dependency on the provided ZooKeeper service. This will be done if such a dependency has not been configured yet, and will cause roles that are not affected by this command to show an \&quot;outdated configuration\&quot; status. &lt;p&gt; If a ZooKeeper dependency has already been set up by some other means, it does not need to be provided in the command arguments.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments for the command. (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 hdfsEnableAutoFailoverCommandAsync(String clusterName, String serviceName, ApiHdfsFailoverArguments 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 = hdfsEnableAutoFailoverCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hdfsEnableHaCommand
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments for the command. (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 hdfsEnableHaCommandCall(String clusterName, String serviceName, ApiHdfsHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hdfsEnableHa"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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);
    }

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

        okhttp3.Call call = hdfsEnableHaCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Enable high availability (HA) for an HDFS NameNode.
     * Enable high availability (HA) for an HDFS NameNode. &lt;p&gt; The command will set up the given \&quot;active\&quot; and \&quot;stand-by\&quot; NameNodes as an HA pair. Both nodes need to already exist. &lt;p&gt; If there is a SecondaryNameNode associated with either given NameNode instance, it will be deleted. &lt;p&gt; Note that while the shared edits path may be different for both nodes, they need to point to the same underlying storage (e.g., an NFS share). &lt;p&gt; As part of enabling HA, any services that depend on the HDFS service being modified will be stopped. The command arguments provide options to re-start these services and to re-deploy the client configurations for services of the cluster after HA has been enabled.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments for the command. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hdfsEnableHaCommand(String clusterName, String serviceName, ApiHdfsHaArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = hdfsEnableHaCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Enable high availability (HA) for an HDFS NameNode.
     * Enable high availability (HA) for an HDFS NameNode. &lt;p&gt; The command will set up the given \&quot;active\&quot; and \&quot;stand-by\&quot; NameNodes as an HA pair. Both nodes need to already exist. &lt;p&gt; If there is a SecondaryNameNode associated with either given NameNode instance, it will be deleted. &lt;p&gt; Note that while the shared edits path may be different for both nodes, they need to point to the same underlying storage (e.g., an NFS share). &lt;p&gt; As part of enabling HA, any services that depend on the HDFS service being modified will be stopped. The command arguments provide options to re-start these services and to re-deploy the client configurations for services of the cluster after HA has been enabled.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments for the command. (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> hdfsEnableHaCommandWithHttpInfo(String clusterName, String serviceName, ApiHdfsHaArguments body) throws ApiException {
        okhttp3.Call call = hdfsEnableHaCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Enable high availability (HA) for an HDFS NameNode. (asynchronously)
     * Enable high availability (HA) for an HDFS NameNode. &lt;p&gt; The command will set up the given \&quot;active\&quot; and \&quot;stand-by\&quot; NameNodes as an HA pair. Both nodes need to already exist. &lt;p&gt; If there is a SecondaryNameNode associated with either given NameNode instance, it will be deleted. &lt;p&gt; Note that while the shared edits path may be different for both nodes, they need to point to the same underlying storage (e.g., an NFS share). &lt;p&gt; As part of enabling HA, any services that depend on the HDFS service being modified will be stopped. The command arguments provide options to re-start these services and to re-deploy the client configurations for services of the cluster after HA has been enabled.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments for the command. (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 hdfsEnableHaCommandAsync(String clusterName, String serviceName, ApiHdfsHaArguments 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 = hdfsEnableHaCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hdfsEnableNnHaCommand
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments for the command. (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 hdfsEnableNnHaCommandCall(String clusterName, String serviceName, ApiEnableNnHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hdfsEnableNnHa"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 hdfsEnableNnHaCommandValidateBeforeCall(String clusterName, String serviceName, ApiEnableNnHaArguments body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling hdfsEnableNnHaCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling hdfsEnableNnHaCommand(Async)");
        }

        okhttp3.Call call = hdfsEnableNnHaCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Enable High Availability (HA) with Automatic Failover for an HDFS NameNode.
     * Enable High Availability (HA) with Automatic Failover for an HDFS NameNode. &lt;p&gt; The command will create a Standby NameNode for the given nameservice and create FailoverControllers for both Active and Standby NameNodes. The SecondaryNameNode associated with the Active NameNode will be deleted. &lt;p&gt; The command will also create JournalNodes needed for HDFS HA if they do not already exist. &lt;p&gt; As part of enabling HA, any services that depend on the HDFS service being modified will be stopped. They will be restarted after HA has been enabled. Finally, client configs for HDFS and its depedents will be re-deployed.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments for the command. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hdfsEnableNnHaCommand(String clusterName, String serviceName, ApiEnableNnHaArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = hdfsEnableNnHaCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Enable High Availability (HA) with Automatic Failover for an HDFS NameNode.
     * Enable High Availability (HA) with Automatic Failover for an HDFS NameNode. &lt;p&gt; The command will create a Standby NameNode for the given nameservice and create FailoverControllers for both Active and Standby NameNodes. The SecondaryNameNode associated with the Active NameNode will be deleted. &lt;p&gt; The command will also create JournalNodes needed for HDFS HA if they do not already exist. &lt;p&gt; As part of enabling HA, any services that depend on the HDFS service being modified will be stopped. They will be restarted after HA has been enabled. Finally, client configs for HDFS and its depedents will be re-deployed.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments for the command. (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> hdfsEnableNnHaCommandWithHttpInfo(String clusterName, String serviceName, ApiEnableNnHaArguments body) throws ApiException {
        okhttp3.Call call = hdfsEnableNnHaCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Enable High Availability (HA) with Automatic Failover for an HDFS NameNode. (asynchronously)
     * Enable High Availability (HA) with Automatic Failover for an HDFS NameNode. &lt;p&gt; The command will create a Standby NameNode for the given nameservice and create FailoverControllers for both Active and Standby NameNodes. The SecondaryNameNode associated with the Active NameNode will be deleted. &lt;p&gt; The command will also create JournalNodes needed for HDFS HA if they do not already exist. &lt;p&gt; As part of enabling HA, any services that depend on the HDFS service being modified will be stopped. They will be restarted after HA has been enabled. Finally, client configs for HDFS and its depedents will be re-deployed.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments for the command. (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 hdfsEnableNnHaCommandAsync(String clusterName, String serviceName, ApiEnableNnHaArguments 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 = hdfsEnableNnHaCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hdfsFailoverCommand
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Names of the NameNodes in the HA pair. (optional)
     * @param force Whether to force failover. (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 hdfsFailoverCommandCall(String clusterName, String serviceName, ApiRoleNameList body, Boolean force, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hdfsFailover"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

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

        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 hdfsFailoverCommandValidateBeforeCall(String clusterName, String serviceName, ApiRoleNameList body, Boolean force, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling hdfsFailoverCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling hdfsFailoverCommand(Async)");
        }

        okhttp3.Call call = hdfsFailoverCommandCall(clusterName, serviceName, body, force, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Initiate a failover in an HDFS HA NameNode pair.
     * Initiate a failover in an HDFS HA NameNode pair. &lt;p&gt; The arguments should contain the names of the two NameNodes in the HA pair. The first one should be the currently active NameNode, the second one the NameNode to be made active.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Names of the NameNodes in the HA pair. (optional)
     * @param force Whether to force failover. (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 hdfsFailoverCommand(String clusterName, String serviceName, ApiRoleNameList body, Boolean force) throws ApiException {
        ApiResponse<ApiCommand> resp = hdfsFailoverCommandWithHttpInfo(clusterName, serviceName, body, force);
        return resp.getData();
    }

    /**
     * Initiate a failover in an HDFS HA NameNode pair.
     * Initiate a failover in an HDFS HA NameNode pair. &lt;p&gt; The arguments should contain the names of the two NameNodes in the HA pair. The first one should be the currently active NameNode, the second one the NameNode to be made active.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Names of the NameNodes in the HA pair. (optional)
     * @param force Whether to force failover. (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> hdfsFailoverCommandWithHttpInfo(String clusterName, String serviceName, ApiRoleNameList body, Boolean force) throws ApiException {
        okhttp3.Call call = hdfsFailoverCommandValidateBeforeCall(clusterName, serviceName, body, force, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Initiate a failover in an HDFS HA NameNode pair. (asynchronously)
     * Initiate a failover in an HDFS HA NameNode pair. &lt;p&gt; The arguments should contain the names of the two NameNodes in the HA pair. The first one should be the currently active NameNode, the second one the NameNode to be made active.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Names of the NameNodes in the HA pair. (optional)
     * @param force Whether to force failover. (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 hdfsFailoverCommandAsync(String clusterName, String serviceName, ApiRoleNameList body, Boolean force, 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 = hdfsFailoverCommandValidateBeforeCall(clusterName, serviceName, body, force, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hdfsFinalizeRollingUpgrade
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (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 hdfsFinalizeRollingUpgradeCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hdfsFinalizeRollingUpgrade"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = hdfsFinalizeRollingUpgradeCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Finalizes the rolling upgrade for HDFS by updating the NameNode metadata permanently to the next version.
     * Finalizes the rolling upgrade for HDFS by updating the NameNode metadata permanently to the next version. Should be done after doing a rolling upgrade to a CDH version &gt;&#x3D; 5.2.0. &lt;p&gt; Available since API v8.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hdfsFinalizeRollingUpgrade(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = hdfsFinalizeRollingUpgradeWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Finalizes the rolling upgrade for HDFS by updating the NameNode metadata permanently to the next version.
     * Finalizes the rolling upgrade for HDFS by updating the NameNode metadata permanently to the next version. Should be done after doing a rolling upgrade to a CDH version &gt;&#x3D; 5.2.0. &lt;p&gt; Available since API v8.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @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> hdfsFinalizeRollingUpgradeWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = hdfsFinalizeRollingUpgradeValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Finalizes the rolling upgrade for HDFS by updating the NameNode metadata permanently to the next version. (asynchronously)
     * Finalizes the rolling upgrade for HDFS by updating the NameNode metadata permanently to the next version. Should be done after doing a rolling upgrade to a CDH version &gt;&#x3D; 5.2.0. &lt;p&gt; Available since API v8.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (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 hdfsFinalizeRollingUpgradeAsync(String clusterName, String serviceName, 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 = hdfsFinalizeRollingUpgradeValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hdfsRollEditsCommand
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments to the Roll Edits command. (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 hdfsRollEditsCommandCall(String clusterName, String serviceName, ApiRollEditsArgs body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hdfsRollEdits"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 hdfsRollEditsCommandValidateBeforeCall(String clusterName, String serviceName, ApiRollEditsArgs body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling hdfsRollEditsCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling hdfsRollEditsCommand(Async)");
        }

        okhttp3.Call call = hdfsRollEditsCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Roll the edits of an HDFS NameNode or Nameservice.
     * Roll the edits of an HDFS NameNode or Nameservice. &lt;p&gt; Available since API v3.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments to the Roll Edits command. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hdfsRollEditsCommand(String clusterName, String serviceName, ApiRollEditsArgs body) throws ApiException {
        ApiResponse<ApiCommand> resp = hdfsRollEditsCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Roll the edits of an HDFS NameNode or Nameservice.
     * Roll the edits of an HDFS NameNode or Nameservice. &lt;p&gt; Available since API v3.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments to the Roll Edits command. (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> hdfsRollEditsCommandWithHttpInfo(String clusterName, String serviceName, ApiRollEditsArgs body) throws ApiException {
        okhttp3.Call call = hdfsRollEditsCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Roll the edits of an HDFS NameNode or Nameservice. (asynchronously)
     * Roll the edits of an HDFS NameNode or Nameservice. &lt;p&gt; Available since API v3.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @param body Arguments to the Roll Edits command. (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 hdfsRollEditsCommandAsync(String clusterName, String serviceName, ApiRollEditsArgs 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 = hdfsRollEditsCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hdfsUpgradeMetadataCommand
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (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 hdfsUpgradeMetadataCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hdfsUpgradeMetadata"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = hdfsUpgradeMetadataCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Upgrade HDFS Metadata as part of a major version upgrade.
     * Upgrade HDFS Metadata as part of a major version upgrade. &lt;p/&gt; When doing a major version upgrade for HDFS, it is necessary to start HDFS in a special mode where it will do any necessary upgrades of stored metadata. Trying to start HDFS normally will result in an error message and the NameNode(s) failing to start. &lt;p/&gt; The metadata upgrade must eventually be finalized, using the hdfsFinalizeMetadataUpgrade command on the NameNode. &lt;p/&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hdfsUpgradeMetadataCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = hdfsUpgradeMetadataCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Upgrade HDFS Metadata as part of a major version upgrade.
     * Upgrade HDFS Metadata as part of a major version upgrade. &lt;p/&gt; When doing a major version upgrade for HDFS, it is necessary to start HDFS in a special mode where it will do any necessary upgrades of stored metadata. Trying to start HDFS normally will result in an error message and the NameNode(s) failing to start. &lt;p/&gt; The metadata upgrade must eventually be finalized, using the hdfsFinalizeMetadataUpgrade command on the NameNode. &lt;p/&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (required)
     * @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> hdfsUpgradeMetadataCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = hdfsUpgradeMetadataCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Upgrade HDFS Metadata as part of a major version upgrade. (asynchronously)
     * Upgrade HDFS Metadata as part of a major version upgrade. &lt;p/&gt; When doing a major version upgrade for HDFS, it is necessary to start HDFS in a special mode where it will do any necessary upgrades of stored metadata. Trying to start HDFS normally will result in an error message and the NameNode(s) failing to start. &lt;p/&gt; The metadata upgrade must eventually be finalized, using the hdfsFinalizeMetadataUpgrade command on the NameNode. &lt;p/&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName The HDFS service name. (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 hdfsUpgradeMetadataCommandAsync(String clusterName, String serviceName, 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 = hdfsUpgradeMetadataCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hiveCreateMetastoreDatabaseCommand
     * @param clusterName  (required)
     * @param serviceName Name of the Hive service on which to run the command. (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 hiveCreateMetastoreDatabaseCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hiveCreateMetastoreDatabase"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = hiveCreateMetastoreDatabaseCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Create the Hive Metastore Database.
     * Create the Hive Metastore Database. Only works with embedded postgresql database. &lt;p&gt; This command is to be run whenever a new user and database needs to be created in the embedded postgresql database for a Hive service. This command should usually be followed by a call to hiveCreateMetastoreDatabaseTables. &lt;p&gt; Available since API v4.
     * @param clusterName  (required)
     * @param serviceName Name of the Hive service on which to run the command. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hiveCreateMetastoreDatabaseCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = hiveCreateMetastoreDatabaseCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Create the Hive Metastore Database.
     * Create the Hive Metastore Database. Only works with embedded postgresql database. &lt;p&gt; This command is to be run whenever a new user and database needs to be created in the embedded postgresql database for a Hive service. This command should usually be followed by a call to hiveCreateMetastoreDatabaseTables. &lt;p&gt; Available since API v4.
     * @param clusterName  (required)
     * @param serviceName Name of the Hive service on which to run the command. (required)
     * @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> hiveCreateMetastoreDatabaseCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = hiveCreateMetastoreDatabaseCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Create the Hive Metastore Database. (asynchronously)
     * Create the Hive Metastore Database. Only works with embedded postgresql database. &lt;p&gt; This command is to be run whenever a new user and database needs to be created in the embedded postgresql database for a Hive service. This command should usually be followed by a call to hiveCreateMetastoreDatabaseTables. &lt;p&gt; Available since API v4.
     * @param clusterName  (required)
     * @param serviceName Name of the Hive service on which to run the command. (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 hiveCreateMetastoreDatabaseCommandAsync(String clusterName, String serviceName, 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 = hiveCreateMetastoreDatabaseCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hiveCreateMetastoreDatabaseTablesCommand
     * @param clusterName  (required)
     * @param serviceName Name of the Hive service on which to run the command. (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 hiveCreateMetastoreDatabaseTablesCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hiveCreateMetastoreDatabaseTables"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = hiveCreateMetastoreDatabaseTablesCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Create the Hive Metastore Database tables.
     * Create the Hive Metastore Database tables. &lt;p&gt; This command is to be run whenever a new database has been specified. Will do nothing if tables already exist. Will not perform an upgrade. Only Available when all Hive Metastore Servers are stopped. &lt;p&gt; Available since API v3.
     * @param clusterName  (required)
     * @param serviceName Name of the Hive service on which to run the command. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hiveCreateMetastoreDatabaseTablesCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = hiveCreateMetastoreDatabaseTablesCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Create the Hive Metastore Database tables.
     * Create the Hive Metastore Database tables. &lt;p&gt; This command is to be run whenever a new database has been specified. Will do nothing if tables already exist. Will not perform an upgrade. Only Available when all Hive Metastore Servers are stopped. &lt;p&gt; Available since API v3.
     * @param clusterName  (required)
     * @param serviceName Name of the Hive service on which to run the command. (required)
     * @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> hiveCreateMetastoreDatabaseTablesCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = hiveCreateMetastoreDatabaseTablesCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Create the Hive Metastore Database tables. (asynchronously)
     * Create the Hive Metastore Database tables. &lt;p&gt; This command is to be run whenever a new database has been specified. Will do nothing if tables already exist. Will not perform an upgrade. Only Available when all Hive Metastore Servers are stopped. &lt;p&gt; Available since API v3.
     * @param clusterName  (required)
     * @param serviceName Name of the Hive service on which to run the command. (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 hiveCreateMetastoreDatabaseTablesCommandAsync(String clusterName, String serviceName, 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 = hiveCreateMetastoreDatabaseTablesCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hiveUpdateMetastoreNamenodesCommand
     * @param clusterName  (required)
     * @param serviceName Name of the Hive service on which to run the command. (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 hiveUpdateMetastoreNamenodesCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hiveUpdateMetastoreNamenodes"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = hiveUpdateMetastoreNamenodesCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Update Hive Metastore to point to a NameNode&#x27;s Nameservice name instead of hostname.
     * Update Hive Metastore to point to a NameNode&#x27;s Nameservice name instead of hostname. &lt;p&gt; &lt;strong&gt;Back up the Hive Metastore Database before running this command.&lt;/strong&gt; &lt;p&gt; This command is to be run after enabling HDFS High Availability. Only available when all Hive Metastore Servers are stopped. &lt;p&gt; Available since API v4.
     * @param clusterName  (required)
     * @param serviceName Name of the Hive service on which to run the command. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hiveUpdateMetastoreNamenodesCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = hiveUpdateMetastoreNamenodesCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Update Hive Metastore to point to a NameNode&#x27;s Nameservice name instead of hostname.
     * Update Hive Metastore to point to a NameNode&#x27;s Nameservice name instead of hostname. &lt;p&gt; &lt;strong&gt;Back up the Hive Metastore Database before running this command.&lt;/strong&gt; &lt;p&gt; This command is to be run after enabling HDFS High Availability. Only available when all Hive Metastore Servers are stopped. &lt;p&gt; Available since API v4.
     * @param clusterName  (required)
     * @param serviceName Name of the Hive service on which to run the command. (required)
     * @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> hiveUpdateMetastoreNamenodesCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = hiveUpdateMetastoreNamenodesCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Update Hive Metastore to point to a NameNode&#x27;s Nameservice name instead of hostname. (asynchronously)
     * Update Hive Metastore to point to a NameNode&#x27;s Nameservice name instead of hostname. &lt;p&gt; &lt;strong&gt;Back up the Hive Metastore Database before running this command.&lt;/strong&gt; &lt;p&gt; This command is to be run after enabling HDFS High Availability. Only available when all Hive Metastore Servers are stopped. &lt;p&gt; Available since API v4.
     * @param clusterName  (required)
     * @param serviceName Name of the Hive service on which to run the command. (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 hiveUpdateMetastoreNamenodesCommandAsync(String clusterName, String serviceName, 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 = hiveUpdateMetastoreNamenodesCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hiveUpgradeMetastoreCommand
     * @param clusterName  (required)
     * @param serviceName The Hive service name. (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 hiveUpgradeMetastoreCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hiveUpgradeMetastore"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = hiveUpgradeMetastoreCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Upgrade Hive Metastore as part of a major version upgrade.
     * Upgrade Hive Metastore as part of a major version upgrade. &lt;p/&gt; When doing a major version upgrade for Hive, it is necessary to upgrade data in the metastore database. &lt;p/&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName The Hive service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hiveUpgradeMetastoreCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = hiveUpgradeMetastoreCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Upgrade Hive Metastore as part of a major version upgrade.
     * Upgrade Hive Metastore as part of a major version upgrade. &lt;p/&gt; When doing a major version upgrade for Hive, it is necessary to upgrade data in the metastore database. &lt;p/&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName The Hive service name. (required)
     * @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> hiveUpgradeMetastoreCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = hiveUpgradeMetastoreCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Upgrade Hive Metastore as part of a major version upgrade. (asynchronously)
     * Upgrade Hive Metastore as part of a major version upgrade. &lt;p/&gt; When doing a major version upgrade for Hive, it is necessary to upgrade data in the metastore database. &lt;p/&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName The Hive service name. (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 hiveUpgradeMetastoreCommandAsync(String clusterName, String serviceName, 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 = hiveUpgradeMetastoreCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hiveValidateMetastoreSchemaCommand
     * @param clusterName  (required)
     * @param serviceName Name of the Hive service on which to run the command. (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 hiveValidateMetastoreSchemaCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hiveValidateMetastoreSchema"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = hiveValidateMetastoreSchemaCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Validate the Hive Metastore Schema.
     * Validate the Hive Metastore Schema. &lt;p&gt; This command checks the Hive metastore schema for any errors and corruptions. This command is to be run on two instances: &lt;li&gt;After the Hive Metastore database tables are created.&lt;/li&gt; &lt;li&gt;Both before and after upgrading the Hive metastore database schema./li&gt; * &lt;p&gt; Available since API v17.
     * @param clusterName  (required)
     * @param serviceName Name of the Hive service on which to run the command. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hiveValidateMetastoreSchemaCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = hiveValidateMetastoreSchemaCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Validate the Hive Metastore Schema.
     * Validate the Hive Metastore Schema. &lt;p&gt; This command checks the Hive metastore schema for any errors and corruptions. This command is to be run on two instances: &lt;li&gt;After the Hive Metastore database tables are created.&lt;/li&gt; &lt;li&gt;Both before and after upgrading the Hive metastore database schema./li&gt; * &lt;p&gt; Available since API v17.
     * @param clusterName  (required)
     * @param serviceName Name of the Hive service on which to run the command. (required)
     * @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> hiveValidateMetastoreSchemaCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = hiveValidateMetastoreSchemaCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Validate the Hive Metastore Schema. (asynchronously)
     * Validate the Hive Metastore Schema. &lt;p&gt; This command checks the Hive metastore schema for any errors and corruptions. This command is to be run on two instances: &lt;li&gt;After the Hive Metastore database tables are created.&lt;/li&gt; &lt;li&gt;Both before and after upgrading the Hive metastore database schema./li&gt; * &lt;p&gt; Available since API v17.
     * @param clusterName  (required)
     * @param serviceName Name of the Hive service on which to run the command. (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 hiveValidateMetastoreSchemaCommandAsync(String clusterName, String serviceName, 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 = hiveValidateMetastoreSchemaCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hueDumpDbCommand
     * @param clusterName  (required)
     * @param serviceName The name of the service (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 hueDumpDbCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hueDumpDb"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = hueDumpDbCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Runs Hue&#x27;s dumpdata command.
     * Runs Hue&#x27;s dumpdata command.  Available since API v10.
     * @param clusterName  (required)
     * @param serviceName The name of the service (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hueDumpDbCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = hueDumpDbCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Runs Hue&#x27;s dumpdata command.
     * Runs Hue&#x27;s dumpdata command.  Available since API v10.
     * @param clusterName  (required)
     * @param serviceName The name of the service (required)
     * @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> hueDumpDbCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = hueDumpDbCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Runs Hue&#x27;s dumpdata command. (asynchronously)
     * Runs Hue&#x27;s dumpdata command.  Available since API v10.
     * @param clusterName  (required)
     * @param serviceName The name of the service (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 hueDumpDbCommandAsync(String clusterName, String serviceName, 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 = hueDumpDbCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hueLoadDbCommand
     * @param clusterName  (required)
     * @param serviceName The name of the service (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 hueLoadDbCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hueLoadDb"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = hueLoadDbCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Runs Hue&#x27;s loaddata command.
     * Runs Hue&#x27;s loaddata command.  Available since API v10.
     * @param clusterName  (required)
     * @param serviceName The name of the service (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hueLoadDbCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = hueLoadDbCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Runs Hue&#x27;s loaddata command.
     * Runs Hue&#x27;s loaddata command.  Available since API v10.
     * @param clusterName  (required)
     * @param serviceName The name of the service (required)
     * @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> hueLoadDbCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = hueLoadDbCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Runs Hue&#x27;s loaddata command. (asynchronously)
     * Runs Hue&#x27;s loaddata command.  Available since API v10.
     * @param clusterName  (required)
     * @param serviceName The name of the service (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 hueLoadDbCommandAsync(String clusterName, String serviceName, 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 = hueLoadDbCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for hueSyncDbCommand
     * @param clusterName  (required)
     * @param serviceName The name of the service (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 hueSyncDbCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/hueSyncDb"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = hueSyncDbCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Runs Hue&#x27;s syncdb command.
     * Runs Hue&#x27;s syncdb command.  Available since API v10.
     * @param clusterName  (required)
     * @param serviceName The name of the service (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand hueSyncDbCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = hueSyncDbCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Runs Hue&#x27;s syncdb command.
     * Runs Hue&#x27;s syncdb command.  Available since API v10.
     * @param clusterName  (required)
     * @param serviceName The name of the service (required)
     * @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> hueSyncDbCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = hueSyncDbCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Runs Hue&#x27;s syncdb command. (asynchronously)
     * Runs Hue&#x27;s syncdb command.  Available since API v10.
     * @param clusterName  (required)
     * @param serviceName The name of the service (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 hueSyncDbCommandAsync(String clusterName, String serviceName, 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 = hueSyncDbCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for icebergReplicationTestAccess
     * @param clusterName  (required)
     * @param serviceName The name of the ICEBERG_REPLICATION service. (required)
     * @param hmsWarehouseDir The HMS warehouseDir path to test access. (optional)
     * @param path The cloudPath to test access. (optional)
     * @param sourceCluster The name of the cluster on remote. (optional)
     * @param sourcePeer The name of the peer. (optional)
     * @param sourceService The name of the ICEBERG_REPLICATION service on remote. (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 icebergReplicationTestAccessCall(String clusterName, String serviceName, String hmsWarehouseDir, String path, String sourceCluster, String sourcePeer, String sourceService, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/icebergReplicationTestAccess"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (hmsWarehouseDir != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("hmsWarehouseDir", hmsWarehouseDir));
        if (path != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("path", path));
        if (sourceCluster != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("sourceCluster", sourceCluster));
        if (sourcePeer != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("sourcePeer", sourcePeer));
        if (sourceService != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("sourceService", sourceService));

        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 icebergReplicationTestAccessValidateBeforeCall(String clusterName, String serviceName, String hmsWarehouseDir, String path, String sourceCluster, String sourcePeer, String sourceService, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling icebergReplicationTestAccess(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling icebergReplicationTestAccess(Async)");
        }

        okhttp3.Call call = icebergReplicationTestAccessCall(clusterName, serviceName, hmsWarehouseDir, path, sourceCluster, sourcePeer, sourceService, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Executes IcebergReplicationTestAccess command for the given path.
     * Executes IcebergReplicationTestAccess command for the given path.
     * @param clusterName  (required)
     * @param serviceName The name of the ICEBERG_REPLICATION service. (required)
     * @param hmsWarehouseDir The HMS warehouseDir path to test access. (optional)
     * @param path The cloudPath to test access. (optional)
     * @param sourceCluster The name of the cluster on remote. (optional)
     * @param sourcePeer The name of the peer. (optional)
     * @param sourceService The name of the ICEBERG_REPLICATION service on remote. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand icebergReplicationTestAccess(String clusterName, String serviceName, String hmsWarehouseDir, String path, String sourceCluster, String sourcePeer, String sourceService) throws ApiException {
        ApiResponse<ApiCommand> resp = icebergReplicationTestAccessWithHttpInfo(clusterName, serviceName, hmsWarehouseDir, path, sourceCluster, sourcePeer, sourceService);
        return resp.getData();
    }

    /**
     * Executes IcebergReplicationTestAccess command for the given path.
     * Executes IcebergReplicationTestAccess command for the given path.
     * @param clusterName  (required)
     * @param serviceName The name of the ICEBERG_REPLICATION service. (required)
     * @param hmsWarehouseDir The HMS warehouseDir path to test access. (optional)
     * @param path The cloudPath to test access. (optional)
     * @param sourceCluster The name of the cluster on remote. (optional)
     * @param sourcePeer The name of the peer. (optional)
     * @param sourceService The name of the ICEBERG_REPLICATION service on remote. (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> icebergReplicationTestAccessWithHttpInfo(String clusterName, String serviceName, String hmsWarehouseDir, String path, String sourceCluster, String sourcePeer, String sourceService) throws ApiException {
        okhttp3.Call call = icebergReplicationTestAccessValidateBeforeCall(clusterName, serviceName, hmsWarehouseDir, path, sourceCluster, sourcePeer, sourceService, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Executes IcebergReplicationTestAccess command for the given path. (asynchronously)
     * Executes IcebergReplicationTestAccess command for the given path.
     * @param clusterName  (required)
     * @param serviceName The name of the ICEBERG_REPLICATION service. (required)
     * @param hmsWarehouseDir The HMS warehouseDir path to test access. (optional)
     * @param path The cloudPath to test access. (optional)
     * @param sourceCluster The name of the cluster on remote. (optional)
     * @param sourcePeer The name of the peer. (optional)
     * @param sourceService The name of the ICEBERG_REPLICATION service on remote. (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 icebergReplicationTestAccessAsync(String clusterName, String serviceName, String hmsWarehouseDir, String path, String sourceCluster, String sourcePeer, String sourceService, 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 = icebergReplicationTestAccessValidateBeforeCall(clusterName, serviceName, hmsWarehouseDir, path, sourceCluster, sourcePeer, sourceService, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for impalaCreateCatalogDatabaseCommand
     * @param clusterName  (required)
     * @param serviceName Name of the Impala service on which to run the command. (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 impalaCreateCatalogDatabaseCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/impalaCreateCatalogDatabase"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = impalaCreateCatalogDatabaseCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * .
     * &lt;strong&gt;Not needed in CM 5.0.0 Release, since Impala Catalog Database is not yet available in CDH as of this release.&lt;/strong&gt; Create the Impala Catalog Database. Only works with embedded postgresql database. &lt;p&gt; This command is to be run whenever a new user and database needs to be created in the embedded postgresql database for the Impala Catalog Server. This command should usually be followed by a call to impalaCreateCatalogDatabaseTables. &lt;p&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName Name of the Impala service on which to run the command. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand impalaCreateCatalogDatabaseCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = impalaCreateCatalogDatabaseCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * .
     * &lt;strong&gt;Not needed in CM 5.0.0 Release, since Impala Catalog Database is not yet available in CDH as of this release.&lt;/strong&gt; Create the Impala Catalog Database. Only works with embedded postgresql database. &lt;p&gt; This command is to be run whenever a new user and database needs to be created in the embedded postgresql database for the Impala Catalog Server. This command should usually be followed by a call to impalaCreateCatalogDatabaseTables. &lt;p&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName Name of the Impala service on which to run the command. (required)
     * @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> impalaCreateCatalogDatabaseCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = impalaCreateCatalogDatabaseCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * . (asynchronously)
     * &lt;strong&gt;Not needed in CM 5.0.0 Release, since Impala Catalog Database is not yet available in CDH as of this release.&lt;/strong&gt; Create the Impala Catalog Database. Only works with embedded postgresql database. &lt;p&gt; This command is to be run whenever a new user and database needs to be created in the embedded postgresql database for the Impala Catalog Server. This command should usually be followed by a call to impalaCreateCatalogDatabaseTables. &lt;p&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName Name of the Impala service on which to run the command. (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 impalaCreateCatalogDatabaseCommandAsync(String clusterName, String serviceName, 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 = impalaCreateCatalogDatabaseCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for impalaCreateCatalogDatabaseTablesCommand
     * @param clusterName  (required)
     * @param serviceName Name of the Impala service on which to run the command. (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 impalaCreateCatalogDatabaseTablesCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/impalaCreateCatalogDatabaseTables"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = impalaCreateCatalogDatabaseTablesCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * .
     * &lt;strong&gt;Not needed in CM 5.0.0 Release, since Impala Catalog Database is not yet available in CDH as of this release.&lt;/strong&gt; Create the Impala Catalog Database tables. &lt;p&gt; This command is to be run whenever a new database has been specified. Will do nothing if tables already exist. Will not perform an upgrade. Only available when all Impala Catalog Servers are stopped. &lt;p&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName Name of the Impala service on which to run the command. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand impalaCreateCatalogDatabaseTablesCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = impalaCreateCatalogDatabaseTablesCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * .
     * &lt;strong&gt;Not needed in CM 5.0.0 Release, since Impala Catalog Database is not yet available in CDH as of this release.&lt;/strong&gt; Create the Impala Catalog Database tables. &lt;p&gt; This command is to be run whenever a new database has been specified. Will do nothing if tables already exist. Will not perform an upgrade. Only available when all Impala Catalog Servers are stopped. &lt;p&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName Name of the Impala service on which to run the command. (required)
     * @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> impalaCreateCatalogDatabaseTablesCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = impalaCreateCatalogDatabaseTablesCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * . (asynchronously)
     * &lt;strong&gt;Not needed in CM 5.0.0 Release, since Impala Catalog Database is not yet available in CDH as of this release.&lt;/strong&gt; Create the Impala Catalog Database tables. &lt;p&gt; This command is to be run whenever a new database has been specified. Will do nothing if tables already exist. Will not perform an upgrade. Only available when all Impala Catalog Servers are stopped. &lt;p&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName Name of the Impala service on which to run the command. (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 impalaCreateCatalogDatabaseTablesCommandAsync(String clusterName, String serviceName, 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 = impalaCreateCatalogDatabaseTablesCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for importMrConfigsIntoYarn
     * @param clusterName  (required)
     * @param serviceName Name of the Yarn service on which to run the command. (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 importMrConfigsIntoYarnCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/importMrConfigsIntoYarn"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = importMrConfigsIntoYarnCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Import MapReduce configuration into Yarn, overwriting Yarn configuration.
     * Import MapReduce configuration into Yarn, overwriting Yarn configuration. &lt;p&gt; You will lose existing Yarn configuration. Read all MapReduce configuration, role assignments, and role configuration groups and update Yarn with corresponding values. MR1 configuration will be converted into the equivalent MR2 configuration. &lt;p&gt; Before running this command, Yarn must be stopped and MapReduce must exist with valid configuration. &lt;p&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName Name of the Yarn service on which to run the command. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand importMrConfigsIntoYarn(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = importMrConfigsIntoYarnWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Import MapReduce configuration into Yarn, overwriting Yarn configuration.
     * Import MapReduce configuration into Yarn, overwriting Yarn configuration. &lt;p&gt; You will lose existing Yarn configuration. Read all MapReduce configuration, role assignments, and role configuration groups and update Yarn with corresponding values. MR1 configuration will be converted into the equivalent MR2 configuration. &lt;p&gt; Before running this command, Yarn must be stopped and MapReduce must exist with valid configuration. &lt;p&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName Name of the Yarn service on which to run the command. (required)
     * @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> importMrConfigsIntoYarnWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = importMrConfigsIntoYarnValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Import MapReduce configuration into Yarn, overwriting Yarn configuration. (asynchronously)
     * Import MapReduce configuration into Yarn, overwriting Yarn configuration. &lt;p&gt; You will lose existing Yarn configuration. Read all MapReduce configuration, role assignments, and role configuration groups and update Yarn with corresponding values. MR1 configuration will be converted into the equivalent MR2 configuration. &lt;p&gt; Before running this command, Yarn must be stopped and MapReduce must exist with valid configuration. &lt;p&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName Name of the Yarn service on which to run the command. (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 importMrConfigsIntoYarnAsync(String clusterName, String serviceName, 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 = importMrConfigsIntoYarnValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for initSolrCommand
     * @param clusterName  (required)
     * @param serviceName The Solr service name. (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 initSolrCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/initSolr"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = initSolrCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Initializes the Solr service in Zookeeper.
     * Initializes the Solr service in Zookeeper.  &lt;p&gt; Available since API v4.
     * @param clusterName  (required)
     * @param serviceName The Solr service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand initSolrCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = initSolrCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Initializes the Solr service in Zookeeper.
     * Initializes the Solr service in Zookeeper.  &lt;p&gt; Available since API v4.
     * @param clusterName  (required)
     * @param serviceName The Solr service name. (required)
     * @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> initSolrCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = initSolrCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Initializes the Solr service in Zookeeper. (asynchronously)
     * Initializes the Solr service in Zookeeper.  &lt;p&gt; Available since API v4.
     * @param clusterName  (required)
     * @param serviceName The Solr service name. (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 initSolrCommandAsync(String clusterName, String serviceName, 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 = initSolrCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for installMrFrameworkJars
     * @param clusterName  (required)
     * @param serviceName Name of the YARN service on which to run the command. (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 installMrFrameworkJarsCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/installMrFrameworkJars"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = installMrFrameworkJarsCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Creates an HDFS directory to hold the MapReduce2 framework JARs (if necessary), and uploads the framework JARs to it.
     * Creates an HDFS directory to hold the MapReduce2 framework JARs (if necessary), and uploads the framework JARs to it. &lt;p&gt; This command is run automatically when starting a YARN service for the first time, or when upgrading an existing YARN service. It can also be run manually to ensure that the latest version of the framework JARS is installed. &lt;p&gt; Available since API v30. &lt;p&gt;
     * @param clusterName  (required)
     * @param serviceName Name of the YARN service on which to run the command. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand installMrFrameworkJars(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = installMrFrameworkJarsWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Creates an HDFS directory to hold the MapReduce2 framework JARs (if necessary), and uploads the framework JARs to it.
     * Creates an HDFS directory to hold the MapReduce2 framework JARs (if necessary), and uploads the framework JARs to it. &lt;p&gt; This command is run automatically when starting a YARN service for the first time, or when upgrading an existing YARN service. It can also be run manually to ensure that the latest version of the framework JARS is installed. &lt;p&gt; Available since API v30. &lt;p&gt;
     * @param clusterName  (required)
     * @param serviceName Name of the YARN service on which to run the command. (required)
     * @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> installMrFrameworkJarsWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = installMrFrameworkJarsValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Creates an HDFS directory to hold the MapReduce2 framework JARs (if necessary), and uploads the framework JARs to it. (asynchronously)
     * Creates an HDFS directory to hold the MapReduce2 framework JARs (if necessary), and uploads the framework JARs to it. &lt;p&gt; This command is run automatically when starting a YARN service for the first time, or when upgrading an existing YARN service. It can also be run manually to ensure that the latest version of the framework JARS is installed. &lt;p&gt; Available since API v30. &lt;p&gt;
     * @param clusterName  (required)
     * @param serviceName Name of the YARN service on which to run the command. (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 installMrFrameworkJarsAsync(String clusterName, String serviceName, 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 = installMrFrameworkJarsValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for installOozieShareLib
     * @param clusterName  (required)
     * @param serviceName Name of the Oozie service on which to run the command. (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 installOozieShareLibCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/installOozieShareLib"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = installOozieShareLibCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Creates directory for Oozie user in HDFS and installs the ShareLib in it.
     * Creates directory for Oozie user in HDFS and installs the ShareLib in it. &lt;p/&gt; This command should be re-run after a major version upgrade to refresh the ShareLib to the latest version. &lt;p/&gt; Available since API v3. &lt;p/&gt;
     * @param clusterName  (required)
     * @param serviceName Name of the Oozie service on which to run the command. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand installOozieShareLib(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = installOozieShareLibWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Creates directory for Oozie user in HDFS and installs the ShareLib in it.
     * Creates directory for Oozie user in HDFS and installs the ShareLib in it. &lt;p/&gt; This command should be re-run after a major version upgrade to refresh the ShareLib to the latest version. &lt;p/&gt; Available since API v3. &lt;p/&gt;
     * @param clusterName  (required)
     * @param serviceName Name of the Oozie service on which to run the command. (required)
     * @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> installOozieShareLibWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = installOozieShareLibValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Creates directory for Oozie user in HDFS and installs the ShareLib in it. (asynchronously)
     * Creates directory for Oozie user in HDFS and installs the ShareLib in it. &lt;p/&gt; This command should be re-run after a major version upgrade to refresh the ShareLib to the latest version. &lt;p/&gt; Available since API v3. &lt;p/&gt;
     * @param clusterName  (required)
     * @param serviceName Name of the Oozie service on which to run the command. (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 installOozieShareLibAsync(String clusterName, String serviceName, 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 = installOozieShareLibValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for ksMigrateToSentry
     * @param clusterName  (required)
     * @param serviceName A String representing the KeyStore Indexer service name. (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 ksMigrateToSentryCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/migrateToSentry"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = ksMigrateToSentryCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Migrates the HBase Indexer policy-based permissions to Sentry, by invoking the SentryConfigToolIndexer.
     * Migrates the HBase Indexer policy-based permissions to Sentry, by invoking the SentryConfigToolIndexer. &lt;p&gt; Note: &lt;li&gt; &lt;ul&gt;KeyStore Indexer service should be in Stopped state.&lt;/ul&gt; &lt;ul&gt;This is only needed for upgrading to CDH6.0.&lt;/ul&gt; &lt;p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the KeyStore Indexer service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand ksMigrateToSentry(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = ksMigrateToSentryWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Migrates the HBase Indexer policy-based permissions to Sentry, by invoking the SentryConfigToolIndexer.
     * Migrates the HBase Indexer policy-based permissions to Sentry, by invoking the SentryConfigToolIndexer. &lt;p&gt; Note: &lt;li&gt; &lt;ul&gt;KeyStore Indexer service should be in Stopped state.&lt;/ul&gt; &lt;ul&gt;This is only needed for upgrading to CDH6.0.&lt;/ul&gt; &lt;p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the KeyStore Indexer service name. (required)
     * @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> ksMigrateToSentryWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = ksMigrateToSentryValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Migrates the HBase Indexer policy-based permissions to Sentry, by invoking the SentryConfigToolIndexer. (asynchronously)
     * Migrates the HBase Indexer policy-based permissions to Sentry, by invoking the SentryConfigToolIndexer. &lt;p&gt; Note: &lt;li&gt; &lt;ul&gt;KeyStore Indexer service should be in Stopped state.&lt;/ul&gt; &lt;ul&gt;This is only needed for upgrading to CDH6.0.&lt;/ul&gt; &lt;p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the KeyStore Indexer service name. (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 ksMigrateToSentryAsync(String clusterName, String serviceName, 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 = ksMigrateToSentryValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for listActiveCommands
     * @param clusterName  (required)
     * @param serviceName The service to which the role belongs. (required)
     * @param commandName the command name, unique for the command class HdfsCreateSnapshotCommand#COMMAND_NAME (optional)
     * @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 clusterName, String serviceName, String commandName, String view, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (commandName != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("commandName", commandName));
        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 clusterName, String serviceName, String commandName, String view, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling listActiveCommands(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling listActiveCommands(Async)");
        }

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

    }

    /**
     * List active service commands.
     * List active service commands.
     * @param clusterName  (required)
     * @param serviceName The service to which the role belongs. (required)
     * @param commandName the command name, unique for the command class HdfsCreateSnapshotCommand#COMMAND_NAME (optional)
     * @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 clusterName, String serviceName, String commandName, String view) throws ApiException {
        ApiResponse<ApiCommandList> resp = listActiveCommandsWithHttpInfo(clusterName, serviceName, commandName, view);
        return resp.getData();
    }

    /**
     * List active service commands.
     * List active service commands.
     * @param clusterName  (required)
     * @param serviceName The service to which the role belongs. (required)
     * @param commandName the command name, unique for the command class HdfsCreateSnapshotCommand#COMMAND_NAME (optional)
     * @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 clusterName, String serviceName, String commandName, String view) throws ApiException {
        okhttp3.Call call = listActiveCommandsValidateBeforeCall(clusterName, serviceName, commandName, view, null, null);
        Type localVarReturnType = new TypeToken<ApiCommandList>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * List active service commands. (asynchronously)
     * List active service commands.
     * @param clusterName  (required)
     * @param serviceName The service to which the role belongs. (required)
     * @param commandName the command name, unique for the command class HdfsCreateSnapshotCommand#COMMAND_NAME (optional)
     * @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 clusterName, String serviceName, String commandName, 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(clusterName, serviceName, commandName, view, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommandList>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for listRoleTypes
     * @param clusterName  (required)
     * @param serviceName The service to modify. (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 listRoleTypesCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/roleTypes"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 listRoleTypesValidateBeforeCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling listRoleTypes(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling listRoleTypes(Async)");
        }

        okhttp3.Call call = listRoleTypesCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * List the supported role types for a service.
     * List the supported role types for a service.
     * @param clusterName  (required)
     * @param serviceName The service to modify. (required)
     * @return ApiRoleTypeList
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiRoleTypeList listRoleTypes(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiRoleTypeList> resp = listRoleTypesWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * List the supported role types for a service.
     * List the supported role types for a service.
     * @param clusterName  (required)
     * @param serviceName The service to modify. (required)
     * @return ApiResponse&lt;ApiRoleTypeList&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiRoleTypeList> listRoleTypesWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = listRoleTypesValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiRoleTypeList>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * List the supported role types for a service. (asynchronously)
     * List the supported role types for a service.
     * @param clusterName  (required)
     * @param serviceName The service to modify. (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 listRoleTypesAsync(String clusterName, String serviceName, final ApiCallback<ApiRoleTypeList> 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 = listRoleTypesValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiRoleTypeList>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for listServiceCommands
     * @param clusterName  (required)
     * @param serviceName The service name. (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 listServiceCommandsCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commandsByName"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 listServiceCommandsValidateBeforeCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling listServiceCommands(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling listServiceCommands(Async)");
        }

        okhttp3.Call call = listServiceCommandsCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Lists all the commands (for CSD based services only) that can be executed by name on the provided service.
     * Lists all the commands (for CSD based services only) that can be executed by name on the provided service.  &lt;p&gt; Available since API v6. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @return ApiCommandMetadataList
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommandMetadataList listServiceCommands(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommandMetadataList> resp = listServiceCommandsWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Lists all the commands (for CSD based services only) that can be executed by name on the provided service.
     * Lists all the commands (for CSD based services only) that can be executed by name on the provided service.  &lt;p&gt; Available since API v6. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @return ApiResponse&lt;ApiCommandMetadataList&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommandMetadataList> listServiceCommandsWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = listServiceCommandsValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommandMetadataList>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Lists all the commands (for CSD based services only) that can be executed by name on the provided service. (asynchronously)
     * Lists all the commands (for CSD based services only) that can be executed by name on the provided service.  &lt;p&gt; Available since API v6. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (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 listServiceCommandsAsync(String clusterName, String serviceName, final ApiCallback<ApiCommandMetadataList> 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 = listServiceCommandsValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommandMetadataList>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for offlineCommand
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body List of role names to offline. (optional)
     * @param timeout Offline timeout in seconds. Offlined roles will automatically transition from offline state to normal state after timeout. Specify as null to get the default timeout (4 hours). (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 offlineCommandCall(String clusterName, String serviceName, ApiRoleNameList body, java.math.BigDecimal timeout, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/offline"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

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

        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 offlineCommandValidateBeforeCall(String clusterName, String serviceName, ApiRoleNameList body, java.math.BigDecimal timeout, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling offlineCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling offlineCommand(Async)");
        }

        okhttp3.Call call = offlineCommandCall(clusterName, serviceName, body, timeout, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Offline roles of a service.
     * Offline roles of a service. &lt;p&gt; Currently the offline operation is only supported by HDFS. &lt;p&gt; For HDFS, 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; The &lt;em&gt;timeout&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;
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body List of role names to offline. (optional)
     * @param timeout Offline timeout in seconds. Offlined roles will automatically transition from offline state to normal state after timeout. Specify as null to get the default timeout (4 hours). (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand offlineCommand(String clusterName, String serviceName, ApiRoleNameList body, java.math.BigDecimal timeout) throws ApiException {
        ApiResponse<ApiCommand> resp = offlineCommandWithHttpInfo(clusterName, serviceName, body, timeout);
        return resp.getData();
    }

    /**
     * Offline roles of a service.
     * Offline roles of a service. &lt;p&gt; Currently the offline operation is only supported by HDFS. &lt;p&gt; For HDFS, 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; The &lt;em&gt;timeout&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;
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body List of role names to offline. (optional)
     * @param timeout Offline timeout in seconds. Offlined roles will automatically transition from offline state to normal state after timeout. Specify as null to get the default timeout (4 hours). (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> offlineCommandWithHttpInfo(String clusterName, String serviceName, ApiRoleNameList body, java.math.BigDecimal timeout) throws ApiException {
        okhttp3.Call call = offlineCommandValidateBeforeCall(clusterName, serviceName, body, timeout, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Offline roles of a service. (asynchronously)
     * Offline roles of a service. &lt;p&gt; Currently the offline operation is only supported by HDFS. &lt;p&gt; For HDFS, 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; The &lt;em&gt;timeout&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;
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body List of role names to offline. (optional)
     * @param timeout Offline timeout in seconds. Offlined roles will automatically transition from offline state to normal state after timeout. Specify as null to get the default timeout (4 hours). (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 offlineCommandAsync(String clusterName, String serviceName, ApiRoleNameList body, java.math.BigDecimal timeout, 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 = offlineCommandValidateBeforeCall(clusterName, serviceName, body, timeout, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for oozieCreateEmbeddedDatabaseCommand
     * @param clusterName  (required)
     * @param serviceName Name of the Oozie service on which to run the command. (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 oozieCreateEmbeddedDatabaseCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/oozieCreateEmbeddedDatabase"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = oozieCreateEmbeddedDatabaseCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Create the Oozie Server Database.
     * Create the Oozie Server Database. Only works with embedded postgresql database. &lt;p&gt; This command is to be run whenever a new user and database need to be created in the embedded postgresql database for an Oozie service. This command should usually be followed by a call to createOozieDb. &lt;p&gt; Available since API v10.
     * @param clusterName  (required)
     * @param serviceName Name of the Oozie service on which to run the command. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand oozieCreateEmbeddedDatabaseCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = oozieCreateEmbeddedDatabaseCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Create the Oozie Server Database.
     * Create the Oozie Server Database. Only works with embedded postgresql database. &lt;p&gt; This command is to be run whenever a new user and database need to be created in the embedded postgresql database for an Oozie service. This command should usually be followed by a call to createOozieDb. &lt;p&gt; Available since API v10.
     * @param clusterName  (required)
     * @param serviceName Name of the Oozie service on which to run the command. (required)
     * @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> oozieCreateEmbeddedDatabaseCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = oozieCreateEmbeddedDatabaseCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Create the Oozie Server Database. (asynchronously)
     * Create the Oozie Server Database. Only works with embedded postgresql database. &lt;p&gt; This command is to be run whenever a new user and database need to be created in the embedded postgresql database for an Oozie service. This command should usually be followed by a call to createOozieDb. &lt;p&gt; Available since API v10.
     * @param clusterName  (required)
     * @param serviceName Name of the Oozie service on which to run the command. (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 oozieCreateEmbeddedDatabaseCommandAsync(String clusterName, String serviceName, 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 = oozieCreateEmbeddedDatabaseCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for oozieDumpDatabaseCommand
     * @param clusterName  (required)
     * @param serviceName The name of the service (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 oozieDumpDatabaseCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/oozieDumpDatabase"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = oozieDumpDatabaseCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Dump the Oozie Server Database.
     * Dump the Oozie Server Database.
     * @param clusterName  (required)
     * @param serviceName The name of the service (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand oozieDumpDatabaseCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = oozieDumpDatabaseCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Dump the Oozie Server Database.
     * Dump the Oozie Server Database.
     * @param clusterName  (required)
     * @param serviceName The name of the service (required)
     * @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> oozieDumpDatabaseCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = oozieDumpDatabaseCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Dump the Oozie Server Database. (asynchronously)
     * Dump the Oozie Server Database.
     * @param clusterName  (required)
     * @param serviceName The name of the service (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 oozieDumpDatabaseCommandAsync(String clusterName, String serviceName, 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 = oozieDumpDatabaseCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for oozieLoadDatabaseCommand
     * @param clusterName  (required)
     * @param serviceName The name of the service (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 oozieLoadDatabaseCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/oozieLoadDatabase"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = oozieLoadDatabaseCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Load the Oozie Server Database from dump.
     * Load the Oozie Server Database from dump.
     * @param clusterName  (required)
     * @param serviceName The name of the service (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand oozieLoadDatabaseCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = oozieLoadDatabaseCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Load the Oozie Server Database from dump.
     * Load the Oozie Server Database from dump.
     * @param clusterName  (required)
     * @param serviceName The name of the service (required)
     * @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> oozieLoadDatabaseCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = oozieLoadDatabaseCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Load the Oozie Server Database from dump. (asynchronously)
     * Load the Oozie Server Database from dump.
     * @param clusterName  (required)
     * @param serviceName The name of the service (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 oozieLoadDatabaseCommandAsync(String clusterName, String serviceName, 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 = oozieLoadDatabaseCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for oozieUpgradeDbCommand
     * @param clusterName  (required)
     * @param serviceName The Oozie service name. (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 oozieUpgradeDbCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/oozieUpgradeDb"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = oozieUpgradeDbCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Upgrade Oozie Database schema as part of a major version upgrade.
     * Upgrade Oozie Database schema as part of a major version upgrade. &lt;p/&gt; When doing a major version upgrade for Oozie, it is necessary to upgrade the schema of its database before Oozie can run successfully. &lt;p/&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName The Oozie service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand oozieUpgradeDbCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = oozieUpgradeDbCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Upgrade Oozie Database schema as part of a major version upgrade.
     * Upgrade Oozie Database schema as part of a major version upgrade. &lt;p/&gt; When doing a major version upgrade for Oozie, it is necessary to upgrade the schema of its database before Oozie can run successfully. &lt;p/&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName The Oozie service name. (required)
     * @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> oozieUpgradeDbCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = oozieUpgradeDbCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Upgrade Oozie Database schema as part of a major version upgrade. (asynchronously)
     * Upgrade Oozie Database schema as part of a major version upgrade. &lt;p/&gt; When doing a major version upgrade for Oozie, it is necessary to upgrade the schema of its database before Oozie can run successfully. &lt;p/&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName The Oozie service name. (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 oozieUpgradeDbCommandAsync(String clusterName, String serviceName, 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 = oozieUpgradeDbCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for readService
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param view DataView to materialize. Defaults to &#x27;full&#x27;. (optional, default to full)
     * @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 readServiceCall(String clusterName, String serviceName, String view, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

        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 readServiceValidateBeforeCall(String clusterName, String serviceName, String view, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling readService(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling readService(Async)");
        }

        okhttp3.Call call = readServiceCall(clusterName, serviceName, view, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Retrieves details information about a service.
     * Retrieves details information about a service.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param view DataView to materialize. Defaults to &#x27;full&#x27;. (optional, default to full)
     * @return ApiService
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiService readService(String clusterName, String serviceName, String view) throws ApiException {
        ApiResponse<ApiService> resp = readServiceWithHttpInfo(clusterName, serviceName, view);
        return resp.getData();
    }

    /**
     * Retrieves details information about a service.
     * Retrieves details information about a service.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param view DataView to materialize. Defaults to &#x27;full&#x27;. (optional, default to full)
     * @return ApiResponse&lt;ApiService&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiService> readServiceWithHttpInfo(String clusterName, String serviceName, String view) throws ApiException {
        okhttp3.Call call = readServiceValidateBeforeCall(clusterName, serviceName, view, null, null);
        Type localVarReturnType = new TypeToken<ApiService>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Retrieves details information about a service. (asynchronously)
     * Retrieves details information about a service.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param view DataView to materialize. Defaults to &#x27;full&#x27;. (optional, default to full)
     * @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 readServiceAsync(String clusterName, String serviceName, String view, final ApiCallback<ApiService> 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 = readServiceValidateBeforeCall(clusterName, serviceName, view, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiService>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for readServiceConfig
     * @param clusterName  (required)
     * @param serviceName The service to query. (required)
     * @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 readServiceConfigCall(String clusterName, String serviceName, String view, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/config"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

        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 readServiceConfigValidateBeforeCall(String clusterName, String serviceName, String view, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling readServiceConfig(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling readServiceConfig(Async)");
        }

        okhttp3.Call call = readServiceConfigCall(clusterName, serviceName, view, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Retrieves the configuration of a specific service.
     * Retrieves the configuration of a specific service. &lt;p&gt; The \&quot;summary\&quot; view contains only the configured parameters, and configuration for role types that contain configured parameters. &lt;p&gt; The \&quot;full\&quot; view contains all available configuration parameters for the service and its role types. This mode performs validation on the configuration, which could take a few seconds on a large cluster (around 500 nodes or more).
     * @param clusterName  (required)
     * @param serviceName The service to query. (required)
     * @param view The view of the data to materialize, either \&quot;summary\&quot; or \&quot;full\&quot;. (optional, default to summary)
     * @return ApiServiceConfig
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiServiceConfig readServiceConfig(String clusterName, String serviceName, String view) throws ApiException {
        ApiResponse<ApiServiceConfig> resp = readServiceConfigWithHttpInfo(clusterName, serviceName, view);
        return resp.getData();
    }

    /**
     * Retrieves the configuration of a specific service.
     * Retrieves the configuration of a specific service. &lt;p&gt; The \&quot;summary\&quot; view contains only the configured parameters, and configuration for role types that contain configured parameters. &lt;p&gt; The \&quot;full\&quot; view contains all available configuration parameters for the service and its role types. This mode performs validation on the configuration, which could take a few seconds on a large cluster (around 500 nodes or more).
     * @param clusterName  (required)
     * @param serviceName The service to query. (required)
     * @param view The view of the data to materialize, either \&quot;summary\&quot; or \&quot;full\&quot;. (optional, default to summary)
     * @return ApiResponse&lt;ApiServiceConfig&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiServiceConfig> readServiceConfigWithHttpInfo(String clusterName, String serviceName, String view) throws ApiException {
        okhttp3.Call call = readServiceConfigValidateBeforeCall(clusterName, serviceName, view, null, null);
        Type localVarReturnType = new TypeToken<ApiServiceConfig>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Retrieves the configuration of a specific service. (asynchronously)
     * Retrieves the configuration of a specific service. &lt;p&gt; The \&quot;summary\&quot; view contains only the configured parameters, and configuration for role types that contain configured parameters. &lt;p&gt; The \&quot;full\&quot; view contains all available configuration parameters for the service and its role types. This mode performs validation on the configuration, which could take a few seconds on a large cluster (around 500 nodes or more).
     * @param clusterName  (required)
     * @param serviceName The service to query. (required)
     * @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 readServiceConfigAsync(String clusterName, String serviceName, String view, final ApiCallback<ApiServiceConfig> 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 = readServiceConfigValidateBeforeCall(clusterName, serviceName, view, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiServiceConfig>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for readServices
     * @param clusterName  (required)
     * @param view  (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 readServicesCall(String clusterName, String view, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()));

        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 readServicesValidateBeforeCall(String clusterName, String view, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling readServices(Async)");
        }

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

    }

    /**
     * Lists all services registered in the cluster.
     * Lists all services registered in the cluster.
     * @param clusterName  (required)
     * @param view  (optional, default to summary)
     * @return ApiServiceList
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiServiceList readServices(String clusterName, String view) throws ApiException {
        ApiResponse<ApiServiceList> resp = readServicesWithHttpInfo(clusterName, view);
        return resp.getData();
    }

    /**
     * Lists all services registered in the cluster.
     * Lists all services registered in the cluster.
     * @param clusterName  (required)
     * @param view  (optional, default to summary)
     * @return ApiResponse&lt;ApiServiceList&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiServiceList> readServicesWithHttpInfo(String clusterName, String view) throws ApiException {
        okhttp3.Call call = readServicesValidateBeforeCall(clusterName, view, null, null);
        Type localVarReturnType = new TypeToken<ApiServiceList>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Lists all services registered in the cluster. (asynchronously)
     * Lists all services registered in the cluster.
     * @param clusterName  (required)
     * @param view  (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 readServicesAsync(String clusterName, String view, final ApiCallback<ApiServiceList> 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 = readServicesValidateBeforeCall(clusterName, view, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiServiceList>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for readTags
     * @param clusterName  (required)
     * @param serviceName The name of the service (required)
     * @param limit Number of tags (optional, default to 10)
     * @param offset Index of the first tag to retrieve (optional, default to 0)
     * @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 readTagsCall(String clusterName, String serviceName, java.math.BigDecimal limit, java.math.BigDecimal offset, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/tags"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

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

        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 readTagsValidateBeforeCall(String clusterName, String serviceName, java.math.BigDecimal limit, java.math.BigDecimal offset, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling readTags(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling readTags(Async)");
        }

        okhttp3.Call call = readTagsCall(clusterName, serviceName, limit, offset, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Returns the tags associated with this service.
     * Returns the tags associated with this service. Tag names beginning with the prefix _cldr_ (case insensitive) are reserved for internal use by Cloudera.
     * @param clusterName  (required)
     * @param serviceName The name of the service (required)
     * @param limit Number of tags (optional, default to 10)
     * @param offset Index of the first tag to retrieve (optional, default to 0)
     * @return List&lt;ApiEntityTag&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<ApiEntityTag> readTags(String clusterName, String serviceName, java.math.BigDecimal limit, java.math.BigDecimal offset) throws ApiException {
        ApiResponse<List<ApiEntityTag>> resp = readTagsWithHttpInfo(clusterName, serviceName, limit, offset);
        return resp.getData();
    }

    /**
     * Returns the tags associated with this service.
     * Returns the tags associated with this service. Tag names beginning with the prefix _cldr_ (case insensitive) are reserved for internal use by Cloudera.
     * @param clusterName  (required)
     * @param serviceName The name of the service (required)
     * @param limit Number of tags (optional, default to 10)
     * @param offset Index of the first tag to retrieve (optional, default to 0)
     * @return ApiResponse&lt;List&lt;ApiEntityTag&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<ApiEntityTag>> readTagsWithHttpInfo(String clusterName, String serviceName, java.math.BigDecimal limit, java.math.BigDecimal offset) throws ApiException {
        okhttp3.Call call = readTagsValidateBeforeCall(clusterName, serviceName, limit, offset, null, null);
        Type localVarReturnType = new TypeToken<List<ApiEntityTag>>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns the tags associated with this service. (asynchronously)
     * Returns the tags associated with this service. Tag names beginning with the prefix _cldr_ (case insensitive) are reserved for internal use by Cloudera.
     * @param clusterName  (required)
     * @param serviceName The name of the service (required)
     * @param limit Number of tags (optional, default to 10)
     * @param offset Index of the first tag to retrieve (optional, default to 0)
     * @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 readTagsAsync(String clusterName, String serviceName, java.math.BigDecimal limit, java.math.BigDecimal offset, final ApiCallback<List<ApiEntityTag>> 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 = readTagsValidateBeforeCall(clusterName, serviceName, limit, offset, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<ApiEntityTag>>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for recommissionCommand
     * @param clusterName  (required)
     * @param serviceName Name of the service on which to run the command. (required)
     * @param body List of role names to recommision. (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 recommissionCommandCall(String clusterName, String serviceName, ApiRoleNameList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/recommission"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 recommissionCommandValidateBeforeCall(String clusterName, String serviceName, ApiRoleNameList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling recommissionCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling recommissionCommand(Async)");
        }

        okhttp3.Call call = recommissionCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Recommission roles of a service.
     * Recommission roles of a service. &lt;p&gt; The list should contain names of slave roles to recommission. &lt;/p&gt;  &lt;p&gt; Available since API v2. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName Name of the service on which to run the command. (required)
     * @param body List of role names to recommision. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand recommissionCommand(String clusterName, String serviceName, ApiRoleNameList body) throws ApiException {
        ApiResponse<ApiCommand> resp = recommissionCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Recommission roles of a service.
     * Recommission roles of a service. &lt;p&gt; The list should contain names of slave roles to recommission. &lt;/p&gt;  &lt;p&gt; Available since API v2. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName Name of the service on which to run the command. (required)
     * @param body List of role names to recommision. (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> recommissionCommandWithHttpInfo(String clusterName, String serviceName, ApiRoleNameList body) throws ApiException {
        okhttp3.Call call = recommissionCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Recommission roles of a service. (asynchronously)
     * Recommission roles of a service. &lt;p&gt; The list should contain names of slave roles to recommission. &lt;/p&gt;  &lt;p&gt; Available since API v2. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName Name of the service on which to run the command. (required)
     * @param body List of role names to recommision. (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 recommissionCommandAsync(String clusterName, String serviceName, ApiRoleNameList 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 = recommissionCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for recommissionWithStartCommand
     * @param clusterName  (required)
     * @param serviceName Name of the service on which to run the command. (required)
     * @param body List of role names to recommision. (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 recommissionWithStartCommandCall(String clusterName, String serviceName, ApiRoleNameList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/recommissionWithStart"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 recommissionWithStartCommandValidateBeforeCall(String clusterName, String serviceName, ApiRoleNameList body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling recommissionWithStartCommand(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling recommissionWithStartCommand(Async)");
        }

        okhttp3.Call call = recommissionWithStartCommandCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Start and recommission roles of a service.
     * Start and recommission roles of a service. &lt;p&gt; The list should contain names of slave roles to start and recommission. &lt;/p&gt;  &lt;p&gt; Warning: Evolving. This method may change in the future and does not offer standard compatibility guarantees. Only support by HDFS. Do not use without guidance from Cloudera. &lt;/p&gt;  &lt;p&gt; Available since API v15. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName Name of the service on which to run the command. (required)
     * @param body List of role names to recommision. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand recommissionWithStartCommand(String clusterName, String serviceName, ApiRoleNameList body) throws ApiException {
        ApiResponse<ApiCommand> resp = recommissionWithStartCommandWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Start and recommission roles of a service.
     * Start and recommission roles of a service. &lt;p&gt; The list should contain names of slave roles to start and recommission. &lt;/p&gt;  &lt;p&gt; Warning: Evolving. This method may change in the future and does not offer standard compatibility guarantees. Only support by HDFS. Do not use without guidance from Cloudera. &lt;/p&gt;  &lt;p&gt; Available since API v15. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName Name of the service on which to run the command. (required)
     * @param body List of role names to recommision. (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> recommissionWithStartCommandWithHttpInfo(String clusterName, String serviceName, ApiRoleNameList body) throws ApiException {
        okhttp3.Call call = recommissionWithStartCommandValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Start and recommission roles of a service. (asynchronously)
     * Start and recommission roles of a service. &lt;p&gt; The list should contain names of slave roles to start and recommission. &lt;/p&gt;  &lt;p&gt; Warning: Evolving. This method may change in the future and does not offer standard compatibility guarantees. Only support by HDFS. Do not use without guidance from Cloudera. &lt;/p&gt;  &lt;p&gt; Available since API v15. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName Name of the service on which to run the command. (required)
     * @param body List of role names to recommision. (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 recommissionWithStartCommandAsync(String clusterName, String serviceName, ApiRoleNameList 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 = recommissionWithStartCommandValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for restartCommand
     * @param clusterName  (required)
     * @param serviceName The service to start. (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 restartCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/restart"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = restartCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Restart the service.
     * Restart the service.
     * @param clusterName  (required)
     * @param serviceName The service to start. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand restartCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = restartCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Restart the service.
     * Restart the service.
     * @param clusterName  (required)
     * @param serviceName The service to start. (required)
     * @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> restartCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = restartCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Restart the service. (asynchronously)
     * Restart the service.
     * @param clusterName  (required)
     * @param serviceName The service to start. (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 restartCommandAsync(String clusterName, String serviceName, 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 = restartCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for rollingRestart
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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 rollingRestartCall(String clusterName, String serviceName, ApiRollingRestartArgs body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/rollingRestart"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 rollingRestartValidateBeforeCall(String clusterName, String serviceName, ApiRollingRestartArgs body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling rollingRestart(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling rollingRestart(Async)");
        }

        okhttp3.Call call = rollingRestartCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Command to run rolling restart of roles in a service.
     * Command to run rolling restart of roles in a service. The sequence is: &lt;ol&gt; &lt;li&gt;Restart all the non-slave roles &lt;li&gt;If slaves are present restart them in batches of size specified in RollingRestartCmdArgs &lt;li&gt;Perform any post-command needed after rolling restart &lt;/ol&gt; &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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 rollingRestart(String clusterName, String serviceName, ApiRollingRestartArgs body) throws ApiException {
        ApiResponse<ApiCommand> resp = rollingRestartWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Command to run rolling restart of roles in a service.
     * Command to run rolling restart of roles in a service. The sequence is: &lt;ol&gt; &lt;li&gt;Restart all the non-slave roles &lt;li&gt;If slaves are present restart them in batches of size specified in RollingRestartCmdArgs &lt;li&gt;Perform any post-command needed after rolling restart &lt;/ol&gt; &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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> rollingRestartWithHttpInfo(String clusterName, String serviceName, ApiRollingRestartArgs body) throws ApiException {
        okhttp3.Call call = rollingRestartValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Command to run rolling restart of roles in a service. (asynchronously)
     * Command to run rolling restart of roles in a service. The sequence is: &lt;ol&gt; &lt;li&gt;Restart all the non-slave roles &lt;li&gt;If slaves are present restart them in batches of size specified in RollingRestartCmdArgs &lt;li&gt;Perform any post-command needed after rolling restart &lt;/ol&gt; &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName  (required)
     * @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 rollingRestartAsync(String clusterName, String serviceName, ApiRollingRestartArgs 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 = rollingRestartValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for rotateEcsCertificates
     * @param clusterName  (required)
     * @param serviceName the name of the ECS service (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 rotateEcsCertificatesCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/rotateEcsCertificates"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = rotateEcsCertificatesCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Rotate ECS Internal Certificates.
     * Rotate ECS Internal Certificates. &lt;p&gt; This command will rotate the TLS/SSL certificates used by Vault, Embedded DB, and Tolerations Webhook. It also rotates the ingress controller certificate if it is using the default certificate. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName the name of the ECS service (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand rotateEcsCertificates(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = rotateEcsCertificatesWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Rotate ECS Internal Certificates.
     * Rotate ECS Internal Certificates. &lt;p&gt; This command will rotate the TLS/SSL certificates used by Vault, Embedded DB, and Tolerations Webhook. It also rotates the ingress controller certificate if it is using the default certificate. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName the name of the ECS service (required)
     * @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> rotateEcsCertificatesWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = rotateEcsCertificatesValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Rotate ECS Internal Certificates. (asynchronously)
     * Rotate ECS Internal Certificates. &lt;p&gt; This command will rotate the TLS/SSL certificates used by Vault, Embedded DB, and Tolerations Webhook. It also rotates the ingress controller certificate if it is using the default certificate. &lt;/p&gt;
     * @param clusterName  (required)
     * @param serviceName the name of the ECS service (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 rotateEcsCertificatesAsync(String clusterName, String serviceName, 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 = rotateEcsCertificatesValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for sentryCreateDatabaseCommand
     * @param clusterName  (required)
     * @param serviceName Name of the Sentry service on which to run the command. (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 sentryCreateDatabaseCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/sentryCreateDatabase"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = sentryCreateDatabaseCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Create the Sentry Server Database.
     * Create the Sentry Server Database. Only works with embedded postgresql database. &lt;p&gt; This command is to be run whenever a new user and database need to be created in the embedded postgresql database for a Sentry service. This command should usually be followed by a call to sentryCreateDatabaseTables. &lt;p&gt; Available since API v7.
     * @param clusterName  (required)
     * @param serviceName Name of the Sentry service on which to run the command. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand sentryCreateDatabaseCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = sentryCreateDatabaseCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Create the Sentry Server Database.
     * Create the Sentry Server Database. Only works with embedded postgresql database. &lt;p&gt; This command is to be run whenever a new user and database need to be created in the embedded postgresql database for a Sentry service. This command should usually be followed by a call to sentryCreateDatabaseTables. &lt;p&gt; Available since API v7.
     * @param clusterName  (required)
     * @param serviceName Name of the Sentry service on which to run the command. (required)
     * @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> sentryCreateDatabaseCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = sentryCreateDatabaseCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Create the Sentry Server Database. (asynchronously)
     * Create the Sentry Server Database. Only works with embedded postgresql database. &lt;p&gt; This command is to be run whenever a new user and database need to be created in the embedded postgresql database for a Sentry service. This command should usually be followed by a call to sentryCreateDatabaseTables. &lt;p&gt; Available since API v7.
     * @param clusterName  (required)
     * @param serviceName Name of the Sentry service on which to run the command. (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 sentryCreateDatabaseCommandAsync(String clusterName, String serviceName, 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 = sentryCreateDatabaseCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for sentryCreateDatabaseTablesCommand
     * @param clusterName  (required)
     * @param serviceName Name of the Sentry service on which to run the command. (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 sentryCreateDatabaseTablesCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/sentryCreateDatabaseTables"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = sentryCreateDatabaseTablesCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Create the Sentry Server Database tables.
     * Create the Sentry Server Database tables. &lt;p&gt; This command is to be run whenever a new database has been specified. Will do nothing if tables already exist. Will not perform an upgrade. Only Available when Sentry Server is stopped. &lt;p&gt; Available since API v7.
     * @param clusterName  (required)
     * @param serviceName Name of the Sentry service on which to run the command. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand sentryCreateDatabaseTablesCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = sentryCreateDatabaseTablesCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Create the Sentry Server Database tables.
     * Create the Sentry Server Database tables. &lt;p&gt; This command is to be run whenever a new database has been specified. Will do nothing if tables already exist. Will not perform an upgrade. Only Available when Sentry Server is stopped. &lt;p&gt; Available since API v7.
     * @param clusterName  (required)
     * @param serviceName Name of the Sentry service on which to run the command. (required)
     * @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> sentryCreateDatabaseTablesCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = sentryCreateDatabaseTablesCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Create the Sentry Server Database tables. (asynchronously)
     * Create the Sentry Server Database tables. &lt;p&gt; This command is to be run whenever a new database has been specified. Will do nothing if tables already exist. Will not perform an upgrade. Only Available when Sentry Server is stopped. &lt;p&gt; Available since API v7.
     * @param clusterName  (required)
     * @param serviceName Name of the Sentry service on which to run the command. (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 sentryCreateDatabaseTablesCommandAsync(String clusterName, String serviceName, 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 = sentryCreateDatabaseTablesCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for sentryUpgradeDatabaseTablesCommand
     * @param clusterName  (required)
     * @param serviceName Name of the Sentry service on which to run the command. (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 sentryUpgradeDatabaseTablesCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/sentryUpgradeDatabaseTables"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = sentryUpgradeDatabaseTablesCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Upgrade the Sentry Server Database tables.
     * Upgrade the Sentry Server Database tables. &lt;p&gt; This command is to be run whenever Sentry requires an upgrade to its database tables. &lt;p&gt; Available since API v8.
     * @param clusterName  (required)
     * @param serviceName Name of the Sentry service on which to run the command. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand sentryUpgradeDatabaseTablesCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = sentryUpgradeDatabaseTablesCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Upgrade the Sentry Server Database tables.
     * Upgrade the Sentry Server Database tables. &lt;p&gt; This command is to be run whenever Sentry requires an upgrade to its database tables. &lt;p&gt; Available since API v8.
     * @param clusterName  (required)
     * @param serviceName Name of the Sentry service on which to run the command. (required)
     * @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> sentryUpgradeDatabaseTablesCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = sentryUpgradeDatabaseTablesCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Upgrade the Sentry Server Database tables. (asynchronously)
     * Upgrade the Sentry Server Database tables. &lt;p&gt; This command is to be run whenever Sentry requires an upgrade to its database tables. &lt;p&gt; Available since API v8.
     * @param clusterName  (required)
     * @param serviceName Name of the Sentry service on which to run the command. (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 sentryUpgradeDatabaseTablesCommandAsync(String clusterName, String serviceName, 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 = sentryUpgradeDatabaseTablesCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for serviceCommandByName
     * @param clusterName  (required)
     * @param commandName The command name. (required)
     * @param serviceName The service name. (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 serviceCommandByNameCall(String clusterName, String commandName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/{commandName}"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "commandName" + "\\}", apiClient.escapeString(commandName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = serviceCommandByNameCall(clusterName, commandName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Executes a command on the service specified by name.
     * Executes a command on the service specified by name. &lt;p&gt; Available since API v6. &lt;/p&gt;
     * @param clusterName  (required)
     * @param commandName The command name. (required)
     * @param serviceName The service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand serviceCommandByName(String clusterName, String commandName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = serviceCommandByNameWithHttpInfo(clusterName, commandName, serviceName);
        return resp.getData();
    }

    /**
     * Executes a command on the service specified by name.
     * Executes a command on the service specified by name. &lt;p&gt; Available since API v6. &lt;/p&gt;
     * @param clusterName  (required)
     * @param commandName The command name. (required)
     * @param serviceName The service name. (required)
     * @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> serviceCommandByNameWithHttpInfo(String clusterName, String commandName, String serviceName) throws ApiException {
        okhttp3.Call call = serviceCommandByNameValidateBeforeCall(clusterName, commandName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Executes a command on the service specified by name. (asynchronously)
     * Executes a command on the service specified by name. &lt;p&gt; Available since API v6. &lt;/p&gt;
     * @param clusterName  (required)
     * @param commandName The command name. (required)
     * @param serviceName The service name. (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 serviceCommandByNameAsync(String clusterName, String commandName, String serviceName, 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 = serviceCommandByNameValidateBeforeCall(clusterName, commandName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for solrBootstrapCollectionsCommand
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (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 solrBootstrapCollectionsCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/solrBootstrapCollections"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = solrBootstrapCollectionsCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Bootstraps Solr Collections after the CDH upgrade.
     * Bootstraps Solr Collections after the CDH upgrade. &lt;p&gt; Note: This is only needed for upgrading to CDH6.0. &lt;p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand solrBootstrapCollectionsCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = solrBootstrapCollectionsCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Bootstraps Solr Collections after the CDH upgrade.
     * Bootstraps Solr Collections after the CDH upgrade. &lt;p&gt; Note: This is only needed for upgrading to CDH6.0. &lt;p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (required)
     * @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> solrBootstrapCollectionsCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = solrBootstrapCollectionsCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Bootstraps Solr Collections after the CDH upgrade. (asynchronously)
     * Bootstraps Solr Collections after the CDH upgrade. &lt;p&gt; Note: This is only needed for upgrading to CDH6.0. &lt;p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (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 solrBootstrapCollectionsCommandAsync(String clusterName, String serviceName, 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 = solrBootstrapCollectionsCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for solrBootstrapConfigCommand
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (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 solrBootstrapConfigCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/solrBootstrapConfig"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = solrBootstrapConfigCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Bootstraps Solr config during the CDH upgrade.
     * Bootstraps Solr config during the CDH upgrade. &lt;p&gt; Note: This is only needed for upgrading to CDH6.0. &lt;p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand solrBootstrapConfigCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = solrBootstrapConfigCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Bootstraps Solr config during the CDH upgrade.
     * Bootstraps Solr config during the CDH upgrade. &lt;p&gt; Note: This is only needed for upgrading to CDH6.0. &lt;p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (required)
     * @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> solrBootstrapConfigCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = solrBootstrapConfigCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Bootstraps Solr config during the CDH upgrade. (asynchronously)
     * Bootstraps Solr config during the CDH upgrade. &lt;p&gt; Note: This is only needed for upgrading to CDH6.0. &lt;p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (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 solrBootstrapConfigCommandAsync(String clusterName, String serviceName, 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 = solrBootstrapConfigCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for solrConfigBackupCommand
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (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 solrConfigBackupCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/solrConfigBackup"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = solrConfigBackupCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Backs up Solr configuration metadata before CDH upgrade.
     * Backs up Solr configuration metadata before CDH upgrade. &lt;p&gt; Note: &lt;li&gt; &lt;ul&gt;Solr service should be in Stopped state.&lt;/ul&gt; &lt;ul&gt;HDFS and Zookeeper services should in Running state.&lt;/ul&gt; &lt;ul&gt;This is only needed for upgrading to CDH6.0.&lt;/ul&gt; &lt;/p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand solrConfigBackupCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = solrConfigBackupCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Backs up Solr configuration metadata before CDH upgrade.
     * Backs up Solr configuration metadata before CDH upgrade. &lt;p&gt; Note: &lt;li&gt; &lt;ul&gt;Solr service should be in Stopped state.&lt;/ul&gt; &lt;ul&gt;HDFS and Zookeeper services should in Running state.&lt;/ul&gt; &lt;ul&gt;This is only needed for upgrading to CDH6.0.&lt;/ul&gt; &lt;/p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (required)
     * @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> solrConfigBackupCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = solrConfigBackupCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Backs up Solr configuration metadata before CDH upgrade. (asynchronously)
     * Backs up Solr configuration metadata before CDH upgrade. &lt;p&gt; Note: &lt;li&gt; &lt;ul&gt;Solr service should be in Stopped state.&lt;/ul&gt; &lt;ul&gt;HDFS and Zookeeper services should in Running state.&lt;/ul&gt; &lt;ul&gt;This is only needed for upgrading to CDH6.0.&lt;/ul&gt; &lt;/p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (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 solrConfigBackupCommandAsync(String clusterName, String serviceName, 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 = solrConfigBackupCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for solrMigrateSentryPrivilegesCommand
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (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 solrMigrateSentryPrivilegesCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/solrMigrateSentryPrivilegesCommand"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = solrMigrateSentryPrivilegesCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Migrates Sentry privileges to new model compatible to support more granular permissions if Solr is configured with a Sentry service.
     * Migrates Sentry privileges to new model compatible to support more granular permissions if Solr is configured with a Sentry service. &lt;p&gt; Note: &lt;li&gt; &lt;ul&gt;Solr service should be in Stopped state.&lt;/ul&gt; &lt;ul&gt;HDFS, Zookeeper, and Sentry services should in Running state.&lt;/ul&gt; &lt;ul&gt;This is only needed for upgrading to CDH6.0.&lt;/ul&gt; &lt;p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand solrMigrateSentryPrivilegesCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = solrMigrateSentryPrivilegesCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Migrates Sentry privileges to new model compatible to support more granular permissions if Solr is configured with a Sentry service.
     * Migrates Sentry privileges to new model compatible to support more granular permissions if Solr is configured with a Sentry service. &lt;p&gt; Note: &lt;li&gt; &lt;ul&gt;Solr service should be in Stopped state.&lt;/ul&gt; &lt;ul&gt;HDFS, Zookeeper, and Sentry services should in Running state.&lt;/ul&gt; &lt;ul&gt;This is only needed for upgrading to CDH6.0.&lt;/ul&gt; &lt;p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (required)
     * @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> solrMigrateSentryPrivilegesCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = solrMigrateSentryPrivilegesCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Migrates Sentry privileges to new model compatible to support more granular permissions if Solr is configured with a Sentry service. (asynchronously)
     * Migrates Sentry privileges to new model compatible to support more granular permissions if Solr is configured with a Sentry service. &lt;p&gt; Note: &lt;li&gt; &lt;ul&gt;Solr service should be in Stopped state.&lt;/ul&gt; &lt;ul&gt;HDFS, Zookeeper, and Sentry services should in Running state.&lt;/ul&gt; &lt;ul&gt;This is only needed for upgrading to CDH6.0.&lt;/ul&gt; &lt;p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (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 solrMigrateSentryPrivilegesCommandAsync(String clusterName, String serviceName, 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 = solrMigrateSentryPrivilegesCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for solrReinitializeStateForUpgradeCommand
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (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 solrReinitializeStateForUpgradeCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/solrReinitializeStateForUpgrade"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = solrReinitializeStateForUpgradeCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Reinitializes the Solr state by clearing the Solr HDFS data directory, the Solr data directory, and the Zookeeper state.
     * Reinitializes the Solr state by clearing the Solr HDFS data directory, the Solr data directory, and the Zookeeper state. &lt;p&gt; Note: &lt;li&gt; &lt;ul&gt;Solr service should be in Stopped state.&lt;/ul&gt; &lt;ul&gt;HDFS and Zookeeper services should in Running state.&lt;/ul&gt; &lt;ul&gt;This is only needed for upgrading to CDH6.0.&lt;/ul&gt; &lt;p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand solrReinitializeStateForUpgradeCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = solrReinitializeStateForUpgradeCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Reinitializes the Solr state by clearing the Solr HDFS data directory, the Solr data directory, and the Zookeeper state.
     * Reinitializes the Solr state by clearing the Solr HDFS data directory, the Solr data directory, and the Zookeeper state. &lt;p&gt; Note: &lt;li&gt; &lt;ul&gt;Solr service should be in Stopped state.&lt;/ul&gt; &lt;ul&gt;HDFS and Zookeeper services should in Running state.&lt;/ul&gt; &lt;ul&gt;This is only needed for upgrading to CDH6.0.&lt;/ul&gt; &lt;p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (required)
     * @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> solrReinitializeStateForUpgradeCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = solrReinitializeStateForUpgradeCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Reinitializes the Solr state by clearing the Solr HDFS data directory, the Solr data directory, and the Zookeeper state. (asynchronously)
     * Reinitializes the Solr state by clearing the Solr HDFS data directory, the Solr data directory, and the Zookeeper state. &lt;p&gt; Note: &lt;li&gt; &lt;ul&gt;Solr service should be in Stopped state.&lt;/ul&gt; &lt;ul&gt;HDFS and Zookeeper services should in Running state.&lt;/ul&gt; &lt;ul&gt;This is only needed for upgrading to CDH6.0.&lt;/ul&gt; &lt;p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (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 solrReinitializeStateForUpgradeCommandAsync(String clusterName, String serviceName, 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 = solrReinitializeStateForUpgradeCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for solrValidateMetadataCommand
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (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 solrValidateMetadataCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/solrValidateMetadata"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = solrValidateMetadataCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Validates Solr metadata and configurations.
     * Validates Solr metadata and configurations. &lt;p&gt; Note: This is only needed for upgrading to CDH6.0. &lt;p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand solrValidateMetadataCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = solrValidateMetadataCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Validates Solr metadata and configurations.
     * Validates Solr metadata and configurations. &lt;p&gt; Note: This is only needed for upgrading to CDH6.0. &lt;p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (required)
     * @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> solrValidateMetadataCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = solrValidateMetadataCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Validates Solr metadata and configurations. (asynchronously)
     * Validates Solr metadata and configurations. &lt;p&gt; Note: This is only needed for upgrading to CDH6.0. &lt;p&gt; Available since API v30.
     * @param clusterName  (required)
     * @param serviceName A String representing the Solr service name. (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 solrValidateMetadataCommandAsync(String clusterName, String serviceName, 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 = solrValidateMetadataCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for sqoopCreateDatabaseTablesCommand
     * @param clusterName  (required)
     * @param serviceName Name of the Sentry service on which to run the command. (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 sqoopCreateDatabaseTablesCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/sqoopCreateDatabaseTables"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = sqoopCreateDatabaseTablesCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Create the Sqoop2 Server Database tables.
     * Create the Sqoop2 Server Database tables. &lt;p&gt; This command is to be run whenever a new database has been specified. Will do nothing if tables already exist. Will not perform an upgrade. Only available when Sqoop2 Server is stopped. &lt;p&gt; Available since API v10.
     * @param clusterName  (required)
     * @param serviceName Name of the Sentry service on which to run the command. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand sqoopCreateDatabaseTablesCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = sqoopCreateDatabaseTablesCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Create the Sqoop2 Server Database tables.
     * Create the Sqoop2 Server Database tables. &lt;p&gt; This command is to be run whenever a new database has been specified. Will do nothing if tables already exist. Will not perform an upgrade. Only available when Sqoop2 Server is stopped. &lt;p&gt; Available since API v10.
     * @param clusterName  (required)
     * @param serviceName Name of the Sentry service on which to run the command. (required)
     * @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> sqoopCreateDatabaseTablesCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = sqoopCreateDatabaseTablesCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Create the Sqoop2 Server Database tables. (asynchronously)
     * Create the Sqoop2 Server Database tables. &lt;p&gt; This command is to be run whenever a new database has been specified. Will do nothing if tables already exist. Will not perform an upgrade. Only available when Sqoop2 Server is stopped. &lt;p&gt; Available since API v10.
     * @param clusterName  (required)
     * @param serviceName Name of the Sentry service on which to run the command. (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 sqoopCreateDatabaseTablesCommandAsync(String clusterName, String serviceName, 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 = sqoopCreateDatabaseTablesCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for sqoopUpgradeDbCommand
     * @param clusterName  (required)
     * @param serviceName The Sqoop service name. (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 sqoopUpgradeDbCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/sqoopUpgradeDb"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = sqoopUpgradeDbCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Upgrade Sqoop Database schema as part of a major version upgrade.
     * Upgrade Sqoop Database schema as part of a major version upgrade. &lt;p/&gt; When doing a major version upgrade for Sqoop, it is necessary to upgrade the schema of its database before Sqoop can run successfully. &lt;p/&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName The Sqoop service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand sqoopUpgradeDbCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = sqoopUpgradeDbCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Upgrade Sqoop Database schema as part of a major version upgrade.
     * Upgrade Sqoop Database schema as part of a major version upgrade. &lt;p/&gt; When doing a major version upgrade for Sqoop, it is necessary to upgrade the schema of its database before Sqoop can run successfully. &lt;p/&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName The Sqoop service name. (required)
     * @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> sqoopUpgradeDbCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = sqoopUpgradeDbCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Upgrade Sqoop Database schema as part of a major version upgrade. (asynchronously)
     * Upgrade Sqoop Database schema as part of a major version upgrade. &lt;p/&gt; When doing a major version upgrade for Sqoop, it is necessary to upgrade the schema of its database before Sqoop can run successfully. &lt;p/&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName The Sqoop service name. (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 sqoopUpgradeDbCommandAsync(String clusterName, String serviceName, 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 = sqoopUpgradeDbCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for startCommand
     * @param clusterName  (required)
     * @param serviceName The service to start. (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 startCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/start"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = startCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Start the service.
     * Start the service.
     * @param clusterName  (required)
     * @param serviceName The service to start. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand startCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = startCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Start the service.
     * Start the service.
     * @param clusterName  (required)
     * @param serviceName The service to start. (required)
     * @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> startCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = startCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Start the service. (asynchronously)
     * Start the service.
     * @param clusterName  (required)
     * @param serviceName The service to start. (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 startCommandAsync(String clusterName, String serviceName, 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 = startCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for stopCommand
     * @param clusterName  (required)
     * @param serviceName The service to stop. (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 stopCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/stop"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = stopCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Stop the service.
     * Stop the service.
     * @param clusterName  (required)
     * @param serviceName The service to stop. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand stopCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = stopCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Stop the service.
     * Stop the service.
     * @param clusterName  (required)
     * @param serviceName The service to stop. (required)
     * @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> stopCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = stopCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Stop the service. (asynchronously)
     * Stop the service.
     * @param clusterName  (required)
     * @param serviceName The service to stop. (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 stopCommandAsync(String clusterName, String serviceName, 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 = stopCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for switchToMr2
     * @param clusterName  (required)
     * @param serviceName Name of the Yarn service on which to run the command. (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 switchToMr2Call(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/switchToMr2"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = switchToMr2Call(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Change the cluster to use MR2 instead of MR1.
     * Change the cluster to use MR2 instead of MR1. Services will be restarted. &lt;p&gt; Will perform the following steps: &lt;ul&gt; &lt;li&gt;Update all services that depend on MapReduce to instead depend on Yarn. &lt;/li&gt; &lt;li&gt;Stop MapReduce&lt;/li&gt; &lt;li&gt;Start Yarn (MR2 Included)&lt;/li&gt; &lt;li&gt;Deploy Yarn (MR2) Client Configuration&lt;/li&gt; &lt;/ul&gt; &lt;p&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName Name of the Yarn service on which to run the command. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand switchToMr2(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = switchToMr2WithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Change the cluster to use MR2 instead of MR1.
     * Change the cluster to use MR2 instead of MR1. Services will be restarted. &lt;p&gt; Will perform the following steps: &lt;ul&gt; &lt;li&gt;Update all services that depend on MapReduce to instead depend on Yarn. &lt;/li&gt; &lt;li&gt;Stop MapReduce&lt;/li&gt; &lt;li&gt;Start Yarn (MR2 Included)&lt;/li&gt; &lt;li&gt;Deploy Yarn (MR2) Client Configuration&lt;/li&gt; &lt;/ul&gt; &lt;p&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName Name of the Yarn service on which to run the command. (required)
     * @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> switchToMr2WithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = switchToMr2ValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Change the cluster to use MR2 instead of MR1. (asynchronously)
     * Change the cluster to use MR2 instead of MR1. Services will be restarted. &lt;p&gt; Will perform the following steps: &lt;ul&gt; &lt;li&gt;Update all services that depend on MapReduce to instead depend on Yarn. &lt;/li&gt; &lt;li&gt;Stop MapReduce&lt;/li&gt; &lt;li&gt;Start Yarn (MR2 Included)&lt;/li&gt; &lt;li&gt;Deploy Yarn (MR2) Client Configuration&lt;/li&gt; &lt;/ul&gt; &lt;p&gt; Available since API v6.
     * @param clusterName  (required)
     * @param serviceName Name of the Yarn service on which to run the command. (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 switchToMr2Async(String clusterName, String serviceName, 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 = switchToMr2ValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for updateEcsIngressControllerCert
     * @param clusterName  (required)
     * @param serviceName The name of the ECS service. (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 updateEcsIngressControllerCertCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/updateEcsIngressControllerCert"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = updateEcsIngressControllerCertCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Updates the certificate used by the ECS Ingress Controller.
     * Updates the certificate used by the ECS Ingress Controller. &lt;p&gt; This API facilitates the updating of the certificate utilized by the ECS Ingress Controller, enabling automation of certificate pipelines.
     * @param clusterName  (required)
     * @param serviceName The name of the ECS service. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand updateEcsIngressControllerCert(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = updateEcsIngressControllerCertWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Updates the certificate used by the ECS Ingress Controller.
     * Updates the certificate used by the ECS Ingress Controller. &lt;p&gt; This API facilitates the updating of the certificate utilized by the ECS Ingress Controller, enabling automation of certificate pipelines.
     * @param clusterName  (required)
     * @param serviceName The name of the ECS service. (required)
     * @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> updateEcsIngressControllerCertWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = updateEcsIngressControllerCertValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Updates the certificate used by the ECS Ingress Controller. (asynchronously)
     * Updates the certificate used by the ECS Ingress Controller. &lt;p&gt; This API facilitates the updating of the certificate utilized by the ECS Ingress Controller, enabling automation of certificate pipelines.
     * @param clusterName  (required)
     * @param serviceName The name of the ECS service. (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 updateEcsIngressControllerCertAsync(String clusterName, String serviceName, 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 = updateEcsIngressControllerCertValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for updateService
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Updated service information. (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 updateServiceCall(String clusterName, String serviceName, ApiService body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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 = {
            "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 updateServiceValidateBeforeCall(String clusterName, String serviceName, ApiService body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling updateService(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling updateService(Async)");
        }

        okhttp3.Call call = updateServiceCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Updates service information.
     * Updates service information. &lt;p/&gt; This method will update only writable fields of the service information. Currently this only includes the service display name. &lt;p/&gt; Available since API v3.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Updated service information. (optional)
     * @return ApiService
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiService updateService(String clusterName, String serviceName, ApiService body) throws ApiException {
        ApiResponse<ApiService> resp = updateServiceWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Updates service information.
     * Updates service information. &lt;p/&gt; This method will update only writable fields of the service information. Currently this only includes the service display name. &lt;p/&gt; Available since API v3.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Updated service information. (optional)
     * @return ApiResponse&lt;ApiService&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiService> updateServiceWithHttpInfo(String clusterName, String serviceName, ApiService body) throws ApiException {
        okhttp3.Call call = updateServiceValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiService>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Updates service information. (asynchronously)
     * Updates service information. &lt;p/&gt; This method will update only writable fields of the service information. Currently this only includes the service display name. &lt;p/&gt; Available since API v3.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Updated service information. (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 updateServiceAsync(String clusterName, String serviceName, ApiService body, final ApiCallback<ApiService> 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 = updateServiceValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiService>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for updateServiceConfig
     * @param clusterName  (required)
     * @param serviceName The service to modify. (required)
     * @param body Configuration changes. (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 updateServiceConfigCall(String clusterName, String serviceName, ApiServiceConfig body, String message, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/config"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.toString()));

        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 updateServiceConfigValidateBeforeCall(String clusterName, String serviceName, ApiServiceConfig body, String message, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'clusterName' is set
        if (clusterName == null) {
            throw new ApiException("Missing the required parameter 'clusterName' when calling updateServiceConfig(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling updateServiceConfig(Async)");
        }

        okhttp3.Call call = updateServiceConfigCall(clusterName, serviceName, body, message, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Updates the service configuration with the given values.
     * Updates the service configuration with the given values. &lt;p&gt; If a value is set in the given configuration, it will be added to the service&#x27;s configuration, replacing any existing entries. If a value is unset (its value is null), the existing configuration for the attribute will be erased, if any. &lt;p&gt; Attributes that are not listed in the input will maintain their current values in the configuration.
     * @param clusterName  (required)
     * @param serviceName The service to modify. (required)
     * @param body Configuration changes. (optional)
     * @param message Optional message describing the changes. (optional)
     * @return ApiServiceConfig
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiServiceConfig updateServiceConfig(String clusterName, String serviceName, ApiServiceConfig body, String message) throws ApiException {
        ApiResponse<ApiServiceConfig> resp = updateServiceConfigWithHttpInfo(clusterName, serviceName, body, message);
        return resp.getData();
    }

    /**
     * Updates the service configuration with the given values.
     * Updates the service configuration with the given values. &lt;p&gt; If a value is set in the given configuration, it will be added to the service&#x27;s configuration, replacing any existing entries. If a value is unset (its value is null), the existing configuration for the attribute will be erased, if any. &lt;p&gt; Attributes that are not listed in the input will maintain their current values in the configuration.
     * @param clusterName  (required)
     * @param serviceName The service to modify. (required)
     * @param body Configuration changes. (optional)
     * @param message Optional message describing the changes. (optional)
     * @return ApiResponse&lt;ApiServiceConfig&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiServiceConfig> updateServiceConfigWithHttpInfo(String clusterName, String serviceName, ApiServiceConfig body, String message) throws ApiException {
        okhttp3.Call call = updateServiceConfigValidateBeforeCall(clusterName, serviceName, body, message, null, null);
        Type localVarReturnType = new TypeToken<ApiServiceConfig>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Updates the service configuration with the given values. (asynchronously)
     * Updates the service configuration with the given values. &lt;p&gt; If a value is set in the given configuration, it will be added to the service&#x27;s configuration, replacing any existing entries. If a value is unset (its value is null), the existing configuration for the attribute will be erased, if any. &lt;p&gt; Attributes that are not listed in the input will maintain their current values in the configuration.
     * @param clusterName  (required)
     * @param serviceName The service to modify. (required)
     * @param body Configuration changes. (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 updateServiceConfigAsync(String clusterName, String serviceName, ApiServiceConfig body, String message, final ApiCallback<ApiServiceConfig> 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 = updateServiceConfigValidateBeforeCall(clusterName, serviceName, body, message, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiServiceConfig>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for yarnFormatStateStore
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (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 yarnFormatStateStoreCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/yarnFormatStateStore"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = yarnFormatStateStoreCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Formats the state store in ZooKeeper used for Resource Manager High Availability.
     * Formats the state store in ZooKeeper used for Resource Manager High Availability. Typically used while moving from non-secure to secure cluster or vice-versa. &lt;p&gt; Available since API v8.
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand yarnFormatStateStore(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = yarnFormatStateStoreWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Formats the state store in ZooKeeper used for Resource Manager High Availability.
     * Formats the state store in ZooKeeper used for Resource Manager High Availability. Typically used while moving from non-secure to secure cluster or vice-versa. &lt;p&gt; Available since API v8.
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (required)
     * @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> yarnFormatStateStoreWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = yarnFormatStateStoreValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Formats the state store in ZooKeeper used for Resource Manager High Availability. (asynchronously)
     * Formats the state store in ZooKeeper used for Resource Manager High Availability. Typically used while moving from non-secure to secure cluster or vice-versa. &lt;p&gt; Available since API v8.
     * @param clusterName  (required)
     * @param serviceName The YARN service name. (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 yarnFormatStateStoreAsync(String clusterName, String serviceName, 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 = yarnFormatStateStoreValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for zooKeeperCleanupCommand
     * @param clusterName  (required)
     * @param serviceName The service to start. (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 zooKeeperCleanupCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/zooKeeperCleanup"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = zooKeeperCleanupCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Clean up all running server instances of a ZooKeeper service.
     * Clean up all running server instances of a ZooKeeper service. &lt;p&gt; This command removes snapshots and transaction log files kept by ZooKeeper for backup purposes. Refer to the ZooKeeper documentation for more details.
     * @param clusterName  (required)
     * @param serviceName The service to start. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand zooKeeperCleanupCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = zooKeeperCleanupCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Clean up all running server instances of a ZooKeeper service.
     * Clean up all running server instances of a ZooKeeper service. &lt;p&gt; This command removes snapshots and transaction log files kept by ZooKeeper for backup purposes. Refer to the ZooKeeper documentation for more details.
     * @param clusterName  (required)
     * @param serviceName The service to start. (required)
     * @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> zooKeeperCleanupCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = zooKeeperCleanupCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Clean up all running server instances of a ZooKeeper service. (asynchronously)
     * Clean up all running server instances of a ZooKeeper service. &lt;p&gt; This command removes snapshots and transaction log files kept by ZooKeeper for backup purposes. Refer to the ZooKeeper documentation for more details.
     * @param clusterName  (required)
     * @param serviceName The service to start. (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 zooKeeperCleanupCommandAsync(String clusterName, String serviceName, 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 = zooKeeperCleanupCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for zooKeeperInitCommand
     * @param clusterName  (required)
     * @param serviceName The service to start. (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 zooKeeperInitCommandCall(String clusterName, String serviceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/commands/zooKeeperInit"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "serviceName" + "\\}", apiClient.escapeString(serviceName.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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

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

        okhttp3.Call call = zooKeeperInitCommandCall(clusterName, serviceName, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Initializes all the server instances of a ZooKeeper service.
     * Initializes all the server instances of a ZooKeeper service. &lt;p&gt; ZooKeeper server roles need to be initialized before they can be used.
     * @param clusterName  (required)
     * @param serviceName The service to start. (required)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand zooKeeperInitCommand(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = zooKeeperInitCommandWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Initializes all the server instances of a ZooKeeper service.
     * Initializes all the server instances of a ZooKeeper service. &lt;p&gt; ZooKeeper server roles need to be initialized before they can be used.
     * @param clusterName  (required)
     * @param serviceName The service to start. (required)
     * @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> zooKeeperInitCommandWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = zooKeeperInitCommandValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Initializes all the server instances of a ZooKeeper service. (asynchronously)
     * Initializes all the server instances of a ZooKeeper service. &lt;p&gt; ZooKeeper server roles need to be initialized before they can be used.
     * @param clusterName  (required)
     * @param serviceName The service to start. (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 zooKeeperInitCommandAsync(String clusterName, String serviceName, 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 = zooKeeperInitCommandValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
}
