com.genesys.internal.workspace.api.NotificationsApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of workspace Show documentation
Show all versions of workspace Show documentation
A Java library to interface to Genesys Workspace public API
/*
* Workspace API
* Agent API
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package com.genesys.internal.workspace.api;
import com.genesys.internal.common.ApiCallback;
import com.genesys.internal.common.ApiClient;
import com.genesys.internal.common.ApiException;
import com.genesys.internal.common.ApiResponse;
import com.genesys.internal.common.Configuration;
import com.genesys.internal.common.Pair;
import com.genesys.internal.common.ProgressRequestBody;
import com.genesys.internal.common.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class NotificationsApi {
private ApiClient apiClient;
public NotificationsApi() {
this(Configuration.getDefaultApiClient());
}
public NotificationsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Build call for notifications
* @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 notificationsCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/notifications";
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 notificationsValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = notificationsCall(progressListener, progressRequestListener);
return call;
}
/**
* Enables subscription to CometD notification API
* Receives one of CometD notification events The following events are available<br> <h5>Channel: /workspace/v3/initialization</h5> Value:<br> {<br> data : {<br> state: 'initialization state'<br> <ul> <li><b>\"Complete\"</b> Initialization was completed successfully</li> <li><b>\"Failed\"</b> Initialization failed</li> </ul><br> }<br> }<br> <h5>Channel: /workspace/v3/voice</h5> Type: <ul> <li><b>\"CallStateChanged\"</b> Call status or state changed</li> Value:<br> {<br> call: {<br> id: '016202a673223196',<br> phoneNumber: '7504772884',<br> connId: '016202a673223196',<br> callUuid: '00PJ6OJ3OSCMR24QETB382LAES000CIG',<br> extensions: [ [list of DN extensions] ],<br> dnis: '7504772885',<br> callType: 'Internal',<br> state: 'state',<br> <ul> <li><b>\"Ringing\"</b> Ringing in progress <li><b>\"Dialing\"</b> Dialing in progress <li><b>\"Established</b> Call established <li><b>\"Released</b> Call released </ul> <br> participants: [ [list of participants] ],<br> capabilities:<br> [ 'release',<br> 'clear',<br> 'attach-user-data',<br> 'update-user-data',<br> 'delete-user-data-pair',<br> 'send-dtmf',<br> 'start-recording'<br> ],<br> duration: 0 <br> },<br> type: 'CallStateChanged' <br> }<br> <li><b>\"DnStateChanged\"</b> DN state changed</li> Value:<br> {<br> dn: { <br> number: '7504772884',<br> switchName: 'ap-southeast-2',<br> agentId: '7504772884',<br> capabilities: [ 'ready', 'not-ready', 'dnd-on', 'set-forward' ],<br> agentState: 'LoggedOut',<br> agentWorkMode: 'Unknown' <br> },<br> type: 'DnStateChanged' <br> } </ul>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void notifications() throws ApiException {
notificationsWithHttpInfo();
}
/**
* Enables subscription to CometD notification API
* Receives one of CometD notification events The following events are available<br> <h5>Channel: /workspace/v3/initialization</h5> Value:<br> {<br> data : {<br> state: 'initialization state'<br> <ul> <li><b>\"Complete\"</b> Initialization was completed successfully</li> <li><b>\"Failed\"</b> Initialization failed</li> </ul><br> }<br> }<br> <h5>Channel: /workspace/v3/voice</h5> Type: <ul> <li><b>\"CallStateChanged\"</b> Call status or state changed</li> Value:<br> {<br> call: {<br> id: '016202a673223196',<br> phoneNumber: '7504772884',<br> connId: '016202a673223196',<br> callUuid: '00PJ6OJ3OSCMR24QETB382LAES000CIG',<br> extensions: [ [list of DN extensions] ],<br> dnis: '7504772885',<br> callType: 'Internal',<br> state: 'state',<br> <ul> <li><b>\"Ringing\"</b> Ringing in progress <li><b>\"Dialing\"</b> Dialing in progress <li><b>\"Established</b> Call established <li><b>\"Released</b> Call released </ul> <br> participants: [ [list of participants] ],<br> capabilities:<br> [ 'release',<br> 'clear',<br> 'attach-user-data',<br> 'update-user-data',<br> 'delete-user-data-pair',<br> 'send-dtmf',<br> 'start-recording'<br> ],<br> duration: 0 <br> },<br> type: 'CallStateChanged' <br> }<br> <li><b>\"DnStateChanged\"</b> DN state changed</li> Value:<br> {<br> dn: { <br> number: '7504772884',<br> switchName: 'ap-southeast-2',<br> agentId: '7504772884',<br> capabilities: [ 'ready', 'not-ready', 'dnd-on', 'set-forward' ],<br> agentState: 'LoggedOut',<br> agentWorkMode: 'Unknown' <br> },<br> type: 'DnStateChanged' <br> } </ul>
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse notificationsWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = notificationsValidateBeforeCall(null, null);
return apiClient.execute(call);
}
/**
* Enables subscription to CometD notification API (asynchronously)
* Receives one of CometD notification events The following events are available<br> <h5>Channel: /workspace/v3/initialization</h5> Value:<br> {<br> data : {<br> state: 'initialization state'<br> <ul> <li><b>\"Complete\"</b> Initialization was completed successfully</li> <li><b>\"Failed\"</b> Initialization failed</li> </ul><br> }<br> }<br> <h5>Channel: /workspace/v3/voice</h5> Type: <ul> <li><b>\"CallStateChanged\"</b> Call status or state changed</li> Value:<br> {<br> call: {<br> id: '016202a673223196',<br> phoneNumber: '7504772884',<br> connId: '016202a673223196',<br> callUuid: '00PJ6OJ3OSCMR24QETB382LAES000CIG',<br> extensions: [ [list of DN extensions] ],<br> dnis: '7504772885',<br> callType: 'Internal',<br> state: 'state',<br> <ul> <li><b>\"Ringing\"</b> Ringing in progress <li><b>\"Dialing\"</b> Dialing in progress <li><b>\"Established</b> Call established <li><b>\"Released</b> Call released </ul> <br> participants: [ [list of participants] ],<br> capabilities:<br> [ 'release',<br> 'clear',<br> 'attach-user-data',<br> 'update-user-data',<br> 'delete-user-data-pair',<br> 'send-dtmf',<br> 'start-recording'<br> ],<br> duration: 0 <br> },<br> type: 'CallStateChanged' <br> }<br> <li><b>\"DnStateChanged\"</b> DN state changed</li> Value:<br> {<br> dn: { <br> number: '7504772884',<br> switchName: 'ap-southeast-2',<br> agentId: '7504772884',<br> capabilities: [ 'ready', 'not-ready', 'dnd-on', 'set-forward' ],<br> agentState: 'LoggedOut',<br> agentWorkMode: 'Unknown' <br> },<br> type: 'DnStateChanged' <br> } </ul>
* @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 notificationsAsync(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 = notificationsValidateBeforeCall(progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for notificationsConnect
* @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 notificationsConnectCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/notifications/connect";
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 notificationsConnectValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = notificationsConnectCall(progressListener, progressRequestListener);
return call;
}
/**
* Subscribes to CometD notifications
* Subscribes to CometD notifications
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void notificationsConnect() throws ApiException {
notificationsConnectWithHttpInfo();
}
/**
* Subscribes to CometD notifications
* Subscribes to CometD notifications
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse notificationsConnectWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = notificationsConnectValidateBeforeCall(null, null);
return apiClient.execute(call);
}
/**
* Subscribes to CometD notifications (asynchronously)
* Subscribes to CometD notifications
* @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 notificationsConnectAsync(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 = notificationsConnectValidateBeforeCall(progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for notificationsDisconnect
* @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 notificationsDisconnectCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/notifications/disconnect";
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 notificationsDisconnectValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = notificationsDisconnectCall(progressListener, progressRequestListener);
return call;
}
/**
* Close CometD notification subscriptions
* Close CometD notification subscriptions
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void notificationsDisconnect() throws ApiException {
notificationsDisconnectWithHttpInfo();
}
/**
* Close CometD notification subscriptions
* Close CometD notification subscriptions
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse notificationsDisconnectWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = notificationsDisconnectValidateBeforeCall(null, null);
return apiClient.execute(call);
}
/**
* Close CometD notification subscriptions (asynchronously)
* Close CometD notification subscriptions
* @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 notificationsDisconnectAsync(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 = notificationsDisconnectValidateBeforeCall(progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for notificationsHandshake
* @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 notificationsHandshakeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/notifications/handshake";
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 notificationsHandshakeValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = notificationsHandshakeCall(progressListener, progressRequestListener);
return call;
}
/**
* Subscribes to CometD notifications
* Subscribes to CometD notifications
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void notificationsHandshake() throws ApiException {
notificationsHandshakeWithHttpInfo();
}
/**
* Subscribes to CometD notifications
* Subscribes to CometD notifications
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse notificationsHandshakeWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = notificationsHandshakeValidateBeforeCall(null, null);
return apiClient.execute(call);
}
/**
* Subscribes to CometD notifications (asynchronously)
* Subscribes to CometD notifications
* @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 notificationsHandshakeAsync(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 = notificationsHandshakeValidateBeforeCall(progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for notificationsSubscribe
* @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 notificationsSubscribeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/notifications/subscribe";
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 notificationsSubscribeValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = notificationsSubscribeCall(progressListener, progressRequestListener);
return call;
}
/**
* Subscribes CometD channel notification
* Subscribes CometD channel notification.<br> <h5>The following channels are available right now:</h5> <ul> <li><b>/workspace/v3/initialization</b> Subscribe for initialization (login) event</li> <li><b>/workspace/v3/voice</b> Subscribe for call state change notification event</li> </ul>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void notificationsSubscribe() throws ApiException {
notificationsSubscribeWithHttpInfo();
}
/**
* Subscribes CometD channel notification
* Subscribes CometD channel notification.<br> <h5>The following channels are available right now:</h5> <ul> <li><b>/workspace/v3/initialization</b> Subscribe for initialization (login) event</li> <li><b>/workspace/v3/voice</b> Subscribe for call state change notification event</li> </ul>
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse notificationsSubscribeWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = notificationsSubscribeValidateBeforeCall(null, null);
return apiClient.execute(call);
}
/**
* Subscribes CometD channel notification (asynchronously)
* Subscribes CometD channel notification.<br> <h5>The following channels are available right now:</h5> <ul> <li><b>/workspace/v3/initialization</b> Subscribe for initialization (login) event</li> <li><b>/workspace/v3/voice</b> Subscribe for call state change notification event</li> </ul>
* @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 notificationsSubscribeAsync(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 = notificationsSubscribeValidateBeforeCall(progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for notificationsUnsubscribe
* @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 notificationsUnsubscribeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/notifications/unsubscribe";
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 notificationsUnsubscribeValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = notificationsUnsubscribeCall(progressListener, progressRequestListener);
return call;
}
/**
* Unsubscribes CometD channel notification
* Unsubscribes CometD channel notification
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void notificationsUnsubscribe() throws ApiException {
notificationsUnsubscribeWithHttpInfo();
}
/**
* Unsubscribes CometD channel notification
* Unsubscribes CometD channel notification
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse notificationsUnsubscribeWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = notificationsUnsubscribeValidateBeforeCall(null, null);
return apiClient.execute(call);
}
/**
* Unsubscribes CometD channel notification (asynchronously)
* Unsubscribes CometD channel notification
* @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 notificationsUnsubscribeAsync(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 = notificationsUnsubscribeValidateBeforeCall(progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for socketio
* @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 socketioCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/socket.io";
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 socketioValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = socketioCall(progressListener, progressRequestListener);
return call;
}
/**
* Enables subscription to SocketIO notifications
* Enables subscription to SocketIO notifications
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void socketio() throws ApiException {
socketioWithHttpInfo();
}
/**
* Enables subscription to SocketIO notifications
* Enables subscription to SocketIO notifications
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse socketioWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = socketioValidateBeforeCall(null, null);
return apiClient.execute(call);
}
/**
* Enables subscription to SocketIO notifications (asynchronously)
* Enables subscription to SocketIO notifications
* @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 socketioAsync(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 = socketioValidateBeforeCall(progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy