diff --git a/CHANGELOG b/CHANGELOG index 23ce34613..89c6d8bf1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-08-24 Version: 1.36.605 +- Edit QueryMetricByPage api. + 2020-08-21 Version: 1.36.604 - Add QueryMetricByPage api. - Add GetAppApiByPage api. diff --git a/VERSION b/VERSION index 7244669b4..6aa33167b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.604 \ No newline at end of file +1.36.605 \ No newline at end of file diff --git a/arms/CMakeLists.txt b/arms/CMakeLists.txt index cd54b7493..45a61e907 100644 --- a/arms/CMakeLists.txt +++ b/arms/CMakeLists.txt @@ -51,6 +51,8 @@ set(arms_public_header_model include/alibabacloud/arms/model/DescribeTraceLicenseKeyResult.h include/alibabacloud/arms/model/DescribeTraceLocationRequest.h include/alibabacloud/arms/model/DescribeTraceLocationResult.h + include/alibabacloud/arms/model/GetAppApiByPageRequest.h + include/alibabacloud/arms/model/GetAppApiByPageResult.h include/alibabacloud/arms/model/GetConsistencySnapshotRequest.h include/alibabacloud/arms/model/GetConsistencySnapshotResult.h include/alibabacloud/arms/model/GetMultipleTraceRequest.h @@ -83,6 +85,8 @@ set(arms_public_header_model include/alibabacloud/arms/model/QueryDatasetResult.h include/alibabacloud/arms/model/QueryMetricRequest.h include/alibabacloud/arms/model/QueryMetricResult.h + include/alibabacloud/arms/model/QueryMetricByPageRequest.h + include/alibabacloud/arms/model/QueryMetricByPageResult.h include/alibabacloud/arms/model/SearchAlertContactRequest.h include/alibabacloud/arms/model/SearchAlertContactResult.h include/alibabacloud/arms/model/SearchAlertContactGroupRequest.h @@ -148,6 +152,8 @@ set(arms_src src/model/DescribeTraceLicenseKeyResult.cc src/model/DescribeTraceLocationRequest.cc src/model/DescribeTraceLocationResult.cc + src/model/GetAppApiByPageRequest.cc + src/model/GetAppApiByPageResult.cc src/model/GetConsistencySnapshotRequest.cc src/model/GetConsistencySnapshotResult.cc src/model/GetMultipleTraceRequest.cc @@ -180,6 +186,8 @@ set(arms_src src/model/QueryDatasetResult.cc src/model/QueryMetricRequest.cc src/model/QueryMetricResult.cc + src/model/QueryMetricByPageRequest.cc + src/model/QueryMetricByPageResult.cc src/model/SearchAlertContactRequest.cc src/model/SearchAlertContactResult.cc src/model/SearchAlertContactGroupRequest.cc diff --git a/arms/include/alibabacloud/arms/ARMSClient.h b/arms/include/alibabacloud/arms/ARMSClient.h index 2e415787d..85be02923 100644 --- a/arms/include/alibabacloud/arms/ARMSClient.h +++ b/arms/include/alibabacloud/arms/ARMSClient.h @@ -52,6 +52,8 @@ #include "model/DescribeTraceLicenseKeyResult.h" #include "model/DescribeTraceLocationRequest.h" #include "model/DescribeTraceLocationResult.h" +#include "model/GetAppApiByPageRequest.h" +#include "model/GetAppApiByPageResult.h" #include "model/GetConsistencySnapshotRequest.h" #include "model/GetConsistencySnapshotResult.h" #include "model/GetMultipleTraceRequest.h" @@ -84,6 +86,8 @@ #include "model/QueryDatasetResult.h" #include "model/QueryMetricRequest.h" #include "model/QueryMetricResult.h" +#include "model/QueryMetricByPageRequest.h" +#include "model/QueryMetricByPageResult.h" #include "model/SearchAlertContactRequest.h" #include "model/SearchAlertContactResult.h" #include "model/SearchAlertContactGroupRequest.h" @@ -170,6 +174,9 @@ namespace AlibabaCloud typedef Outcome DescribeTraceLocationOutcome; typedef std::future DescribeTraceLocationOutcomeCallable; typedef std::function&)> DescribeTraceLocationAsyncHandler; + typedef Outcome GetAppApiByPageOutcome; + typedef std::future GetAppApiByPageOutcomeCallable; + typedef std::function&)> GetAppApiByPageAsyncHandler; typedef Outcome GetConsistencySnapshotOutcome; typedef std::future GetConsistencySnapshotOutcomeCallable; typedef std::function&)> GetConsistencySnapshotAsyncHandler; @@ -218,6 +225,9 @@ namespace AlibabaCloud typedef Outcome QueryMetricOutcome; typedef std::future QueryMetricOutcomeCallable; typedef std::function&)> QueryMetricAsyncHandler; + typedef Outcome QueryMetricByPageOutcome; + typedef std::future QueryMetricByPageOutcomeCallable; + typedef std::function&)> QueryMetricByPageAsyncHandler; typedef Outcome SearchAlertContactOutcome; typedef std::future SearchAlertContactOutcomeCallable; typedef std::function&)> SearchAlertContactAsyncHandler; @@ -316,6 +326,9 @@ namespace AlibabaCloud DescribeTraceLocationOutcome describeTraceLocation(const Model::DescribeTraceLocationRequest &request)const; void describeTraceLocationAsync(const Model::DescribeTraceLocationRequest& request, const DescribeTraceLocationAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DescribeTraceLocationOutcomeCallable describeTraceLocationCallable(const Model::DescribeTraceLocationRequest& request) const; + GetAppApiByPageOutcome getAppApiByPage(const Model::GetAppApiByPageRequest &request)const; + void getAppApiByPageAsync(const Model::GetAppApiByPageRequest& request, const GetAppApiByPageAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetAppApiByPageOutcomeCallable getAppApiByPageCallable(const Model::GetAppApiByPageRequest& request) const; GetConsistencySnapshotOutcome getConsistencySnapshot(const Model::GetConsistencySnapshotRequest &request)const; void getConsistencySnapshotAsync(const Model::GetConsistencySnapshotRequest& request, const GetConsistencySnapshotAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetConsistencySnapshotOutcomeCallable getConsistencySnapshotCallable(const Model::GetConsistencySnapshotRequest& request) const; @@ -364,6 +377,9 @@ namespace AlibabaCloud QueryMetricOutcome queryMetric(const Model::QueryMetricRequest &request)const; void queryMetricAsync(const Model::QueryMetricRequest& request, const QueryMetricAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; QueryMetricOutcomeCallable queryMetricCallable(const Model::QueryMetricRequest& request) const; + QueryMetricByPageOutcome queryMetricByPage(const Model::QueryMetricByPageRequest &request)const; + void queryMetricByPageAsync(const Model::QueryMetricByPageRequest& request, const QueryMetricByPageAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + QueryMetricByPageOutcomeCallable queryMetricByPageCallable(const Model::QueryMetricByPageRequest& request) const; SearchAlertContactOutcome searchAlertContact(const Model::SearchAlertContactRequest &request)const; void searchAlertContactAsync(const Model::SearchAlertContactRequest& request, const SearchAlertContactAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; SearchAlertContactOutcomeCallable searchAlertContactCallable(const Model::SearchAlertContactRequest& request) const; diff --git a/arms/include/alibabacloud/arms/model/GetAppApiByPageRequest.h b/arms/include/alibabacloud/arms/model/GetAppApiByPageRequest.h new file mode 100644 index 000000000..9d3d730c8 --- /dev/null +++ b/arms/include/alibabacloud/arms/model/GetAppApiByPageRequest.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_ARMS_MODEL_GETAPPAPIBYPAGEREQUEST_H_ +#define ALIBABACLOUD_ARMS_MODEL_GETAPPAPIBYPAGEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace ARMS + { + namespace Model + { + class ALIBABACLOUD_ARMS_EXPORT GetAppApiByPageRequest : public RpcServiceRequest + { + + public: + GetAppApiByPageRequest(); + ~GetAppApiByPageRequest(); + + long getEndTime()const; + void setEndTime(long endTime); + int getCurrentPage()const; + void setCurrentPage(int currentPage); + std::string getPId()const; + void setPId(const std::string& pId); + long getStartTime()const; + void setStartTime(long startTime); + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + int getPageSize()const; + void setPageSize(int pageSize); + int getIntervalMills()const; + void setIntervalMills(int intervalMills); + + private: + long endTime_; + int currentPage_; + std::string pId_; + long startTime_; + std::string regionId_; + int pageSize_; + int intervalMills_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ARMS_MODEL_GETAPPAPIBYPAGEREQUEST_H_ \ No newline at end of file diff --git a/arms/include/alibabacloud/arms/model/GetAppApiByPageResult.h b/arms/include/alibabacloud/arms/model/GetAppApiByPageResult.h new file mode 100644 index 000000000..8009c832f --- /dev/null +++ b/arms/include/alibabacloud/arms/model/GetAppApiByPageResult.h @@ -0,0 +1,64 @@ +/* + * 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_ARMS_MODEL_GETAPPAPIBYPAGERESULT_H_ +#define ALIBABACLOUD_ARMS_MODEL_GETAPPAPIBYPAGERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace ARMS + { + namespace Model + { + class ALIBABACLOUD_ARMS_EXPORT GetAppApiByPageResult : public ServiceResult + { + public: + struct Data + { + int pageSize; + std::string total; + int page; + std::vector items; + }; + + + GetAppApiByPageResult(); + explicit GetAppApiByPageResult(const std::string &payload); + ~GetAppApiByPageResult(); + std::string getMessage()const; + Data getData()const; + int getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + Data data_; + int code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ARMS_MODEL_GETAPPAPIBYPAGERESULT_H_ \ No newline at end of file diff --git a/arms/include/alibabacloud/arms/model/QueryMetricByPageRequest.h b/arms/include/alibabacloud/arms/model/QueryMetricByPageRequest.h new file mode 100644 index 000000000..aaff75a5d --- /dev/null +++ b/arms/include/alibabacloud/arms/model/QueryMetricByPageRequest.h @@ -0,0 +1,93 @@ +/* + * 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_ARMS_MODEL_QUERYMETRICBYPAGEREQUEST_H_ +#define ALIBABACLOUD_ARMS_MODEL_QUERYMETRICBYPAGEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace ARMS + { + namespace Model + { + class ALIBABACLOUD_ARMS_EXPORT QueryMetricByPageRequest : public RpcServiceRequest + { + public: + struct Filters + { + std::string value; + std::string key; + }; + + public: + QueryMetricByPageRequest(); + ~QueryMetricByPageRequest(); + + std::string getConsistencyQueryStrategy()const; + void setConsistencyQueryStrategy(const std::string& consistencyQueryStrategy); + long getEndTime()const; + void setEndTime(long endTime); + std::string getOrderBy()const; + void setOrderBy(const std::string& orderBy); + int getCurrentPage()const; + void setCurrentPage(int currentPage); + long getStartTime()const; + void setStartTime(long startTime); + std::vector getFilters()const; + void setFilters(const std::vector& filters); + std::string getConsistencyDataKey()const; + void setConsistencyDataKey(const std::string& consistencyDataKey); + std::string getProxyUserId()const; + void setProxyUserId(const std::string& proxyUserId); + std::vector getMeasures()const; + void setMeasures(const std::vector& measures); + int getIntervalInSec()const; + void setIntervalInSec(int intervalInSec); + std::string getMetric()const; + void setMetric(const std::string& metric); + int getPageSize()const; + void setPageSize(int pageSize); + std::vector getDimensions()const; + void setDimensions(const std::vector& dimensions); + std::string getOrder()const; + void setOrder(const std::string& order); + + private: + std::string consistencyQueryStrategy_; + long endTime_; + std::string orderBy_; + int currentPage_; + long startTime_; + std::vector filters_; + std::string consistencyDataKey_; + std::string proxyUserId_; + std::vector measures_; + int intervalInSec_; + std::string metric_; + int pageSize_; + std::vector dimensions_; + std::string order_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ARMS_MODEL_QUERYMETRICBYPAGEREQUEST_H_ \ No newline at end of file diff --git a/arms/include/alibabacloud/arms/model/QueryMetricByPageResult.h b/arms/include/alibabacloud/arms/model/QueryMetricByPageResult.h new file mode 100644 index 000000000..471a463f2 --- /dev/null +++ b/arms/include/alibabacloud/arms/model/QueryMetricByPageResult.h @@ -0,0 +1,64 @@ +/* + * 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_ARMS_MODEL_QUERYMETRICBYPAGERESULT_H_ +#define ALIBABACLOUD_ARMS_MODEL_QUERYMETRICBYPAGERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace ARMS + { + namespace Model + { + class ALIBABACLOUD_ARMS_EXPORT QueryMetricByPageResult : public ServiceResult + { + public: + struct Data + { + int pageSize; + int total; + int page; + std::vector items; + }; + + + QueryMetricByPageResult(); + explicit QueryMetricByPageResult(const std::string &payload); + ~QueryMetricByPageResult(); + std::string getMessage()const; + Data getData()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + Data data_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ARMS_MODEL_QUERYMETRICBYPAGERESULT_H_ \ No newline at end of file diff --git a/arms/src/ARMSClient.cc b/arms/src/ARMSClient.cc index b9d806d7d..a1c92a774 100644 --- a/arms/src/ARMSClient.cc +++ b/arms/src/ARMSClient.cc @@ -591,6 +591,42 @@ ARMSClient::DescribeTraceLocationOutcomeCallable ARMSClient::describeTraceLocati return task->get_future(); } +ARMSClient::GetAppApiByPageOutcome ARMSClient::getAppApiByPage(const GetAppApiByPageRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetAppApiByPageOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetAppApiByPageOutcome(GetAppApiByPageResult(outcome.result())); + else + return GetAppApiByPageOutcome(outcome.error()); +} + +void ARMSClient::getAppApiByPageAsync(const GetAppApiByPageRequest& request, const GetAppApiByPageAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getAppApiByPage(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ARMSClient::GetAppApiByPageOutcomeCallable ARMSClient::getAppApiByPageCallable(const GetAppApiByPageRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getAppApiByPage(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + ARMSClient::GetConsistencySnapshotOutcome ARMSClient::getConsistencySnapshot(const GetConsistencySnapshotRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -1167,6 +1203,42 @@ ARMSClient::QueryMetricOutcomeCallable ARMSClient::queryMetricCallable(const Que return task->get_future(); } +ARMSClient::QueryMetricByPageOutcome ARMSClient::queryMetricByPage(const QueryMetricByPageRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return QueryMetricByPageOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return QueryMetricByPageOutcome(QueryMetricByPageResult(outcome.result())); + else + return QueryMetricByPageOutcome(outcome.error()); +} + +void ARMSClient::queryMetricByPageAsync(const QueryMetricByPageRequest& request, const QueryMetricByPageAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, queryMetricByPage(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ARMSClient::QueryMetricByPageOutcomeCallable ARMSClient::queryMetricByPageCallable(const QueryMetricByPageRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->queryMetricByPage(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + ARMSClient::SearchAlertContactOutcome ARMSClient::searchAlertContact(const SearchAlertContactRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/arms/src/model/GetAppApiByPageRequest.cc b/arms/src/model/GetAppApiByPageRequest.cc new file mode 100644 index 000000000..12e49e1bc --- /dev/null +++ b/arms/src/model/GetAppApiByPageRequest.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::ARMS::Model::GetAppApiByPageRequest; + +GetAppApiByPageRequest::GetAppApiByPageRequest() : + RpcServiceRequest("arms", "2019-08-08", "GetAppApiByPage") +{ + setMethod(HttpRequest::Method::Post); +} + +GetAppApiByPageRequest::~GetAppApiByPageRequest() +{} + +long GetAppApiByPageRequest::getEndTime()const +{ + return endTime_; +} + +void GetAppApiByPageRequest::setEndTime(long endTime) +{ + endTime_ = endTime; + setParameter("EndTime", std::to_string(endTime)); +} + +int GetAppApiByPageRequest::getCurrentPage()const +{ + return currentPage_; +} + +void GetAppApiByPageRequest::setCurrentPage(int currentPage) +{ + currentPage_ = currentPage; + setParameter("CurrentPage", std::to_string(currentPage)); +} + +std::string GetAppApiByPageRequest::getPId()const +{ + return pId_; +} + +void GetAppApiByPageRequest::setPId(const std::string& pId) +{ + pId_ = pId; + setParameter("PId", pId); +} + +long GetAppApiByPageRequest::getStartTime()const +{ + return startTime_; +} + +void GetAppApiByPageRequest::setStartTime(long startTime) +{ + startTime_ = startTime; + setParameter("StartTime", std::to_string(startTime)); +} + +std::string GetAppApiByPageRequest::getRegionId()const +{ + return regionId_; +} + +void GetAppApiByPageRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +int GetAppApiByPageRequest::getPageSize()const +{ + return pageSize_; +} + +void GetAppApiByPageRequest::setPageSize(int pageSize) +{ + pageSize_ = pageSize; + setParameter("PageSize", std::to_string(pageSize)); +} + +int GetAppApiByPageRequest::getIntervalMills()const +{ + return intervalMills_; +} + +void GetAppApiByPageRequest::setIntervalMills(int intervalMills) +{ + intervalMills_ = intervalMills; + setParameter("IntervalMills", std::to_string(intervalMills)); +} + diff --git a/arms/src/model/GetAppApiByPageResult.cc b/arms/src/model/GetAppApiByPageResult.cc new file mode 100644 index 000000000..fa7cdb733 --- /dev/null +++ b/arms/src/model/GetAppApiByPageResult.cc @@ -0,0 +1,80 @@ +/* + * 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::ARMS; +using namespace AlibabaCloud::ARMS::Model; + +GetAppApiByPageResult::GetAppApiByPageResult() : + ServiceResult() +{} + +GetAppApiByPageResult::GetAppApiByPageResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetAppApiByPageResult::~GetAppApiByPageResult() +{} + +void GetAppApiByPageResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["Total"].isNull()) + data_.total = dataNode["Total"].asString(); + if(!dataNode["Page"].isNull()) + data_.page = std::stoi(dataNode["Page"].asString()); + if(!dataNode["PageSize"].isNull()) + data_.pageSize = std::stoi(dataNode["PageSize"].asString()); + auto allItems = dataNode["Items"]["Items"]; + for (auto value : allItems) + data_.items.push_back(value.asString()); + if(!value["Code"].isNull()) + code_ = std::stoi(value["Code"].asString()); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + +} + +std::string GetAppApiByPageResult::getMessage()const +{ + return message_; +} + +GetAppApiByPageResult::Data GetAppApiByPageResult::getData()const +{ + return data_; +} + +int GetAppApiByPageResult::getCode()const +{ + return code_; +} + +bool GetAppApiByPageResult::getSuccess()const +{ + return success_; +} + diff --git a/arms/src/model/QueryMetricByPageRequest.cc b/arms/src/model/QueryMetricByPageRequest.cc new file mode 100644 index 000000000..01d6807a1 --- /dev/null +++ b/arms/src/model/QueryMetricByPageRequest.cc @@ -0,0 +1,192 @@ +/* + * 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::ARMS::Model::QueryMetricByPageRequest; + +QueryMetricByPageRequest::QueryMetricByPageRequest() : + RpcServiceRequest("arms", "2019-08-08", "QueryMetricByPage") +{ + setMethod(HttpRequest::Method::Post); +} + +QueryMetricByPageRequest::~QueryMetricByPageRequest() +{} + +std::string QueryMetricByPageRequest::getConsistencyQueryStrategy()const +{ + return consistencyQueryStrategy_; +} + +void QueryMetricByPageRequest::setConsistencyQueryStrategy(const std::string& consistencyQueryStrategy) +{ + consistencyQueryStrategy_ = consistencyQueryStrategy; + setParameter("ConsistencyQueryStrategy", consistencyQueryStrategy); +} + +long QueryMetricByPageRequest::getEndTime()const +{ + return endTime_; +} + +void QueryMetricByPageRequest::setEndTime(long endTime) +{ + endTime_ = endTime; + setParameter("EndTime", std::to_string(endTime)); +} + +std::string QueryMetricByPageRequest::getOrderBy()const +{ + return orderBy_; +} + +void QueryMetricByPageRequest::setOrderBy(const std::string& orderBy) +{ + orderBy_ = orderBy; + setParameter("OrderBy", orderBy); +} + +int QueryMetricByPageRequest::getCurrentPage()const +{ + return currentPage_; +} + +void QueryMetricByPageRequest::setCurrentPage(int currentPage) +{ + currentPage_ = currentPage; + setParameter("CurrentPage", std::to_string(currentPage)); +} + +long QueryMetricByPageRequest::getStartTime()const +{ + return startTime_; +} + +void QueryMetricByPageRequest::setStartTime(long startTime) +{ + startTime_ = startTime; + setParameter("StartTime", std::to_string(startTime)); +} + +std::vector QueryMetricByPageRequest::getFilters()const +{ + return filters_; +} + +void QueryMetricByPageRequest::setFilters(const std::vector& filters) +{ + filters_ = filters; + for(int dep1 = 0; dep1!= filters.size(); dep1++) { + auto filtersObj = filters.at(dep1); + std::string filtersObjStr = "Filters." + std::to_string(dep1 + 1); + setParameter(filtersObjStr + ".Value", filtersObj.value); + setParameter(filtersObjStr + ".Key", filtersObj.key); + } +} + +std::string QueryMetricByPageRequest::getConsistencyDataKey()const +{ + return consistencyDataKey_; +} + +void QueryMetricByPageRequest::setConsistencyDataKey(const std::string& consistencyDataKey) +{ + consistencyDataKey_ = consistencyDataKey; + setParameter("ConsistencyDataKey", consistencyDataKey); +} + +std::string QueryMetricByPageRequest::getProxyUserId()const +{ + return proxyUserId_; +} + +void QueryMetricByPageRequest::setProxyUserId(const std::string& proxyUserId) +{ + proxyUserId_ = proxyUserId; + setParameter("ProxyUserId", proxyUserId); +} + +std::vector QueryMetricByPageRequest::getMeasures()const +{ + return measures_; +} + +void QueryMetricByPageRequest::setMeasures(const std::vector& measures) +{ + measures_ = measures; + for(int dep1 = 0; dep1!= measures.size(); dep1++) { + setParameter("Measures."+ std::to_string(dep1), measures.at(dep1)); + } +} + +int QueryMetricByPageRequest::getIntervalInSec()const +{ + return intervalInSec_; +} + +void QueryMetricByPageRequest::setIntervalInSec(int intervalInSec) +{ + intervalInSec_ = intervalInSec; + setParameter("IntervalInSec", std::to_string(intervalInSec)); +} + +std::string QueryMetricByPageRequest::getMetric()const +{ + return metric_; +} + +void QueryMetricByPageRequest::setMetric(const std::string& metric) +{ + metric_ = metric; + setParameter("Metric", metric); +} + +int QueryMetricByPageRequest::getPageSize()const +{ + return pageSize_; +} + +void QueryMetricByPageRequest::setPageSize(int pageSize) +{ + pageSize_ = pageSize; + setParameter("PageSize", std::to_string(pageSize)); +} + +std::vector QueryMetricByPageRequest::getDimensions()const +{ + return dimensions_; +} + +void QueryMetricByPageRequest::setDimensions(const std::vector& dimensions) +{ + dimensions_ = dimensions; + for(int dep1 = 0; dep1!= dimensions.size(); dep1++) { + setParameter("Dimensions."+ std::to_string(dep1), dimensions.at(dep1)); + } +} + +std::string QueryMetricByPageRequest::getOrder()const +{ + return order_; +} + +void QueryMetricByPageRequest::setOrder(const std::string& order) +{ + order_ = order; + setParameter("Order", order); +} + diff --git a/arms/src/model/QueryMetricByPageResult.cc b/arms/src/model/QueryMetricByPageResult.cc new file mode 100644 index 000000000..87a3a6fad --- /dev/null +++ b/arms/src/model/QueryMetricByPageResult.cc @@ -0,0 +1,80 @@ +/* + * 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::ARMS; +using namespace AlibabaCloud::ARMS::Model; + +QueryMetricByPageResult::QueryMetricByPageResult() : + ServiceResult() +{} + +QueryMetricByPageResult::QueryMetricByPageResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +QueryMetricByPageResult::~QueryMetricByPageResult() +{} + +void QueryMetricByPageResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["Total"].isNull()) + data_.total = std::stoi(dataNode["Total"].asString()); + if(!dataNode["Page"].isNull()) + data_.page = std::stoi(dataNode["Page"].asString()); + if(!dataNode["PageSize"].isNull()) + data_.pageSize = std::stoi(dataNode["PageSize"].asString()); + auto allItems = dataNode["Items"]["Items"]; + for (auto value : allItems) + data_.items.push_back(value.asString()); + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string QueryMetricByPageResult::getMessage()const +{ + return message_; +} + +QueryMetricByPageResult::Data QueryMetricByPageResult::getData()const +{ + return data_; +} + +std::string QueryMetricByPageResult::getCode()const +{ + return code_; +} + +bool QueryMetricByPageResult::getSuccess()const +{ + return success_; +} +