com.aliyun.dingtalkim_2_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
The newest version!
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.dingtalkim_2_0;
import com.aliyun.tea.*;
import com.aliyun.dingtalkim_2_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._signatureAlgorithm = "v2";
this._endpointRule = "";
if (com.aliyun.teautil.Common.empty(_endpoint)) {
this._endpoint = "api.dingtalk.com";
}
}
/**
* summary :
* 关闭互动卡片吊顶
*
* @param request CloseTopboxRequest
* @param headers CloseTopboxHeaders
* @param runtime runtime options for this request RuntimeOptions
* @return CloseTopboxResponse
*/
public CloseTopboxResponse closeTopboxWithOptions(CloseTopboxRequest request, CloseTopboxHeaders 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.conversationType)) {
body.put("conversationType", request.conversationType);
}
if (!com.aliyun.teautil.Common.isUnset(request.coolAppCode)) {
body.put("coolAppCode", request.coolAppCode);
}
if (!com.aliyun.teautil.Common.isUnset(request.groupTemplateId)) {
body.put("groupTemplateId", request.groupTemplateId);
}
if (!com.aliyun.teautil.Common.isUnset(request.openConversationId)) {
body.put("openConversationId", request.openConversationId);
}
if (!com.aliyun.teautil.Common.isUnset(request.outTrackId)) {
body.put("outTrackId", request.outTrackId);
}
if (!com.aliyun.teautil.Common.isUnset(request.robotCode)) {
body.put("robotCode", request.robotCode);
}
if (!com.aliyun.teautil.Common.isUnset(request.unoinId)) {
body.put("unoinId", request.unoinId);
}
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", "CloseTopbox"),
new TeaPair("version", "im_2.0"),
new TeaPair("protocol", "HTTP"),
new TeaPair("pathname", "/v2.0/im/topBoxes/close"),
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 CloseTopboxResponse());
}
/**
* summary :
* 关闭互动卡片吊顶
*
* @param request CloseTopboxRequest
* @return CloseTopboxResponse
*/
public CloseTopboxResponse closeTopbox(CloseTopboxRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
CloseTopboxHeaders headers = new CloseTopboxHeaders();
return this.closeTopboxWithOptions(request, headers, runtime);
}
/**
* summary :
* 创建两人群
*
* @param request CreateCoupleGroupRequest
* @param headers CreateCoupleGroupHeaders
* @param runtime runtime options for this request RuntimeOptions
* @return CreateCoupleGroupResponse
*/
public CreateCoupleGroupResponse createCoupleGroupWithOptions(CreateCoupleGroupRequest request, CreateCoupleGroupHeaders 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.groupTemplateId)) {
body.put("groupTemplateId", request.groupTemplateId);
}
if (!com.aliyun.teautil.Common.isUnset(request.operatorId)) {
body.put("operatorId", request.operatorId);
}
if (!com.aliyun.teautil.Common.isUnset(request.users)) {
body.put("users", request.users);
}
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", "CreateCoupleGroup"),
new TeaPair("version", "im_2.0"),
new TeaPair("protocol", "HTTP"),
new TeaPair("pathname", "/v2.0/im/interconnections/couples/groups"),
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 CreateCoupleGroupResponse());
}
/**
* summary :
* 创建两人群
*
* @param request CreateCoupleGroupRequest
* @return CreateCoupleGroupResponse
*/
public CreateCoupleGroupResponse createCoupleGroup(CreateCoupleGroupRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
CreateCoupleGroupHeaders headers = new CreateCoupleGroupHeaders();
return this.createCoupleGroupWithOptions(request, headers, runtime);
}
/**
* summary :
* 创建普通群
*
* @param request CreateGroupRequest
* @param headers CreateGroupHeaders
* @param runtime runtime options for this request RuntimeOptions
* @return CreateGroupResponse
*/
public CreateGroupResponse createGroupWithOptions(CreateGroupRequest request, CreateGroupHeaders 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.groupAvatar)) {
body.put("groupAvatar", request.groupAvatar);
}
if (!com.aliyun.teautil.Common.isUnset(request.groupName)) {
body.put("groupName", request.groupName);
}
if (!com.aliyun.teautil.Common.isUnset(request.groupTemplateId)) {
body.put("groupTemplateId", request.groupTemplateId);
}
if (!com.aliyun.teautil.Common.isUnset(request.operatorId)) {
body.put("operatorId", request.operatorId);
}
if (!com.aliyun.teautil.Common.isUnset(request.users)) {
body.put("users", request.users);
}
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", "CreateGroup"),
new TeaPair("version", "im_2.0"),
new TeaPair("protocol", "HTTP"),
new TeaPair("pathname", "/v2.0/im/interconnections/groups"),
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 CreateGroupResponse());
}
/**
* summary :
* 创建普通群
*
* @param request CreateGroupRequest
* @return CreateGroupResponse
*/
public CreateGroupResponse createGroup(CreateGroupRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
CreateGroupHeaders headers = new CreateGroupHeaders();
return this.createGroupWithOptions(request, headers, runtime);
}
/**
* summary :
* 创建并开启互动卡片吊顶
*
* @param request CreateTopboxRequest
* @param headers CreateTopboxHeaders
* @param runtime runtime options for this request RuntimeOptions
* @return CreateTopboxResponse
*/
public CreateTopboxResponse createTopboxWithOptions(CreateTopboxRequest request, CreateTopboxHeaders 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.callbackRouteKey)) {
body.put("callbackRouteKey", request.callbackRouteKey);
}
if (!com.aliyun.teautil.Common.isUnset(request.cardData)) {
body.put("cardData", request.cardData);
}
if (!com.aliyun.teautil.Common.isUnset(request.cardSettings)) {
body.put("cardSettings", request.cardSettings);
}
if (!com.aliyun.teautil.Common.isUnset(request.cardTemplateId)) {
body.put("cardTemplateId", request.cardTemplateId);
}
if (!com.aliyun.teautil.Common.isUnset(request.conversationType)) {
body.put("conversationType", request.conversationType);
}
if (!com.aliyun.teautil.Common.isUnset(request.coolAppCode)) {
body.put("coolAppCode", request.coolAppCode);
}
if (!com.aliyun.teautil.Common.isUnset(request.expiredTime)) {
body.put("expiredTime", request.expiredTime);
}
if (!com.aliyun.teautil.Common.isUnset(request.groupTemplateId)) {
body.put("groupTemplateId", request.groupTemplateId);
}
if (!com.aliyun.teautil.Common.isUnset(request.openConversationId)) {
body.put("openConversationId", request.openConversationId);
}
if (!com.aliyun.teautil.Common.isUnset(request.outTrackId)) {
body.put("outTrackId", request.outTrackId);
}
if (!com.aliyun.teautil.Common.isUnset(request.platforms)) {
body.put("platforms", request.platforms);
}
if (!com.aliyun.teautil.Common.isUnset(request.receiverUnionIdList)) {
body.put("receiverUnionIdList", request.receiverUnionIdList);
}
if (!com.aliyun.teautil.Common.isUnset(request.receiverUserIdList)) {
body.put("receiverUserIdList", request.receiverUserIdList);
}
if (!com.aliyun.teautil.Common.isUnset(request.robotCode)) {
body.put("robotCode", request.robotCode);
}
if (!com.aliyun.teautil.Common.isUnset(request.unionIdPrivateDataMap)) {
body.put("unionIdPrivateDataMap", request.unionIdPrivateDataMap);
}
if (!com.aliyun.teautil.Common.isUnset(request.unoinId)) {
body.put("unoinId", request.unoinId);
}
if (!com.aliyun.teautil.Common.isUnset(request.userId)) {
body.put("userId", request.userId);
}
if (!com.aliyun.teautil.Common.isUnset(request.userIdPrivateDataMap)) {
body.put("userIdPrivateDataMap", request.userIdPrivateDataMap);
}
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", "CreateTopbox"),
new TeaPair("version", "im_2.0"),
new TeaPair("protocol", "HTTP"),
new TeaPair("pathname", "/v2.0/im/topBoxes"),
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 CreateTopboxResponse());
}
/**
* summary :
* 创建并开启互动卡片吊顶
*
* @param request CreateTopboxRequest
* @return CreateTopboxResponse
*/
public CreateTopboxResponse createTopbox(CreateTopboxRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
CreateTopboxHeaders headers = new CreateTopboxHeaders();
return this.createTopboxWithOptions(request, headers, runtime);
}
/**
* summary :
* 群设备市场管理
*
* @param headers map
* @param runtime runtime options for this request RuntimeOptions
* @return GroupManagerDeviceMarketResponse
*/
public GroupManagerDeviceMarketResponse groupManagerDeviceMarketWithOptions(java.util.Map headers, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception {
com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", headers)
));
com.aliyun.teaopenapi.models.Params params = com.aliyun.teaopenapi.models.Params.build(TeaConverter.buildMap(
new TeaPair("action", "GroupManagerDeviceMarket"),
new TeaPair("version", "im_2.0"),
new TeaPair("protocol", "HTTP"),
new TeaPair("pathname", "/v2.0/im/group/device/market/manager"),
new TeaPair("method", "GET"),
new TeaPair("authType", "Anonymous"),
new TeaPair("style", "ROA"),
new TeaPair("reqBodyType", "none"),
new TeaPair("bodyType", "json")
));
return TeaModel.toModel(this.execute(params, req, runtime), new GroupManagerDeviceMarketResponse());
}
/**
* summary :
* 群设备市场管理
* @return GroupManagerDeviceMarketResponse
*/
public GroupManagerDeviceMarketResponse groupManagerDeviceMarket() throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
java.util.Map headers = new java.util.HashMap<>();
return this.groupManagerDeviceMarketWithOptions(headers, runtime);
}
}