com.aliyun.dingtalkflashmsg_1_0.Client Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dingtalk Show documentation
Show all versions of dingtalk Show documentation
Alibaba Cloud dingtalk SDK for Java
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.dingtalkflashmsg_1_0;
import com.aliyun.tea.*;
import com.aliyun.dingtalkflashmsg_1_0.models.*;
public class Client extends com.aliyun.teaopenapi.Client {
public Client(com.aliyun.teaopenapi.models.Config config) throws Exception {
super(config);
com.aliyun.gateway.dingtalk.Client gatewayClient = new com.aliyun.gateway.dingtalk.Client();
this._spi = gatewayClient;
this._endpointRule = "";
if (com.aliyun.teautil.Common.empty(_endpoint)) {
this._endpoint = "api.dingtalk.com";
}
}
/**
* summary :
* 添加插件规则
*
* @param request AddPluginRuleRequest
* @param headers AddPluginRuleHeaders
* @param runtime runtime options for this request RuntimeOptions
* @return AddPluginRuleResponse
*/
public AddPluginRuleResponse addPluginRuleWithOptions(AddPluginRuleRequest request, AddPluginRuleHeaders headers, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception {
com.aliyun.teautil.Common.validateModel(request);
java.util.Map body = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(request.chatType)) {
body.put("chatType", request.chatType);
}
if (!com.aliyun.teautil.Common.isUnset(request.code)) {
body.put("code", request.code);
}
if (!com.aliyun.teautil.Common.isUnset(request.itemType)) {
body.put("itemType", request.itemType);
}
if (!com.aliyun.teautil.Common.isUnset(request.rules)) {
body.put("rules", request.rules);
}
if (!com.aliyun.teautil.Common.isUnset(request.userId)) {
body.put("userId", request.userId);
}
java.util.Map realHeaders = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!com.aliyun.teautil.Common.isUnset(headers.xAcsDingtalkAccessToken)) {
realHeaders.put("x-acs-dingtalk-access-token", com.aliyun.teautil.Common.toJSONString(headers.xAcsDingtalkAccessToken));
}
com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
new TeaPair("body", com.aliyun.openapiutil.Client.parseToMap(body))
));
com.aliyun.teaopenapi.models.Params params = com.aliyun.teaopenapi.models.Params.build(TeaConverter.buildMap(
new TeaPair("action", "AddPluginRule"),
new TeaPair("version", "flashmsg_1.0"),
new TeaPair("protocol", "HTTP"),
new TeaPair("pathname", "/v1.0/flashmsg/plugins"),
new TeaPair("method", "POST"),
new TeaPair("authType", "AK"),
new TeaPair("style", "ROA"),
new TeaPair("reqBodyType", "none"),
new TeaPair("bodyType", "json")
));
return TeaModel.toModel(this.execute(params, req, runtime), new AddPluginRuleResponse());
}
/**
* summary :
* 添加插件规则
*
* @param request AddPluginRuleRequest
* @return AddPluginRuleResponse
*/
public AddPluginRuleResponse addPluginRule(AddPluginRuleRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
AddPluginRuleHeaders headers = new AddPluginRuleHeaders();
return this.addPluginRuleWithOptions(request, headers, runtime);
}
/**
* summary :
* 删除插件规则
*
* @param request DeletePlguinRuleRequest
* @param headers DeletePlguinRuleHeaders
* @param runtime runtime options for this request RuntimeOptions
* @return DeletePlguinRuleResponse
*/
public DeletePlguinRuleResponse deletePlguinRuleWithOptions(DeletePlguinRuleRequest request, DeletePlguinRuleHeaders headers, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception {
com.aliyun.teautil.Common.validateModel(request);
java.util.Map body = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(request.bizIdList)) {
body.put("bizIdList", request.bizIdList);
}
if (!com.aliyun.teautil.Common.isUnset(request.userId)) {
body.put("userId", request.userId);
}
java.util.Map realHeaders = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!com.aliyun.teautil.Common.isUnset(headers.xAcsDingtalkAccessToken)) {
realHeaders.put("x-acs-dingtalk-access-token", com.aliyun.teautil.Common.toJSONString(headers.xAcsDingtalkAccessToken));
}
com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
new TeaPair("body", com.aliyun.openapiutil.Client.parseToMap(body))
));
com.aliyun.teaopenapi.models.Params params = com.aliyun.teaopenapi.models.Params.build(TeaConverter.buildMap(
new TeaPair("action", "DeletePlguinRule"),
new TeaPair("version", "flashmsg_1.0"),
new TeaPair("protocol", "HTTP"),
new TeaPair("pathname", "/v1.0/flashmsg/plugins/remove"),
new TeaPair("method", "POST"),
new TeaPair("authType", "AK"),
new TeaPair("style", "ROA"),
new TeaPair("reqBodyType", "none"),
new TeaPair("bodyType", "json")
));
return TeaModel.toModel(this.execute(params, req, runtime), new DeletePlguinRuleResponse());
}
/**
* summary :
* 删除插件规则
*
* @param request DeletePlguinRuleRequest
* @return DeletePlguinRuleResponse
*/
public DeletePlguinRuleResponse deletePlguinRule(DeletePlguinRuleRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
DeletePlguinRuleHeaders headers = new DeletePlguinRuleHeaders();
return this.deletePlguinRuleWithOptions(request, headers, runtime);
}
/**
* summary :
* 闪读用户基础信息查询
*
* @param request GetBaseProfileListRequest
* @param headers GetBaseProfileListHeaders
* @param runtime runtime options for this request RuntimeOptions
* @return GetBaseProfileListResponse
*/
public GetBaseProfileListResponse getBaseProfileListWithOptions(GetBaseProfileListRequest request, GetBaseProfileListHeaders headers, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception {
com.aliyun.teautil.Common.validateModel(request);
java.util.Map realHeaders = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!com.aliyun.teautil.Common.isUnset(headers.xAcsDingtalkAccessToken)) {
realHeaders.put("x-acs-dingtalk-access-token", com.aliyun.teautil.Common.toJSONString(headers.xAcsDingtalkAccessToken));
}
com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
new TeaPair("body", request.body)
));
com.aliyun.teaopenapi.models.Params params = com.aliyun.teaopenapi.models.Params.build(TeaConverter.buildMap(
new TeaPair("action", "GetBaseProfileList"),
new TeaPair("version", "flashmsg_1.0"),
new TeaPair("protocol", "HTTP"),
new TeaPair("pathname", "/v1.0/flashmsg/users/baseInfos/query"),
new TeaPair("method", "POST"),
new TeaPair("authType", "AK"),
new TeaPair("style", "ROA"),
new TeaPair("reqBodyType", "none"),
new TeaPair("bodyType", "json")
));
return TeaModel.toModel(this.execute(params, req, runtime), new GetBaseProfileListResponse());
}
/**
* summary :
* 闪读用户基础信息查询
*
* @param request GetBaseProfileListRequest
* @return GetBaseProfileListResponse
*/
public GetBaseProfileListResponse getBaseProfileList(GetBaseProfileListRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
GetBaseProfileListHeaders headers = new GetBaseProfileListHeaders();
return this.getBaseProfileListWithOptions(request, headers, runtime);
}
/**
* summary :
* 获得闪读会话信息
*
* @param request GetConversationRequest
* @param headers GetConversationHeaders
* @param runtime runtime options for this request RuntimeOptions
* @return GetConversationResponse
*/
public GetConversationResponse getConversationWithOptions(GetConversationRequest request, GetConversationHeaders headers, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception {
com.aliyun.teautil.Common.validateModel(request);
java.util.Map query = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(request.openConversationId)) {
query.put("openConversationId", request.openConversationId);
}
if (!com.aliyun.teautil.Common.isUnset(request.userId)) {
query.put("userId", request.userId);
}
java.util.Map realHeaders = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!com.aliyun.teautil.Common.isUnset(headers.xAcsDingtalkAccessToken)) {
realHeaders.put("x-acs-dingtalk-access-token", com.aliyun.teautil.Common.toJSONString(headers.xAcsDingtalkAccessToken));
}
com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
new TeaPair("query", com.aliyun.openapiutil.Client.query(query))
));
com.aliyun.teaopenapi.models.Params params = com.aliyun.teaopenapi.models.Params.build(TeaConverter.buildMap(
new TeaPair("action", "GetConversation"),
new TeaPair("version", "flashmsg_1.0"),
new TeaPair("protocol", "HTTP"),
new TeaPair("pathname", "/v1.0/flashmsg/conversations/infos"),
new TeaPair("method", "GET"),
new TeaPair("authType", "AK"),
new TeaPair("style", "ROA"),
new TeaPair("reqBodyType", "none"),
new TeaPair("bodyType", "json")
));
return TeaModel.toModel(this.execute(params, req, runtime), new GetConversationResponse());
}
/**
* summary :
* 获得闪读会话信息
*
* @param request GetConversationRequest
* @return GetConversationResponse
*/
public GetConversationResponse getConversation(GetConversationRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
GetConversationHeaders headers = new GetConversationHeaders();
return this.getConversationWithOptions(request, headers, runtime);
}
/**
* summary :
* 获得成员ID列表
*
* @param request GetMemberListRequest
* @param headers GetMemberListHeaders
* @param runtime runtime options for this request RuntimeOptions
* @return GetMemberListResponse
*/
public GetMemberListResponse getMemberListWithOptions(GetMemberListRequest request, GetMemberListHeaders headers, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception {
com.aliyun.teautil.Common.validateModel(request);
java.util.Map query = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(request.openConversationId)) {
query.put("openConversationId", request.openConversationId);
}
if (!com.aliyun.teautil.Common.isUnset(request.pageNumber)) {
query.put("pageNumber", request.pageNumber);
}
if (!com.aliyun.teautil.Common.isUnset(request.pageSize)) {
query.put("pageSize", request.pageSize);
}
if (!com.aliyun.teautil.Common.isUnset(request.userId)) {
query.put("userId", request.userId);
}
java.util.Map realHeaders = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!com.aliyun.teautil.Common.isUnset(headers.xAcsDingtalkAccessToken)) {
realHeaders.put("x-acs-dingtalk-access-token", com.aliyun.teautil.Common.toJSONString(headers.xAcsDingtalkAccessToken));
}
com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
new TeaPair("query", com.aliyun.openapiutil.Client.query(query))
));
com.aliyun.teaopenapi.models.Params params = com.aliyun.teaopenapi.models.Params.build(TeaConverter.buildMap(
new TeaPair("action", "GetMemberList"),
new TeaPair("version", "flashmsg_1.0"),
new TeaPair("protocol", "HTTP"),
new TeaPair("pathname", "/v1.0/flashmsg/conversations/memberIdLists"),
new TeaPair("method", "GET"),
new TeaPair("authType", "AK"),
new TeaPair("style", "ROA"),
new TeaPair("reqBodyType", "none"),
new TeaPair("bodyType", "json")
));
return TeaModel.toModel(this.execute(params, req, runtime), new GetMemberListResponse());
}
/**
* summary :
* 获得成员ID列表
*
* @param request GetMemberListRequest
* @return GetMemberListResponse
*/
public GetMemberListResponse getMemberList(GetMemberListRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
GetMemberListHeaders headers = new GetMemberListHeaders();
return this.getMemberListWithOptions(request, headers, runtime);
}
/**
* summary :
* 查询插件规则
*
* @param request QueryPluginRuleRequest
* @param headers QueryPluginRuleHeaders
* @param runtime runtime options for this request RuntimeOptions
* @return QueryPluginRuleResponse
*/
public QueryPluginRuleResponse queryPluginRuleWithOptions(QueryPluginRuleRequest request, QueryPluginRuleHeaders headers, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception {
com.aliyun.teautil.Common.validateModel(request);
java.util.Map query = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(request.chatType)) {
query.put("chatType", request.chatType);
}
if (!com.aliyun.teautil.Common.isUnset(request.code)) {
query.put("code", request.code);
}
if (!com.aliyun.teautil.Common.isUnset(request.itemId)) {
query.put("itemId", request.itemId);
}
if (!com.aliyun.teautil.Common.isUnset(request.itemType)) {
query.put("itemType", request.itemType);
}
if (!com.aliyun.teautil.Common.isUnset(request.pageNumber)) {
query.put("pageNumber", request.pageNumber);
}
if (!com.aliyun.teautil.Common.isUnset(request.pageSize)) {
query.put("pageSize", request.pageSize);
}
java.util.Map realHeaders = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!com.aliyun.teautil.Common.isUnset(headers.xAcsDingtalkAccessToken)) {
realHeaders.put("x-acs-dingtalk-access-token", com.aliyun.teautil.Common.toJSONString(headers.xAcsDingtalkAccessToken));
}
com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
new TeaPair("query", com.aliyun.openapiutil.Client.query(query))
));
com.aliyun.teaopenapi.models.Params params = com.aliyun.teaopenapi.models.Params.build(TeaConverter.buildMap(
new TeaPair("action", "QueryPluginRule"),
new TeaPair("version", "flashmsg_1.0"),
new TeaPair("protocol", "HTTP"),
new TeaPair("pathname", "/v1.0/flashmsg/plugins"),
new TeaPair("method", "GET"),
new TeaPair("authType", "AK"),
new TeaPair("style", "ROA"),
new TeaPair("reqBodyType", "none"),
new TeaPair("bodyType", "json")
));
return TeaModel.toModel(this.execute(params, req, runtime), new QueryPluginRuleResponse());
}
/**
* summary :
* 查询插件规则
*
* @param request QueryPluginRuleRequest
* @return QueryPluginRuleResponse
*/
public QueryPluginRuleResponse queryPluginRule(QueryPluginRuleRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
QueryPluginRuleHeaders headers = new QueryPluginRuleHeaders();
return this.queryPluginRuleWithOptions(request, headers, runtime);
}
/**
* summary :
* 发送Ding提示消息
*
* @param request SendDingTipRequest
* @param headers SendDingTipHeaders
* @param runtime runtime options for this request RuntimeOptions
* @return SendDingTipResponse
*/
public SendDingTipResponse sendDingTipWithOptions(SendDingTipRequest request, SendDingTipHeaders headers, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception {
com.aliyun.teautil.Common.validateModel(request);
java.util.Map body = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(request.extension)) {
body.put("extension", request.extension);
}
if (!com.aliyun.teautil.Common.isUnset(request.link)) {
body.put("link", request.link);
}
if (!com.aliyun.teautil.Common.isUnset(request.messageId)) {
body.put("messageId", request.messageId);
}
if (!com.aliyun.teautil.Common.isUnset(request.receiverUserId)) {
body.put("receiverUserId", request.receiverUserId);
}
if (!com.aliyun.teautil.Common.isUnset(request.senderUserId)) {
body.put("senderUserId", request.senderUserId);
}
if (!com.aliyun.teautil.Common.isUnset(request.textContent)) {
body.put("textContent", request.textContent);
}
java.util.Map realHeaders = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!com.aliyun.teautil.Common.isUnset(headers.xAcsDingtalkAccessToken)) {
realHeaders.put("x-acs-dingtalk-access-token", com.aliyun.teautil.Common.toJSONString(headers.xAcsDingtalkAccessToken));
}
com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
new TeaPair("body", com.aliyun.openapiutil.Client.parseToMap(body))
));
com.aliyun.teaopenapi.models.Params params = com.aliyun.teaopenapi.models.Params.build(TeaConverter.buildMap(
new TeaPair("action", "SendDingTip"),
new TeaPair("version", "flashmsg_1.0"),
new TeaPair("protocol", "HTTP"),
new TeaPair("pathname", "/v1.0/flashmsg/ding/messages/send"),
new TeaPair("method", "POST"),
new TeaPair("authType", "AK"),
new TeaPair("style", "ROA"),
new TeaPair("reqBodyType", "none"),
new TeaPair("bodyType", "json")
));
return TeaModel.toModel(this.execute(params, req, runtime), new SendDingTipResponse());
}
/**
* summary :
* 发送Ding提示消息
*
* @param request SendDingTipRequest
* @return SendDingTipResponse
*/
public SendDingTipResponse sendDingTip(SendDingTipRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
SendDingTipHeaders headers = new SendDingTipHeaders();
return this.sendDingTipWithOptions(request, headers, runtime);
}
/**
* summary :
* 发送闪读消息提示
*
* @param request SendMessageTipRequest
* @param headers SendMessageTipHeaders
* @param runtime runtime options for this request RuntimeOptions
* @return SendMessageTipResponse
*/
public SendMessageTipResponse sendMessageTipWithOptions(SendMessageTipRequest request, SendMessageTipHeaders headers, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception {
com.aliyun.teautil.Common.validateModel(request);
java.util.Map body = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(request.defaultView)) {
body.put("defaultView", request.defaultView);
}
if (!com.aliyun.teautil.Common.isUnset(request.messageId)) {
body.put("messageId", request.messageId);
}
if (!com.aliyun.teautil.Common.isUnset(request.openConversationId)) {
body.put("openConversationId", request.openConversationId);
}
if (!com.aliyun.teautil.Common.isUnset(request.privateFieldMap)) {
body.put("privateFieldMap", request.privateFieldMap);
}
if (!com.aliyun.teautil.Common.isUnset(request.publicField)) {
body.put("publicField", request.publicField);
}
if (!com.aliyun.teautil.Common.isUnset(request.receiverUserId)) {
body.put("receiverUserId", request.receiverUserId);
}
if (!com.aliyun.teautil.Common.isUnset(request.senderUserId)) {
body.put("senderUserId", request.senderUserId);
}
java.util.Map realHeaders = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!com.aliyun.teautil.Common.isUnset(headers.xAcsDingtalkAccessToken)) {
realHeaders.put("x-acs-dingtalk-access-token", com.aliyun.teautil.Common.toJSONString(headers.xAcsDingtalkAccessToken));
}
com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
new TeaPair("body", com.aliyun.openapiutil.Client.parseToMap(body))
));
com.aliyun.teaopenapi.models.Params params = com.aliyun.teaopenapi.models.Params.build(TeaConverter.buildMap(
new TeaPair("action", "SendMessageTip"),
new TeaPair("version", "flashmsg_1.0"),
new TeaPair("protocol", "HTTP"),
new TeaPair("pathname", "/v1.0/flashmsg/messages/send"),
new TeaPair("method", "POST"),
new TeaPair("authType", "AK"),
new TeaPair("style", "ROA"),
new TeaPair("reqBodyType", "none"),
new TeaPair("bodyType", "json")
));
return TeaModel.toModel(this.execute(params, req, runtime), new SendMessageTipResponse());
}
/**
* summary :
* 发送闪读消息提示
*
* @param request SendMessageTipRequest
* @return SendMessageTipResponse
*/
public SendMessageTipResponse sendMessageTip(SendMessageTipRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
SendMessageTipHeaders headers = new SendMessageTipHeaders();
return this.sendMessageTipWithOptions(request, headers, runtime);
}
}