
io.swagger.client.api.ChatRoomsApi Maven / Gradle / Ivy
/*
* Easemob REST APIs
* Easemob Server REST API Swagger is designated to provide better documentation and thorough interfaces for testing. For more details about server implementation, request rate limitation, etc, please visit [Easemob Server Integration](http://docs.easemob.com/im/100serverintegration/10intro). **Note:** `org_ID` is the unique ID of the organization created when you first registered [Easemob console](https://console.easemob.com/). `app_name` is the unique app ID created when you new application in [Easemob console](https://console.easemob.com/). `Authorization token` is required for most API requests as part of requesting header in the format `Bearer ${token}`. You can obtain the token via [/{org_name}/{app_name}/token](https://docs.hyphenate.io/docs/server-overview#section-request-authentication-token).
*
* OpenAPI spec version: 1.0.2
*
*
* 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 io.swagger.client.api;
import io.swagger.client.ApiCallback;
import io.swagger.client.ApiClient;
import io.swagger.client.ApiException;
import io.swagger.client.ApiResponse;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import io.swagger.client.ProgressRequestBody;
import io.swagger.client.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import io.swagger.client.model.Chatroom;
import io.swagger.client.model.ModifyChatroom;
import io.swagger.client.model.UserNames;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ChatRoomsApi {
private ApiClient apiClient;
public ChatRoomsApi() {
this(Configuration.getDefaultApiClient());
}
public ChatRoomsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/* Build call for orgNameAppNameChatroomsChatroomIdDelete */
private com.squareup.okhttp.Call orgNameAppNameChatroomsChatroomIdDeleteCall(String orgName, String appName, String authorization, String chatroomId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/{org_name}/{app_name}/chatrooms/{chatroom_id}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "org_name" + "\\}", apiClient.escapeString(orgName.toString()))
.replaceAll("\\{" + "app_name" + "\\}", apiClient.escapeString(appName.toString()))
.replaceAll("\\{" + "chatroom_id" + "\\}", apiClient.escapeString(chatroomId.toString()));
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
if (authorization != null)
localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization));
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call orgNameAppNameChatroomsChatroomIdDeleteValidateBeforeCall(String orgName, String appName, String authorization, String chatroomId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'orgName' is set
if (orgName == null) {
throw new ApiException("Missing the required parameter 'orgName' when calling orgNameAppNameChatroomsChatroomIdDelete(Async)");
}
// verify the required parameter 'appName' is set
if (appName == null) {
throw new ApiException("Missing the required parameter 'appName' when calling orgNameAppNameChatroomsChatroomIdDelete(Async)");
}
// verify the required parameter 'authorization' is set
if (authorization == null) {
throw new ApiException("Missing the required parameter 'authorization' when calling orgNameAppNameChatroomsChatroomIdDelete(Async)");
}
// verify the required parameter 'chatroomId' is set
if (chatroomId == null) {
throw new ApiException("Missing the required parameter 'chatroomId' when calling orgNameAppNameChatroomsChatroomIdDelete(Async)");
}
com.squareup.okhttp.Call call = orgNameAppNameChatroomsChatroomIdDeleteCall(orgName, appName, authorization, chatroomId, progressListener, progressRequestListener);
return call;
}
/**
* Delete a Chat Room
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String orgNameAppNameChatroomsChatroomIdDelete(String orgName, String appName, String authorization, String chatroomId) throws ApiException {
ApiResponse resp = orgNameAppNameChatroomsChatroomIdDeleteWithHttpInfo(orgName, appName, authorization, chatroomId);
return resp.getData();
}
/**
* Delete a Chat Room
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse orgNameAppNameChatroomsChatroomIdDeleteWithHttpInfo(String orgName, String appName, String authorization, String chatroomId) throws ApiException {
com.squareup.okhttp.Call call = orgNameAppNameChatroomsChatroomIdDeleteValidateBeforeCall(orgName, appName, authorization, chatroomId, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Delete a Chat Room (asynchronously)
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (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 orgNameAppNameChatroomsChatroomIdDeleteAsync(String orgName, String appName, String authorization, String chatroomId, 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 = orgNameAppNameChatroomsChatroomIdDeleteValidateBeforeCall(orgName, appName, authorization, chatroomId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/* Build call for orgNameAppNameChatroomsChatroomIdGet */
private com.squareup.okhttp.Call orgNameAppNameChatroomsChatroomIdGetCall(String orgName, String appName, String authorization, String chatroomId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/{org_name}/{app_name}/chatrooms/{chatroom_id}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "org_name" + "\\}", apiClient.escapeString(orgName.toString()))
.replaceAll("\\{" + "app_name" + "\\}", apiClient.escapeString(appName.toString()))
.replaceAll("\\{" + "chatroom_id" + "\\}", apiClient.escapeString(chatroomId.toString()));
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
if (authorization != null)
localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization));
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, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call orgNameAppNameChatroomsChatroomIdGetValidateBeforeCall(String orgName, String appName, String authorization, String chatroomId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'orgName' is set
if (orgName == null) {
throw new ApiException("Missing the required parameter 'orgName' when calling orgNameAppNameChatroomsChatroomIdGet(Async)");
}
// verify the required parameter 'appName' is set
if (appName == null) {
throw new ApiException("Missing the required parameter 'appName' when calling orgNameAppNameChatroomsChatroomIdGet(Async)");
}
// verify the required parameter 'authorization' is set
if (authorization == null) {
throw new ApiException("Missing the required parameter 'authorization' when calling orgNameAppNameChatroomsChatroomIdGet(Async)");
}
// verify the required parameter 'chatroomId' is set
if (chatroomId == null) {
throw new ApiException("Missing the required parameter 'chatroomId' when calling orgNameAppNameChatroomsChatroomIdGet(Async)");
}
com.squareup.okhttp.Call call = orgNameAppNameChatroomsChatroomIdGetCall(orgName, appName, authorization, chatroomId, progressListener, progressRequestListener);
return call;
}
/**
* Get Chat Room Details
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String orgNameAppNameChatroomsChatroomIdGet(String orgName, String appName, String authorization, String chatroomId) throws ApiException {
ApiResponse resp = orgNameAppNameChatroomsChatroomIdGetWithHttpInfo(orgName, appName, authorization, chatroomId);
return resp.getData();
}
/**
* Get Chat Room Details
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse orgNameAppNameChatroomsChatroomIdGetWithHttpInfo(String orgName, String appName, String authorization, String chatroomId) throws ApiException {
com.squareup.okhttp.Call call = orgNameAppNameChatroomsChatroomIdGetValidateBeforeCall(orgName, appName, authorization, chatroomId, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get Chat Room Details (asynchronously)
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (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 orgNameAppNameChatroomsChatroomIdGetAsync(String orgName, String appName, String authorization, String chatroomId, 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 = orgNameAppNameChatroomsChatroomIdGetValidateBeforeCall(orgName, appName, authorization, chatroomId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/* Build call for orgNameAppNameChatroomsChatroomIdPut */
private com.squareup.okhttp.Call orgNameAppNameChatroomsChatroomIdPutCall(String orgName, String appName, String authorization, String chatroomId, ModifyChatroom body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/{org_name}/{app_name}/chatrooms/{chatroom_id}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "org_name" + "\\}", apiClient.escapeString(orgName.toString()))
.replaceAll("\\{" + "app_name" + "\\}", apiClient.escapeString(appName.toString()))
.replaceAll("\\{" + "chatroom_id" + "\\}", apiClient.escapeString(chatroomId.toString()));
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
if (authorization != null)
localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization));
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call orgNameAppNameChatroomsChatroomIdPutValidateBeforeCall(String orgName, String appName, String authorization, String chatroomId, ModifyChatroom body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'orgName' is set
if (orgName == null) {
throw new ApiException("Missing the required parameter 'orgName' when calling orgNameAppNameChatroomsChatroomIdPut(Async)");
}
// verify the required parameter 'appName' is set
if (appName == null) {
throw new ApiException("Missing the required parameter 'appName' when calling orgNameAppNameChatroomsChatroomIdPut(Async)");
}
// verify the required parameter 'authorization' is set
if (authorization == null) {
throw new ApiException("Missing the required parameter 'authorization' when calling orgNameAppNameChatroomsChatroomIdPut(Async)");
}
// verify the required parameter 'chatroomId' is set
if (chatroomId == null) {
throw new ApiException("Missing the required parameter 'chatroomId' when calling orgNameAppNameChatroomsChatroomIdPut(Async)");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling orgNameAppNameChatroomsChatroomIdPut(Async)");
}
com.squareup.okhttp.Call call = orgNameAppNameChatroomsChatroomIdPutCall(orgName, appName, authorization, chatroomId, body, progressListener, progressRequestListener);
return call;
}
/**
* Update Chat Room Details
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (required)
* @param body (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String orgNameAppNameChatroomsChatroomIdPut(String orgName, String appName, String authorization, String chatroomId, ModifyChatroom body) throws ApiException {
ApiResponse resp = orgNameAppNameChatroomsChatroomIdPutWithHttpInfo(orgName, appName, authorization, chatroomId, body);
return resp.getData();
}
/**
* Update Chat Room Details
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (required)
* @param body (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse orgNameAppNameChatroomsChatroomIdPutWithHttpInfo(String orgName, String appName, String authorization, String chatroomId, ModifyChatroom body) throws ApiException {
com.squareup.okhttp.Call call = orgNameAppNameChatroomsChatroomIdPutValidateBeforeCall(orgName, appName, authorization, chatroomId, body, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Update Chat Room Details (asynchronously)
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (required)
* @param body (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 orgNameAppNameChatroomsChatroomIdPutAsync(String orgName, String appName, String authorization, String chatroomId, ModifyChatroom body, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgNameAppNameChatroomsChatroomIdPutValidateBeforeCall(orgName, appName, authorization, chatroomId, body, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/* Build call for orgNameAppNameChatroomsChatroomIdUsersPost */
private com.squareup.okhttp.Call orgNameAppNameChatroomsChatroomIdUsersPostCall(String orgName, String appName, String authorization, String chatroomId, UserNames content, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = content;
// create path and map variables
String localVarPath = "/{org_name}/{app_name}/chatrooms/{chatroom_id}/users".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "org_name" + "\\}", apiClient.escapeString(orgName.toString()))
.replaceAll("\\{" + "app_name" + "\\}", apiClient.escapeString(appName.toString()))
.replaceAll("\\{" + "chatroom_id" + "\\}", apiClient.escapeString(chatroomId.toString()));
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
if (authorization != null)
localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization));
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call orgNameAppNameChatroomsChatroomIdUsersPostValidateBeforeCall(String orgName, String appName, String authorization, String chatroomId, UserNames content, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'orgName' is set
if (orgName == null) {
throw new ApiException("Missing the required parameter 'orgName' when calling orgNameAppNameChatroomsChatroomIdUsersPost(Async)");
}
// verify the required parameter 'appName' is set
if (appName == null) {
throw new ApiException("Missing the required parameter 'appName' when calling orgNameAppNameChatroomsChatroomIdUsersPost(Async)");
}
// verify the required parameter 'authorization' is set
if (authorization == null) {
throw new ApiException("Missing the required parameter 'authorization' when calling orgNameAppNameChatroomsChatroomIdUsersPost(Async)");
}
// verify the required parameter 'chatroomId' is set
if (chatroomId == null) {
throw new ApiException("Missing the required parameter 'chatroomId' when calling orgNameAppNameChatroomsChatroomIdUsersPost(Async)");
}
// verify the required parameter 'content' is set
if (content == null) {
throw new ApiException("Missing the required parameter 'content' when calling orgNameAppNameChatroomsChatroomIdUsersPost(Async)");
}
com.squareup.okhttp.Call call = orgNameAppNameChatroomsChatroomIdUsersPostCall(orgName, appName, authorization, chatroomId, content, progressListener, progressRequestListener);
return call;
}
/**
* Add Chat Room Members in Batch
* Add max 60 group members at a time.
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (required)
* @param content (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String orgNameAppNameChatroomsChatroomIdUsersPost(String orgName, String appName, String authorization, String chatroomId, UserNames content) throws ApiException {
ApiResponse resp = orgNameAppNameChatroomsChatroomIdUsersPostWithHttpInfo(orgName, appName, authorization, chatroomId, content);
return resp.getData();
}
/**
* Add Chat Room Members in Batch
* Add max 60 group members at a time.
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (required)
* @param content (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse orgNameAppNameChatroomsChatroomIdUsersPostWithHttpInfo(String orgName, String appName, String authorization, String chatroomId, UserNames content) throws ApiException {
com.squareup.okhttp.Call call = orgNameAppNameChatroomsChatroomIdUsersPostValidateBeforeCall(orgName, appName, authorization, chatroomId, content, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Add Chat Room Members in Batch (asynchronously)
* Add max 60 group members at a time.
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (required)
* @param content (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 orgNameAppNameChatroomsChatroomIdUsersPostAsync(String orgName, String appName, String authorization, String chatroomId, UserNames content, 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 = orgNameAppNameChatroomsChatroomIdUsersPostValidateBeforeCall(orgName, appName, authorization, chatroomId, content, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/* Build call for orgNameAppNameChatroomsChatroomIdUsersUsernameDelete */
private com.squareup.okhttp.Call orgNameAppNameChatroomsChatroomIdUsersUsernameDeleteCall(String orgName, String appName, String authorization, String chatroomId, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/{org_name}/{app_name}/chatrooms/{chatroom_id}/users/{username}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "org_name" + "\\}", apiClient.escapeString(orgName.toString()))
.replaceAll("\\{" + "app_name" + "\\}", apiClient.escapeString(appName.toString()))
.replaceAll("\\{" + "chatroom_id" + "\\}", apiClient.escapeString(chatroomId.toString()))
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
if (authorization != null)
localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization));
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call orgNameAppNameChatroomsChatroomIdUsersUsernameDeleteValidateBeforeCall(String orgName, String appName, String authorization, String chatroomId, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'orgName' is set
if (orgName == null) {
throw new ApiException("Missing the required parameter 'orgName' when calling orgNameAppNameChatroomsChatroomIdUsersUsernameDelete(Async)");
}
// verify the required parameter 'appName' is set
if (appName == null) {
throw new ApiException("Missing the required parameter 'appName' when calling orgNameAppNameChatroomsChatroomIdUsersUsernameDelete(Async)");
}
// verify the required parameter 'authorization' is set
if (authorization == null) {
throw new ApiException("Missing the required parameter 'authorization' when calling orgNameAppNameChatroomsChatroomIdUsersUsernameDelete(Async)");
}
// verify the required parameter 'chatroomId' is set
if (chatroomId == null) {
throw new ApiException("Missing the required parameter 'chatroomId' when calling orgNameAppNameChatroomsChatroomIdUsersUsernameDelete(Async)");
}
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling orgNameAppNameChatroomsChatroomIdUsersUsernameDelete(Async)");
}
com.squareup.okhttp.Call call = orgNameAppNameChatroomsChatroomIdUsersUsernameDeleteCall(orgName, appName, authorization, chatroomId, username, progressListener, progressRequestListener);
return call;
}
/**
* Remove a Chat Room Member
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (required)
* @param username (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String orgNameAppNameChatroomsChatroomIdUsersUsernameDelete(String orgName, String appName, String authorization, String chatroomId, String username) throws ApiException {
ApiResponse resp = orgNameAppNameChatroomsChatroomIdUsersUsernameDeleteWithHttpInfo(orgName, appName, authorization, chatroomId, username);
return resp.getData();
}
/**
* Remove a Chat Room Member
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (required)
* @param username (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse orgNameAppNameChatroomsChatroomIdUsersUsernameDeleteWithHttpInfo(String orgName, String appName, String authorization, String chatroomId, String username) throws ApiException {
com.squareup.okhttp.Call call = orgNameAppNameChatroomsChatroomIdUsersUsernameDeleteValidateBeforeCall(orgName, appName, authorization, chatroomId, username, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Remove a Chat Room Member (asynchronously)
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (required)
* @param username (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 orgNameAppNameChatroomsChatroomIdUsersUsernameDeleteAsync(String orgName, String appName, String authorization, String chatroomId, String username, 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 = orgNameAppNameChatroomsChatroomIdUsersUsernameDeleteValidateBeforeCall(orgName, appName, authorization, chatroomId, username, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/* Build call for orgNameAppNameChatroomsChatroomIdUsersUsernamePost */
private com.squareup.okhttp.Call orgNameAppNameChatroomsChatroomIdUsersUsernamePostCall(String orgName, String appName, String authorization, String chatroomId, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/{org_name}/{app_name}/chatrooms/{chatroom_id}/users/{username}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "org_name" + "\\}", apiClient.escapeString(orgName.toString()))
.replaceAll("\\{" + "app_name" + "\\}", apiClient.escapeString(appName.toString()))
.replaceAll("\\{" + "chatroom_id" + "\\}", apiClient.escapeString(chatroomId.toString()))
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
if (authorization != null)
localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization));
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call orgNameAppNameChatroomsChatroomIdUsersUsernamePostValidateBeforeCall(String orgName, String appName, String authorization, String chatroomId, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'orgName' is set
if (orgName == null) {
throw new ApiException("Missing the required parameter 'orgName' when calling orgNameAppNameChatroomsChatroomIdUsersUsernamePost(Async)");
}
// verify the required parameter 'appName' is set
if (appName == null) {
throw new ApiException("Missing the required parameter 'appName' when calling orgNameAppNameChatroomsChatroomIdUsersUsernamePost(Async)");
}
// verify the required parameter 'authorization' is set
if (authorization == null) {
throw new ApiException("Missing the required parameter 'authorization' when calling orgNameAppNameChatroomsChatroomIdUsersUsernamePost(Async)");
}
// verify the required parameter 'chatroomId' is set
if (chatroomId == null) {
throw new ApiException("Missing the required parameter 'chatroomId' when calling orgNameAppNameChatroomsChatroomIdUsersUsernamePost(Async)");
}
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling orgNameAppNameChatroomsChatroomIdUsersUsernamePost(Async)");
}
com.squareup.okhttp.Call call = orgNameAppNameChatroomsChatroomIdUsersUsernamePostCall(orgName, appName, authorization, chatroomId, username, progressListener, progressRequestListener);
return call;
}
/**
* Add a Chat Room Member
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (required)
* @param username (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String orgNameAppNameChatroomsChatroomIdUsersUsernamePost(String orgName, String appName, String authorization, String chatroomId, String username) throws ApiException {
ApiResponse resp = orgNameAppNameChatroomsChatroomIdUsersUsernamePostWithHttpInfo(orgName, appName, authorization, chatroomId, username);
return resp.getData();
}
/**
* Add a Chat Room Member
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (required)
* @param username (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse orgNameAppNameChatroomsChatroomIdUsersUsernamePostWithHttpInfo(String orgName, String appName, String authorization, String chatroomId, String username) throws ApiException {
com.squareup.okhttp.Call call = orgNameAppNameChatroomsChatroomIdUsersUsernamePostValidateBeforeCall(orgName, appName, authorization, chatroomId, username, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Add a Chat Room Member (asynchronously)
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (required)
* @param username (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 orgNameAppNameChatroomsChatroomIdUsersUsernamePostAsync(String orgName, String appName, String authorization, String chatroomId, String username, 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 = orgNameAppNameChatroomsChatroomIdUsersUsernamePostValidateBeforeCall(orgName, appName, authorization, chatroomId, username, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/* Build call for orgNameAppNameChatroomsChatroomIdUsersUsernamesDelete */
private com.squareup.okhttp.Call orgNameAppNameChatroomsChatroomIdUsersUsernamesDeleteCall(String orgName, String appName, String authorization, String chatroomId, String usernames, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/{org_name}/{app_name}/chatrooms/{chatroom_id}/users/{usernames}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "org_name" + "\\}", apiClient.escapeString(orgName.toString()))
.replaceAll("\\{" + "app_name" + "\\}", apiClient.escapeString(appName.toString()))
.replaceAll("\\{" + "chatroom_id" + "\\}", apiClient.escapeString(chatroomId.toString()))
.replaceAll("\\{" + "usernames" + "\\}", apiClient.escapeString(usernames.toString()));
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
if (authorization != null)
localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization));
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call orgNameAppNameChatroomsChatroomIdUsersUsernamesDeleteValidateBeforeCall(String orgName, String appName, String authorization, String chatroomId, String usernames, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'orgName' is set
if (orgName == null) {
throw new ApiException("Missing the required parameter 'orgName' when calling orgNameAppNameChatroomsChatroomIdUsersUsernamesDelete(Async)");
}
// verify the required parameter 'appName' is set
if (appName == null) {
throw new ApiException("Missing the required parameter 'appName' when calling orgNameAppNameChatroomsChatroomIdUsersUsernamesDelete(Async)");
}
// verify the required parameter 'authorization' is set
if (authorization == null) {
throw new ApiException("Missing the required parameter 'authorization' when calling orgNameAppNameChatroomsChatroomIdUsersUsernamesDelete(Async)");
}
// verify the required parameter 'chatroomId' is set
if (chatroomId == null) {
throw new ApiException("Missing the required parameter 'chatroomId' when calling orgNameAppNameChatroomsChatroomIdUsersUsernamesDelete(Async)");
}
// verify the required parameter 'usernames' is set
if (usernames == null) {
throw new ApiException("Missing the required parameter 'usernames' when calling orgNameAppNameChatroomsChatroomIdUsersUsernamesDelete(Async)");
}
com.squareup.okhttp.Call call = orgNameAppNameChatroomsChatroomIdUsersUsernamesDeleteCall(orgName, appName, authorization, chatroomId, usernames, progressListener, progressRequestListener);
return call;
}
/**
* Remove Chat Room Members in Batch
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (required)
* @param usernames Separate usernames by ',' (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String orgNameAppNameChatroomsChatroomIdUsersUsernamesDelete(String orgName, String appName, String authorization, String chatroomId, String usernames) throws ApiException {
ApiResponse resp = orgNameAppNameChatroomsChatroomIdUsersUsernamesDeleteWithHttpInfo(orgName, appName, authorization, chatroomId, usernames);
return resp.getData();
}
/**
* Remove Chat Room Members in Batch
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (required)
* @param usernames Separate usernames by ',' (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse orgNameAppNameChatroomsChatroomIdUsersUsernamesDeleteWithHttpInfo(String orgName, String appName, String authorization, String chatroomId, String usernames) throws ApiException {
com.squareup.okhttp.Call call = orgNameAppNameChatroomsChatroomIdUsersUsernamesDeleteValidateBeforeCall(orgName, appName, authorization, chatroomId, usernames, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Remove Chat Room Members in Batch (asynchronously)
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param chatroomId (required)
* @param usernames Separate usernames by ',' (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 orgNameAppNameChatroomsChatroomIdUsersUsernamesDeleteAsync(String orgName, String appName, String authorization, String chatroomId, String usernames, 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 = orgNameAppNameChatroomsChatroomIdUsersUsernamesDeleteValidateBeforeCall(orgName, appName, authorization, chatroomId, usernames, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/* Build call for orgNameAppNameChatroomsGet */
private com.squareup.okhttp.Call orgNameAppNameChatroomsGetCall(String orgName, String appName, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/{org_name}/{app_name}/chatrooms".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "org_name" + "\\}", apiClient.escapeString(orgName.toString()))
.replaceAll("\\{" + "app_name" + "\\}", apiClient.escapeString(appName.toString()));
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
if (authorization != null)
localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization));
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, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call orgNameAppNameChatroomsGetValidateBeforeCall(String orgName, String appName, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'orgName' is set
if (orgName == null) {
throw new ApiException("Missing the required parameter 'orgName' when calling orgNameAppNameChatroomsGet(Async)");
}
// verify the required parameter 'appName' is set
if (appName == null) {
throw new ApiException("Missing the required parameter 'appName' when calling orgNameAppNameChatroomsGet(Async)");
}
// verify the required parameter 'authorization' is set
if (authorization == null) {
throw new ApiException("Missing the required parameter 'authorization' when calling orgNameAppNameChatroomsGet(Async)");
}
com.squareup.okhttp.Call call = orgNameAppNameChatroomsGetCall(orgName, appName, authorization, progressListener, progressRequestListener);
return call;
}
/**
* Get All the Chat Rooms
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String orgNameAppNameChatroomsGet(String orgName, String appName, String authorization) throws ApiException {
ApiResponse resp = orgNameAppNameChatroomsGetWithHttpInfo(orgName, appName, authorization);
return resp.getData();
}
/**
* Get All the Chat Rooms
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse orgNameAppNameChatroomsGetWithHttpInfo(String orgName, String appName, String authorization) throws ApiException {
com.squareup.okhttp.Call call = orgNameAppNameChatroomsGetValidateBeforeCall(orgName, appName, authorization, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get All the Chat Rooms (asynchronously)
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (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 orgNameAppNameChatroomsGetAsync(String orgName, String appName, String authorization, 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 = orgNameAppNameChatroomsGetValidateBeforeCall(orgName, appName, authorization, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/* Build call for orgNameAppNameChatroomsPost */
private com.squareup.okhttp.Call orgNameAppNameChatroomsPostCall(String orgName, String appName, String authorization, Chatroom body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/{org_name}/{app_name}/chatrooms".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "org_name" + "\\}", apiClient.escapeString(orgName.toString()))
.replaceAll("\\{" + "app_name" + "\\}", apiClient.escapeString(appName.toString()));
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
if (authorization != null)
localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization));
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call orgNameAppNameChatroomsPostValidateBeforeCall(String orgName, String appName, String authorization, Chatroom body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'orgName' is set
if (orgName == null) {
throw new ApiException("Missing the required parameter 'orgName' when calling orgNameAppNameChatroomsPost(Async)");
}
// verify the required parameter 'appName' is set
if (appName == null) {
throw new ApiException("Missing the required parameter 'appName' when calling orgNameAppNameChatroomsPost(Async)");
}
// verify the required parameter 'authorization' is set
if (authorization == null) {
throw new ApiException("Missing the required parameter 'authorization' when calling orgNameAppNameChatroomsPost(Async)");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling orgNameAppNameChatroomsPost(Async)");
}
com.squareup.okhttp.Call call = orgNameAppNameChatroomsPostCall(orgName, appName, authorization, body, progressListener, progressRequestListener);
return call;
}
/**
* Create a Chat Room
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param body (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String orgNameAppNameChatroomsPost(String orgName, String appName, String authorization, Chatroom body) throws ApiException {
ApiResponse resp = orgNameAppNameChatroomsPostWithHttpInfo(orgName, appName, authorization, body);
return resp.getData();
}
/**
* Create a Chat Room
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param body (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse orgNameAppNameChatroomsPostWithHttpInfo(String orgName, String appName, String authorization, Chatroom body) throws ApiException {
com.squareup.okhttp.Call call = orgNameAppNameChatroomsPostValidateBeforeCall(orgName, appName, authorization, body, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Create a Chat Room (asynchronously)
*
* @param orgName Organization ID (required)
* @param appName Application name (required)
* @param authorization Bearer ${token} (required)
* @param body (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 orgNameAppNameChatroomsPostAsync(String orgName, String appName, String authorization, Chatroom body, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = orgNameAppNameChatroomsPostValidateBeforeCall(orgName, appName, authorization, body, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy