/* * 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.Iotexplorer.V20190423 { using Newtonsoft.Json; using System.Threading.Tasks; using TencentCloud.Common; using TencentCloud.Common.Profile; using TencentCloud.Iotexplorer.V20190423.Models; public class IotexplorerClient : AbstractClient{ private const string endpoint = "iotexplorer.tencentcloudapi.com"; private const string version = "2019-04-23"; /// /// Client constructor. /// /// Credentials. /// Region name, such as "ap-guangzhou". public IotexplorerClient(Credential credential, string region) : this(credential, region, new ClientProfile()) { } /// /// Client Constructor. /// /// Credentials. /// Region name, such as "ap-guangzhou". /// Client profiles. public IotexplorerClient(Credential credential, string region, ClientProfile profile) : base(endpoint, version, credential, region, profile) { } /// /// 提供给用户异步调用设备动作的能力 /// /// /// public async Task CallDeviceActionAsync(CallDeviceActionAsyncRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "CallDeviceActionAsync"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供给用户异步调用设备动作的能力 /// /// /// public CallDeviceActionAsyncResponse CallDeviceActionAsyncSync(CallDeviceActionAsyncRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "CallDeviceActionAsync"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 为用户提供同步调用设备动作的能力。 /// /// /// public async Task CallDeviceActionSync(CallDeviceActionSyncRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "CallDeviceActionSync"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 为用户提供同步调用设备动作的能力。 /// /// /// public CallDeviceActionSyncResponse CallDeviceActionSyncSync(CallDeviceActionSyncRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "CallDeviceActionSync"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 根据设备产品ID、设备名称,设置控制设备的属性数据。 /// /// /// public async Task ControlDeviceData(ControlDeviceDataRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ControlDeviceData"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 根据设备产品ID、设备名称,设置控制设备的属性数据。 /// /// /// public ControlDeviceDataResponse ControlDeviceDataSync(ControlDeviceDataRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ControlDeviceData"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 创建设备 /// /// /// public async Task CreateDevice(CreateDeviceRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "CreateDevice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 创建设备 /// /// /// public CreateDeviceResponse CreateDeviceSync(CreateDeviceRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "CreateDevice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 为用户提供新建项目的能力,用于集中管理产品和应用。 /// /// /// public async Task CreateProject(CreateProjectRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "CreateProject"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 为用户提供新建项目的能力,用于集中管理产品和应用。 /// /// /// public CreateProjectResponse CreateProjectSync(CreateProjectRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "CreateProject"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 为用户提供新建产品的能力,用于管理用户的设备 /// /// /// public async Task CreateStudioProduct(CreateStudioProductRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "CreateStudioProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 为用户提供新建产品的能力,用于管理用户的设备 /// /// /// public CreateStudioProductResponse CreateStudioProductSync(CreateStudioProductRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "CreateStudioProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 删除设备 /// /// /// 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; } /// /// 删除设备 /// /// /// 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; } /// /// 提供删除某个项目的能力 /// /// /// public async Task DeleteProject(DeleteProjectRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DeleteProject"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供删除某个项目的能力 /// /// /// public DeleteProjectResponse DeleteProjectSync(DeleteProjectRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DeleteProject"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供删除某个项目下产品的能力 /// /// /// public async Task DeleteStudioProduct(DeleteStudioProductRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DeleteStudioProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供删除某个项目下产品的能力 /// /// /// public DeleteStudioProductResponse DeleteStudioProductSync(DeleteStudioProductRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DeleteStudioProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 用于查看某个设备的详细信息 /// /// /// public async Task DescribeDevice(DescribeDeviceRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeDevice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 用于查看某个设备的详细信息 /// /// /// public DescribeDeviceResponse DescribeDeviceSync(DescribeDeviceRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeDevice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 根据设备产品ID、设备名称,获取设备上报的属性数据。 /// /// /// public async Task DescribeDeviceData(DescribeDeviceDataRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeDeviceData"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 根据设备产品ID、设备名称,获取设备上报的属性数据。 /// /// /// public DescribeDeviceDataResponse DescribeDeviceDataSync(DescribeDeviceDataRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeDeviceData"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取设备在指定时间范围内上报的历史数据。 /// /// /// public async Task DescribeDeviceDataHistory(DescribeDeviceDataHistoryRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeDeviceDataHistory"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取设备在指定时间范围内上报的历史数据。 /// /// /// public DescribeDeviceDataHistoryResponse DescribeDeviceDataHistorySync(DescribeDeviceDataHistoryRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeDeviceDataHistory"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询产品配置的数据模板信息 /// /// /// public async Task DescribeModelDefinition(DescribeModelDefinitionRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeModelDefinition"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询产品配置的数据模板信息 /// /// /// public DescribeModelDefinitionResponse DescribeModelDefinitionSync(DescribeModelDefinitionRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeModelDefinition"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询项目详情 /// /// /// public async Task DescribeProject(DescribeProjectRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeProject"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询项目详情 /// /// /// public DescribeProjectResponse DescribeProjectSync(DescribeProjectRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeProject"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供查看茶品详细信息的能力,包括产品的ID、数据协议、认证类型等重要参数 /// /// /// public async Task DescribeStudioProduct(DescribeStudioProductRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeStudioProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供查看茶品详细信息的能力,包括产品的ID、数据协议、认证类型等重要参数 /// /// /// public DescribeStudioProductResponse DescribeStudioProductSync(DescribeStudioProductRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeStudioProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 用于查询某个产品下的设备列表 /// /// /// public async Task GetDeviceList(GetDeviceListRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "GetDeviceList"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 用于查询某个产品下的设备列表 /// /// /// public GetDeviceListResponse GetDeviceListSync(GetDeviceListRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "GetDeviceList"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供查询用户所创建的项目列表查询功能。 /// /// /// public async Task GetProjectList(GetProjectListRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "GetProjectList"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供查询用户所创建的项目列表查询功能。 /// /// /// public GetProjectListResponse GetProjectListSync(GetProjectListRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "GetProjectList"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供查询某个项目下所有产品信息的能力。 /// /// /// public async Task GetStudioProductList(GetStudioProductListRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "GetStudioProductList"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供查询某个项目下所有产品信息的能力。 /// /// /// public GetStudioProductListResponse GetStudioProductListSync(GetStudioProductListRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "GetStudioProductList"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取设备的历史事件 /// /// /// public async Task ListEventHistory(ListEventHistoryRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ListEventHistory"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取设备的历史事件 /// /// /// public ListEventHistoryResponse ListEventHistorySync(ListEventHistoryRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ListEventHistory"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供修改产品的数据模板的能力 /// /// /// public async Task ModifyModelDefinition(ModifyModelDefinitionRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ModifyModelDefinition"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供修改产品的数据模板的能力 /// /// /// public ModifyModelDefinitionResponse ModifyModelDefinitionSync(ModifyModelDefinitionRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ModifyModelDefinition"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 修改项目 /// /// /// public async Task ModifyProject(ModifyProjectRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ModifyProject"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 修改项目 /// /// /// public ModifyProjectResponse ModifyProjectSync(ModifyProjectRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ModifyProject"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供修改产品的名称和描述等信息的能力,对于已发布产品不允许进行修改。 /// /// /// public async Task ModifyStudioProduct(ModifyStudioProductRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ModifyStudioProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供修改产品的名称和描述等信息的能力,对于已发布产品不允许进行修改。 /// /// /// public ModifyStudioProductResponse ModifyStudioProductSync(ModifyStudioProductRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ModifyStudioProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 产品开发完成并测试通过后,通过发布产品将产品设置为发布状态 /// /// /// public async Task ReleaseStudioProduct(ReleaseStudioProductRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ReleaseStudioProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 产品开发完成并测试通过后,通过发布产品将产品设置为发布状态 /// /// /// public ReleaseStudioProductResponse ReleaseStudioProductSync(ReleaseStudioProductRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ReleaseStudioProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供根据产品名称查找产品的能力 /// /// /// public async Task SearchStudioProduct(SearchStudioProductRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "SearchStudioProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 提供根据产品名称查找产品的能力 /// /// /// public SearchStudioProductResponse SearchStudioProductSync(SearchStudioProductRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "SearchStudioProduct"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } } }