All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.akeyless.auth.swagger.api.DefaultApi Maven / Gradle / Ivy

There is a newer version: 1.0.7
Show newest version
/*
 * Auth - Application API
 * Auth manages access policies for services that need access policies management for their clients. Auth also issues temporary credentials for the services' clients and validates them for the services
 *
 * OpenAPI spec version: 1.0.2
 * Contact: [email protected]
 *
 * 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.akeyless.auth.swagger.api;

import com.akeyless.auth.swagger.ApiCallback;
import com.akeyless.auth.swagger.ApiClient;
import com.akeyless.auth.swagger.ApiException;
import com.akeyless.auth.swagger.ApiResponse;
import com.akeyless.auth.swagger.Configuration;
import com.akeyless.auth.swagger.Pair;
import com.akeyless.auth.swagger.ProgressRequestBody;
import com.akeyless.auth.swagger.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import com.akeyless.auth.swagger.model.AuthStatusReplyObj;
import com.akeyless.auth.swagger.model.CreateAccountCredsParams;
import com.akeyless.auth.swagger.model.CreatePolicyReplyObj;
import com.akeyless.auth.swagger.model.CredentialsReplyObj;
import com.akeyless.auth.swagger.model.ErrorReplyObj;
import com.akeyless.auth.swagger.model.GetPoliciesReplyObj;
import com.akeyless.auth.swagger.model.GetPolicyReplyObj;
import com.akeyless.auth.swagger.model.PolicyParams;
import com.akeyless.auth.swagger.model.PublicSigningKeyReplyObj;
import com.akeyless.auth.swagger.model.SetUAMPolicyCredsParams;
import com.akeyless.auth.swagger.model.SystemUserCredentialsReplyObj;
import com.akeyless.auth.swagger.model.TimeReplyObj;
import com.akeyless.auth.swagger.model.ValidateClientCredsReplyObj;

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

public class DefaultApi {
    private ApiClient apiClient;

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

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

    public ApiClient getApiClient() {
        return apiClient;
    }

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

    /**
     * Build call for authenticateApiKeyPolicy
     * @param policyId Policy id. (required)
     * @param timestamp A Unix timestamp which was used for the signature. (required)
     * @param nonce Random string which was used for the signature. (required)
     * @param signature A digital signature generated with the private key that complies with the access policy. (required)
     * @param clientIp The Client's IP for authentication. Relevant only to the services that mediate between Auth and their clients in obtaining temporary access credentials. (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 com.squareup.okhttp.Call authenticateApiKeyPolicyCall(String policyId, Long timestamp, String nonce, String signature, String clientIp, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/auth-api-key-policy";

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        if (policyId != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("policy_id", policyId));
        if (timestamp != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("timestamp", timestamp));
        if (nonce != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("nonce", nonce));
        if (signature != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("signature", signature));
        if (clientIp != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("client_ip", clientIp));

        Map localVarHeaderParams = new HashMap();

        Map localVarFormParams = new HashMap();

        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 com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

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

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call authenticateApiKeyPolicyValidateBeforeCall(String policyId, Long timestamp, String nonce, String signature, String clientIp, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'policyId' is set
        if (policyId == null) {
            throw new ApiException("Missing the required parameter 'policyId' when calling authenticateApiKeyPolicy(Async)");
        }
        
        // verify the required parameter 'timestamp' is set
        if (timestamp == null) {
            throw new ApiException("Missing the required parameter 'timestamp' when calling authenticateApiKeyPolicy(Async)");
        }
        
        // verify the required parameter 'nonce' is set
        if (nonce == null) {
            throw new ApiException("Missing the required parameter 'nonce' when calling authenticateApiKeyPolicy(Async)");
        }
        
        // verify the required parameter 'signature' is set
        if (signature == null) {
            throw new ApiException("Missing the required parameter 'signature' when calling authenticateApiKeyPolicy(Async)");
        }
        

        com.squareup.okhttp.Call call = authenticateApiKeyPolicyCall(policyId, timestamp, nonce, signature, clientIp, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Return a temporary access credentials
     * Client that meet an API key access policy will be able to get temporary credentials to access the service that created the policy for him. The client must provide a signature that proves his compliance with the policy. In this case the IP address used for authentication will be taken from the http request.
     * @param policyId Policy id. (required)
     * @param timestamp A Unix timestamp which was used for the signature. (required)
     * @param nonce Random string which was used for the signature. (required)
     * @param signature A digital signature generated with the private key that complies with the access policy. (required)
     * @param clientIp The Client's IP for authentication. Relevant only to the services that mediate between Auth and their clients in obtaining temporary access credentials. (optional)
     * @return CredentialsReplyObj
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public CredentialsReplyObj authenticateApiKeyPolicy(String policyId, Long timestamp, String nonce, String signature, String clientIp) throws ApiException {
        ApiResponse resp = authenticateApiKeyPolicyWithHttpInfo(policyId, timestamp, nonce, signature, clientIp);
        return resp.getData();
    }

    /**
     * Return a temporary access credentials
     * Client that meet an API key access policy will be able to get temporary credentials to access the service that created the policy for him. The client must provide a signature that proves his compliance with the policy. In this case the IP address used for authentication will be taken from the http request.
     * @param policyId Policy id. (required)
     * @param timestamp A Unix timestamp which was used for the signature. (required)
     * @param nonce Random string which was used for the signature. (required)
     * @param signature A digital signature generated with the private key that complies with the access policy. (required)
     * @param clientIp The Client's IP for authentication. Relevant only to the services that mediate between Auth and their clients in obtaining temporary access credentials. (optional)
     * @return ApiResponse<CredentialsReplyObj>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse authenticateApiKeyPolicyWithHttpInfo(String policyId, Long timestamp, String nonce, String signature, String clientIp) throws ApiException {
        com.squareup.okhttp.Call call = authenticateApiKeyPolicyValidateBeforeCall(policyId, timestamp, nonce, signature, clientIp, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Return a temporary access credentials (asynchronously)
     * Client that meet an API key access policy will be able to get temporary credentials to access the service that created the policy for him. The client must provide a signature that proves his compliance with the policy. In this case the IP address used for authentication will be taken from the http request.
     * @param policyId Policy id. (required)
     * @param timestamp A Unix timestamp which was used for the signature. (required)
     * @param nonce Random string which was used for the signature. (required)
     * @param signature A digital signature generated with the private key that complies with the access policy. (required)
     * @param clientIp The Client's IP for authentication. Relevant only to the services that mediate between Auth and their clients in obtaining temporary access credentials. (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 com.squareup.okhttp.Call authenticateApiKeyPolicyAsync(String policyId, Long timestamp, String nonce, String signature, String clientIp, final ApiCallback 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);
                }
            };
        }

        com.squareup.okhttp.Call call = authenticateApiKeyPolicyValidateBeforeCall(policyId, timestamp, nonce, signature, clientIp, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for authenticateUAMApiKeyPolicy
     * @param policyId Policy id. (required)
     * @param timestamp A Unix timestamp which was used for the signature. (required)
     * @param nonce Random string which was used for the signature. (required)
     * @param signature A digital signature generated with the private key that complies with the access policy. (required)
     * @param clientIp The Client's IP for authentication. Relevant only to the services that mediate between Auth and their clients in obtaining temporary access credentials. (optional)
     * @param credsExpiry The requested expiration time of the temporary credentials in minutes. (optional, default to 60)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call authenticateUAMApiKeyPolicyCall(String policyId, Long timestamp, String nonce, String signature, String clientIp, Integer credsExpiry, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/auth-uam-api-key-policy";

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        if (policyId != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("policy_id", policyId));
        if (timestamp != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("timestamp", timestamp));
        if (nonce != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("nonce", nonce));
        if (signature != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("signature", signature));
        if (clientIp != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("client_ip", clientIp));
        if (credsExpiry != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("creds_expiry", credsExpiry));

        Map localVarHeaderParams = new HashMap();

        Map localVarFormParams = new HashMap();

        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 com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

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

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call authenticateUAMApiKeyPolicyValidateBeforeCall(String policyId, Long timestamp, String nonce, String signature, String clientIp, Integer credsExpiry, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'policyId' is set
        if (policyId == null) {
            throw new ApiException("Missing the required parameter 'policyId' when calling authenticateUAMApiKeyPolicy(Async)");
        }
        
        // verify the required parameter 'timestamp' is set
        if (timestamp == null) {
            throw new ApiException("Missing the required parameter 'timestamp' when calling authenticateUAMApiKeyPolicy(Async)");
        }
        
        // verify the required parameter 'nonce' is set
        if (nonce == null) {
            throw new ApiException("Missing the required parameter 'nonce' when calling authenticateUAMApiKeyPolicy(Async)");
        }
        
        // verify the required parameter 'signature' is set
        if (signature == null) {
            throw new ApiException("Missing the required parameter 'signature' when calling authenticateUAMApiKeyPolicy(Async)");
        }
        

        com.squareup.okhttp.Call call = authenticateUAMApiKeyPolicyCall(policyId, timestamp, nonce, signature, clientIp, credsExpiry, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Return a combination of three temporary credentials for accessing Auth, UAM and KFMs instances.
     * System's user that meet an API key access policy will be able to get a combination of three temporary credentials signed by Auth for accessing Auth, UAM and KFMs instances. The client must provide a signature that proves his compliance with the policy. In this case the IP address used for authentication will be taken from the http request.
     * @param policyId Policy id. (required)
     * @param timestamp A Unix timestamp which was used for the signature. (required)
     * @param nonce Random string which was used for the signature. (required)
     * @param signature A digital signature generated with the private key that complies with the access policy. (required)
     * @param clientIp The Client's IP for authentication. Relevant only to the services that mediate between Auth and their clients in obtaining temporary access credentials. (optional)
     * @param credsExpiry The requested expiration time of the temporary credentials in minutes. (optional, default to 60)
     * @return SystemUserCredentialsReplyObj
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public SystemUserCredentialsReplyObj authenticateUAMApiKeyPolicy(String policyId, Long timestamp, String nonce, String signature, String clientIp, Integer credsExpiry) throws ApiException {
        ApiResponse resp = authenticateUAMApiKeyPolicyWithHttpInfo(policyId, timestamp, nonce, signature, clientIp, credsExpiry);
        return resp.getData();
    }

    /**
     * Return a combination of three temporary credentials for accessing Auth, UAM and KFMs instances.
     * System's user that meet an API key access policy will be able to get a combination of three temporary credentials signed by Auth for accessing Auth, UAM and KFMs instances. The client must provide a signature that proves his compliance with the policy. In this case the IP address used for authentication will be taken from the http request.
     * @param policyId Policy id. (required)
     * @param timestamp A Unix timestamp which was used for the signature. (required)
     * @param nonce Random string which was used for the signature. (required)
     * @param signature A digital signature generated with the private key that complies with the access policy. (required)
     * @param clientIp The Client's IP for authentication. Relevant only to the services that mediate between Auth and their clients in obtaining temporary access credentials. (optional)
     * @param credsExpiry The requested expiration time of the temporary credentials in minutes. (optional, default to 60)
     * @return ApiResponse<SystemUserCredentialsReplyObj>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse authenticateUAMApiKeyPolicyWithHttpInfo(String policyId, Long timestamp, String nonce, String signature, String clientIp, Integer credsExpiry) throws ApiException {
        com.squareup.okhttp.Call call = authenticateUAMApiKeyPolicyValidateBeforeCall(policyId, timestamp, nonce, signature, clientIp, credsExpiry, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Return a combination of three temporary credentials for accessing Auth, UAM and KFMs instances. (asynchronously)
     * System's user that meet an API key access policy will be able to get a combination of three temporary credentials signed by Auth for accessing Auth, UAM and KFMs instances. The client must provide a signature that proves his compliance with the policy. In this case the IP address used for authentication will be taken from the http request.
     * @param policyId Policy id. (required)
     * @param timestamp A Unix timestamp which was used for the signature. (required)
     * @param nonce Random string which was used for the signature. (required)
     * @param signature A digital signature generated with the private key that complies with the access policy. (required)
     * @param clientIp The Client's IP for authentication. Relevant only to the services that mediate between Auth and their clients in obtaining temporary access credentials. (optional)
     * @param credsExpiry The requested expiration time of the temporary credentials in minutes. (optional, default to 60)
     * @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 com.squareup.okhttp.Call authenticateUAMApiKeyPolicyAsync(String policyId, Long timestamp, String nonce, String signature, String clientIp, Integer credsExpiry, final ApiCallback 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);
                }
            };
        }

        com.squareup.okhttp.Call call = authenticateUAMApiKeyPolicyValidateBeforeCall(policyId, timestamp, nonce, signature, clientIp, credsExpiry, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createAccountCreds
     * @param body Policy rules to be used for accessing the new account. (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 com.squareup.okhttp.Call createAccountCredsCall(CreateAccountCredsParams body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

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

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();

        Map localVarHeaderParams = new HashMap();

        Map localVarFormParams = new HashMap();

        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 com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

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

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call createAccountCredsValidateBeforeCall(CreateAccountCredsParams body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling createAccountCreds(Async)");
        }
        

        com.squareup.okhttp.Call call = createAccountCredsCall(body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Getting temporary access credentials to create new account in the UAM service. The UAM service will use this credentials to create an access policy to be used for accessing the account
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param body Policy rules to be used for accessing the new account. (required)
     * @return CredentialsReplyObj
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public CredentialsReplyObj createAccountCreds(CreateAccountCredsParams body) throws ApiException {
        ApiResponse resp = createAccountCredsWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Getting temporary access credentials to create new account in the UAM service. The UAM service will use this credentials to create an access policy to be used for accessing the account
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param body Policy rules to be used for accessing the new account. (required)
     * @return ApiResponse<CredentialsReplyObj>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse createAccountCredsWithHttpInfo(CreateAccountCredsParams body) throws ApiException {
        com.squareup.okhttp.Call call = createAccountCredsValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Getting temporary access credentials to create new account in the UAM service. The UAM service will use this credentials to create an access policy to be used for accessing the account (asynchronously)
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param body Policy rules to be used for accessing the new account. (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 com.squareup.okhttp.Call createAccountCredsAsync(CreateAccountCredsParams body, final ApiCallback 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);
                }
            };
        }

        com.squareup.okhttp.Call call = createAccountCredsValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createPolicy
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param body Policy rules and attaches. (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 com.squareup.okhttp.Call createPolicyCall(String akeylessCredentials, PolicyParams body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

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

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();

        Map localVarHeaderParams = new HashMap();
        if (akeylessCredentials != null)
        localVarHeaderParams.put("Akeyless-Credentials", apiClient.parameterToString(akeylessCredentials));

        Map localVarFormParams = new HashMap();

        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 com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

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

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call createPolicyValidateBeforeCall(String akeylessCredentials, PolicyParams body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'akeylessCredentials' is set
        if (akeylessCredentials == null) {
            throw new ApiException("Missing the required parameter 'akeylessCredentials' when calling createPolicy(Async)");
        }
        
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling createPolicy(Async)");
        }
        

        com.squareup.okhttp.Call call = createPolicyCall(akeylessCredentials, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Creating a new access policy.
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param body Policy rules and attaches. (required)
     * @return CreatePolicyReplyObj
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public CreatePolicyReplyObj createPolicy(String akeylessCredentials, PolicyParams body) throws ApiException {
        ApiResponse resp = createPolicyWithHttpInfo(akeylessCredentials, body);
        return resp.getData();
    }

    /**
     * Creating a new access policy.
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param body Policy rules and attaches. (required)
     * @return ApiResponse<CreatePolicyReplyObj>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse createPolicyWithHttpInfo(String akeylessCredentials, PolicyParams body) throws ApiException {
        com.squareup.okhttp.Call call = createPolicyValidateBeforeCall(akeylessCredentials, body, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Creating a new access policy. (asynchronously)
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param body Policy rules and attaches. (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 com.squareup.okhttp.Call createPolicyAsync(String akeylessCredentials, PolicyParams body, final ApiCallback 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);
                }
            };
        }

        com.squareup.okhttp.Call call = createPolicyValidateBeforeCall(akeylessCredentials, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for deletePolicy
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param policyId Policy id. (required)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call deletePolicyCall(String akeylessCredentials, String policyId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/policy/{policy_id}"
            .replaceAll("\\{" + "policy_id" + "\\}", apiClient.escapeString(policyId.toString()));

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();

        Map localVarHeaderParams = new HashMap();
        if (akeylessCredentials != null)
        localVarHeaderParams.put("Akeyless-Credentials", apiClient.parameterToString(akeylessCredentials));

        Map localVarFormParams = new HashMap();

        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 com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

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

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call deletePolicyValidateBeforeCall(String akeylessCredentials, String policyId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'akeylessCredentials' is set
        if (akeylessCredentials == null) {
            throw new ApiException("Missing the required parameter 'akeylessCredentials' when calling deletePolicy(Async)");
        }
        
        // verify the required parameter 'policyId' is set
        if (policyId == null) {
            throw new ApiException("Missing the required parameter 'policyId' when calling deletePolicy(Async)");
        }
        

        com.squareup.okhttp.Call call = deletePolicyCall(akeylessCredentials, policyId, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Deleting an existing access policy.
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param policyId Policy id. (required)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void deletePolicy(String akeylessCredentials, String policyId) throws ApiException {
        deletePolicyWithHttpInfo(akeylessCredentials, policyId);
    }

    /**
     * Deleting an existing access policy.
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param policyId Policy id. (required)
     * @return ApiResponse<Void>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse deletePolicyWithHttpInfo(String akeylessCredentials, String policyId) throws ApiException {
        com.squareup.okhttp.Call call = deletePolicyValidateBeforeCall(akeylessCredentials, policyId, null, null);
        return apiClient.execute(call);
    }

    /**
     * Deleting an existing access policy. (asynchronously)
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param policyId Policy id. (required)
     * @param callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     */
    public com.squareup.okhttp.Call deletePolicyAsync(String akeylessCredentials, String policyId, final ApiCallback 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);
                }
            };
        }

        com.squareup.okhttp.Call call = deletePolicyValidateBeforeCall(akeylessCredentials, policyId, progressListener, progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }
    /**
     * Build call for getPolicies
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param filterKeys Keys array of fields in the policy attaches. (optional)
     * @param filterValues Values array of fields in the policy attaches. (optional)
     * @param includeExpired  (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 com.squareup.okhttp.Call getPoliciesCall(String akeylessCredentials, List filterKeys, List filterValues, Boolean includeExpired, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        if (filterKeys != null)
        localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "filter_keys", filterKeys));
        if (filterValues != null)
        localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "filter_values", filterValues));
        if (includeExpired != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("include_expired", includeExpired));

        Map localVarHeaderParams = new HashMap();
        if (akeylessCredentials != null)
        localVarHeaderParams.put("Akeyless-Credentials", apiClient.parameterToString(akeylessCredentials));

        Map localVarFormParams = new HashMap();

        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 com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

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

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call getPoliciesValidateBeforeCall(String akeylessCredentials, List filterKeys, List filterValues, Boolean includeExpired, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'akeylessCredentials' is set
        if (akeylessCredentials == null) {
            throw new ApiException("Missing the required parameter 'akeylessCredentials' when calling getPolicies(Async)");
        }
        

        com.squareup.okhttp.Call call = getPoliciesCall(akeylessCredentials, filterKeys, filterValues, includeExpired, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Geting a list of access policies
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param filterKeys Keys array of fields in the policy attaches. (optional)
     * @param filterValues Values array of fields in the policy attaches. (optional)
     * @param includeExpired  (optional)
     * @return GetPoliciesReplyObj
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public GetPoliciesReplyObj getPolicies(String akeylessCredentials, List filterKeys, List filterValues, Boolean includeExpired) throws ApiException {
        ApiResponse resp = getPoliciesWithHttpInfo(akeylessCredentials, filterKeys, filterValues, includeExpired);
        return resp.getData();
    }

    /**
     * Geting a list of access policies
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param filterKeys Keys array of fields in the policy attaches. (optional)
     * @param filterValues Values array of fields in the policy attaches. (optional)
     * @param includeExpired  (optional)
     * @return ApiResponse<GetPoliciesReplyObj>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse getPoliciesWithHttpInfo(String akeylessCredentials, List filterKeys, List filterValues, Boolean includeExpired) throws ApiException {
        com.squareup.okhttp.Call call = getPoliciesValidateBeforeCall(akeylessCredentials, filterKeys, filterValues, includeExpired, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Geting a list of access policies (asynchronously)
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param filterKeys Keys array of fields in the policy attaches. (optional)
     * @param filterValues Values array of fields in the policy attaches. (optional)
     * @param includeExpired  (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 com.squareup.okhttp.Call getPoliciesAsync(String akeylessCredentials, List filterKeys, List filterValues, Boolean includeExpired, final ApiCallback 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);
                }
            };
        }

        com.squareup.okhttp.Call call = getPoliciesValidateBeforeCall(akeylessCredentials, filterKeys, filterValues, includeExpired, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getPolicy
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param policyId Policy id. (required)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call getPolicyCall(String akeylessCredentials, String policyId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/policy/{policy_id}"
            .replaceAll("\\{" + "policy_id" + "\\}", apiClient.escapeString(policyId.toString()));

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();

        Map localVarHeaderParams = new HashMap();
        if (akeylessCredentials != null)
        localVarHeaderParams.put("Akeyless-Credentials", apiClient.parameterToString(akeylessCredentials));

        Map localVarFormParams = new HashMap();

        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 com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

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

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call getPolicyValidateBeforeCall(String akeylessCredentials, String policyId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'akeylessCredentials' is set
        if (akeylessCredentials == null) {
            throw new ApiException("Missing the required parameter 'akeylessCredentials' when calling getPolicy(Async)");
        }
        
        // verify the required parameter 'policyId' is set
        if (policyId == null) {
            throw new ApiException("Missing the required parameter 'policyId' when calling getPolicy(Async)");
        }
        

        com.squareup.okhttp.Call call = getPolicyCall(akeylessCredentials, policyId, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Getting an existing access policy.
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param policyId Policy id. (required)
     * @return GetPolicyReplyObj
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public GetPolicyReplyObj getPolicy(String akeylessCredentials, String policyId) throws ApiException {
        ApiResponse resp = getPolicyWithHttpInfo(akeylessCredentials, policyId);
        return resp.getData();
    }

    /**
     * Getting an existing access policy.
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param policyId Policy id. (required)
     * @return ApiResponse<GetPolicyReplyObj>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse getPolicyWithHttpInfo(String akeylessCredentials, String policyId) throws ApiException {
        com.squareup.okhttp.Call call = getPolicyValidateBeforeCall(akeylessCredentials, policyId, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Getting an existing access policy. (asynchronously)
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param policyId Policy id. (required)
     * @param callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     */
    public com.squareup.okhttp.Call getPolicyAsync(String akeylessCredentials, String policyId, final ApiCallback 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);
                }
            };
        }

        com.squareup.okhttp.Call call = getPolicyValidateBeforeCall(akeylessCredentials, policyId, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getPublicSigningKey
     * @param signingKeyId The ID of the key used by Auth to sign the temporary access credentials. (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 com.squareup.okhttp.Call getPublicSigningKeyCall(String signingKeyId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/public-signing-key/{signing_key_id}"
            .replaceAll("\\{" + "signing_key_id" + "\\}", apiClient.escapeString(signingKeyId.toString()));

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();

        Map localVarHeaderParams = new HashMap();

        Map localVarFormParams = new HashMap();

        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 com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

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

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

        com.squareup.okhttp.Call call = getPublicSigningKeyCall(signingKeyId, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Getting the public part of the key used by Auth to sign the temporary access credentials.
     * 
     * @param signingKeyId The ID of the key used by Auth to sign the temporary access credentials. (required)
     * @return PublicSigningKeyReplyObj
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public PublicSigningKeyReplyObj getPublicSigningKey(String signingKeyId) throws ApiException {
        ApiResponse resp = getPublicSigningKeyWithHttpInfo(signingKeyId);
        return resp.getData();
    }

    /**
     * Getting the public part of the key used by Auth to sign the temporary access credentials.
     * 
     * @param signingKeyId The ID of the key used by Auth to sign the temporary access credentials. (required)
     * @return ApiResponse<PublicSigningKeyReplyObj>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse getPublicSigningKeyWithHttpInfo(String signingKeyId) throws ApiException {
        com.squareup.okhttp.Call call = getPublicSigningKeyValidateBeforeCall(signingKeyId, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Getting the public part of the key used by Auth to sign the temporary access credentials. (asynchronously)
     * 
     * @param signingKeyId The ID of the key used by Auth to sign the temporary access credentials. (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 com.squareup.okhttp.Call getPublicSigningKeyAsync(String signingKeyId, final ApiCallback 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);
                }
            };
        }

        com.squareup.okhttp.Call call = getPublicSigningKeyValidateBeforeCall(signingKeyId, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getStatus
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call getStatusCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();

        Map localVarHeaderParams = new HashMap();

        Map localVarFormParams = new HashMap();

        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 com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

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

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call getStatusValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        

        com.squareup.okhttp.Call call = getStatusCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * 
     * Get Auth server status
     * @return AuthStatusReplyObj
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public AuthStatusReplyObj getStatus() throws ApiException {
        ApiResponse resp = getStatusWithHttpInfo();
        return resp.getData();
    }

    /**
     * 
     * Get Auth server status
     * @return ApiResponse<AuthStatusReplyObj>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse getStatusWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = getStatusValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     *  (asynchronously)
     * Get Auth server status
     * @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 com.squareup.okhttp.Call getStatusAsync(final ApiCallback 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);
                }
            };
        }

        com.squareup.okhttp.Call call = getStatusValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getTime
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call getTimeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();

        Map localVarHeaderParams = new HashMap();

        Map localVarFormParams = new HashMap();

        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 com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

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

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call getTimeValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        

        com.squareup.okhttp.Call call = getTimeCall(progressListener, progressRequestListener);
        return call;

    }

    /**
     * 
     * Get Auth server time
     * @return TimeReplyObj
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public TimeReplyObj getTime() throws ApiException {
        ApiResponse resp = getTimeWithHttpInfo();
        return resp.getData();
    }

    /**
     * 
     * Get Auth server time
     * @return ApiResponse<TimeReplyObj>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse getTimeWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = getTimeValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     *  (asynchronously)
     * Get Auth server time
     * @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 com.squareup.okhttp.Call getTimeAsync(final ApiCallback 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);
                }
            };
        }

        com.squareup.okhttp.Call call = getTimeValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for setUamPolicyCreds
     * @param akeylessAuthCreds Temporary credentials for accessing the endpoint (required)
     * @param body Policy params. (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 com.squareup.okhttp.Call setUamPolicyCredsCall(String akeylessAuthCreds, SetUAMPolicyCredsParams body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/set-uam-policy-creds";

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();

        Map localVarHeaderParams = new HashMap();
        if (akeylessAuthCreds != null)
        localVarHeaderParams.put("AkeylessAuthCreds", apiClient.parameterToString(akeylessAuthCreds));

        Map localVarFormParams = new HashMap();

        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 com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

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

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call setUamPolicyCredsValidateBeforeCall(String akeylessAuthCreds, SetUAMPolicyCredsParams body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'akeylessAuthCreds' is set
        if (akeylessAuthCreds == null) {
            throw new ApiException("Missing the required parameter 'akeylessAuthCreds' when calling setUamPolicyCreds(Async)");
        }
        
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling setUamPolicyCreds(Async)");
        }
        

        com.squareup.okhttp.Call call = setUamPolicyCredsCall(akeylessAuthCreds, body, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Getting temporary access credentials to add a new access policy or to update an existing access policy in an UAM account. The UAM service will use this credentials to create/update an access policy to be used for accessing key fragments.
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param akeylessAuthCreds Temporary credentials for accessing the endpoint (required)
     * @param body Policy params. (required)
     * @return CredentialsReplyObj
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public CredentialsReplyObj setUamPolicyCreds(String akeylessAuthCreds, SetUAMPolicyCredsParams body) throws ApiException {
        ApiResponse resp = setUamPolicyCredsWithHttpInfo(akeylessAuthCreds, body);
        return resp.getData();
    }

    /**
     * Getting temporary access credentials to add a new access policy or to update an existing access policy in an UAM account. The UAM service will use this credentials to create/update an access policy to be used for accessing key fragments.
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param akeylessAuthCreds Temporary credentials for accessing the endpoint (required)
     * @param body Policy params. (required)
     * @return ApiResponse<CredentialsReplyObj>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse setUamPolicyCredsWithHttpInfo(String akeylessAuthCreds, SetUAMPolicyCredsParams body) throws ApiException {
        com.squareup.okhttp.Call call = setUamPolicyCredsValidateBeforeCall(akeylessAuthCreds, body, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Getting temporary access credentials to add a new access policy or to update an existing access policy in an UAM account. The UAM service will use this credentials to create/update an access policy to be used for accessing key fragments. (asynchronously)
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param akeylessAuthCreds Temporary credentials for accessing the endpoint (required)
     * @param body Policy params. (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 com.squareup.okhttp.Call setUamPolicyCredsAsync(String akeylessAuthCreds, SetUAMPolicyCredsParams body, final ApiCallback 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);
                }
            };
        }

        com.squareup.okhttp.Call call = setUamPolicyCredsValidateBeforeCall(akeylessAuthCreds, body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for updatePolicy
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param body Policy rules and attaches. (required)
     * @param policyId Policy id. (required)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call updatePolicyCall(String akeylessCredentials, PolicyParams body, String policyId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/policy/{policy_id}"
            .replaceAll("\\{" + "policy_id" + "\\}", apiClient.escapeString(policyId.toString()));

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();

        Map localVarHeaderParams = new HashMap();
        if (akeylessCredentials != null)
        localVarHeaderParams.put("Akeyless-Credentials", apiClient.parameterToString(akeylessCredentials));

        Map localVarFormParams = new HashMap();

        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 com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

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

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call updatePolicyValidateBeforeCall(String akeylessCredentials, PolicyParams body, String policyId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'akeylessCredentials' is set
        if (akeylessCredentials == null) {
            throw new ApiException("Missing the required parameter 'akeylessCredentials' when calling updatePolicy(Async)");
        }
        
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling updatePolicy(Async)");
        }
        
        // verify the required parameter 'policyId' is set
        if (policyId == null) {
            throw new ApiException("Missing the required parameter 'policyId' when calling updatePolicy(Async)");
        }
        

        com.squareup.okhttp.Call call = updatePolicyCall(akeylessCredentials, body, policyId, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Updating an existing access policy
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param body Policy rules and attaches. (required)
     * @param policyId Policy id. (required)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void updatePolicy(String akeylessCredentials, PolicyParams body, String policyId) throws ApiException {
        updatePolicyWithHttpInfo(akeylessCredentials, body, policyId);
    }

    /**
     * Updating an existing access policy
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param body Policy rules and attaches. (required)
     * @param policyId Policy id. (required)
     * @return ApiResponse<Void>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse updatePolicyWithHttpInfo(String akeylessCredentials, PolicyParams body, String policyId) throws ApiException {
        com.squareup.okhttp.Call call = updatePolicyValidateBeforeCall(akeylessCredentials, body, policyId, null, null);
        return apiClient.execute(call);
    }

    /**
     * Updating an existing access policy (asynchronously)
     * This endpoint is accessible only by services that have a permission to access Auth for managing their policies for their clients.
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param body Policy rules and attaches. (required)
     * @param policyId Policy id. (required)
     * @param callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     */
    public com.squareup.okhttp.Call updatePolicyAsync(String akeylessCredentials, PolicyParams body, String policyId, final ApiCallback 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);
                }
            };
        }

        com.squareup.okhttp.Call call = updatePolicyValidateBeforeCall(akeylessCredentials, body, policyId, progressListener, progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }
    /**
     * Build call for validateClientCredentials
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param clientCredentials Temporary credentials for validation (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 com.squareup.okhttp.Call validateClientCredentialsCall(String akeylessCredentials, String clientCredentials, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/validate-client-credentials";

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        if (clientCredentials != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("client_credentials", clientCredentials));

        Map localVarHeaderParams = new HashMap();
        if (akeylessCredentials != null)
        localVarHeaderParams.put("Akeyless-Credentials", apiClient.parameterToString(akeylessCredentials));

        Map localVarFormParams = new HashMap();

        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 com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

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

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call validateClientCredentialsValidateBeforeCall(String akeylessCredentials, String clientCredentials, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'akeylessCredentials' is set
        if (akeylessCredentials == null) {
            throw new ApiException("Missing the required parameter 'akeylessCredentials' when calling validateClientCredentials(Async)");
        }
        
        // verify the required parameter 'clientCredentials' is set
        if (clientCredentials == null) {
            throw new ApiException("Missing the required parameter 'clientCredentials' when calling validateClientCredentials(Async)");
        }
        

        com.squareup.okhttp.Call call = validateClientCredentialsCall(akeylessCredentials, clientCredentials, progressListener, progressRequestListener);
        return call;

    }

    /**
     * Validate client credentials
     * Allows the services to validate the temporary access credentials that received from their clients.
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param clientCredentials Temporary credentials for validation (required)
     * @return ValidateClientCredsReplyObj
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ValidateClientCredsReplyObj validateClientCredentials(String akeylessCredentials, String clientCredentials) throws ApiException {
        ApiResponse resp = validateClientCredentialsWithHttpInfo(akeylessCredentials, clientCredentials);
        return resp.getData();
    }

    /**
     * Validate client credentials
     * Allows the services to validate the temporary access credentials that received from their clients.
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param clientCredentials Temporary credentials for validation (required)
     * @return ApiResponse<ValidateClientCredsReplyObj>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse validateClientCredentialsWithHttpInfo(String akeylessCredentials, String clientCredentials) throws ApiException {
        com.squareup.okhttp.Call call = validateClientCredentialsValidateBeforeCall(akeylessCredentials, clientCredentials, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Validate client credentials (asynchronously)
     * Allows the services to validate the temporary access credentials that received from their clients.
     * @param akeylessCredentials Temporary credentials for accessing the endpoint (required)
     * @param clientCredentials Temporary credentials for validation (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 com.squareup.okhttp.Call validateClientCredentialsAsync(String akeylessCredentials, String clientCredentials, final ApiCallback 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);
                }
            };
        }

        com.squareup.okhttp.Call call = validateClientCredentialsValidateBeforeCall(akeylessCredentials, clientCredentials, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy