/*
 * 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.ApiAtlasReplicationRemoteArgs;
import com.cloudera.api.swagger.model.ApiCommand;
import com.cloudera.api.swagger.model.ApiHBaseAddReplicationPeerInput;
import com.cloudera.api.swagger.model.ApiHBasePeerId;
import com.cloudera.api.swagger.model.ApiHBasePeerIdWithTableCFs;
import com.cloudera.api.swagger.model.ApiHBaseReplicationUpdatePeerStateArgs;
import com.cloudera.api.swagger.model.ApiHBaseSetCFsReplicationScope;
import com.cloudera.api.swagger.model.ApiHBaseTableNames;
import com.cloudera.api.swagger.model.ApiHBaseUpdateReplicationPeerState;
import com.cloudera.api.swagger.model.ApiHive3ReplicationArguments;
import com.cloudera.api.swagger.model.ApiRangerReplicationExportArgs;
import com.cloudera.api.swagger.model.ApiReplicationCommandList;
import com.cloudera.api.swagger.model.ApiReplicationDiagnosticsCollectionArgs;
import com.cloudera.api.swagger.model.ApiReplicationSchedule;
import com.cloudera.api.swagger.model.ApiReplicationScheduleList;
import com.cloudera.api.swagger.model.ApiReplicationState;

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

public class ReplicationsResourceApi {
    private ApiClient apiClient;

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

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

    public ApiClient getApiClient() {
        return apiClient;
    }

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

    /**
     * Build call for addHBaseReplicationPeer
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Information for peer creation. (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 addHBaseReplicationPeerCall(String clusterName, String serviceName, ApiHBaseAddReplicationPeerInput 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}/replications/operations/addReplicationPeer"
            .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 addHBaseReplicationPeerValidateBeforeCall(String clusterName, String serviceName, ApiHBaseAddReplicationPeerInput 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 addHBaseReplicationPeer(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling addHBaseReplicationPeer(Async)");
        }

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

    }

    /**
     * Starts a command that adds a new replication peer to HBase.
     * Starts a command that adds a new replication peer to HBase.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Information for peer creation. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand addHBaseReplicationPeer(String clusterName, String serviceName, ApiHBaseAddReplicationPeerInput body) throws ApiException {
        ApiResponse<ApiCommand> resp = addHBaseReplicationPeerWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Starts a command that adds a new replication peer to HBase.
     * Starts a command that adds a new replication peer to HBase.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Information for peer creation. (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> addHBaseReplicationPeerWithHttpInfo(String clusterName, String serviceName, ApiHBaseAddReplicationPeerInput body) throws ApiException {
        okhttp3.Call call = addHBaseReplicationPeerValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Starts a command that adds a new replication peer to HBase. (asynchronously)
     * Starts a command that adds a new replication peer to HBase.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Information for peer creation. (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 addHBaseReplicationPeerAsync(String clusterName, String serviceName, ApiHBaseAddReplicationPeerInput 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 = addHBaseReplicationPeerValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for addTablesToHBasePeer
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Arguments for the operation. (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call addTablesToHBasePeerCall(String clusterName, String serviceName, ApiHBasePeerIdWithTableCFs 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}/replications/operations/addTablesToHBasePeer"
            .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 addTablesToHBasePeerValidateBeforeCall(String clusterName, String serviceName, ApiHBasePeerIdWithTableCFs 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 addTablesToHBasePeer(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling addTablesToHBasePeer(Async)");
        }

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

    }

    /**
     * Starts a command that adds tables and column families to an existing HBase replication peer.
     * Starts a command that adds tables and column families to an existing HBase replication peer.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Arguments for the operation. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand addTablesToHBasePeer(String clusterName, String serviceName, ApiHBasePeerIdWithTableCFs body) throws ApiException {
        ApiResponse<ApiCommand> resp = addTablesToHBasePeerWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Starts a command that adds tables and column families to an existing HBase replication peer.
     * Starts a command that adds tables and column families to an existing HBase replication peer.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Arguments for the operation. (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> addTablesToHBasePeerWithHttpInfo(String clusterName, String serviceName, ApiHBasePeerIdWithTableCFs body) throws ApiException {
        okhttp3.Call call = addTablesToHBasePeerValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Starts a command that adds tables and column families to an existing HBase replication peer. (asynchronously)
     * Starts a command that adds tables and column families to an existing HBase replication peer.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Arguments for the operation. (optional)
     * @param callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     */
    public okhttp3.Call addTablesToHBasePeerAsync(String clusterName, String serviceName, ApiHBasePeerIdWithTableCFs 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 = addTablesToHBasePeerValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for checkHBaseTablesExist
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Names of the tables to be checked. (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 checkHBaseTablesExistCall(String clusterName, String serviceName, ApiHBaseTableNames 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}/replications/operations/checkTables"
            .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 checkHBaseTablesExistValidateBeforeCall(String clusterName, String serviceName, ApiHBaseTableNames 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 checkHBaseTablesExist(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling checkHBaseTablesExist(Async)");
        }

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

    }

    /**
     * Starts a command that checks if the specified tables exist in HBase.
     * Starts a command that checks if the specified tables exist in HBase.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Names of the tables to be checked. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand checkHBaseTablesExist(String clusterName, String serviceName, ApiHBaseTableNames body) throws ApiException {
        ApiResponse<ApiCommand> resp = checkHBaseTablesExistWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Starts a command that checks if the specified tables exist in HBase.
     * Starts a command that checks if the specified tables exist in HBase.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Names of the tables to be checked. (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> checkHBaseTablesExistWithHttpInfo(String clusterName, String serviceName, ApiHBaseTableNames body) throws ApiException {
        okhttp3.Call call = checkHBaseTablesExistValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Starts a command that checks if the specified tables exist in HBase. (asynchronously)
     * Starts a command that checks if the specified tables exist in HBase.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Names of the tables to be checked. (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 checkHBaseTablesExistAsync(String clusterName, String serviceName, ApiHBaseTableNames 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 = checkHBaseTablesExistValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for collectDiagnosticData
     * @param clusterName  (required)
     * @param scheduleId Schedule ID (required)
     * @param serviceName The service name. (required)
     * @param body Replication collection arguments (optional)
     * @param view view to materialize (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 collectDiagnosticDataCall(String clusterName, java.math.BigDecimal scheduleId, String serviceName, ApiReplicationDiagnosticsCollectionArgs body, String view, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/replications/{scheduleId}/collectDiagnosticData"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "scheduleId" + "\\}", apiClient.escapeString(scheduleId.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 = {
            "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 collectDiagnosticDataValidateBeforeCall(String clusterName, java.math.BigDecimal scheduleId, String serviceName, ApiReplicationDiagnosticsCollectionArgs body, 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 collectDiagnosticData(Async)");
        }
        // verify the required parameter 'scheduleId' is set
        if (scheduleId == null) {
            throw new ApiException("Missing the required parameter 'scheduleId' when calling collectDiagnosticData(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling collectDiagnosticData(Async)");
        }

        okhttp3.Call call = collectDiagnosticDataCall(clusterName, scheduleId, serviceName, body, view, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Collect diagnostic data for a schedule, optionally for a subset of commands on that schedule, matched by schedule ID.
     * Collect diagnostic data for a schedule, optionally for a subset of commands on that schedule, matched by schedule ID.  The returned command&#x27;s resultDataUrl property, upon the commands completion, will refer to the generated diagnostic data. Available since API v11.
     * @param clusterName  (required)
     * @param scheduleId Schedule ID (required)
     * @param serviceName The service name. (required)
     * @param body Replication collection arguments (optional)
     * @param view view to materialize (optional, default to summary)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand collectDiagnosticData(String clusterName, java.math.BigDecimal scheduleId, String serviceName, ApiReplicationDiagnosticsCollectionArgs body, String view) throws ApiException {
        ApiResponse<ApiCommand> resp = collectDiagnosticDataWithHttpInfo(clusterName, scheduleId, serviceName, body, view);
        return resp.getData();
    }

    /**
     * Collect diagnostic data for a schedule, optionally for a subset of commands on that schedule, matched by schedule ID.
     * Collect diagnostic data for a schedule, optionally for a subset of commands on that schedule, matched by schedule ID.  The returned command&#x27;s resultDataUrl property, upon the commands completion, will refer to the generated diagnostic data. Available since API v11.
     * @param clusterName  (required)
     * @param scheduleId Schedule ID (required)
     * @param serviceName The service name. (required)
     * @param body Replication collection arguments (optional)
     * @param view view to materialize (optional, default to summary)
     * @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> collectDiagnosticDataWithHttpInfo(String clusterName, java.math.BigDecimal scheduleId, String serviceName, ApiReplicationDiagnosticsCollectionArgs body, String view) throws ApiException {
        okhttp3.Call call = collectDiagnosticDataValidateBeforeCall(clusterName, scheduleId, serviceName, body, view, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Collect diagnostic data for a schedule, optionally for a subset of commands on that schedule, matched by schedule ID. (asynchronously)
     * Collect diagnostic data for a schedule, optionally for a subset of commands on that schedule, matched by schedule ID.  The returned command&#x27;s resultDataUrl property, upon the commands completion, will refer to the generated diagnostic data. Available since API v11.
     * @param clusterName  (required)
     * @param scheduleId Schedule ID (required)
     * @param serviceName The service name. (required)
     * @param body Replication collection arguments (optional)
     * @param view view to materialize (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 collectDiagnosticDataAsync(String clusterName, java.math.BigDecimal scheduleId, String serviceName, ApiReplicationDiagnosticsCollectionArgs body, String view, 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 = collectDiagnosticDataValidateBeforeCall(clusterName, scheduleId, serviceName, body, view, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createCloudCredstoreOnHdfs
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param force if the jceks file already exists on HDFS and this parameter is set to true then it will be recreated, otherwise left untouched (optional)
     * @param sourceAccount the External Account that has been already added to this CM, for which the credstore provider jceks file will be generated (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 createCloudCredstoreOnHdfsCall(String clusterName, String serviceName, Boolean force, String sourceAccount, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/replications/createCloudCredstoreOnHdfs"
            .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));
        if (sourceAccount != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("sourceAccount", sourceAccount));

        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 createCloudCredstoreOnHdfsValidateBeforeCall(String clusterName, String serviceName, Boolean force, String sourceAccount, 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 createCloudCredstoreOnHdfs(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling createCloudCredstoreOnHdfs(Async)");
        }

        okhttp3.Call call = createCloudCredstoreOnHdfsCall(clusterName, serviceName, force, sourceAccount, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Creates a credstore provider jceks file on HDFS for the given service.
     * Creates a credstore provider jceks file on HDFS for the given service. The file will store credential information for the given sourceAccount.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param force if the jceks file already exists on HDFS and this parameter is set to true then it will be recreated, otherwise left untouched (optional)
     * @param sourceAccount the External Account that has been already added to this CM, for which the credstore provider jceks file will be generated (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand createCloudCredstoreOnHdfs(String clusterName, String serviceName, Boolean force, String sourceAccount) throws ApiException {
        ApiResponse<ApiCommand> resp = createCloudCredstoreOnHdfsWithHttpInfo(clusterName, serviceName, force, sourceAccount);
        return resp.getData();
    }

    /**
     * Creates a credstore provider jceks file on HDFS for the given service.
     * Creates a credstore provider jceks file on HDFS for the given service. The file will store credential information for the given sourceAccount.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param force if the jceks file already exists on HDFS and this parameter is set to true then it will be recreated, otherwise left untouched (optional)
     * @param sourceAccount the External Account that has been already added to this CM, for which the credstore provider jceks file will be generated (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> createCloudCredstoreOnHdfsWithHttpInfo(String clusterName, String serviceName, Boolean force, String sourceAccount) throws ApiException {
        okhttp3.Call call = createCloudCredstoreOnHdfsValidateBeforeCall(clusterName, serviceName, force, sourceAccount, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Creates a credstore provider jceks file on HDFS for the given service. (asynchronously)
     * Creates a credstore provider jceks file on HDFS for the given service. The file will store credential information for the given sourceAccount.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param force if the jceks file already exists on HDFS and this parameter is set to true then it will be recreated, otherwise left untouched (optional)
     * @param sourceAccount the External Account that has been already added to this CM, for which the credstore provider jceks file will be generated (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 createCloudCredstoreOnHdfsAsync(String clusterName, String serviceName, Boolean force, String sourceAccount, 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 = createCloudCredstoreOnHdfsValidateBeforeCall(clusterName, serviceName, force, sourceAccount, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createCredstore
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param credstoreDirPath  (optional)
     * @param force  (optional)
     * @param sourceAccount  (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 createCredstoreCall(String clusterName, String serviceName, String credstoreDirPath, Boolean force, String sourceAccount, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/replications/createCredstore"
            .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 (credstoreDirPath != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("credstoreDirPath", credstoreDirPath));
        if (force != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("force", force));
        if (sourceAccount != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("sourceAccount", sourceAccount));

        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 createCredstoreValidateBeforeCall(String clusterName, String serviceName, String credstoreDirPath, Boolean force, String sourceAccount, 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 createCredstore(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling createCredstore(Async)");
        }

        okhttp3.Call call = createCredstoreCall(clusterName, serviceName, credstoreDirPath, force, sourceAccount, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Use the following API endpoint instead:.
     * Use the following API endpoint instead: &lt;b/&gt; com.cloudera.api.v50.ReplicationsResourceV50#createCloudCredstoreOnHdfs(String, boolean)
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param credstoreDirPath  (optional)
     * @param force  (optional)
     * @param sourceAccount  (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand createCredstore(String clusterName, String serviceName, String credstoreDirPath, Boolean force, String sourceAccount) throws ApiException {
        ApiResponse<ApiCommand> resp = createCredstoreWithHttpInfo(clusterName, serviceName, credstoreDirPath, force, sourceAccount);
        return resp.getData();
    }

    /**
     * Use the following API endpoint instead:.
     * Use the following API endpoint instead: &lt;b/&gt; com.cloudera.api.v50.ReplicationsResourceV50#createCloudCredstoreOnHdfs(String, boolean)
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param credstoreDirPath  (optional)
     * @param force  (optional)
     * @param sourceAccount  (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> createCredstoreWithHttpInfo(String clusterName, String serviceName, String credstoreDirPath, Boolean force, String sourceAccount) throws ApiException {
        okhttp3.Call call = createCredstoreValidateBeforeCall(clusterName, serviceName, credstoreDirPath, force, sourceAccount, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Use the following API endpoint instead:. (asynchronously)
     * Use the following API endpoint instead: &lt;b/&gt; com.cloudera.api.v50.ReplicationsResourceV50#createCloudCredstoreOnHdfs(String, boolean)
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param credstoreDirPath  (optional)
     * @param force  (optional)
     * @param sourceAccount  (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 createCredstoreAsync(String clusterName, String serviceName, String credstoreDirPath, Boolean force, String sourceAccount, 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 = createCredstoreValidateBeforeCall(clusterName, serviceName, credstoreDirPath, force, sourceAccount, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createSchedules
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body List of the replication schedules 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 createSchedulesCall(String clusterName, String serviceName, ApiReplicationScheduleList 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}/replications"
            .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 createSchedulesValidateBeforeCall(String clusterName, String serviceName, ApiReplicationScheduleList 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 createSchedules(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling createSchedules(Async)");
        }

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

    }

    /**
     * Creates one or more replication schedules.
     * Creates one or more replication schedules. &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body List of the replication schedules to create. (optional)
     * @return ApiReplicationScheduleList
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiReplicationScheduleList createSchedules(String clusterName, String serviceName, ApiReplicationScheduleList body) throws ApiException {
        ApiResponse<ApiReplicationScheduleList> resp = createSchedulesWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Creates one or more replication schedules.
     * Creates one or more replication schedules. &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body List of the replication schedules to create. (optional)
     * @return ApiResponse&lt;ApiReplicationScheduleList&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiReplicationScheduleList> createSchedulesWithHttpInfo(String clusterName, String serviceName, ApiReplicationScheduleList body) throws ApiException {
        okhttp3.Call call = createSchedulesValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiReplicationScheduleList>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Creates one or more replication schedules. (asynchronously)
     * Creates one or more replication schedules. &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body List of the replication schedules 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 createSchedulesAsync(String clusterName, String serviceName, ApiReplicationScheduleList body, final ApiCallback<ApiReplicationScheduleList> 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 = createSchedulesValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiReplicationScheduleList>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for deleteAllSchedules
     * @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 deleteAllSchedulesCall(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}/replications"
            .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 deleteAllSchedulesValidateBeforeCall(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 deleteAllSchedules(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling deleteAllSchedules(Async)");
        }

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

    }

    /**
     * Deletes all existing replication schedules.
     * Deletes all existing replication schedules. &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @return ApiReplicationScheduleList
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiReplicationScheduleList deleteAllSchedules(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiReplicationScheduleList> resp = deleteAllSchedulesWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Deletes all existing replication schedules.
     * Deletes all existing replication schedules. &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @return ApiResponse&lt;ApiReplicationScheduleList&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiReplicationScheduleList> deleteAllSchedulesWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = deleteAllSchedulesValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiReplicationScheduleList>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Deletes all existing replication schedules. (asynchronously)
     * Deletes all existing replication schedules. &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @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 deleteAllSchedulesAsync(String clusterName, String serviceName, final ApiCallback<ApiReplicationScheduleList> 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 = deleteAllSchedulesValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiReplicationScheduleList>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for deleteSchedule
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (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 deleteScheduleCall(String clusterName, java.math.BigDecimal scheduleId, 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}/replications/{scheduleId}"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "scheduleId" + "\\}", apiClient.escapeString(scheduleId.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 deleteScheduleValidateBeforeCall(String clusterName, java.math.BigDecimal scheduleId, 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 deleteSchedule(Async)");
        }
        // verify the required parameter 'scheduleId' is set
        if (scheduleId == null) {
            throw new ApiException("Missing the required parameter 'scheduleId' when calling deleteSchedule(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling deleteSchedule(Async)");
        }

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

    }

    /**
     * Deletes an existing replication schedule.
     * Deletes an existing replication schedule. &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (required)
     * @param serviceName The service name. (required)
     * @return ApiReplicationSchedule
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiReplicationSchedule deleteSchedule(String clusterName, java.math.BigDecimal scheduleId, String serviceName) throws ApiException {
        ApiResponse<ApiReplicationSchedule> resp = deleteScheduleWithHttpInfo(clusterName, scheduleId, serviceName);
        return resp.getData();
    }

    /**
     * Deletes an existing replication schedule.
     * Deletes an existing replication schedule. &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (required)
     * @param serviceName The service name. (required)
     * @return ApiResponse&lt;ApiReplicationSchedule&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiReplicationSchedule> deleteScheduleWithHttpInfo(String clusterName, java.math.BigDecimal scheduleId, String serviceName) throws ApiException {
        okhttp3.Call call = deleteScheduleValidateBeforeCall(clusterName, scheduleId, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiReplicationSchedule>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Deletes an existing replication schedule. (asynchronously)
     * Deletes an existing replication schedule. &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (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 deleteScheduleAsync(String clusterName, java.math.BigDecimal scheduleId, String serviceName, final ApiCallback<ApiReplicationSchedule> 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 = deleteScheduleValidateBeforeCall(clusterName, scheduleId, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiReplicationSchedule>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for exportAtlasEntites
     * @param clusterName  (required)
     * @param serviceName The service name. (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 exportAtlasEntitesCall(String clusterName, String serviceName, ApiAtlasReplicationRemoteArgs 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}/replications/exportAtlasEntities"
            .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 exportAtlasEntitesValidateBeforeCall(String clusterName, String serviceName, ApiAtlasReplicationRemoteArgs 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 exportAtlasEntites(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling exportAtlasEntites(Async)");
        }

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

    }

    /**
     * Exports the given Atlas Entities (defined in the API body) to a zipped file in hdfs.
     * Exports the given Atlas Entities (defined in the API body) to a zipped file in hdfs.
     * @param clusterName  (required)
     * @param serviceName The service name. (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 exportAtlasEntites(String clusterName, String serviceName, ApiAtlasReplicationRemoteArgs body) throws ApiException {
        ApiResponse<ApiCommand> resp = exportAtlasEntitesWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Exports the given Atlas Entities (defined in the API body) to a zipped file in hdfs.
     * Exports the given Atlas Entities (defined in the API body) to a zipped file in hdfs.
     * @param clusterName  (required)
     * @param serviceName The service name. (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> exportAtlasEntitesWithHttpInfo(String clusterName, String serviceName, ApiAtlasReplicationRemoteArgs body) throws ApiException {
        okhttp3.Call call = exportAtlasEntitesValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Exports the given Atlas Entities (defined in the API body) to a zipped file in hdfs. (asynchronously)
     * Exports the given Atlas Entities (defined in the API body) to a zipped file in hdfs.
     * @param clusterName  (required)
     * @param serviceName The service name. (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 exportAtlasEntitesAsync(String clusterName, String serviceName, ApiAtlasReplicationRemoteArgs 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 = exportAtlasEntitesValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for exportRangerServices
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body the arguments for the export operation.
Contains the Ranger services to be exported. (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 exportRangerServicesCall(String clusterName, String serviceName, ApiRangerReplicationExportArgs 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}/replications/exportRangerServices"
            .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 exportRangerServicesValidateBeforeCall(String clusterName, String serviceName, ApiRangerReplicationExportArgs 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 exportRangerServices(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling exportRangerServices(Async)");
        }

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

    }

    /**
     * Exports the given Ranger services and policies (defined in the API body) to a zipped file.
     * Exports the given Ranger services and policies (defined in the API body) to a zipped file.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body the arguments for the export operation.
Contains the Ranger services to be exported. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand exportRangerServices(String clusterName, String serviceName, ApiRangerReplicationExportArgs body) throws ApiException {
        ApiResponse<ApiCommand> resp = exportRangerServicesWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Exports the given Ranger services and policies (defined in the API body) to a zipped file.
     * Exports the given Ranger services and policies (defined in the API body) to a zipped file.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body the arguments for the export operation.
Contains the Ranger services to be exported. (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> exportRangerServicesWithHttpInfo(String clusterName, String serviceName, ApiRangerReplicationExportArgs body) throws ApiException {
        okhttp3.Call call = exportRangerServicesValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Exports the given Ranger services and policies (defined in the API body) to a zipped file. (asynchronously)
     * Exports the given Ranger services and policies (defined in the API body) to a zipped file.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body the arguments for the export operation.
Contains the Ranger services to be exported. (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 exportRangerServicesAsync(String clusterName, String serviceName, ApiRangerReplicationExportArgs 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 = exportRangerServicesValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for fetchHBaseColumnFamilies
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Names of tables to query for column families. (optional)
     * @param whereReplicationSet Whether to retrieve column families of only those tables where there is at least one column family with replication scope set to 1. (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 fetchHBaseColumnFamiliesCall(String clusterName, String serviceName, ApiHBaseTableNames body, Boolean whereReplicationSet, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/replications/operations/fetchColumnFamilies"
            .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 (whereReplicationSet != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("whereReplicationSet", whereReplicationSet));

        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 fetchHBaseColumnFamiliesValidateBeforeCall(String clusterName, String serviceName, ApiHBaseTableNames body, Boolean whereReplicationSet, 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 fetchHBaseColumnFamilies(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling fetchHBaseColumnFamilies(Async)");
        }

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

    }

    /**
     * Starts a command that fetches column families for the desired tables.
     * Starts a command that fetches column families for the desired tables.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Names of tables to query for column families. (optional)
     * @param whereReplicationSet Whether to retrieve column families of only those tables where there is at least one column family with replication scope set to 1. (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 fetchHBaseColumnFamilies(String clusterName, String serviceName, ApiHBaseTableNames body, Boolean whereReplicationSet) throws ApiException {
        ApiResponse<ApiCommand> resp = fetchHBaseColumnFamiliesWithHttpInfo(clusterName, serviceName, body, whereReplicationSet);
        return resp.getData();
    }

    /**
     * Starts a command that fetches column families for the desired tables.
     * Starts a command that fetches column families for the desired tables.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Names of tables to query for column families. (optional)
     * @param whereReplicationSet Whether to retrieve column families of only those tables where there is at least one column family with replication scope set to 1. (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> fetchHBaseColumnFamiliesWithHttpInfo(String clusterName, String serviceName, ApiHBaseTableNames body, Boolean whereReplicationSet) throws ApiException {
        okhttp3.Call call = fetchHBaseColumnFamiliesValidateBeforeCall(clusterName, serviceName, body, whereReplicationSet, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Starts a command that fetches column families for the desired tables. (asynchronously)
     * Starts a command that fetches column families for the desired tables.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Names of tables to query for column families. (optional)
     * @param whereReplicationSet Whether to retrieve column families of only those tables where there is at least one column family with replication scope set to 1. (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 fetchHBaseColumnFamiliesAsync(String clusterName, String serviceName, ApiHBaseTableNames body, Boolean whereReplicationSet, 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 = fetchHBaseColumnFamiliesValidateBeforeCall(clusterName, serviceName, body, whereReplicationSet, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for fetchHBasePeerInfo
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body ID of the fetched 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 fetchHBasePeerInfoCall(String clusterName, String serviceName, ApiHBasePeerId 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}/replications/operations/fetchHBasePeerInfo"
            .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 fetchHBasePeerInfoValidateBeforeCall(String clusterName, String serviceName, ApiHBasePeerId 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 fetchHBasePeerInfo(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling fetchHBasePeerInfo(Async)");
        }

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

    }

    /**
     * Starts a command that fetches information about an HBase peer by its ID.
     * Starts a command that fetches information about an HBase peer by its ID.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body ID of the fetched peer. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand fetchHBasePeerInfo(String clusterName, String serviceName, ApiHBasePeerId body) throws ApiException {
        ApiResponse<ApiCommand> resp = fetchHBasePeerInfoWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Starts a command that fetches information about an HBase peer by its ID.
     * Starts a command that fetches information about an HBase peer by its ID.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body ID of the fetched 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> fetchHBasePeerInfoWithHttpInfo(String clusterName, String serviceName, ApiHBasePeerId body) throws ApiException {
        okhttp3.Call call = fetchHBasePeerInfoValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Starts a command that fetches information about an HBase peer by its ID. (asynchronously)
     * Starts a command that fetches information about an HBase peer by its ID.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body ID of the fetched 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 fetchHBasePeerInfoAsync(String clusterName, String serviceName, ApiHBasePeerId 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 = fetchHBasePeerInfoValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for forceDeleteSchedule
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (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 forceDeleteScheduleCall(String clusterName, java.math.BigDecimal scheduleId, 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}/replications/{scheduleId}/forcedDelete"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "scheduleId" + "\\}", apiClient.escapeString(scheduleId.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 forceDeleteScheduleValidateBeforeCall(String clusterName, java.math.BigDecimal scheduleId, 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 forceDeleteSchedule(Async)");
        }
        // verify the required parameter 'scheduleId' is set
        if (scheduleId == null) {
            throw new ApiException("Missing the required parameter 'scheduleId' when calling forceDeleteSchedule(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling forceDeleteSchedule(Async)");
        }

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

    }

    /**
     * Deletes an existing replication schedule only from the DB.
     * Deletes an existing replication schedule only from the DB. &lt;p&gt; Only the DB schedule reference is deleted with no further cleanup on the source or target side. Typically this endpoint can be used when the source cluster is not available any more and normal policy delete fails during cleanup.  Available since API v46. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (required)
     * @param serviceName The service name. (required)
     * @return ApiReplicationSchedule
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiReplicationSchedule forceDeleteSchedule(String clusterName, java.math.BigDecimal scheduleId, String serviceName) throws ApiException {
        ApiResponse<ApiReplicationSchedule> resp = forceDeleteScheduleWithHttpInfo(clusterName, scheduleId, serviceName);
        return resp.getData();
    }

    /**
     * Deletes an existing replication schedule only from the DB.
     * Deletes an existing replication schedule only from the DB. &lt;p&gt; Only the DB schedule reference is deleted with no further cleanup on the source or target side. Typically this endpoint can be used when the source cluster is not available any more and normal policy delete fails during cleanup.  Available since API v46. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (required)
     * @param serviceName The service name. (required)
     * @return ApiResponse&lt;ApiReplicationSchedule&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiReplicationSchedule> forceDeleteScheduleWithHttpInfo(String clusterName, java.math.BigDecimal scheduleId, String serviceName) throws ApiException {
        okhttp3.Call call = forceDeleteScheduleValidateBeforeCall(clusterName, scheduleId, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiReplicationSchedule>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Deletes an existing replication schedule only from the DB. (asynchronously)
     * Deletes an existing replication schedule only from the DB. &lt;p&gt; Only the DB schedule reference is deleted with no further cleanup on the source or target side. Typically this endpoint can be used when the source cluster is not available any more and normal policy delete fails during cleanup.  Available since API v46. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (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 forceDeleteScheduleAsync(String clusterName, java.math.BigDecimal scheduleId, String serviceName, final ApiCallback<ApiReplicationSchedule> 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 = forceDeleteScheduleValidateBeforeCall(clusterName, scheduleId, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiReplicationSchedule>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for generateCloudReplCredstorePassword
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param passwordGenerateMode the CloudReplPasswordGenerateMode to be used for regenerating the password. (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 generateCloudReplCredstorePasswordCall(String clusterName, String serviceName, String passwordGenerateMode, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/replications/generateCloudReplCredstorePassword"
            .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 (passwordGenerateMode != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("passwordGenerateMode", passwordGenerateMode));

        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 generateCloudReplCredstorePasswordValidateBeforeCall(String clusterName, String serviceName, String passwordGenerateMode, 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 generateCloudReplCredstorePassword(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling generateCloudReplCredstorePassword(Async)");
        }

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

    }

    /**
     * (Re)generates the cloud credential provider password, used by the given service, for replicating to the cloud.
     * (Re)generates the cloud credential provider password, used by the given service, for replicating to the cloud. &lt;br/&gt; Calling this API endpoint may cause staleness for the given service. &lt;br/&gt; NOTE: If this API endpoint REGENERATED the credstore password successfully and there are existing credstore provider jceks files on HDFS, protected by this password, then these jceks files should be recreated by using the following API endpoint: #recreateCloudCredstoresOnHdfs().
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param passwordGenerateMode the CloudReplPasswordGenerateMode to be used for regenerating the password. (optional)
     * @return Boolean
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public Boolean generateCloudReplCredstorePassword(String clusterName, String serviceName, String passwordGenerateMode) throws ApiException {
        ApiResponse<Boolean> resp = generateCloudReplCredstorePasswordWithHttpInfo(clusterName, serviceName, passwordGenerateMode);
        return resp.getData();
    }

    /**
     * (Re)generates the cloud credential provider password, used by the given service, for replicating to the cloud.
     * (Re)generates the cloud credential provider password, used by the given service, for replicating to the cloud. &lt;br/&gt; Calling this API endpoint may cause staleness for the given service. &lt;br/&gt; NOTE: If this API endpoint REGENERATED the credstore password successfully and there are existing credstore provider jceks files on HDFS, protected by this password, then these jceks files should be recreated by using the following API endpoint: #recreateCloudCredstoresOnHdfs().
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param passwordGenerateMode the CloudReplPasswordGenerateMode to be used for regenerating the password. (optional)
     * @return ApiResponse&lt;Boolean&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Boolean> generateCloudReplCredstorePasswordWithHttpInfo(String clusterName, String serviceName, String passwordGenerateMode) throws ApiException {
        okhttp3.Call call = generateCloudReplCredstorePasswordValidateBeforeCall(clusterName, serviceName, passwordGenerateMode, null, null);
        Type localVarReturnType = new TypeToken<Boolean>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * (Re)generates the cloud credential provider password, used by the given service, for replicating to the cloud. (asynchronously)
     * (Re)generates the cloud credential provider password, used by the given service, for replicating to the cloud. &lt;br/&gt; Calling this API endpoint may cause staleness for the given service. &lt;br/&gt; NOTE: If this API endpoint REGENERATED the credstore password successfully and there are existing credstore provider jceks files on HDFS, protected by this password, then these jceks files should be recreated by using the following API endpoint: #recreateCloudCredstoresOnHdfs().
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param passwordGenerateMode the CloudReplPasswordGenerateMode to be used for regenerating the password. (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 generateCloudReplCredstorePasswordAsync(String clusterName, String serviceName, String passwordGenerateMode, final ApiCallback<Boolean> 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 = generateCloudReplCredstorePasswordValidateBeforeCall(clusterName, serviceName, passwordGenerateMode, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<Boolean>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getReplicationState
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param view view to materialize (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 getReplicationStateCall(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}/replications/replicationState"
            .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 getReplicationStateValidateBeforeCall(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 getReplicationState(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling getReplicationState(Async)");
        }

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

    }

    /**
     * returns the replication state.
     * returns the replication state. for example if incremental export is enabled, etc
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param view view to materialize (optional, default to summary)
     * @return ApiReplicationState
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiReplicationState getReplicationState(String clusterName, String serviceName, String view) throws ApiException {
        ApiResponse<ApiReplicationState> resp = getReplicationStateWithHttpInfo(clusterName, serviceName, view);
        return resp.getData();
    }

    /**
     * returns the replication state.
     * returns the replication state. for example if incremental export is enabled, etc
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param view view to materialize (optional, default to summary)
     * @return ApiResponse&lt;ApiReplicationState&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiReplicationState> getReplicationStateWithHttpInfo(String clusterName, String serviceName, String view) throws ApiException {
        okhttp3.Call call = getReplicationStateValidateBeforeCall(clusterName, serviceName, view, null, null);
        Type localVarReturnType = new TypeToken<ApiReplicationState>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * returns the replication state. (asynchronously)
     * returns the replication state. for example if incremental export is enabled, etc
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param view view to materialize (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 getReplicationStateAsync(String clusterName, String serviceName, String view, final ApiCallback<ApiReplicationState> 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 = getReplicationStateValidateBeforeCall(clusterName, serviceName, view, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiReplicationState>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for isHive3ReverseDirectionEnabled
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param clusterUuidOnRemote the uuid of the cluster on the remote CM server (optional)
     * @param serviceNameOnRemote the Hive3 service name on the remote CM server, more specifically on the cluster specified by clusterUuidOnRemote (optional)
     * @param sourceDbNameOnRemote the name of the source database on the remote CM server (optional)
     * @param targetDbNameOnRemote the name of the target database on the remote CM server (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 isHive3ReverseDirectionEnabledCall(String clusterName, String serviceName, String clusterUuidOnRemote, String serviceNameOnRemote, String sourceDbNameOnRemote, String targetDbNameOnRemote, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/replications/isHive3ReverseDirectionEnabled"
            .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 (clusterUuidOnRemote != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("clusterUuidOnRemote", clusterUuidOnRemote));
        if (serviceNameOnRemote != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("serviceNameOnRemote", serviceNameOnRemote));
        if (sourceDbNameOnRemote != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("sourceDbNameOnRemote", sourceDbNameOnRemote));
        if (targetDbNameOnRemote != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("targetDbNameOnRemote", targetDbNameOnRemote));

        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 isHive3ReverseDirectionEnabledValidateBeforeCall(String clusterName, String serviceName, String clusterUuidOnRemote, String serviceNameOnRemote, String sourceDbNameOnRemote, String targetDbNameOnRemote, 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 isHive3ReverseDirectionEnabled(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling isHive3ReverseDirectionEnabled(Async)");
        }

        okhttp3.Call call = isHive3ReverseDirectionEnabledCall(clusterName, serviceName, clusterUuidOnRemote, serviceNameOnRemote, sourceDbNameOnRemote, targetDbNameOnRemote, progressListener, progressRequestListener);
        return call;

    }

    /**
     * This API endpoint checks if there is an ENABLED Hive3 replication policy on this server that replicates for the reverse direction.
     * This API endpoint checks if there is an ENABLED Hive3 replication policy on this server that replicates for the reverse direction. Bidirectional Hive3 replication policies are allowed, but only one direction can be ENABLED at the same time.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param clusterUuidOnRemote the uuid of the cluster on the remote CM server (optional)
     * @param serviceNameOnRemote the Hive3 service name on the remote CM server, more specifically on the cluster specified by clusterUuidOnRemote (optional)
     * @param sourceDbNameOnRemote the name of the source database on the remote CM server (optional)
     * @param targetDbNameOnRemote the name of the target database on the remote CM server (optional)
     * @return Boolean
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public Boolean isHive3ReverseDirectionEnabled(String clusterName, String serviceName, String clusterUuidOnRemote, String serviceNameOnRemote, String sourceDbNameOnRemote, String targetDbNameOnRemote) throws ApiException {
        ApiResponse<Boolean> resp = isHive3ReverseDirectionEnabledWithHttpInfo(clusterName, serviceName, clusterUuidOnRemote, serviceNameOnRemote, sourceDbNameOnRemote, targetDbNameOnRemote);
        return resp.getData();
    }

    /**
     * This API endpoint checks if there is an ENABLED Hive3 replication policy on this server that replicates for the reverse direction.
     * This API endpoint checks if there is an ENABLED Hive3 replication policy on this server that replicates for the reverse direction. Bidirectional Hive3 replication policies are allowed, but only one direction can be ENABLED at the same time.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param clusterUuidOnRemote the uuid of the cluster on the remote CM server (optional)
     * @param serviceNameOnRemote the Hive3 service name on the remote CM server, more specifically on the cluster specified by clusterUuidOnRemote (optional)
     * @param sourceDbNameOnRemote the name of the source database on the remote CM server (optional)
     * @param targetDbNameOnRemote the name of the target database on the remote CM server (optional)
     * @return ApiResponse&lt;Boolean&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Boolean> isHive3ReverseDirectionEnabledWithHttpInfo(String clusterName, String serviceName, String clusterUuidOnRemote, String serviceNameOnRemote, String sourceDbNameOnRemote, String targetDbNameOnRemote) throws ApiException {
        okhttp3.Call call = isHive3ReverseDirectionEnabledValidateBeforeCall(clusterName, serviceName, clusterUuidOnRemote, serviceNameOnRemote, sourceDbNameOnRemote, targetDbNameOnRemote, null, null);
        Type localVarReturnType = new TypeToken<Boolean>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * This API endpoint checks if there is an ENABLED Hive3 replication policy on this server that replicates for the reverse direction. (asynchronously)
     * This API endpoint checks if there is an ENABLED Hive3 replication policy on this server that replicates for the reverse direction. Bidirectional Hive3 replication policies are allowed, but only one direction can be ENABLED at the same time.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param clusterUuidOnRemote the uuid of the cluster on the remote CM server (optional)
     * @param serviceNameOnRemote the Hive3 service name on the remote CM server, more specifically on the cluster specified by clusterUuidOnRemote (optional)
     * @param sourceDbNameOnRemote the name of the source database on the remote CM server (optional)
     * @param targetDbNameOnRemote the name of the target database on the remote CM server (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 isHive3ReverseDirectionEnabledAsync(String clusterName, String serviceName, String clusterUuidOnRemote, String serviceNameOnRemote, String sourceDbNameOnRemote, String targetDbNameOnRemote, final ApiCallback<Boolean> 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 = isHive3ReverseDirectionEnabledValidateBeforeCall(clusterName, serviceName, clusterUuidOnRemote, serviceNameOnRemote, sourceDbNameOnRemote, targetDbNameOnRemote, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<Boolean>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for listHBaseNamespaces
     * @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 listHBaseNamespacesCall(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}/replications/operations/listNamespaces"
            .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 listHBaseNamespacesValidateBeforeCall(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 listHBaseNamespaces(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling listHBaseNamespaces(Async)");
        }

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

    }

    /**
     * Starts a command that lists all namespaces in HBase.
     * Starts a command that lists all namespaces in HBase.
     * @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 listHBaseNamespaces(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = listHBaseNamespacesWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Starts a command that lists all namespaces in HBase.
     * Starts a command that lists all namespaces in HBase.
     * @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> listHBaseNamespacesWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = listHBaseNamespacesValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Starts a command that lists all namespaces in HBase. (asynchronously)
     * Starts a command that lists all namespaces in HBase.
     * @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 listHBaseNamespacesAsync(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 = listHBaseNamespacesValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for listHBasePeers
     * @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 listHBasePeersCall(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}/replications/operations/listPeers"
            .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 listHBasePeersValidateBeforeCall(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 listHBasePeers(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling listHBasePeers(Async)");
        }

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

    }

    /**
     * Starts a command that retrieves all peers registered in the HBase service.
     * Starts a command that retrieves all peers registered in the HBase service.
     * @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 listHBasePeers(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = listHBasePeersWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Starts a command that retrieves all peers registered in the HBase service.
     * Starts a command that retrieves all peers registered in the HBase service.
     * @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> listHBasePeersWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = listHBasePeersValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Starts a command that retrieves all peers registered in the HBase service. (asynchronously)
     * Starts a command that retrieves all peers registered in the HBase service.
     * @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 listHBasePeersAsync(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 = listHBasePeersValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for listHBaseTables
     * @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 listHBaseTablesCall(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}/replications/operations/listTables"
            .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 listHBaseTablesValidateBeforeCall(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 listHBaseTables(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling listHBaseTables(Async)");
        }

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

    }

    /**
     * Starts a command that lists tables from the HBase service.
     * Starts a command that lists tables from the HBase service.
     * @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 listHBaseTables(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = listHBaseTablesWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Starts a command that lists tables from the HBase service.
     * Starts a command that lists tables from the HBase service.
     * @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> listHBaseTablesWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = listHBaseTablesValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Starts a command that lists tables from the HBase service. (asynchronously)
     * Starts a command that lists tables from the HBase service.
     * @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 listHBaseTablesAsync(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 = listHBaseTablesValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for postCopyReconciliation
     * @param clusterName  (required)
     * @param scheduleId  (required)
     * @param serviceName The service name. (required)
     * @param pcrEnableCrcCheck  (optional, default to true)
     * @param pcrEnableLengthCheck  (optional, default to true)
     * @param pcrEnableModtimeCheck  (optional, default to true)
     * @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 postCopyReconciliationCall(String clusterName, java.math.BigDecimal scheduleId, String serviceName, Boolean pcrEnableCrcCheck, Boolean pcrEnableLengthCheck, Boolean pcrEnableModtimeCheck, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        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 postCopyReconciliationValidateBeforeCall(String clusterName, java.math.BigDecimal scheduleId, String serviceName, Boolean pcrEnableCrcCheck, Boolean pcrEnableLengthCheck, Boolean pcrEnableModtimeCheck, 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 postCopyReconciliation(Async)");
        }
        // verify the required parameter 'scheduleId' is set
        if (scheduleId == null) {
            throw new ApiException("Missing the required parameter 'scheduleId' when calling postCopyReconciliation(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling postCopyReconciliation(Async)");
        }

        okhttp3.Call call = postCopyReconciliationCall(clusterName, scheduleId, serviceName, pcrEnableCrcCheck, pcrEnableLengthCheck, pcrEnableModtimeCheck, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Starts a command that executes PostCopyReconciliation steps on a schedule.
     * Starts a command that executes PostCopyReconciliation steps on a schedule.
     * @param clusterName  (required)
     * @param scheduleId  (required)
     * @param serviceName The service name. (required)
     * @param pcrEnableCrcCheck  (optional, default to true)
     * @param pcrEnableLengthCheck  (optional, default to true)
     * @param pcrEnableModtimeCheck  (optional, default to true)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand postCopyReconciliation(String clusterName, java.math.BigDecimal scheduleId, String serviceName, Boolean pcrEnableCrcCheck, Boolean pcrEnableLengthCheck, Boolean pcrEnableModtimeCheck) throws ApiException {
        ApiResponse<ApiCommand> resp = postCopyReconciliationWithHttpInfo(clusterName, scheduleId, serviceName, pcrEnableCrcCheck, pcrEnableLengthCheck, pcrEnableModtimeCheck);
        return resp.getData();
    }

    /**
     * Starts a command that executes PostCopyReconciliation steps on a schedule.
     * Starts a command that executes PostCopyReconciliation steps on a schedule.
     * @param clusterName  (required)
     * @param scheduleId  (required)
     * @param serviceName The service name. (required)
     * @param pcrEnableCrcCheck  (optional, default to true)
     * @param pcrEnableLengthCheck  (optional, default to true)
     * @param pcrEnableModtimeCheck  (optional, default to true)
     * @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> postCopyReconciliationWithHttpInfo(String clusterName, java.math.BigDecimal scheduleId, String serviceName, Boolean pcrEnableCrcCheck, Boolean pcrEnableLengthCheck, Boolean pcrEnableModtimeCheck) throws ApiException {
        okhttp3.Call call = postCopyReconciliationValidateBeforeCall(clusterName, scheduleId, serviceName, pcrEnableCrcCheck, pcrEnableLengthCheck, pcrEnableModtimeCheck, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Starts a command that executes PostCopyReconciliation steps on a schedule. (asynchronously)
     * Starts a command that executes PostCopyReconciliation steps on a schedule.
     * @param clusterName  (required)
     * @param scheduleId  (required)
     * @param serviceName The service name. (required)
     * @param pcrEnableCrcCheck  (optional, default to true)
     * @param pcrEnableLengthCheck  (optional, default to true)
     * @param pcrEnableModtimeCheck  (optional, default to true)
     * @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 postCopyReconciliationAsync(String clusterName, java.math.BigDecimal scheduleId, String serviceName, Boolean pcrEnableCrcCheck, Boolean pcrEnableLengthCheck, Boolean pcrEnableModtimeCheck, 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 = postCopyReconciliationValidateBeforeCall(clusterName, scheduleId, serviceName, pcrEnableCrcCheck, pcrEnableLengthCheck, pcrEnableModtimeCheck, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for readHistory
     * @param clusterName  (required)
     * @param scheduleId ID of an existing replication schedule. (required)
     * @param serviceName The service name. (required)
     * @param limit Maximum number of commands to retrieve. Optional, default value is 20. (optional, default to 20)
     * @param offset Index of first command to retrieve. Optional, default value is 0. (optional, default to 0)
     * @param sort The list of fields to order by. The value passed should be in the format of orderBy&#x3D;field1:asc,field2:desc, where field1 will have the highest precedence. For every field provided, asc or  also has to be provided. This param is optional, default behaviour is descending ordering by start time. (optional)
     * @param status Desired status of retrieved commands. Optional, default behaviour is not applying any filtering, and returning all commands. Check ApiReplicationHistoryItemStatus for possible values. (optional)
     * @param view The view to materialize. Optional, default is summary. (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 readHistoryCall(String clusterName, java.math.BigDecimal scheduleId, String serviceName, java.math.BigDecimal limit, java.math.BigDecimal offset, String sort, String status, 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}/replications/{scheduleId}/history"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "scheduleId" + "\\}", apiClient.escapeString(scheduleId.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));
        if (sort != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort));
        if (status != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("status", status));
        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 readHistoryValidateBeforeCall(String clusterName, java.math.BigDecimal scheduleId, String serviceName, java.math.BigDecimal limit, java.math.BigDecimal offset, String sort, String status, 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 readHistory(Async)");
        }
        // verify the required parameter 'scheduleId' is set
        if (scheduleId == null) {
            throw new ApiException("Missing the required parameter 'scheduleId' when calling readHistory(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling readHistory(Async)");
        }

        okhttp3.Call call = readHistoryCall(clusterName, scheduleId, serviceName, limit, offset, sort, status, view, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Returns a list of commands triggered by a schedule.
     * Returns a list of commands triggered by a schedule.
     * @param clusterName  (required)
     * @param scheduleId ID of an existing replication schedule. (required)
     * @param serviceName The service name. (required)
     * @param limit Maximum number of commands to retrieve. Optional, default value is 20. (optional, default to 20)
     * @param offset Index of first command to retrieve. Optional, default value is 0. (optional, default to 0)
     * @param sort The list of fields to order by. The value passed should be in the format of orderBy&#x3D;field1:asc,field2:desc, where field1 will have the highest precedence. For every field provided, asc or  also has to be provided. This param is optional, default behaviour is descending ordering by start time. (optional)
     * @param status Desired status of retrieved commands. Optional, default behaviour is not applying any filtering, and returning all commands. Check ApiReplicationHistoryItemStatus for possible values. (optional)
     * @param view The view to materialize. Optional, default is summary. (optional, default to summary)
     * @return ApiReplicationCommandList
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiReplicationCommandList readHistory(String clusterName, java.math.BigDecimal scheduleId, String serviceName, java.math.BigDecimal limit, java.math.BigDecimal offset, String sort, String status, String view) throws ApiException {
        ApiResponse<ApiReplicationCommandList> resp = readHistoryWithHttpInfo(clusterName, scheduleId, serviceName, limit, offset, sort, status, view);
        return resp.getData();
    }

    /**
     * Returns a list of commands triggered by a schedule.
     * Returns a list of commands triggered by a schedule.
     * @param clusterName  (required)
     * @param scheduleId ID of an existing replication schedule. (required)
     * @param serviceName The service name. (required)
     * @param limit Maximum number of commands to retrieve. Optional, default value is 20. (optional, default to 20)
     * @param offset Index of first command to retrieve. Optional, default value is 0. (optional, default to 0)
     * @param sort The list of fields to order by. The value passed should be in the format of orderBy&#x3D;field1:asc,field2:desc, where field1 will have the highest precedence. For every field provided, asc or  also has to be provided. This param is optional, default behaviour is descending ordering by start time. (optional)
     * @param status Desired status of retrieved commands. Optional, default behaviour is not applying any filtering, and returning all commands. Check ApiReplicationHistoryItemStatus for possible values. (optional)
     * @param view The view to materialize. Optional, default is summary. (optional, default to summary)
     * @return ApiResponse&lt;ApiReplicationCommandList&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiReplicationCommandList> readHistoryWithHttpInfo(String clusterName, java.math.BigDecimal scheduleId, String serviceName, java.math.BigDecimal limit, java.math.BigDecimal offset, String sort, String status, String view) throws ApiException {
        okhttp3.Call call = readHistoryValidateBeforeCall(clusterName, scheduleId, serviceName, limit, offset, sort, status, view, null, null);
        Type localVarReturnType = new TypeToken<ApiReplicationCommandList>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns a list of commands triggered by a schedule. (asynchronously)
     * Returns a list of commands triggered by a schedule.
     * @param clusterName  (required)
     * @param scheduleId ID of an existing replication schedule. (required)
     * @param serviceName The service name. (required)
     * @param limit Maximum number of commands to retrieve. Optional, default value is 20. (optional, default to 20)
     * @param offset Index of first command to retrieve. Optional, default value is 0. (optional, default to 0)
     * @param sort The list of fields to order by. The value passed should be in the format of orderBy&#x3D;field1:asc,field2:desc, where field1 will have the highest precedence. For every field provided, asc or  also has to be provided. This param is optional, default behaviour is descending ordering by start time. (optional)
     * @param status Desired status of retrieved commands. Optional, default behaviour is not applying any filtering, and returning all commands. Check ApiReplicationHistoryItemStatus for possible values. (optional)
     * @param view The view to materialize. Optional, default is summary. (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 readHistoryAsync(String clusterName, java.math.BigDecimal scheduleId, String serviceName, java.math.BigDecimal limit, java.math.BigDecimal offset, String sort, String status, String view, final ApiCallback<ApiReplicationCommandList> 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 = readHistoryValidateBeforeCall(clusterName, scheduleId, serviceName, limit, offset, sort, status, view, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiReplicationCommandList>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for readSchedule
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (required)
     * @param serviceName The service name. (required)
     * @param view The view to materialize. (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 readScheduleCall(String clusterName, java.math.BigDecimal scheduleId, 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}/replications/{scheduleId}"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "scheduleId" + "\\}", apiClient.escapeString(scheduleId.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 readScheduleValidateBeforeCall(String clusterName, java.math.BigDecimal scheduleId, 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 readSchedule(Async)");
        }
        // verify the required parameter 'scheduleId' is set
        if (scheduleId == null) {
            throw new ApiException("Missing the required parameter 'scheduleId' when calling readSchedule(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling readSchedule(Async)");
        }

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

    }

    /**
     * Returns information for a specific replication schedule.
     * Returns information for a specific replication schedule. &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (required)
     * @param serviceName The service name. (required)
     * @param view The view to materialize. (optional, default to summary)
     * @return ApiReplicationSchedule
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiReplicationSchedule readSchedule(String clusterName, java.math.BigDecimal scheduleId, String serviceName, String view) throws ApiException {
        ApiResponse<ApiReplicationSchedule> resp = readScheduleWithHttpInfo(clusterName, scheduleId, serviceName, view);
        return resp.getData();
    }

    /**
     * Returns information for a specific replication schedule.
     * Returns information for a specific replication schedule. &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (required)
     * @param serviceName The service name. (required)
     * @param view The view to materialize. (optional, default to summary)
     * @return ApiResponse&lt;ApiReplicationSchedule&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiReplicationSchedule> readScheduleWithHttpInfo(String clusterName, java.math.BigDecimal scheduleId, String serviceName, String view) throws ApiException {
        okhttp3.Call call = readScheduleValidateBeforeCall(clusterName, scheduleId, serviceName, view, null, null);
        Type localVarReturnType = new TypeToken<ApiReplicationSchedule>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns information for a specific replication schedule. (asynchronously)
     * Returns information for a specific replication schedule. &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (required)
     * @param serviceName The service name. (required)
     * @param view The view to materialize. (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 readScheduleAsync(String clusterName, java.math.BigDecimal scheduleId, String serviceName, String view, final ApiCallback<ApiReplicationSchedule> 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 = readScheduleValidateBeforeCall(clusterName, scheduleId, serviceName, view, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiReplicationSchedule>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for readSchedules
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param maxCommands Maximum number of commands to include in the history of replication schedules. By default, it has no limit. Pass 0 to explicitly set to unlimited. (optional, default to 0)
     * @param maxErrors Maximum number of errors per Hive replication command. By default, it has no limit. Pass 0 to explicitly set to unlimited. (optional, default to 0)
     * @param maxSchedules Maximum number of replication schedules to be included in the response. By default, it has no limit. Pass 0 to explicitly set to unlimited. (optional, default to 0)
     * @param maxTables Maximum number of tables per Hive replication command. By default, it has no limit. Pass 0 to explicitly set to unlimited. (optional, default to 0)
     * @param view The view to materialize. (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 readSchedulesCall(String clusterName, String serviceName, java.math.BigDecimal maxCommands, java.math.BigDecimal maxErrors, java.math.BigDecimal maxSchedules, java.math.BigDecimal maxTables, 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}/replications"
            .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 (maxCommands != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("maxCommands", maxCommands));
        if (maxErrors != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("maxErrors", maxErrors));
        if (maxSchedules != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("maxSchedules", maxSchedules));
        if (maxTables != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("maxTables", maxTables));
        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 readSchedulesValidateBeforeCall(String clusterName, String serviceName, java.math.BigDecimal maxCommands, java.math.BigDecimal maxErrors, java.math.BigDecimal maxSchedules, java.math.BigDecimal maxTables, 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 readSchedules(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling readSchedules(Async)");
        }

        okhttp3.Call call = readSchedulesCall(clusterName, serviceName, maxCommands, maxErrors, maxSchedules, maxTables, view, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Retrieves information about replication schedules.
     * Retrieves information about replication schedules.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param maxCommands Maximum number of commands to include in the history of replication schedules. By default, it has no limit. Pass 0 to explicitly set to unlimited. (optional, default to 0)
     * @param maxErrors Maximum number of errors per Hive replication command. By default, it has no limit. Pass 0 to explicitly set to unlimited. (optional, default to 0)
     * @param maxSchedules Maximum number of replication schedules to be included in the response. By default, it has no limit. Pass 0 to explicitly set to unlimited. (optional, default to 0)
     * @param maxTables Maximum number of tables per Hive replication command. By default, it has no limit. Pass 0 to explicitly set to unlimited. (optional, default to 0)
     * @param view The view to materialize. (optional, default to summary)
     * @return ApiReplicationScheduleList
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiReplicationScheduleList readSchedules(String clusterName, String serviceName, java.math.BigDecimal maxCommands, java.math.BigDecimal maxErrors, java.math.BigDecimal maxSchedules, java.math.BigDecimal maxTables, String view) throws ApiException {
        ApiResponse<ApiReplicationScheduleList> resp = readSchedulesWithHttpInfo(clusterName, serviceName, maxCommands, maxErrors, maxSchedules, maxTables, view);
        return resp.getData();
    }

    /**
     * Retrieves information about replication schedules.
     * Retrieves information about replication schedules.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param maxCommands Maximum number of commands to include in the history of replication schedules. By default, it has no limit. Pass 0 to explicitly set to unlimited. (optional, default to 0)
     * @param maxErrors Maximum number of errors per Hive replication command. By default, it has no limit. Pass 0 to explicitly set to unlimited. (optional, default to 0)
     * @param maxSchedules Maximum number of replication schedules to be included in the response. By default, it has no limit. Pass 0 to explicitly set to unlimited. (optional, default to 0)
     * @param maxTables Maximum number of tables per Hive replication command. By default, it has no limit. Pass 0 to explicitly set to unlimited. (optional, default to 0)
     * @param view The view to materialize. (optional, default to summary)
     * @return ApiResponse&lt;ApiReplicationScheduleList&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiReplicationScheduleList> readSchedulesWithHttpInfo(String clusterName, String serviceName, java.math.BigDecimal maxCommands, java.math.BigDecimal maxErrors, java.math.BigDecimal maxSchedules, java.math.BigDecimal maxTables, String view) throws ApiException {
        okhttp3.Call call = readSchedulesValidateBeforeCall(clusterName, serviceName, maxCommands, maxErrors, maxSchedules, maxTables, view, null, null);
        Type localVarReturnType = new TypeToken<ApiReplicationScheduleList>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Retrieves information about replication schedules. (asynchronously)
     * Retrieves information about replication schedules.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param maxCommands Maximum number of commands to include in the history of replication schedules. By default, it has no limit. Pass 0 to explicitly set to unlimited. (optional, default to 0)
     * @param maxErrors Maximum number of errors per Hive replication command. By default, it has no limit. Pass 0 to explicitly set to unlimited. (optional, default to 0)
     * @param maxSchedules Maximum number of replication schedules to be included in the response. By default, it has no limit. Pass 0 to explicitly set to unlimited. (optional, default to 0)
     * @param maxTables Maximum number of tables per Hive replication command. By default, it has no limit. Pass 0 to explicitly set to unlimited. (optional, default to 0)
     * @param view The view to materialize. (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 readSchedulesAsync(String clusterName, String serviceName, java.math.BigDecimal maxCommands, java.math.BigDecimal maxErrors, java.math.BigDecimal maxSchedules, java.math.BigDecimal maxTables, String view, final ApiCallback<ApiReplicationScheduleList> 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 = readSchedulesValidateBeforeCall(clusterName, serviceName, maxCommands, maxErrors, maxSchedules, maxTables, view, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiReplicationScheduleList>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for recreateCloudCredstoresOnHdfs
     * @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 recreateCloudCredstoresOnHdfsCall(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}/replications/recreateCloudCredstoresOnHdfs"
            .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 recreateCloudCredstoresOnHdfsValidateBeforeCall(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 recreateCloudCredstoresOnHdfs(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling recreateCloudCredstoresOnHdfs(Async)");
        }

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

    }

    /**
     * Recreates the existing credential provider jceks files on HDFS, that are used by the given service, for replicating to the cloud.
     * Recreates the existing credential provider jceks files on HDFS, that are used by the given service, for replicating to the cloud.
     * @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 recreateCloudCredstoresOnHdfs(String clusterName, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = recreateCloudCredstoresOnHdfsWithHttpInfo(clusterName, serviceName);
        return resp.getData();
    }

    /**
     * Recreates the existing credential provider jceks files on HDFS, that are used by the given service, for replicating to the cloud.
     * Recreates the existing credential provider jceks files on HDFS, that are used by the given service, for replicating to the cloud.
     * @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> recreateCloudCredstoresOnHdfsWithHttpInfo(String clusterName, String serviceName) throws ApiException {
        okhttp3.Call call = recreateCloudCredstoresOnHdfsValidateBeforeCall(clusterName, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Recreates the existing credential provider jceks files on HDFS, that are used by the given service, for replicating to the cloud. (asynchronously)
     * Recreates the existing credential provider jceks files on HDFS, that are used by the given service, for replicating to the cloud.
     * @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 recreateCloudCredstoresOnHdfsAsync(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 = recreateCloudCredstoresOnHdfsValidateBeforeCall(clusterName, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for removeHBasePeer
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body ID of the peer to be removed. (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 removeHBasePeerCall(String clusterName, String serviceName, ApiHBasePeerId 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}/replications/operations/removeHBasePeer"
            .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 removeHBasePeerValidateBeforeCall(String clusterName, String serviceName, ApiHBasePeerId 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 removeHBasePeer(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling removeHBasePeer(Async)");
        }

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

    }

    /**
     * Starts a command that removes the specified HBase replication peer from the local HBase service.
     * Starts a command that removes the specified HBase replication peer from the local HBase service.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body ID of the peer to be removed. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand removeHBasePeer(String clusterName, String serviceName, ApiHBasePeerId body) throws ApiException {
        ApiResponse<ApiCommand> resp = removeHBasePeerWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Starts a command that removes the specified HBase replication peer from the local HBase service.
     * Starts a command that removes the specified HBase replication peer from the local HBase service.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body ID of the peer to be removed. (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> removeHBasePeerWithHttpInfo(String clusterName, String serviceName, ApiHBasePeerId body) throws ApiException {
        okhttp3.Call call = removeHBasePeerValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Starts a command that removes the specified HBase replication peer from the local HBase service. (asynchronously)
     * Starts a command that removes the specified HBase replication peer from the local HBase service.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body ID of the peer to be removed. (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 removeHBasePeerAsync(String clusterName, String serviceName, ApiHBasePeerId 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 = removeHBasePeerValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for removeTablesFromHBasePeer
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Arguments for removing tables from HBase replication 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 removeTablesFromHBasePeerCall(String clusterName, String serviceName, ApiHBasePeerIdWithTableCFs 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}/replications/operations/removeTablesFromHBasePeer"
            .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 removeTablesFromHBasePeerValidateBeforeCall(String clusterName, String serviceName, ApiHBasePeerIdWithTableCFs 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 removeTablesFromHBasePeer(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling removeTablesFromHBasePeer(Async)");
        }

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

    }

    /**
     * Starts a command that removes tables and column families from an existing HBase replication peer.
     * Starts a command that removes tables and column families from an existing HBase replication peer.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Arguments for removing tables from HBase replication peer. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand removeTablesFromHBasePeer(String clusterName, String serviceName, ApiHBasePeerIdWithTableCFs body) throws ApiException {
        ApiResponse<ApiCommand> resp = removeTablesFromHBasePeerWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Starts a command that removes tables and column families from an existing HBase replication peer.
     * Starts a command that removes tables and column families from an existing HBase replication peer.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Arguments for removing tables from HBase replication 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> removeTablesFromHBasePeerWithHttpInfo(String clusterName, String serviceName, ApiHBasePeerIdWithTableCFs body) throws ApiException {
        okhttp3.Call call = removeTablesFromHBasePeerValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Starts a command that removes tables and column families from an existing HBase replication peer. (asynchronously)
     * Starts a command that removes tables and column families from an existing HBase replication peer.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Arguments for removing tables from HBase replication 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 removeTablesFromHBasePeerAsync(String clusterName, String serviceName, ApiHBasePeerIdWithTableCFs 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 = removeTablesFromHBasePeerValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for rescheduleHive3ReplicationMetricsGetter
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param nextStartMins  (optional, default to 5)
     * @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 rescheduleHive3ReplicationMetricsGetterCall(String clusterName, String serviceName, java.math.BigDecimal nextStartMins, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/replications/rescheduleHive3ReplicationMetricsGetter"
            .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 (nextStartMins != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("nextStartMins", nextStartMins));

        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 rescheduleHive3ReplicationMetricsGetterValidateBeforeCall(String clusterName, String serviceName, java.math.BigDecimal nextStartMins, 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 rescheduleHive3ReplicationMetricsGetter(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling rescheduleHive3ReplicationMetricsGetter(Async)");
        }

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

    }

    /**
     * Set the Hive3 Replication Metrics Getter next start time.
     * Set the Hive3 Replication Metrics Getter next start time. &lt;p&gt; (Re)set the Hive3 Replication Metrics Getter next start time. Should be only used if the Getter needs to be manually started. &lt;p&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param nextStartMins  (optional, default to 5)
     * @return Boolean
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public Boolean rescheduleHive3ReplicationMetricsGetter(String clusterName, String serviceName, java.math.BigDecimal nextStartMins) throws ApiException {
        ApiResponse<Boolean> resp = rescheduleHive3ReplicationMetricsGetterWithHttpInfo(clusterName, serviceName, nextStartMins);
        return resp.getData();
    }

    /**
     * Set the Hive3 Replication Metrics Getter next start time.
     * Set the Hive3 Replication Metrics Getter next start time. &lt;p&gt; (Re)set the Hive3 Replication Metrics Getter next start time. Should be only used if the Getter needs to be manually started. &lt;p&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param nextStartMins  (optional, default to 5)
     * @return ApiResponse&lt;Boolean&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Boolean> rescheduleHive3ReplicationMetricsGetterWithHttpInfo(String clusterName, String serviceName, java.math.BigDecimal nextStartMins) throws ApiException {
        okhttp3.Call call = rescheduleHive3ReplicationMetricsGetterValidateBeforeCall(clusterName, serviceName, nextStartMins, null, null);
        Type localVarReturnType = new TypeToken<Boolean>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Set the Hive3 Replication Metrics Getter next start time. (asynchronously)
     * Set the Hive3 Replication Metrics Getter next start time. &lt;p&gt; (Re)set the Hive3 Replication Metrics Getter next start time. Should be only used if the Getter needs to be manually started. &lt;p&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param nextStartMins  (optional, default to 5)
     * @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 rescheduleHive3ReplicationMetricsGetterAsync(String clusterName, String serviceName, java.math.BigDecimal nextStartMins, final ApiCallback<Boolean> 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 = rescheduleHive3ReplicationMetricsGetterValidateBeforeCall(clusterName, serviceName, nextStartMins, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<Boolean>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for retrySchedule
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (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 retryScheduleCall(String clusterName, java.math.BigDecimal scheduleId, 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}/replications/{scheduleId}/retry"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "scheduleId" + "\\}", apiClient.escapeString(scheduleId.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 retryScheduleValidateBeforeCall(String clusterName, java.math.BigDecimal scheduleId, 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 retrySchedule(Async)");
        }
        // verify the required parameter 'scheduleId' is set
        if (scheduleId == null) {
            throw new ApiException("Missing the required parameter 'scheduleId' when calling retrySchedule(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling retrySchedule(Async)");
        }

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

    }

    /**
     * Retry the last command of a failed replication schedule.
     * Retry the last command of a failed replication schedule. Similar to com.cloudera.api.v3.ReplicationsResource#runSchedule but only works if the last command failed.
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (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 retrySchedule(String clusterName, java.math.BigDecimal scheduleId, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = retryScheduleWithHttpInfo(clusterName, scheduleId, serviceName);
        return resp.getData();
    }

    /**
     * Retry the last command of a failed replication schedule.
     * Retry the last command of a failed replication schedule. Similar to com.cloudera.api.v3.ReplicationsResource#runSchedule but only works if the last command failed.
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (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> retryScheduleWithHttpInfo(String clusterName, java.math.BigDecimal scheduleId, String serviceName) throws ApiException {
        okhttp3.Call call = retryScheduleValidateBeforeCall(clusterName, scheduleId, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Retry the last command of a failed replication schedule. (asynchronously)
     * Retry the last command of a failed replication schedule. Similar to com.cloudera.api.v3.ReplicationsResource#runSchedule but only works if the last command failed.
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (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 retryScheduleAsync(String clusterName, java.math.BigDecimal scheduleId, 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 = retryScheduleValidateBeforeCall(clusterName, scheduleId, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for runCopyListing
     * @param clusterName  (required)
     * @param serviceName The service name. (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 runCopyListingCall(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}/replications/hdfsCopyListing"
            .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 runCopyListingValidateBeforeCall(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 runCopyListing(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling runCopyListing(Async)");
        }

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

    }

    /**
     * Run the hdfs copy listing command.
     * Run the hdfs copy listing command &lt;p&gt; The copy listing command will be triggered with the provided arguments &lt;p&gt; Available since API v18. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName The service name. (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 runCopyListing(String clusterName, String serviceName, String body) throws ApiException {
        ApiResponse<ApiCommand> resp = runCopyListingWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Run the hdfs copy listing command.
     * Run the hdfs copy listing command &lt;p&gt; The copy listing command will be triggered with the provided arguments &lt;p&gt; Available since API v18. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName The service name. (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> runCopyListingWithHttpInfo(String clusterName, String serviceName, String body) throws ApiException {
        okhttp3.Call call = runCopyListingValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Run the hdfs copy listing command. (asynchronously)
     * Run the hdfs copy listing command &lt;p&gt; The copy listing command will be triggered with the provided arguments &lt;p&gt; Available since API v18. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param serviceName The service name. (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 runCopyListingAsync(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 = runCopyListingValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for runHBaseReplicationRetryFailedSnapshots
     * @param clusterName  (required)
     * @param scheduleId The HBase schedule ID to retry on (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 runHBaseReplicationRetryFailedSnapshotsCall(String clusterName, java.math.BigDecimal scheduleId, 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}/replications/{scheduleId}/runHBaseReplicationRetryFailedSnapshots"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "scheduleId" + "\\}", apiClient.escapeString(scheduleId.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 runHBaseReplicationRetryFailedSnapshotsValidateBeforeCall(String clusterName, java.math.BigDecimal scheduleId, 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 runHBaseReplicationRetryFailedSnapshots(Async)");
        }
        // verify the required parameter 'scheduleId' is set
        if (scheduleId == null) {
            throw new ApiException("Missing the required parameter 'scheduleId' when calling runHBaseReplicationRetryFailedSnapshots(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling runHBaseReplicationRetryFailedSnapshots(Async)");
        }

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

    }

    /**
     * Executes a command to run a HBase replication retry on failed snapshots for the given schedule ID.
     * Executes a command to run a HBase replication retry on failed snapshots for the given schedule ID
     * @param clusterName  (required)
     * @param scheduleId The HBase schedule ID to retry on (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 runHBaseReplicationRetryFailedSnapshots(String clusterName, java.math.BigDecimal scheduleId, String serviceName) throws ApiException {
        ApiResponse<ApiCommand> resp = runHBaseReplicationRetryFailedSnapshotsWithHttpInfo(clusterName, scheduleId, serviceName);
        return resp.getData();
    }

    /**
     * Executes a command to run a HBase replication retry on failed snapshots for the given schedule ID.
     * Executes a command to run a HBase replication retry on failed snapshots for the given schedule ID
     * @param clusterName  (required)
     * @param scheduleId The HBase schedule ID to retry on (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> runHBaseReplicationRetryFailedSnapshotsWithHttpInfo(String clusterName, java.math.BigDecimal scheduleId, String serviceName) throws ApiException {
        okhttp3.Call call = runHBaseReplicationRetryFailedSnapshotsValidateBeforeCall(clusterName, scheduleId, serviceName, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Executes a command to run a HBase replication retry on failed snapshots for the given schedule ID. (asynchronously)
     * Executes a command to run a HBase replication retry on failed snapshots for the given schedule ID
     * @param clusterName  (required)
     * @param scheduleId The HBase schedule ID to retry on (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 runHBaseReplicationRetryFailedSnapshotsAsync(String clusterName, java.math.BigDecimal scheduleId, 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 = runHBaseReplicationRetryFailedSnapshotsValidateBeforeCall(clusterName, scheduleId, serviceName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for runHBaseReplicationSecurityTool
     * @param clusterName  (required)
     * @param serviceName The service name. (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 runHBaseReplicationSecurityToolCall(String clusterName, String serviceName, Map<String, 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}/replications/hbaseReplicationSecurityTool"
            .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 runHBaseReplicationSecurityToolValidateBeforeCall(String clusterName, String serviceName, Map<String, 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 runHBaseReplicationSecurityTool(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling runHBaseReplicationSecurityTool(Async)");
        }

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

    }

    /**
     * Run the hbase replication security tool.
     * Run the hbase replication security tool &lt;p&gt; The replication security tool is invoked against the provided arguments &lt;p&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (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 runHBaseReplicationSecurityTool(String clusterName, String serviceName, Map<String, String> body) throws ApiException {
        ApiResponse<ApiCommand> resp = runHBaseReplicationSecurityToolWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Run the hbase replication security tool.
     * Run the hbase replication security tool &lt;p&gt; The replication security tool is invoked against the provided arguments &lt;p&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (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> runHBaseReplicationSecurityToolWithHttpInfo(String clusterName, String serviceName, Map<String, String> body) throws ApiException {
        okhttp3.Call call = runHBaseReplicationSecurityToolValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Run the hbase replication security tool. (asynchronously)
     * Run the hbase replication security tool &lt;p&gt; The replication security tool is invoked against the provided arguments &lt;p&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (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 runHBaseReplicationSecurityToolAsync(String clusterName, String serviceName, Map<String, 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 = runHBaseReplicationSecurityToolValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for runHBaseReplicationValidationTool
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param hbasePeerId The HBase peer ID to be validated (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 runHBaseReplicationValidationToolCall(String clusterName, String serviceName, String hbasePeerId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/clusters/{clusterName}/services/{serviceName}/replications/hbaseReplicationValidationTool"
            .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 (hbasePeerId != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("hbasePeerId", hbasePeerId));

        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 runHBaseReplicationValidationToolValidateBeforeCall(String clusterName, String serviceName, String hbasePeerId, 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 runHBaseReplicationValidationTool(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling runHBaseReplicationValidationTool(Async)");
        }

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

    }

    /**
     * Executes a command, which validates if HBase replication works properly for the given hbasePeerId.
     * Executes a command, which validates if HBase replication works properly for the given hbasePeerId
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param hbasePeerId The HBase peer ID to be validated (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand runHBaseReplicationValidationTool(String clusterName, String serviceName, String hbasePeerId) throws ApiException {
        ApiResponse<ApiCommand> resp = runHBaseReplicationValidationToolWithHttpInfo(clusterName, serviceName, hbasePeerId);
        return resp.getData();
    }

    /**
     * Executes a command, which validates if HBase replication works properly for the given hbasePeerId.
     * Executes a command, which validates if HBase replication works properly for the given hbasePeerId
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param hbasePeerId The HBase peer ID to be validated (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> runHBaseReplicationValidationToolWithHttpInfo(String clusterName, String serviceName, String hbasePeerId) throws ApiException {
        okhttp3.Call call = runHBaseReplicationValidationToolValidateBeforeCall(clusterName, serviceName, hbasePeerId, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Executes a command, which validates if HBase replication works properly for the given hbasePeerId. (asynchronously)
     * Executes a command, which validates if HBase replication works properly for the given hbasePeerId
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param hbasePeerId The HBase peer ID to be validated (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 runHBaseReplicationValidationToolAsync(String clusterName, String serviceName, String hbasePeerId, 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 = runHBaseReplicationValidationToolValidateBeforeCall(clusterName, serviceName, hbasePeerId, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for runHiveReplicationQuery
     * @param clusterName  (required)
     * @param serviceName The service name. (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 runHiveReplicationQueryCall(String clusterName, String serviceName, ApiHive3ReplicationArguments 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}/replications/hiveReplicationQuery"
            .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 runHiveReplicationQueryValidateBeforeCall(String clusterName, String serviceName, ApiHive3ReplicationArguments 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 runHiveReplicationQuery(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling runHiveReplicationQuery(Async)");
        }

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

    }

    /**
     * Execute a hive replication query on local HS2 service instance.
     * Execute a hive replication query on local HS2 service instance &lt;p&gt; The command executes hive replication query on local HS2 instance with the provided arguments &lt;p&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (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 runHiveReplicationQuery(String clusterName, String serviceName, ApiHive3ReplicationArguments body) throws ApiException {
        ApiResponse<ApiCommand> resp = runHiveReplicationQueryWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Execute a hive replication query on local HS2 service instance.
     * Execute a hive replication query on local HS2 service instance &lt;p&gt; The command executes hive replication query on local HS2 instance with the provided arguments &lt;p&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (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> runHiveReplicationQueryWithHttpInfo(String clusterName, String serviceName, ApiHive3ReplicationArguments body) throws ApiException {
        okhttp3.Call call = runHiveReplicationQueryValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Execute a hive replication query on local HS2 service instance. (asynchronously)
     * Execute a hive replication query on local HS2 service instance &lt;p&gt; The command executes hive replication query on local HS2 instance with the provided arguments &lt;p&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (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 runHiveReplicationQueryAsync(String clusterName, String serviceName, ApiHive3ReplicationArguments 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 = runHiveReplicationQueryValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for runSchedule
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (required)
     * @param serviceName The service name. (required)
     * @param dryRun Whether to execute a dry run. (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 runScheduleCall(String clusterName, java.math.BigDecimal scheduleId, String serviceName, Boolean dryRun, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        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 runScheduleValidateBeforeCall(String clusterName, java.math.BigDecimal scheduleId, String serviceName, Boolean dryRun, 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 runSchedule(Async)");
        }
        // verify the required parameter 'scheduleId' is set
        if (scheduleId == null) {
            throw new ApiException("Missing the required parameter 'scheduleId' when calling runSchedule(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling runSchedule(Async)");
        }

        okhttp3.Call call = runScheduleCall(clusterName, scheduleId, serviceName, dryRun, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Run the schedule immediately.
     * Run the schedule immediately. &lt;p&gt; The replication command will be triggered with the configured arguments, and will be recorded in the schedule&#x27;s history. &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (required)
     * @param serviceName The service name. (required)
     * @param dryRun Whether to execute a dry run. (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 runSchedule(String clusterName, java.math.BigDecimal scheduleId, String serviceName, Boolean dryRun) throws ApiException {
        ApiResponse<ApiCommand> resp = runScheduleWithHttpInfo(clusterName, scheduleId, serviceName, dryRun);
        return resp.getData();
    }

    /**
     * Run the schedule immediately.
     * Run the schedule immediately. &lt;p&gt; The replication command will be triggered with the configured arguments, and will be recorded in the schedule&#x27;s history. &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (required)
     * @param serviceName The service name. (required)
     * @param dryRun Whether to execute a dry run. (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> runScheduleWithHttpInfo(String clusterName, java.math.BigDecimal scheduleId, String serviceName, Boolean dryRun) throws ApiException {
        okhttp3.Call call = runScheduleValidateBeforeCall(clusterName, scheduleId, serviceName, dryRun, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Run the schedule immediately. (asynchronously)
     * Run the schedule immediately. &lt;p&gt; The replication command will be triggered with the configured arguments, and will be recorded in the schedule&#x27;s history. &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (required)
     * @param serviceName The service name. (required)
     * @param dryRun Whether to execute a dry run. (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 runScheduleAsync(String clusterName, java.math.BigDecimal scheduleId, String serviceName, Boolean dryRun, 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 = runScheduleValidateBeforeCall(clusterName, scheduleId, serviceName, dryRun, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for setCFsReplicationScope
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Arguments for setting the replication scope. (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 setCFsReplicationScopeCall(String clusterName, String serviceName, ApiHBaseSetCFsReplicationScope 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}/replications/operations/setCFsReplicationScope"
            .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 setCFsReplicationScopeValidateBeforeCall(String clusterName, String serviceName, ApiHBaseSetCFsReplicationScope 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 setCFsReplicationScope(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling setCFsReplicationScope(Async)");
        }

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

    }

    /**
     * Starts a command that set the replication scope of the provided column families to the desired value.
     * Starts a command that set the replication scope of the provided column families to the desired value.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Arguments for setting the replication scope. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand setCFsReplicationScope(String clusterName, String serviceName, ApiHBaseSetCFsReplicationScope body) throws ApiException {
        ApiResponse<ApiCommand> resp = setCFsReplicationScopeWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Starts a command that set the replication scope of the provided column families to the desired value.
     * Starts a command that set the replication scope of the provided column families to the desired value.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Arguments for setting the replication scope. (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> setCFsReplicationScopeWithHttpInfo(String clusterName, String serviceName, ApiHBaseSetCFsReplicationScope body) throws ApiException {
        okhttp3.Call call = setCFsReplicationScopeValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Starts a command that set the replication scope of the provided column families to the desired value. (asynchronously)
     * Starts a command that set the replication scope of the provided column families to the desired value.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Arguments for setting the replication scope. (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 setCFsReplicationScopeAsync(String clusterName, String serviceName, ApiHBaseSetCFsReplicationScope 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 = setCFsReplicationScopeValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for updateHBasePeerState
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body ApiHBaseReplicationUpdatePeerStateArgs (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 updateHBasePeerStateCall(String clusterName, String serviceName, ApiHBaseReplicationUpdatePeerStateArgs 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}/replications/updateHBasePeerState"
            .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 updateHBasePeerStateValidateBeforeCall(String clusterName, String serviceName, ApiHBaseReplicationUpdatePeerStateArgs 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 updateHBasePeerState(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling updateHBasePeerState(Async)");
        }

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

    }

    /**
     * Update HBase peer state (&#x27;DISABLE&#x27; or &#x27;ENABLE&#x27;),.
     * Update HBase peer state (&#x27;DISABLE&#x27; or &#x27;ENABLE&#x27;),&lt;br/&gt; and set the related HBase replication schedules &lt;pre&gt;ApiHBaseReplicationArguments.peerState&lt;/pre&gt; for the given peer name (all schedules for the same source and target HBase service) according to the given state (&#x27;DISABLED&#x27; or &#x27;ENABLED&#x27;). &lt;pre&gt;  example json data payload:  &#x27;{     \&quot;sourceRef\&quot;: {       \&quot;peerName\&quot;: \&quot;source-peer-name\&quot;,       \&quot;clusterName\&quot;: \&quot;Cluster Name\&quot;,       \&quot;serviceName\&quot;: \&quot;HBase Service Name\&quot;     }     \&quot;peerState\&quot;: \&quot;ENABLED|DISABLED\&quot;   }&#x27;  &lt;/pre&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body ApiHBaseReplicationUpdatePeerStateArgs (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand updateHBasePeerState(String clusterName, String serviceName, ApiHBaseReplicationUpdatePeerStateArgs body) throws ApiException {
        ApiResponse<ApiCommand> resp = updateHBasePeerStateWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Update HBase peer state (&#x27;DISABLE&#x27; or &#x27;ENABLE&#x27;),.
     * Update HBase peer state (&#x27;DISABLE&#x27; or &#x27;ENABLE&#x27;),&lt;br/&gt; and set the related HBase replication schedules &lt;pre&gt;ApiHBaseReplicationArguments.peerState&lt;/pre&gt; for the given peer name (all schedules for the same source and target HBase service) according to the given state (&#x27;DISABLED&#x27; or &#x27;ENABLED&#x27;). &lt;pre&gt;  example json data payload:  &#x27;{     \&quot;sourceRef\&quot;: {       \&quot;peerName\&quot;: \&quot;source-peer-name\&quot;,       \&quot;clusterName\&quot;: \&quot;Cluster Name\&quot;,       \&quot;serviceName\&quot;: \&quot;HBase Service Name\&quot;     }     \&quot;peerState\&quot;: \&quot;ENABLED|DISABLED\&quot;   }&#x27;  &lt;/pre&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body ApiHBaseReplicationUpdatePeerStateArgs (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> updateHBasePeerStateWithHttpInfo(String clusterName, String serviceName, ApiHBaseReplicationUpdatePeerStateArgs body) throws ApiException {
        okhttp3.Call call = updateHBasePeerStateValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Update HBase peer state (&#x27;DISABLE&#x27; or &#x27;ENABLE&#x27;),. (asynchronously)
     * Update HBase peer state (&#x27;DISABLE&#x27; or &#x27;ENABLE&#x27;),&lt;br/&gt; and set the related HBase replication schedules &lt;pre&gt;ApiHBaseReplicationArguments.peerState&lt;/pre&gt; for the given peer name (all schedules for the same source and target HBase service) according to the given state (&#x27;DISABLED&#x27; or &#x27;ENABLED&#x27;). &lt;pre&gt;  example json data payload:  &#x27;{     \&quot;sourceRef\&quot;: {       \&quot;peerName\&quot;: \&quot;source-peer-name\&quot;,       \&quot;clusterName\&quot;: \&quot;Cluster Name\&quot;,       \&quot;serviceName\&quot;: \&quot;HBase Service Name\&quot;     }     \&quot;peerState\&quot;: \&quot;ENABLED|DISABLED\&quot;   }&#x27;  &lt;/pre&gt;
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body ApiHBaseReplicationUpdatePeerStateArgs (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 updateHBasePeerStateAsync(String clusterName, String serviceName, ApiHBaseReplicationUpdatePeerStateArgs 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 = updateHBasePeerStateValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for updateHBaseReplicationPeerState
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Arguments for operation. (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public okhttp3.Call updateHBaseReplicationPeerStateCall(String clusterName, String serviceName, ApiHBaseUpdateReplicationPeerState 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}/replications/operations/updateReplicationPeerState"
            .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 updateHBaseReplicationPeerStateValidateBeforeCall(String clusterName, String serviceName, ApiHBaseUpdateReplicationPeerState 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 updateHBaseReplicationPeerState(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling updateHBaseReplicationPeerState(Async)");
        }

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

    }

    /**
     * Starts a command that updates the state of an existing HBase replication peer.
     * Starts a command that updates the state of an existing HBase replication peer.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Arguments for operation. (optional)
     * @return ApiCommand
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiCommand updateHBaseReplicationPeerState(String clusterName, String serviceName, ApiHBaseUpdateReplicationPeerState body) throws ApiException {
        ApiResponse<ApiCommand> resp = updateHBaseReplicationPeerStateWithHttpInfo(clusterName, serviceName, body);
        return resp.getData();
    }

    /**
     * Starts a command that updates the state of an existing HBase replication peer.
     * Starts a command that updates the state of an existing HBase replication peer.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Arguments for operation. (optional)
     * @return ApiResponse&lt;ApiCommand&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiCommand> updateHBaseReplicationPeerStateWithHttpInfo(String clusterName, String serviceName, ApiHBaseUpdateReplicationPeerState body) throws ApiException {
        okhttp3.Call call = updateHBaseReplicationPeerStateValidateBeforeCall(clusterName, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Starts a command that updates the state of an existing HBase replication peer. (asynchronously)
     * Starts a command that updates the state of an existing HBase replication peer.
     * @param clusterName  (required)
     * @param serviceName The service name. (required)
     * @param body Arguments for operation. (optional)
     * @param callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     */
    public okhttp3.Call updateHBaseReplicationPeerStateAsync(String clusterName, String serviceName, ApiHBaseUpdateReplicationPeerState 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 = updateHBaseReplicationPeerStateValidateBeforeCall(clusterName, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiCommand>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for updateSchedule
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (required)
     * @param serviceName The service name. (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 updateScheduleCall(String clusterName, java.math.BigDecimal scheduleId, String serviceName, ApiReplicationSchedule 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}/replications/{scheduleId}"
            .replaceAll("\\{" + "clusterName" + "\\}", apiClient.escapeString(clusterName.toString()))
            .replaceAll("\\{" + "scheduleId" + "\\}", apiClient.escapeString(scheduleId.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 updateScheduleValidateBeforeCall(String clusterName, java.math.BigDecimal scheduleId, String serviceName, ApiReplicationSchedule 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 updateSchedule(Async)");
        }
        // verify the required parameter 'scheduleId' is set
        if (scheduleId == null) {
            throw new ApiException("Missing the required parameter 'scheduleId' when calling updateSchedule(Async)");
        }
        // verify the required parameter 'serviceName' is set
        if (serviceName == null) {
            throw new ApiException("Missing the required parameter 'serviceName' when calling updateSchedule(Async)");
        }

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

    }

    /**
     * Updates an existing replication schedule.
     * Updates an existing replication schedule. &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (required)
     * @param serviceName The service name. (required)
     * @param body  (optional)
     * @return ApiReplicationSchedule
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiReplicationSchedule updateSchedule(String clusterName, java.math.BigDecimal scheduleId, String serviceName, ApiReplicationSchedule body) throws ApiException {
        ApiResponse<ApiReplicationSchedule> resp = updateScheduleWithHttpInfo(clusterName, scheduleId, serviceName, body);
        return resp.getData();
    }

    /**
     * Updates an existing replication schedule.
     * Updates an existing replication schedule. &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (required)
     * @param serviceName The service name. (required)
     * @param body  (optional)
     * @return ApiResponse&lt;ApiReplicationSchedule&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ApiReplicationSchedule> updateScheduleWithHttpInfo(String clusterName, java.math.BigDecimal scheduleId, String serviceName, ApiReplicationSchedule body) throws ApiException {
        okhttp3.Call call = updateScheduleValidateBeforeCall(clusterName, scheduleId, serviceName, body, null, null);
        Type localVarReturnType = new TypeToken<ApiReplicationSchedule>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Updates an existing replication schedule. (asynchronously)
     * Updates an existing replication schedule. &lt;p&gt; Available since API v3. Only available with Cloudera Manager Enterprise Edition.
     * @param clusterName  (required)
     * @param scheduleId Id of an existing replication schedule. (required)
     * @param serviceName The service name. (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 updateScheduleAsync(String clusterName, java.math.BigDecimal scheduleId, String serviceName, ApiReplicationSchedule body, final ApiCallback<ApiReplicationSchedule> 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 = updateScheduleValidateBeforeCall(clusterName, scheduleId, serviceName, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ApiReplicationSchedule>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
}
