From 1e36d3c54a612a4b8508a2cb4f32a88c634bdb1a Mon Sep 17 00:00:00 2001 From: sdk-team Date: Tue, 31 Dec 2019 11:38:00 +0800 Subject: [PATCH] Generated 2019-09-28 for reid. --- CHANGELOG | 3 + VERSION | 2 +- reid/CMakeLists.txt | 4 + reid/include/alibabacloud/reid/ReidClient.h | 8 ++ .../reid/model/DescribeDevicesRequest.h | 48 +++++++ .../reid/model/DescribeDevicesResult.h | 75 +++++++++++ .../reid/model/DescribeOverviewDataResult.h | 23 ++++ reid/src/ReidClient.cc | 36 ++++++ reid/src/model/DescribeDevicesRequest.cc | 40 ++++++ reid/src/model/DescribeDevicesResult.cc | 118 ++++++++++++++++++ reid/src/model/DescribeOverviewDataResult.cc | 54 ++++++++ 11 files changed, 410 insertions(+), 1 deletion(-) create mode 100644 reid/include/alibabacloud/reid/model/DescribeDevicesRequest.h create mode 100644 reid/include/alibabacloud/reid/model/DescribeDevicesResult.h create mode 100644 reid/src/model/DescribeDevicesRequest.cc create mode 100644 reid/src/model/DescribeDevicesResult.cc diff --git a/CHANGELOG b/CHANGELOG index 99b777fd9..c0160fa2b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2019-12-31 Version 1.36.225 +- Generated 2019-09-28 for `reid`. + 2019-12-31 Version 1.36.224 - Support DeleteDBCluster. - Support ModifyDBCluster. diff --git a/VERSION b/VERSION index 9f9447396..a277199c6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.224 \ No newline at end of file +1.36.225 \ No newline at end of file diff --git a/reid/CMakeLists.txt b/reid/CMakeLists.txt index 8b9d94ce2..33670285d 100644 --- a/reid/CMakeLists.txt +++ b/reid/CMakeLists.txt @@ -27,6 +27,8 @@ set(reid_public_header_model include/alibabacloud/reid/model/DescribeCursorResult.h include/alibabacloud/reid/model/DescribeCustomerFlowByLocationRequest.h include/alibabacloud/reid/model/DescribeCustomerFlowByLocationResult.h + include/alibabacloud/reid/model/DescribeDevicesRequest.h + include/alibabacloud/reid/model/DescribeDevicesResult.h include/alibabacloud/reid/model/DescribeHeatMapRequest.h include/alibabacloud/reid/model/DescribeHeatMapResult.h include/alibabacloud/reid/model/DescribeImageUrlsRequest.h @@ -56,6 +58,8 @@ set(reid_src src/model/DescribeCursorResult.cc src/model/DescribeCustomerFlowByLocationRequest.cc src/model/DescribeCustomerFlowByLocationResult.cc + src/model/DescribeDevicesRequest.cc + src/model/DescribeDevicesResult.cc src/model/DescribeHeatMapRequest.cc src/model/DescribeHeatMapResult.cc src/model/DescribeImageUrlsRequest.cc diff --git a/reid/include/alibabacloud/reid/ReidClient.h b/reid/include/alibabacloud/reid/ReidClient.h index b70c5168b..0c3b5dec3 100644 --- a/reid/include/alibabacloud/reid/ReidClient.h +++ b/reid/include/alibabacloud/reid/ReidClient.h @@ -28,6 +28,8 @@ #include "model/DescribeCursorResult.h" #include "model/DescribeCustomerFlowByLocationRequest.h" #include "model/DescribeCustomerFlowByLocationResult.h" +#include "model/DescribeDevicesRequest.h" +#include "model/DescribeDevicesResult.h" #include "model/DescribeHeatMapRequest.h" #include "model/DescribeHeatMapResult.h" #include "model/DescribeImageUrlsRequest.h" @@ -66,6 +68,9 @@ namespace AlibabaCloud typedef Outcome DescribeCustomerFlowByLocationOutcome; typedef std::future DescribeCustomerFlowByLocationOutcomeCallable; typedef std::function&)> DescribeCustomerFlowByLocationAsyncHandler; + typedef Outcome DescribeDevicesOutcome; + typedef std::future DescribeDevicesOutcomeCallable; + typedef std::function&)> DescribeDevicesAsyncHandler; typedef Outcome DescribeHeatMapOutcome; typedef std::future DescribeHeatMapOutcomeCallable; typedef std::function&)> DescribeHeatMapAsyncHandler; @@ -110,6 +115,9 @@ namespace AlibabaCloud DescribeCustomerFlowByLocationOutcome describeCustomerFlowByLocation(const Model::DescribeCustomerFlowByLocationRequest &request)const; void describeCustomerFlowByLocationAsync(const Model::DescribeCustomerFlowByLocationRequest& request, const DescribeCustomerFlowByLocationAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DescribeCustomerFlowByLocationOutcomeCallable describeCustomerFlowByLocationCallable(const Model::DescribeCustomerFlowByLocationRequest& request) const; + DescribeDevicesOutcome describeDevices(const Model::DescribeDevicesRequest &request)const; + void describeDevicesAsync(const Model::DescribeDevicesRequest& request, const DescribeDevicesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DescribeDevicesOutcomeCallable describeDevicesCallable(const Model::DescribeDevicesRequest& request) const; DescribeHeatMapOutcome describeHeatMap(const Model::DescribeHeatMapRequest &request)const; void describeHeatMapAsync(const Model::DescribeHeatMapRequest& request, const DescribeHeatMapAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DescribeHeatMapOutcomeCallable describeHeatMapCallable(const Model::DescribeHeatMapRequest& request) const; diff --git a/reid/include/alibabacloud/reid/model/DescribeDevicesRequest.h b/reid/include/alibabacloud/reid/model/DescribeDevicesRequest.h new file mode 100644 index 000000000..1d0a53dd5 --- /dev/null +++ b/reid/include/alibabacloud/reid/model/DescribeDevicesRequest.h @@ -0,0 +1,48 @@ +/* + * 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_REID_MODEL_DESCRIBEDEVICESREQUEST_H_ +#define ALIBABACLOUD_REID_MODEL_DESCRIBEDEVICESREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Reid + { + namespace Model + { + class ALIBABACLOUD_REID_EXPORT DescribeDevicesRequest : public RpcServiceRequest + { + + public: + DescribeDevicesRequest(); + ~DescribeDevicesRequest(); + + long getStoreId()const; + void setStoreId(long storeId); + + private: + long storeId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_REID_MODEL_DESCRIBEDEVICESREQUEST_H_ \ No newline at end of file diff --git a/reid/include/alibabacloud/reid/model/DescribeDevicesResult.h b/reid/include/alibabacloud/reid/model/DescribeDevicesResult.h new file mode 100644 index 000000000..26ed08436 --- /dev/null +++ b/reid/include/alibabacloud/reid/model/DescribeDevicesResult.h @@ -0,0 +1,75 @@ +/* + * 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_REID_MODEL_DESCRIBEDEVICESRESULT_H_ +#define ALIBABACLOUD_REID_MODEL_DESCRIBEDEVICESRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Reid + { + namespace Model + { + class ALIBABACLOUD_REID_EXPORT DescribeDevicesResult : public ServiceResult + { + public: + struct Device + { + std::string agentMac; + std::string agentStatus; + std::string agentIp; + std::string ipcIp; + long ipcReceiveTime; + std::string ipcStatus; + long agentReceiveTime; + }; + + + DescribeDevicesResult(); + explicit DescribeDevicesResult(const std::string &payload); + ~DescribeDevicesResult(); + std::string getMessage()const; + std::string getDynamicCode()const; + std::string getErrorCode()const; + std::string getDynamicMessage()const; + std::vector getDevices()const; + std::string getErrorMessage()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + std::string dynamicCode_; + std::string errorCode_; + std::string dynamicMessage_; + std::vector devices_; + std::string errorMessage_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_REID_MODEL_DESCRIBEDEVICESRESULT_H_ \ No newline at end of file diff --git a/reid/include/alibabacloud/reid/model/DescribeOverviewDataResult.h b/reid/include/alibabacloud/reid/model/DescribeOverviewDataResult.h index c1f5a0e6e..fa2205741 100644 --- a/reid/include/alibabacloud/reid/model/DescribeOverviewDataResult.h +++ b/reid/include/alibabacloud/reid/model/DescribeOverviewDataResult.h @@ -45,22 +45,45 @@ namespace AlibabaCloud float stayAvgPeriodWOWPercent; float uvAvgWOWPercent; }; + struct AccurateOverviewDetail + { + std::string stayDeepAvg; + long uv; + std::string uvEverySqm; + std::string uvEverySqmGrowthWOWPercent; + std::string uvAvg; + std::string uvWOWPercent; + std::string stayAvgPeriod; + std::string stayDeepAvgWOWPercent; + std::string stayAvgPeriodWOWPercent; + std::string uvAvgWOWPercent; + }; DescribeOverviewDataResult(); explicit DescribeOverviewDataResult(const std::string &payload); ~DescribeOverviewDataResult(); OverviewDetail getOverviewDetail()const; + std::string getMessage()const; + AccurateOverviewDetail getAccurateOverviewDetail()const; + std::string getDynamicCode()const; std::string getErrorCode()const; + std::string getDynamicMessage()const; std::string getErrorMessage()const; + std::string getCode()const; bool getSuccess()const; protected: void parse(const std::string &payload); private: OverviewDetail overviewDetail_; + std::string message_; + AccurateOverviewDetail accurateOverviewDetail_; + std::string dynamicCode_; std::string errorCode_; + std::string dynamicMessage_; std::string errorMessage_; + std::string code_; bool success_; }; diff --git a/reid/src/ReidClient.cc b/reid/src/ReidClient.cc index f9c1d136b..fbc82c168 100644 --- a/reid/src/ReidClient.cc +++ b/reid/src/ReidClient.cc @@ -159,6 +159,42 @@ ReidClient::DescribeCustomerFlowByLocationOutcomeCallable ReidClient::describeCu return task->get_future(); } +ReidClient::DescribeDevicesOutcome ReidClient::describeDevices(const DescribeDevicesRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DescribeDevicesOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DescribeDevicesOutcome(DescribeDevicesResult(outcome.result())); + else + return DescribeDevicesOutcome(outcome.error()); +} + +void ReidClient::describeDevicesAsync(const DescribeDevicesRequest& request, const DescribeDevicesAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, describeDevices(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ReidClient::DescribeDevicesOutcomeCallable ReidClient::describeDevicesCallable(const DescribeDevicesRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->describeDevices(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + ReidClient::DescribeHeatMapOutcome ReidClient::describeHeatMap(const DescribeHeatMapRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/reid/src/model/DescribeDevicesRequest.cc b/reid/src/model/DescribeDevicesRequest.cc new file mode 100644 index 000000000..e13e18787 --- /dev/null +++ b/reid/src/model/DescribeDevicesRequest.cc @@ -0,0 +1,40 @@ +/* + * 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::Reid::Model::DescribeDevicesRequest; + +DescribeDevicesRequest::DescribeDevicesRequest() : + RpcServiceRequest("reid", "2019-09-28", "DescribeDevices") +{ + setMethod(HttpRequest::Method::Post); +} + +DescribeDevicesRequest::~DescribeDevicesRequest() +{} + +long DescribeDevicesRequest::getStoreId()const +{ + return storeId_; +} + +void DescribeDevicesRequest::setStoreId(long storeId) +{ + storeId_ = storeId; + setCoreParameter("StoreId", std::to_string(storeId)); +} + diff --git a/reid/src/model/DescribeDevicesResult.cc b/reid/src/model/DescribeDevicesResult.cc new file mode 100644 index 000000000..4e4aa1cd2 --- /dev/null +++ b/reid/src/model/DescribeDevicesResult.cc @@ -0,0 +1,118 @@ +/* + * 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::Reid; +using namespace AlibabaCloud::Reid::Model; + +DescribeDevicesResult::DescribeDevicesResult() : + ServiceResult() +{} + +DescribeDevicesResult::DescribeDevicesResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DescribeDevicesResult::~DescribeDevicesResult() +{} + +void DescribeDevicesResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allDevicesNode = value["Devices"]["Device"]; + for (auto valueDevicesDevice : allDevicesNode) + { + Device devicesObject; + if(!valueDevicesDevice["AgentStatus"].isNull()) + devicesObject.agentStatus = valueDevicesDevice["AgentStatus"].asString(); + if(!valueDevicesDevice["IpcStatus"].isNull()) + devicesObject.ipcStatus = valueDevicesDevice["IpcStatus"].asString(); + if(!valueDevicesDevice["AgentIp"].isNull()) + devicesObject.agentIp = valueDevicesDevice["AgentIp"].asString(); + if(!valueDevicesDevice["IpcIp"].isNull()) + devicesObject.ipcIp = valueDevicesDevice["IpcIp"].asString(); + if(!valueDevicesDevice["AgentReceiveTime"].isNull()) + devicesObject.agentReceiveTime = std::stol(valueDevicesDevice["AgentReceiveTime"].asString()); + if(!valueDevicesDevice["AgentMac"].isNull()) + devicesObject.agentMac = valueDevicesDevice["AgentMac"].asString(); + if(!valueDevicesDevice["IpcReceiveTime"].isNull()) + devicesObject.ipcReceiveTime = std::stol(valueDevicesDevice["IpcReceiveTime"].asString()); + devices_.push_back(devicesObject); + } + if(!value["ErrorCode"].isNull()) + errorCode_ = value["ErrorCode"].asString(); + if(!value["ErrorMessage"].isNull()) + errorMessage_ = value["ErrorMessage"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["DynamicCode"].isNull()) + dynamicCode_ = value["DynamicCode"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["DynamicMessage"].isNull()) + dynamicMessage_ = value["DynamicMessage"].asString(); + +} + +std::string DescribeDevicesResult::getMessage()const +{ + return message_; +} + +std::string DescribeDevicesResult::getDynamicCode()const +{ + return dynamicCode_; +} + +std::string DescribeDevicesResult::getErrorCode()const +{ + return errorCode_; +} + +std::string DescribeDevicesResult::getDynamicMessage()const +{ + return dynamicMessage_; +} + +std::vector DescribeDevicesResult::getDevices()const +{ + return devices_; +} + +std::string DescribeDevicesResult::getErrorMessage()const +{ + return errorMessage_; +} + +std::string DescribeDevicesResult::getCode()const +{ + return code_; +} + +bool DescribeDevicesResult::getSuccess()const +{ + return success_; +} + diff --git a/reid/src/model/DescribeOverviewDataResult.cc b/reid/src/model/DescribeOverviewDataResult.cc index 7d079cd9e..c9e70a24a 100644 --- a/reid/src/model/DescribeOverviewDataResult.cc +++ b/reid/src/model/DescribeOverviewDataResult.cc @@ -60,12 +60,41 @@ void DescribeOverviewDataResult::parse(const std::string &payload) overviewDetail_.uvAvg = std::stof(overviewDetailNode["UvAvg"].asString()); if(!overviewDetailNode["StayAvgPeriod"].isNull()) overviewDetail_.stayAvgPeriod = std::stof(overviewDetailNode["StayAvgPeriod"].asString()); + auto accurateOverviewDetailNode = value["AccurateOverviewDetail"]; + if(!accurateOverviewDetailNode["StayDeepAvgWOWPercent"].isNull()) + accurateOverviewDetail_.stayDeepAvgWOWPercent = accurateOverviewDetailNode["StayDeepAvgWOWPercent"].asString(); + if(!accurateOverviewDetailNode["StayDeepAvg"].isNull()) + accurateOverviewDetail_.stayDeepAvg = accurateOverviewDetailNode["StayDeepAvg"].asString(); + if(!accurateOverviewDetailNode["UvAvgWOWPercent"].isNull()) + accurateOverviewDetail_.uvAvgWOWPercent = accurateOverviewDetailNode["UvAvgWOWPercent"].asString(); + if(!accurateOverviewDetailNode["StayAvgPeriodWOWPercent"].isNull()) + accurateOverviewDetail_.stayAvgPeriodWOWPercent = accurateOverviewDetailNode["StayAvgPeriodWOWPercent"].asString(); + if(!accurateOverviewDetailNode["UvWOWPercent"].isNull()) + accurateOverviewDetail_.uvWOWPercent = accurateOverviewDetailNode["UvWOWPercent"].asString(); + if(!accurateOverviewDetailNode["UvEverySqmGrowthWOWPercent"].isNull()) + accurateOverviewDetail_.uvEverySqmGrowthWOWPercent = accurateOverviewDetailNode["UvEverySqmGrowthWOWPercent"].asString(); + if(!accurateOverviewDetailNode["Uv"].isNull()) + accurateOverviewDetail_.uv = std::stol(accurateOverviewDetailNode["Uv"].asString()); + if(!accurateOverviewDetailNode["UvEverySqm"].isNull()) + accurateOverviewDetail_.uvEverySqm = accurateOverviewDetailNode["UvEverySqm"].asString(); + if(!accurateOverviewDetailNode["UvAvg"].isNull()) + accurateOverviewDetail_.uvAvg = accurateOverviewDetailNode["UvAvg"].asString(); + if(!accurateOverviewDetailNode["StayAvgPeriod"].isNull()) + accurateOverviewDetail_.stayAvgPeriod = accurateOverviewDetailNode["StayAvgPeriod"].asString(); if(!value["ErrorCode"].isNull()) errorCode_ = value["ErrorCode"].asString(); if(!value["ErrorMessage"].isNull()) errorMessage_ = value["ErrorMessage"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["DynamicCode"].isNull()) + dynamicCode_ = value["DynamicCode"].asString(); if(!value["Success"].isNull()) success_ = value["Success"].asString() == "true"; + if(!value["DynamicMessage"].isNull()) + dynamicMessage_ = value["DynamicMessage"].asString(); } @@ -74,16 +103,41 @@ DescribeOverviewDataResult::OverviewDetail DescribeOverviewDataResult::getOvervi return overviewDetail_; } +std::string DescribeOverviewDataResult::getMessage()const +{ + return message_; +} + +DescribeOverviewDataResult::AccurateOverviewDetail DescribeOverviewDataResult::getAccurateOverviewDetail()const +{ + return accurateOverviewDetail_; +} + +std::string DescribeOverviewDataResult::getDynamicCode()const +{ + return dynamicCode_; +} + std::string DescribeOverviewDataResult::getErrorCode()const { return errorCode_; } +std::string DescribeOverviewDataResult::getDynamicMessage()const +{ + return dynamicMessage_; +} + std::string DescribeOverviewDataResult::getErrorMessage()const { return errorMessage_; } +std::string DescribeOverviewDataResult::getCode()const +{ + return code_; +} + bool DescribeOverviewDataResult::getSuccess()const { return success_;