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

com.genesys.internal.workspace.api.UcsApi Maven / Gradle / Ivy

There is a newer version: 9.0.73
Show newest version
/*
 * Workspace API
 * Agent API
 *
 * OpenAPI spec version: 1.0.0
 * 
 *
 * 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.genesys.internal.workspace.api;

import com.genesys.internal.common.ApiCallback;
import com.genesys.internal.common.ApiClient;
import com.genesys.internal.common.ApiException;
import com.genesys.internal.common.ApiResponse;
import com.genesys.internal.common.Configuration;
import com.genesys.internal.common.Pair;
import com.genesys.internal.common.ProgressRequestBody;
import com.genesys.internal.common.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import com.genesys.internal.workspace.model.AgentHistoryData;
import com.genesys.internal.workspace.model.ApiErrorResponse;
import com.genesys.internal.workspace.model.ApiSuccessResponse;
import com.genesys.internal.workspace.model.AssignInteractionToContactData;
import com.genesys.internal.workspace.model.CallCompletedData;
import com.genesys.internal.workspace.model.CallNoteData;
import com.genesys.internal.workspace.model.ConfigResponse;
import com.genesys.internal.workspace.model.ContactDetailsData;
import com.genesys.internal.workspace.model.ContactHistoryData;
import com.genesys.internal.workspace.model.DeleteContactData;
import com.genesys.internal.workspace.model.GetContactsData;
import com.genesys.internal.workspace.model.IdentifyContactData;
import com.genesys.internal.workspace.model.InteractionContentData;
import com.genesys.internal.workspace.model.LuceneSearchData;
import com.genesys.internal.workspace.model.LuceneSearchInteractionData;
import com.genesys.internal.workspace.model.PhoneCallData;
import com.genesys.internal.workspace.model.UpdateContactData;

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

public class UcsApi {
    private ApiClient apiClient;

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

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

    public ApiClient getApiClient() {
        return apiClient;
    }

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

    /**
     * Build call for assignInteractionToContact
     * @param assignInteractionToContactData  (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 assignInteractionToContactCall(AssignInteractionToContactData assignInteractionToContactData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = assignInteractionToContactData;
        
        // create path and map variables
        String localVarPath = "/ucs/assign-interaction-to-contact";

        List localVarQueryParams = 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, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call assignInteractionToContactValidateBeforeCall(AssignInteractionToContactData assignInteractionToContactData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'assignInteractionToContactData' is set
        if (assignInteractionToContactData == null) {
            throw new ApiException("Missing the required parameter 'assignInteractionToContactData' when calling assignInteractionToContact(Async)");
        }
        
        
        com.squareup.okhttp.Call call = assignInteractionToContactCall(assignInteractionToContactData, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Assign the interaction to a contact
     * 
     * @param assignInteractionToContactData  (required)
     * @return ApiSuccessResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiSuccessResponse assignInteractionToContact(AssignInteractionToContactData assignInteractionToContactData) throws ApiException {
        ApiResponse resp = assignInteractionToContactWithHttpInfo(assignInteractionToContactData);
        return resp.getData();
    }

    /**
     * Assign the interaction to a contact
     * 
     * @param assignInteractionToContactData  (required)
     * @return ApiResponse<ApiSuccessResponse>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse assignInteractionToContactWithHttpInfo(AssignInteractionToContactData assignInteractionToContactData) throws ApiException {
        com.squareup.okhttp.Call call = assignInteractionToContactValidateBeforeCall(assignInteractionToContactData, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Assign the interaction to a contact (asynchronously)
     * 
     * @param assignInteractionToContactData  (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 assignInteractionToContactAsync(AssignInteractionToContactData assignInteractionToContactData, 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 = assignInteractionToContactValidateBeforeCall(assignInteractionToContactData, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createContact
     * @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 createContactCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;
        
        // create path and map variables
        String localVarPath = "/ucs/create-contact";

        List localVarQueryParams = 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, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call createContactValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        
        com.squareup.okhttp.Call call = createContactCall(progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Create a new contact
     * 
     * @return ApiSuccessResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiSuccessResponse createContact() throws ApiException {
        ApiResponse resp = createContactWithHttpInfo();
        return resp.getData();
    }

    /**
     * Create a new contact
     * 
     * @return ApiResponse<ApiSuccessResponse>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse createContactWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = createContactValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Create a new contact (asynchronously)
     * 
     * @param callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     */
    public com.squareup.okhttp.Call createContactAsync(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 = createContactValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for deleteContact
     * @param deleteContactData  (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 deleteContactCall(DeleteContactData deleteContactData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = deleteContactData;
        
        // create path and map variables
        String localVarPath = "/ucs/delete-contact";

        List localVarQueryParams = 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, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call deleteContactValidateBeforeCall(DeleteContactData deleteContactData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'deleteContactData' is set
        if (deleteContactData == null) {
            throw new ApiException("Missing the required parameter 'deleteContactData' when calling deleteContact(Async)");
        }
        
        
        com.squareup.okhttp.Call call = deleteContactCall(deleteContactData, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Delete an existing contact
     * 
     * @param deleteContactData  (required)
     * @return ApiSuccessResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiSuccessResponse deleteContact(DeleteContactData deleteContactData) throws ApiException {
        ApiResponse resp = deleteContactWithHttpInfo(deleteContactData);
        return resp.getData();
    }

    /**
     * Delete an existing contact
     * 
     * @param deleteContactData  (required)
     * @return ApiResponse<ApiSuccessResponse>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse deleteContactWithHttpInfo(DeleteContactData deleteContactData) throws ApiException {
        com.squareup.okhttp.Call call = deleteContactValidateBeforeCall(deleteContactData, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Delete an existing contact (asynchronously)
     * 
     * @param deleteContactData  (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 deleteContactAsync(DeleteContactData deleteContactData, 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 = deleteContactValidateBeforeCall(deleteContactData, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for findOrCreatePhoneCall
     * @param phoneCallData  (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 findOrCreatePhoneCallCall(PhoneCallData phoneCallData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = phoneCallData;
        
        // create path and map variables
        String localVarPath = "/ucs/find-or-create-phone-call";

        List localVarQueryParams = 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, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call findOrCreatePhoneCallValidateBeforeCall(PhoneCallData phoneCallData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'phoneCallData' is set
        if (phoneCallData == null) {
            throw new ApiException("Missing the required parameter 'phoneCallData' when calling findOrCreatePhoneCall(Async)");
        }
        
        
        com.squareup.okhttp.Call call = findOrCreatePhoneCallCall(phoneCallData, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Find or create phone call in UCS
     * 
     * @param phoneCallData  (required)
     * @return ApiSuccessResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiSuccessResponse findOrCreatePhoneCall(PhoneCallData phoneCallData) throws ApiException {
        ApiResponse resp = findOrCreatePhoneCallWithHttpInfo(phoneCallData);
        return resp.getData();
    }

    /**
     * Find or create phone call in UCS
     * 
     * @param phoneCallData  (required)
     * @return ApiResponse<ApiSuccessResponse>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse findOrCreatePhoneCallWithHttpInfo(PhoneCallData phoneCallData) throws ApiException {
        com.squareup.okhttp.Call call = findOrCreatePhoneCallValidateBeforeCall(phoneCallData, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Find or create phone call in UCS (asynchronously)
     * 
     * @param phoneCallData  (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 findOrCreatePhoneCallAsync(PhoneCallData phoneCallData, 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 = findOrCreatePhoneCallValidateBeforeCall(phoneCallData, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getAgentHistory
     * @param agentHistoryData  (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 getAgentHistoryCall(AgentHistoryData agentHistoryData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = agentHistoryData;
        
        // create path and map variables
        String localVarPath = "/ucs/get-agent-history";

        List localVarQueryParams = 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, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call getAgentHistoryValidateBeforeCall(AgentHistoryData agentHistoryData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        
        com.squareup.okhttp.Call call = getAgentHistoryCall(agentHistoryData, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Get the history of interactions for the agent
     * 
     * @param agentHistoryData  (optional)
     * @return ApiSuccessResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiSuccessResponse getAgentHistory(AgentHistoryData agentHistoryData) throws ApiException {
        ApiResponse resp = getAgentHistoryWithHttpInfo(agentHistoryData);
        return resp.getData();
    }

    /**
     * Get the history of interactions for the agent
     * 
     * @param agentHistoryData  (optional)
     * @return ApiResponse<ApiSuccessResponse>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse getAgentHistoryWithHttpInfo(AgentHistoryData agentHistoryData) throws ApiException {
        com.squareup.okhttp.Call call = getAgentHistoryValidateBeforeCall(agentHistoryData, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Get the history of interactions for the agent (asynchronously)
     * 
     * @param agentHistoryData  (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 getAgentHistoryAsync(AgentHistoryData agentHistoryData, 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 = getAgentHistoryValidateBeforeCall(agentHistoryData, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getContactDetails
     * @param contactDetailsData  (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 getContactDetailsCall(ContactDetailsData contactDetailsData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = contactDetailsData;
        
        // create path and map variables
        String localVarPath = "/ucs/get-contact-details";

        List localVarQueryParams = 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, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call getContactDetailsValidateBeforeCall(ContactDetailsData contactDetailsData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'contactDetailsData' is set
        if (contactDetailsData == null) {
            throw new ApiException("Missing the required parameter 'contactDetailsData' when calling getContactDetails(Async)");
        }
        
        
        com.squareup.okhttp.Call call = getContactDetailsCall(contactDetailsData, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Get the details of a contact
     * 
     * @param contactDetailsData  (required)
     * @return ApiSuccessResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiSuccessResponse getContactDetails(ContactDetailsData contactDetailsData) throws ApiException {
        ApiResponse resp = getContactDetailsWithHttpInfo(contactDetailsData);
        return resp.getData();
    }

    /**
     * Get the details of a contact
     * 
     * @param contactDetailsData  (required)
     * @return ApiResponse<ApiSuccessResponse>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse getContactDetailsWithHttpInfo(ContactDetailsData contactDetailsData) throws ApiException {
        com.squareup.okhttp.Call call = getContactDetailsValidateBeforeCall(contactDetailsData, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Get the details of a contact (asynchronously)
     * 
     * @param contactDetailsData  (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 getContactDetailsAsync(ContactDetailsData contactDetailsData, 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 = getContactDetailsValidateBeforeCall(contactDetailsData, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getContactHistory
     * @param contactHistoryData  (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 getContactHistoryCall(ContactHistoryData contactHistoryData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = contactHistoryData;
        
        // create path and map variables
        String localVarPath = "/ucs/get-contact-history";

        List localVarQueryParams = 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, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call getContactHistoryValidateBeforeCall(ContactHistoryData contactHistoryData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'contactHistoryData' is set
        if (contactHistoryData == null) {
            throw new ApiException("Missing the required parameter 'contactHistoryData' when calling getContactHistory(Async)");
        }
        
        
        com.squareup.okhttp.Call call = getContactHistoryCall(contactHistoryData, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Get the history of interactions for a contact
     * 
     * @param contactHistoryData  (required)
     * @return ApiSuccessResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiSuccessResponse getContactHistory(ContactHistoryData contactHistoryData) throws ApiException {
        ApiResponse resp = getContactHistoryWithHttpInfo(contactHistoryData);
        return resp.getData();
    }

    /**
     * Get the history of interactions for a contact
     * 
     * @param contactHistoryData  (required)
     * @return ApiResponse<ApiSuccessResponse>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse getContactHistoryWithHttpInfo(ContactHistoryData contactHistoryData) throws ApiException {
        com.squareup.okhttp.Call call = getContactHistoryValidateBeforeCall(contactHistoryData, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Get the history of interactions for a contact (asynchronously)
     * 
     * @param contactHistoryData  (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 getContactHistoryAsync(ContactHistoryData contactHistoryData, 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 = getContactHistoryValidateBeforeCall(contactHistoryData, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getContacts
     * @param getContactsData  (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 getContactsCall(GetContactsData getContactsData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = getContactsData;
        
        // create path and map variables
        String localVarPath = "/ucs/get-contacts";

        List localVarQueryParams = 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, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call getContactsValidateBeforeCall(GetContactsData getContactsData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'getContactsData' is set
        if (getContactsData == null) {
            throw new ApiException("Missing the required parameter 'getContactsData' when calling getContacts(Async)");
        }
        
        
        com.squareup.okhttp.Call call = getContactsCall(getContactsData, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Get contacts based on search criteria.
     * 
     * @param getContactsData  (required)
     * @return ApiSuccessResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiSuccessResponse getContacts(GetContactsData getContactsData) throws ApiException {
        ApiResponse resp = getContactsWithHttpInfo(getContactsData);
        return resp.getData();
    }

    /**
     * Get contacts based on search criteria.
     * 
     * @param getContactsData  (required)
     * @return ApiResponse<ApiSuccessResponse>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse getContactsWithHttpInfo(GetContactsData getContactsData) throws ApiException {
        com.squareup.okhttp.Call call = getContactsValidateBeforeCall(getContactsData, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Get contacts based on search criteria. (asynchronously)
     * 
     * @param getContactsData  (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 getContactsAsync(GetContactsData getContactsData, 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 = getContactsValidateBeforeCall(getContactsData, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getIndexProperties
     * @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 getIndexPropertiesCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;
        
        // create path and map variables
        String localVarPath = "/ucs/get-index-properties";

        List localVarQueryParams = 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, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call getIndexPropertiesValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        
        com.squareup.okhttp.Call call = getIndexPropertiesCall(progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Get the lucene indexes for ucs
     * This request returns all the lucene indexes for contact 
     * @return ConfigResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ConfigResponse getIndexProperties() throws ApiException {
        ApiResponse resp = getIndexPropertiesWithHttpInfo();
        return resp.getData();
    }

    /**
     * Get the lucene indexes for ucs
     * This request returns all the lucene indexes for contact 
     * @return ApiResponse<ConfigResponse>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse getIndexPropertiesWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = getIndexPropertiesValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Get the lucene indexes for ucs (asynchronously)
     * This request returns all the lucene indexes for contact 
     * @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 getIndexPropertiesAsync(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 = getIndexPropertiesValidateBeforeCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getInteractionContent
     * @param interactionContentData  (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 getInteractionContentCall(InteractionContentData interactionContentData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = interactionContentData;
        
        // create path and map variables
        String localVarPath = "/ucs/get-interaction-content";

        List localVarQueryParams = 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, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call getInteractionContentValidateBeforeCall(InteractionContentData interactionContentData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'interactionContentData' is set
        if (interactionContentData == null) {
            throw new ApiException("Missing the required parameter 'interactionContentData' when calling getInteractionContent(Async)");
        }
        
        
        com.squareup.okhttp.Call call = getInteractionContentCall(interactionContentData, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Get the content of the interaction
     * 
     * @param interactionContentData  (required)
     * @return ApiSuccessResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiSuccessResponse getInteractionContent(InteractionContentData interactionContentData) throws ApiException {
        ApiResponse resp = getInteractionContentWithHttpInfo(interactionContentData);
        return resp.getData();
    }

    /**
     * Get the content of the interaction
     * 
     * @param interactionContentData  (required)
     * @return ApiResponse<ApiSuccessResponse>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse getInteractionContentWithHttpInfo(InteractionContentData interactionContentData) throws ApiException {
        com.squareup.okhttp.Call call = getInteractionContentValidateBeforeCall(interactionContentData, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Get the content of the interaction (asynchronously)
     * 
     * @param interactionContentData  (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 getInteractionContentAsync(InteractionContentData interactionContentData, 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 = getInteractionContentValidateBeforeCall(interactionContentData, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for identifyContact
     * @param identifyContactData  (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 identifyContactCall(IdentifyContactData identifyContactData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = identifyContactData;
        
        // create path and map variables
        String localVarPath = "/ucs/identify-contact";

        List localVarQueryParams = 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, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call identifyContactValidateBeforeCall(IdentifyContactData identifyContactData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'identifyContactData' is set
        if (identifyContactData == null) {
            throw new ApiException("Missing the required parameter 'identifyContactData' when calling identifyContact(Async)");
        }
        
        
        com.squareup.okhttp.Call call = identifyContactCall(identifyContactData, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Identify the contact for the interaction
     * 
     * @param identifyContactData  (required)
     * @return ApiSuccessResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiSuccessResponse identifyContact(IdentifyContactData identifyContactData) throws ApiException {
        ApiResponse resp = identifyContactWithHttpInfo(identifyContactData);
        return resp.getData();
    }

    /**
     * Identify the contact for the interaction
     * 
     * @param identifyContactData  (required)
     * @return ApiResponse<ApiSuccessResponse>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse identifyContactWithHttpInfo(IdentifyContactData identifyContactData) throws ApiException {
        com.squareup.okhttp.Call call = identifyContactValidateBeforeCall(identifyContactData, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Identify the contact for the interaction (asynchronously)
     * 
     * @param identifyContactData  (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 identifyContactAsync(IdentifyContactData identifyContactData, 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 = identifyContactValidateBeforeCall(identifyContactData, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for luceneSearch
     * @param luceneSearchData  (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 luceneSearchCall(LuceneSearchData luceneSearchData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = luceneSearchData;
        
        // create path and map variables
        String localVarPath = "/ucs/lucene-search";

        List localVarQueryParams = 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, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call luceneSearchValidateBeforeCall(LuceneSearchData luceneSearchData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'luceneSearchData' is set
        if (luceneSearchData == null) {
            throw new ApiException("Missing the required parameter 'luceneSearchData' when calling luceneSearch(Async)");
        }
        
        
        com.squareup.okhttp.Call call = luceneSearchCall(luceneSearchData, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Search for contacts based on search query, using lucene search
     * 
     * @param luceneSearchData  (required)
     * @return ApiSuccessResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiSuccessResponse luceneSearch(LuceneSearchData luceneSearchData) throws ApiException {
        ApiResponse resp = luceneSearchWithHttpInfo(luceneSearchData);
        return resp.getData();
    }

    /**
     * Search for contacts based on search query, using lucene search
     * 
     * @param luceneSearchData  (required)
     * @return ApiResponse<ApiSuccessResponse>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse luceneSearchWithHttpInfo(LuceneSearchData luceneSearchData) throws ApiException {
        com.squareup.okhttp.Call call = luceneSearchValidateBeforeCall(luceneSearchData, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Search for contacts based on search query, using lucene search (asynchronously)
     * 
     * @param luceneSearchData  (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 luceneSearchAsync(LuceneSearchData luceneSearchData, 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 = luceneSearchValidateBeforeCall(luceneSearchData, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for luceneSearchInteraction
     * @param luceneSearchInteractionData  (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 luceneSearchInteractionCall(LuceneSearchInteractionData luceneSearchInteractionData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = luceneSearchInteractionData;
        
        // create path and map variables
        String localVarPath = "/ucs/lucene-search-interaction";

        List localVarQueryParams = 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, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call luceneSearchInteractionValidateBeforeCall(LuceneSearchInteractionData luceneSearchInteractionData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'luceneSearchInteractionData' is set
        if (luceneSearchInteractionData == null) {
            throw new ApiException("Missing the required parameter 'luceneSearchInteractionData' when calling luceneSearchInteraction(Async)");
        }
        
        
        com.squareup.okhttp.Call call = luceneSearchInteractionCall(luceneSearchInteractionData, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Search for interactions based on search query, using lucene search
     * 
     * @param luceneSearchInteractionData  (required)
     * @return ApiSuccessResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiSuccessResponse luceneSearchInteraction(LuceneSearchInteractionData luceneSearchInteractionData) throws ApiException {
        ApiResponse resp = luceneSearchInteractionWithHttpInfo(luceneSearchInteractionData);
        return resp.getData();
    }

    /**
     * Search for interactions based on search query, using lucene search
     * 
     * @param luceneSearchInteractionData  (required)
     * @return ApiResponse<ApiSuccessResponse>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse luceneSearchInteractionWithHttpInfo(LuceneSearchInteractionData luceneSearchInteractionData) throws ApiException {
        com.squareup.okhttp.Call call = luceneSearchInteractionValidateBeforeCall(luceneSearchInteractionData, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Search for interactions based on search query, using lucene search (asynchronously)
     * 
     * @param luceneSearchInteractionData  (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 luceneSearchInteractionAsync(LuceneSearchInteractionData luceneSearchInteractionData, 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 = luceneSearchInteractionValidateBeforeCall(luceneSearchInteractionData, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for setCallCompleted
     * @param callCompletedData  (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 setCallCompletedCall(CallCompletedData callCompletedData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = callCompletedData;
        
        // create path and map variables
        String localVarPath = "/ucs/set-call-completed";

        List localVarQueryParams = 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, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call setCallCompletedValidateBeforeCall(CallCompletedData callCompletedData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'callCompletedData' is set
        if (callCompletedData == null) {
            throw new ApiException("Missing the required parameter 'callCompletedData' when calling setCallCompleted(Async)");
        }
        
        
        com.squareup.okhttp.Call call = setCallCompletedCall(callCompletedData, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Set the call as being completed
     * 
     * @param callCompletedData  (required)
     * @return ApiSuccessResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiSuccessResponse setCallCompleted(CallCompletedData callCompletedData) throws ApiException {
        ApiResponse resp = setCallCompletedWithHttpInfo(callCompletedData);
        return resp.getData();
    }

    /**
     * Set the call as being completed
     * 
     * @param callCompletedData  (required)
     * @return ApiResponse<ApiSuccessResponse>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse setCallCompletedWithHttpInfo(CallCompletedData callCompletedData) throws ApiException {
        com.squareup.okhttp.Call call = setCallCompletedValidateBeforeCall(callCompletedData, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Set the call as being completed (asynchronously)
     * 
     * @param callCompletedData  (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 setCallCompletedAsync(CallCompletedData callCompletedData, 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 = setCallCompletedValidateBeforeCall(callCompletedData, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for setCallNote
     * @param callNoteData  (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 setCallNoteCall(CallNoteData callNoteData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = callNoteData;
        
        // create path and map variables
        String localVarPath = "/ucs/set-call-note";

        List localVarQueryParams = 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, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call setCallNoteValidateBeforeCall(CallNoteData callNoteData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'callNoteData' is set
        if (callNoteData == null) {
            throw new ApiException("Missing the required parameter 'callNoteData' when calling setCallNote(Async)");
        }
        
        
        com.squareup.okhttp.Call call = setCallNoteCall(callNoteData, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Set the note for the call
     * 
     * @param callNoteData  (required)
     * @return ApiSuccessResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiSuccessResponse setCallNote(CallNoteData callNoteData) throws ApiException {
        ApiResponse resp = setCallNoteWithHttpInfo(callNoteData);
        return resp.getData();
    }

    /**
     * Set the note for the call
     * 
     * @param callNoteData  (required)
     * @return ApiResponse<ApiSuccessResponse>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse setCallNoteWithHttpInfo(CallNoteData callNoteData) throws ApiException {
        com.squareup.okhttp.Call call = setCallNoteValidateBeforeCall(callNoteData, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Set the note for the call (asynchronously)
     * 
     * @param callNoteData  (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 setCallNoteAsync(CallNoteData callNoteData, 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 = setCallNoteValidateBeforeCall(callNoteData, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for updateContact
     * @param updateContactData  (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 updateContactCall(UpdateContactData updateContactData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = updateContactData;
        
        // create path and map variables
        String localVarPath = "/ucs/update-contact";

        List localVarQueryParams = 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, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call updateContactValidateBeforeCall(UpdateContactData updateContactData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'updateContactData' is set
        if (updateContactData == null) {
            throw new ApiException("Missing the required parameter 'updateContactData' when calling updateContact(Async)");
        }
        
        
        com.squareup.okhttp.Call call = updateContactCall(updateContactData, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Update attributes of an existing contact
     * 
     * @param updateContactData  (required)
     * @return ApiSuccessResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiSuccessResponse updateContact(UpdateContactData updateContactData) throws ApiException {
        ApiResponse resp = updateContactWithHttpInfo(updateContactData);
        return resp.getData();
    }

    /**
     * Update attributes of an existing contact
     * 
     * @param updateContactData  (required)
     * @return ApiResponse<ApiSuccessResponse>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse updateContactWithHttpInfo(UpdateContactData updateContactData) throws ApiException {
        com.squareup.okhttp.Call call = updateContactValidateBeforeCall(updateContactData, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Update attributes of an existing contact (asynchronously)
     * 
     * @param updateContactData  (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 updateContactAsync(UpdateContactData updateContactData, 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 = updateContactValidateBeforeCall(updateContactData, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy