From c12d0267d7406cdcac031400c9bb4a9cc32bbe98 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Sun, 20 Sep 2020 12:12:16 +0000 Subject: [PATCH] Add describe devices to return device status. --- CHANGELOG | 3 + vcs/CMakeLists.txt | 4 + vcs/include/alibabacloud/vcs/VcsClient.h | 8 ++ .../vcs/model/AddMonitorRequest.h | 15 +++ .../vcs/model/CreateCorpRequest.h | 3 + .../alibabacloud/vcs/model/ListCorpsResult.h | 2 + .../vcs/model/ListDeviceGroupsRequest.h | 66 +++++++++++ .../vcs/model/ListDeviceGroupsResult.h | 73 ++++++++++++ .../vcs/model/SearchObjectRequest.h | 27 ++--- .../vcs/model/UpdateCorpRequest.h | 3 + .../vcs/model/UpdateMonitorRequest.h | 15 +++ vcs/src/VcsClient.cc | 36 ++++++ vcs/src/model/AddMonitorRequest.cc | 55 +++++++++ vcs/src/model/CreateCorpRequest.cc | 11 ++ vcs/src/model/ListCorpsResult.cc | 4 + vcs/src/model/ListDeviceGroupsRequest.cc | 106 ++++++++++++++++++ vcs/src/model/ListDeviceGroupsResult.cc | 97 ++++++++++++++++ vcs/src/model/SearchObjectRequest.cc | 99 ++++++++-------- vcs/src/model/UpdateCorpRequest.cc | 11 ++ vcs/src/model/UpdateMonitorRequest.cc | 55 +++++++++ 20 files changed, 623 insertions(+), 70 deletions(-) create mode 100644 vcs/include/alibabacloud/vcs/model/ListDeviceGroupsRequest.h create mode 100644 vcs/include/alibabacloud/vcs/model/ListDeviceGroupsResult.h create mode 100644 vcs/src/model/ListDeviceGroupsRequest.cc create mode 100644 vcs/src/model/ListDeviceGroupsResult.cc diff --git a/CHANGELOG b/CHANGELOG index 10bb01567..94df1f25f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-09-20 Version: patch +- Add describe devices to return device status. + 2020-09-19 Version: patch - Support query user tenant list and current active tenant. - Support query table meta information via table GUID. diff --git a/vcs/CMakeLists.txt b/vcs/CMakeLists.txt index fbaff3879..c389c05b7 100644 --- a/vcs/CMakeLists.txt +++ b/vcs/CMakeLists.txt @@ -113,6 +113,8 @@ set(vcs_public_header_model include/alibabacloud/vcs/model/ListCorpMetricsResult.h include/alibabacloud/vcs/model/ListCorpsRequest.h include/alibabacloud/vcs/model/ListCorpsResult.h + include/alibabacloud/vcs/model/ListDeviceGroupsRequest.h + include/alibabacloud/vcs/model/ListDeviceGroupsResult.h include/alibabacloud/vcs/model/ListDevicesRequest.h include/alibabacloud/vcs/model/ListDevicesResult.h include/alibabacloud/vcs/model/ListEventAlgorithmDetailsRequest.h @@ -274,6 +276,8 @@ set(vcs_src src/model/ListCorpMetricsResult.cc src/model/ListCorpsRequest.cc src/model/ListCorpsResult.cc + src/model/ListDeviceGroupsRequest.cc + src/model/ListDeviceGroupsResult.cc src/model/ListDevicesRequest.cc src/model/ListDevicesResult.cc src/model/ListEventAlgorithmDetailsRequest.cc diff --git a/vcs/include/alibabacloud/vcs/VcsClient.h b/vcs/include/alibabacloud/vcs/VcsClient.h index 63a1c2420..c3615fe30 100644 --- a/vcs/include/alibabacloud/vcs/VcsClient.h +++ b/vcs/include/alibabacloud/vcs/VcsClient.h @@ -114,6 +114,8 @@ #include "model/ListCorpMetricsResult.h" #include "model/ListCorpsRequest.h" #include "model/ListCorpsResult.h" +#include "model/ListDeviceGroupsRequest.h" +#include "model/ListDeviceGroupsResult.h" #include "model/ListDevicesRequest.h" #include "model/ListDevicesResult.h" #include "model/ListEventAlgorithmDetailsRequest.h" @@ -327,6 +329,9 @@ namespace AlibabaCloud typedef Outcome ListCorpsOutcome; typedef std::future ListCorpsOutcomeCallable; typedef std::function&)> ListCorpsAsyncHandler; + typedef Outcome ListDeviceGroupsOutcome; + typedef std::future ListDeviceGroupsOutcomeCallable; + typedef std::function&)> ListDeviceGroupsAsyncHandler; typedef Outcome ListDevicesOutcome; typedef std::future ListDevicesOutcomeCallable; typedef std::function&)> ListDevicesAsyncHandler; @@ -569,6 +574,9 @@ namespace AlibabaCloud ListCorpsOutcome listCorps(const Model::ListCorpsRequest &request)const; void listCorpsAsync(const Model::ListCorpsRequest& request, const ListCorpsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListCorpsOutcomeCallable listCorpsCallable(const Model::ListCorpsRequest& request) const; + ListDeviceGroupsOutcome listDeviceGroups(const Model::ListDeviceGroupsRequest &request)const; + void listDeviceGroupsAsync(const Model::ListDeviceGroupsRequest& request, const ListDeviceGroupsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListDeviceGroupsOutcomeCallable listDeviceGroupsCallable(const Model::ListDeviceGroupsRequest& request) const; ListDevicesOutcome listDevices(const Model::ListDevicesRequest &request)const; void listDevicesAsync(const Model::ListDevicesRequest& request, const ListDevicesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListDevicesOutcomeCallable listDevicesCallable(const Model::ListDevicesRequest& request) const; diff --git a/vcs/include/alibabacloud/vcs/model/AddMonitorRequest.h b/vcs/include/alibabacloud/vcs/model/AddMonitorRequest.h index e0f7450a8..2407dbf07 100644 --- a/vcs/include/alibabacloud/vcs/model/AddMonitorRequest.h +++ b/vcs/include/alibabacloud/vcs/model/AddMonitorRequest.h @@ -41,8 +41,18 @@ namespace AlibabaCloud void setCorpId(const std::string& corpId); std::string getDescription()const; void setDescription(const std::string& description); + std::string getNotifierAppSecret()const; + void setNotifierAppSecret(const std::string& notifierAppSecret); + std::string getNotifierExtendValues()const; + void setNotifierExtendValues(const std::string& notifierExtendValues); + std::string getNotifierUrl()const; + void setNotifierUrl(const std::string& notifierUrl); + std::string getNotifierType()const; + void setNotifierType(const std::string& notifierType); int getBatchIndicator()const; void setBatchIndicator(int batchIndicator); + int getNotifierTimeOut()const; + void setNotifierTimeOut(int notifierTimeOut); std::string getAlgorithmVendor()const; void setAlgorithmVendor(const std::string& algorithmVendor); @@ -50,7 +60,12 @@ namespace AlibabaCloud std::string monitorType_; std::string corpId_; std::string description_; + std::string notifierAppSecret_; + std::string notifierExtendValues_; + std::string notifierUrl_; + std::string notifierType_; int batchIndicator_; + int notifierTimeOut_; std::string algorithmVendor_; }; diff --git a/vcs/include/alibabacloud/vcs/model/CreateCorpRequest.h b/vcs/include/alibabacloud/vcs/model/CreateCorpRequest.h index b1f6c7ee9..4c30caecf 100644 --- a/vcs/include/alibabacloud/vcs/model/CreateCorpRequest.h +++ b/vcs/include/alibabacloud/vcs/model/CreateCorpRequest.h @@ -43,6 +43,8 @@ namespace AlibabaCloud void setParentCorpId(const std::string& parentCorpId); std::string getDescription()const; void setDescription(const std::string& description); + std::string getIconPath()const; + void setIconPath(const std::string& iconPath); std::string getAppName()const; void setAppName(const std::string& appName); std::string getCorpName()const; @@ -53,6 +55,7 @@ namespace AlibabaCloud std::string isvSubId_; std::string parentCorpId_; std::string description_; + std::string iconPath_; std::string appName_; std::string corpName_; diff --git a/vcs/include/alibabacloud/vcs/model/ListCorpsResult.h b/vcs/include/alibabacloud/vcs/model/ListCorpsResult.h index 2bfdc1548..7b7b2e432 100644 --- a/vcs/include/alibabacloud/vcs/model/ListCorpsResult.h +++ b/vcs/include/alibabacloud/vcs/model/ListCorpsResult.h @@ -36,11 +36,13 @@ namespace AlibabaCloud { struct Record { + std::string iconPath; std::string corpId; std::string description; std::string parentCorpId; std::string isvSubId; std::string createDate; + int acuUsed; std::string corpName; std::string appName; int deviceCount; diff --git a/vcs/include/alibabacloud/vcs/model/ListDeviceGroupsRequest.h b/vcs/include/alibabacloud/vcs/model/ListDeviceGroupsRequest.h new file mode 100644 index 000000000..dd4195295 --- /dev/null +++ b/vcs/include/alibabacloud/vcs/model/ListDeviceGroupsRequest.h @@ -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. + */ + +#ifndef ALIBABACLOUD_VCS_MODEL_LISTDEVICEGROUPSREQUEST_H_ +#define ALIBABACLOUD_VCS_MODEL_LISTDEVICEGROUPSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Vcs + { + namespace Model + { + class ALIBABACLOUD_VCS_EXPORT ListDeviceGroupsRequest : public RpcServiceRequest + { + + public: + ListDeviceGroupsRequest(); + ~ListDeviceGroupsRequest(); + + int getIsPage()const; + void setIsPage(int isPage); + int getPageNum()const; + void setPageNum(int pageNum); + std::string getCorpIdList()const; + void setCorpIdList(const std::string& corpIdList); + std::string getDeviceCodeList()const; + void setDeviceCodeList(const std::string& deviceCodeList); + std::string getName()const; + void setName(const std::string& name); + int getPageSize()const; + void setPageSize(int pageSize); + std::string getGroup()const; + void setGroup(const std::string& group); + + private: + int isPage_; + int pageNum_; + std::string corpIdList_; + std::string deviceCodeList_; + std::string name_; + int pageSize_; + std::string group_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VCS_MODEL_LISTDEVICEGROUPSREQUEST_H_ \ No newline at end of file diff --git a/vcs/include/alibabacloud/vcs/model/ListDeviceGroupsResult.h b/vcs/include/alibabacloud/vcs/model/ListDeviceGroupsResult.h new file mode 100644 index 000000000..9e6dc7885 --- /dev/null +++ b/vcs/include/alibabacloud/vcs/model/ListDeviceGroupsResult.h @@ -0,0 +1,73 @@ +/* + * 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_VCS_MODEL_LISTDEVICEGROUPSRESULT_H_ +#define ALIBABACLOUD_VCS_MODEL_LISTDEVICEGROUPSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Vcs + { + namespace Model + { + class ALIBABACLOUD_VCS_EXPORT ListDeviceGroupsResult : public ServiceResult + { + public: + struct DataItem + { + struct ListItem + { + std::string codingFormat; + std::string installAddress; + std::string regionName; + std::string dataSourceType; + std::string deviceGroup; + std::string deviceCode; + std::string regionId; + std::string bitRate; + std::string resolvingPower; + std::string deviceName; + }; + std::string totalCount; + std::vector list; + }; + + + ListDeviceGroupsResult(); + explicit ListDeviceGroupsResult(const std::string &payload); + ~ListDeviceGroupsResult(); + std::string getMessage()const; + std::vector getData()const; + std::string getCode()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + std::vector data_; + std::string code_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VCS_MODEL_LISTDEVICEGROUPSRESULT_H_ \ No newline at end of file diff --git a/vcs/include/alibabacloud/vcs/model/SearchObjectRequest.h b/vcs/include/alibabacloud/vcs/model/SearchObjectRequest.h index 9aefa7a3d..47efe2ccc 100644 --- a/vcs/include/alibabacloud/vcs/model/SearchObjectRequest.h +++ b/vcs/include/alibabacloud/vcs/model/SearchObjectRequest.h @@ -35,43 +35,40 @@ namespace AlibabaCloud SearchObjectRequest(); ~SearchObjectRequest(); + std::string getAlgorithmType()const; + void setAlgorithmType(const std::string& algorithmType); std::string getCorpId()const; void setCorpId(const std::string& corpId); + long getEndTime()const; + void setEndTime(long endTime); long getStartTime()const; void setStartTime(long startTime); int getPageNumber()const; void setPageNumber(int pageNumber); - std::string getPicContent()const; - void setPicContent(const std::string& picContent); - int getPageSize()const; - void setPageSize(int pageSize); - std::string getObjectType()const; - void setObjectType(const std::string& objectType); - std::string getAlgorithmType()const; - void setAlgorithmType(const std::string& algorithmType); - long getEndTime()const; - void setEndTime(long endTime); std::map getDeviceList()const; void setDeviceList(const std::map& deviceList); std::string getPicUrl()const; void setPicUrl(const std::string& picUrl); std::string getImagePath()const; void setImagePath(const std::string& imagePath); + int getPageSize()const; + void setPageSize(int pageSize); + std::string getObjectType()const; + void setObjectType(const std::string& objectType); std::string getConditions()const; void setConditions(const std::string& conditions); private: + std::string algorithmType_; std::string corpId_; + long endTime_; long startTime_; int pageNumber_; - std::string picContent_; - int pageSize_; - std::string objectType_; - std::string algorithmType_; - long endTime_; std::map deviceList_; std::string picUrl_; std::string imagePath_; + int pageSize_; + std::string objectType_; std::string conditions_; }; diff --git a/vcs/include/alibabacloud/vcs/model/UpdateCorpRequest.h b/vcs/include/alibabacloud/vcs/model/UpdateCorpRequest.h index 20721e624..4e98fcfd8 100644 --- a/vcs/include/alibabacloud/vcs/model/UpdateCorpRequest.h +++ b/vcs/include/alibabacloud/vcs/model/UpdateCorpRequest.h @@ -43,6 +43,8 @@ namespace AlibabaCloud void setParentCorpId(const std::string& parentCorpId); std::string getDescription()const; void setDescription(const std::string& description); + std::string getIconPath()const; + void setIconPath(const std::string& iconPath); std::string getAppName()const; void setAppName(const std::string& appName); std::string getCorpName()const; @@ -53,6 +55,7 @@ namespace AlibabaCloud std::string corpId_; std::string parentCorpId_; std::string description_; + std::string iconPath_; std::string appName_; std::string corpName_; diff --git a/vcs/include/alibabacloud/vcs/model/UpdateMonitorRequest.h b/vcs/include/alibabacloud/vcs/model/UpdateMonitorRequest.h index d011816b3..c918fe0e8 100644 --- a/vcs/include/alibabacloud/vcs/model/UpdateMonitorRequest.h +++ b/vcs/include/alibabacloud/vcs/model/UpdateMonitorRequest.h @@ -49,6 +49,8 @@ namespace AlibabaCloud void setAttributeOperateType(const std::string& attributeOperateType); std::string getRuleExpression()const; void setRuleExpression(const std::string& ruleExpression); + int getNotifierTimeOut()const; + void setNotifierTimeOut(int notifierTimeOut); std::string getTaskId()const; void setTaskId(const std::string& taskId); std::string getDeviceOperateType()const; @@ -57,8 +59,16 @@ namespace AlibabaCloud void setPicList(const std::string& picList); std::string getAttributeValueList()const; void setAttributeValueList(const std::string& attributeValueList); + std::string getNotifierAppSecret()const; + void setNotifierAppSecret(const std::string& notifierAppSecret); + std::string getNotifierExtendValues()const; + void setNotifierExtendValues(const std::string& notifierExtendValues); std::string getDeviceList()const; void setDeviceList(const std::string& deviceList); + std::string getNotifierUrl()const; + void setNotifierUrl(const std::string& notifierUrl); + std::string getNotifierType()const; + void setNotifierType(const std::string& notifierType); std::string getAlgorithmVendor()const; void setAlgorithmVendor(const std::string& algorithmVendor); @@ -70,11 +80,16 @@ namespace AlibabaCloud std::string attributeName_; std::string attributeOperateType_; std::string ruleExpression_; + int notifierTimeOut_; std::string taskId_; std::string deviceOperateType_; std::string picList_; std::string attributeValueList_; + std::string notifierAppSecret_; + std::string notifierExtendValues_; std::string deviceList_; + std::string notifierUrl_; + std::string notifierType_; std::string algorithmVendor_; }; diff --git a/vcs/src/VcsClient.cc b/vcs/src/VcsClient.cc index 2eef419ce..3264903bc 100644 --- a/vcs/src/VcsClient.cc +++ b/vcs/src/VcsClient.cc @@ -1707,6 +1707,42 @@ VcsClient::ListCorpsOutcomeCallable VcsClient::listCorpsCallable(const ListCorps return task->get_future(); } +VcsClient::ListDeviceGroupsOutcome VcsClient::listDeviceGroups(const ListDeviceGroupsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListDeviceGroupsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListDeviceGroupsOutcome(ListDeviceGroupsResult(outcome.result())); + else + return ListDeviceGroupsOutcome(outcome.error()); +} + +void VcsClient::listDeviceGroupsAsync(const ListDeviceGroupsRequest& request, const ListDeviceGroupsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listDeviceGroups(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +VcsClient::ListDeviceGroupsOutcomeCallable VcsClient::listDeviceGroupsCallable(const ListDeviceGroupsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listDeviceGroups(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + VcsClient::ListDevicesOutcome VcsClient::listDevices(const ListDevicesRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/vcs/src/model/AddMonitorRequest.cc b/vcs/src/model/AddMonitorRequest.cc index acf50597a..92e691339 100644 --- a/vcs/src/model/AddMonitorRequest.cc +++ b/vcs/src/model/AddMonitorRequest.cc @@ -60,6 +60,50 @@ void AddMonitorRequest::setDescription(const std::string& description) setBodyParameter("Description", description); } +std::string AddMonitorRequest::getNotifierAppSecret()const +{ + return notifierAppSecret_; +} + +void AddMonitorRequest::setNotifierAppSecret(const std::string& notifierAppSecret) +{ + notifierAppSecret_ = notifierAppSecret; + setBodyParameter("NotifierAppSecret", notifierAppSecret); +} + +std::string AddMonitorRequest::getNotifierExtendValues()const +{ + return notifierExtendValues_; +} + +void AddMonitorRequest::setNotifierExtendValues(const std::string& notifierExtendValues) +{ + notifierExtendValues_ = notifierExtendValues; + setBodyParameter("NotifierExtendValues", notifierExtendValues); +} + +std::string AddMonitorRequest::getNotifierUrl()const +{ + return notifierUrl_; +} + +void AddMonitorRequest::setNotifierUrl(const std::string& notifierUrl) +{ + notifierUrl_ = notifierUrl; + setBodyParameter("NotifierUrl", notifierUrl); +} + +std::string AddMonitorRequest::getNotifierType()const +{ + return notifierType_; +} + +void AddMonitorRequest::setNotifierType(const std::string& notifierType) +{ + notifierType_ = notifierType; + setBodyParameter("NotifierType", notifierType); +} + int AddMonitorRequest::getBatchIndicator()const { return batchIndicator_; @@ -71,6 +115,17 @@ void AddMonitorRequest::setBatchIndicator(int batchIndicator) setBodyParameter("BatchIndicator", std::to_string(batchIndicator)); } +int AddMonitorRequest::getNotifierTimeOut()const +{ + return notifierTimeOut_; +} + +void AddMonitorRequest::setNotifierTimeOut(int notifierTimeOut) +{ + notifierTimeOut_ = notifierTimeOut; + setBodyParameter("NotifierTimeOut", std::to_string(notifierTimeOut)); +} + std::string AddMonitorRequest::getAlgorithmVendor()const { return algorithmVendor_; diff --git a/vcs/src/model/CreateCorpRequest.cc b/vcs/src/model/CreateCorpRequest.cc index 5a40900fc..f86d9fd0f 100644 --- a/vcs/src/model/CreateCorpRequest.cc +++ b/vcs/src/model/CreateCorpRequest.cc @@ -71,6 +71,17 @@ void CreateCorpRequest::setDescription(const std::string& description) setBodyParameter("Description", description); } +std::string CreateCorpRequest::getIconPath()const +{ + return iconPath_; +} + +void CreateCorpRequest::setIconPath(const std::string& iconPath) +{ + iconPath_ = iconPath; + setBodyParameter("IconPath", iconPath); +} + std::string CreateCorpRequest::getAppName()const { return appName_; diff --git a/vcs/src/model/ListCorpsResult.cc b/vcs/src/model/ListCorpsResult.cc index 9a5291497..26008e56a 100644 --- a/vcs/src/model/ListCorpsResult.cc +++ b/vcs/src/model/ListCorpsResult.cc @@ -68,6 +68,10 @@ void ListCorpsResult::parse(const std::string &payload) recordObject.deviceCount = std::stoi(dataNodeRecordsRecord["DeviceCount"].asString()); if(!dataNodeRecordsRecord["IsvSubId"].isNull()) recordObject.isvSubId = dataNodeRecordsRecord["IsvSubId"].asString(); + if(!dataNodeRecordsRecord["AcuUsed"].isNull()) + recordObject.acuUsed = std::stoi(dataNodeRecordsRecord["AcuUsed"].asString()); + if(!dataNodeRecordsRecord["IconPath"].isNull()) + recordObject.iconPath = dataNodeRecordsRecord["IconPath"].asString(); data_.records.push_back(recordObject); } if(!value["Code"].isNull()) diff --git a/vcs/src/model/ListDeviceGroupsRequest.cc b/vcs/src/model/ListDeviceGroupsRequest.cc new file mode 100644 index 000000000..100d794cd --- /dev/null +++ b/vcs/src/model/ListDeviceGroupsRequest.cc @@ -0,0 +1,106 @@ +/* + * 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::Vcs::Model::ListDeviceGroupsRequest; + +ListDeviceGroupsRequest::ListDeviceGroupsRequest() : + RpcServiceRequest("vcs", "2020-05-15", "ListDeviceGroups") +{ + setMethod(HttpRequest::Method::Post); +} + +ListDeviceGroupsRequest::~ListDeviceGroupsRequest() +{} + +int ListDeviceGroupsRequest::getIsPage()const +{ + return isPage_; +} + +void ListDeviceGroupsRequest::setIsPage(int isPage) +{ + isPage_ = isPage; + setBodyParameter("IsPage", std::to_string(isPage)); +} + +int ListDeviceGroupsRequest::getPageNum()const +{ + return pageNum_; +} + +void ListDeviceGroupsRequest::setPageNum(int pageNum) +{ + pageNum_ = pageNum; + setBodyParameter("PageNum", std::to_string(pageNum)); +} + +std::string ListDeviceGroupsRequest::getCorpIdList()const +{ + return corpIdList_; +} + +void ListDeviceGroupsRequest::setCorpIdList(const std::string& corpIdList) +{ + corpIdList_ = corpIdList; + setBodyParameter("CorpIdList", corpIdList); +} + +std::string ListDeviceGroupsRequest::getDeviceCodeList()const +{ + return deviceCodeList_; +} + +void ListDeviceGroupsRequest::setDeviceCodeList(const std::string& deviceCodeList) +{ + deviceCodeList_ = deviceCodeList; + setBodyParameter("DeviceCodeList", deviceCodeList); +} + +std::string ListDeviceGroupsRequest::getName()const +{ + return name_; +} + +void ListDeviceGroupsRequest::setName(const std::string& name) +{ + name_ = name; + setBodyParameter("Name", name); +} + +int ListDeviceGroupsRequest::getPageSize()const +{ + return pageSize_; +} + +void ListDeviceGroupsRequest::setPageSize(int pageSize) +{ + pageSize_ = pageSize; + setBodyParameter("PageSize", std::to_string(pageSize)); +} + +std::string ListDeviceGroupsRequest::getGroup()const +{ + return group_; +} + +void ListDeviceGroupsRequest::setGroup(const std::string& group) +{ + group_ = group; + setBodyParameter("Group", group); +} + diff --git a/vcs/src/model/ListDeviceGroupsResult.cc b/vcs/src/model/ListDeviceGroupsResult.cc new file mode 100644 index 000000000..02e9fc822 --- /dev/null +++ b/vcs/src/model/ListDeviceGroupsResult.cc @@ -0,0 +1,97 @@ +/* + * 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::Vcs; +using namespace AlibabaCloud::Vcs::Model; + +ListDeviceGroupsResult::ListDeviceGroupsResult() : + ServiceResult() +{} + +ListDeviceGroupsResult::ListDeviceGroupsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListDeviceGroupsResult::~ListDeviceGroupsResult() +{} + +void ListDeviceGroupsResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allDataNode = value["Data"]["DataItem"]; + for (auto valueDataDataItem : allDataNode) + { + DataItem dataObject; + if(!valueDataDataItem["TotalCount"].isNull()) + dataObject.totalCount = valueDataDataItem["TotalCount"].asString(); + auto allListNode = allDataNode["List"]["ListItem"]; + for (auto allDataNodeListListItem : allListNode) + { + DataItem::ListItem listObject; + if(!allDataNodeListListItem["DeviceGroup"].isNull()) + listObject.deviceGroup = allDataNodeListListItem["DeviceGroup"].asString(); + if(!allDataNodeListListItem["DeviceName"].isNull()) + listObject.deviceName = allDataNodeListListItem["DeviceName"].asString(); + if(!allDataNodeListListItem["DeviceCode"].isNull()) + listObject.deviceCode = allDataNodeListListItem["DeviceCode"].asString(); + if(!allDataNodeListListItem["BitRate"].isNull()) + listObject.bitRate = allDataNodeListListItem["BitRate"].asString(); + if(!allDataNodeListListItem["CodingFormat"].isNull()) + listObject.codingFormat = allDataNodeListListItem["CodingFormat"].asString(); + if(!allDataNodeListListItem["ResolvingPower"].isNull()) + listObject.resolvingPower = allDataNodeListListItem["ResolvingPower"].asString(); + if(!allDataNodeListListItem["DataSourceType"].isNull()) + listObject.dataSourceType = allDataNodeListListItem["DataSourceType"].asString(); + if(!allDataNodeListListItem["RegionName"].isNull()) + listObject.regionName = allDataNodeListListItem["RegionName"].asString(); + if(!allDataNodeListListItem["RegionId"].isNull()) + listObject.regionId = allDataNodeListListItem["RegionId"].asString(); + if(!allDataNodeListListItem["InstallAddress"].isNull()) + listObject.installAddress = allDataNodeListListItem["InstallAddress"].asString(); + dataObject.list.push_back(listObject); + } + data_.push_back(dataObject); + } + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string ListDeviceGroupsResult::getMessage()const +{ + return message_; +} + +std::vector ListDeviceGroupsResult::getData()const +{ + return data_; +} + +std::string ListDeviceGroupsResult::getCode()const +{ + return code_; +} + diff --git a/vcs/src/model/SearchObjectRequest.cc b/vcs/src/model/SearchObjectRequest.cc index ccedc0ee5..cfff4829a 100644 --- a/vcs/src/model/SearchObjectRequest.cc +++ b/vcs/src/model/SearchObjectRequest.cc @@ -27,6 +27,17 @@ SearchObjectRequest::SearchObjectRequest() : SearchObjectRequest::~SearchObjectRequest() {} +std::string SearchObjectRequest::getAlgorithmType()const +{ + return algorithmType_; +} + +void SearchObjectRequest::setAlgorithmType(const std::string& algorithmType) +{ + algorithmType_ = algorithmType; + setBodyParameter("AlgorithmType", algorithmType); +} + std::string SearchObjectRequest::getCorpId()const { return corpId_; @@ -38,6 +49,17 @@ void SearchObjectRequest::setCorpId(const std::string& corpId) setBodyParameter("CorpId", corpId); } +long SearchObjectRequest::getEndTime()const +{ + return endTime_; +} + +void SearchObjectRequest::setEndTime(long endTime) +{ + endTime_ = endTime; + setBodyParameter("EndTime", std::to_string(endTime)); +} + long SearchObjectRequest::getStartTime()const { return startTime_; @@ -60,61 +82,6 @@ void SearchObjectRequest::setPageNumber(int pageNumber) setBodyParameter("PageNumber", std::to_string(pageNumber)); } -std::string SearchObjectRequest::getPicContent()const -{ - return picContent_; -} - -void SearchObjectRequest::setPicContent(const std::string& picContent) -{ - picContent_ = picContent; - setBodyParameter("PicContent", picContent); -} - -int SearchObjectRequest::getPageSize()const -{ - return pageSize_; -} - -void SearchObjectRequest::setPageSize(int pageSize) -{ - pageSize_ = pageSize; - setBodyParameter("PageSize", std::to_string(pageSize)); -} - -std::string SearchObjectRequest::getObjectType()const -{ - return objectType_; -} - -void SearchObjectRequest::setObjectType(const std::string& objectType) -{ - objectType_ = objectType; - setBodyParameter("ObjectType", objectType); -} - -std::string SearchObjectRequest::getAlgorithmType()const -{ - return algorithmType_; -} - -void SearchObjectRequest::setAlgorithmType(const std::string& algorithmType) -{ - algorithmType_ = algorithmType; - setBodyParameter("AlgorithmType", algorithmType); -} - -long SearchObjectRequest::getEndTime()const -{ - return endTime_; -} - -void SearchObjectRequest::setEndTime(long endTime) -{ - endTime_ = endTime; - setBodyParameter("EndTime", std::to_string(endTime)); -} - std::map SearchObjectRequest::getDeviceList()const { return deviceList_; @@ -148,6 +115,28 @@ void SearchObjectRequest::setImagePath(const std::string& imagePath) setBodyParameter("ImagePath", imagePath); } +int SearchObjectRequest::getPageSize()const +{ + return pageSize_; +} + +void SearchObjectRequest::setPageSize(int pageSize) +{ + pageSize_ = pageSize; + setBodyParameter("PageSize", std::to_string(pageSize)); +} + +std::string SearchObjectRequest::getObjectType()const +{ + return objectType_; +} + +void SearchObjectRequest::setObjectType(const std::string& objectType) +{ + objectType_ = objectType; + setBodyParameter("ObjectType", objectType); +} + std::string SearchObjectRequest::getConditions()const { return conditions_; diff --git a/vcs/src/model/UpdateCorpRequest.cc b/vcs/src/model/UpdateCorpRequest.cc index cb933bbf0..c55fd9f74 100644 --- a/vcs/src/model/UpdateCorpRequest.cc +++ b/vcs/src/model/UpdateCorpRequest.cc @@ -71,6 +71,17 @@ void UpdateCorpRequest::setDescription(const std::string& description) setBodyParameter("Description", description); } +std::string UpdateCorpRequest::getIconPath()const +{ + return iconPath_; +} + +void UpdateCorpRequest::setIconPath(const std::string& iconPath) +{ + iconPath_ = iconPath; + setBodyParameter("IconPath", iconPath); +} + std::string UpdateCorpRequest::getAppName()const { return appName_; diff --git a/vcs/src/model/UpdateMonitorRequest.cc b/vcs/src/model/UpdateMonitorRequest.cc index 233ac9334..25ac38050 100644 --- a/vcs/src/model/UpdateMonitorRequest.cc +++ b/vcs/src/model/UpdateMonitorRequest.cc @@ -104,6 +104,17 @@ void UpdateMonitorRequest::setRuleExpression(const std::string& ruleExpression) setBodyParameter("RuleExpression", ruleExpression); } +int UpdateMonitorRequest::getNotifierTimeOut()const +{ + return notifierTimeOut_; +} + +void UpdateMonitorRequest::setNotifierTimeOut(int notifierTimeOut) +{ + notifierTimeOut_ = notifierTimeOut; + setBodyParameter("NotifierTimeOut", std::to_string(notifierTimeOut)); +} + std::string UpdateMonitorRequest::getTaskId()const { return taskId_; @@ -148,6 +159,28 @@ void UpdateMonitorRequest::setAttributeValueList(const std::string& attributeVal setBodyParameter("AttributeValueList", attributeValueList); } +std::string UpdateMonitorRequest::getNotifierAppSecret()const +{ + return notifierAppSecret_; +} + +void UpdateMonitorRequest::setNotifierAppSecret(const std::string& notifierAppSecret) +{ + notifierAppSecret_ = notifierAppSecret; + setBodyParameter("NotifierAppSecret", notifierAppSecret); +} + +std::string UpdateMonitorRequest::getNotifierExtendValues()const +{ + return notifierExtendValues_; +} + +void UpdateMonitorRequest::setNotifierExtendValues(const std::string& notifierExtendValues) +{ + notifierExtendValues_ = notifierExtendValues; + setBodyParameter("NotifierExtendValues", notifierExtendValues); +} + std::string UpdateMonitorRequest::getDeviceList()const { return deviceList_; @@ -159,6 +192,28 @@ void UpdateMonitorRequest::setDeviceList(const std::string& deviceList) setBodyParameter("DeviceList", deviceList); } +std::string UpdateMonitorRequest::getNotifierUrl()const +{ + return notifierUrl_; +} + +void UpdateMonitorRequest::setNotifierUrl(const std::string& notifierUrl) +{ + notifierUrl_ = notifierUrl; + setBodyParameter("NotifierUrl", notifierUrl); +} + +std::string UpdateMonitorRequest::getNotifierType()const +{ + return notifierType_; +} + +void UpdateMonitorRequest::setNotifierType(const std::string& notifierType) +{ + notifierType_ = notifierType; + setBodyParameter("NotifierType", notifierType); +} + std::string UpdateMonitorRequest::getAlgorithmVendor()const { return algorithmVendor_;