From 893339c43df6f38434037bec529bba604c528830 Mon Sep 17 00:00:00 2001 From: "yixiong.jxy" Date: Tue, 27 Nov 2018 15:00:25 +0800 Subject: [PATCH] =?UTF-8?q?IOT=20SDK=20Auto=20Released=20By=20cheyun.lxf,V?= =?UTF-8?q?ersion=EF=BC=9A1.33.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yixiong.jxy --- CHANGELOG | 3 + VERSION | 2 +- iot/CMakeLists.txt | 16 ++ iot/include/alibabacloud/iot/IotClient.h | 32 ++++ .../iot/model/CreateProductRequest.h | 3 + .../iot/model/CreateRuleActionRequest.h | 3 + .../iot/model/GetRuleActionResult.h | 1 + .../iot/model/InvokeThingsServiceRequest.h | 60 ++++++++ .../iot/model/InvokeThingsServiceResult.h | 55 +++++++ .../iot/model/ListRuleActionsResult.h | 1 + .../iot/model/QueryDeviceByTagsRequest.h | 62 ++++++++ .../iot/model/QueryDeviceByTagsResult.h | 72 +++++++++ .../iot/model/SetDeviceGroupTagsRequest.h | 54 +++++++ .../iot/model/SetDeviceGroupTagsResult.h | 55 +++++++ .../iot/model/SetDevicesPropertyRequest.h | 57 +++++++ .../iot/model/SetDevicesPropertyResult.h | 55 +++++++ iot/src/IotClient.cc | 144 ++++++++++++++++++ iot/src/model/CreateProductRequest.cc | 11 ++ iot/src/model/CreateRuleActionRequest.cc | 11 ++ iot/src/model/GetRuleActionResult.cc | 2 + iot/src/model/InvokeThingsServiceRequest.cc | 83 ++++++++++ iot/src/model/InvokeThingsServiceResult.cc | 66 ++++++++ iot/src/model/ListRuleActionsResult.cc | 2 + iot/src/model/QueryDeviceByTagsRequest.cc | 77 ++++++++++ iot/src/model/QueryDeviceByTagsResult.cc | 113 ++++++++++++++ iot/src/model/SetDeviceGroupTagsRequest.cc | 60 ++++++++ iot/src/model/SetDeviceGroupTagsResult.cc | 66 ++++++++ iot/src/model/SetDevicesPropertyRequest.cc | 72 +++++++++ iot/src/model/SetDevicesPropertyResult.cc | 66 ++++++++ 29 files changed, 1303 insertions(+), 1 deletion(-) create mode 100644 iot/include/alibabacloud/iot/model/InvokeThingsServiceRequest.h create mode 100644 iot/include/alibabacloud/iot/model/InvokeThingsServiceResult.h create mode 100644 iot/include/alibabacloud/iot/model/QueryDeviceByTagsRequest.h create mode 100644 iot/include/alibabacloud/iot/model/QueryDeviceByTagsResult.h create mode 100644 iot/include/alibabacloud/iot/model/SetDeviceGroupTagsRequest.h create mode 100644 iot/include/alibabacloud/iot/model/SetDeviceGroupTagsResult.h create mode 100644 iot/include/alibabacloud/iot/model/SetDevicesPropertyRequest.h create mode 100644 iot/include/alibabacloud/iot/model/SetDevicesPropertyResult.h create mode 100644 iot/src/model/InvokeThingsServiceRequest.cc create mode 100644 iot/src/model/InvokeThingsServiceResult.cc create mode 100644 iot/src/model/QueryDeviceByTagsRequest.cc create mode 100644 iot/src/model/QueryDeviceByTagsResult.cc create mode 100644 iot/src/model/SetDeviceGroupTagsRequest.cc create mode 100644 iot/src/model/SetDeviceGroupTagsResult.cc create mode 100644 iot/src/model/SetDevicesPropertyRequest.cc create mode 100644 iot/src/model/SetDevicesPropertyResult.cc diff --git a/CHANGELOG b/CHANGELOG index 3de02dafa..3b2a275b4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2018-11-27 Version: 1.33.5 +1, Add APIs InvokeThingsService, SetDevicesProperty and QueryDeviceByTags . + 2018-11-22 Version: 1.33.4 1, Increase the scene field diff --git a/VERSION b/VERSION index 0a7d9bc23..676784cf0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.33.4 \ No newline at end of file +1.33.5 \ No newline at end of file diff --git a/iot/CMakeLists.txt b/iot/CMakeLists.txt index 7db13e09f..419b31c53 100644 --- a/iot/CMakeLists.txt +++ b/iot/CMakeLists.txt @@ -27,8 +27,12 @@ set(iot_public_header_model include/alibabacloud/iot/model/DeleteTopicRouteTableResult.h include/alibabacloud/iot/model/QueryDeviceGroupListRequest.h include/alibabacloud/iot/model/QueryDeviceGroupListResult.h + include/alibabacloud/iot/model/SetDeviceGroupTagsRequest.h + include/alibabacloud/iot/model/SetDeviceGroupTagsResult.h include/alibabacloud/iot/model/QueryDeviceEventDataRequest.h include/alibabacloud/iot/model/QueryDeviceEventDataResult.h + include/alibabacloud/iot/model/QueryDeviceByTagsRequest.h + include/alibabacloud/iot/model/QueryDeviceByTagsResult.h include/alibabacloud/iot/model/GetDeviceStatusRequest.h include/alibabacloud/iot/model/GetDeviceStatusResult.h include/alibabacloud/iot/model/DeleteDeviceRequest.h @@ -97,6 +101,8 @@ set(iot_public_header_model include/alibabacloud/iot/model/QueryDeviceResult.h include/alibabacloud/iot/model/BatchDeleteDeviceGroupRelationsRequest.h include/alibabacloud/iot/model/BatchDeleteDeviceGroupRelationsResult.h + include/alibabacloud/iot/model/InvokeThingsServiceRequest.h + include/alibabacloud/iot/model/InvokeThingsServiceResult.h include/alibabacloud/iot/model/QueryDeviceGroupTagListRequest.h include/alibabacloud/iot/model/QueryDeviceGroupTagListResult.h include/alibabacloud/iot/model/ListRuleRequest.h @@ -143,6 +149,8 @@ set(iot_public_header_model include/alibabacloud/iot/model/GetRuleResult.h include/alibabacloud/iot/model/GetDeviceShadowRequest.h include/alibabacloud/iot/model/GetDeviceShadowResult.h + include/alibabacloud/iot/model/SetDevicesPropertyRequest.h + include/alibabacloud/iot/model/SetDevicesPropertyResult.h include/alibabacloud/iot/model/GetGatewayBySubDeviceRequest.h include/alibabacloud/iot/model/GetGatewayBySubDeviceResult.h include/alibabacloud/iot/model/CreateRuleActionRequest.h @@ -164,8 +172,12 @@ set(iot_src src/model/DeleteTopicRouteTableResult.cc src/model/QueryDeviceGroupListRequest.cc src/model/QueryDeviceGroupListResult.cc + src/model/SetDeviceGroupTagsRequest.cc + src/model/SetDeviceGroupTagsResult.cc src/model/QueryDeviceEventDataRequest.cc src/model/QueryDeviceEventDataResult.cc + src/model/QueryDeviceByTagsRequest.cc + src/model/QueryDeviceByTagsResult.cc src/model/GetDeviceStatusRequest.cc src/model/GetDeviceStatusResult.cc src/model/DeleteDeviceRequest.cc @@ -234,6 +246,8 @@ set(iot_src src/model/QueryDeviceResult.cc src/model/BatchDeleteDeviceGroupRelationsRequest.cc src/model/BatchDeleteDeviceGroupRelationsResult.cc + src/model/InvokeThingsServiceRequest.cc + src/model/InvokeThingsServiceResult.cc src/model/QueryDeviceGroupTagListRequest.cc src/model/QueryDeviceGroupTagListResult.cc src/model/ListRuleRequest.cc @@ -280,6 +294,8 @@ set(iot_src src/model/GetRuleResult.cc src/model/GetDeviceShadowRequest.cc src/model/GetDeviceShadowResult.cc + src/model/SetDevicesPropertyRequest.cc + src/model/SetDevicesPropertyResult.cc src/model/GetGatewayBySubDeviceRequest.cc src/model/GetGatewayBySubDeviceResult.cc src/model/CreateRuleActionRequest.cc diff --git a/iot/include/alibabacloud/iot/IotClient.h b/iot/include/alibabacloud/iot/IotClient.h index 830de2cea..646c32acc 100644 --- a/iot/include/alibabacloud/iot/IotClient.h +++ b/iot/include/alibabacloud/iot/IotClient.h @@ -28,8 +28,12 @@ #include "model/DeleteTopicRouteTableResult.h" #include "model/QueryDeviceGroupListRequest.h" #include "model/QueryDeviceGroupListResult.h" +#include "model/SetDeviceGroupTagsRequest.h" +#include "model/SetDeviceGroupTagsResult.h" #include "model/QueryDeviceEventDataRequest.h" #include "model/QueryDeviceEventDataResult.h" +#include "model/QueryDeviceByTagsRequest.h" +#include "model/QueryDeviceByTagsResult.h" #include "model/GetDeviceStatusRequest.h" #include "model/GetDeviceStatusResult.h" #include "model/DeleteDeviceRequest.h" @@ -98,6 +102,8 @@ #include "model/QueryDeviceResult.h" #include "model/BatchDeleteDeviceGroupRelationsRequest.h" #include "model/BatchDeleteDeviceGroupRelationsResult.h" +#include "model/InvokeThingsServiceRequest.h" +#include "model/InvokeThingsServiceResult.h" #include "model/QueryDeviceGroupTagListRequest.h" #include "model/QueryDeviceGroupTagListResult.h" #include "model/ListRuleRequest.h" @@ -144,6 +150,8 @@ #include "model/GetRuleResult.h" #include "model/GetDeviceShadowRequest.h" #include "model/GetDeviceShadowResult.h" +#include "model/SetDevicesPropertyRequest.h" +#include "model/SetDevicesPropertyResult.h" #include "model/GetGatewayBySubDeviceRequest.h" #include "model/GetGatewayBySubDeviceResult.h" #include "model/CreateRuleActionRequest.h" @@ -174,9 +182,15 @@ namespace AlibabaCloud typedef Outcome QueryDeviceGroupListOutcome; typedef std::future QueryDeviceGroupListOutcomeCallable; typedef std::function&)> QueryDeviceGroupListAsyncHandler; + typedef Outcome SetDeviceGroupTagsOutcome; + typedef std::future SetDeviceGroupTagsOutcomeCallable; + typedef std::function&)> SetDeviceGroupTagsAsyncHandler; typedef Outcome QueryDeviceEventDataOutcome; typedef std::future QueryDeviceEventDataOutcomeCallable; typedef std::function&)> QueryDeviceEventDataAsyncHandler; + typedef Outcome QueryDeviceByTagsOutcome; + typedef std::future QueryDeviceByTagsOutcomeCallable; + typedef std::function&)> QueryDeviceByTagsAsyncHandler; typedef Outcome GetDeviceStatusOutcome; typedef std::future GetDeviceStatusOutcomeCallable; typedef std::function&)> GetDeviceStatusAsyncHandler; @@ -279,6 +293,9 @@ namespace AlibabaCloud typedef Outcome BatchDeleteDeviceGroupRelationsOutcome; typedef std::future BatchDeleteDeviceGroupRelationsOutcomeCallable; typedef std::function&)> BatchDeleteDeviceGroupRelationsAsyncHandler; + typedef Outcome InvokeThingsServiceOutcome; + typedef std::future InvokeThingsServiceOutcomeCallable; + typedef std::function&)> InvokeThingsServiceAsyncHandler; typedef Outcome QueryDeviceGroupTagListOutcome; typedef std::future QueryDeviceGroupTagListOutcomeCallable; typedef std::function&)> QueryDeviceGroupTagListAsyncHandler; @@ -348,6 +365,9 @@ namespace AlibabaCloud typedef Outcome GetDeviceShadowOutcome; typedef std::future GetDeviceShadowOutcomeCallable; typedef std::function&)> GetDeviceShadowAsyncHandler; + typedef Outcome SetDevicesPropertyOutcome; + typedef std::future SetDevicesPropertyOutcomeCallable; + typedef std::function&)> SetDevicesPropertyAsyncHandler; typedef Outcome GetGatewayBySubDeviceOutcome; typedef std::future GetGatewayBySubDeviceOutcomeCallable; typedef std::function&)> GetGatewayBySubDeviceAsyncHandler; @@ -380,9 +400,15 @@ namespace AlibabaCloud QueryDeviceGroupListOutcome queryDeviceGroupList(const Model::QueryDeviceGroupListRequest &request)const; void queryDeviceGroupListAsync(const Model::QueryDeviceGroupListRequest& request, const QueryDeviceGroupListAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; QueryDeviceGroupListOutcomeCallable queryDeviceGroupListCallable(const Model::QueryDeviceGroupListRequest& request) const; + SetDeviceGroupTagsOutcome setDeviceGroupTags(const Model::SetDeviceGroupTagsRequest &request)const; + void setDeviceGroupTagsAsync(const Model::SetDeviceGroupTagsRequest& request, const SetDeviceGroupTagsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + SetDeviceGroupTagsOutcomeCallable setDeviceGroupTagsCallable(const Model::SetDeviceGroupTagsRequest& request) const; QueryDeviceEventDataOutcome queryDeviceEventData(const Model::QueryDeviceEventDataRequest &request)const; void queryDeviceEventDataAsync(const Model::QueryDeviceEventDataRequest& request, const QueryDeviceEventDataAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; QueryDeviceEventDataOutcomeCallable queryDeviceEventDataCallable(const Model::QueryDeviceEventDataRequest& request) const; + QueryDeviceByTagsOutcome queryDeviceByTags(const Model::QueryDeviceByTagsRequest &request)const; + void queryDeviceByTagsAsync(const Model::QueryDeviceByTagsRequest& request, const QueryDeviceByTagsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + QueryDeviceByTagsOutcomeCallable queryDeviceByTagsCallable(const Model::QueryDeviceByTagsRequest& request) const; GetDeviceStatusOutcome getDeviceStatus(const Model::GetDeviceStatusRequest &request)const; void getDeviceStatusAsync(const Model::GetDeviceStatusRequest& request, const GetDeviceStatusAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetDeviceStatusOutcomeCallable getDeviceStatusCallable(const Model::GetDeviceStatusRequest& request) const; @@ -485,6 +511,9 @@ namespace AlibabaCloud BatchDeleteDeviceGroupRelationsOutcome batchDeleteDeviceGroupRelations(const Model::BatchDeleteDeviceGroupRelationsRequest &request)const; void batchDeleteDeviceGroupRelationsAsync(const Model::BatchDeleteDeviceGroupRelationsRequest& request, const BatchDeleteDeviceGroupRelationsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; BatchDeleteDeviceGroupRelationsOutcomeCallable batchDeleteDeviceGroupRelationsCallable(const Model::BatchDeleteDeviceGroupRelationsRequest& request) const; + InvokeThingsServiceOutcome invokeThingsService(const Model::InvokeThingsServiceRequest &request)const; + void invokeThingsServiceAsync(const Model::InvokeThingsServiceRequest& request, const InvokeThingsServiceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + InvokeThingsServiceOutcomeCallable invokeThingsServiceCallable(const Model::InvokeThingsServiceRequest& request) const; QueryDeviceGroupTagListOutcome queryDeviceGroupTagList(const Model::QueryDeviceGroupTagListRequest &request)const; void queryDeviceGroupTagListAsync(const Model::QueryDeviceGroupTagListRequest& request, const QueryDeviceGroupTagListAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; QueryDeviceGroupTagListOutcomeCallable queryDeviceGroupTagListCallable(const Model::QueryDeviceGroupTagListRequest& request) const; @@ -554,6 +583,9 @@ namespace AlibabaCloud GetDeviceShadowOutcome getDeviceShadow(const Model::GetDeviceShadowRequest &request)const; void getDeviceShadowAsync(const Model::GetDeviceShadowRequest& request, const GetDeviceShadowAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetDeviceShadowOutcomeCallable getDeviceShadowCallable(const Model::GetDeviceShadowRequest& request) const; + SetDevicesPropertyOutcome setDevicesProperty(const Model::SetDevicesPropertyRequest &request)const; + void setDevicesPropertyAsync(const Model::SetDevicesPropertyRequest& request, const SetDevicesPropertyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + SetDevicesPropertyOutcomeCallable setDevicesPropertyCallable(const Model::SetDevicesPropertyRequest& request) const; GetGatewayBySubDeviceOutcome getGatewayBySubDevice(const Model::GetGatewayBySubDeviceRequest &request)const; void getGatewayBySubDeviceAsync(const Model::GetGatewayBySubDeviceRequest& request, const GetGatewayBySubDeviceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetGatewayBySubDeviceOutcomeCallable getGatewayBySubDeviceCallable(const Model::GetGatewayBySubDeviceRequest& request) const; diff --git a/iot/include/alibabacloud/iot/model/CreateProductRequest.h b/iot/include/alibabacloud/iot/model/CreateProductRequest.h index 03c9b43a3..05b1c93c9 100644 --- a/iot/include/alibabacloud/iot/model/CreateProductRequest.h +++ b/iot/include/alibabacloud/iot/model/CreateProductRequest.h @@ -41,6 +41,8 @@ namespace AlibabaCloud void setNodeType(int nodeType); bool getId2()const; void setId2(bool id2); + std::string getNetType()const; + void setNetType(const std::string& netType); std::string getProductName()const; void setProductName(const std::string& productName); std::string getDescription()const; @@ -58,6 +60,7 @@ namespace AlibabaCloud int dataFormat_; int nodeType_; bool id2_; + std::string netType_; std::string productName_; std::string description_; std::string protocolType_; diff --git a/iot/include/alibabacloud/iot/model/CreateRuleActionRequest.h b/iot/include/alibabacloud/iot/model/CreateRuleActionRequest.h index bc08e8b88..f756a08d6 100644 --- a/iot/include/alibabacloud/iot/model/CreateRuleActionRequest.h +++ b/iot/include/alibabacloud/iot/model/CreateRuleActionRequest.h @@ -43,12 +43,15 @@ namespace AlibabaCloud void setType(const std::string& type); std::string getAccessKeyId()const; void setAccessKeyId(const std::string& accessKeyId); + bool getErrorActionFlag()const; + void setErrorActionFlag(bool errorActionFlag); private: std::string configuration_; long ruleId_; std::string type_; std::string accessKeyId_; + bool errorActionFlag_; }; } diff --git a/iot/include/alibabacloud/iot/model/GetRuleActionResult.h b/iot/include/alibabacloud/iot/model/GetRuleActionResult.h index 0d9848a54..6495bc0d0 100644 --- a/iot/include/alibabacloud/iot/model/GetRuleActionResult.h +++ b/iot/include/alibabacloud/iot/model/GetRuleActionResult.h @@ -34,6 +34,7 @@ namespace AlibabaCloud public: struct RuleActionInfo { + bool errorActionFlag; std::string type; std::string configuration; long ruleId; diff --git a/iot/include/alibabacloud/iot/model/InvokeThingsServiceRequest.h b/iot/include/alibabacloud/iot/model/InvokeThingsServiceRequest.h new file mode 100644 index 000000000..1ff46628c --- /dev/null +++ b/iot/include/alibabacloud/iot/model/InvokeThingsServiceRequest.h @@ -0,0 +1,60 @@ +/* + * 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_INVOKETHINGSSERVICEREQUEST_H_ +#define ALIBABACLOUD_IOT_MODEL_INVOKETHINGSSERVICEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT InvokeThingsServiceRequest : public RpcServiceRequest + { + + public: + InvokeThingsServiceRequest(); + ~InvokeThingsServiceRequest(); + + std::string getArgs()const; + void setArgs(const std::string& args); + std::string getIdentifier()const; + void setIdentifier(const std::string& identifier); + 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::string args_; + std::string identifier_; + std::vector deviceName_; + std::string productKey_; + std::string accessKeyId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_INVOKETHINGSSERVICEREQUEST_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/InvokeThingsServiceResult.h b/iot/include/alibabacloud/iot/model/InvokeThingsServiceResult.h new file mode 100644 index 000000000..5ce012e25 --- /dev/null +++ b/iot/include/alibabacloud/iot/model/InvokeThingsServiceResult.h @@ -0,0 +1,55 @@ +/* + * 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_INVOKETHINGSSERVICERESULT_H_ +#define ALIBABACLOUD_IOT_MODEL_INVOKETHINGSSERVICERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT InvokeThingsServiceResult : public ServiceResult + { + public: + + + InvokeThingsServiceResult(); + explicit InvokeThingsServiceResult(const std::string &payload); + ~InvokeThingsServiceResult(); + std::string getErrorMessage()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string errorMessage_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_INVOKETHINGSSERVICERESULT_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/ListRuleActionsResult.h b/iot/include/alibabacloud/iot/model/ListRuleActionsResult.h index 761102647..254342cb5 100644 --- a/iot/include/alibabacloud/iot/model/ListRuleActionsResult.h +++ b/iot/include/alibabacloud/iot/model/ListRuleActionsResult.h @@ -34,6 +34,7 @@ namespace AlibabaCloud public: struct RuleActionInfo { + bool errorActionFlag; std::string type; std::string configuration; long ruleId; diff --git a/iot/include/alibabacloud/iot/model/QueryDeviceByTagsRequest.h b/iot/include/alibabacloud/iot/model/QueryDeviceByTagsRequest.h new file mode 100644 index 000000000..5e9df2a67 --- /dev/null +++ b/iot/include/alibabacloud/iot/model/QueryDeviceByTagsRequest.h @@ -0,0 +1,62 @@ +/* + * 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_QUERYDEVICEBYTAGSREQUEST_H_ +#define ALIBABACLOUD_IOT_MODEL_QUERYDEVICEBYTAGSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT QueryDeviceByTagsRequest : public RpcServiceRequest + { + struct Tag + { + std::string tagValue; + std::string tagKey; + }; + + public: + QueryDeviceByTagsRequest(); + ~QueryDeviceByTagsRequest(); + + int getPageSize()const; + void setPageSize(int pageSize); + int getCurrentPage()const; + void setCurrentPage(int currentPage); + std::vector getTag()const; + void setTag(const std::vector& tag); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + + private: + int pageSize_; + int currentPage_; + std::vector tag_; + std::string accessKeyId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_QUERYDEVICEBYTAGSREQUEST_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/QueryDeviceByTagsResult.h b/iot/include/alibabacloud/iot/model/QueryDeviceByTagsResult.h new file mode 100644 index 000000000..cd085abf2 --- /dev/null +++ b/iot/include/alibabacloud/iot/model/QueryDeviceByTagsResult.h @@ -0,0 +1,72 @@ +/* + * 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_QUERYDEVICEBYTAGSRESULT_H_ +#define ALIBABACLOUD_IOT_MODEL_QUERYDEVICEBYTAGSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT QueryDeviceByTagsResult : public ServiceResult + { + public: + struct SimpleDeviceInfo + { + std::string iotId; + std::string productName; + std::string productKey; + std::string deviceName; + }; + + + QueryDeviceByTagsResult(); + explicit QueryDeviceByTagsResult(const std::string &payload); + ~QueryDeviceByTagsResult(); + int getPageSize()const; + int getPageCount()const; + int getTotal()const; + std::vector getData()const; + int getPage()const; + std::string getErrorMessage()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + int pageSize_; + int pageCount_; + int total_; + std::vector data_; + int page_; + std::string errorMessage_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_QUERYDEVICEBYTAGSRESULT_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/SetDeviceGroupTagsRequest.h b/iot/include/alibabacloud/iot/model/SetDeviceGroupTagsRequest.h new file mode 100644 index 000000000..0f0a95b81 --- /dev/null +++ b/iot/include/alibabacloud/iot/model/SetDeviceGroupTagsRequest.h @@ -0,0 +1,54 @@ +/* + * 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_SETDEVICEGROUPTAGSREQUEST_H_ +#define ALIBABACLOUD_IOT_MODEL_SETDEVICEGROUPTAGSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT SetDeviceGroupTagsRequest : public RpcServiceRequest + { + + public: + SetDeviceGroupTagsRequest(); + ~SetDeviceGroupTagsRequest(); + + std::string getTagString()const; + void setTagString(const std::string& tagString); + std::string getGroupId()const; + void setGroupId(const std::string& groupId); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + + private: + std::string tagString_; + std::string groupId_; + std::string accessKeyId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_SETDEVICEGROUPTAGSREQUEST_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/SetDeviceGroupTagsResult.h b/iot/include/alibabacloud/iot/model/SetDeviceGroupTagsResult.h new file mode 100644 index 000000000..e7fecbf46 --- /dev/null +++ b/iot/include/alibabacloud/iot/model/SetDeviceGroupTagsResult.h @@ -0,0 +1,55 @@ +/* + * 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_SETDEVICEGROUPTAGSRESULT_H_ +#define ALIBABACLOUD_IOT_MODEL_SETDEVICEGROUPTAGSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT SetDeviceGroupTagsResult : public ServiceResult + { + public: + + + SetDeviceGroupTagsResult(); + explicit SetDeviceGroupTagsResult(const std::string &payload); + ~SetDeviceGroupTagsResult(); + std::string getErrorMessage()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string errorMessage_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_SETDEVICEGROUPTAGSRESULT_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/SetDevicesPropertyRequest.h b/iot/include/alibabacloud/iot/model/SetDevicesPropertyRequest.h new file mode 100644 index 000000000..0fd95b75c --- /dev/null +++ b/iot/include/alibabacloud/iot/model/SetDevicesPropertyRequest.h @@ -0,0 +1,57 @@ +/* + * 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_SETDEVICESPROPERTYREQUEST_H_ +#define ALIBABACLOUD_IOT_MODEL_SETDEVICESPROPERTYREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT SetDevicesPropertyRequest : public RpcServiceRequest + { + + public: + SetDevicesPropertyRequest(); + ~SetDevicesPropertyRequest(); + + std::vector getDeviceName()const; + void setDeviceName(const std::vector& deviceName); + std::string getProductKey()const; + void setProductKey(const std::string& productKey); + std::string getItems()const; + void setItems(const std::string& items); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + + private: + std::vector deviceName_; + std::string productKey_; + std::string items_; + std::string accessKeyId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_SETDEVICESPROPERTYREQUEST_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/SetDevicesPropertyResult.h b/iot/include/alibabacloud/iot/model/SetDevicesPropertyResult.h new file mode 100644 index 000000000..0f6ede939 --- /dev/null +++ b/iot/include/alibabacloud/iot/model/SetDevicesPropertyResult.h @@ -0,0 +1,55 @@ +/* + * 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_SETDEVICESPROPERTYRESULT_H_ +#define ALIBABACLOUD_IOT_MODEL_SETDEVICESPROPERTYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT SetDevicesPropertyResult : public ServiceResult + { + public: + + + SetDevicesPropertyResult(); + explicit SetDevicesPropertyResult(const std::string &payload); + ~SetDevicesPropertyResult(); + std::string getErrorMessage()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string errorMessage_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_SETDEVICESPROPERTYRESULT_H_ \ No newline at end of file diff --git a/iot/src/IotClient.cc b/iot/src/IotClient.cc index bd4abd092..395f8fb1b 100644 --- a/iot/src/IotClient.cc +++ b/iot/src/IotClient.cc @@ -159,6 +159,42 @@ IotClient::QueryDeviceGroupListOutcomeCallable IotClient::queryDeviceGroupListCa return task->get_future(); } +IotClient::SetDeviceGroupTagsOutcome IotClient::setDeviceGroupTags(const SetDeviceGroupTagsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return SetDeviceGroupTagsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return SetDeviceGroupTagsOutcome(SetDeviceGroupTagsResult(outcome.result())); + else + return SetDeviceGroupTagsOutcome(outcome.error()); +} + +void IotClient::setDeviceGroupTagsAsync(const SetDeviceGroupTagsRequest& request, const SetDeviceGroupTagsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, setDeviceGroupTags(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +IotClient::SetDeviceGroupTagsOutcomeCallable IotClient::setDeviceGroupTagsCallable(const SetDeviceGroupTagsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->setDeviceGroupTags(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + IotClient::QueryDeviceEventDataOutcome IotClient::queryDeviceEventData(const QueryDeviceEventDataRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -195,6 +231,42 @@ IotClient::QueryDeviceEventDataOutcomeCallable IotClient::queryDeviceEventDataCa return task->get_future(); } +IotClient::QueryDeviceByTagsOutcome IotClient::queryDeviceByTags(const QueryDeviceByTagsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return QueryDeviceByTagsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return QueryDeviceByTagsOutcome(QueryDeviceByTagsResult(outcome.result())); + else + return QueryDeviceByTagsOutcome(outcome.error()); +} + +void IotClient::queryDeviceByTagsAsync(const QueryDeviceByTagsRequest& request, const QueryDeviceByTagsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, queryDeviceByTags(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +IotClient::QueryDeviceByTagsOutcomeCallable IotClient::queryDeviceByTagsCallable(const QueryDeviceByTagsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->queryDeviceByTags(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + IotClient::GetDeviceStatusOutcome IotClient::getDeviceStatus(const GetDeviceStatusRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -1419,6 +1491,42 @@ IotClient::BatchDeleteDeviceGroupRelationsOutcomeCallable IotClient::batchDelete return task->get_future(); } +IotClient::InvokeThingsServiceOutcome IotClient::invokeThingsService(const InvokeThingsServiceRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return InvokeThingsServiceOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return InvokeThingsServiceOutcome(InvokeThingsServiceResult(outcome.result())); + else + return InvokeThingsServiceOutcome(outcome.error()); +} + +void IotClient::invokeThingsServiceAsync(const InvokeThingsServiceRequest& request, const InvokeThingsServiceAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, invokeThingsService(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +IotClient::InvokeThingsServiceOutcomeCallable IotClient::invokeThingsServiceCallable(const InvokeThingsServiceRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->invokeThingsService(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + IotClient::QueryDeviceGroupTagListOutcome IotClient::queryDeviceGroupTagList(const QueryDeviceGroupTagListRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -2247,6 +2355,42 @@ IotClient::GetDeviceShadowOutcomeCallable IotClient::getDeviceShadowCallable(con return task->get_future(); } +IotClient::SetDevicesPropertyOutcome IotClient::setDevicesProperty(const SetDevicesPropertyRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return SetDevicesPropertyOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return SetDevicesPropertyOutcome(SetDevicesPropertyResult(outcome.result())); + else + return SetDevicesPropertyOutcome(outcome.error()); +} + +void IotClient::setDevicesPropertyAsync(const SetDevicesPropertyRequest& request, const SetDevicesPropertyAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, setDevicesProperty(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +IotClient::SetDevicesPropertyOutcomeCallable IotClient::setDevicesPropertyCallable(const SetDevicesPropertyRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->setDevicesProperty(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + IotClient::GetGatewayBySubDeviceOutcome IotClient::getGatewayBySubDevice(const GetGatewayBySubDeviceRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/iot/src/model/CreateProductRequest.cc b/iot/src/model/CreateProductRequest.cc index 4875dc7ea..59a2f1350 100644 --- a/iot/src/model/CreateProductRequest.cc +++ b/iot/src/model/CreateProductRequest.cc @@ -58,6 +58,17 @@ void CreateProductRequest::setId2(bool id2) setParameter("Id2", std::to_string(id2)); } +std::string CreateProductRequest::getNetType()const +{ + return netType_; +} + +void CreateProductRequest::setNetType(const std::string& netType) +{ + netType_ = netType; + setParameter("NetType", netType); +} + std::string CreateProductRequest::getProductName()const { return productName_; diff --git a/iot/src/model/CreateRuleActionRequest.cc b/iot/src/model/CreateRuleActionRequest.cc index c389bb580..2caac42e1 100644 --- a/iot/src/model/CreateRuleActionRequest.cc +++ b/iot/src/model/CreateRuleActionRequest.cc @@ -69,3 +69,14 @@ void CreateRuleActionRequest::setAccessKeyId(const std::string& accessKeyId) setParameter("AccessKeyId", accessKeyId); } +bool CreateRuleActionRequest::getErrorActionFlag()const +{ + return errorActionFlag_; +} + +void CreateRuleActionRequest::setErrorActionFlag(bool errorActionFlag) +{ + errorActionFlag_ = errorActionFlag; + setParameter("ErrorActionFlag", std::to_string(errorActionFlag)); +} + diff --git a/iot/src/model/GetRuleActionResult.cc b/iot/src/model/GetRuleActionResult.cc index a0a4e022a..50de5b286 100644 --- a/iot/src/model/GetRuleActionResult.cc +++ b/iot/src/model/GetRuleActionResult.cc @@ -49,6 +49,8 @@ void GetRuleActionResult::parse(const std::string &payload) ruleActionInfo_.type = ruleActionInfoNode["Type"].asString(); if(!ruleActionInfoNode["Configuration"].isNull()) ruleActionInfo_.configuration = ruleActionInfoNode["Configuration"].asString(); + if(!ruleActionInfoNode["ErrorActionFlag"].isNull()) + ruleActionInfo_.errorActionFlag = ruleActionInfoNode["ErrorActionFlag"].asString() == "true"; if(!value["Success"].isNull()) success_ = value["Success"].asString() == "true"; if(!value["Code"].isNull()) diff --git a/iot/src/model/InvokeThingsServiceRequest.cc b/iot/src/model/InvokeThingsServiceRequest.cc new file mode 100644 index 000000000..7db782e79 --- /dev/null +++ b/iot/src/model/InvokeThingsServiceRequest.cc @@ -0,0 +1,83 @@ +/* + * 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::InvokeThingsServiceRequest; + +InvokeThingsServiceRequest::InvokeThingsServiceRequest() : + RpcServiceRequest("iot", "2018-01-20", "InvokeThingsService") +{} + +InvokeThingsServiceRequest::~InvokeThingsServiceRequest() +{} + +std::string InvokeThingsServiceRequest::getArgs()const +{ + return args_; +} + +void InvokeThingsServiceRequest::setArgs(const std::string& args) +{ + args_ = args; + setParameter("Args", args); +} + +std::string InvokeThingsServiceRequest::getIdentifier()const +{ + return identifier_; +} + +void InvokeThingsServiceRequest::setIdentifier(const std::string& identifier) +{ + identifier_ = identifier; + setParameter("Identifier", identifier); +} + +std::vector InvokeThingsServiceRequest::getDeviceName()const +{ + return deviceName_; +} + +void InvokeThingsServiceRequest::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 InvokeThingsServiceRequest::getProductKey()const +{ + return productKey_; +} + +void InvokeThingsServiceRequest::setProductKey(const std::string& productKey) +{ + productKey_ = productKey; + setParameter("ProductKey", productKey); +} + +std::string InvokeThingsServiceRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void InvokeThingsServiceRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + diff --git a/iot/src/model/InvokeThingsServiceResult.cc b/iot/src/model/InvokeThingsServiceResult.cc new file mode 100644 index 000000000..b42db783c --- /dev/null +++ b/iot/src/model/InvokeThingsServiceResult.cc @@ -0,0 +1,66 @@ +/* + * 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; + +InvokeThingsServiceResult::InvokeThingsServiceResult() : + ServiceResult() +{} + +InvokeThingsServiceResult::InvokeThingsServiceResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +InvokeThingsServiceResult::~InvokeThingsServiceResult() +{} + +void InvokeThingsServiceResult::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["ErrorMessage"].isNull()) + errorMessage_ = value["ErrorMessage"].asString(); + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + +} + +std::string InvokeThingsServiceResult::getErrorMessage()const +{ + return errorMessage_; +} + +std::string InvokeThingsServiceResult::getCode()const +{ + return code_; +} + +bool InvokeThingsServiceResult::getSuccess()const +{ + return success_; +} + diff --git a/iot/src/model/ListRuleActionsResult.cc b/iot/src/model/ListRuleActionsResult.cc index 0816bbe35..8a6cd73df 100644 --- a/iot/src/model/ListRuleActionsResult.cc +++ b/iot/src/model/ListRuleActionsResult.cc @@ -52,6 +52,8 @@ void ListRuleActionsResult::parse(const std::string &payload) ruleActionListObject.type = value["Type"].asString(); if(!value["Configuration"].isNull()) ruleActionListObject.configuration = value["Configuration"].asString(); + if(!value["ErrorActionFlag"].isNull()) + ruleActionListObject.errorActionFlag = value["ErrorActionFlag"].asString() == "true"; ruleActionList_.push_back(ruleActionListObject); } if(!value["Success"].isNull()) diff --git a/iot/src/model/QueryDeviceByTagsRequest.cc b/iot/src/model/QueryDeviceByTagsRequest.cc new file mode 100644 index 000000000..9c2157130 --- /dev/null +++ b/iot/src/model/QueryDeviceByTagsRequest.cc @@ -0,0 +1,77 @@ +/* + * 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::QueryDeviceByTagsRequest; + +QueryDeviceByTagsRequest::QueryDeviceByTagsRequest() : + RpcServiceRequest("iot", "2018-01-20", "QueryDeviceByTags") +{} + +QueryDeviceByTagsRequest::~QueryDeviceByTagsRequest() +{} + +int QueryDeviceByTagsRequest::getPageSize()const +{ + return pageSize_; +} + +void QueryDeviceByTagsRequest::setPageSize(int pageSize) +{ + pageSize_ = pageSize; + setParameter("PageSize", std::to_string(pageSize)); +} + +int QueryDeviceByTagsRequest::getCurrentPage()const +{ + return currentPage_; +} + +void QueryDeviceByTagsRequest::setCurrentPage(int currentPage) +{ + currentPage_ = currentPage; + setParameter("CurrentPage", std::to_string(currentPage)); +} + +std::vector QueryDeviceByTagsRequest::getTag()const +{ + return tag_; +} + +void QueryDeviceByTagsRequest::setTag(const std::vector& tag) +{ + tag_ = tag; + int i = 0; + for(int i = 0; i!= tag.size(); i++) { + auto obj = tag.at(i); + std::string str ="Tag."+ std::to_string(i); + setParameter(str + ".TagValue", obj.tagValue); + setParameter(str + ".TagKey", obj.tagKey); + } +} + +std::string QueryDeviceByTagsRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void QueryDeviceByTagsRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + diff --git a/iot/src/model/QueryDeviceByTagsResult.cc b/iot/src/model/QueryDeviceByTagsResult.cc new file mode 100644 index 000000000..e2a5e6ab7 --- /dev/null +++ b/iot/src/model/QueryDeviceByTagsResult.cc @@ -0,0 +1,113 @@ +/* + * 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; + +QueryDeviceByTagsResult::QueryDeviceByTagsResult() : + ServiceResult() +{} + +QueryDeviceByTagsResult::QueryDeviceByTagsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +QueryDeviceByTagsResult::~QueryDeviceByTagsResult() +{} + +void QueryDeviceByTagsResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + + setRequestId(value["RequestId"].asString()); + auto allData = value["Data"]["SimpleDeviceInfo"]; + for (auto value : allData) + { + SimpleDeviceInfo dataObject; + if(!value["ProductName"].isNull()) + dataObject.productName = value["ProductName"].asString(); + if(!value["ProductKey"].isNull()) + dataObject.productKey = value["ProductKey"].asString(); + if(!value["DeviceName"].isNull()) + dataObject.deviceName = value["DeviceName"].asString(); + if(!value["IotId"].isNull()) + dataObject.iotId = value["IotId"].asString(); + data_.push_back(dataObject); + } + 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["Page"].isNull()) + page_ = std::stoi(value["Page"].asString()); + if(!value["PageSize"].isNull()) + pageSize_ = std::stoi(value["PageSize"].asString()); + if(!value["PageCount"].isNull()) + pageCount_ = std::stoi(value["PageCount"].asString()); + if(!value["Total"].isNull()) + total_ = std::stoi(value["Total"].asString()); + +} + +int QueryDeviceByTagsResult::getPageSize()const +{ + return pageSize_; +} + +int QueryDeviceByTagsResult::getPageCount()const +{ + return pageCount_; +} + +int QueryDeviceByTagsResult::getTotal()const +{ + return total_; +} + +std::vector QueryDeviceByTagsResult::getData()const +{ + return data_; +} + +int QueryDeviceByTagsResult::getPage()const +{ + return page_; +} + +std::string QueryDeviceByTagsResult::getErrorMessage()const +{ + return errorMessage_; +} + +std::string QueryDeviceByTagsResult::getCode()const +{ + return code_; +} + +bool QueryDeviceByTagsResult::getSuccess()const +{ + return success_; +} + diff --git a/iot/src/model/SetDeviceGroupTagsRequest.cc b/iot/src/model/SetDeviceGroupTagsRequest.cc new file mode 100644 index 000000000..a5ce4b612 --- /dev/null +++ b/iot/src/model/SetDeviceGroupTagsRequest.cc @@ -0,0 +1,60 @@ +/* + * 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::SetDeviceGroupTagsRequest; + +SetDeviceGroupTagsRequest::SetDeviceGroupTagsRequest() : + RpcServiceRequest("iot", "2018-01-20", "SetDeviceGroupTags") +{} + +SetDeviceGroupTagsRequest::~SetDeviceGroupTagsRequest() +{} + +std::string SetDeviceGroupTagsRequest::getTagString()const +{ + return tagString_; +} + +void SetDeviceGroupTagsRequest::setTagString(const std::string& tagString) +{ + tagString_ = tagString; + setParameter("TagString", tagString); +} + +std::string SetDeviceGroupTagsRequest::getGroupId()const +{ + return groupId_; +} + +void SetDeviceGroupTagsRequest::setGroupId(const std::string& groupId) +{ + groupId_ = groupId; + setParameter("GroupId", groupId); +} + +std::string SetDeviceGroupTagsRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void SetDeviceGroupTagsRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + diff --git a/iot/src/model/SetDeviceGroupTagsResult.cc b/iot/src/model/SetDeviceGroupTagsResult.cc new file mode 100644 index 000000000..dee9f5156 --- /dev/null +++ b/iot/src/model/SetDeviceGroupTagsResult.cc @@ -0,0 +1,66 @@ +/* + * 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; + +SetDeviceGroupTagsResult::SetDeviceGroupTagsResult() : + ServiceResult() +{} + +SetDeviceGroupTagsResult::SetDeviceGroupTagsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +SetDeviceGroupTagsResult::~SetDeviceGroupTagsResult() +{} + +void SetDeviceGroupTagsResult::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(); + +} + +std::string SetDeviceGroupTagsResult::getErrorMessage()const +{ + return errorMessage_; +} + +std::string SetDeviceGroupTagsResult::getCode()const +{ + return code_; +} + +bool SetDeviceGroupTagsResult::getSuccess()const +{ + return success_; +} + diff --git a/iot/src/model/SetDevicesPropertyRequest.cc b/iot/src/model/SetDevicesPropertyRequest.cc new file mode 100644 index 000000000..751d5a191 --- /dev/null +++ b/iot/src/model/SetDevicesPropertyRequest.cc @@ -0,0 +1,72 @@ +/* + * 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::SetDevicesPropertyRequest; + +SetDevicesPropertyRequest::SetDevicesPropertyRequest() : + RpcServiceRequest("iot", "2018-01-20", "SetDevicesProperty") +{} + +SetDevicesPropertyRequest::~SetDevicesPropertyRequest() +{} + +std::vector SetDevicesPropertyRequest::getDeviceName()const +{ + return deviceName_; +} + +void SetDevicesPropertyRequest::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 SetDevicesPropertyRequest::getProductKey()const +{ + return productKey_; +} + +void SetDevicesPropertyRequest::setProductKey(const std::string& productKey) +{ + productKey_ = productKey; + setParameter("ProductKey", productKey); +} + +std::string SetDevicesPropertyRequest::getItems()const +{ + return items_; +} + +void SetDevicesPropertyRequest::setItems(const std::string& items) +{ + items_ = items; + setParameter("Items", items); +} + +std::string SetDevicesPropertyRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void SetDevicesPropertyRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + diff --git a/iot/src/model/SetDevicesPropertyResult.cc b/iot/src/model/SetDevicesPropertyResult.cc new file mode 100644 index 000000000..3fee2418f --- /dev/null +++ b/iot/src/model/SetDevicesPropertyResult.cc @@ -0,0 +1,66 @@ +/* + * 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; + +SetDevicesPropertyResult::SetDevicesPropertyResult() : + ServiceResult() +{} + +SetDevicesPropertyResult::SetDevicesPropertyResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +SetDevicesPropertyResult::~SetDevicesPropertyResult() +{} + +void SetDevicesPropertyResult::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["ErrorMessage"].isNull()) + errorMessage_ = value["ErrorMessage"].asString(); + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + +} + +std::string SetDevicesPropertyResult::getErrorMessage()const +{ + return errorMessage_; +} + +std::string SetDevicesPropertyResult::getCode()const +{ + return code_; +} + +bool SetDevicesPropertyResult::getSuccess()const +{ + return success_; +} +