com.aliyun.dingtalkdiot_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.dingtalkdiot_1_0;
import com.aliyun.tea.*;
import com.aliyun.dingtalkdiot_1_0.models.*;
import com.aliyun.teautil.*;
import com.aliyun.teautil.models.*;
import com.aliyun.teaopenapi.*;
import com.aliyun.teaopenapi.models.*;
import com.aliyun.openapiutil.*;
public class Client extends com.aliyun.teaopenapi.Client {
public Client(Config config) throws Exception {
super(config);
this._endpointRule = "";
if (com.aliyun.teautil.Common.empty(_endpoint)) {
this._endpoint = "api.dingtalk.com";
}
}
public BatchDeleteDeviceResponse batchDeleteDevice(BatchDeleteDeviceRequest request) throws Exception {
RuntimeOptions runtime = new RuntimeOptions();
BatchDeleteDeviceHeaders headers = new BatchDeleteDeviceHeaders();
return this.batchDeleteDeviceWithOptions(request, headers, runtime);
}
public BatchDeleteDeviceResponse batchDeleteDeviceWithOptions(BatchDeleteDeviceRequest request, BatchDeleteDeviceHeaders headers, 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.corpId)) {
body.put("corpId", request.corpId);
}
if (!com.aliyun.teautil.Common.isUnset(request.deviceIds)) {
body.put("deviceIds", request.deviceIds);
}
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));
}
OpenApiRequest req = OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
new TeaPair("body", com.aliyun.openapiutil.Client.parseToMap(body))
));
return TeaModel.toModel(this.doROARequest("BatchDeleteDevice", "diot_1.0", "HTTP", "POST", "AK", "/v1.0/diot/devices/remove", "json", req, runtime), new BatchDeleteDeviceResponse());
}
public BatchRegisterDeviceResponse batchRegisterDevice(BatchRegisterDeviceRequest request) throws Exception {
RuntimeOptions runtime = new RuntimeOptions();
BatchRegisterDeviceHeaders headers = new BatchRegisterDeviceHeaders();
return this.batchRegisterDeviceWithOptions(request, headers, runtime);
}
public BatchRegisterDeviceResponse batchRegisterDeviceWithOptions(BatchRegisterDeviceRequest request, BatchRegisterDeviceHeaders headers, 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.corpId)) {
body.put("corpId", request.corpId);
}
if (!com.aliyun.teautil.Common.isUnset(request.devices)) {
body.put("devices", request.devices);
}
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));
}
OpenApiRequest req = OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
new TeaPair("body", com.aliyun.openapiutil.Client.parseToMap(body))
));
return TeaModel.toModel(this.doROARequest("BatchRegisterDevice", "diot_1.0", "HTTP", "POST", "AK", "/v1.0/diot/devices/registrations/batch", "json", req, runtime), new BatchRegisterDeviceResponse());
}
public BatchRegisterEventTypeResponse batchRegisterEventType(BatchRegisterEventTypeRequest request) throws Exception {
RuntimeOptions runtime = new RuntimeOptions();
BatchRegisterEventTypeHeaders headers = new BatchRegisterEventTypeHeaders();
return this.batchRegisterEventTypeWithOptions(request, headers, runtime);
}
public BatchRegisterEventTypeResponse batchRegisterEventTypeWithOptions(BatchRegisterEventTypeRequest request, BatchRegisterEventTypeHeaders headers, 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.corpId)) {
body.put("corpId", request.corpId);
}
if (!com.aliyun.teautil.Common.isUnset(request.eventTypes)) {
body.put("eventTypes", request.eventTypes);
}
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));
}
OpenApiRequest req = OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
new TeaPair("body", com.aliyun.openapiutil.Client.parseToMap(body))
));
return TeaModel.toModel(this.doROARequest("BatchRegisterEventType", "diot_1.0", "HTTP", "POST", "AK", "/v1.0/diot/eventTypes/registrations/batch", "json", req, runtime), new BatchRegisterEventTypeResponse());
}
public BatchUpdateDeviceResponse batchUpdateDevice(BatchUpdateDeviceRequest request) throws Exception {
RuntimeOptions runtime = new RuntimeOptions();
BatchUpdateDeviceHeaders headers = new BatchUpdateDeviceHeaders();
return this.batchUpdateDeviceWithOptions(request, headers, runtime);
}
public BatchUpdateDeviceResponse batchUpdateDeviceWithOptions(BatchUpdateDeviceRequest request, BatchUpdateDeviceHeaders headers, 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.corpId)) {
body.put("corpId", request.corpId);
}
if (!com.aliyun.teautil.Common.isUnset(request.devices)) {
body.put("devices", request.devices);
}
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));
}
OpenApiRequest req = OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
new TeaPair("body", com.aliyun.openapiutil.Client.parseToMap(body))
));
return TeaModel.toModel(this.doROARequest("BatchUpdateDevice", "diot_1.0", "HTTP", "PUT", "AK", "/v1.0/diot/devices/batch", "json", req, runtime), new BatchUpdateDeviceResponse());
}
public BindSystemResponse bindSystem(BindSystemRequest request) throws Exception {
RuntimeOptions runtime = new RuntimeOptions();
BindSystemHeaders headers = new BindSystemHeaders();
return this.bindSystemWithOptions(request, headers, runtime);
}
public BindSystemResponse bindSystemWithOptions(BindSystemRequest request, BindSystemHeaders headers, 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.authCode)) {
body.put("authCode", request.authCode);
}
if (!com.aliyun.teautil.Common.isUnset(request.clientId)) {
body.put("clientId", request.clientId);
}
if (!com.aliyun.teautil.Common.isUnset(request.clientName)) {
body.put("clientName", request.clientName);
}
if (!com.aliyun.teautil.Common.isUnset(request.corpId)) {
body.put("corpId", request.corpId);
}
if (!com.aliyun.teautil.Common.isUnset(request.extraData)) {
body.put("extraData", request.extraData);
}
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));
}
OpenApiRequest req = OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
new TeaPair("body", com.aliyun.openapiutil.Client.parseToMap(body))
));
return TeaModel.toModel(this.doROARequest("BindSystem", "diot_1.0", "HTTP", "POST", "AK", "/v1.0/diot/systems/bind", "json", req, runtime), new BindSystemResponse());
}
public DeviceConferenceResponse deviceConference(DeviceConferenceRequest request) throws Exception {
RuntimeOptions runtime = new RuntimeOptions();
DeviceConferenceHeaders headers = new DeviceConferenceHeaders();
return this.deviceConferenceWithOptions(request, headers, runtime);
}
public DeviceConferenceResponse deviceConferenceWithOptions(DeviceConferenceRequest request, DeviceConferenceHeaders headers, 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.confTitle)) {
body.put("confTitle", request.confTitle);
}
if (!com.aliyun.teautil.Common.isUnset(request.conferenceId)) {
body.put("conferenceId", request.conferenceId);
}
if (!com.aliyun.teautil.Common.isUnset(request.conferencePassword)) {
body.put("conferencePassword", request.conferencePassword);
}
if (!com.aliyun.teautil.Common.isUnset(request.deviceIds)) {
body.put("deviceIds", request.deviceIds);
}
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));
}
OpenApiRequest req = OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
new TeaPair("body", com.aliyun.openapiutil.Client.parseToMap(body))
));
return TeaModel.toModel(this.doROARequest("DeviceConference", "diot_1.0", "HTTP", "POST", "AK", "/v1.0/diot/deviceConferences/initiate", "json", req, runtime), new DeviceConferenceResponse());
}
public PushEventResponse pushEvent(PushEventRequest request) throws Exception {
RuntimeOptions runtime = new RuntimeOptions();
PushEventHeaders headers = new PushEventHeaders();
return this.pushEventWithOptions(request, headers, runtime);
}
public PushEventResponse pushEventWithOptions(PushEventRequest request, PushEventHeaders headers, 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.corpId)) {
body.put("corpId", request.corpId);
}
if (!com.aliyun.teautil.Common.isUnset(request.deviceId)) {
body.put("deviceId", request.deviceId);
}
if (!com.aliyun.teautil.Common.isUnset(request.eventId)) {
body.put("eventId", request.eventId);
}
if (!com.aliyun.teautil.Common.isUnset(request.eventName)) {
body.put("eventName", request.eventName);
}
if (!com.aliyun.teautil.Common.isUnset(request.eventType)) {
body.put("eventType", request.eventType);
}
if (!com.aliyun.teautil.Common.isUnset(request.extraData)) {
body.put("extraData", request.extraData);
}
if (!com.aliyun.teautil.Common.isUnset(request.location)) {
body.put("location", request.location);
}
if (!com.aliyun.teautil.Common.isUnset(request.msg)) {
body.put("msg", request.msg);
}
if (!com.aliyun.teautil.Common.isUnset(request.occurrenceTime)) {
body.put("occurrenceTime", request.occurrenceTime);
}
if (!com.aliyun.teautil.Common.isUnset(request.picUrls)) {
body.put("picUrls", request.picUrls);
}
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));
}
OpenApiRequest req = OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
new TeaPair("body", com.aliyun.openapiutil.Client.parseToMap(body))
));
return TeaModel.toModel(this.doROARequest("PushEvent", "diot_1.0", "HTTP", "POST", "AK", "/v1.0/diot/events/push", "json", req, runtime), new PushEventResponse());
}
public QueryDeviceResponse queryDevice(QueryDeviceRequest request) throws Exception {
RuntimeOptions runtime = new RuntimeOptions();
QueryDeviceHeaders headers = new QueryDeviceHeaders();
return this.queryDeviceWithOptions(request, headers, runtime);
}
public QueryDeviceResponse queryDeviceWithOptions(QueryDeviceRequest request, QueryDeviceHeaders headers, 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.corpId)) {
query.put("corpId", request.corpId);
}
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));
}
OpenApiRequest req = OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
new TeaPair("query", com.aliyun.openapiutil.Client.query(query))
));
return TeaModel.toModel(this.doROARequest("QueryDevice", "diot_1.0", "HTTP", "GET", "AK", "/v1.0/diot/devices", "json", req, runtime), new QueryDeviceResponse());
}
public RegisterDeviceResponse registerDevice(RegisterDeviceRequest request) throws Exception {
RuntimeOptions runtime = new RuntimeOptions();
RegisterDeviceHeaders headers = new RegisterDeviceHeaders();
return this.registerDeviceWithOptions(request, headers, runtime);
}
public RegisterDeviceResponse registerDeviceWithOptions(RegisterDeviceRequest request, RegisterDeviceHeaders headers, 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.corpId)) {
body.put("corpId", request.corpId);
}
if (!com.aliyun.teautil.Common.isUnset(request.deviceName)) {
body.put("deviceName", request.deviceName);
}
if (!com.aliyun.teautil.Common.isUnset(request.deviceStatus)) {
body.put("deviceStatus", request.deviceStatus);
}
if (!com.aliyun.teautil.Common.isUnset(request.deviceType)) {
body.put("deviceType", request.deviceType);
}
if (!com.aliyun.teautil.Common.isUnset(request.deviceTypeName)) {
body.put("deviceTypeName", request.deviceTypeName);
}
if (!com.aliyun.teautil.Common.isUnset(request.id)) {
body.put("id", request.id);
}
if (!com.aliyun.teautil.Common.isUnset(TeaModel.buildMap(request.liveUrls))) {
body.put("liveUrls", request.liveUrls);
}
if (!com.aliyun.teautil.Common.isUnset(request.location)) {
body.put("location", request.location);
}
if (!com.aliyun.teautil.Common.isUnset(request.nickName)) {
body.put("nickName", request.nickName);
}
if (!com.aliyun.teautil.Common.isUnset(request.parentId)) {
body.put("parentId", request.parentId);
}
if (!com.aliyun.teautil.Common.isUnset(request.productType)) {
body.put("productType", request.productType);
}
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));
}
OpenApiRequest req = OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
new TeaPair("body", com.aliyun.openapiutil.Client.parseToMap(body))
));
return TeaModel.toModel(this.doROARequest("RegisterDevice", "diot_1.0", "HTTP", "POST", "AK", "/v1.0/diot/devices/register", "json", req, runtime), new RegisterDeviceResponse());
}
}