From ee5b4ca599abafedd829ace2994c6d8e66944f69 Mon Sep 17 00:00:00 2001 From: "yixiong.jxy" Date: Thu, 6 Sep 2018 01:09:55 +0800 Subject: [PATCH] =?UTF-8?q?IOT=20SDK=20Auto=20Released=20By=20cheyun.lxf,V?= =?UTF-8?q?ersion=EF=BC=9A1.25.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yixiong.jxy --- CHANGELOG | 4 + VERSION | 2 +- iot/CMakeLists.txt | 20 +- iot/include/alibabacloud/iot/IotClient.h | 40 +--- .../iot/model/ApplyDeviceWithNamesRequest.h | 54 ------ .../iot/model/ApplyDeviceWithNamesResult.h | 57 ------ .../iot/model/CreateProductRequest.h | 39 ++-- .../iot/model/CreateProductResult.h | 20 +- .../iot/model/CreateRuleRequest.h | 3 + ...DeviceRequest.h => DeleteProductRequest.h} | 15 +- ...lyStatusResult.h => DeleteProductResult.h} | 16 +- .../alibabacloud/iot/model/GetRuleResult.h | 3 + .../alibabacloud/iot/model/ListRuleResult.h | 2 + .../iot/model/QueryApplyStatusRequest.h | 51 ----- .../iot/model/QueryDeviceByNameRequest.h | 54 ------ .../iot/model/QueryDeviceByNameResult.h | 69 ------- .../iot/model/QueryProductResult.h | 7 +- .../alibabacloud/iot/model/RRpcRequest.h | 3 + .../iot/model/RegistDeviceResult.h | 63 ------ .../iot/model/UpdateProductRequest.h | 15 +- .../iot/model/UpdateRuleRequest.h | 3 + iot/src/IotClient.cc | 180 ++++-------------- iot/src/model/ApplyDeviceWithNamesRequest.cc | 61 ------ iot/src/model/ApplyDeviceWithNamesResult.cc | 73 ------- iot/src/model/BatchGetDeviceStateRequest.cc | 2 +- iot/src/model/CreateProductRequest.cc | 85 ++++----- iot/src/model/CreateProductResult.cc | 53 +++--- iot/src/model/CreateProductTopicRequest.cc | 2 +- iot/src/model/CreateRuleActionRequest.cc | 2 +- iot/src/model/CreateRuleActionResult.cc | 4 +- iot/src/model/CreateRuleRequest.cc | 13 +- iot/src/model/CreateTopicRouteTableRequest.cc | 2 +- iot/src/model/DeleteDevicePropRequest.cc | 2 +- ...atusRequest.cc => DeleteProductRequest.cc} | 24 +-- ...StatusResult.cc => DeleteProductResult.cc} | 23 +-- iot/src/model/DeleteProductTopicRequest.cc | 2 +- iot/src/model/DeleteRuleActionRequest.cc | 2 +- iot/src/model/DeleteRuleRequest.cc | 2 +- iot/src/model/DeleteTopicRouteTableRequest.cc | 2 +- iot/src/model/GetDeviceShadowRequest.cc | 2 +- iot/src/model/GetRuleActionRequest.cc | 2 +- iot/src/model/GetRuleRequest.cc | 2 +- iot/src/model/GetRuleResult.cc | 10 +- iot/src/model/ListRuleActionsRequest.cc | 2 +- iot/src/model/ListRuleRequest.cc | 2 +- iot/src/model/ListRuleResult.cc | 4 + iot/src/model/PubBroadcastRequest.cc | 2 +- iot/src/model/PubRequest.cc | 2 +- iot/src/model/QueryDeviceByNameRequest.cc | 60 ------ iot/src/model/QueryDeviceByNameResult.cc | 90 --------- iot/src/model/QueryDevicePropRequest.cc | 2 +- iot/src/model/QueryDeviceRequest.cc | 2 +- iot/src/model/QueryPageByApplyIdRequest.cc | 2 +- iot/src/model/QueryProductResult.cc | 2 + iot/src/model/QueryProductTopicRequest.cc | 2 +- .../QueryTopicReverseRouteTableRequest.cc | 2 +- iot/src/model/QueryTopicRouteTableRequest.cc | 2 +- iot/src/model/RRpcRequest.cc | 13 +- iot/src/model/RegistDeviceRequest.cc | 60 ------ iot/src/model/RegistDeviceResult.cc | 94 --------- iot/src/model/SaveDevicePropRequest.cc | 2 +- iot/src/model/StartRuleRequest.cc | 2 +- iot/src/model/StopRuleRequest.cc | 2 +- iot/src/model/UpdateDeviceShadowRequest.cc | 2 +- iot/src/model/UpdateProductRequest.cc | 45 +---- iot/src/model/UpdateProductTopicRequest.cc | 2 +- iot/src/model/UpdateRuleActionRequest.cc | 2 +- iot/src/model/UpdateRuleActionResult.cc | 4 +- iot/src/model/UpdateRuleRequest.cc | 13 +- 69 files changed, 285 insertions(+), 1222 deletions(-) delete mode 100644 iot/include/alibabacloud/iot/model/ApplyDeviceWithNamesRequest.h delete mode 100644 iot/include/alibabacloud/iot/model/ApplyDeviceWithNamesResult.h rename iot/include/alibabacloud/iot/model/{RegistDeviceRequest.h => DeleteProductRequest.h} (72%) rename iot/include/alibabacloud/iot/model/{QueryApplyStatusResult.h => DeleteProductResult.h} (72%) delete mode 100644 iot/include/alibabacloud/iot/model/QueryApplyStatusRequest.h delete mode 100644 iot/include/alibabacloud/iot/model/QueryDeviceByNameRequest.h delete mode 100644 iot/include/alibabacloud/iot/model/QueryDeviceByNameResult.h delete mode 100644 iot/include/alibabacloud/iot/model/RegistDeviceResult.h delete mode 100644 iot/src/model/ApplyDeviceWithNamesRequest.cc delete mode 100644 iot/src/model/ApplyDeviceWithNamesResult.cc rename iot/src/model/{QueryApplyStatusRequest.cc => DeleteProductRequest.cc} (54%) rename iot/src/model/{QueryApplyStatusResult.cc => DeleteProductResult.cc} (66%) delete mode 100644 iot/src/model/QueryDeviceByNameRequest.cc delete mode 100644 iot/src/model/QueryDeviceByNameResult.cc delete mode 100644 iot/src/model/RegistDeviceRequest.cc delete mode 100644 iot/src/model/RegistDeviceResult.cc diff --git a/CHANGELOG b/CHANGELOG index b3ac1315f..0f4bd1c5d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2018-09-06 Version: 1.25.1 +1, Add API deleteProduct. +2, Move all API to version 20180120. + 2018-09-05 Version: 1.25.0 1, Add new APIs with control policy for querying price diff --git a/VERSION b/VERSION index f2538f8b5..7c819a961 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.25.0 \ No newline at end of file +1.25.1 \ No newline at end of file diff --git a/iot/CMakeLists.txt b/iot/CMakeLists.txt index 81993587c..3103d97e4 100644 --- a/iot/CMakeLists.txt +++ b/iot/CMakeLists.txt @@ -21,8 +21,6 @@ set(iot_public_header include/alibabacloud/iot/IotExport.h ) set(iot_public_header_model - include/alibabacloud/iot/model/RegistDeviceRequest.h - include/alibabacloud/iot/model/RegistDeviceResult.h include/alibabacloud/iot/model/DeleteTopicRouteTableRequest.h include/alibabacloud/iot/model/DeleteTopicRouteTableResult.h include/alibabacloud/iot/model/QueryDeviceEventDataRequest.h @@ -37,8 +35,6 @@ set(iot_public_header_model include/alibabacloud/iot/model/RRpcResult.h include/alibabacloud/iot/model/DeleteRuleRequest.h include/alibabacloud/iot/model/DeleteRuleResult.h - include/alibabacloud/iot/model/QueryDeviceByNameRequest.h - include/alibabacloud/iot/model/QueryDeviceByNameResult.h include/alibabacloud/iot/model/QueryProductTopicRequest.h include/alibabacloud/iot/model/QueryProductTopicResult.h include/alibabacloud/iot/model/GetThingTopoRequest.h @@ -95,8 +91,6 @@ set(iot_public_header_model include/alibabacloud/iot/model/CreateRuleResult.h include/alibabacloud/iot/model/StartRuleRequest.h include/alibabacloud/iot/model/StartRuleResult.h - include/alibabacloud/iot/model/ApplyDeviceWithNamesRequest.h - include/alibabacloud/iot/model/ApplyDeviceWithNamesResult.h include/alibabacloud/iot/model/QueryProductListRequest.h include/alibabacloud/iot/model/QueryProductListResult.h include/alibabacloud/iot/model/QueryDevicePropertyStatusRequest.h @@ -105,12 +99,12 @@ set(iot_public_header_model include/alibabacloud/iot/model/QueryDeviceStatisticsResult.h include/alibabacloud/iot/model/PubRequest.h include/alibabacloud/iot/model/PubResult.h + include/alibabacloud/iot/model/DeleteProductRequest.h + include/alibabacloud/iot/model/DeleteProductResult.h include/alibabacloud/iot/model/SaveDevicePropRequest.h include/alibabacloud/iot/model/SaveDevicePropResult.h include/alibabacloud/iot/model/DeleteProductTopicRequest.h include/alibabacloud/iot/model/DeleteProductTopicResult.h - include/alibabacloud/iot/model/QueryApplyStatusRequest.h - include/alibabacloud/iot/model/QueryApplyStatusResult.h include/alibabacloud/iot/model/QueryDeviceServiceDataRequest.h include/alibabacloud/iot/model/QueryDeviceServiceDataResult.h include/alibabacloud/iot/model/BatchRegisterDeviceWithApplyIdRequest.h @@ -144,8 +138,6 @@ set(iot_public_header_model set(iot_src src/IotClient.cc - src/model/RegistDeviceRequest.cc - src/model/RegistDeviceResult.cc src/model/DeleteTopicRouteTableRequest.cc src/model/DeleteTopicRouteTableResult.cc src/model/QueryDeviceEventDataRequest.cc @@ -160,8 +152,6 @@ set(iot_src src/model/RRpcResult.cc src/model/DeleteRuleRequest.cc src/model/DeleteRuleResult.cc - src/model/QueryDeviceByNameRequest.cc - src/model/QueryDeviceByNameResult.cc src/model/QueryProductTopicRequest.cc src/model/QueryProductTopicResult.cc src/model/GetThingTopoRequest.cc @@ -218,8 +208,6 @@ set(iot_src src/model/CreateRuleResult.cc src/model/StartRuleRequest.cc src/model/StartRuleResult.cc - src/model/ApplyDeviceWithNamesRequest.cc - src/model/ApplyDeviceWithNamesResult.cc src/model/QueryProductListRequest.cc src/model/QueryProductListResult.cc src/model/QueryDevicePropertyStatusRequest.cc @@ -228,12 +216,12 @@ set(iot_src src/model/QueryDeviceStatisticsResult.cc src/model/PubRequest.cc src/model/PubResult.cc + src/model/DeleteProductRequest.cc + src/model/DeleteProductResult.cc src/model/SaveDevicePropRequest.cc src/model/SaveDevicePropResult.cc src/model/DeleteProductTopicRequest.cc src/model/DeleteProductTopicResult.cc - src/model/QueryApplyStatusRequest.cc - src/model/QueryApplyStatusResult.cc src/model/QueryDeviceServiceDataRequest.cc src/model/QueryDeviceServiceDataResult.cc src/model/BatchRegisterDeviceWithApplyIdRequest.cc diff --git a/iot/include/alibabacloud/iot/IotClient.h b/iot/include/alibabacloud/iot/IotClient.h index 10faa496c..a35fe6e68 100644 --- a/iot/include/alibabacloud/iot/IotClient.h +++ b/iot/include/alibabacloud/iot/IotClient.h @@ -22,8 +22,6 @@ #include #include #include "IotExport.h" -#include "model/RegistDeviceRequest.h" -#include "model/RegistDeviceResult.h" #include "model/DeleteTopicRouteTableRequest.h" #include "model/DeleteTopicRouteTableResult.h" #include "model/QueryDeviceEventDataRequest.h" @@ -38,8 +36,6 @@ #include "model/RRpcResult.h" #include "model/DeleteRuleRequest.h" #include "model/DeleteRuleResult.h" -#include "model/QueryDeviceByNameRequest.h" -#include "model/QueryDeviceByNameResult.h" #include "model/QueryProductTopicRequest.h" #include "model/QueryProductTopicResult.h" #include "model/GetThingTopoRequest.h" @@ -96,8 +92,6 @@ #include "model/CreateRuleResult.h" #include "model/StartRuleRequest.h" #include "model/StartRuleResult.h" -#include "model/ApplyDeviceWithNamesRequest.h" -#include "model/ApplyDeviceWithNamesResult.h" #include "model/QueryProductListRequest.h" #include "model/QueryProductListResult.h" #include "model/QueryDevicePropertyStatusRequest.h" @@ -106,12 +100,12 @@ #include "model/QueryDeviceStatisticsResult.h" #include "model/PubRequest.h" #include "model/PubResult.h" +#include "model/DeleteProductRequest.h" +#include "model/DeleteProductResult.h" #include "model/SaveDevicePropRequest.h" #include "model/SaveDevicePropResult.h" #include "model/DeleteProductTopicRequest.h" #include "model/DeleteProductTopicResult.h" -#include "model/QueryApplyStatusRequest.h" -#include "model/QueryApplyStatusResult.h" #include "model/QueryDeviceServiceDataRequest.h" #include "model/QueryDeviceServiceDataResult.h" #include "model/BatchRegisterDeviceWithApplyIdRequest.h" @@ -151,9 +145,6 @@ namespace AlibabaCloud class ALIBABACLOUD_IOT_EXPORT IotClient : public RpcServiceClient { public: - typedef Outcome RegistDeviceOutcome; - typedef std::future RegistDeviceOutcomeCallable; - typedef std::function&)> RegistDeviceAsyncHandler; typedef Outcome DeleteTopicRouteTableOutcome; typedef std::future DeleteTopicRouteTableOutcomeCallable; typedef std::function&)> DeleteTopicRouteTableAsyncHandler; @@ -175,9 +166,6 @@ namespace AlibabaCloud typedef Outcome DeleteRuleOutcome; typedef std::future DeleteRuleOutcomeCallable; typedef std::function&)> DeleteRuleAsyncHandler; - typedef Outcome QueryDeviceByNameOutcome; - typedef std::future QueryDeviceByNameOutcomeCallable; - typedef std::function&)> QueryDeviceByNameAsyncHandler; typedef Outcome QueryProductTopicOutcome; typedef std::future QueryProductTopicOutcomeCallable; typedef std::function&)> QueryProductTopicAsyncHandler; @@ -262,9 +250,6 @@ namespace AlibabaCloud typedef Outcome StartRuleOutcome; typedef std::future StartRuleOutcomeCallable; typedef std::function&)> StartRuleAsyncHandler; - typedef Outcome ApplyDeviceWithNamesOutcome; - typedef std::future ApplyDeviceWithNamesOutcomeCallable; - typedef std::function&)> ApplyDeviceWithNamesAsyncHandler; typedef Outcome QueryProductListOutcome; typedef std::future QueryProductListOutcomeCallable; typedef std::function&)> QueryProductListAsyncHandler; @@ -277,15 +262,15 @@ namespace AlibabaCloud typedef Outcome PubOutcome; typedef std::future PubOutcomeCallable; typedef std::function&)> PubAsyncHandler; + typedef Outcome DeleteProductOutcome; + typedef std::future DeleteProductOutcomeCallable; + typedef std::function&)> DeleteProductAsyncHandler; typedef Outcome SaveDevicePropOutcome; typedef std::future SaveDevicePropOutcomeCallable; typedef std::function&)> SaveDevicePropAsyncHandler; typedef Outcome DeleteProductTopicOutcome; typedef std::future DeleteProductTopicOutcomeCallable; typedef std::function&)> DeleteProductTopicAsyncHandler; - typedef Outcome QueryApplyStatusOutcome; - typedef std::future QueryApplyStatusOutcomeCallable; - typedef std::function&)> QueryApplyStatusAsyncHandler; typedef Outcome QueryDeviceServiceDataOutcome; typedef std::future QueryDeviceServiceDataOutcomeCallable; typedef std::function&)> QueryDeviceServiceDataAsyncHandler; @@ -336,9 +321,6 @@ namespace AlibabaCloud IotClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); IotClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration); ~IotClient(); - RegistDeviceOutcome registDevice(const Model::RegistDeviceRequest &request)const; - void registDeviceAsync(const Model::RegistDeviceRequest& request, const RegistDeviceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; - RegistDeviceOutcomeCallable registDeviceCallable(const Model::RegistDeviceRequest& request) const; DeleteTopicRouteTableOutcome deleteTopicRouteTable(const Model::DeleteTopicRouteTableRequest &request)const; void deleteTopicRouteTableAsync(const Model::DeleteTopicRouteTableRequest& request, const DeleteTopicRouteTableAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DeleteTopicRouteTableOutcomeCallable deleteTopicRouteTableCallable(const Model::DeleteTopicRouteTableRequest& request) const; @@ -360,9 +342,6 @@ namespace AlibabaCloud DeleteRuleOutcome deleteRule(const Model::DeleteRuleRequest &request)const; void deleteRuleAsync(const Model::DeleteRuleRequest& request, const DeleteRuleAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DeleteRuleOutcomeCallable deleteRuleCallable(const Model::DeleteRuleRequest& request) const; - QueryDeviceByNameOutcome queryDeviceByName(const Model::QueryDeviceByNameRequest &request)const; - void queryDeviceByNameAsync(const Model::QueryDeviceByNameRequest& request, const QueryDeviceByNameAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; - QueryDeviceByNameOutcomeCallable queryDeviceByNameCallable(const Model::QueryDeviceByNameRequest& request) const; QueryProductTopicOutcome queryProductTopic(const Model::QueryProductTopicRequest &request)const; void queryProductTopicAsync(const Model::QueryProductTopicRequest& request, const QueryProductTopicAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; QueryProductTopicOutcomeCallable queryProductTopicCallable(const Model::QueryProductTopicRequest& request) const; @@ -447,9 +426,6 @@ namespace AlibabaCloud StartRuleOutcome startRule(const Model::StartRuleRequest &request)const; void startRuleAsync(const Model::StartRuleRequest& request, const StartRuleAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; StartRuleOutcomeCallable startRuleCallable(const Model::StartRuleRequest& request) const; - ApplyDeviceWithNamesOutcome applyDeviceWithNames(const Model::ApplyDeviceWithNamesRequest &request)const; - void applyDeviceWithNamesAsync(const Model::ApplyDeviceWithNamesRequest& request, const ApplyDeviceWithNamesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; - ApplyDeviceWithNamesOutcomeCallable applyDeviceWithNamesCallable(const Model::ApplyDeviceWithNamesRequest& request) const; QueryProductListOutcome queryProductList(const Model::QueryProductListRequest &request)const; void queryProductListAsync(const Model::QueryProductListRequest& request, const QueryProductListAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; QueryProductListOutcomeCallable queryProductListCallable(const Model::QueryProductListRequest& request) const; @@ -462,15 +438,15 @@ namespace AlibabaCloud PubOutcome pub(const Model::PubRequest &request)const; void pubAsync(const Model::PubRequest& request, const PubAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; PubOutcomeCallable pubCallable(const Model::PubRequest& request) const; + DeleteProductOutcome deleteProduct(const Model::DeleteProductRequest &request)const; + void deleteProductAsync(const Model::DeleteProductRequest& request, const DeleteProductAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DeleteProductOutcomeCallable deleteProductCallable(const Model::DeleteProductRequest& request) const; SaveDevicePropOutcome saveDeviceProp(const Model::SaveDevicePropRequest &request)const; void saveDevicePropAsync(const Model::SaveDevicePropRequest& request, const SaveDevicePropAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; SaveDevicePropOutcomeCallable saveDevicePropCallable(const Model::SaveDevicePropRequest& request) const; DeleteProductTopicOutcome deleteProductTopic(const Model::DeleteProductTopicRequest &request)const; void deleteProductTopicAsync(const Model::DeleteProductTopicRequest& request, const DeleteProductTopicAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DeleteProductTopicOutcomeCallable deleteProductTopicCallable(const Model::DeleteProductTopicRequest& request) const; - QueryApplyStatusOutcome queryApplyStatus(const Model::QueryApplyStatusRequest &request)const; - void queryApplyStatusAsync(const Model::QueryApplyStatusRequest& request, const QueryApplyStatusAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; - QueryApplyStatusOutcomeCallable queryApplyStatusCallable(const Model::QueryApplyStatusRequest& request) const; QueryDeviceServiceDataOutcome queryDeviceServiceData(const Model::QueryDeviceServiceDataRequest &request)const; void queryDeviceServiceDataAsync(const Model::QueryDeviceServiceDataRequest& request, const QueryDeviceServiceDataAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; QueryDeviceServiceDataOutcomeCallable queryDeviceServiceDataCallable(const Model::QueryDeviceServiceDataRequest& request) const; diff --git a/iot/include/alibabacloud/iot/model/ApplyDeviceWithNamesRequest.h b/iot/include/alibabacloud/iot/model/ApplyDeviceWithNamesRequest.h deleted file mode 100644 index af97f19d4..000000000 --- a/iot/include/alibabacloud/iot/model/ApplyDeviceWithNamesRequest.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2009-2017 Alibaba Cloud 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. - */ - -#ifndef ALIBABACLOUD_IOT_MODEL_APPLYDEVICEWITHNAMESREQUEST_H_ -#define ALIBABACLOUD_IOT_MODEL_APPLYDEVICEWITHNAMESREQUEST_H_ - -#include -#include -#include -#include - -namespace AlibabaCloud -{ - namespace Iot - { - namespace Model - { - class ALIBABACLOUD_IOT_EXPORT ApplyDeviceWithNamesRequest : public RpcServiceRequest - { - - public: - ApplyDeviceWithNamesRequest(); - ~ApplyDeviceWithNamesRequest(); - - std::vector getDeviceName()const; - void setDeviceName(const std::vector& deviceName); - std::string getProductKey()const; - void setProductKey(const std::string& productKey); - std::string getAccessKeyId()const; - void setAccessKeyId(const std::string& accessKeyId); - - private: - std::vector deviceName_; - std::string productKey_; - std::string accessKeyId_; - - }; - } - } -} -#endif // !ALIBABACLOUD_IOT_MODEL_APPLYDEVICEWITHNAMESREQUEST_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/ApplyDeviceWithNamesResult.h b/iot/include/alibabacloud/iot/model/ApplyDeviceWithNamesResult.h deleted file mode 100644 index f2ee9d73a..000000000 --- a/iot/include/alibabacloud/iot/model/ApplyDeviceWithNamesResult.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2009-2017 Alibaba Cloud 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. - */ - -#ifndef ALIBABACLOUD_IOT_MODEL_APPLYDEVICEWITHNAMESRESULT_H_ -#define ALIBABACLOUD_IOT_MODEL_APPLYDEVICEWITHNAMESRESULT_H_ - -#include -#include -#include -#include -#include - -namespace AlibabaCloud -{ - namespace Iot - { - namespace Model - { - class ALIBABACLOUD_IOT_EXPORT ApplyDeviceWithNamesResult : public ServiceResult - { - public: - - - ApplyDeviceWithNamesResult(); - explicit ApplyDeviceWithNamesResult(const std::string &payload); - ~ApplyDeviceWithNamesResult(); - long getApplyId()const; - std::string getErrorMessage()const; - std::string getCode()const; - bool getSuccess()const; - - protected: - void parse(const std::string &payload); - private: - long applyId_; - std::string errorMessage_; - std::string code_; - bool success_; - - }; - } - } -} -#endif // !ALIBABACLOUD_IOT_MODEL_APPLYDEVICEWITHNAMESRESULT_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/CreateProductRequest.h b/iot/include/alibabacloud/iot/model/CreateProductRequest.h index 57def1eac..03c9b43a3 100644 --- a/iot/include/alibabacloud/iot/model/CreateProductRequest.h +++ b/iot/include/alibabacloud/iot/model/CreateProductRequest.h @@ -35,38 +35,35 @@ namespace AlibabaCloud CreateProductRequest(); ~CreateProductRequest(); - long getCatId()const; - void setCatId(long catId); + int getDataFormat()const; + void setDataFormat(int dataFormat); int getNodeType()const; void setNodeType(int nodeType); - std::string getRegionId()const; - void setRegionId(const std::string& regionId); bool getId2()const; void setId2(bool id2); - std::string getName()const; - void setName(const std::string& name); - std::string getExtProps()const; - void setExtProps(const std::string& extProps); - std::string getSecurityPolicy()const; - void setSecurityPolicy(const std::string& securityPolicy); - int getPayType()const; - void setPayType(int payType); + std::string getProductName()const; + void setProductName(const std::string& productName); + std::string getDescription()const; + void setDescription(const std::string& description); + std::string getProtocolType()const; + void setProtocolType(const std::string& protocolType); + std::string getAliyunCommodityCode()const; + void setAliyunCommodityCode(const std::string& aliyunCommodityCode); + long getCategoryId()const; + void setCategoryId(long categoryId); std::string getAccessKeyId()const; void setAccessKeyId(const std::string& accessKeyId); - std::string getDesc()const; - void setDesc(const std::string& desc); private: - long catId_; + int dataFormat_; int nodeType_; - std::string regionId_; bool id2_; - std::string name_; - std::string extProps_; - std::string securityPolicy_; - int payType_; + std::string productName_; + std::string description_; + std::string protocolType_; + std::string aliyunCommodityCode_; + long categoryId_; std::string accessKeyId_; - std::string desc_; }; } diff --git a/iot/include/alibabacloud/iot/model/CreateProductResult.h b/iot/include/alibabacloud/iot/model/CreateProductResult.h index 0278eb93f..48fa6f7d9 100644 --- a/iot/include/alibabacloud/iot/model/CreateProductResult.h +++ b/iot/include/alibabacloud/iot/model/CreateProductResult.h @@ -32,19 +32,15 @@ namespace AlibabaCloud class ALIBABACLOUD_IOT_EXPORT CreateProductResult : public ServiceResult { public: - struct ProductInfo + struct Data { - std::string gmtCreate; + std::string description; std::string productName; - std::string extProps; + std::string aliyunCommodityCode; bool id2; + std::string protocolType; int nodeType; - std::string fromSource; - std::string gmtModified; - long createUserId; - std::string productDesc; - std::string productSecret; - long catId; + int dataFormat; std::string productKey; }; @@ -52,18 +48,20 @@ namespace AlibabaCloud CreateProductResult(); explicit CreateProductResult(const std::string &payload); ~CreateProductResult(); - ProductInfo getProductInfo()const; + Data getData()const; std::string getErrorMessage()const; std::string getCode()const; bool getSuccess()const; + std::string getProductKey()const; protected: void parse(const std::string &payload); private: - ProductInfo productInfo_; + Data data_; std::string errorMessage_; std::string code_; bool success_; + std::string productKey_; }; } diff --git a/iot/include/alibabacloud/iot/model/CreateRuleRequest.h b/iot/include/alibabacloud/iot/model/CreateRuleRequest.h index 3003c2990..f386ea47e 100644 --- a/iot/include/alibabacloud/iot/model/CreateRuleRequest.h +++ b/iot/include/alibabacloud/iot/model/CreateRuleRequest.h @@ -47,6 +47,8 @@ namespace AlibabaCloud void setWhere(const std::string& where); std::string getProductKey()const; void setProductKey(const std::string& productKey); + int getTopicType()const; + void setTopicType(int topicType); std::string getAccessKeyId()const; void setAccessKeyId(const std::string& accessKeyId); std::string getShortTopic()const; @@ -59,6 +61,7 @@ namespace AlibabaCloud std::string name_; std::string where_; std::string productKey_; + int topicType_; std::string accessKeyId_; std::string shortTopic_; diff --git a/iot/include/alibabacloud/iot/model/RegistDeviceRequest.h b/iot/include/alibabacloud/iot/model/DeleteProductRequest.h similarity index 72% rename from iot/include/alibabacloud/iot/model/RegistDeviceRequest.h rename to iot/include/alibabacloud/iot/model/DeleteProductRequest.h index c48c19698..7a6f79f2f 100644 --- a/iot/include/alibabacloud/iot/model/RegistDeviceRequest.h +++ b/iot/include/alibabacloud/iot/model/DeleteProductRequest.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ALIBABACLOUD_IOT_MODEL_REGISTDEVICEREQUEST_H_ -#define ALIBABACLOUD_IOT_MODEL_REGISTDEVICEREQUEST_H_ +#ifndef ALIBABACLOUD_IOT_MODEL_DELETEPRODUCTREQUEST_H_ +#define ALIBABACLOUD_IOT_MODEL_DELETEPRODUCTREQUEST_H_ #include #include @@ -28,22 +28,19 @@ namespace AlibabaCloud { namespace Model { - class ALIBABACLOUD_IOT_EXPORT RegistDeviceRequest : public RpcServiceRequest + class ALIBABACLOUD_IOT_EXPORT DeleteProductRequest : public RpcServiceRequest { public: - RegistDeviceRequest(); - ~RegistDeviceRequest(); + DeleteProductRequest(); + ~DeleteProductRequest(); - std::string getDeviceName()const; - void setDeviceName(const std::string& deviceName); std::string getProductKey()const; void setProductKey(const std::string& productKey); std::string getAccessKeyId()const; void setAccessKeyId(const std::string& accessKeyId); private: - std::string deviceName_; std::string productKey_; std::string accessKeyId_; @@ -51,4 +48,4 @@ namespace AlibabaCloud } } } -#endif // !ALIBABACLOUD_IOT_MODEL_REGISTDEVICEREQUEST_H_ \ No newline at end of file +#endif // !ALIBABACLOUD_IOT_MODEL_DELETEPRODUCTREQUEST_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/QueryApplyStatusResult.h b/iot/include/alibabacloud/iot/model/DeleteProductResult.h similarity index 72% rename from iot/include/alibabacloud/iot/model/QueryApplyStatusResult.h rename to iot/include/alibabacloud/iot/model/DeleteProductResult.h index a31a657f2..a060446b5 100644 --- a/iot/include/alibabacloud/iot/model/QueryApplyStatusResult.h +++ b/iot/include/alibabacloud/iot/model/DeleteProductResult.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ALIBABACLOUD_IOT_MODEL_QUERYAPPLYSTATUSRESULT_H_ -#define ALIBABACLOUD_IOT_MODEL_QUERYAPPLYSTATUSRESULT_H_ +#ifndef ALIBABACLOUD_IOT_MODEL_DELETEPRODUCTRESULT_H_ +#define ALIBABACLOUD_IOT_MODEL_DELETEPRODUCTRESULT_H_ #include #include @@ -29,17 +29,16 @@ namespace AlibabaCloud { namespace Model { - class ALIBABACLOUD_IOT_EXPORT QueryApplyStatusResult : public ServiceResult + class ALIBABACLOUD_IOT_EXPORT DeleteProductResult : public ServiceResult { public: - QueryApplyStatusResult(); - explicit QueryApplyStatusResult(const std::string &payload); - ~QueryApplyStatusResult(); + DeleteProductResult(); + explicit DeleteProductResult(const std::string &payload); + ~DeleteProductResult(); std::string getErrorMessage()const; std::string getCode()const; - bool getFinish()const; bool getSuccess()const; protected: @@ -47,11 +46,10 @@ namespace AlibabaCloud private: std::string errorMessage_; std::string code_; - bool finish_; bool success_; }; } } } -#endif // !ALIBABACLOUD_IOT_MODEL_QUERYAPPLYSTATUSRESULT_H_ \ No newline at end of file +#endif // !ALIBABACLOUD_IOT_MODEL_DELETEPRODUCTRESULT_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/GetRuleResult.h b/iot/include/alibabacloud/iot/model/GetRuleResult.h index 7fd1837a4..dfd62044d 100644 --- a/iot/include/alibabacloud/iot/model/GetRuleResult.h +++ b/iot/include/alibabacloud/iot/model/GetRuleResult.h @@ -36,13 +36,16 @@ namespace AlibabaCloud { std::string status; std::string modified; + std::string utcCreated; long createUserId; std::string name; std::string created; + int topicType; std::string select; std::string shortTopic; std::string ruleDesc; std::string dataType; + std::string utcModified; long id; std::string topic; std::string where; diff --git a/iot/include/alibabacloud/iot/model/ListRuleResult.h b/iot/include/alibabacloud/iot/model/ListRuleResult.h index c59b63f30..81b82aca5 100644 --- a/iot/include/alibabacloud/iot/model/ListRuleResult.h +++ b/iot/include/alibabacloud/iot/model/ListRuleResult.h @@ -36,6 +36,7 @@ namespace AlibabaCloud { std::string status; std::string modified; + std::string utcCreated; long createUserId; std::string name; std::string created; @@ -43,6 +44,7 @@ namespace AlibabaCloud std::string shortTopic; std::string dataType; std::string ruleDesc; + std::string utcModified; long id; std::string topic; std::string where; diff --git a/iot/include/alibabacloud/iot/model/QueryApplyStatusRequest.h b/iot/include/alibabacloud/iot/model/QueryApplyStatusRequest.h deleted file mode 100644 index 5494d889c..000000000 --- a/iot/include/alibabacloud/iot/model/QueryApplyStatusRequest.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2009-2017 Alibaba Cloud 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. - */ - -#ifndef ALIBABACLOUD_IOT_MODEL_QUERYAPPLYSTATUSREQUEST_H_ -#define ALIBABACLOUD_IOT_MODEL_QUERYAPPLYSTATUSREQUEST_H_ - -#include -#include -#include -#include - -namespace AlibabaCloud -{ - namespace Iot - { - namespace Model - { - class ALIBABACLOUD_IOT_EXPORT QueryApplyStatusRequest : public RpcServiceRequest - { - - public: - QueryApplyStatusRequest(); - ~QueryApplyStatusRequest(); - - long getApplyId()const; - void setApplyId(long applyId); - std::string getAccessKeyId()const; - void setAccessKeyId(const std::string& accessKeyId); - - private: - long applyId_; - std::string accessKeyId_; - - }; - } - } -} -#endif // !ALIBABACLOUD_IOT_MODEL_QUERYAPPLYSTATUSREQUEST_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/QueryDeviceByNameRequest.h b/iot/include/alibabacloud/iot/model/QueryDeviceByNameRequest.h deleted file mode 100644 index ae69559aa..000000000 --- a/iot/include/alibabacloud/iot/model/QueryDeviceByNameRequest.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2009-2017 Alibaba Cloud 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. - */ - -#ifndef ALIBABACLOUD_IOT_MODEL_QUERYDEVICEBYNAMEREQUEST_H_ -#define ALIBABACLOUD_IOT_MODEL_QUERYDEVICEBYNAMEREQUEST_H_ - -#include -#include -#include -#include - -namespace AlibabaCloud -{ - namespace Iot - { - namespace Model - { - class ALIBABACLOUD_IOT_EXPORT QueryDeviceByNameRequest : public RpcServiceRequest - { - - public: - QueryDeviceByNameRequest(); - ~QueryDeviceByNameRequest(); - - std::string getDeviceName()const; - void setDeviceName(const std::string& deviceName); - std::string getProductKey()const; - void setProductKey(const std::string& productKey); - std::string getAccessKeyId()const; - void setAccessKeyId(const std::string& accessKeyId); - - private: - std::string deviceName_; - std::string productKey_; - std::string accessKeyId_; - - }; - } - } -} -#endif // !ALIBABACLOUD_IOT_MODEL_QUERYDEVICEBYNAMEREQUEST_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/QueryDeviceByNameResult.h b/iot/include/alibabacloud/iot/model/QueryDeviceByNameResult.h deleted file mode 100644 index 7bc10c127..000000000 --- a/iot/include/alibabacloud/iot/model/QueryDeviceByNameResult.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2009-2017 Alibaba Cloud 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. - */ - -#ifndef ALIBABACLOUD_IOT_MODEL_QUERYDEVICEBYNAMERESULT_H_ -#define ALIBABACLOUD_IOT_MODEL_QUERYDEVICEBYNAMERESULT_H_ - -#include -#include -#include -#include -#include - -namespace AlibabaCloud -{ - namespace Iot - { - namespace Model - { - class ALIBABACLOUD_IOT_EXPORT QueryDeviceByNameResult : public ServiceResult - { - public: - struct DeviceInfo - { - std::string deviceType; - std::string gmtCreate; - std::string deviceId; - std::string deviceSecret; - std::string gmtModified; - std::string deviceStatus; - std::string clientIp; - std::string productKey; - std::string deviceName; - }; - - - QueryDeviceByNameResult(); - explicit QueryDeviceByNameResult(const std::string &payload); - ~QueryDeviceByNameResult(); - DeviceInfo getDeviceInfo()const; - std::string getErrorMessage()const; - std::string getCode()const; - bool getSuccess()const; - - protected: - void parse(const std::string &payload); - private: - DeviceInfo deviceInfo_; - std::string errorMessage_; - std::string code_; - bool success_; - - }; - } - } -} -#endif // !ALIBABACLOUD_IOT_MODEL_QUERYDEVICEBYNAMERESULT_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/QueryProductResult.h b/iot/include/alibabacloud/iot/model/QueryProductResult.h index d3c3dc0b5..1554f0114 100644 --- a/iot/include/alibabacloud/iot/model/QueryProductResult.h +++ b/iot/include/alibabacloud/iot/model/QueryProductResult.h @@ -34,16 +34,17 @@ namespace AlibabaCloud public: struct Data { - long gmtCreate; std::string description; - std::string categoryKey; std::string productName; std::string aliyunCommodityCode; + std::string productSecret; + long gmtCreate; + std::string categoryKey; bool id2; + std::string protocolType; int nodeType; int dataFormat; std::string categoryName; - std::string productSecret; std::string productKey; int deviceCount; }; diff --git a/iot/include/alibabacloud/iot/model/RRpcRequest.h b/iot/include/alibabacloud/iot/model/RRpcRequest.h index dd197d300..1d9ed5d8c 100644 --- a/iot/include/alibabacloud/iot/model/RRpcRequest.h +++ b/iot/include/alibabacloud/iot/model/RRpcRequest.h @@ -37,6 +37,8 @@ namespace AlibabaCloud std::string getRequestBase64Byte()const; void setRequestBase64Byte(const std::string& requestBase64Byte); + std::string getTopic()const; + void setTopic(const std::string& topic); std::string getDeviceName()const; void setDeviceName(const std::string& deviceName); std::string getProductKey()const; @@ -48,6 +50,7 @@ namespace AlibabaCloud private: std::string requestBase64Byte_; + std::string topic_; std::string deviceName_; std::string productKey_; int timeout_; diff --git a/iot/include/alibabacloud/iot/model/RegistDeviceResult.h b/iot/include/alibabacloud/iot/model/RegistDeviceResult.h deleted file mode 100644 index 5428af016..000000000 --- a/iot/include/alibabacloud/iot/model/RegistDeviceResult.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2009-2017 Alibaba Cloud 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. - */ - -#ifndef ALIBABACLOUD_IOT_MODEL_REGISTDEVICERESULT_H_ -#define ALIBABACLOUD_IOT_MODEL_REGISTDEVICERESULT_H_ - -#include -#include -#include -#include -#include - -namespace AlibabaCloud -{ - namespace Iot - { - namespace Model - { - class ALIBABACLOUD_IOT_EXPORT RegistDeviceResult : public ServiceResult - { - public: - - - RegistDeviceResult(); - explicit RegistDeviceResult(const std::string &payload); - ~RegistDeviceResult(); - std::string getDeviceId()const; - std::string getDeviceSecret()const; - std::string getDeviceStatus()const; - std::string getErrorMessage()const; - std::string getCode()const; - bool getSuccess()const; - std::string getDeviceName()const; - - protected: - void parse(const std::string &payload); - private: - std::string deviceId_; - std::string deviceSecret_; - std::string deviceStatus_; - std::string errorMessage_; - std::string code_; - bool success_; - std::string deviceName_; - - }; - } - } -} -#endif // !ALIBABACLOUD_IOT_MODEL_REGISTDEVICERESULT_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/UpdateProductRequest.h b/iot/include/alibabacloud/iot/model/UpdateProductRequest.h index 1fb387444..160a2962e 100644 --- a/iot/include/alibabacloud/iot/model/UpdateProductRequest.h +++ b/iot/include/alibabacloud/iot/model/UpdateProductRequest.h @@ -35,28 +35,19 @@ namespace AlibabaCloud UpdateProductRequest(); ~UpdateProductRequest(); - long getCatId()const; - void setCatId(long catId); - int getNodeType()const; - void setNodeType(int nodeType); std::string getProductName()const; void setProductName(const std::string& productName); - std::string getExtProps()const; - void setExtProps(const std::string& extProps); + std::string getDescription()const; + void setDescription(const std::string& description); std::string getProductKey()const; void setProductKey(const std::string& productKey); - std::string getProductDesc()const; - void setProductDesc(const std::string& productDesc); std::string getAccessKeyId()const; void setAccessKeyId(const std::string& accessKeyId); private: - long catId_; - int nodeType_; std::string productName_; - std::string extProps_; + std::string description_; std::string productKey_; - std::string productDesc_; std::string accessKeyId_; }; diff --git a/iot/include/alibabacloud/iot/model/UpdateRuleRequest.h b/iot/include/alibabacloud/iot/model/UpdateRuleRequest.h index 4f58f669f..530644f8c 100644 --- a/iot/include/alibabacloud/iot/model/UpdateRuleRequest.h +++ b/iot/include/alibabacloud/iot/model/UpdateRuleRequest.h @@ -47,6 +47,8 @@ namespace AlibabaCloud void setRuleId(long ruleId); std::string getProductKey()const; void setProductKey(const std::string& productKey); + int getTopicType()const; + void setTopicType(int topicType); std::string getAccessKeyId()const; void setAccessKeyId(const std::string& accessKeyId); std::string getShortTopic()const; @@ -59,6 +61,7 @@ namespace AlibabaCloud std::string where_; long ruleId_; std::string productKey_; + int topicType_; std::string accessKeyId_; std::string shortTopic_; diff --git a/iot/src/IotClient.cc b/iot/src/IotClient.cc index 93582d488..86449d224 100644 --- a/iot/src/IotClient.cc +++ b/iot/src/IotClient.cc @@ -51,42 +51,6 @@ IotClient::IotClient(const std::string & accessKeyId, const std::string & access IotClient::~IotClient() {} -IotClient::RegistDeviceOutcome IotClient::registDevice(const RegistDeviceRequest &request) const -{ - auto endpointOutcome = endpointProvider_->getEndpoint(); - if (!endpointOutcome.isSuccess()) - return RegistDeviceOutcome(endpointOutcome.error()); - - auto outcome = makeRequest(endpointOutcome.result(), request); - - if (outcome.isSuccess()) - return RegistDeviceOutcome(RegistDeviceResult(outcome.result())); - else - return RegistDeviceOutcome(outcome.error()); -} - -void IotClient::registDeviceAsync(const RegistDeviceRequest& request, const RegistDeviceAsyncHandler& handler, const std::shared_ptr& context) const -{ - auto fn = [this, request, handler, context]() - { - handler(this, request, registDevice(request), context); - }; - - asyncExecute(new Runnable(fn)); -} - -IotClient::RegistDeviceOutcomeCallable IotClient::registDeviceCallable(const RegistDeviceRequest &request) const -{ - auto task = std::make_shared>( - [this, request]() - { - return this->registDevice(request); - }); - - asyncExecute(new Runnable([task]() { (*task)(); })); - return task->get_future(); -} - IotClient::DeleteTopicRouteTableOutcome IotClient::deleteTopicRouteTable(const DeleteTopicRouteTableRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -339,42 +303,6 @@ IotClient::DeleteRuleOutcomeCallable IotClient::deleteRuleCallable(const DeleteR return task->get_future(); } -IotClient::QueryDeviceByNameOutcome IotClient::queryDeviceByName(const QueryDeviceByNameRequest &request) const -{ - auto endpointOutcome = endpointProvider_->getEndpoint(); - if (!endpointOutcome.isSuccess()) - return QueryDeviceByNameOutcome(endpointOutcome.error()); - - auto outcome = makeRequest(endpointOutcome.result(), request); - - if (outcome.isSuccess()) - return QueryDeviceByNameOutcome(QueryDeviceByNameResult(outcome.result())); - else - return QueryDeviceByNameOutcome(outcome.error()); -} - -void IotClient::queryDeviceByNameAsync(const QueryDeviceByNameRequest& request, const QueryDeviceByNameAsyncHandler& handler, const std::shared_ptr& context) const -{ - auto fn = [this, request, handler, context]() - { - handler(this, request, queryDeviceByName(request), context); - }; - - asyncExecute(new Runnable(fn)); -} - -IotClient::QueryDeviceByNameOutcomeCallable IotClient::queryDeviceByNameCallable(const QueryDeviceByNameRequest &request) const -{ - auto task = std::make_shared>( - [this, request]() - { - return this->queryDeviceByName(request); - }); - - asyncExecute(new Runnable([task]() { (*task)(); })); - return task->get_future(); -} - IotClient::QueryProductTopicOutcome IotClient::queryProductTopic(const QueryProductTopicRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -1383,42 +1311,6 @@ IotClient::StartRuleOutcomeCallable IotClient::startRuleCallable(const StartRule return task->get_future(); } -IotClient::ApplyDeviceWithNamesOutcome IotClient::applyDeviceWithNames(const ApplyDeviceWithNamesRequest &request) const -{ - auto endpointOutcome = endpointProvider_->getEndpoint(); - if (!endpointOutcome.isSuccess()) - return ApplyDeviceWithNamesOutcome(endpointOutcome.error()); - - auto outcome = makeRequest(endpointOutcome.result(), request); - - if (outcome.isSuccess()) - return ApplyDeviceWithNamesOutcome(ApplyDeviceWithNamesResult(outcome.result())); - else - return ApplyDeviceWithNamesOutcome(outcome.error()); -} - -void IotClient::applyDeviceWithNamesAsync(const ApplyDeviceWithNamesRequest& request, const ApplyDeviceWithNamesAsyncHandler& handler, const std::shared_ptr& context) const -{ - auto fn = [this, request, handler, context]() - { - handler(this, request, applyDeviceWithNames(request), context); - }; - - asyncExecute(new Runnable(fn)); -} - -IotClient::ApplyDeviceWithNamesOutcomeCallable IotClient::applyDeviceWithNamesCallable(const ApplyDeviceWithNamesRequest &request) const -{ - auto task = std::make_shared>( - [this, request]() - { - return this->applyDeviceWithNames(request); - }); - - asyncExecute(new Runnable([task]() { (*task)(); })); - return task->get_future(); -} - IotClient::QueryProductListOutcome IotClient::queryProductList(const QueryProductListRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -1563,6 +1455,42 @@ IotClient::PubOutcomeCallable IotClient::pubCallable(const PubRequest &request) return task->get_future(); } +IotClient::DeleteProductOutcome IotClient::deleteProduct(const DeleteProductRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DeleteProductOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DeleteProductOutcome(DeleteProductResult(outcome.result())); + else + return DeleteProductOutcome(outcome.error()); +} + +void IotClient::deleteProductAsync(const DeleteProductRequest& request, const DeleteProductAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, deleteProduct(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +IotClient::DeleteProductOutcomeCallable IotClient::deleteProductCallable(const DeleteProductRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->deleteProduct(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + IotClient::SaveDevicePropOutcome IotClient::saveDeviceProp(const SaveDevicePropRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -1635,42 +1563,6 @@ IotClient::DeleteProductTopicOutcomeCallable IotClient::deleteProductTopicCallab return task->get_future(); } -IotClient::QueryApplyStatusOutcome IotClient::queryApplyStatus(const QueryApplyStatusRequest &request) const -{ - auto endpointOutcome = endpointProvider_->getEndpoint(); - if (!endpointOutcome.isSuccess()) - return QueryApplyStatusOutcome(endpointOutcome.error()); - - auto outcome = makeRequest(endpointOutcome.result(), request); - - if (outcome.isSuccess()) - return QueryApplyStatusOutcome(QueryApplyStatusResult(outcome.result())); - else - return QueryApplyStatusOutcome(outcome.error()); -} - -void IotClient::queryApplyStatusAsync(const QueryApplyStatusRequest& request, const QueryApplyStatusAsyncHandler& handler, const std::shared_ptr& context) const -{ - auto fn = [this, request, handler, context]() - { - handler(this, request, queryApplyStatus(request), context); - }; - - asyncExecute(new Runnable(fn)); -} - -IotClient::QueryApplyStatusOutcomeCallable IotClient::queryApplyStatusCallable(const QueryApplyStatusRequest &request) const -{ - auto task = std::make_shared>( - [this, request]() - { - return this->queryApplyStatus(request); - }); - - asyncExecute(new Runnable([task]() { (*task)(); })); - return task->get_future(); -} - IotClient::QueryDeviceServiceDataOutcome IotClient::queryDeviceServiceData(const QueryDeviceServiceDataRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/iot/src/model/ApplyDeviceWithNamesRequest.cc b/iot/src/model/ApplyDeviceWithNamesRequest.cc deleted file mode 100644 index 77e3f8dad..000000000 --- a/iot/src/model/ApplyDeviceWithNamesRequest.cc +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2009-2017 Alibaba Cloud 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. - */ - -#include - -using AlibabaCloud::Iot::Model::ApplyDeviceWithNamesRequest; - -ApplyDeviceWithNamesRequest::ApplyDeviceWithNamesRequest() : - RpcServiceRequest("iot", "2017-04-20", "ApplyDeviceWithNames") -{} - -ApplyDeviceWithNamesRequest::~ApplyDeviceWithNamesRequest() -{} - -std::vector ApplyDeviceWithNamesRequest::getDeviceName()const -{ - return deviceName_; -} - -void ApplyDeviceWithNamesRequest::setDeviceName(const std::vector& deviceName) -{ - deviceName_ = deviceName; - for(int i = 0; i!= deviceName.size(); i++) - setParameter("DeviceName."+ std::to_string(i), deviceName.at(i)); -} - -std::string ApplyDeviceWithNamesRequest::getProductKey()const -{ - return productKey_; -} - -void ApplyDeviceWithNamesRequest::setProductKey(const std::string& productKey) -{ - productKey_ = productKey; - setParameter("ProductKey", productKey); -} - -std::string ApplyDeviceWithNamesRequest::getAccessKeyId()const -{ - return accessKeyId_; -} - -void ApplyDeviceWithNamesRequest::setAccessKeyId(const std::string& accessKeyId) -{ - accessKeyId_ = accessKeyId; - setParameter("AccessKeyId", accessKeyId); -} - diff --git a/iot/src/model/ApplyDeviceWithNamesResult.cc b/iot/src/model/ApplyDeviceWithNamesResult.cc deleted file mode 100644 index e787c6bb7..000000000 --- a/iot/src/model/ApplyDeviceWithNamesResult.cc +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2009-2017 Alibaba Cloud 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. - */ - -#include -#include - -using namespace AlibabaCloud::Iot; -using namespace AlibabaCloud::Iot::Model; - -ApplyDeviceWithNamesResult::ApplyDeviceWithNamesResult() : - ServiceResult() -{} - -ApplyDeviceWithNamesResult::ApplyDeviceWithNamesResult(const std::string &payload) : - ServiceResult() -{ - parse(payload); -} - -ApplyDeviceWithNamesResult::~ApplyDeviceWithNamesResult() -{} - -void ApplyDeviceWithNamesResult::parse(const std::string &payload) -{ - Json::Reader reader; - Json::Value value; - reader.parse(payload, value); - - setRequestId(value["RequestId"].asString()); - if(!value["Success"].isNull()) - success_ = value["Success"].asString() == "true"; - if(!value["Code"].isNull()) - code_ = value["Code"].asString(); - if(!value["ErrorMessage"].isNull()) - errorMessage_ = value["ErrorMessage"].asString(); - if(!value["ApplyId"].isNull()) - applyId_ = std::stol(value["ApplyId"].asString()); - -} - -long ApplyDeviceWithNamesResult::getApplyId()const -{ - return applyId_; -} - -std::string ApplyDeviceWithNamesResult::getErrorMessage()const -{ - return errorMessage_; -} - -std::string ApplyDeviceWithNamesResult::getCode()const -{ - return code_; -} - -bool ApplyDeviceWithNamesResult::getSuccess()const -{ - return success_; -} - diff --git a/iot/src/model/BatchGetDeviceStateRequest.cc b/iot/src/model/BatchGetDeviceStateRequest.cc index 4c103e430..ccb16b58c 100644 --- a/iot/src/model/BatchGetDeviceStateRequest.cc +++ b/iot/src/model/BatchGetDeviceStateRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::BatchGetDeviceStateRequest; BatchGetDeviceStateRequest::BatchGetDeviceStateRequest() : - RpcServiceRequest("iot", "2017-04-20", "BatchGetDeviceState") + RpcServiceRequest("iot", "2018-01-20", "BatchGetDeviceState") {} BatchGetDeviceStateRequest::~BatchGetDeviceStateRequest() diff --git a/iot/src/model/CreateProductRequest.cc b/iot/src/model/CreateProductRequest.cc index b99ec22e0..4875dc7ea 100644 --- a/iot/src/model/CreateProductRequest.cc +++ b/iot/src/model/CreateProductRequest.cc @@ -19,21 +19,21 @@ using AlibabaCloud::Iot::Model::CreateProductRequest; CreateProductRequest::CreateProductRequest() : - RpcServiceRequest("iot", "2017-04-20", "CreateProduct") + RpcServiceRequest("iot", "2018-01-20", "CreateProduct") {} CreateProductRequest::~CreateProductRequest() {} -long CreateProductRequest::getCatId()const +int CreateProductRequest::getDataFormat()const { - return catId_; + return dataFormat_; } -void CreateProductRequest::setCatId(long catId) +void CreateProductRequest::setDataFormat(int dataFormat) { - catId_ = catId; - setParameter("CatId", std::to_string(catId)); + dataFormat_ = dataFormat; + setParameter("DataFormat", std::to_string(dataFormat)); } int CreateProductRequest::getNodeType()const @@ -47,17 +47,6 @@ void CreateProductRequest::setNodeType(int nodeType) setParameter("NodeType", std::to_string(nodeType)); } -std::string CreateProductRequest::getRegionId()const -{ - return regionId_; -} - -void CreateProductRequest::setRegionId(const std::string& regionId) -{ - regionId_ = regionId; - setParameter("RegionId", regionId); -} - bool CreateProductRequest::getId2()const { return id2_; @@ -69,48 +58,59 @@ void CreateProductRequest::setId2(bool id2) setParameter("Id2", std::to_string(id2)); } -std::string CreateProductRequest::getName()const +std::string CreateProductRequest::getProductName()const { - return name_; + return productName_; } -void CreateProductRequest::setName(const std::string& name) +void CreateProductRequest::setProductName(const std::string& productName) { - name_ = name; - setParameter("Name", name); + productName_ = productName; + setParameter("ProductName", productName); } -std::string CreateProductRequest::getExtProps()const +std::string CreateProductRequest::getDescription()const { - return extProps_; + return description_; } -void CreateProductRequest::setExtProps(const std::string& extProps) +void CreateProductRequest::setDescription(const std::string& description) { - extProps_ = extProps; - setParameter("ExtProps", extProps); + description_ = description; + setParameter("Description", description); } -std::string CreateProductRequest::getSecurityPolicy()const +std::string CreateProductRequest::getProtocolType()const { - return securityPolicy_; + return protocolType_; } -void CreateProductRequest::setSecurityPolicy(const std::string& securityPolicy) +void CreateProductRequest::setProtocolType(const std::string& protocolType) { - securityPolicy_ = securityPolicy; - setParameter("SecurityPolicy", securityPolicy); + protocolType_ = protocolType; + setParameter("ProtocolType", protocolType); } -int CreateProductRequest::getPayType()const +std::string CreateProductRequest::getAliyunCommodityCode()const { - return payType_; + return aliyunCommodityCode_; } -void CreateProductRequest::setPayType(int payType) +void CreateProductRequest::setAliyunCommodityCode(const std::string& aliyunCommodityCode) { - payType_ = payType; - setParameter("PayType", std::to_string(payType)); + aliyunCommodityCode_ = aliyunCommodityCode; + setParameter("AliyunCommodityCode", aliyunCommodityCode); +} + +long CreateProductRequest::getCategoryId()const +{ + return categoryId_; +} + +void CreateProductRequest::setCategoryId(long categoryId) +{ + categoryId_ = categoryId; + setParameter("CategoryId", std::to_string(categoryId)); } std::string CreateProductRequest::getAccessKeyId()const @@ -124,14 +124,3 @@ void CreateProductRequest::setAccessKeyId(const std::string& accessKeyId) setParameter("AccessKeyId", accessKeyId); } -std::string CreateProductRequest::getDesc()const -{ - return desc_; -} - -void CreateProductRequest::setDesc(const std::string& desc) -{ - desc_ = desc; - setParameter("Desc", desc); -} - diff --git a/iot/src/model/CreateProductResult.cc b/iot/src/model/CreateProductResult.cc index ecae2a0a4..48b8b033d 100644 --- a/iot/src/model/CreateProductResult.cc +++ b/iot/src/model/CreateProductResult.cc @@ -40,43 +40,37 @@ void CreateProductResult::parse(const std::string &payload) reader.parse(payload, value); setRequestId(value["RequestId"].asString()); - auto productInfoNode = value["ProductInfo"]; - if(!productInfoNode["ProductKey"].isNull()) - productInfo_.productKey = productInfoNode["ProductKey"].asString(); - if(!productInfoNode["ProductName"].isNull()) - productInfo_.productName = productInfoNode["ProductName"].asString(); - if(!productInfoNode["NodeType"].isNull()) - productInfo_.nodeType = std::stoi(productInfoNode["NodeType"].asString()); - if(!productInfoNode["CatId"].isNull()) - productInfo_.catId = std::stol(productInfoNode["CatId"].asString()); - if(!productInfoNode["CreateUserId"].isNull()) - productInfo_.createUserId = std::stol(productInfoNode["CreateUserId"].asString()); - if(!productInfoNode["ProductDesc"].isNull()) - productInfo_.productDesc = productInfoNode["ProductDesc"].asString(); - if(!productInfoNode["FromSource"].isNull()) - productInfo_.fromSource = productInfoNode["FromSource"].asString(); - if(!productInfoNode["ExtProps"].isNull()) - productInfo_.extProps = productInfoNode["ExtProps"].asString(); - if(!productInfoNode["GmtCreate"].isNull()) - productInfo_.gmtCreate = productInfoNode["GmtCreate"].asString(); - if(!productInfoNode["GmtModified"].isNull()) - productInfo_.gmtModified = productInfoNode["GmtModified"].asString(); - if(!productInfoNode["ProductSecret"].isNull()) - productInfo_.productSecret = productInfoNode["ProductSecret"].asString(); - if(!productInfoNode["Id2"].isNull()) - productInfo_.id2 = productInfoNode["Id2"].asString() == "true"; + auto dataNode = value["Data"]; + if(!dataNode["DataFormat"].isNull()) + data_.dataFormat = std::stoi(dataNode["DataFormat"].asString()); + if(!dataNode["Description"].isNull()) + data_.description = dataNode["Description"].asString(); + if(!dataNode["NodeType"].isNull()) + data_.nodeType = std::stoi(dataNode["NodeType"].asString()); + if(!dataNode["ProductKey"].isNull()) + data_.productKey = dataNode["ProductKey"].asString(); + if(!dataNode["ProductName"].isNull()) + data_.productName = dataNode["ProductName"].asString(); + if(!dataNode["AliyunCommodityCode"].isNull()) + data_.aliyunCommodityCode = dataNode["AliyunCommodityCode"].asString(); + if(!dataNode["Id2"].isNull()) + data_.id2 = dataNode["Id2"].asString() == "true"; + if(!dataNode["ProtocolType"].isNull()) + data_.protocolType = dataNode["ProtocolType"].asString(); if(!value["Success"].isNull()) success_ = value["Success"].asString() == "true"; if(!value["Code"].isNull()) code_ = value["Code"].asString(); if(!value["ErrorMessage"].isNull()) errorMessage_ = value["ErrorMessage"].asString(); + if(!value["ProductKey"].isNull()) + productKey_ = value["ProductKey"].asString(); } -CreateProductResult::ProductInfo CreateProductResult::getProductInfo()const +CreateProductResult::Data CreateProductResult::getData()const { - return productInfo_; + return data_; } std::string CreateProductResult::getErrorMessage()const @@ -94,3 +88,8 @@ bool CreateProductResult::getSuccess()const return success_; } +std::string CreateProductResult::getProductKey()const +{ + return productKey_; +} + diff --git a/iot/src/model/CreateProductTopicRequest.cc b/iot/src/model/CreateProductTopicRequest.cc index fa765c797..5f352c518 100644 --- a/iot/src/model/CreateProductTopicRequest.cc +++ b/iot/src/model/CreateProductTopicRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::CreateProductTopicRequest; CreateProductTopicRequest::CreateProductTopicRequest() : - RpcServiceRequest("iot", "2017-04-20", "CreateProductTopic") + RpcServiceRequest("iot", "2018-01-20", "CreateProductTopic") {} CreateProductTopicRequest::~CreateProductTopicRequest() diff --git a/iot/src/model/CreateRuleActionRequest.cc b/iot/src/model/CreateRuleActionRequest.cc index e56ec3fbf..c389bb580 100644 --- a/iot/src/model/CreateRuleActionRequest.cc +++ b/iot/src/model/CreateRuleActionRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::CreateRuleActionRequest; CreateRuleActionRequest::CreateRuleActionRequest() : - RpcServiceRequest("iot", "2017-04-20", "CreateRuleAction") + RpcServiceRequest("iot", "2018-01-20", "CreateRuleAction") {} CreateRuleActionRequest::~CreateRuleActionRequest() diff --git a/iot/src/model/CreateRuleActionResult.cc b/iot/src/model/CreateRuleActionResult.cc index b3bf24077..883dad08e 100644 --- a/iot/src/model/CreateRuleActionResult.cc +++ b/iot/src/model/CreateRuleActionResult.cc @@ -40,10 +40,10 @@ void CreateRuleActionResult::parse(const std::string &payload) reader.parse(payload, value); setRequestId(value["RequestId"].asString()); - if(!value["Success"].isNull()) - success_ = value["Success"].asString() == "true"; if(!value["Code"].isNull()) code_ = value["Code"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; if(!value["ErrorMessage"].isNull()) errorMessage_ = value["ErrorMessage"].asString(); if(!value["ActionId"].isNull()) diff --git a/iot/src/model/CreateRuleRequest.cc b/iot/src/model/CreateRuleRequest.cc index 0dba2f524..761640399 100644 --- a/iot/src/model/CreateRuleRequest.cc +++ b/iot/src/model/CreateRuleRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::CreateRuleRequest; CreateRuleRequest::CreateRuleRequest() : - RpcServiceRequest("iot", "2017-04-20", "CreateRule") + RpcServiceRequest("iot", "2018-01-20", "CreateRule") {} CreateRuleRequest::~CreateRuleRequest() @@ -91,6 +91,17 @@ void CreateRuleRequest::setProductKey(const std::string& productKey) setParameter("ProductKey", productKey); } +int CreateRuleRequest::getTopicType()const +{ + return topicType_; +} + +void CreateRuleRequest::setTopicType(int topicType) +{ + topicType_ = topicType; + setParameter("TopicType", std::to_string(topicType)); +} + std::string CreateRuleRequest::getAccessKeyId()const { return accessKeyId_; diff --git a/iot/src/model/CreateTopicRouteTableRequest.cc b/iot/src/model/CreateTopicRouteTableRequest.cc index 746caff0d..3cf0a24aa 100644 --- a/iot/src/model/CreateTopicRouteTableRequest.cc +++ b/iot/src/model/CreateTopicRouteTableRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::CreateTopicRouteTableRequest; CreateTopicRouteTableRequest::CreateTopicRouteTableRequest() : - RpcServiceRequest("iot", "2017-04-20", "CreateTopicRouteTable") + RpcServiceRequest("iot", "2018-01-20", "CreateTopicRouteTable") {} CreateTopicRouteTableRequest::~CreateTopicRouteTableRequest() diff --git a/iot/src/model/DeleteDevicePropRequest.cc b/iot/src/model/DeleteDevicePropRequest.cc index c7a000fa1..ccac0640f 100644 --- a/iot/src/model/DeleteDevicePropRequest.cc +++ b/iot/src/model/DeleteDevicePropRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::DeleteDevicePropRequest; DeleteDevicePropRequest::DeleteDevicePropRequest() : - RpcServiceRequest("iot", "2017-04-20", "DeleteDeviceProp") + RpcServiceRequest("iot", "2018-01-20", "DeleteDeviceProp") {} DeleteDevicePropRequest::~DeleteDevicePropRequest() diff --git a/iot/src/model/QueryApplyStatusRequest.cc b/iot/src/model/DeleteProductRequest.cc similarity index 54% rename from iot/src/model/QueryApplyStatusRequest.cc rename to iot/src/model/DeleteProductRequest.cc index 17b50d7b6..507f121c2 100644 --- a/iot/src/model/QueryApplyStatusRequest.cc +++ b/iot/src/model/DeleteProductRequest.cc @@ -14,34 +14,34 @@ * limitations under the License. */ -#include +#include -using AlibabaCloud::Iot::Model::QueryApplyStatusRequest; +using AlibabaCloud::Iot::Model::DeleteProductRequest; -QueryApplyStatusRequest::QueryApplyStatusRequest() : - RpcServiceRequest("iot", "2017-04-20", "QueryApplyStatus") +DeleteProductRequest::DeleteProductRequest() : + RpcServiceRequest("iot", "2018-01-20", "DeleteProduct") {} -QueryApplyStatusRequest::~QueryApplyStatusRequest() +DeleteProductRequest::~DeleteProductRequest() {} -long QueryApplyStatusRequest::getApplyId()const +std::string DeleteProductRequest::getProductKey()const { - return applyId_; + return productKey_; } -void QueryApplyStatusRequest::setApplyId(long applyId) +void DeleteProductRequest::setProductKey(const std::string& productKey) { - applyId_ = applyId; - setParameter("ApplyId", std::to_string(applyId)); + productKey_ = productKey; + setParameter("ProductKey", productKey); } -std::string QueryApplyStatusRequest::getAccessKeyId()const +std::string DeleteProductRequest::getAccessKeyId()const { return accessKeyId_; } -void QueryApplyStatusRequest::setAccessKeyId(const std::string& accessKeyId) +void DeleteProductRequest::setAccessKeyId(const std::string& accessKeyId) { accessKeyId_ = accessKeyId; setParameter("AccessKeyId", accessKeyId); diff --git a/iot/src/model/QueryApplyStatusResult.cc b/iot/src/model/DeleteProductResult.cc similarity index 66% rename from iot/src/model/QueryApplyStatusResult.cc rename to iot/src/model/DeleteProductResult.cc index a7709c26d..4b6089298 100644 --- a/iot/src/model/QueryApplyStatusResult.cc +++ b/iot/src/model/DeleteProductResult.cc @@ -14,26 +14,26 @@ * limitations under the License. */ -#include +#include #include using namespace AlibabaCloud::Iot; using namespace AlibabaCloud::Iot::Model; -QueryApplyStatusResult::QueryApplyStatusResult() : +DeleteProductResult::DeleteProductResult() : ServiceResult() {} -QueryApplyStatusResult::QueryApplyStatusResult(const std::string &payload) : +DeleteProductResult::DeleteProductResult(const std::string &payload) : ServiceResult() { parse(payload); } -QueryApplyStatusResult::~QueryApplyStatusResult() +DeleteProductResult::~DeleteProductResult() {} -void QueryApplyStatusResult::parse(const std::string &payload) +void DeleteProductResult::parse(const std::string &payload) { Json::Reader reader; Json::Value value; @@ -46,27 +46,20 @@ void QueryApplyStatusResult::parse(const std::string &payload) code_ = value["Code"].asString(); if(!value["ErrorMessage"].isNull()) errorMessage_ = value["ErrorMessage"].asString(); - if(!value["Finish"].isNull()) - finish_ = value["Finish"].asString() == "true"; } -std::string QueryApplyStatusResult::getErrorMessage()const +std::string DeleteProductResult::getErrorMessage()const { return errorMessage_; } -std::string QueryApplyStatusResult::getCode()const +std::string DeleteProductResult::getCode()const { return code_; } -bool QueryApplyStatusResult::getFinish()const -{ - return finish_; -} - -bool QueryApplyStatusResult::getSuccess()const +bool DeleteProductResult::getSuccess()const { return success_; } diff --git a/iot/src/model/DeleteProductTopicRequest.cc b/iot/src/model/DeleteProductTopicRequest.cc index 9552129e7..d19a7c69a 100644 --- a/iot/src/model/DeleteProductTopicRequest.cc +++ b/iot/src/model/DeleteProductTopicRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::DeleteProductTopicRequest; DeleteProductTopicRequest::DeleteProductTopicRequest() : - RpcServiceRequest("iot", "2017-04-20", "DeleteProductTopic") + RpcServiceRequest("iot", "2018-01-20", "DeleteProductTopic") {} DeleteProductTopicRequest::~DeleteProductTopicRequest() diff --git a/iot/src/model/DeleteRuleActionRequest.cc b/iot/src/model/DeleteRuleActionRequest.cc index 081752119..d0f222c99 100644 --- a/iot/src/model/DeleteRuleActionRequest.cc +++ b/iot/src/model/DeleteRuleActionRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::DeleteRuleActionRequest; DeleteRuleActionRequest::DeleteRuleActionRequest() : - RpcServiceRequest("iot", "2017-04-20", "DeleteRuleAction") + RpcServiceRequest("iot", "2018-01-20", "DeleteRuleAction") {} DeleteRuleActionRequest::~DeleteRuleActionRequest() diff --git a/iot/src/model/DeleteRuleRequest.cc b/iot/src/model/DeleteRuleRequest.cc index 8572a15d7..4f8a8abf8 100644 --- a/iot/src/model/DeleteRuleRequest.cc +++ b/iot/src/model/DeleteRuleRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::DeleteRuleRequest; DeleteRuleRequest::DeleteRuleRequest() : - RpcServiceRequest("iot", "2017-04-20", "DeleteRule") + RpcServiceRequest("iot", "2018-01-20", "DeleteRule") {} DeleteRuleRequest::~DeleteRuleRequest() diff --git a/iot/src/model/DeleteTopicRouteTableRequest.cc b/iot/src/model/DeleteTopicRouteTableRequest.cc index 565a35e08..993352343 100644 --- a/iot/src/model/DeleteTopicRouteTableRequest.cc +++ b/iot/src/model/DeleteTopicRouteTableRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::DeleteTopicRouteTableRequest; DeleteTopicRouteTableRequest::DeleteTopicRouteTableRequest() : - RpcServiceRequest("iot", "2017-04-20", "DeleteTopicRouteTable") + RpcServiceRequest("iot", "2018-01-20", "DeleteTopicRouteTable") {} DeleteTopicRouteTableRequest::~DeleteTopicRouteTableRequest() diff --git a/iot/src/model/GetDeviceShadowRequest.cc b/iot/src/model/GetDeviceShadowRequest.cc index b6c9c9b16..3ed280fa8 100644 --- a/iot/src/model/GetDeviceShadowRequest.cc +++ b/iot/src/model/GetDeviceShadowRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::GetDeviceShadowRequest; GetDeviceShadowRequest::GetDeviceShadowRequest() : - RpcServiceRequest("iot", "2017-04-20", "GetDeviceShadow") + RpcServiceRequest("iot", "2018-01-20", "GetDeviceShadow") {} GetDeviceShadowRequest::~GetDeviceShadowRequest() diff --git a/iot/src/model/GetRuleActionRequest.cc b/iot/src/model/GetRuleActionRequest.cc index 159f673fd..7b0a61b03 100644 --- a/iot/src/model/GetRuleActionRequest.cc +++ b/iot/src/model/GetRuleActionRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::GetRuleActionRequest; GetRuleActionRequest::GetRuleActionRequest() : - RpcServiceRequest("iot", "2017-04-20", "GetRuleAction") + RpcServiceRequest("iot", "2018-01-20", "GetRuleAction") {} GetRuleActionRequest::~GetRuleActionRequest() diff --git a/iot/src/model/GetRuleRequest.cc b/iot/src/model/GetRuleRequest.cc index 287e39ded..1ed3bdcae 100644 --- a/iot/src/model/GetRuleRequest.cc +++ b/iot/src/model/GetRuleRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::GetRuleRequest; GetRuleRequest::GetRuleRequest() : - RpcServiceRequest("iot", "2017-04-20", "GetRule") + RpcServiceRequest("iot", "2018-01-20", "GetRule") {} GetRuleRequest::~GetRuleRequest() diff --git a/iot/src/model/GetRuleResult.cc b/iot/src/model/GetRuleResult.cc index af6f1b07d..0a67ddddc 100644 --- a/iot/src/model/GetRuleResult.cc +++ b/iot/src/model/GetRuleResult.cc @@ -61,12 +61,18 @@ void GetRuleResult::parse(const std::string &payload) ruleInfo_.name = ruleInfoNode["Name"].asString(); if(!ruleInfoNode["RuleDesc"].isNull()) ruleInfo_.ruleDesc = ruleInfoNode["RuleDesc"].asString(); - if(!ruleInfoNode["Created"].isNull()) - ruleInfo_.created = ruleInfoNode["Created"].asString(); if(!ruleInfoNode["DataType"].isNull()) ruleInfo_.dataType = ruleInfoNode["DataType"].asString(); + if(!ruleInfoNode["Created"].isNull()) + ruleInfo_.created = ruleInfoNode["Created"].asString(); + if(!ruleInfoNode["UtcCreated"].isNull()) + ruleInfo_.utcCreated = ruleInfoNode["UtcCreated"].asString(); if(!ruleInfoNode["Modified"].isNull()) ruleInfo_.modified = ruleInfoNode["Modified"].asString(); + if(!ruleInfoNode["UtcModified"].isNull()) + ruleInfo_.utcModified = ruleInfoNode["UtcModified"].asString(); + if(!ruleInfoNode["TopicType"].isNull()) + ruleInfo_.topicType = std::stoi(ruleInfoNode["TopicType"].asString()); if(!value["Success"].isNull()) success_ = value["Success"].asString() == "true"; if(!value["Code"].isNull()) diff --git a/iot/src/model/ListRuleActionsRequest.cc b/iot/src/model/ListRuleActionsRequest.cc index d1ab6c59d..0f9c74227 100644 --- a/iot/src/model/ListRuleActionsRequest.cc +++ b/iot/src/model/ListRuleActionsRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::ListRuleActionsRequest; ListRuleActionsRequest::ListRuleActionsRequest() : - RpcServiceRequest("iot", "2017-04-20", "ListRuleActions") + RpcServiceRequest("iot", "2018-01-20", "ListRuleActions") {} ListRuleActionsRequest::~ListRuleActionsRequest() diff --git a/iot/src/model/ListRuleRequest.cc b/iot/src/model/ListRuleRequest.cc index 6b2e2abe1..89cd106ff 100644 --- a/iot/src/model/ListRuleRequest.cc +++ b/iot/src/model/ListRuleRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::ListRuleRequest; ListRuleRequest::ListRuleRequest() : - RpcServiceRequest("iot", "2017-04-20", "ListRule") + RpcServiceRequest("iot", "2018-01-20", "ListRule") {} ListRuleRequest::~ListRuleRequest() diff --git a/iot/src/model/ListRuleResult.cc b/iot/src/model/ListRuleResult.cc index 53c50eb92..d998b87a2 100644 --- a/iot/src/model/ListRuleResult.cc +++ b/iot/src/model/ListRuleResult.cc @@ -68,8 +68,12 @@ void ListRuleResult::parse(const std::string &payload) dataObject.ruleDesc = value["RuleDesc"].asString(); if(!value["Created"].isNull()) dataObject.created = value["Created"].asString(); + if(!value["UtcCreated"].isNull()) + dataObject.utcCreated = value["UtcCreated"].asString(); if(!value["Modified"].isNull()) dataObject.modified = value["Modified"].asString(); + if(!value["UtcModified"].isNull()) + dataObject.utcModified = value["UtcModified"].asString(); data_.push_back(dataObject); } if(!value["Success"].isNull()) diff --git a/iot/src/model/PubBroadcastRequest.cc b/iot/src/model/PubBroadcastRequest.cc index 3003efe80..73fe1db6c 100644 --- a/iot/src/model/PubBroadcastRequest.cc +++ b/iot/src/model/PubBroadcastRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::PubBroadcastRequest; PubBroadcastRequest::PubBroadcastRequest() : - RpcServiceRequest("iot", "2017-04-20", "PubBroadcast") + RpcServiceRequest("iot", "2018-01-20", "PubBroadcast") {} PubBroadcastRequest::~PubBroadcastRequest() diff --git a/iot/src/model/PubRequest.cc b/iot/src/model/PubRequest.cc index dd959d15b..be2b6960c 100644 --- a/iot/src/model/PubRequest.cc +++ b/iot/src/model/PubRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::PubRequest; PubRequest::PubRequest() : - RpcServiceRequest("iot", "2017-04-20", "Pub") + RpcServiceRequest("iot", "2018-01-20", "Pub") {} PubRequest::~PubRequest() diff --git a/iot/src/model/QueryDeviceByNameRequest.cc b/iot/src/model/QueryDeviceByNameRequest.cc deleted file mode 100644 index f3e840e65..000000000 --- a/iot/src/model/QueryDeviceByNameRequest.cc +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2009-2017 Alibaba Cloud 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. - */ - -#include - -using AlibabaCloud::Iot::Model::QueryDeviceByNameRequest; - -QueryDeviceByNameRequest::QueryDeviceByNameRequest() : - RpcServiceRequest("iot", "2017-04-20", "QueryDeviceByName") -{} - -QueryDeviceByNameRequest::~QueryDeviceByNameRequest() -{} - -std::string QueryDeviceByNameRequest::getDeviceName()const -{ - return deviceName_; -} - -void QueryDeviceByNameRequest::setDeviceName(const std::string& deviceName) -{ - deviceName_ = deviceName; - setParameter("DeviceName", deviceName); -} - -std::string QueryDeviceByNameRequest::getProductKey()const -{ - return productKey_; -} - -void QueryDeviceByNameRequest::setProductKey(const std::string& productKey) -{ - productKey_ = productKey; - setParameter("ProductKey", productKey); -} - -std::string QueryDeviceByNameRequest::getAccessKeyId()const -{ - return accessKeyId_; -} - -void QueryDeviceByNameRequest::setAccessKeyId(const std::string& accessKeyId) -{ - accessKeyId_ = accessKeyId; - setParameter("AccessKeyId", accessKeyId); -} - diff --git a/iot/src/model/QueryDeviceByNameResult.cc b/iot/src/model/QueryDeviceByNameResult.cc deleted file mode 100644 index b1bb66f5b..000000000 --- a/iot/src/model/QueryDeviceByNameResult.cc +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2009-2017 Alibaba Cloud 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. - */ - -#include -#include - -using namespace AlibabaCloud::Iot; -using namespace AlibabaCloud::Iot::Model; - -QueryDeviceByNameResult::QueryDeviceByNameResult() : - ServiceResult() -{} - -QueryDeviceByNameResult::QueryDeviceByNameResult(const std::string &payload) : - ServiceResult() -{ - parse(payload); -} - -QueryDeviceByNameResult::~QueryDeviceByNameResult() -{} - -void QueryDeviceByNameResult::parse(const std::string &payload) -{ - Json::Reader reader; - Json::Value value; - reader.parse(payload, value); - - setRequestId(value["RequestId"].asString()); - auto deviceInfoNode = value["DeviceInfo"]; - if(!deviceInfoNode["DeviceId"].isNull()) - deviceInfo_.deviceId = deviceInfoNode["DeviceId"].asString(); - if(!deviceInfoNode["DeviceSecret"].isNull()) - deviceInfo_.deviceSecret = deviceInfoNode["DeviceSecret"].asString(); - if(!deviceInfoNode["ProductKey"].isNull()) - deviceInfo_.productKey = deviceInfoNode["ProductKey"].asString(); - if(!deviceInfoNode["DeviceStatus"].isNull()) - deviceInfo_.deviceStatus = deviceInfoNode["DeviceStatus"].asString(); - if(!deviceInfoNode["DeviceName"].isNull()) - deviceInfo_.deviceName = deviceInfoNode["DeviceName"].asString(); - if(!deviceInfoNode["DeviceType"].isNull()) - deviceInfo_.deviceType = deviceInfoNode["DeviceType"].asString(); - if(!deviceInfoNode["ClientIp"].isNull()) - deviceInfo_.clientIp = deviceInfoNode["ClientIp"].asString(); - if(!deviceInfoNode["GmtCreate"].isNull()) - deviceInfo_.gmtCreate = deviceInfoNode["GmtCreate"].asString(); - if(!deviceInfoNode["GmtModified"].isNull()) - deviceInfo_.gmtModified = deviceInfoNode["GmtModified"].asString(); - if(!value["Success"].isNull()) - success_ = value["Success"].asString() == "true"; - if(!value["Code"].isNull()) - code_ = value["Code"].asString(); - if(!value["ErrorMessage"].isNull()) - errorMessage_ = value["ErrorMessage"].asString(); - -} - -QueryDeviceByNameResult::DeviceInfo QueryDeviceByNameResult::getDeviceInfo()const -{ - return deviceInfo_; -} - -std::string QueryDeviceByNameResult::getErrorMessage()const -{ - return errorMessage_; -} - -std::string QueryDeviceByNameResult::getCode()const -{ - return code_; -} - -bool QueryDeviceByNameResult::getSuccess()const -{ - return success_; -} - diff --git a/iot/src/model/QueryDevicePropRequest.cc b/iot/src/model/QueryDevicePropRequest.cc index 80aa13fc5..b8533ae3f 100644 --- a/iot/src/model/QueryDevicePropRequest.cc +++ b/iot/src/model/QueryDevicePropRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::QueryDevicePropRequest; QueryDevicePropRequest::QueryDevicePropRequest() : - RpcServiceRequest("iot", "2017-04-20", "QueryDeviceProp") + RpcServiceRequest("iot", "2018-01-20", "QueryDeviceProp") {} QueryDevicePropRequest::~QueryDevicePropRequest() diff --git a/iot/src/model/QueryDeviceRequest.cc b/iot/src/model/QueryDeviceRequest.cc index 08506269c..9203bb8b3 100644 --- a/iot/src/model/QueryDeviceRequest.cc +++ b/iot/src/model/QueryDeviceRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::QueryDeviceRequest; QueryDeviceRequest::QueryDeviceRequest() : - RpcServiceRequest("iot", "2017-04-20", "QueryDevice") + RpcServiceRequest("iot", "2018-01-20", "QueryDevice") {} QueryDeviceRequest::~QueryDeviceRequest() diff --git a/iot/src/model/QueryPageByApplyIdRequest.cc b/iot/src/model/QueryPageByApplyIdRequest.cc index 99dffdecb..a557fbdd8 100644 --- a/iot/src/model/QueryPageByApplyIdRequest.cc +++ b/iot/src/model/QueryPageByApplyIdRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::QueryPageByApplyIdRequest; QueryPageByApplyIdRequest::QueryPageByApplyIdRequest() : - RpcServiceRequest("iot", "2017-04-20", "QueryPageByApplyId") + RpcServiceRequest("iot", "2018-01-20", "QueryPageByApplyId") {} QueryPageByApplyIdRequest::~QueryPageByApplyIdRequest() diff --git a/iot/src/model/QueryProductResult.cc b/iot/src/model/QueryProductResult.cc index ead51fd6f..799dd13e0 100644 --- a/iot/src/model/QueryProductResult.cc +++ b/iot/src/model/QueryProductResult.cc @@ -65,6 +65,8 @@ void QueryProductResult::parse(const std::string &payload) data_.aliyunCommodityCode = dataNode["AliyunCommodityCode"].asString(); if(!dataNode["Id2"].isNull()) data_.id2 = dataNode["Id2"].asString() == "true"; + if(!dataNode["ProtocolType"].isNull()) + data_.protocolType = dataNode["ProtocolType"].asString(); if(!value["Success"].isNull()) success_ = value["Success"].asString() == "true"; if(!value["Code"].isNull()) diff --git a/iot/src/model/QueryProductTopicRequest.cc b/iot/src/model/QueryProductTopicRequest.cc index eed09915a..af41e532d 100644 --- a/iot/src/model/QueryProductTopicRequest.cc +++ b/iot/src/model/QueryProductTopicRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::QueryProductTopicRequest; QueryProductTopicRequest::QueryProductTopicRequest() : - RpcServiceRequest("iot", "2017-04-20", "QueryProductTopic") + RpcServiceRequest("iot", "2018-01-20", "QueryProductTopic") {} QueryProductTopicRequest::~QueryProductTopicRequest() diff --git a/iot/src/model/QueryTopicReverseRouteTableRequest.cc b/iot/src/model/QueryTopicReverseRouteTableRequest.cc index 07cce39cb..daf2b998d 100644 --- a/iot/src/model/QueryTopicReverseRouteTableRequest.cc +++ b/iot/src/model/QueryTopicReverseRouteTableRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::QueryTopicReverseRouteTableRequest; QueryTopicReverseRouteTableRequest::QueryTopicReverseRouteTableRequest() : - RpcServiceRequest("iot", "2017-04-20", "QueryTopicReverseRouteTable") + RpcServiceRequest("iot", "2018-01-20", "QueryTopicReverseRouteTable") {} QueryTopicReverseRouteTableRequest::~QueryTopicReverseRouteTableRequest() diff --git a/iot/src/model/QueryTopicRouteTableRequest.cc b/iot/src/model/QueryTopicRouteTableRequest.cc index aa62ffada..8dfb3521d 100644 --- a/iot/src/model/QueryTopicRouteTableRequest.cc +++ b/iot/src/model/QueryTopicRouteTableRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::QueryTopicRouteTableRequest; QueryTopicRouteTableRequest::QueryTopicRouteTableRequest() : - RpcServiceRequest("iot", "2017-04-20", "QueryTopicRouteTable") + RpcServiceRequest("iot", "2018-01-20", "QueryTopicRouteTable") {} QueryTopicRouteTableRequest::~QueryTopicRouteTableRequest() diff --git a/iot/src/model/RRpcRequest.cc b/iot/src/model/RRpcRequest.cc index 8e4ee2392..3ef880aa9 100644 --- a/iot/src/model/RRpcRequest.cc +++ b/iot/src/model/RRpcRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::RRpcRequest; RRpcRequest::RRpcRequest() : - RpcServiceRequest("iot", "2017-04-20", "RRpc") + RpcServiceRequest("iot", "2018-01-20", "RRpc") {} RRpcRequest::~RRpcRequest() @@ -36,6 +36,17 @@ void RRpcRequest::setRequestBase64Byte(const std::string& requestBase64Byte) setParameter("RequestBase64Byte", requestBase64Byte); } +std::string RRpcRequest::getTopic()const +{ + return topic_; +} + +void RRpcRequest::setTopic(const std::string& topic) +{ + topic_ = topic; + setParameter("Topic", topic); +} + std::string RRpcRequest::getDeviceName()const { return deviceName_; diff --git a/iot/src/model/RegistDeviceRequest.cc b/iot/src/model/RegistDeviceRequest.cc deleted file mode 100644 index 5324c8803..000000000 --- a/iot/src/model/RegistDeviceRequest.cc +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2009-2017 Alibaba Cloud 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. - */ - -#include - -using AlibabaCloud::Iot::Model::RegistDeviceRequest; - -RegistDeviceRequest::RegistDeviceRequest() : - RpcServiceRequest("iot", "2017-04-20", "RegistDevice") -{} - -RegistDeviceRequest::~RegistDeviceRequest() -{} - -std::string RegistDeviceRequest::getDeviceName()const -{ - return deviceName_; -} - -void RegistDeviceRequest::setDeviceName(const std::string& deviceName) -{ - deviceName_ = deviceName; - setParameter("DeviceName", deviceName); -} - -std::string RegistDeviceRequest::getProductKey()const -{ - return productKey_; -} - -void RegistDeviceRequest::setProductKey(const std::string& productKey) -{ - productKey_ = productKey; - setParameter("ProductKey", productKey); -} - -std::string RegistDeviceRequest::getAccessKeyId()const -{ - return accessKeyId_; -} - -void RegistDeviceRequest::setAccessKeyId(const std::string& accessKeyId) -{ - accessKeyId_ = accessKeyId; - setParameter("AccessKeyId", accessKeyId); -} - diff --git a/iot/src/model/RegistDeviceResult.cc b/iot/src/model/RegistDeviceResult.cc deleted file mode 100644 index 1c2fc7edd..000000000 --- a/iot/src/model/RegistDeviceResult.cc +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2009-2017 Alibaba Cloud 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. - */ - -#include -#include - -using namespace AlibabaCloud::Iot; -using namespace AlibabaCloud::Iot::Model; - -RegistDeviceResult::RegistDeviceResult() : - ServiceResult() -{} - -RegistDeviceResult::RegistDeviceResult(const std::string &payload) : - ServiceResult() -{ - parse(payload); -} - -RegistDeviceResult::~RegistDeviceResult() -{} - -void RegistDeviceResult::parse(const std::string &payload) -{ - Json::Reader reader; - Json::Value value; - reader.parse(payload, value); - - setRequestId(value["RequestId"].asString()); - if(!value["Success"].isNull()) - success_ = value["Success"].asString() == "true"; - if(!value["Code"].isNull()) - code_ = value["Code"].asString(); - if(!value["ErrorMessage"].isNull()) - errorMessage_ = value["ErrorMessage"].asString(); - if(!value["DeviceId"].isNull()) - deviceId_ = value["DeviceId"].asString(); - if(!value["DeviceSecret"].isNull()) - deviceSecret_ = value["DeviceSecret"].asString(); - if(!value["DeviceStatus"].isNull()) - deviceStatus_ = value["DeviceStatus"].asString(); - if(!value["DeviceName"].isNull()) - deviceName_ = value["DeviceName"].asString(); - -} - -std::string RegistDeviceResult::getDeviceId()const -{ - return deviceId_; -} - -std::string RegistDeviceResult::getDeviceSecret()const -{ - return deviceSecret_; -} - -std::string RegistDeviceResult::getDeviceStatus()const -{ - return deviceStatus_; -} - -std::string RegistDeviceResult::getErrorMessage()const -{ - return errorMessage_; -} - -std::string RegistDeviceResult::getCode()const -{ - return code_; -} - -bool RegistDeviceResult::getSuccess()const -{ - return success_; -} - -std::string RegistDeviceResult::getDeviceName()const -{ - return deviceName_; -} - diff --git a/iot/src/model/SaveDevicePropRequest.cc b/iot/src/model/SaveDevicePropRequest.cc index a9c77e3c9..9af2a31d1 100644 --- a/iot/src/model/SaveDevicePropRequest.cc +++ b/iot/src/model/SaveDevicePropRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::SaveDevicePropRequest; SaveDevicePropRequest::SaveDevicePropRequest() : - RpcServiceRequest("iot", "2017-04-20", "SaveDeviceProp") + RpcServiceRequest("iot", "2018-01-20", "SaveDeviceProp") {} SaveDevicePropRequest::~SaveDevicePropRequest() diff --git a/iot/src/model/StartRuleRequest.cc b/iot/src/model/StartRuleRequest.cc index 4d3539000..c2b3375f8 100644 --- a/iot/src/model/StartRuleRequest.cc +++ b/iot/src/model/StartRuleRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::StartRuleRequest; StartRuleRequest::StartRuleRequest() : - RpcServiceRequest("iot", "2017-04-20", "StartRule") + RpcServiceRequest("iot", "2018-01-20", "StartRule") {} StartRuleRequest::~StartRuleRequest() diff --git a/iot/src/model/StopRuleRequest.cc b/iot/src/model/StopRuleRequest.cc index 792f713a2..3d3eb35dd 100644 --- a/iot/src/model/StopRuleRequest.cc +++ b/iot/src/model/StopRuleRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::StopRuleRequest; StopRuleRequest::StopRuleRequest() : - RpcServiceRequest("iot", "2017-04-20", "StopRule") + RpcServiceRequest("iot", "2018-01-20", "StopRule") {} StopRuleRequest::~StopRuleRequest() diff --git a/iot/src/model/UpdateDeviceShadowRequest.cc b/iot/src/model/UpdateDeviceShadowRequest.cc index 67a0ec6a3..1e53d018c 100644 --- a/iot/src/model/UpdateDeviceShadowRequest.cc +++ b/iot/src/model/UpdateDeviceShadowRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::UpdateDeviceShadowRequest; UpdateDeviceShadowRequest::UpdateDeviceShadowRequest() : - RpcServiceRequest("iot", "2017-04-20", "UpdateDeviceShadow") + RpcServiceRequest("iot", "2018-01-20", "UpdateDeviceShadow") {} UpdateDeviceShadowRequest::~UpdateDeviceShadowRequest() diff --git a/iot/src/model/UpdateProductRequest.cc b/iot/src/model/UpdateProductRequest.cc index 6af2d9ea5..014e3ad5b 100644 --- a/iot/src/model/UpdateProductRequest.cc +++ b/iot/src/model/UpdateProductRequest.cc @@ -19,34 +19,12 @@ using AlibabaCloud::Iot::Model::UpdateProductRequest; UpdateProductRequest::UpdateProductRequest() : - RpcServiceRequest("iot", "2017-04-20", "UpdateProduct") + RpcServiceRequest("iot", "2018-01-20", "UpdateProduct") {} UpdateProductRequest::~UpdateProductRequest() {} -long UpdateProductRequest::getCatId()const -{ - return catId_; -} - -void UpdateProductRequest::setCatId(long catId) -{ - catId_ = catId; - setParameter("CatId", std::to_string(catId)); -} - -int UpdateProductRequest::getNodeType()const -{ - return nodeType_; -} - -void UpdateProductRequest::setNodeType(int nodeType) -{ - nodeType_ = nodeType; - setParameter("NodeType", std::to_string(nodeType)); -} - std::string UpdateProductRequest::getProductName()const { return productName_; @@ -58,15 +36,15 @@ void UpdateProductRequest::setProductName(const std::string& productName) setParameter("ProductName", productName); } -std::string UpdateProductRequest::getExtProps()const +std::string UpdateProductRequest::getDescription()const { - return extProps_; + return description_; } -void UpdateProductRequest::setExtProps(const std::string& extProps) +void UpdateProductRequest::setDescription(const std::string& description) { - extProps_ = extProps; - setParameter("ExtProps", extProps); + description_ = description; + setParameter("Description", description); } std::string UpdateProductRequest::getProductKey()const @@ -80,17 +58,6 @@ void UpdateProductRequest::setProductKey(const std::string& productKey) setParameter("ProductKey", productKey); } -std::string UpdateProductRequest::getProductDesc()const -{ - return productDesc_; -} - -void UpdateProductRequest::setProductDesc(const std::string& productDesc) -{ - productDesc_ = productDesc; - setParameter("ProductDesc", productDesc); -} - std::string UpdateProductRequest::getAccessKeyId()const { return accessKeyId_; diff --git a/iot/src/model/UpdateProductTopicRequest.cc b/iot/src/model/UpdateProductTopicRequest.cc index e1dd8415f..9e27388a4 100644 --- a/iot/src/model/UpdateProductTopicRequest.cc +++ b/iot/src/model/UpdateProductTopicRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::UpdateProductTopicRequest; UpdateProductTopicRequest::UpdateProductTopicRequest() : - RpcServiceRequest("iot", "2017-04-20", "UpdateProductTopic") + RpcServiceRequest("iot", "2018-01-20", "UpdateProductTopic") {} UpdateProductTopicRequest::~UpdateProductTopicRequest() diff --git a/iot/src/model/UpdateRuleActionRequest.cc b/iot/src/model/UpdateRuleActionRequest.cc index fe2a23876..3cccc622b 100644 --- a/iot/src/model/UpdateRuleActionRequest.cc +++ b/iot/src/model/UpdateRuleActionRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::UpdateRuleActionRequest; UpdateRuleActionRequest::UpdateRuleActionRequest() : - RpcServiceRequest("iot", "2017-04-20", "UpdateRuleAction") + RpcServiceRequest("iot", "2018-01-20", "UpdateRuleAction") {} UpdateRuleActionRequest::~UpdateRuleActionRequest() diff --git a/iot/src/model/UpdateRuleActionResult.cc b/iot/src/model/UpdateRuleActionResult.cc index 71caf659f..8479f9006 100644 --- a/iot/src/model/UpdateRuleActionResult.cc +++ b/iot/src/model/UpdateRuleActionResult.cc @@ -40,10 +40,10 @@ void UpdateRuleActionResult::parse(const std::string &payload) reader.parse(payload, value); setRequestId(value["RequestId"].asString()); - if(!value["Success"].isNull()) - success_ = value["Success"].asString() == "true"; if(!value["Code"].isNull()) code_ = value["Code"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; if(!value["ErrorMessage"].isNull()) errorMessage_ = value["ErrorMessage"].asString(); diff --git a/iot/src/model/UpdateRuleRequest.cc b/iot/src/model/UpdateRuleRequest.cc index 65d474aec..543a8e5ec 100644 --- a/iot/src/model/UpdateRuleRequest.cc +++ b/iot/src/model/UpdateRuleRequest.cc @@ -19,7 +19,7 @@ using AlibabaCloud::Iot::Model::UpdateRuleRequest; UpdateRuleRequest::UpdateRuleRequest() : - RpcServiceRequest("iot", "2017-04-20", "UpdateRule") + RpcServiceRequest("iot", "2018-01-20", "UpdateRule") {} UpdateRuleRequest::~UpdateRuleRequest() @@ -91,6 +91,17 @@ void UpdateRuleRequest::setProductKey(const std::string& productKey) setParameter("ProductKey", productKey); } +int UpdateRuleRequest::getTopicType()const +{ + return topicType_; +} + +void UpdateRuleRequest::setTopicType(int topicType) +{ + topicType_ = topicType; + setParameter("TopicType", std::to_string(topicType)); +} + std::string UpdateRuleRequest::getAccessKeyId()const { return accessKeyId_;