Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.genesys.internal.workspace.api.ChatApi Maven / Gradle / Ivy
Go to download
A Java library to interface to Genesys Workspace public API
/*
* Workspace API
* Agent API
*
* OpenAPI spec version: 9.0.000.78.3880
*
*
* 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.AcceptData;
import com.genesys.internal.workspace.model.AcceptData1;
import com.genesys.internal.workspace.model.AcceptData2;
import com.genesys.internal.workspace.model.ApiErrorResponse;
import com.genesys.internal.workspace.model.ApiSuccessResponse;
import com.genesys.internal.workspace.model.CancelConsultData;
import com.genesys.internal.workspace.model.ConsultData;
import com.genesys.internal.workspace.model.ConsultData1;
import com.genesys.internal.workspace.model.CustomNotificationData;
import com.genesys.internal.workspace.model.InviteData;
import com.genesys.internal.workspace.model.InviteData1;
import com.genesys.internal.workspace.model.LeaveData;
import com.genesys.internal.workspace.model.RemoveFromConferenceData;
import com.genesys.internal.workspace.model.TypingStartedData;
import com.genesys.internal.workspace.model.TypingStoppedData;
import com.genesys.internal.workspace.model.UpdateNicknameData;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ChatApi {
private ApiClient apiClient;
public ChatApi() {
this(Configuration.getDefaultApiClient());
}
public ChatApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Build call for acceptChat
* @param id The ID of the chat interaction. (required)
* @param acceptData Request parameters. (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 acceptChatCall(String id, AcceptData acceptData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = acceptData;
// create path and map variables
String localVarPath = "/media/chat/interactions/{id}/accept"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call acceptChatValidateBeforeCall(String id, AcceptData acceptData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling acceptChat(Async)");
}
com.squareup.okhttp.Call call = acceptChatCall(id, acceptData, progressListener, progressRequestListener);
return call;
}
/**
* Accept a chat
* Accept the specified chat interaction.
* @param id The ID of the chat interaction. (required)
* @param acceptData Request parameters. (optional)
* @return ApiSuccessResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiSuccessResponse acceptChat(String id, AcceptData acceptData) throws ApiException {
ApiResponse resp = acceptChatWithHttpInfo(id, acceptData);
return resp.getData();
}
/**
* Accept a chat
* Accept the specified chat interaction.
* @param id The ID of the chat interaction. (required)
* @param acceptData Request parameters. (optional)
* @return ApiResponse<ApiSuccessResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse acceptChatWithHttpInfo(String id, AcceptData acceptData) throws ApiException {
com.squareup.okhttp.Call call = acceptChatValidateBeforeCall(id, acceptData, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Accept a chat (asynchronously)
* Accept the specified chat interaction.
* @param id The ID of the chat interaction. (required)
* @param acceptData Request parameters. (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 acceptChatAsync(String id, AcceptData acceptData, 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 = acceptChatValidateBeforeCall(id, acceptData, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for cancelConsultationChat
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param cancelConsultData Request parameters. (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 cancelConsultationChatCall(String id, String mediatype, CancelConsultData cancelConsultData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = cancelConsultData;
// create path and map variables
String localVarPath = "/media/{mediatype}/interactions/{id}/cancel-consult"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "mediatype" + "\\}", apiClient.escapeString(mediatype.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call cancelConsultationChatValidateBeforeCall(String id, String mediatype, CancelConsultData cancelConsultData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling cancelConsultationChat(Async)");
}
// verify the required parameter 'mediatype' is set
if (mediatype == null) {
throw new ApiException("Missing the required parameter 'mediatype' when calling cancelConsultationChat(Async)");
}
com.squareup.okhttp.Call call = cancelConsultationChatCall(id, mediatype, cancelConsultData, progressListener, progressRequestListener);
return call;
}
/**
* Cancel a chat consultation request
* Cancel a chat consultation request that was initialized by calling [/media/chat/interactions/{id}/consult-by-queue](/reference/workspace/Media/index.html#consultByQueue). If the agent has already accepted the invitation, the Workspace API can't cancel the consultation.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param cancelConsultData Request parameters. (optional)
* @return ApiSuccessResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiSuccessResponse cancelConsultationChat(String id, String mediatype, CancelConsultData cancelConsultData) throws ApiException {
ApiResponse resp = cancelConsultationChatWithHttpInfo(id, mediatype, cancelConsultData);
return resp.getData();
}
/**
* Cancel a chat consultation request
* Cancel a chat consultation request that was initialized by calling [/media/chat/interactions/{id}/consult-by-queue](/reference/workspace/Media/index.html#consultByQueue). If the agent has already accepted the invitation, the Workspace API can't cancel the consultation.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param cancelConsultData Request parameters. (optional)
* @return ApiResponse<ApiSuccessResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse cancelConsultationChatWithHttpInfo(String id, String mediatype, CancelConsultData cancelConsultData) throws ApiException {
com.squareup.okhttp.Call call = cancelConsultationChatValidateBeforeCall(id, mediatype, cancelConsultData, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Cancel a chat consultation request (asynchronously)
* Cancel a chat consultation request that was initialized by calling [/media/chat/interactions/{id}/consult-by-queue](/reference/workspace/Media/index.html#consultByQueue). If the agent has already accepted the invitation, the Workspace API can't cancel the consultation.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param cancelConsultData Request parameters. (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 cancelConsultationChatAsync(String id, String mediatype, CancelConsultData cancelConsultData, 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 = cancelConsultationChatValidateBeforeCall(id, mediatype, cancelConsultData, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for chatMessages
* @param mediatype The chat media channel. (required)
* @param id The ID of the chat interaction. (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 chatMessagesCall(String mediatype, String id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/media/{mediatype}/interactions/{id}/messages"
.replaceAll("\\{" + "mediatype" + "\\}", apiClient.escapeString(mediatype.toString()))
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call chatMessagesValidateBeforeCall(String mediatype, String id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'mediatype' is set
if (mediatype == null) {
throw new ApiException("Missing the required parameter 'mediatype' when calling chatMessages(Async)");
}
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling chatMessages(Async)");
}
com.squareup.okhttp.Call call = chatMessagesCall(mediatype, id, progressListener, progressRequestListener);
return call;
}
/**
* Get chat transcript
* Get a transcript for the specified chat interaction.
* @param mediatype The chat media channel. (required)
* @param id The ID of the chat interaction. (required)
* @return Object
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public Object chatMessages(String mediatype, String id) throws ApiException {
ApiResponse resp = chatMessagesWithHttpInfo(mediatype, id);
return resp.getData();
}
/**
* Get chat transcript
* Get a transcript for the specified chat interaction.
* @param mediatype The chat media channel. (required)
* @param id The ID of the chat interaction. (required)
* @return ApiResponse<Object>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse chatMessagesWithHttpInfo(String mediatype, String id) throws ApiException {
com.squareup.okhttp.Call call = chatMessagesValidateBeforeCall(mediatype, id, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get chat transcript (asynchronously)
* Get a transcript for the specified chat interaction.
* @param mediatype The chat media channel. (required)
* @param id The ID of the chat interaction. (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 chatMessagesAsync(String mediatype, String id, 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 = chatMessagesValidateBeforeCall(mediatype, id, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for consult
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param consultData (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 consultCall(String id, String mediatype, ConsultData consultData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = consultData;
// create path and map variables
String localVarPath = "/media/{mediatype}/interactions/{id}/consult"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "mediatype" + "\\}", apiClient.escapeString(mediatype.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call consultValidateBeforeCall(String id, String mediatype, ConsultData consultData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling consult(Async)");
}
// verify the required parameter 'mediatype' is set
if (mediatype == null) {
throw new ApiException("Missing the required parameter 'mediatype' when calling consult(Async)");
}
// verify the required parameter 'consultData' is set
if (consultData == null) {
throw new ApiException("Missing the required parameter 'consultData' when calling consult(Async)");
}
com.squareup.okhttp.Call call = consultCall(id, mediatype, consultData, progressListener, progressRequestListener);
return call;
}
/**
* Consult with another agent
* A consult occurs in the context of the specified chat, but the customer is not aware of the consulting agent. Messages and notifications from the consulting agent are only visible to other agents in the chat, not to the customer. After the consulting agent accepts the consultation, the originating agent can either transfer the chat to the consulting agent ([/media/{mediatype}/interactions/{id}/transfer-agent](/reference/workspace/Media/index.html#transferAgent)), add them in a conference ([/media/chat/interactions/{id}/invite](/reference/workspace/Media/index.html#invite)) or the consulting agent can leave the chat ([/media/chat/interactions/{id}/leave](/reference/workspace/Media/index.html#leaveChat)).
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param consultData (required)
* @return ApiSuccessResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiSuccessResponse consult(String id, String mediatype, ConsultData consultData) throws ApiException {
ApiResponse resp = consultWithHttpInfo(id, mediatype, consultData);
return resp.getData();
}
/**
* Consult with another agent
* A consult occurs in the context of the specified chat, but the customer is not aware of the consulting agent. Messages and notifications from the consulting agent are only visible to other agents in the chat, not to the customer. After the consulting agent accepts the consultation, the originating agent can either transfer the chat to the consulting agent ([/media/{mediatype}/interactions/{id}/transfer-agent](/reference/workspace/Media/index.html#transferAgent)), add them in a conference ([/media/chat/interactions/{id}/invite](/reference/workspace/Media/index.html#invite)) or the consulting agent can leave the chat ([/media/chat/interactions/{id}/leave](/reference/workspace/Media/index.html#leaveChat)).
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param consultData (required)
* @return ApiResponse<ApiSuccessResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse consultWithHttpInfo(String id, String mediatype, ConsultData consultData) throws ApiException {
com.squareup.okhttp.Call call = consultValidateBeforeCall(id, mediatype, consultData, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Consult with another agent (asynchronously)
* A consult occurs in the context of the specified chat, but the customer is not aware of the consulting agent. Messages and notifications from the consulting agent are only visible to other agents in the chat, not to the customer. After the consulting agent accepts the consultation, the originating agent can either transfer the chat to the consulting agent ([/media/{mediatype}/interactions/{id}/transfer-agent](/reference/workspace/Media/index.html#transferAgent)), add them in a conference ([/media/chat/interactions/{id}/invite](/reference/workspace/Media/index.html#invite)) or the consulting agent can leave the chat ([/media/chat/interactions/{id}/leave](/reference/workspace/Media/index.html#leaveChat)).
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param consultData (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 consultAsync(String id, String mediatype, ConsultData consultData, 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 = consultValidateBeforeCall(id, mediatype, consultData, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for consultByQueue
* @param mediatype The chat media channel. (required)
* @param id The ID of the chat interaction. (required)
* @param consultData (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 consultByQueueCall(String mediatype, String id, ConsultData1 consultData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = consultData;
// create path and map variables
String localVarPath = "/media/{mediatype}/interactions/{id}/consult-by-queue"
.replaceAll("\\{" + "mediatype" + "\\}", apiClient.escapeString(mediatype.toString()))
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call consultByQueueValidateBeforeCall(String mediatype, String id, ConsultData1 consultData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'mediatype' is set
if (mediatype == null) {
throw new ApiException("Missing the required parameter 'mediatype' when calling consultByQueue(Async)");
}
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling consultByQueue(Async)");
}
// verify the required parameter 'consultData' is set
if (consultData == null) {
throw new ApiException("Missing the required parameter 'consultData' when calling consultByQueue(Async)");
}
com.squareup.okhttp.Call call = consultByQueueCall(mediatype, id, consultData, progressListener, progressRequestListener);
return call;
}
/**
* Consult with another agent via a queue
* Consult with another agent during a chat by sending an consult invitation to the specified queue. A consult occurs in the context of the specified chat, but the customer is not aware of the consulting agent. Messages and notifications from the consulting agent are only visible to other agents in the cat, not to the customer. After the consulting agent accepts the consultation, the originating agent can either transfer the chat to the consulting agent ([/media/{mediatype}/interactions/{id}/transfer-agent](/reference/workspace/Media/index.html#transferAgent)), add them in a conference ([/media/chat/interactions/{id}/invite](/reference/workspace/Media/index.html#invite)) or the consulting agent can leave the chat ([/media/chat/interactions/{id}/leave](/reference/workspace/Media/index.html#leaveChat)).
* @param mediatype The chat media channel. (required)
* @param id The ID of the chat interaction. (required)
* @param consultData (required)
* @return ApiSuccessResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiSuccessResponse consultByQueue(String mediatype, String id, ConsultData1 consultData) throws ApiException {
ApiResponse resp = consultByQueueWithHttpInfo(mediatype, id, consultData);
return resp.getData();
}
/**
* Consult with another agent via a queue
* Consult with another agent during a chat by sending an consult invitation to the specified queue. A consult occurs in the context of the specified chat, but the customer is not aware of the consulting agent. Messages and notifications from the consulting agent are only visible to other agents in the cat, not to the customer. After the consulting agent accepts the consultation, the originating agent can either transfer the chat to the consulting agent ([/media/{mediatype}/interactions/{id}/transfer-agent](/reference/workspace/Media/index.html#transferAgent)), add them in a conference ([/media/chat/interactions/{id}/invite](/reference/workspace/Media/index.html#invite)) or the consulting agent can leave the chat ([/media/chat/interactions/{id}/leave](/reference/workspace/Media/index.html#leaveChat)).
* @param mediatype The chat media channel. (required)
* @param id The ID of the chat interaction. (required)
* @param consultData (required)
* @return ApiResponse<ApiSuccessResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse consultByQueueWithHttpInfo(String mediatype, String id, ConsultData1 consultData) throws ApiException {
com.squareup.okhttp.Call call = consultByQueueValidateBeforeCall(mediatype, id, consultData, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Consult with another agent via a queue (asynchronously)
* Consult with another agent during a chat by sending an consult invitation to the specified queue. A consult occurs in the context of the specified chat, but the customer is not aware of the consulting agent. Messages and notifications from the consulting agent are only visible to other agents in the cat, not to the customer. After the consulting agent accepts the consultation, the originating agent can either transfer the chat to the consulting agent ([/media/{mediatype}/interactions/{id}/transfer-agent](/reference/workspace/Media/index.html#transferAgent)), add them in a conference ([/media/chat/interactions/{id}/invite](/reference/workspace/Media/index.html#invite)) or the consulting agent can leave the chat ([/media/chat/interactions/{id}/leave](/reference/workspace/Media/index.html#leaveChat)).
* @param mediatype The chat media channel. (required)
* @param id The ID of the chat interaction. (required)
* @param consultData (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 consultByQueueAsync(String mediatype, String id, ConsultData1 consultData, 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 = consultByQueueValidateBeforeCall(mediatype, id, consultData, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for invite
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param inviteData (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 inviteCall(String id, String mediatype, InviteData inviteData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = inviteData;
// create path and map variables
String localVarPath = "/media/{mediatype}/interactions/{id}/invite"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "mediatype" + "\\}", apiClient.escapeString(mediatype.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call inviteValidateBeforeCall(String id, String mediatype, InviteData inviteData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling invite(Async)");
}
// verify the required parameter 'mediatype' is set
if (mediatype == null) {
throw new ApiException("Missing the required parameter 'mediatype' when calling invite(Async)");
}
// verify the required parameter 'inviteData' is set
if (inviteData == null) {
throw new ApiException("Missing the required parameter 'inviteData' when calling invite(Async)");
}
com.squareup.okhttp.Call call = inviteCall(id, mediatype, inviteData, progressListener, progressRequestListener);
return call;
}
/**
* Invite another agent to a chat
* Invite another agent to join the specified chat conference. The customer is notified when the invited agent joins the chat. The agents can communicate with the customer or they can communicate with each other without the customer seeing their messages, depending on the value you set for the **visibility** parameter when you call [/media/chat/interactions/{id}/send-message](/reference/workspace/Media/index.html#sendMessage).
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param inviteData (required)
* @return ApiSuccessResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiSuccessResponse invite(String id, String mediatype, InviteData inviteData) throws ApiException {
ApiResponse resp = inviteWithHttpInfo(id, mediatype, inviteData);
return resp.getData();
}
/**
* Invite another agent to a chat
* Invite another agent to join the specified chat conference. The customer is notified when the invited agent joins the chat. The agents can communicate with the customer or they can communicate with each other without the customer seeing their messages, depending on the value you set for the **visibility** parameter when you call [/media/chat/interactions/{id}/send-message](/reference/workspace/Media/index.html#sendMessage).
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param inviteData (required)
* @return ApiResponse<ApiSuccessResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse inviteWithHttpInfo(String id, String mediatype, InviteData inviteData) throws ApiException {
com.squareup.okhttp.Call call = inviteValidateBeforeCall(id, mediatype, inviteData, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Invite another agent to a chat (asynchronously)
* Invite another agent to join the specified chat conference. The customer is notified when the invited agent joins the chat. The agents can communicate with the customer or they can communicate with each other without the customer seeing their messages, depending on the value you set for the **visibility** parameter when you call [/media/chat/interactions/{id}/send-message](/reference/workspace/Media/index.html#sendMessage).
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param inviteData (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 inviteAsync(String id, String mediatype, InviteData inviteData, 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 = inviteValidateBeforeCall(id, mediatype, inviteData, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for inviteByQueue
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param inviteData (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 inviteByQueueCall(String id, String mediatype, InviteData1 inviteData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = inviteData;
// create path and map variables
String localVarPath = "/media/{mediatype}/interactions/{id}/invite-by-queue"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "mediatype" + "\\}", apiClient.escapeString(mediatype.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call inviteByQueueValidateBeforeCall(String id, String mediatype, InviteData1 inviteData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling inviteByQueue(Async)");
}
// verify the required parameter 'mediatype' is set
if (mediatype == null) {
throw new ApiException("Missing the required parameter 'mediatype' when calling inviteByQueue(Async)");
}
// verify the required parameter 'inviteData' is set
if (inviteData == null) {
throw new ApiException("Missing the required parameter 'inviteData' when calling inviteByQueue(Async)");
}
com.squareup.okhttp.Call call = inviteByQueueCall(id, mediatype, inviteData, progressListener, progressRequestListener);
return call;
}
/**
* Invite another agent to a chat via a queue
* Invite another agent to the chat conference by sending an invitation to the specified queue. The next available agent in the queue is then sent an invite to join the chat. The customer is notified when the invited agent joins the chat. The agents can communicate with the customer or they can communicate with each other without the customer seeing their messages, depending on the value you set for the **visibility** parameter when you call [/media/chat/interactions/{id}/send-message](/reference/workspace/Media/index.html#sendMessage).
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param inviteData (required)
* @return ApiSuccessResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiSuccessResponse inviteByQueue(String id, String mediatype, InviteData1 inviteData) throws ApiException {
ApiResponse resp = inviteByQueueWithHttpInfo(id, mediatype, inviteData);
return resp.getData();
}
/**
* Invite another agent to a chat via a queue
* Invite another agent to the chat conference by sending an invitation to the specified queue. The next available agent in the queue is then sent an invite to join the chat. The customer is notified when the invited agent joins the chat. The agents can communicate with the customer or they can communicate with each other without the customer seeing their messages, depending on the value you set for the **visibility** parameter when you call [/media/chat/interactions/{id}/send-message](/reference/workspace/Media/index.html#sendMessage).
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param inviteData (required)
* @return ApiResponse<ApiSuccessResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse inviteByQueueWithHttpInfo(String id, String mediatype, InviteData1 inviteData) throws ApiException {
com.squareup.okhttp.Call call = inviteByQueueValidateBeforeCall(id, mediatype, inviteData, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Invite another agent to a chat via a queue (asynchronously)
* Invite another agent to the chat conference by sending an invitation to the specified queue. The next available agent in the queue is then sent an invite to join the chat. The customer is notified when the invited agent joins the chat. The agents can communicate with the customer or they can communicate with each other without the customer seeing their messages, depending on the value you set for the **visibility** parameter when you call [/media/chat/interactions/{id}/send-message](/reference/workspace/Media/index.html#sendMessage).
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param inviteData (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 inviteByQueueAsync(String id, String mediatype, InviteData1 inviteData, 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 = inviteByQueueValidateBeforeCall(id, mediatype, inviteData, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for leaveChat
* @param mediatype The chat media channel. (required)
* @param id The ID of the chat interaction. (required)
* @param leaveData Request parameters. (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 leaveChatCall(String mediatype, String id, LeaveData leaveData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = leaveData;
// create path and map variables
String localVarPath = "/media/{mediatype}/interactions/{id}/leave"
.replaceAll("\\{" + "mediatype" + "\\}", apiClient.escapeString(mediatype.toString()))
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call leaveChatValidateBeforeCall(String mediatype, String id, LeaveData leaveData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'mediatype' is set
if (mediatype == null) {
throw new ApiException("Missing the required parameter 'mediatype' when calling leaveChat(Async)");
}
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling leaveChat(Async)");
}
com.squareup.okhttp.Call call = leaveChatCall(mediatype, id, leaveData, progressListener, progressRequestListener);
return call;
}
/**
* Leave a chat
* Leave the specified chat or conference. If the agent is in a conference, the chat session stays open for the customer. If the agent is not in a conference, the chat ends for the customer but the agent can still update user data and set disposition.
* @param mediatype The chat media channel. (required)
* @param id The ID of the chat interaction. (required)
* @param leaveData Request parameters. (optional)
* @return ApiSuccessResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiSuccessResponse leaveChat(String mediatype, String id, LeaveData leaveData) throws ApiException {
ApiResponse resp = leaveChatWithHttpInfo(mediatype, id, leaveData);
return resp.getData();
}
/**
* Leave a chat
* Leave the specified chat or conference. If the agent is in a conference, the chat session stays open for the customer. If the agent is not in a conference, the chat ends for the customer but the agent can still update user data and set disposition.
* @param mediatype The chat media channel. (required)
* @param id The ID of the chat interaction. (required)
* @param leaveData Request parameters. (optional)
* @return ApiResponse<ApiSuccessResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse leaveChatWithHttpInfo(String mediatype, String id, LeaveData leaveData) throws ApiException {
com.squareup.okhttp.Call call = leaveChatValidateBeforeCall(mediatype, id, leaveData, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Leave a chat (asynchronously)
* Leave the specified chat or conference. If the agent is in a conference, the chat session stays open for the customer. If the agent is not in a conference, the chat ends for the customer but the agent can still update user data and set disposition.
* @param mediatype The chat media channel. (required)
* @param id The ID of the chat interaction. (required)
* @param leaveData Request parameters. (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 leaveChatAsync(String mediatype, String id, LeaveData leaveData, 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 = leaveChatValidateBeforeCall(mediatype, id, leaveData, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for removeFromConference
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param removeFromConferenceData (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 removeFromConferenceCall(String id, String mediatype, RemoveFromConferenceData removeFromConferenceData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = removeFromConferenceData;
// create path and map variables
String localVarPath = "/media/{mediatype}/interactions/{id}/remove-from-conference"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "mediatype" + "\\}", apiClient.escapeString(mediatype.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call removeFromConferenceValidateBeforeCall(String id, String mediatype, RemoveFromConferenceData removeFromConferenceData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling removeFromConference(Async)");
}
// verify the required parameter 'mediatype' is set
if (mediatype == null) {
throw new ApiException("Missing the required parameter 'mediatype' when calling removeFromConference(Async)");
}
// verify the required parameter 'removeFromConferenceData' is set
if (removeFromConferenceData == null) {
throw new ApiException("Missing the required parameter 'removeFromConferenceData' when calling removeFromConference(Async)");
}
com.squareup.okhttp.Call call = removeFromConferenceCall(id, mediatype, removeFromConferenceData, progressListener, progressRequestListener);
return call;
}
/**
* Remove an agent from a chat conference
* Remove the specified agent from the chat conference.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param removeFromConferenceData (required)
* @return ApiSuccessResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiSuccessResponse removeFromConference(String id, String mediatype, RemoveFromConferenceData removeFromConferenceData) throws ApiException {
ApiResponse resp = removeFromConferenceWithHttpInfo(id, mediatype, removeFromConferenceData);
return resp.getData();
}
/**
* Remove an agent from a chat conference
* Remove the specified agent from the chat conference.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param removeFromConferenceData (required)
* @return ApiResponse<ApiSuccessResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse removeFromConferenceWithHttpInfo(String id, String mediatype, RemoveFromConferenceData removeFromConferenceData) throws ApiException {
com.squareup.okhttp.Call call = removeFromConferenceValidateBeforeCall(id, mediatype, removeFromConferenceData, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Remove an agent from a chat conference (asynchronously)
* Remove the specified agent from the chat conference.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param removeFromConferenceData (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 removeFromConferenceAsync(String id, String mediatype, RemoveFromConferenceData removeFromConferenceData, 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 = removeFromConferenceValidateBeforeCall(id, mediatype, removeFromConferenceData, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for sendCustomNotification
* @param mediatype The chat media channel. (required)
* @param id The ID of the chat interaction. (required)
* @param customNotificationData Request parameters. (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 sendCustomNotificationCall(String mediatype, String id, CustomNotificationData customNotificationData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = customNotificationData;
// create path and map variables
String localVarPath = "/media/{mediatype}/interactions/{id}/send-custom-notification"
.replaceAll("\\{" + "mediatype" + "\\}", apiClient.escapeString(mediatype.toString()))
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call sendCustomNotificationValidateBeforeCall(String mediatype, String id, CustomNotificationData customNotificationData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'mediatype' is set
if (mediatype == null) {
throw new ApiException("Missing the required parameter 'mediatype' when calling sendCustomNotification(Async)");
}
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling sendCustomNotification(Async)");
}
com.squareup.okhttp.Call call = sendCustomNotificationCall(mediatype, id, customNotificationData, progressListener, progressRequestListener);
return call;
}
/**
* Send a custom notification
* Send a custom notification to the specified chat. The notification is typically used as a trigger for some custom behavior on the recipient's end.
* @param mediatype The chat media channel. (required)
* @param id The ID of the chat interaction. (required)
* @param customNotificationData Request parameters. (optional)
* @return ApiSuccessResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiSuccessResponse sendCustomNotification(String mediatype, String id, CustomNotificationData customNotificationData) throws ApiException {
ApiResponse resp = sendCustomNotificationWithHttpInfo(mediatype, id, customNotificationData);
return resp.getData();
}
/**
* Send a custom notification
* Send a custom notification to the specified chat. The notification is typically used as a trigger for some custom behavior on the recipient's end.
* @param mediatype The chat media channel. (required)
* @param id The ID of the chat interaction. (required)
* @param customNotificationData Request parameters. (optional)
* @return ApiResponse<ApiSuccessResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse sendCustomNotificationWithHttpInfo(String mediatype, String id, CustomNotificationData customNotificationData) throws ApiException {
com.squareup.okhttp.Call call = sendCustomNotificationValidateBeforeCall(mediatype, id, customNotificationData, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Send a custom notification (asynchronously)
* Send a custom notification to the specified chat. The notification is typically used as a trigger for some custom behavior on the recipient's end.
* @param mediatype The chat media channel. (required)
* @param id The ID of the chat interaction. (required)
* @param customNotificationData Request parameters. (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 sendCustomNotificationAsync(String mediatype, String id, CustomNotificationData customNotificationData, 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 = sendCustomNotificationValidateBeforeCall(mediatype, id, customNotificationData, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for sendMessage
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param acceptData Request parameters. (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 sendMessageCall(String id, String mediatype, AcceptData1 acceptData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = acceptData;
// create path and map variables
String localVarPath = "/media/{mediatype}/interactions/{id}/send-message"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "mediatype" + "\\}", apiClient.escapeString(mediatype.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call sendMessageValidateBeforeCall(String id, String mediatype, AcceptData1 acceptData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling sendMessage(Async)");
}
// verify the required parameter 'mediatype' is set
if (mediatype == null) {
throw new ApiException("Missing the required parameter 'mediatype' when calling sendMessage(Async)");
}
com.squareup.okhttp.Call call = sendMessageCall(id, mediatype, acceptData, progressListener, progressRequestListener);
return call;
}
/**
* Send a message
* Send a message to participants in the specified chat.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param acceptData Request parameters. (optional)
* @return ApiSuccessResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiSuccessResponse sendMessage(String id, String mediatype, AcceptData1 acceptData) throws ApiException {
ApiResponse resp = sendMessageWithHttpInfo(id, mediatype, acceptData);
return resp.getData();
}
/**
* Send a message
* Send a message to participants in the specified chat.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param acceptData Request parameters. (optional)
* @return ApiResponse<ApiSuccessResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse sendMessageWithHttpInfo(String id, String mediatype, AcceptData1 acceptData) throws ApiException {
com.squareup.okhttp.Call call = sendMessageValidateBeforeCall(id, mediatype, acceptData, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Send a message (asynchronously)
* Send a message to participants in the specified chat.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param acceptData Request parameters. (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 sendMessageAsync(String id, String mediatype, AcceptData1 acceptData, 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 = sendMessageValidateBeforeCall(id, mediatype, acceptData, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for sendTypingStarted
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param typingStartedData Request parameters. (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 sendTypingStartedCall(String id, String mediatype, TypingStartedData typingStartedData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = typingStartedData;
// create path and map variables
String localVarPath = "/media/{mediatype}/interactions/{id}/send-typing-started"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "mediatype" + "\\}", apiClient.escapeString(mediatype.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call sendTypingStartedValidateBeforeCall(String id, String mediatype, TypingStartedData typingStartedData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling sendTypingStarted(Async)");
}
// verify the required parameter 'mediatype' is set
if (mediatype == null) {
throw new ApiException("Missing the required parameter 'mediatype' when calling sendTypingStarted(Async)");
}
com.squareup.okhttp.Call call = sendTypingStartedCall(id, mediatype, typingStartedData, progressListener, progressRequestListener);
return call;
}
/**
* Send notification that the agent is typing
* Send notification that the agent is typing to the other participants in the specified chat.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param typingStartedData Request parameters. (optional)
* @return ApiSuccessResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiSuccessResponse sendTypingStarted(String id, String mediatype, TypingStartedData typingStartedData) throws ApiException {
ApiResponse resp = sendTypingStartedWithHttpInfo(id, mediatype, typingStartedData);
return resp.getData();
}
/**
* Send notification that the agent is typing
* Send notification that the agent is typing to the other participants in the specified chat.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param typingStartedData Request parameters. (optional)
* @return ApiResponse<ApiSuccessResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse sendTypingStartedWithHttpInfo(String id, String mediatype, TypingStartedData typingStartedData) throws ApiException {
com.squareup.okhttp.Call call = sendTypingStartedValidateBeforeCall(id, mediatype, typingStartedData, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Send notification that the agent is typing (asynchronously)
* Send notification that the agent is typing to the other participants in the specified chat.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param typingStartedData Request parameters. (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 sendTypingStartedAsync(String id, String mediatype, TypingStartedData typingStartedData, 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 = sendTypingStartedValidateBeforeCall(id, mediatype, typingStartedData, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for sendTypingStopped
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param typingStoppedData Request parameters. (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 sendTypingStoppedCall(String id, String mediatype, TypingStoppedData typingStoppedData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = typingStoppedData;
// create path and map variables
String localVarPath = "/media/{mediatype}/interactions/{id}/send-typing-stopped"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "mediatype" + "\\}", apiClient.escapeString(mediatype.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call sendTypingStoppedValidateBeforeCall(String id, String mediatype, TypingStoppedData typingStoppedData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling sendTypingStopped(Async)");
}
// verify the required parameter 'mediatype' is set
if (mediatype == null) {
throw new ApiException("Missing the required parameter 'mediatype' when calling sendTypingStopped(Async)");
}
com.squareup.okhttp.Call call = sendTypingStoppedCall(id, mediatype, typingStoppedData, progressListener, progressRequestListener);
return call;
}
/**
* Send notification that the agent stopped typing
* Send notification that the agent stopped typing to the other participants in the specified chat.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param typingStoppedData Request parameters. (optional)
* @return ApiSuccessResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiSuccessResponse sendTypingStopped(String id, String mediatype, TypingStoppedData typingStoppedData) throws ApiException {
ApiResponse resp = sendTypingStoppedWithHttpInfo(id, mediatype, typingStoppedData);
return resp.getData();
}
/**
* Send notification that the agent stopped typing
* Send notification that the agent stopped typing to the other participants in the specified chat.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param typingStoppedData Request parameters. (optional)
* @return ApiResponse<ApiSuccessResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse sendTypingStoppedWithHttpInfo(String id, String mediatype, TypingStoppedData typingStoppedData) throws ApiException {
com.squareup.okhttp.Call call = sendTypingStoppedValidateBeforeCall(id, mediatype, typingStoppedData, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Send notification that the agent stopped typing (asynchronously)
* Send notification that the agent stopped typing to the other participants in the specified chat.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param typingStoppedData Request parameters. (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 sendTypingStoppedAsync(String id, String mediatype, TypingStoppedData typingStoppedData, 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 = sendTypingStoppedValidateBeforeCall(id, mediatype, typingStoppedData, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for sendUrlData
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param acceptData Request parameters. (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 sendUrlDataCall(String id, String mediatype, AcceptData2 acceptData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = acceptData;
// create path and map variables
String localVarPath = "/media/{mediatype}/interactions/{id}/send-url"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "mediatype" + "\\}", apiClient.escapeString(mediatype.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call sendUrlDataValidateBeforeCall(String id, String mediatype, AcceptData2 acceptData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling sendUrlData(Async)");
}
// verify the required parameter 'mediatype' is set
if (mediatype == null) {
throw new ApiException("Missing the required parameter 'mediatype' when calling sendUrlData(Async)");
}
com.squareup.okhttp.Call call = sendUrlDataCall(id, mediatype, acceptData, progressListener, progressRequestListener);
return call;
}
/**
* Send a URL
* Send a URL to participants in the specified chat.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param acceptData Request parameters. (optional)
* @return ApiSuccessResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiSuccessResponse sendUrlData(String id, String mediatype, AcceptData2 acceptData) throws ApiException {
ApiResponse resp = sendUrlDataWithHttpInfo(id, mediatype, acceptData);
return resp.getData();
}
/**
* Send a URL
* Send a URL to participants in the specified chat.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param acceptData Request parameters. (optional)
* @return ApiResponse<ApiSuccessResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse sendUrlDataWithHttpInfo(String id, String mediatype, AcceptData2 acceptData) throws ApiException {
com.squareup.okhttp.Call call = sendUrlDataValidateBeforeCall(id, mediatype, acceptData, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Send a URL (asynchronously)
* Send a URL to participants in the specified chat.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param acceptData Request parameters. (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 sendUrlDataAsync(String id, String mediatype, AcceptData2 acceptData, 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 = sendUrlDataValidateBeforeCall(id, mediatype, acceptData, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for updateNickname
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param updateNicknameData Request parameters. (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 updateNicknameCall(String id, String mediatype, UpdateNicknameData updateNicknameData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = updateNicknameData;
// create path and map variables
String localVarPath = "/media/{mediatype}/interactions/{id}/update-nickname"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "mediatype" + "\\}", apiClient.escapeString(mediatype.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call updateNicknameValidateBeforeCall(String id, String mediatype, UpdateNicknameData updateNicknameData, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling updateNickname(Async)");
}
// verify the required parameter 'mediatype' is set
if (mediatype == null) {
throw new ApiException("Missing the required parameter 'mediatype' when calling updateNickname(Async)");
}
com.squareup.okhttp.Call call = updateNicknameCall(id, mediatype, updateNicknameData, progressListener, progressRequestListener);
return call;
}
/**
* Update an agent's nickname
* Update the agent's nickname for the specified chat.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param updateNicknameData Request parameters. (optional)
* @return ApiSuccessResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiSuccessResponse updateNickname(String id, String mediatype, UpdateNicknameData updateNicknameData) throws ApiException {
ApiResponse resp = updateNicknameWithHttpInfo(id, mediatype, updateNicknameData);
return resp.getData();
}
/**
* Update an agent's nickname
* Update the agent's nickname for the specified chat.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param updateNicknameData Request parameters. (optional)
* @return ApiResponse<ApiSuccessResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse updateNicknameWithHttpInfo(String id, String mediatype, UpdateNicknameData updateNicknameData) throws ApiException {
com.squareup.okhttp.Call call = updateNicknameValidateBeforeCall(id, mediatype, updateNicknameData, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Update an agent's nickname (asynchronously)
* Update the agent's nickname for the specified chat.
* @param id The ID of the chat interaction. (required)
* @param mediatype The chat media channel. (required)
* @param updateNicknameData Request parameters. (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 updateNicknameAsync(String id, String mediatype, UpdateNicknameData updateNicknameData, 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 = updateNicknameValidateBeforeCall(id, mediatype, updateNicknameData, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
}