From 4014391257807793a0397c8187468ca5640cad1d Mon Sep 17 00:00:00 2001 From: sdk-team Date: Tue, 12 Apr 2022 03:20:58 +0000 Subject: [PATCH] Remove redundant input for API ListTaskFlow. --- CHANGELOG | 3 + VERSION | 2 +- dms-enterprise/CMakeLists.txt | 4 + .../dms-enterprise/Dms_enterpriseClient.h | 8 ++ .../model/ListDAGVersionsRequest.h | 51 ++++++++++ .../model/ListDAGVersionsResult.h | 68 +++++++++++++ .../model/ListTaskFlowRequest.h | 6 -- dms-enterprise/src/Dms-enterpriseClient.cc | 36 +++++++ .../src/model/ListDAGVersionsRequest.cc | 63 ++++++++++++ .../src/model/ListDAGVersionsResult.cc | 95 +++++++++++++++++++ .../src/model/ListTaskFlowRequest.cc | 18 ---- 11 files changed, 329 insertions(+), 25 deletions(-) create mode 100644 dms-enterprise/include/alibabacloud/dms-enterprise/model/ListDAGVersionsRequest.h create mode 100644 dms-enterprise/include/alibabacloud/dms-enterprise/model/ListDAGVersionsResult.h create mode 100644 dms-enterprise/src/model/ListDAGVersionsRequest.cc create mode 100644 dms-enterprise/src/model/ListDAGVersionsResult.cc diff --git a/CHANGELOG b/CHANGELOG index 89c23f749..418c99c19 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2022-04-12 Version: 1.36.1103 +- Remove redundant input for API ListTaskFlow. + 2022-04-11 Version: 1.36.1102 - Set multiple apis to public. diff --git a/VERSION b/VERSION index be6a4ed52..549c3f3e5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1102 \ No newline at end of file +1.36.1103 \ No newline at end of file diff --git a/dms-enterprise/CMakeLists.txt b/dms-enterprise/CMakeLists.txt index e5af70057..4e6a9b476 100644 --- a/dms-enterprise/CMakeLists.txt +++ b/dms-enterprise/CMakeLists.txt @@ -169,6 +169,8 @@ set(dms-enterprise_public_header_model include/alibabacloud/dms-enterprise/model/InspectProxyAccessSecretResult.h include/alibabacloud/dms-enterprise/model/ListColumnsRequest.h include/alibabacloud/dms-enterprise/model/ListColumnsResult.h + include/alibabacloud/dms-enterprise/model/ListDAGVersionsRequest.h + include/alibabacloud/dms-enterprise/model/ListDAGVersionsResult.h include/alibabacloud/dms-enterprise/model/ListDBTaskSQLJobRequest.h include/alibabacloud/dms-enterprise/model/ListDBTaskSQLJobResult.h include/alibabacloud/dms-enterprise/model/ListDBTaskSQLJobDetailRequest.h @@ -418,6 +420,8 @@ set(dms-enterprise_src src/model/InspectProxyAccessSecretResult.cc src/model/ListColumnsRequest.cc src/model/ListColumnsResult.cc + src/model/ListDAGVersionsRequest.cc + src/model/ListDAGVersionsResult.cc src/model/ListDBTaskSQLJobRequest.cc src/model/ListDBTaskSQLJobResult.cc src/model/ListDBTaskSQLJobDetailRequest.cc diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h b/dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h index 8f6678d0e..e2086f2ae 100644 --- a/dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h @@ -170,6 +170,8 @@ #include "model/InspectProxyAccessSecretResult.h" #include "model/ListColumnsRequest.h" #include "model/ListColumnsResult.h" +#include "model/ListDAGVersionsRequest.h" +#include "model/ListDAGVersionsResult.h" #include "model/ListDBTaskSQLJobRequest.h" #include "model/ListDBTaskSQLJobResult.h" #include "model/ListDBTaskSQLJobDetailRequest.h" @@ -499,6 +501,9 @@ namespace AlibabaCloud typedef Outcome ListColumnsOutcome; typedef std::future ListColumnsOutcomeCallable; typedef std::function&)> ListColumnsAsyncHandler; + typedef Outcome ListDAGVersionsOutcome; + typedef std::future ListDAGVersionsOutcomeCallable; + typedef std::function&)> ListDAGVersionsAsyncHandler; typedef Outcome ListDBTaskSQLJobOutcome; typedef std::future ListDBTaskSQLJobOutcomeCallable; typedef std::function&)> ListDBTaskSQLJobAsyncHandler; @@ -873,6 +878,9 @@ namespace AlibabaCloud ListColumnsOutcome listColumns(const Model::ListColumnsRequest &request)const; void listColumnsAsync(const Model::ListColumnsRequest& request, const ListColumnsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListColumnsOutcomeCallable listColumnsCallable(const Model::ListColumnsRequest& request) const; + ListDAGVersionsOutcome listDAGVersions(const Model::ListDAGVersionsRequest &request)const; + void listDAGVersionsAsync(const Model::ListDAGVersionsRequest& request, const ListDAGVersionsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListDAGVersionsOutcomeCallable listDAGVersionsCallable(const Model::ListDAGVersionsRequest& request) const; ListDBTaskSQLJobOutcome listDBTaskSQLJob(const Model::ListDBTaskSQLJobRequest &request)const; void listDBTaskSQLJobAsync(const Model::ListDBTaskSQLJobRequest& request, const ListDBTaskSQLJobAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListDBTaskSQLJobOutcomeCallable listDBTaskSQLJobCallable(const Model::ListDBTaskSQLJobRequest& request) const; diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/model/ListDAGVersionsRequest.h b/dms-enterprise/include/alibabacloud/dms-enterprise/model/ListDAGVersionsRequest.h new file mode 100644 index 000000000..b33662abb --- /dev/null +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/model/ListDAGVersionsRequest.h @@ -0,0 +1,51 @@ +/* + * 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_DMS_ENTERPRISE_MODEL_LISTDAGVERSIONSREQUEST_H_ +#define ALIBABACLOUD_DMS_ENTERPRISE_MODEL_LISTDAGVERSIONSREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Dms_enterprise { +namespace Model { +class ALIBABACLOUD_DMS_ENTERPRISE_EXPORT ListDAGVersionsRequest : public RpcServiceRequest { +public: + ListDAGVersionsRequest(); + ~ListDAGVersionsRequest(); + long getDagId() const; + void setDagId(long dagId); + long getTid() const; + void setTid(long tid); + int getPageSize() const; + void setPageSize(int pageSize); + int getPageIndex() const; + void setPageIndex(int pageIndex); + +private: + long dagId_; + long tid_; + int pageSize_; + int pageIndex_; +}; +} // namespace Model +} // namespace Dms_enterprise +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_DMS_ENTERPRISE_MODEL_LISTDAGVERSIONSREQUEST_H_ diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/model/ListDAGVersionsResult.h b/dms-enterprise/include/alibabacloud/dms-enterprise/model/ListDAGVersionsResult.h new file mode 100644 index 000000000..f9732fdf1 --- /dev/null +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/model/ListDAGVersionsResult.h @@ -0,0 +1,68 @@ +/* + * 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_DMS_ENTERPRISE_MODEL_LISTDAGVERSIONSRESULT_H_ +#define ALIBABACLOUD_DMS_ENTERPRISE_MODEL_LISTDAGVERSIONSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Dms_enterprise + { + namespace Model + { + class ALIBABACLOUD_DMS_ENTERPRISE_EXPORT ListDAGVersionsResult : public ServiceResult + { + public: + struct DagVersion + { + long versionId; + long lastVersionId; + std::string dagOwnerId; + std::string versionComments; + std::string dagName; + std::string dagOwnerNickName; + }; + + + ListDAGVersionsResult(); + explicit ListDAGVersionsResult(const std::string &payload); + ~ListDAGVersionsResult(); + int getTotalCount()const; + std::string getErrorCode()const; + std::string getErrorMessage()const; + std::vector getDagVersionList()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + int totalCount_; + std::string errorCode_; + std::string errorMessage_; + std::vector dagVersionList_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_DMS_ENTERPRISE_MODEL_LISTDAGVERSIONSRESULT_H_ \ No newline at end of file diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/model/ListTaskFlowRequest.h b/dms-enterprise/include/alibabacloud/dms-enterprise/model/ListTaskFlowRequest.h index 3ca27f673..d4b4f535b 100644 --- a/dms-enterprise/include/alibabacloud/dms-enterprise/model/ListTaskFlowRequest.h +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/model/ListTaskFlowRequest.h @@ -30,17 +30,11 @@ class ALIBABACLOUD_DMS_ENTERPRISE_EXPORT ListTaskFlowRequest : public RpcService public: ListTaskFlowRequest(); ~ListTaskFlowRequest(); - long getDagId() const; - void setDagId(long dagId); long getTid() const; void setTid(long tid); - long getDagInstanceId() const; - void setDagInstanceId(long dagInstanceId); private: - long dagId_; long tid_; - long dagInstanceId_; }; } // namespace Model } // namespace Dms_enterprise diff --git a/dms-enterprise/src/Dms-enterpriseClient.cc b/dms-enterprise/src/Dms-enterpriseClient.cc index 0bfd6b72e..41e1567a3 100644 --- a/dms-enterprise/src/Dms-enterpriseClient.cc +++ b/dms-enterprise/src/Dms-enterpriseClient.cc @@ -2715,6 +2715,42 @@ Dms_enterpriseClient::ListColumnsOutcomeCallable Dms_enterpriseClient::listColum return task->get_future(); } +Dms_enterpriseClient::ListDAGVersionsOutcome Dms_enterpriseClient::listDAGVersions(const ListDAGVersionsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListDAGVersionsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListDAGVersionsOutcome(ListDAGVersionsResult(outcome.result())); + else + return ListDAGVersionsOutcome(outcome.error()); +} + +void Dms_enterpriseClient::listDAGVersionsAsync(const ListDAGVersionsRequest& request, const ListDAGVersionsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listDAGVersions(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +Dms_enterpriseClient::ListDAGVersionsOutcomeCallable Dms_enterpriseClient::listDAGVersionsCallable(const ListDAGVersionsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listDAGVersions(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + Dms_enterpriseClient::ListDBTaskSQLJobOutcome Dms_enterpriseClient::listDBTaskSQLJob(const ListDBTaskSQLJobRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/dms-enterprise/src/model/ListDAGVersionsRequest.cc b/dms-enterprise/src/model/ListDAGVersionsRequest.cc new file mode 100644 index 000000000..cff56c33f --- /dev/null +++ b/dms-enterprise/src/model/ListDAGVersionsRequest.cc @@ -0,0 +1,63 @@ +/* + * 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::Dms_enterprise::Model::ListDAGVersionsRequest; + +ListDAGVersionsRequest::ListDAGVersionsRequest() + : RpcServiceRequest("dms-enterprise", "2018-11-01", "ListDAGVersions") { + setMethod(HttpRequest::Method::Post); +} + +ListDAGVersionsRequest::~ListDAGVersionsRequest() {} + +long ListDAGVersionsRequest::getDagId() const { + return dagId_; +} + +void ListDAGVersionsRequest::setDagId(long dagId) { + dagId_ = dagId; + setParameter(std::string("DagId"), std::to_string(dagId)); +} + +long ListDAGVersionsRequest::getTid() const { + return tid_; +} + +void ListDAGVersionsRequest::setTid(long tid) { + tid_ = tid; + setParameter(std::string("Tid"), std::to_string(tid)); +} + +int ListDAGVersionsRequest::getPageSize() const { + return pageSize_; +} + +void ListDAGVersionsRequest::setPageSize(int pageSize) { + pageSize_ = pageSize; + setParameter(std::string("PageSize"), std::to_string(pageSize)); +} + +int ListDAGVersionsRequest::getPageIndex() const { + return pageIndex_; +} + +void ListDAGVersionsRequest::setPageIndex(int pageIndex) { + pageIndex_ = pageIndex; + setParameter(std::string("PageIndex"), std::to_string(pageIndex)); +} + diff --git a/dms-enterprise/src/model/ListDAGVersionsResult.cc b/dms-enterprise/src/model/ListDAGVersionsResult.cc new file mode 100644 index 000000000..a55d35def --- /dev/null +++ b/dms-enterprise/src/model/ListDAGVersionsResult.cc @@ -0,0 +1,95 @@ +/* + * 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::Dms_enterprise; +using namespace AlibabaCloud::Dms_enterprise::Model; + +ListDAGVersionsResult::ListDAGVersionsResult() : + ServiceResult() +{} + +ListDAGVersionsResult::ListDAGVersionsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListDAGVersionsResult::~ListDAGVersionsResult() +{} + +void ListDAGVersionsResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allDagVersionListNode = value["DagVersionList"]["DagVersion"]; + for (auto valueDagVersionListDagVersion : allDagVersionListNode) + { + DagVersion dagVersionListObject; + if(!valueDagVersionListDagVersion["DagName"].isNull()) + dagVersionListObject.dagName = valueDagVersionListDagVersion["DagName"].asString(); + if(!valueDagVersionListDagVersion["DagOwnerId"].isNull()) + dagVersionListObject.dagOwnerId = valueDagVersionListDagVersion["DagOwnerId"].asString(); + if(!valueDagVersionListDagVersion["DagOwnerNickName"].isNull()) + dagVersionListObject.dagOwnerNickName = valueDagVersionListDagVersion["DagOwnerNickName"].asString(); + if(!valueDagVersionListDagVersion["VersionComments"].isNull()) + dagVersionListObject.versionComments = valueDagVersionListDagVersion["VersionComments"].asString(); + if(!valueDagVersionListDagVersion["VersionId"].isNull()) + dagVersionListObject.versionId = std::stol(valueDagVersionListDagVersion["VersionId"].asString()); + if(!valueDagVersionListDagVersion["LastVersionId"].isNull()) + dagVersionListObject.lastVersionId = std::stol(valueDagVersionListDagVersion["LastVersionId"].asString()); + dagVersionList_.push_back(dagVersionListObject); + } + if(!value["ErrorCode"].isNull()) + errorCode_ = value["ErrorCode"].asString(); + if(!value["ErrorMessage"].isNull()) + errorMessage_ = value["ErrorMessage"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["TotalCount"].isNull()) + totalCount_ = std::stoi(value["TotalCount"].asString()); + +} + +int ListDAGVersionsResult::getTotalCount()const +{ + return totalCount_; +} + +std::string ListDAGVersionsResult::getErrorCode()const +{ + return errorCode_; +} + +std::string ListDAGVersionsResult::getErrorMessage()const +{ + return errorMessage_; +} + +std::vector ListDAGVersionsResult::getDagVersionList()const +{ + return dagVersionList_; +} + +bool ListDAGVersionsResult::getSuccess()const +{ + return success_; +} + diff --git a/dms-enterprise/src/model/ListTaskFlowRequest.cc b/dms-enterprise/src/model/ListTaskFlowRequest.cc index 0788d1b72..31fdf64bf 100644 --- a/dms-enterprise/src/model/ListTaskFlowRequest.cc +++ b/dms-enterprise/src/model/ListTaskFlowRequest.cc @@ -25,15 +25,6 @@ ListTaskFlowRequest::ListTaskFlowRequest() ListTaskFlowRequest::~ListTaskFlowRequest() {} -long ListTaskFlowRequest::getDagId() const { - return dagId_; -} - -void ListTaskFlowRequest::setDagId(long dagId) { - dagId_ = dagId; - setParameter(std::string("DagId"), std::to_string(dagId)); -} - long ListTaskFlowRequest::getTid() const { return tid_; } @@ -43,12 +34,3 @@ void ListTaskFlowRequest::setTid(long tid) { setParameter(std::string("Tid"), std::to_string(tid)); } -long ListTaskFlowRequest::getDagInstanceId() const { - return dagInstanceId_; -} - -void ListTaskFlowRequest::setDagInstanceId(long dagInstanceId) { - dagInstanceId_ = dagInstanceId; - setParameter(std::string("DagInstanceId"), std::to_string(dagInstanceId)); -} -