/* * Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ namespace TencentCloud.Iot.V20180123 { using Newtonsoft.Json; using System.Threading.Tasks; using TencentCloud.Common; using TencentCloud.Common.Profile; using TencentCloud.Iot.V20180123.Models; public class IotClient : AbstractClient{ private const string endpoint = "iot.tencentcloudapi.com"; private const string version = "2018-01-23"; /// /// Client constructor. /// /// Credentials. /// Region name, such as "ap-guangzhou". public IotClient(Credential credential, string region) : this(credential, region, new ClientProfile()) { } /// /// Client Constructor. /// /// Credentials. /// Region name, such as "ap-guangzhou". /// Client profiles. public IotClient(Credential credential, string region, ClientProfile profile) : base(endpoint, version, credential, region, profile) { } /// /// 启用规则 /// /// /// public async Task ActivateRule(ActivateRuleRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ActivateRule"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 启用规则 /// /// /// public ActivateRuleResponse ActivateRuleSync(ActivateRuleRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ActivateRule"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供在指定的产品Id下创建一个设备的能力,生成设备名称与设备秘钥。 /// /// /// public async Task AddDevice(AddDeviceRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AddDevice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供在指定的产品Id下创建一个设备的能力,生成设备名称与设备秘钥。 /// /// /// public AddDeviceResponse AddDeviceSync(AddDeviceRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AddDevice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(AddProduct)用于创建、定义某款硬件产品。 /// /// /// public async Task AddProduct(AddProductRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AddProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(AddProduct)用于创建、定义某款硬件产品。 /// /// /// public AddProductResponse AddProductSync(AddProductRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AddProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 新增规则 /// /// /// public async Task AddRule(AddRuleRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AddRule"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 新增规则 /// /// /// public AddRuleResponse AddRuleSync(AddRuleRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AddRule"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 新增Topic,用于设备或应用发布消息至该Topic或订阅该Topic的消息。 /// /// /// public async Task AddTopic(AddTopicRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AddTopic"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 新增Topic,用于设备或应用发布消息至该Topic或订阅该Topic的消息。 /// /// /// public AddTopicResponse AddTopicSync(AddTopicRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AddTopic"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 为APP提供用户注册功能 /// /// /// public async Task AppAddUser(AppAddUserRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AppAddUser"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 为APP提供用户注册功能 /// /// /// public AppAddUserResponse AppAddUserSync(AppAddUserRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AppAddUser"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 用户解除与设备的关联关系,解除后APP用户无法控制设备,获取设备数据 /// /// /// public async Task AppDeleteDevice(AppDeleteDeviceRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AppDeleteDevice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 用户解除与设备的关联关系,解除后APP用户无法控制设备,获取设备数据 /// /// /// public AppDeleteDeviceResponse AppDeleteDeviceSync(AppDeleteDeviceRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AppDeleteDevice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取绑定设备的基本信息与数据模板定义 /// /// /// public async Task AppGetDevice(AppGetDeviceRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AppGetDevice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取绑定设备的基本信息与数据模板定义 /// /// /// public AppGetDeviceResponse AppGetDeviceSync(AppGetDeviceRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AppGetDevice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取绑定设备数据,用于实时展示设备的最新数据 /// /// /// public async Task AppGetDeviceData(AppGetDeviceDataRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AppGetDeviceData"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取绑定设备数据,用于实时展示设备的最新数据 /// /// /// public AppGetDeviceDataResponse AppGetDeviceDataSync(AppGetDeviceDataRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AppGetDeviceData"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取绑定设备的上下线状态 /// /// /// public async Task AppGetDeviceStatuses(AppGetDeviceStatusesRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AppGetDeviceStatuses"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取绑定设备的上下线状态 /// /// /// public AppGetDeviceStatusesResponse AppGetDeviceStatusesSync(AppGetDeviceStatusesRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AppGetDeviceStatuses"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取用户的绑定设备列表 /// /// /// public async Task AppGetDevices(AppGetDevicesRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AppGetDevices"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取用户的绑定设备列表 /// /// /// public AppGetDevicesResponse AppGetDevicesSync(AppGetDevicesRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AppGetDevices"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取用户token /// /// /// public async Task AppGetToken(AppGetTokenRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AppGetToken"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取用户token /// /// /// public AppGetTokenResponse AppGetTokenSync(AppGetTokenRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AppGetToken"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取用户信息 /// /// /// public async Task AppGetUser(AppGetUserRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AppGetUser"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取用户信息 /// /// /// public AppGetUserResponse AppGetUserSync(AppGetUserRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AppGetUser"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 用户通过APP控制设备 /// /// /// public async Task AppIssueDeviceControl(AppIssueDeviceControlRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AppIssueDeviceControl"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 用户通过APP控制设备 /// /// /// public AppIssueDeviceControlResponse AppIssueDeviceControlSync(AppIssueDeviceControlRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AppIssueDeviceControl"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 重置APP用户密码 /// /// /// public async Task AppResetPassword(AppResetPasswordRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AppResetPassword"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 重置APP用户密码 /// /// /// public AppResetPasswordResponse AppResetPasswordSync(AppResetPasswordRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AppResetPassword"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 用户绑定设备,绑定后可以在APP端进行控制。绑定设备前需调用“获取设备绑定签名”接口 /// /// /// public async Task AppSecureAddDevice(AppSecureAddDeviceRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AppSecureAddDevice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 用户绑定设备,绑定后可以在APP端进行控制。绑定设备前需调用“获取设备绑定签名”接口 /// /// /// public AppSecureAddDeviceResponse AppSecureAddDeviceSync(AppSecureAddDeviceRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AppSecureAddDevice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 修改设备别名,便于用户个性化定义设备的名称 /// /// /// public async Task AppUpdateDevice(AppUpdateDeviceRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AppUpdateDevice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 修改设备别名,便于用户个性化定义设备的名称 /// /// /// public AppUpdateDeviceResponse AppUpdateDeviceSync(AppUpdateDeviceRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AppUpdateDevice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 修改用户信息 /// /// /// public async Task AppUpdateUser(AppUpdateUserRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AppUpdateUser"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 修改用户信息 /// /// /// public AppUpdateUserResponse AppUpdateUserSync(AppUpdateUserRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AppUpdateUser"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 关联子设备产品和网关产品 /// /// /// public async Task AssociateSubDeviceToGatewayProduct(AssociateSubDeviceToGatewayProductRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AssociateSubDeviceToGatewayProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 关联子设备产品和网关产品 /// /// /// public AssociateSubDeviceToGatewayProductResponse AssociateSubDeviceToGatewayProductSync(AssociateSubDeviceToGatewayProductRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AssociateSubDeviceToGatewayProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 禁用规则 /// /// /// public async Task DeactivateRule(DeactivateRuleRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DeactivateRule"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 禁用规则 /// /// /// public DeactivateRuleResponse DeactivateRuleSync(DeactivateRuleRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DeactivateRule"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供在指定的产品Id下删除一个设备的能力。 /// /// /// public async Task DeleteDevice(DeleteDeviceRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DeleteDevice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供在指定的产品Id下删除一个设备的能力。 /// /// /// public DeleteDeviceResponse DeleteDeviceSync(DeleteDeviceRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DeleteDevice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 删除用户指定的产品Id对应的信息。 /// /// /// public async Task DeleteProduct(DeleteProductRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DeleteProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 删除用户指定的产品Id对应的信息。 /// /// /// public DeleteProductResponse DeleteProductSync(DeleteProductRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DeleteProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 删除规则 /// /// /// public async Task DeleteRule(DeleteRuleRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DeleteRule"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 删除规则 /// /// /// public DeleteRuleResponse DeleteRuleSync(DeleteRuleRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DeleteRule"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 删除Topic /// /// /// public async Task DeleteTopic(DeleteTopicRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DeleteTopic"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 删除Topic /// /// /// public DeleteTopicResponse DeleteTopicSync(DeleteTopicRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DeleteTopic"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 批量获取设备某一段时间范围的设备上报数据。该接口适用于使用高级版类型的产品 /// /// /// public async Task GetDataHistory(GetDataHistoryRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "GetDataHistory"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 批量获取设备某一段时间范围的设备上报数据。该接口适用于使用高级版类型的产品 /// /// /// public GetDataHistoryResponse GetDataHistorySync(GetDataHistoryRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "GetDataHistory"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取设备的调试日志,用于定位问题 /// /// /// public async Task GetDebugLog(GetDebugLogRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "GetDebugLog"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取设备的调试日志,用于定位问题 /// /// /// public GetDebugLogResponse GetDebugLogSync(GetDebugLogRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "GetDebugLog"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供查询某个设备详细信息的能力。 /// /// /// public async Task GetDevice(GetDeviceRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "GetDevice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供查询某个设备详细信息的能力。 /// /// /// public GetDeviceResponse GetDeviceSync(GetDeviceRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "GetDevice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取某个设备当前上报到云端的数据,该接口适用于使用数据模板协议的产品。 /// /// /// public async Task GetDeviceData(GetDeviceDataRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "GetDeviceData"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取某个设备当前上报到云端的数据,该接口适用于使用数据模板协议的产品。 /// /// /// public GetDeviceDataResponse GetDeviceDataSync(GetDeviceDataRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "GetDeviceData"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 批量获取设备与云端的详细通信日志,该接口适用于使用高级版类型的产品。 /// /// /// public async Task GetDeviceLog(GetDeviceLogRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "GetDeviceLog"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 批量获取设备与云端的详细通信日志,该接口适用于使用高级版类型的产品。 /// /// /// public GetDeviceLogResponse GetDeviceLogSync(GetDeviceLogRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "GetDeviceLog"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取设备绑定签名,用于用户绑定某个设备的应用场景 /// /// /// public async Task GetDeviceSignatures(GetDeviceSignaturesRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "GetDeviceSignatures"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取设备绑定签名,用于用户绑定某个设备的应用场景 /// /// /// public GetDeviceSignaturesResponse GetDeviceSignaturesSync(GetDeviceSignaturesRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "GetDeviceSignatures"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询某段时间范围内产品的在线、激活设备数 /// /// /// public async Task GetDeviceStatistics(GetDeviceStatisticsRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "GetDeviceStatistics"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询某段时间范围内产品的在线、激活设备数 /// /// /// public GetDeviceStatisticsResponse GetDeviceStatisticsSync(GetDeviceStatisticsRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "GetDeviceStatistics"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 批量获取设备的当前状态,状态包括在线、离线或未激活状态。 /// /// /// public async Task GetDeviceStatuses(GetDeviceStatusesRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "GetDeviceStatuses"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 批量获取设备的当前状态,状态包括在线、离线或未激活状态。 /// /// /// public GetDeviceStatusesResponse GetDeviceStatusesSync(GetDeviceStatusesRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "GetDeviceStatuses"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供分页查询某个产品Id下设备信息的能力。 /// /// /// public async Task GetDevices(GetDevicesRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "GetDevices"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供分页查询某个产品Id下设备信息的能力。 /// /// /// public GetDevicesResponse GetDevicesSync(GetDevicesRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "GetDevices"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取产品定义的详细信息,包括产品名称、产品描述,鉴权模式等信息。 /// /// /// public async Task GetProduct(GetProductRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "GetProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取产品定义的详细信息,包括产品名称、产品描述,鉴权模式等信息。 /// /// /// public GetProductResponse GetProductSync(GetProductRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "GetProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取用户在物联网套件所创建的所有产品信息。 /// /// /// public async Task GetProducts(GetProductsRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "GetProducts"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取用户在物联网套件所创建的所有产品信息。 /// /// /// public GetProductsResponse GetProductsSync(GetProductsRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "GetProducts"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取转发规则信息 /// /// /// public async Task GetRule(GetRuleRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "GetRule"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取转发规则信息 /// /// /// public GetRuleResponse GetRuleSync(GetRuleRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "GetRule"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取转发规则列表 /// /// /// public async Task GetRules(GetRulesRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "GetRules"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取转发规则列表 /// /// /// public GetRulesResponse GetRulesSync(GetRulesRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "GetRules"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取Topic信息 /// /// /// public async Task GetTopic(GetTopicRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "GetTopic"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取Topic信息 /// /// /// public GetTopicResponse GetTopicSync(GetTopicRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "GetTopic"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取Topic列表 /// /// /// public async Task GetTopics(GetTopicsRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "GetTopics"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取Topic列表 /// /// /// public GetTopicsResponse GetTopicsSync(GetTopicsRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "GetTopics"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供下发控制指令到指定设备的能力,该接口适用于使用高级版类型的产品。 /// /// /// public async Task IssueDeviceControl(IssueDeviceControlRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "IssueDeviceControl"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供下发控制指令到指定设备的能力,该接口适用于使用高级版类型的产品。 /// /// /// public IssueDeviceControlResponse IssueDeviceControlSync(IssueDeviceControlRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "IssueDeviceControl"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供向指定的Topic发布消息的能力,常用于向设备下发控制指令。该接口只适用于产品版本为“基础版”类型的产品,使用高级版的产品需使用“下发设备控制指令”接口 /// /// /// public async Task PublishMsg(PublishMsgRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "PublishMsg"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供向指定的Topic发布消息的能力,常用于向设备下发控制指令。该接口只适用于产品版本为“基础版”类型的产品,使用高级版的产品需使用“下发设备控制指令”接口 /// /// /// public PublishMsgResponse PublishMsgSync(PublishMsgRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "PublishMsg"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 重置设备操作,将会为设备生成新的证书及清空最新数据,需谨慎操作。 /// /// /// public async Task ResetDevice(ResetDeviceRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ResetDevice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 重置设备操作,将会为设备生成新的证书及清空最新数据,需谨慎操作。 /// /// /// public ResetDeviceResponse ResetDeviceSync(ResetDeviceRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ResetDevice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 取消子设备产品与网关设备产品的关联 /// /// /// public async Task UnassociateSubDeviceFromGatewayProduct(UnassociateSubDeviceFromGatewayProductRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "UnassociateSubDeviceFromGatewayProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 取消子设备产品与网关设备产品的关联 /// /// /// public UnassociateSubDeviceFromGatewayProductResponse UnassociateSubDeviceFromGatewayProductSync(UnassociateSubDeviceFromGatewayProductRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "UnassociateSubDeviceFromGatewayProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供修改产品信息及数据模板的能力。 /// /// /// public async Task UpdateProduct(UpdateProductRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "UpdateProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供修改产品信息及数据模板的能力。 /// /// /// public UpdateProductResponse UpdateProductSync(UpdateProductRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "UpdateProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 更新规则 /// /// /// public async Task UpdateRule(UpdateRuleRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "UpdateRule"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 更新规则 /// /// /// public UpdateRuleResponse UpdateRuleSync(UpdateRuleRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "UpdateRule"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } } }