From 1fba5bdce4f9922766d98cc51577529c5f5b353c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=82=85=E4=B8=9C=E6=B5=B7?= <296322762@qq.com>
Date: Mon, 19 Feb 2024 15:18:48 +0800
Subject: [PATCH] Add push & presence & reaction api
---
.../java/com/easemob/im/api/PresenceApi.java | 945 ++++++++++
src/main/java/com/easemob/im/api/PushApi.java | 1586 +++++++++++++++++
.../java/com/easemob/im/api/ReactionApi.java | 710 ++++++++
.../model/EMCreateOfflinePushTemplate.java | 270 +++
.../EMCreateOfflinePushTemplateResult.java | 210 +++
.../EMDeleteOfflinePushTemplateResult.java | 210 +++
.../im/api/model/EMDeleteReactionResult.java | 208 +++
.../EMGetGroupOnlineMemberCountResult.java | 205 +++
.../EMGetMultipleUsersPresenceStatus.java | 219 +++
...etMultipleUsersPresenceStatusResource.java | 296 +++
...MGetMultipleUsersPresenceStatusResult.java | 230 +++
.../im/api/model/EMGetOfflinePushResult.java | 210 +++
.../model/EMGetOfflinePushTemplateResult.java | 210 +++
.../api/model/EMGetPushBindingInfoResult.java | 230 +++
.../EMGetPushPreferredLanguageResult.java | 210 +++
.../api/model/EMGetReactionDetailResult.java | 241 +++
.../api/model/EMGetReactionListResource.java | 261 +++
.../im/api/model/EMGetReactionResult.java | 261 +++
.../EMGetUserSubscriptionListResource.java | 258 +++
.../EMGetUserSubscriptionListResult.java | 210 +++
.../api/model/EMOfflinePushNewResource.java | 268 +++
.../model/EMOfflinePushTemplateResource.java | 327 ++++
.../api/model/EMPushBindingInfoResource.java | 270 +++
.../EMPushPreferredLanguageResource.java | 208 +++
.../im/api/model/EMReactionResource.java | 368 ++++
.../EMReceiverConfigurationTemplateName.java | 208 +++
...iverConfigurationTemplateNameResource.java | 208 +++
...ceiverConfigurationTemplateNameResult.java | 210 +++
.../im/api/model/EMSetOfflinePushNew.java | 268 +++
.../api/model/EMSetOfflinePushNewResult.java | 210 +++
.../im/api/model/EMSetOfflinePushOld.java | 326 ++++
.../im/api/model/EMSetPushBindingInfo.java | 270 +++
.../api/model/EMSetPushBindingInfoResult.java | 230 +++
.../api/model/EMSetPushPreferredLanguage.java | 208 +++
.../EMSetPushPreferredLanguageResult.java | 210 +++
.../easemob/im/api/model/EMSetReaction.java | 239 +++
.../im/api/model/EMSetReactionResult.java | 208 +++
.../im/api/model/EMSetUserPresenceStatus.java | 208 +++
.../model/EMSetUserPresenceStatusResult.java | 208 +++
...MSubscribeMultipleUsersPresenceStatus.java | 219 +++
...beMultipleUsersPresenceStatusResource.java | 324 ++++
...ribeMultipleUsersPresenceStatusResult.java | 230 +++
...ribeMultipleUsersPresenceStatusResult.java | 208 +++
.../api/model/EMUserSubscriptionResource.java | 239 +++
.../com/easemob/im/api/MessageApiTest.java | 6 -
.../com/easemob/im/api/PresenceApiTest.java | 206 +++
.../java/com/easemob/im/api/PushApiTest.java | 456 +++++
.../com/easemob/im/api/ReactionApiTest.java | 294 +++
48 files changed, 14008 insertions(+), 6 deletions(-)
create mode 100644 src/main/java/com/easemob/im/api/PresenceApi.java
create mode 100644 src/main/java/com/easemob/im/api/PushApi.java
create mode 100644 src/main/java/com/easemob/im/api/ReactionApi.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMCreateOfflinePushTemplate.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMCreateOfflinePushTemplateResult.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMDeleteOfflinePushTemplateResult.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMDeleteReactionResult.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMGetGroupOnlineMemberCountResult.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMGetMultipleUsersPresenceStatus.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMGetMultipleUsersPresenceStatusResource.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMGetMultipleUsersPresenceStatusResult.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMGetOfflinePushResult.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMGetOfflinePushTemplateResult.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMGetPushBindingInfoResult.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMGetPushPreferredLanguageResult.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMGetReactionDetailResult.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMGetReactionListResource.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMGetReactionResult.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMGetUserSubscriptionListResource.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMGetUserSubscriptionListResult.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMOfflinePushNewResource.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMOfflinePushTemplateResource.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMPushBindingInfoResource.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMPushPreferredLanguageResource.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMReactionResource.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMReceiverConfigurationTemplateName.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMReceiverConfigurationTemplateNameResource.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMReceiverConfigurationTemplateNameResult.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMSetOfflinePushNew.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMSetOfflinePushNewResult.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMSetOfflinePushOld.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMSetPushBindingInfo.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMSetPushBindingInfoResult.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMSetPushPreferredLanguage.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMSetPushPreferredLanguageResult.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMSetReaction.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMSetReactionResult.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMSetUserPresenceStatus.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMSetUserPresenceStatusResult.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMSubscribeMultipleUsersPresenceStatus.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMSubscribeMultipleUsersPresenceStatusResource.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMSubscribeMultipleUsersPresenceStatusResult.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMUnsubscribeMultipleUsersPresenceStatusResult.java
create mode 100644 src/main/java/com/easemob/im/api/model/EMUserSubscriptionResource.java
create mode 100644 src/test/java/com/easemob/im/api/PresenceApiTest.java
create mode 100644 src/test/java/com/easemob/im/api/PushApiTest.java
create mode 100644 src/test/java/com/easemob/im/api/ReactionApiTest.java
diff --git a/src/main/java/com/easemob/im/api/PresenceApi.java b/src/main/java/com/easemob/im/api/PresenceApi.java
new file mode 100644
index 000000000..e7b8df2aa
--- /dev/null
+++ b/src/main/java/com/easemob/im/api/PresenceApi.java
@@ -0,0 +1,945 @@
+/*
+ * EMService
+ * Easemob Rest API
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.easemob.im.api;
+
+import com.easemob.im.ApiCallback;
+import com.easemob.im.ApiClient;
+import com.easemob.im.ApiException;
+import com.easemob.im.ApiResponse;
+import com.easemob.im.Configuration;
+import com.easemob.im.Pair;
+import com.easemob.im.ProgressRequestBody;
+import com.easemob.im.ProgressResponseBody;
+
+import com.google.gson.reflect.TypeToken;
+
+import java.io.IOException;
+
+
+import com.easemob.im.api.model.EMGetGroupOnlineMemberCountResult;
+import com.easemob.im.api.model.EMGetMultipleUsersPresenceStatus;
+import com.easemob.im.api.model.EMGetMultipleUsersPresenceStatusResult;
+import com.easemob.im.api.model.EMGetUserSubscriptionListResult;
+import com.easemob.im.api.model.EMSetUserPresenceStatus;
+import com.easemob.im.api.model.EMSetUserPresenceStatusResult;
+import com.easemob.im.api.model.EMSubscribeMultipleUsersPresenceStatus;
+import com.easemob.im.api.model.EMSubscribeMultipleUsersPresenceStatusResult;
+import com.easemob.im.api.model.EMUnsubscribeMultipleUsersPresenceStatusResult;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class PresenceApi {
+ private ApiClient localVarApiClient;
+ private int localHostIndex;
+ private String localCustomBaseUrl;
+
+ public PresenceApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public PresenceApi(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return localVarApiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ public int getHostIndex() {
+ return localHostIndex;
+ }
+
+ public void setHostIndex(int hostIndex) {
+ this.localHostIndex = hostIndex;
+ }
+
+ public String getCustomBaseUrl() {
+ return localCustomBaseUrl;
+ }
+
+ public void setCustomBaseUrl(String customBaseUrl) {
+ this.localCustomBaseUrl = customBaseUrl;
+ }
+
+ /**
+ * Build call for getGroupOnlineMemberCount
+ * @param groupId 群组 ID (required)
+ * @param queryType 查询类型,查询群组的在线成员数量,传 1 即可 (required)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call getGroupOnlineMemberCountCall(String groupId, Integer queryType, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/presence/online/{group_id}/type/{query_type}"
+ .replace("{" + "group_id" + "}", localVarApiClient.escapeString(groupId.toString()))
+ .replace("{" + "query_type" + "}", localVarApiClient.escapeString(queryType.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call getGroupOnlineMemberCountValidateBeforeCall(String groupId, Integer queryType, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'groupId' is set
+ if (groupId == null) {
+ throw new ApiException("Missing the required parameter 'groupId' when calling getGroupOnlineMemberCount(Async)");
+ }
+
+ // verify the required parameter 'queryType' is set
+ if (queryType == null) {
+ throw new ApiException("Missing the required parameter 'queryType' when calling getGroupOnlineMemberCount(Async)");
+ }
+
+ return getGroupOnlineMemberCountCall(groupId, queryType, _callback);
+
+ }
+
+ /**
+ * 查询单个群组的在线成员数量
+ * 你可以查询单个群组的在线成员数量。如需使用该 API,需要联系环信商务开通。这里的在线状态指用户的 app 与服务器成功建立连接,不包括用户的自定义在线状态,如忙碌、马上回来等。文档介绍:https://docs-im-beta.easemob.com/document/server-side/presence.html#%E6%9F%A5%E8%AF%A2%E5%8D%95%E4%B8%AA%E7%BE%A4%E7%BB%84%E7%9A%84%E5%9C%A8%E7%BA%BF%E6%88%90%E5%91%98%E6%95%B0%E9%87%8F
+ * @param groupId 群组 ID (required)
+ * @param queryType 查询类型,查询群组的在线成员数量,传 1 即可 (required)
+ * @return EMGetGroupOnlineMemberCountResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public EMGetGroupOnlineMemberCountResult getGroupOnlineMemberCount(String groupId, Integer queryType) throws ApiException {
+ ApiResponse localVarResp = getGroupOnlineMemberCountWithHttpInfo(groupId, queryType);
+ return localVarResp.getData();
+ }
+
+ /**
+ * 查询单个群组的在线成员数量
+ * 你可以查询单个群组的在线成员数量。如需使用该 API,需要联系环信商务开通。这里的在线状态指用户的 app 与服务器成功建立连接,不包括用户的自定义在线状态,如忙碌、马上回来等。文档介绍:https://docs-im-beta.easemob.com/document/server-side/presence.html#%E6%9F%A5%E8%AF%A2%E5%8D%95%E4%B8%AA%E7%BE%A4%E7%BB%84%E7%9A%84%E5%9C%A8%E7%BA%BF%E6%88%90%E5%91%98%E6%95%B0%E9%87%8F
+ * @param groupId 群组 ID (required)
+ * @param queryType 查询类型,查询群组的在线成员数量,传 1 即可 (required)
+ * @return ApiResponse<EMGetGroupOnlineMemberCountResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public ApiResponse getGroupOnlineMemberCountWithHttpInfo(String groupId, Integer queryType) throws ApiException {
+ okhttp3.Call localVarCall = getGroupOnlineMemberCountValidateBeforeCall(groupId, queryType, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * 查询单个群组的在线成员数量 (asynchronously)
+ * 你可以查询单个群组的在线成员数量。如需使用该 API,需要联系环信商务开通。这里的在线状态指用户的 app 与服务器成功建立连接,不包括用户的自定义在线状态,如忙碌、马上回来等。文档介绍:https://docs-im-beta.easemob.com/document/server-side/presence.html#%E6%9F%A5%E8%AF%A2%E5%8D%95%E4%B8%AA%E7%BE%A4%E7%BB%84%E7%9A%84%E5%9C%A8%E7%BA%BF%E6%88%90%E5%91%98%E6%95%B0%E9%87%8F
+ * @param groupId 群组 ID (required)
+ * @param queryType 查询类型,查询群组的在线成员数量,传 1 即可 (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
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call getGroupOnlineMemberCountAsync(String groupId, Integer queryType, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = getGroupOnlineMemberCountValidateBeforeCall(groupId, queryType, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for getMultipleUserPresenceStatus
+ * @param username (required)
+ * @param emGetMultipleUsersPresenceStatus (optional)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call getMultipleUserPresenceStatusCall(String username, EMGetMultipleUsersPresenceStatus emGetMultipleUsersPresenceStatus, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = emGetMultipleUsersPresenceStatus;
+
+ // create path and map variables
+ String localVarPath = "/users/{username}/presence"
+ .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call getMultipleUserPresenceStatusValidateBeforeCall(String username, EMGetMultipleUsersPresenceStatus emGetMultipleUsersPresenceStatus, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'username' is set
+ if (username == null) {
+ throw new ApiException("Missing the required parameter 'username' when calling getMultipleUserPresenceStatus(Async)");
+ }
+
+ return getMultipleUserPresenceStatusCall(username, emGetMultipleUsersPresenceStatus, _callback);
+
+ }
+
+ /**
+ * 批量获取在线状态信息
+ * 你一次可获取多个用户的在线状态信息。文档介绍:https://docs-im-beta.easemob.com/document/server-side/presence.html#%E6%89%B9%E9%87%8F%E8%8E%B7%E5%8F%96%E5%9C%A8%E7%BA%BF%E7%8A%B6%E6%80%81%E4%BF%A1%E6%81%AF
+ * @param username (required)
+ * @param emGetMultipleUsersPresenceStatus (optional)
+ * @return EMGetMultipleUsersPresenceStatusResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public EMGetMultipleUsersPresenceStatusResult getMultipleUserPresenceStatus(String username, EMGetMultipleUsersPresenceStatus emGetMultipleUsersPresenceStatus) throws ApiException {
+ ApiResponse localVarResp = getMultipleUserPresenceStatusWithHttpInfo(username, emGetMultipleUsersPresenceStatus);
+ return localVarResp.getData();
+ }
+
+ /**
+ * 批量获取在线状态信息
+ * 你一次可获取多个用户的在线状态信息。文档介绍:https://docs-im-beta.easemob.com/document/server-side/presence.html#%E6%89%B9%E9%87%8F%E8%8E%B7%E5%8F%96%E5%9C%A8%E7%BA%BF%E7%8A%B6%E6%80%81%E4%BF%A1%E6%81%AF
+ * @param username (required)
+ * @param emGetMultipleUsersPresenceStatus (optional)
+ * @return ApiResponse<EMGetMultipleUsersPresenceStatusResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public ApiResponse getMultipleUserPresenceStatusWithHttpInfo(String username, EMGetMultipleUsersPresenceStatus emGetMultipleUsersPresenceStatus) throws ApiException {
+ okhttp3.Call localVarCall = getMultipleUserPresenceStatusValidateBeforeCall(username, emGetMultipleUsersPresenceStatus, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * 批量获取在线状态信息 (asynchronously)
+ * 你一次可获取多个用户的在线状态信息。文档介绍:https://docs-im-beta.easemob.com/document/server-side/presence.html#%E6%89%B9%E9%87%8F%E8%8E%B7%E5%8F%96%E5%9C%A8%E7%BA%BF%E7%8A%B6%E6%80%81%E4%BF%A1%E6%81%AF
+ * @param username (required)
+ * @param emGetMultipleUsersPresenceStatus (optional)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call getMultipleUserPresenceStatusAsync(String username, EMGetMultipleUsersPresenceStatus emGetMultipleUsersPresenceStatus, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = getMultipleUserPresenceStatusValidateBeforeCall(username, emGetMultipleUsersPresenceStatus, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for getUserSubscriptionList
+ * @param username (required)
+ * @param pageNum 要查询的页码。该参数的值须大于等于 1。若不传,默认值为 1 (optional)
+ * @param pageSize 每页显示的订阅用户数量。取值范围为 [1,500],若不传默认值为 1 (optional)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call getUserSubscriptionListCall(String username, Integer pageNum, Integer pageSize, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/users/{username}/presence/sublist"
+ .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ if (pageNum != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageNum", pageNum));
+ }
+
+ if (pageSize != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize));
+ }
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call getUserSubscriptionListValidateBeforeCall(String username, Integer pageNum, Integer pageSize, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'username' is set
+ if (username == null) {
+ throw new ApiException("Missing the required parameter 'username' when calling getUserSubscriptionList(Async)");
+ }
+
+ return getUserSubscriptionListCall(username, pageNum, pageSize, _callback);
+
+ }
+
+ /**
+ * 查询订阅列表
+ * 查询当前用户已订阅在线状态的用户列表。文档介绍:https://docs-im-beta.easemob.com/document/server-side/presence.html#%E6%9F%A5%E8%AF%A2%E8%AE%A2%E9%98%85%E5%88%97%E8%A1%A8
+ * @param username (required)
+ * @param pageNum 要查询的页码。该参数的值须大于等于 1。若不传,默认值为 1 (optional)
+ * @param pageSize 每页显示的订阅用户数量。取值范围为 [1,500],若不传默认值为 1 (optional)
+ * @return EMGetUserSubscriptionListResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public EMGetUserSubscriptionListResult getUserSubscriptionList(String username, Integer pageNum, Integer pageSize) throws ApiException {
+ ApiResponse localVarResp = getUserSubscriptionListWithHttpInfo(username, pageNum, pageSize);
+ return localVarResp.getData();
+ }
+
+ /**
+ * 查询订阅列表
+ * 查询当前用户已订阅在线状态的用户列表。文档介绍:https://docs-im-beta.easemob.com/document/server-side/presence.html#%E6%9F%A5%E8%AF%A2%E8%AE%A2%E9%98%85%E5%88%97%E8%A1%A8
+ * @param username (required)
+ * @param pageNum 要查询的页码。该参数的值须大于等于 1。若不传,默认值为 1 (optional)
+ * @param pageSize 每页显示的订阅用户数量。取值范围为 [1,500],若不传默认值为 1 (optional)
+ * @return ApiResponse<EMGetUserSubscriptionListResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public ApiResponse getUserSubscriptionListWithHttpInfo(String username, Integer pageNum, Integer pageSize) throws ApiException {
+ okhttp3.Call localVarCall = getUserSubscriptionListValidateBeforeCall(username, pageNum, pageSize, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * 查询订阅列表 (asynchronously)
+ * 查询当前用户已订阅在线状态的用户列表。文档介绍:https://docs-im-beta.easemob.com/document/server-side/presence.html#%E6%9F%A5%E8%AF%A2%E8%AE%A2%E9%98%85%E5%88%97%E8%A1%A8
+ * @param username (required)
+ * @param pageNum 要查询的页码。该参数的值须大于等于 1。若不传,默认值为 1 (optional)
+ * @param pageSize 每页显示的订阅用户数量。取值范围为 [1,500],若不传默认值为 1 (optional)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call getUserSubscriptionListAsync(String username, Integer pageNum, Integer pageSize, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = getUserSubscriptionListValidateBeforeCall(username, pageNum, pageSize, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for setUserPresenceStatus
+ * @param username (required)
+ * @param resource 要设置用户在哪个设备的在线状态信息,即传入服务器分配给每个设备资源的唯一标识符,格式为 {device type}_{resource ID},其中设备类型 device type 可以是 android、ios 或 web,资源 ID resource ID 由 SDK 分配。例如,android_123423453246 (required)
+ * @param status 用户的在线状态: - 0:离线; - 1:在线; - 其它数字字符串:自定义在线状态 (required)
+ * @param emSetUserPresenceStatus (optional)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call setUserPresenceStatusCall(String username, String resource, String status, EMSetUserPresenceStatus emSetUserPresenceStatus, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = emSetUserPresenceStatus;
+
+ // create path and map variables
+ String localVarPath = "/users/{username}/presence/{resource}/{status}"
+ .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()))
+ .replace("{" + "resource" + "}", localVarApiClient.escapeString(resource.toString()))
+ .replace("{" + "status" + "}", localVarApiClient.escapeString(status.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call setUserPresenceStatusValidateBeforeCall(String username, String resource, String status, EMSetUserPresenceStatus emSetUserPresenceStatus, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'username' is set
+ if (username == null) {
+ throw new ApiException("Missing the required parameter 'username' when calling setUserPresenceStatus(Async)");
+ }
+
+ // verify the required parameter 'resource' is set
+ if (resource == null) {
+ throw new ApiException("Missing the required parameter 'resource' when calling setUserPresenceStatus(Async)");
+ }
+
+ // verify the required parameter 'status' is set
+ if (status == null) {
+ throw new ApiException("Missing the required parameter 'status' when calling setUserPresenceStatus(Async)");
+ }
+
+ return setUserPresenceStatusCall(username, resource, status, emSetUserPresenceStatus, _callback);
+
+ }
+
+ /**
+ * 设置用户在线状态信息
+ * 可以设置用户在指定设备的在线状态信息。文档介绍:https://docs-im-beta.easemob.com/document/server-side/presence.html#%E8%AE%BE%E7%BD%AE%E7%94%A8%E6%88%B7%E5%9C%A8%E7%BA%BF%E7%8A%B6%E6%80%81%E4%BF%A1%E6%81%AF
+ * @param username (required)
+ * @param resource 要设置用户在哪个设备的在线状态信息,即传入服务器分配给每个设备资源的唯一标识符,格式为 {device type}_{resource ID},其中设备类型 device type 可以是 android、ios 或 web,资源 ID resource ID 由 SDK 分配。例如,android_123423453246 (required)
+ * @param status 用户的在线状态: - 0:离线; - 1:在线; - 其它数字字符串:自定义在线状态 (required)
+ * @param emSetUserPresenceStatus (optional)
+ * @return EMSetUserPresenceStatusResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public EMSetUserPresenceStatusResult setUserPresenceStatus(String username, String resource, String status, EMSetUserPresenceStatus emSetUserPresenceStatus) throws ApiException {
+ ApiResponse localVarResp = setUserPresenceStatusWithHttpInfo(username, resource, status, emSetUserPresenceStatus);
+ return localVarResp.getData();
+ }
+
+ /**
+ * 设置用户在线状态信息
+ * 可以设置用户在指定设备的在线状态信息。文档介绍:https://docs-im-beta.easemob.com/document/server-side/presence.html#%E8%AE%BE%E7%BD%AE%E7%94%A8%E6%88%B7%E5%9C%A8%E7%BA%BF%E7%8A%B6%E6%80%81%E4%BF%A1%E6%81%AF
+ * @param username (required)
+ * @param resource 要设置用户在哪个设备的在线状态信息,即传入服务器分配给每个设备资源的唯一标识符,格式为 {device type}_{resource ID},其中设备类型 device type 可以是 android、ios 或 web,资源 ID resource ID 由 SDK 分配。例如,android_123423453246 (required)
+ * @param status 用户的在线状态: - 0:离线; - 1:在线; - 其它数字字符串:自定义在线状态 (required)
+ * @param emSetUserPresenceStatus (optional)
+ * @return ApiResponse<EMSetUserPresenceStatusResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public ApiResponse setUserPresenceStatusWithHttpInfo(String username, String resource, String status, EMSetUserPresenceStatus emSetUserPresenceStatus) throws ApiException {
+ okhttp3.Call localVarCall = setUserPresenceStatusValidateBeforeCall(username, resource, status, emSetUserPresenceStatus, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * 设置用户在线状态信息 (asynchronously)
+ * 可以设置用户在指定设备的在线状态信息。文档介绍:https://docs-im-beta.easemob.com/document/server-side/presence.html#%E8%AE%BE%E7%BD%AE%E7%94%A8%E6%88%B7%E5%9C%A8%E7%BA%BF%E7%8A%B6%E6%80%81%E4%BF%A1%E6%81%AF
+ * @param username (required)
+ * @param resource 要设置用户在哪个设备的在线状态信息,即传入服务器分配给每个设备资源的唯一标识符,格式为 {device type}_{resource ID},其中设备类型 device type 可以是 android、ios 或 web,资源 ID resource ID 由 SDK 分配。例如,android_123423453246 (required)
+ * @param status 用户的在线状态: - 0:离线; - 1:在线; - 其它数字字符串:自定义在线状态 (required)
+ * @param emSetUserPresenceStatus (optional)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call setUserPresenceStatusAsync(String username, String resource, String status, EMSetUserPresenceStatus emSetUserPresenceStatus, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = setUserPresenceStatusValidateBeforeCall(username, resource, status, emSetUserPresenceStatus, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for subscribeMultipleUsersPresenceStatus
+ * @param username (required)
+ * @param expiry 订阅时长,单位为秒,最大值为 2,592,000,即 30 天 (required)
+ * @param emSubscribeMultipleUsersPresenceStatus (optional)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call subscribeMultipleUsersPresenceStatusCall(String username, String expiry, EMSubscribeMultipleUsersPresenceStatus emSubscribeMultipleUsersPresenceStatus, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = emSubscribeMultipleUsersPresenceStatus;
+
+ // create path and map variables
+ String localVarPath = "/users/{username}/presence/{expiry}"
+ .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()))
+ .replace("{" + "expiry" + "}", localVarApiClient.escapeString(expiry.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call subscribeMultipleUsersPresenceStatusValidateBeforeCall(String username, String expiry, EMSubscribeMultipleUsersPresenceStatus emSubscribeMultipleUsersPresenceStatus, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'username' is set
+ if (username == null) {
+ throw new ApiException("Missing the required parameter 'username' when calling subscribeMultipleUsersPresenceStatus(Async)");
+ }
+
+ // verify the required parameter 'expiry' is set
+ if (expiry == null) {
+ throw new ApiException("Missing the required parameter 'expiry' when calling subscribeMultipleUsersPresenceStatus(Async)");
+ }
+
+ return subscribeMultipleUsersPresenceStatusCall(username, expiry, emSubscribeMultipleUsersPresenceStatus, _callback);
+
+ }
+
+ /**
+ * 批量订阅在线状态
+ * 一次可订阅多个用户的在线状态。文档介绍:https://docs-im-beta.easemob.com/document/server-side/presence.html#%E6%89%B9%E9%87%8F%E8%AE%A2%E9%98%85%E5%9C%A8%E7%BA%BF%E7%8A%B6%E6%80%81
+ * @param username (required)
+ * @param expiry 订阅时长,单位为秒,最大值为 2,592,000,即 30 天 (required)
+ * @param emSubscribeMultipleUsersPresenceStatus (optional)
+ * @return EMSubscribeMultipleUsersPresenceStatusResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public EMSubscribeMultipleUsersPresenceStatusResult subscribeMultipleUsersPresenceStatus(String username, String expiry, EMSubscribeMultipleUsersPresenceStatus emSubscribeMultipleUsersPresenceStatus) throws ApiException {
+ ApiResponse localVarResp = subscribeMultipleUsersPresenceStatusWithHttpInfo(username, expiry, emSubscribeMultipleUsersPresenceStatus);
+ return localVarResp.getData();
+ }
+
+ /**
+ * 批量订阅在线状态
+ * 一次可订阅多个用户的在线状态。文档介绍:https://docs-im-beta.easemob.com/document/server-side/presence.html#%E6%89%B9%E9%87%8F%E8%AE%A2%E9%98%85%E5%9C%A8%E7%BA%BF%E7%8A%B6%E6%80%81
+ * @param username (required)
+ * @param expiry 订阅时长,单位为秒,最大值为 2,592,000,即 30 天 (required)
+ * @param emSubscribeMultipleUsersPresenceStatus (optional)
+ * @return ApiResponse<EMSubscribeMultipleUsersPresenceStatusResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public ApiResponse subscribeMultipleUsersPresenceStatusWithHttpInfo(String username, String expiry, EMSubscribeMultipleUsersPresenceStatus emSubscribeMultipleUsersPresenceStatus) throws ApiException {
+ okhttp3.Call localVarCall = subscribeMultipleUsersPresenceStatusValidateBeforeCall(username, expiry, emSubscribeMultipleUsersPresenceStatus, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * 批量订阅在线状态 (asynchronously)
+ * 一次可订阅多个用户的在线状态。文档介绍:https://docs-im-beta.easemob.com/document/server-side/presence.html#%E6%89%B9%E9%87%8F%E8%AE%A2%E9%98%85%E5%9C%A8%E7%BA%BF%E7%8A%B6%E6%80%81
+ * @param username (required)
+ * @param expiry 订阅时长,单位为秒,最大值为 2,592,000,即 30 天 (required)
+ * @param emSubscribeMultipleUsersPresenceStatus (optional)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call subscribeMultipleUsersPresenceStatusAsync(String username, String expiry, EMSubscribeMultipleUsersPresenceStatus emSubscribeMultipleUsersPresenceStatus, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = subscribeMultipleUsersPresenceStatusValidateBeforeCall(username, expiry, emSubscribeMultipleUsersPresenceStatus, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for unsubscribeMultipleUsersPresenceStatus
+ * @param username (required)
+ * @param requestBody (optional)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call unsubscribeMultipleUsersPresenceStatusCall(String username, List requestBody, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = requestBody;
+
+ // create path and map variables
+ String localVarPath = "/users/{username}/presence"
+ .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call unsubscribeMultipleUsersPresenceStatusValidateBeforeCall(String username, List requestBody, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'username' is set
+ if (username == null) {
+ throw new ApiException("Missing the required parameter 'username' when calling unsubscribeMultipleUsersPresenceStatus(Async)");
+ }
+
+ return unsubscribeMultipleUsersPresenceStatusCall(username, requestBody, _callback);
+
+ }
+
+ /**
+ * 取消订阅多个用户的在线状态
+ * 取消订阅多个用户的在线状态。文档介绍:https://docs-im-beta.easemob.com/document/server-side/presence.html#%E5%8F%96%E6%B6%88%E8%AE%A2%E9%98%85%E5%A4%9A%E4%B8%AA%E7%94%A8%E6%88%B7%E7%9A%84%E5%9C%A8%E7%BA%BF%E7%8A%B6%E6%80%81
+ * @param username (required)
+ * @param requestBody (optional)
+ * @return EMUnsubscribeMultipleUsersPresenceStatusResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public EMUnsubscribeMultipleUsersPresenceStatusResult unsubscribeMultipleUsersPresenceStatus(String username, List requestBody) throws ApiException {
+ ApiResponse localVarResp = unsubscribeMultipleUsersPresenceStatusWithHttpInfo(username, requestBody);
+ return localVarResp.getData();
+ }
+
+ /**
+ * 取消订阅多个用户的在线状态
+ * 取消订阅多个用户的在线状态。文档介绍:https://docs-im-beta.easemob.com/document/server-side/presence.html#%E5%8F%96%E6%B6%88%E8%AE%A2%E9%98%85%E5%A4%9A%E4%B8%AA%E7%94%A8%E6%88%B7%E7%9A%84%E5%9C%A8%E7%BA%BF%E7%8A%B6%E6%80%81
+ * @param username (required)
+ * @param requestBody (optional)
+ * @return ApiResponse<EMUnsubscribeMultipleUsersPresenceStatusResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public ApiResponse unsubscribeMultipleUsersPresenceStatusWithHttpInfo(String username, List requestBody) throws ApiException {
+ okhttp3.Call localVarCall = unsubscribeMultipleUsersPresenceStatusValidateBeforeCall(username, requestBody, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * 取消订阅多个用户的在线状态 (asynchronously)
+ * 取消订阅多个用户的在线状态。文档介绍:https://docs-im-beta.easemob.com/document/server-side/presence.html#%E5%8F%96%E6%B6%88%E8%AE%A2%E9%98%85%E5%A4%9A%E4%B8%AA%E7%94%A8%E6%88%B7%E7%9A%84%E5%9C%A8%E7%BA%BF%E7%8A%B6%E6%80%81
+ * @param username (required)
+ * @param requestBody (optional)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call unsubscribeMultipleUsersPresenceStatusAsync(String username, List requestBody, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = unsubscribeMultipleUsersPresenceStatusValidateBeforeCall(username, requestBody, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+}
diff --git a/src/main/java/com/easemob/im/api/PushApi.java b/src/main/java/com/easemob/im/api/PushApi.java
new file mode 100644
index 000000000..e51fe4353
--- /dev/null
+++ b/src/main/java/com/easemob/im/api/PushApi.java
@@ -0,0 +1,1586 @@
+/*
+ * EMService
+ * Easemob Rest API
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.easemob.im.api;
+
+import com.easemob.im.ApiCallback;
+import com.easemob.im.ApiClient;
+import com.easemob.im.ApiException;
+import com.easemob.im.ApiResponse;
+import com.easemob.im.Configuration;
+import com.easemob.im.Pair;
+import com.easemob.im.ProgressRequestBody;
+import com.easemob.im.ProgressResponseBody;
+
+import com.google.gson.reflect.TypeToken;
+
+import java.io.IOException;
+
+
+import com.easemob.im.api.model.EMCreateOfflinePushTemplate;
+import com.easemob.im.api.model.EMCreateOfflinePushTemplateResult;
+import com.easemob.im.api.model.EMDeleteOfflinePushTemplateResult;
+import com.easemob.im.api.model.EMGetOfflinePushResult;
+import com.easemob.im.api.model.EMGetOfflinePushTemplateResult;
+import com.easemob.im.api.model.EMGetPushBindingInfoResult;
+import com.easemob.im.api.model.EMGetPushPreferredLanguageResult;
+import com.easemob.im.api.model.EMReceiverConfigurationTemplateName;
+import com.easemob.im.api.model.EMReceiverConfigurationTemplateNameResult;
+import com.easemob.im.api.model.EMSetOfflinePushNew;
+import com.easemob.im.api.model.EMSetOfflinePushNewResult;
+import com.easemob.im.api.model.EMSetOfflinePushOld;
+import com.easemob.im.api.model.EMSetPushBindingInfo;
+import com.easemob.im.api.model.EMSetPushBindingInfoResult;
+import com.easemob.im.api.model.EMSetPushPreferredLanguage;
+import com.easemob.im.api.model.EMSetPushPreferredLanguageResult;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class PushApi {
+ private ApiClient localVarApiClient;
+ private int localHostIndex;
+ private String localCustomBaseUrl;
+
+ public PushApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public PushApi(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return localVarApiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ public int getHostIndex() {
+ return localHostIndex;
+ }
+
+ public void setHostIndex(int hostIndex) {
+ this.localHostIndex = hostIndex;
+ }
+
+ public String getCustomBaseUrl() {
+ return localCustomBaseUrl;
+ }
+
+ public void setCustomBaseUrl(String customBaseUrl) {
+ this.localCustomBaseUrl = customBaseUrl;
+ }
+
+ /**
+ * Build call for createOfflinePushTemplate
+ * @param emCreateOfflinePushTemplate (optional)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call createOfflinePushTemplateCall(EMCreateOfflinePushTemplate emCreateOfflinePushTemplate, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = emCreateOfflinePushTemplate;
+
+ // create path and map variables
+ String localVarPath = "/notification/template";
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call createOfflinePushTemplateValidateBeforeCall(EMCreateOfflinePushTemplate emCreateOfflinePushTemplate, final ApiCallback _callback) throws ApiException {
+ return createOfflinePushTemplateCall(emCreateOfflinePushTemplate, _callback);
+
+ }
+
+ /**
+ * 创建离线推送模板
+ * 创建离线推送消息模板,包括默认模板 default 和自定模板。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E5%88%9B%E5%BB%BA%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81%E6%A8%A1%E6%9D%BF
+ * @param emCreateOfflinePushTemplate (optional)
+ * @return EMCreateOfflinePushTemplateResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public EMCreateOfflinePushTemplateResult createOfflinePushTemplate(EMCreateOfflinePushTemplate emCreateOfflinePushTemplate) throws ApiException {
+ ApiResponse localVarResp = createOfflinePushTemplateWithHttpInfo(emCreateOfflinePushTemplate);
+ return localVarResp.getData();
+ }
+
+ /**
+ * 创建离线推送模板
+ * 创建离线推送消息模板,包括默认模板 default 和自定模板。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E5%88%9B%E5%BB%BA%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81%E6%A8%A1%E6%9D%BF
+ * @param emCreateOfflinePushTemplate (optional)
+ * @return ApiResponse<EMCreateOfflinePushTemplateResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public ApiResponse createOfflinePushTemplateWithHttpInfo(EMCreateOfflinePushTemplate emCreateOfflinePushTemplate) throws ApiException {
+ okhttp3.Call localVarCall = createOfflinePushTemplateValidateBeforeCall(emCreateOfflinePushTemplate, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * 创建离线推送模板 (asynchronously)
+ * 创建离线推送消息模板,包括默认模板 default 和自定模板。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E5%88%9B%E5%BB%BA%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81%E6%A8%A1%E6%9D%BF
+ * @param emCreateOfflinePushTemplate (optional)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call createOfflinePushTemplateAsync(EMCreateOfflinePushTemplate emCreateOfflinePushTemplate, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = createOfflinePushTemplateValidateBeforeCall(emCreateOfflinePushTemplate, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for deleteOfflinePushTemplate
+ * @param name 要查询的推送模板的名称 (required)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call deleteOfflinePushTemplateCall(String name, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/notification/template/{name}"
+ .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call deleteOfflinePushTemplateValidateBeforeCall(String name, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'name' is set
+ if (name == null) {
+ throw new ApiException("Missing the required parameter 'name' when calling deleteOfflinePushTemplate(Async)");
+ }
+
+ return deleteOfflinePushTemplateCall(name, _callback);
+
+ }
+
+ /**
+ * 删除离线推送模板
+ * 删除离线消息推送模板。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E5%88%A0%E9%99%A4%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81%E6%A8%A1%E6%9D%BF
+ * @param name 要查询的推送模板的名称 (required)
+ * @return EMDeleteOfflinePushTemplateResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public EMDeleteOfflinePushTemplateResult deleteOfflinePushTemplate(String name) throws ApiException {
+ ApiResponse localVarResp = deleteOfflinePushTemplateWithHttpInfo(name);
+ return localVarResp.getData();
+ }
+
+ /**
+ * 删除离线推送模板
+ * 删除离线消息推送模板。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E5%88%A0%E9%99%A4%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81%E6%A8%A1%E6%9D%BF
+ * @param name 要查询的推送模板的名称 (required)
+ * @return ApiResponse<EMDeleteOfflinePushTemplateResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public ApiResponse deleteOfflinePushTemplateWithHttpInfo(String name) throws ApiException {
+ okhttp3.Call localVarCall = deleteOfflinePushTemplateValidateBeforeCall(name, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * 删除离线推送模板 (asynchronously)
+ * 删除离线消息推送模板。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E5%88%A0%E9%99%A4%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81%E6%A8%A1%E6%9D%BF
+ * @param name 要查询的推送模板的名称 (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
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call deleteOfflinePushTemplateAsync(String name, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = deleteOfflinePushTemplateValidateBeforeCall(name, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for getOfflinePush
+ * @param username (required)
+ * @param chattype 对象类型,即会话类型: - user:用户,表示单聊; - chatgroup:群组,表示群聊 (required)
+ * @param key 对象名称: - 单聊时为对端用户的用户 ID; - 群聊时为群组 ID (required)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call getOfflinePushCall(String username, String chattype, String key, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/users/{username}/notification/{chattype}/{key}"
+ .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()))
+ .replace("{" + "chattype" + "}", localVarApiClient.escapeString(chattype.toString()))
+ .replace("{" + "key" + "}", localVarApiClient.escapeString(key.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call getOfflinePushValidateBeforeCall(String username, String chattype, String key, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'username' is set
+ if (username == null) {
+ throw new ApiException("Missing the required parameter 'username' when calling getOfflinePush(Async)");
+ }
+
+ // verify the required parameter 'chattype' is set
+ if (chattype == null) {
+ throw new ApiException("Missing the required parameter 'chattype' when calling getOfflinePush(Async)");
+ }
+
+ // verify the required parameter 'key' is set
+ if (key == null) {
+ throw new ApiException("Missing the required parameter 'key' when calling getOfflinePush(Async)");
+ }
+
+ return getOfflinePushCall(username, chattype, key, _callback);
+
+ }
+
+ /**
+ * 查询离线推送设置
+ * 查询指定单聊、指定群聊或全局的离线推送设置。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E6%9F%A5%E8%AF%A2%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81%E8%AE%BE%E7%BD%AE
+ * @param username (required)
+ * @param chattype 对象类型,即会话类型: - user:用户,表示单聊; - chatgroup:群组,表示群聊 (required)
+ * @param key 对象名称: - 单聊时为对端用户的用户 ID; - 群聊时为群组 ID (required)
+ * @return EMGetOfflinePushResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public EMGetOfflinePushResult getOfflinePush(String username, String chattype, String key) throws ApiException {
+ ApiResponse localVarResp = getOfflinePushWithHttpInfo(username, chattype, key);
+ return localVarResp.getData();
+ }
+
+ /**
+ * 查询离线推送设置
+ * 查询指定单聊、指定群聊或全局的离线推送设置。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E6%9F%A5%E8%AF%A2%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81%E8%AE%BE%E7%BD%AE
+ * @param username (required)
+ * @param chattype 对象类型,即会话类型: - user:用户,表示单聊; - chatgroup:群组,表示群聊 (required)
+ * @param key 对象名称: - 单聊时为对端用户的用户 ID; - 群聊时为群组 ID (required)
+ * @return ApiResponse<EMGetOfflinePushResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public ApiResponse getOfflinePushWithHttpInfo(String username, String chattype, String key) throws ApiException {
+ okhttp3.Call localVarCall = getOfflinePushValidateBeforeCall(username, chattype, key, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * 查询离线推送设置 (asynchronously)
+ * 查询指定单聊、指定群聊或全局的离线推送设置。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E6%9F%A5%E8%AF%A2%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81%E8%AE%BE%E7%BD%AE
+ * @param username (required)
+ * @param chattype 对象类型,即会话类型: - user:用户,表示单聊; - chatgroup:群组,表示群聊 (required)
+ * @param key 对象名称: - 单聊时为对端用户的用户 ID; - 群聊时为群组 ID (required)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call getOfflinePushAsync(String username, String chattype, String key, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = getOfflinePushValidateBeforeCall(username, chattype, key, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for getOfflinePushTemplate
+ * @param name 要查询的推送模板的名称 (required)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call getOfflinePushTemplateCall(String name, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/notification/template/{name}"
+ .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call getOfflinePushTemplateValidateBeforeCall(String name, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'name' is set
+ if (name == null) {
+ throw new ApiException("Missing the required parameter 'name' when calling getOfflinePushTemplate(Async)");
+ }
+
+ return getOfflinePushTemplateCall(name, _callback);
+
+ }
+
+ /**
+ * 查询离线推送模板
+ * 查询离线推送消息使用的模板。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E6%9F%A5%E8%AF%A2%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81%E6%A8%A1%E6%9D%BF
+ * @param name 要查询的推送模板的名称 (required)
+ * @return EMGetOfflinePushTemplateResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public EMGetOfflinePushTemplateResult getOfflinePushTemplate(String name) throws ApiException {
+ ApiResponse localVarResp = getOfflinePushTemplateWithHttpInfo(name);
+ return localVarResp.getData();
+ }
+
+ /**
+ * 查询离线推送模板
+ * 查询离线推送消息使用的模板。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E6%9F%A5%E8%AF%A2%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81%E6%A8%A1%E6%9D%BF
+ * @param name 要查询的推送模板的名称 (required)
+ * @return ApiResponse<EMGetOfflinePushTemplateResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public ApiResponse getOfflinePushTemplateWithHttpInfo(String name) throws ApiException {
+ okhttp3.Call localVarCall = getOfflinePushTemplateValidateBeforeCall(name, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * 查询离线推送模板 (asynchronously)
+ * 查询离线推送消息使用的模板。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E6%9F%A5%E8%AF%A2%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81%E6%A8%A1%E6%9D%BF
+ * @param name 要查询的推送模板的名称 (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
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call getOfflinePushTemplateAsync(String name, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = getOfflinePushTemplateValidateBeforeCall(name, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for getPushBindingInfo
+ * @param username (required)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call getPushBindingInfoCall(String username, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/users/{username}/push/binding"
+ .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call getPushBindingInfoValidateBeforeCall(String username, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'username' is set
+ if (username == null) {
+ throw new ApiException("Missing the required parameter 'username' when calling getPushBindingInfo(Async)");
+ }
+
+ return getPushBindingInfoCall(username, _callback);
+
+ }
+
+ /**
+ * 查询推送绑定信息
+ * 查询当前用户的所有设备的推送绑定信息。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E6%9F%A5%E8%AF%A2%E6%8E%A8%E9%80%81%E7%BB%91%E5%AE%9A%E4%BF%A1%E6%81%AF
+ * @param username (required)
+ * @return EMGetPushBindingInfoResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public EMGetPushBindingInfoResult getPushBindingInfo(String username) throws ApiException {
+ ApiResponse localVarResp = getPushBindingInfoWithHttpInfo(username);
+ return localVarResp.getData();
+ }
+
+ /**
+ * 查询推送绑定信息
+ * 查询当前用户的所有设备的推送绑定信息。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E6%9F%A5%E8%AF%A2%E6%8E%A8%E9%80%81%E7%BB%91%E5%AE%9A%E4%BF%A1%E6%81%AF
+ * @param username (required)
+ * @return ApiResponse<EMGetPushBindingInfoResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public ApiResponse getPushBindingInfoWithHttpInfo(String username) throws ApiException {
+ okhttp3.Call localVarCall = getPushBindingInfoValidateBeforeCall(username, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * 查询推送绑定信息 (asynchronously)
+ * 查询当前用户的所有设备的推送绑定信息。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E6%9F%A5%E8%AF%A2%E6%8E%A8%E9%80%81%E7%BB%91%E5%AE%9A%E4%BF%A1%E6%81%AF
+ * @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
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call getPushBindingInfoAsync(String username, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = getPushBindingInfoValidateBeforeCall(username, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for getPushPreferredLanguage
+ * @param username (required)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call getPushPreferredLanguageCall(String username, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/users/{username}/notification/language"
+ .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call getPushPreferredLanguageValidateBeforeCall(String username, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'username' is set
+ if (username == null) {
+ throw new ApiException("Missing the required parameter 'username' when calling getPushPreferredLanguage(Async)");
+ }
+
+ return getPushPreferredLanguageCall(username, _callback);
+
+ }
+
+ /**
+ * 获取推送通知的首选语言
+ * 获取推送通知的首选语言。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E8%8E%B7%E5%8F%96%E6%8E%A8%E9%80%81%E9%80%9A%E7%9F%A5%E7%9A%84%E9%A6%96%E9%80%89%E8%AF%AD%E8%A8%80
+ * @param username (required)
+ * @return EMGetPushPreferredLanguageResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public EMGetPushPreferredLanguageResult getPushPreferredLanguage(String username) throws ApiException {
+ ApiResponse localVarResp = getPushPreferredLanguageWithHttpInfo(username);
+ return localVarResp.getData();
+ }
+
+ /**
+ * 获取推送通知的首选语言
+ * 获取推送通知的首选语言。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E8%8E%B7%E5%8F%96%E6%8E%A8%E9%80%81%E9%80%9A%E7%9F%A5%E7%9A%84%E9%A6%96%E9%80%89%E8%AF%AD%E8%A8%80
+ * @param username (required)
+ * @return ApiResponse<EMGetPushPreferredLanguageResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public ApiResponse getPushPreferredLanguageWithHttpInfo(String username) throws ApiException {
+ okhttp3.Call localVarCall = getPushPreferredLanguageValidateBeforeCall(username, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * 获取推送通知的首选语言 (asynchronously)
+ * 获取推送通知的首选语言。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E8%8E%B7%E5%8F%96%E6%8E%A8%E9%80%81%E9%80%9A%E7%9F%A5%E7%9A%84%E9%A6%96%E9%80%89%E8%AF%AD%E8%A8%80
+ * @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
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call getPushPreferredLanguageAsync(String username, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = getPushPreferredLanguageValidateBeforeCall(username, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for receiverConfigurationTemplateName
+ * @param username (required)
+ * @param emReceiverConfigurationTemplateName (optional)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call receiverConfigurationTemplateNameCall(String username, EMReceiverConfigurationTemplateName emReceiverConfigurationTemplateName, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = emReceiverConfigurationTemplateName;
+
+ // create path and map variables
+ String localVarPath = "/users/{username}/notification/template"
+ .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call receiverConfigurationTemplateNameValidateBeforeCall(String username, EMReceiverConfigurationTemplateName emReceiverConfigurationTemplateName, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'username' is set
+ if (username == null) {
+ throw new ApiException("Missing the required parameter 'username' when calling receiverConfigurationTemplateName(Async)");
+ }
+
+ return receiverConfigurationTemplateNameCall(username, emReceiverConfigurationTemplateName, _callback);
+
+ }
+
+ /**
+ * 接收方配置模板名称
+ * 接收方可以调用该 API 设置推送模板。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E6%8E%A5%E6%94%B6%E6%96%B9%E9%85%8D%E7%BD%AE%E6%A8%A1%E6%9D%BF%E5%90%8D%E7%A7%B0
+ * @param username (required)
+ * @param emReceiverConfigurationTemplateName (optional)
+ * @return EMReceiverConfigurationTemplateNameResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public EMReceiverConfigurationTemplateNameResult receiverConfigurationTemplateName(String username, EMReceiverConfigurationTemplateName emReceiverConfigurationTemplateName) throws ApiException {
+ ApiResponse localVarResp = receiverConfigurationTemplateNameWithHttpInfo(username, emReceiverConfigurationTemplateName);
+ return localVarResp.getData();
+ }
+
+ /**
+ * 接收方配置模板名称
+ * 接收方可以调用该 API 设置推送模板。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E6%8E%A5%E6%94%B6%E6%96%B9%E9%85%8D%E7%BD%AE%E6%A8%A1%E6%9D%BF%E5%90%8D%E7%A7%B0
+ * @param username (required)
+ * @param emReceiverConfigurationTemplateName (optional)
+ * @return ApiResponse<EMReceiverConfigurationTemplateNameResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public ApiResponse receiverConfigurationTemplateNameWithHttpInfo(String username, EMReceiverConfigurationTemplateName emReceiverConfigurationTemplateName) throws ApiException {
+ okhttp3.Call localVarCall = receiverConfigurationTemplateNameValidateBeforeCall(username, emReceiverConfigurationTemplateName, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * 接收方配置模板名称 (asynchronously)
+ * 接收方可以调用该 API 设置推送模板。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E6%8E%A5%E6%94%B6%E6%96%B9%E9%85%8D%E7%BD%AE%E6%A8%A1%E6%9D%BF%E5%90%8D%E7%A7%B0
+ * @param username (required)
+ * @param emReceiverConfigurationTemplateName (optional)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call receiverConfigurationTemplateNameAsync(String username, EMReceiverConfigurationTemplateName emReceiverConfigurationTemplateName, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = receiverConfigurationTemplateNameValidateBeforeCall(username, emReceiverConfigurationTemplateName, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for setOfflinePushNew
+ * @param username (required)
+ * @param chattype 对象类型,即会话类型: - user:用户,表示单聊; - chatgroup:群组,表示群聊 (required)
+ * @param key 对象名称: - 单聊时为对端用户的用户 ID; - 群聊时为群组 ID (required)
+ * @param emSetOfflinePushNew (optional)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call setOfflinePushNewCall(String username, String chattype, String key, EMSetOfflinePushNew emSetOfflinePushNew, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = emSetOfflinePushNew;
+
+ // create path and map variables
+ String localVarPath = "/users/{username}/notification/{chattype}/{key}"
+ .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()))
+ .replace("{" + "chattype" + "}", localVarApiClient.escapeString(chattype.toString()))
+ .replace("{" + "key" + "}", localVarApiClient.escapeString(key.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call setOfflinePushNewValidateBeforeCall(String username, String chattype, String key, EMSetOfflinePushNew emSetOfflinePushNew, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'username' is set
+ if (username == null) {
+ throw new ApiException("Missing the required parameter 'username' when calling setOfflinePushNew(Async)");
+ }
+
+ // verify the required parameter 'chattype' is set
+ if (chattype == null) {
+ throw new ApiException("Missing the required parameter 'chattype' when calling setOfflinePushNew(Async)");
+ }
+
+ // verify the required parameter 'key' is set
+ if (key == null) {
+ throw new ApiException("Missing the required parameter 'key' when calling setOfflinePushNew(Async)");
+ }
+
+ return setOfflinePushNewCall(username, chattype, key, emSetOfflinePushNew, _callback);
+
+ }
+
+ /**
+ * 设置离线推送(新)
+ * 你可以设置全局离线推送的通知方式和免打扰模式以及单个单聊或群聊会话的离线推送设置。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E8%AE%BE%E7%BD%AE%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81
+ * @param username (required)
+ * @param chattype 对象类型,即会话类型: - user:用户,表示单聊; - chatgroup:群组,表示群聊 (required)
+ * @param key 对象名称: - 单聊时为对端用户的用户 ID; - 群聊时为群组 ID (required)
+ * @param emSetOfflinePushNew (optional)
+ * @return EMSetOfflinePushNewResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public EMSetOfflinePushNewResult setOfflinePushNew(String username, String chattype, String key, EMSetOfflinePushNew emSetOfflinePushNew) throws ApiException {
+ ApiResponse localVarResp = setOfflinePushNewWithHttpInfo(username, chattype, key, emSetOfflinePushNew);
+ return localVarResp.getData();
+ }
+
+ /**
+ * 设置离线推送(新)
+ * 你可以设置全局离线推送的通知方式和免打扰模式以及单个单聊或群聊会话的离线推送设置。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E8%AE%BE%E7%BD%AE%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81
+ * @param username (required)
+ * @param chattype 对象类型,即会话类型: - user:用户,表示单聊; - chatgroup:群组,表示群聊 (required)
+ * @param key 对象名称: - 单聊时为对端用户的用户 ID; - 群聊时为群组 ID (required)
+ * @param emSetOfflinePushNew (optional)
+ * @return ApiResponse<EMSetOfflinePushNewResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public ApiResponse setOfflinePushNewWithHttpInfo(String username, String chattype, String key, EMSetOfflinePushNew emSetOfflinePushNew) throws ApiException {
+ okhttp3.Call localVarCall = setOfflinePushNewValidateBeforeCall(username, chattype, key, emSetOfflinePushNew, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * 设置离线推送(新) (asynchronously)
+ * 你可以设置全局离线推送的通知方式和免打扰模式以及单个单聊或群聊会话的离线推送设置。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E8%AE%BE%E7%BD%AE%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81
+ * @param username (required)
+ * @param chattype 对象类型,即会话类型: - user:用户,表示单聊; - chatgroup:群组,表示群聊 (required)
+ * @param key 对象名称: - 单聊时为对端用户的用户 ID; - 群聊时为群组 ID (required)
+ * @param emSetOfflinePushNew (optional)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call setOfflinePushNewAsync(String username, String chattype, String key, EMSetOfflinePushNew emSetOfflinePushNew, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = setOfflinePushNewValidateBeforeCall(username, chattype, key, emSetOfflinePushNew, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for setOfflinePushOld
+ * @param username 用户 ID (required)
+ * @param emSetOfflinePushOld (optional)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call setOfflinePushOldCall(String username, EMSetOfflinePushOld emSetOfflinePushOld, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = emSetOfflinePushOld;
+
+ // create path and map variables
+ String localVarPath = "/users/{username}"
+ .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call setOfflinePushOldValidateBeforeCall(String username, EMSetOfflinePushOld emSetOfflinePushOld, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'username' is set
+ if (username == null) {
+ throw new ApiException("Missing the required parameter 'username' when calling setOfflinePushOld(Async)");
+ }
+
+ return setOfflinePushOldCall(username, emSetOfflinePushOld, _callback);
+
+ }
+
+ /**
+ * 离线推送设置。包括设置离线推送时显示的昵称、设置离线推送通知的展示方式、设置免打扰模式
+ * 离线推送设置。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E8%AE%BE%E7%BD%AE%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81%E6%97%B6%E6%98%BE%E7%A4%BA%E7%9A%84%E6%98%B5%E7%A7%B0、https://docs-im-beta.easemob.com/document/server-side/push.html#%E8%AE%BE%E7%BD%AE%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81%E9%80%9A%E7%9F%A5%E7%9A%84%E5%B1%95%E7%A4%BA%E6%96%B9%E5%BC%8F、https://docs-im-beta.easemob.com/document/server-side/push.html#%E8%AE%BE%E7%BD%AE%E5%85%8D%E6%89%93%E6%89%B0%E6%A8%A1%E5%BC%8F
+ * @param username 用户 ID (required)
+ * @param emSetOfflinePushOld (optional)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public void setOfflinePushOld(String username, EMSetOfflinePushOld emSetOfflinePushOld) throws ApiException {
+ setOfflinePushOldWithHttpInfo(username, emSetOfflinePushOld);
+ }
+
+ /**
+ * 离线推送设置。包括设置离线推送时显示的昵称、设置离线推送通知的展示方式、设置免打扰模式
+ * 离线推送设置。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E8%AE%BE%E7%BD%AE%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81%E6%97%B6%E6%98%BE%E7%A4%BA%E7%9A%84%E6%98%B5%E7%A7%B0、https://docs-im-beta.easemob.com/document/server-side/push.html#%E8%AE%BE%E7%BD%AE%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81%E9%80%9A%E7%9F%A5%E7%9A%84%E5%B1%95%E7%A4%BA%E6%96%B9%E5%BC%8F、https://docs-im-beta.easemob.com/document/server-side/push.html#%E8%AE%BE%E7%BD%AE%E5%85%8D%E6%89%93%E6%89%B0%E6%A8%A1%E5%BC%8F
+ * @param username 用户 ID (required)
+ * @param emSetOfflinePushOld (optional)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public ApiResponse setOfflinePushOldWithHttpInfo(String username, EMSetOfflinePushOld emSetOfflinePushOld) throws ApiException {
+ okhttp3.Call localVarCall = setOfflinePushOldValidateBeforeCall(username, emSetOfflinePushOld, null);
+ return localVarApiClient.execute(localVarCall);
+ }
+
+ /**
+ * 离线推送设置。包括设置离线推送时显示的昵称、设置离线推送通知的展示方式、设置免打扰模式 (asynchronously)
+ * 离线推送设置。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E8%AE%BE%E7%BD%AE%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81%E6%97%B6%E6%98%BE%E7%A4%BA%E7%9A%84%E6%98%B5%E7%A7%B0、https://docs-im-beta.easemob.com/document/server-side/push.html#%E8%AE%BE%E7%BD%AE%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81%E9%80%9A%E7%9F%A5%E7%9A%84%E5%B1%95%E7%A4%BA%E6%96%B9%E5%BC%8F、https://docs-im-beta.easemob.com/document/server-side/push.html#%E8%AE%BE%E7%BD%AE%E5%85%8D%E6%89%93%E6%89%B0%E6%A8%A1%E5%BC%8F
+ * @param username 用户 ID (required)
+ * @param emSetOfflinePushOld (optional)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call setOfflinePushOldAsync(String username, EMSetOfflinePushOld emSetOfflinePushOld, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = setOfflinePushOldValidateBeforeCall(username, emSetOfflinePushOld, _callback);
+ localVarApiClient.executeAsync(localVarCall, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for setPushBindingInfo
+ * @param username (required)
+ * @param emSetPushBindingInfo (optional)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call setPushBindingInfoCall(String username, EMSetPushBindingInfo emSetPushBindingInfo, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = emSetPushBindingInfo;
+
+ // create path and map variables
+ String localVarPath = "/users/{username}/push/binding"
+ .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call setPushBindingInfoValidateBeforeCall(String username, EMSetPushBindingInfo emSetPushBindingInfo, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'username' is set
+ if (username == null) {
+ throw new ApiException("Missing the required parameter 'username' when calling setPushBindingInfo(Async)");
+ }
+
+ return setPushBindingInfoCall(username, emSetPushBindingInfo, _callback);
+
+ }
+
+ /**
+ * 绑定和解绑推送信息
+ * 推送消息时,设备与推送信息会进行绑定,包括设备 ID、推送证书和 device token。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E7%BB%91%E5%AE%9A%E5%92%8C%E8%A7%A3%E7%BB%91%E6%8E%A8%E9%80%81%E4%BF%A1%E6%81%AF
+ * @param username (required)
+ * @param emSetPushBindingInfo (optional)
+ * @return EMSetPushBindingInfoResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public EMSetPushBindingInfoResult setPushBindingInfo(String username, EMSetPushBindingInfo emSetPushBindingInfo) throws ApiException {
+ ApiResponse localVarResp = setPushBindingInfoWithHttpInfo(username, emSetPushBindingInfo);
+ return localVarResp.getData();
+ }
+
+ /**
+ * 绑定和解绑推送信息
+ * 推送消息时,设备与推送信息会进行绑定,包括设备 ID、推送证书和 device token。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E7%BB%91%E5%AE%9A%E5%92%8C%E8%A7%A3%E7%BB%91%E6%8E%A8%E9%80%81%E4%BF%A1%E6%81%AF
+ * @param username (required)
+ * @param emSetPushBindingInfo (optional)
+ * @return ApiResponse<EMSetPushBindingInfoResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public ApiResponse setPushBindingInfoWithHttpInfo(String username, EMSetPushBindingInfo emSetPushBindingInfo) throws ApiException {
+ okhttp3.Call localVarCall = setPushBindingInfoValidateBeforeCall(username, emSetPushBindingInfo, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * 绑定和解绑推送信息 (asynchronously)
+ * 推送消息时,设备与推送信息会进行绑定,包括设备 ID、推送证书和 device token。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E7%BB%91%E5%AE%9A%E5%92%8C%E8%A7%A3%E7%BB%91%E6%8E%A8%E9%80%81%E4%BF%A1%E6%81%AF
+ * @param username (required)
+ * @param emSetPushBindingInfo (optional)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call setPushBindingInfoAsync(String username, EMSetPushBindingInfo emSetPushBindingInfo, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = setPushBindingInfoValidateBeforeCall(username, emSetPushBindingInfo, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for setPushPreferredLanguage
+ * @param username (required)
+ * @param emSetPushPreferredLanguage (optional)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | OK | - |
+ 4xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+ 5xx | 错误码:https://docs-im-beta.easemob.com/document/server-side/error.html | - |
+
+ */
+ public okhttp3.Call setPushPreferredLanguageCall(String username, EMSetPushPreferredLanguage emSetPushPreferredLanguage, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = emSetPushPreferredLanguage;
+
+ // create path and map variables
+ String localVarPath = "/users/{username}/notification/language"
+ .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call setPushPreferredLanguageValidateBeforeCall(String username, EMSetPushPreferredLanguage emSetPushPreferredLanguage, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'username' is set
+ if (username == null) {
+ throw new ApiException("Missing the required parameter 'username' when calling setPushPreferredLanguage(Async)");
+ }
+
+ return setPushPreferredLanguageCall(username, emSetPushPreferredLanguage, _callback);
+
+ }
+
+ /**
+ * 设置推送通知的首选语言
+ * 设置离线推送消息的首选语言。文档介绍:https://docs-im-beta.easemob.com/document/server-side/push.html#%E8%AE%BE%E7%BD%AE%E6%8E%A8%E9%80%81%E9%80%9A%E7%9F%A5%E7%9A%84%E9%A6%96%E9%80%89%E8%AF%AD%E8%A8%80
+ * @param username (required)
+ * @param emSetPushPreferredLanguage (optional)
+ * @return EMSetPushPreferredLanguageResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+