From ef568baa30a901da9066c4673ceb5d82e07db120 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Thu, 28 Sep 2023 06:29:00 +0000 Subject: [PATCH] Support CreateProcCorrectAPI. --- VERSION | 2 +- dms-enterprise/CMakeLists.txt | 8 + .../dms-enterprise/Dms_enterpriseClient.h | 16 ++ .../model/GetPagedInstanceRequest.h | 45 ++++++ .../model/GetPagedInstanceResult.h | 88 +++++++++++ .../model/PreviewWorkflowRequest.h | 45 ++++++ .../model/PreviewWorkflowResult.h | 76 ++++++++++ dms-enterprise/src/Dms-enterpriseClient.cc | 72 +++++++++ .../src/model/GetPagedInstanceRequest.cc | 45 ++++++ .../src/model/GetPagedInstanceResult.cc | 137 ++++++++++++++++++ .../src/model/PreviewWorkflowRequest.cc | 45 ++++++ .../src/model/PreviewWorkflowResult.cc | 99 +++++++++++++ 12 files changed, 677 insertions(+), 1 deletion(-) create mode 100644 dms-enterprise/include/alibabacloud/dms-enterprise/model/GetPagedInstanceRequest.h create mode 100644 dms-enterprise/include/alibabacloud/dms-enterprise/model/GetPagedInstanceResult.h create mode 100644 dms-enterprise/include/alibabacloud/dms-enterprise/model/PreviewWorkflowRequest.h create mode 100644 dms-enterprise/include/alibabacloud/dms-enterprise/model/PreviewWorkflowResult.h create mode 100644 dms-enterprise/src/model/GetPagedInstanceRequest.cc create mode 100644 dms-enterprise/src/model/GetPagedInstanceResult.cc create mode 100644 dms-enterprise/src/model/PreviewWorkflowRequest.cc create mode 100644 dms-enterprise/src/model/PreviewWorkflowResult.cc diff --git a/VERSION b/VERSION index 6461134dd..c9f93dcf5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1770 \ No newline at end of file +1.36.1771 \ No newline at end of file diff --git a/dms-enterprise/CMakeLists.txt b/dms-enterprise/CMakeLists.txt index 6773ac171..e737dee5c 100644 --- a/dms-enterprise/CMakeLists.txt +++ b/dms-enterprise/CMakeLists.txt @@ -203,6 +203,8 @@ set(dms-enterprise_public_header_model include/alibabacloud/dms-enterprise/model/GetOrderBaseInfoResult.h include/alibabacloud/dms-enterprise/model/GetOwnerApplyOrderDetailRequest.h include/alibabacloud/dms-enterprise/model/GetOwnerApplyOrderDetailResult.h + include/alibabacloud/dms-enterprise/model/GetPagedInstanceRequest.h + include/alibabacloud/dms-enterprise/model/GetPagedInstanceResult.h include/alibabacloud/dms-enterprise/model/GetPermApplyOrderDetailRequest.h include/alibabacloud/dms-enterprise/model/GetPermApplyOrderDetailResult.h include/alibabacloud/dms-enterprise/model/GetPhysicalDatabaseRequest.h @@ -361,6 +363,8 @@ set(dms-enterprise_public_header_model include/alibabacloud/dms-enterprise/model/OfflineTaskFlowResult.h include/alibabacloud/dms-enterprise/model/PauseDataCorrectSQLJobRequest.h include/alibabacloud/dms-enterprise/model/PauseDataCorrectSQLJobResult.h + include/alibabacloud/dms-enterprise/model/PreviewWorkflowRequest.h + include/alibabacloud/dms-enterprise/model/PreviewWorkflowResult.h include/alibabacloud/dms-enterprise/model/PublishAndDeployTaskFlowRequest.h include/alibabacloud/dms-enterprise/model/PublishAndDeployTaskFlowResult.h include/alibabacloud/dms-enterprise/model/QueryDataTrackResultDownloadStatusRequest.h @@ -630,6 +634,8 @@ set(dms-enterprise_src src/model/GetOrderBaseInfoResult.cc src/model/GetOwnerApplyOrderDetailRequest.cc src/model/GetOwnerApplyOrderDetailResult.cc + src/model/GetPagedInstanceRequest.cc + src/model/GetPagedInstanceResult.cc src/model/GetPermApplyOrderDetailRequest.cc src/model/GetPermApplyOrderDetailResult.cc src/model/GetPhysicalDatabaseRequest.cc @@ -788,6 +794,8 @@ set(dms-enterprise_src src/model/OfflineTaskFlowResult.cc src/model/PauseDataCorrectSQLJobRequest.cc src/model/PauseDataCorrectSQLJobResult.cc + src/model/PreviewWorkflowRequest.cc + src/model/PreviewWorkflowResult.cc src/model/PublishAndDeployTaskFlowRequest.cc src/model/PublishAndDeployTaskFlowResult.cc src/model/QueryDataTrackResultDownloadStatusRequest.cc diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h b/dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h index 86d9097b6..592997019 100644 --- a/dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h @@ -204,6 +204,8 @@ #include "model/GetOrderBaseInfoResult.h" #include "model/GetOwnerApplyOrderDetailRequest.h" #include "model/GetOwnerApplyOrderDetailResult.h" +#include "model/GetPagedInstanceRequest.h" +#include "model/GetPagedInstanceResult.h" #include "model/GetPermApplyOrderDetailRequest.h" #include "model/GetPermApplyOrderDetailResult.h" #include "model/GetPhysicalDatabaseRequest.h" @@ -362,6 +364,8 @@ #include "model/OfflineTaskFlowResult.h" #include "model/PauseDataCorrectSQLJobRequest.h" #include "model/PauseDataCorrectSQLJobResult.h" +#include "model/PreviewWorkflowRequest.h" +#include "model/PreviewWorkflowResult.h" #include "model/PublishAndDeployTaskFlowRequest.h" #include "model/PublishAndDeployTaskFlowResult.h" #include "model/QueryDataTrackResultDownloadStatusRequest.h" @@ -728,6 +732,9 @@ namespace AlibabaCloud typedef Outcome GetOwnerApplyOrderDetailOutcome; typedef std::future GetOwnerApplyOrderDetailOutcomeCallable; typedef std::function&)> GetOwnerApplyOrderDetailAsyncHandler; + typedef Outcome GetPagedInstanceOutcome; + typedef std::future GetPagedInstanceOutcomeCallable; + typedef std::function&)> GetPagedInstanceAsyncHandler; typedef Outcome GetPermApplyOrderDetailOutcome; typedef std::future GetPermApplyOrderDetailOutcomeCallable; typedef std::function&)> GetPermApplyOrderDetailAsyncHandler; @@ -965,6 +972,9 @@ namespace AlibabaCloud typedef Outcome PauseDataCorrectSQLJobOutcome; typedef std::future PauseDataCorrectSQLJobOutcomeCallable; typedef std::function&)> PauseDataCorrectSQLJobAsyncHandler; + typedef Outcome PreviewWorkflowOutcome; + typedef std::future PreviewWorkflowOutcomeCallable; + typedef std::function&)> PreviewWorkflowAsyncHandler; typedef Outcome PublishAndDeployTaskFlowOutcome; typedef std::future PublishAndDeployTaskFlowOutcomeCallable; typedef std::function&)> PublishAndDeployTaskFlowAsyncHandler; @@ -1369,6 +1379,9 @@ namespace AlibabaCloud GetOwnerApplyOrderDetailOutcome getOwnerApplyOrderDetail(const Model::GetOwnerApplyOrderDetailRequest &request)const; void getOwnerApplyOrderDetailAsync(const Model::GetOwnerApplyOrderDetailRequest& request, const GetOwnerApplyOrderDetailAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetOwnerApplyOrderDetailOutcomeCallable getOwnerApplyOrderDetailCallable(const Model::GetOwnerApplyOrderDetailRequest& request) const; + GetPagedInstanceOutcome getPagedInstance(const Model::GetPagedInstanceRequest &request)const; + void getPagedInstanceAsync(const Model::GetPagedInstanceRequest& request, const GetPagedInstanceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetPagedInstanceOutcomeCallable getPagedInstanceCallable(const Model::GetPagedInstanceRequest& request) const; GetPermApplyOrderDetailOutcome getPermApplyOrderDetail(const Model::GetPermApplyOrderDetailRequest &request)const; void getPermApplyOrderDetailAsync(const Model::GetPermApplyOrderDetailRequest& request, const GetPermApplyOrderDetailAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetPermApplyOrderDetailOutcomeCallable getPermApplyOrderDetailCallable(const Model::GetPermApplyOrderDetailRequest& request) const; @@ -1606,6 +1619,9 @@ namespace AlibabaCloud PauseDataCorrectSQLJobOutcome pauseDataCorrectSQLJob(const Model::PauseDataCorrectSQLJobRequest &request)const; void pauseDataCorrectSQLJobAsync(const Model::PauseDataCorrectSQLJobRequest& request, const PauseDataCorrectSQLJobAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; PauseDataCorrectSQLJobOutcomeCallable pauseDataCorrectSQLJobCallable(const Model::PauseDataCorrectSQLJobRequest& request) const; + PreviewWorkflowOutcome previewWorkflow(const Model::PreviewWorkflowRequest &request)const; + void previewWorkflowAsync(const Model::PreviewWorkflowRequest& request, const PreviewWorkflowAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + PreviewWorkflowOutcomeCallable previewWorkflowCallable(const Model::PreviewWorkflowRequest& request) const; PublishAndDeployTaskFlowOutcome publishAndDeployTaskFlow(const Model::PublishAndDeployTaskFlowRequest &request)const; void publishAndDeployTaskFlowAsync(const Model::PublishAndDeployTaskFlowRequest& request, const PublishAndDeployTaskFlowAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; PublishAndDeployTaskFlowOutcomeCallable publishAndDeployTaskFlowCallable(const Model::PublishAndDeployTaskFlowRequest& request) const; diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetPagedInstanceRequest.h b/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetPagedInstanceRequest.h new file mode 100644 index 000000000..539f94326 --- /dev/null +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetPagedInstanceRequest.h @@ -0,0 +1,45 @@ +/* + * 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_GETPAGEDINSTANCEREQUEST_H_ +#define ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETPAGEDINSTANCEREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Dms_enterprise { +namespace Model { +class ALIBABACLOUD_DMS_ENTERPRISE_EXPORT GetPagedInstanceRequest : public RpcServiceRequest { +public: + GetPagedInstanceRequest(); + ~GetPagedInstanceRequest(); + long getTid() const; + void setTid(long tid); + long getOrderId() const; + void setOrderId(long orderId); + +private: + long tid_; + long orderId_; +}; +} // namespace Model +} // namespace Dms_enterprise +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETPAGEDINSTANCEREQUEST_H_ diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetPagedInstanceResult.h b/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetPagedInstanceResult.h new file mode 100644 index 000000000..ee711f300 --- /dev/null +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetPagedInstanceResult.h @@ -0,0 +1,88 @@ +/* + * 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_GETPAGEDINSTANCERESULT_H_ +#define ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETPAGEDINSTANCERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Dms_enterprise + { + namespace Model + { + class ALIBABACLOUD_DMS_ENTERPRISE_EXPORT GetPagedInstanceResult : public ServiceResult + { + public: + struct Data + { + struct InstanceItem + { + std::string msg; + long status; + long triggerType; + long historyDagId; + std::string endTime; + long checkStatus; + std::string gmtModified; + long dagId; + std::string _delete; + std::string gmtCreate; + std::string tenantId; + std::string lastRunningContext; + std::string version; + long taskType; + long id; + std::string businessTime; + }; + std::vector instance; + }; + + + GetPagedInstanceResult(); + explicit GetPagedInstanceResult(const std::string &payload); + ~GetPagedInstanceResult(); + long getPageSize()const; + long getTotal()const; + std::string getTraceId()const; + Data getData()const; + std::string getErrorCode()const; + long getPageIndex()const; + std::string getErrorMessage()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + long pageSize_; + long total_; + std::string traceId_; + Data data_; + std::string errorCode_; + long pageIndex_; + std::string errorMessage_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETPAGEDINSTANCERESULT_H_ \ No newline at end of file diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/model/PreviewWorkflowRequest.h b/dms-enterprise/include/alibabacloud/dms-enterprise/model/PreviewWorkflowRequest.h new file mode 100644 index 000000000..59b7a81e0 --- /dev/null +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/model/PreviewWorkflowRequest.h @@ -0,0 +1,45 @@ +/* + * 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_PREVIEWWORKFLOWREQUEST_H_ +#define ALIBABACLOUD_DMS_ENTERPRISE_MODEL_PREVIEWWORKFLOWREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Dms_enterprise { +namespace Model { +class ALIBABACLOUD_DMS_ENTERPRISE_EXPORT PreviewWorkflowRequest : public RpcServiceRequest { +public: + PreviewWorkflowRequest(); + ~PreviewWorkflowRequest(); + long getTid() const; + void setTid(long tid); + long getOrderId() const; + void setOrderId(long orderId); + +private: + long tid_; + long orderId_; +}; +} // namespace Model +} // namespace Dms_enterprise +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_DMS_ENTERPRISE_MODEL_PREVIEWWORKFLOWREQUEST_H_ diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/model/PreviewWorkflowResult.h b/dms-enterprise/include/alibabacloud/dms-enterprise/model/PreviewWorkflowResult.h new file mode 100644 index 000000000..9b72955d4 --- /dev/null +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/model/PreviewWorkflowResult.h @@ -0,0 +1,76 @@ +/* + * 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_PREVIEWWORKFLOWRESULT_H_ +#define ALIBABACLOUD_DMS_ENTERPRISE_MODEL_PREVIEWWORKFLOWRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Dms_enterprise + { + namespace Model + { + class ALIBABACLOUD_DMS_ENTERPRISE_EXPORT PreviewWorkflowResult : public ServiceResult + { + public: + struct WorkflowDetail + { + struct WorkflowNode + { + struct AuditUser + { + long userId; + std::string realName; + std::string nickName; + }; + std::string comment; + std::vector auditUserList; + std::string nodeName; + std::string nodeType; + }; + std::vector workflowNodeList; + std::string comment; + std::string wfCateName; + }; + + + PreviewWorkflowResult(); + explicit PreviewWorkflowResult(const std::string &payload); + ~PreviewWorkflowResult(); + WorkflowDetail getWorkflowDetail()const; + std::string getErrorCode()const; + std::string getErrorMessage()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + WorkflowDetail workflowDetail_; + std::string errorCode_; + std::string errorMessage_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_DMS_ENTERPRISE_MODEL_PREVIEWWORKFLOWRESULT_H_ \ No newline at end of file diff --git a/dms-enterprise/src/Dms-enterpriseClient.cc b/dms-enterprise/src/Dms-enterpriseClient.cc index c672b238a..57f609a0e 100644 --- a/dms-enterprise/src/Dms-enterpriseClient.cc +++ b/dms-enterprise/src/Dms-enterpriseClient.cc @@ -3327,6 +3327,42 @@ Dms_enterpriseClient::GetOwnerApplyOrderDetailOutcomeCallable Dms_enterpriseClie return task->get_future(); } +Dms_enterpriseClient::GetPagedInstanceOutcome Dms_enterpriseClient::getPagedInstance(const GetPagedInstanceRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetPagedInstanceOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetPagedInstanceOutcome(GetPagedInstanceResult(outcome.result())); + else + return GetPagedInstanceOutcome(outcome.error()); +} + +void Dms_enterpriseClient::getPagedInstanceAsync(const GetPagedInstanceRequest& request, const GetPagedInstanceAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getPagedInstance(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +Dms_enterpriseClient::GetPagedInstanceOutcomeCallable Dms_enterpriseClient::getPagedInstanceCallable(const GetPagedInstanceRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getPagedInstance(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + Dms_enterpriseClient::GetPermApplyOrderDetailOutcome Dms_enterpriseClient::getPermApplyOrderDetail(const GetPermApplyOrderDetailRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -6171,6 +6207,42 @@ Dms_enterpriseClient::PauseDataCorrectSQLJobOutcomeCallable Dms_enterpriseClient return task->get_future(); } +Dms_enterpriseClient::PreviewWorkflowOutcome Dms_enterpriseClient::previewWorkflow(const PreviewWorkflowRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return PreviewWorkflowOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return PreviewWorkflowOutcome(PreviewWorkflowResult(outcome.result())); + else + return PreviewWorkflowOutcome(outcome.error()); +} + +void Dms_enterpriseClient::previewWorkflowAsync(const PreviewWorkflowRequest& request, const PreviewWorkflowAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, previewWorkflow(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +Dms_enterpriseClient::PreviewWorkflowOutcomeCallable Dms_enterpriseClient::previewWorkflowCallable(const PreviewWorkflowRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->previewWorkflow(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + Dms_enterpriseClient::PublishAndDeployTaskFlowOutcome Dms_enterpriseClient::publishAndDeployTaskFlow(const PublishAndDeployTaskFlowRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/dms-enterprise/src/model/GetPagedInstanceRequest.cc b/dms-enterprise/src/model/GetPagedInstanceRequest.cc new file mode 100644 index 000000000..6a2982e57 --- /dev/null +++ b/dms-enterprise/src/model/GetPagedInstanceRequest.cc @@ -0,0 +1,45 @@ +/* + * 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::GetPagedInstanceRequest; + +GetPagedInstanceRequest::GetPagedInstanceRequest() + : RpcServiceRequest("dms-enterprise", "2018-11-01", "GetPagedInstance") { + setMethod(HttpRequest::Method::Get); +} + +GetPagedInstanceRequest::~GetPagedInstanceRequest() {} + +long GetPagedInstanceRequest::getTid() const { + return tid_; +} + +void GetPagedInstanceRequest::setTid(long tid) { + tid_ = tid; + setParameter(std::string("Tid"), std::to_string(tid)); +} + +long GetPagedInstanceRequest::getOrderId() const { + return orderId_; +} + +void GetPagedInstanceRequest::setOrderId(long orderId) { + orderId_ = orderId; + setParameter(std::string("OrderId"), std::to_string(orderId)); +} + diff --git a/dms-enterprise/src/model/GetPagedInstanceResult.cc b/dms-enterprise/src/model/GetPagedInstanceResult.cc new file mode 100644 index 000000000..afd3fe656 --- /dev/null +++ b/dms-enterprise/src/model/GetPagedInstanceResult.cc @@ -0,0 +1,137 @@ +/* + * 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; + +GetPagedInstanceResult::GetPagedInstanceResult() : + ServiceResult() +{} + +GetPagedInstanceResult::GetPagedInstanceResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetPagedInstanceResult::~GetPagedInstanceResult() +{} + +void GetPagedInstanceResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + auto allInstanceNode = dataNode["Instance"]["instanceItem"]; + for (auto dataNodeInstanceinstanceItem : allInstanceNode) + { + Data::InstanceItem instanceItemObject; + if(!dataNodeInstanceinstanceItem["BusinessTime"].isNull()) + instanceItemObject.businessTime = dataNodeInstanceinstanceItem["BusinessTime"].asString(); + if(!dataNodeInstanceinstanceItem["CheckStatus"].isNull()) + instanceItemObject.checkStatus = std::stol(dataNodeInstanceinstanceItem["CheckStatus"].asString()); + if(!dataNodeInstanceinstanceItem["DagId"].isNull()) + instanceItemObject.dagId = std::stol(dataNodeInstanceinstanceItem["DagId"].asString()); + if(!dataNodeInstanceinstanceItem["Delete"].isNull()) + instanceItemObject._delete = dataNodeInstanceinstanceItem["Delete"].asString(); + if(!dataNodeInstanceinstanceItem["EndTime"].isNull()) + instanceItemObject.endTime = dataNodeInstanceinstanceItem["EndTime"].asString(); + if(!dataNodeInstanceinstanceItem["GmtCreate"].isNull()) + instanceItemObject.gmtCreate = dataNodeInstanceinstanceItem["GmtCreate"].asString(); + if(!dataNodeInstanceinstanceItem["GmtModified"].isNull()) + instanceItemObject.gmtModified = dataNodeInstanceinstanceItem["GmtModified"].asString(); + if(!dataNodeInstanceinstanceItem["HistoryDagId"].isNull()) + instanceItemObject.historyDagId = std::stol(dataNodeInstanceinstanceItem["HistoryDagId"].asString()); + if(!dataNodeInstanceinstanceItem["Id"].isNull()) + instanceItemObject.id = std::stol(dataNodeInstanceinstanceItem["Id"].asString()); + if(!dataNodeInstanceinstanceItem["LastRunningContext"].isNull()) + instanceItemObject.lastRunningContext = dataNodeInstanceinstanceItem["LastRunningContext"].asString(); + if(!dataNodeInstanceinstanceItem["Msg"].isNull()) + instanceItemObject.msg = dataNodeInstanceinstanceItem["Msg"].asString(); + if(!dataNodeInstanceinstanceItem["Status"].isNull()) + instanceItemObject.status = std::stol(dataNodeInstanceinstanceItem["Status"].asString()); + if(!dataNodeInstanceinstanceItem["TaskType"].isNull()) + instanceItemObject.taskType = std::stol(dataNodeInstanceinstanceItem["TaskType"].asString()); + if(!dataNodeInstanceinstanceItem["TenantId"].isNull()) + instanceItemObject.tenantId = dataNodeInstanceinstanceItem["TenantId"].asString(); + if(!dataNodeInstanceinstanceItem["TriggerType"].isNull()) + instanceItemObject.triggerType = std::stol(dataNodeInstanceinstanceItem["TriggerType"].asString()); + if(!dataNodeInstanceinstanceItem["Version"].isNull()) + instanceItemObject.version = dataNodeInstanceinstanceItem["Version"].asString(); + data_.instance.push_back(instanceItemObject); + } + if(!value["TraceId"].isNull()) + traceId_ = value["TraceId"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["ErrorMessage"].isNull()) + errorMessage_ = value["ErrorMessage"].asString(); + if(!value["ErrorCode"].isNull()) + errorCode_ = value["ErrorCode"].asString(); + if(!value["PageIndex"].isNull()) + pageIndex_ = std::stol(value["PageIndex"].asString()); + if(!value["PageSize"].isNull()) + pageSize_ = std::stol(value["PageSize"].asString()); + if(!value["Total"].isNull()) + total_ = std::stol(value["Total"].asString()); + +} + +long GetPagedInstanceResult::getPageSize()const +{ + return pageSize_; +} + +long GetPagedInstanceResult::getTotal()const +{ + return total_; +} + +std::string GetPagedInstanceResult::getTraceId()const +{ + return traceId_; +} + +GetPagedInstanceResult::Data GetPagedInstanceResult::getData()const +{ + return data_; +} + +std::string GetPagedInstanceResult::getErrorCode()const +{ + return errorCode_; +} + +long GetPagedInstanceResult::getPageIndex()const +{ + return pageIndex_; +} + +std::string GetPagedInstanceResult::getErrorMessage()const +{ + return errorMessage_; +} + +bool GetPagedInstanceResult::getSuccess()const +{ + return success_; +} + diff --git a/dms-enterprise/src/model/PreviewWorkflowRequest.cc b/dms-enterprise/src/model/PreviewWorkflowRequest.cc new file mode 100644 index 000000000..2e5bf5541 --- /dev/null +++ b/dms-enterprise/src/model/PreviewWorkflowRequest.cc @@ -0,0 +1,45 @@ +/* + * 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::PreviewWorkflowRequest; + +PreviewWorkflowRequest::PreviewWorkflowRequest() + : RpcServiceRequest("dms-enterprise", "2018-11-01", "PreviewWorkflow") { + setMethod(HttpRequest::Method::Post); +} + +PreviewWorkflowRequest::~PreviewWorkflowRequest() {} + +long PreviewWorkflowRequest::getTid() const { + return tid_; +} + +void PreviewWorkflowRequest::setTid(long tid) { + tid_ = tid; + setParameter(std::string("Tid"), std::to_string(tid)); +} + +long PreviewWorkflowRequest::getOrderId() const { + return orderId_; +} + +void PreviewWorkflowRequest::setOrderId(long orderId) { + orderId_ = orderId; + setParameter(std::string("OrderId"), std::to_string(orderId)); +} + diff --git a/dms-enterprise/src/model/PreviewWorkflowResult.cc b/dms-enterprise/src/model/PreviewWorkflowResult.cc new file mode 100644 index 000000000..a61392393 --- /dev/null +++ b/dms-enterprise/src/model/PreviewWorkflowResult.cc @@ -0,0 +1,99 @@ +/* + * 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; + +PreviewWorkflowResult::PreviewWorkflowResult() : + ServiceResult() +{} + +PreviewWorkflowResult::PreviewWorkflowResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +PreviewWorkflowResult::~PreviewWorkflowResult() +{} + +void PreviewWorkflowResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto workflowDetailNode = value["WorkflowDetail"]; + if(!workflowDetailNode["WfCateName"].isNull()) + workflowDetail_.wfCateName = workflowDetailNode["WfCateName"].asString(); + if(!workflowDetailNode["Comment"].isNull()) + workflowDetail_.comment = workflowDetailNode["Comment"].asString(); + auto allWorkflowNodeListNode = workflowDetailNode["WorkflowNodeList"]["WorkflowNode"]; + for (auto workflowDetailNodeWorkflowNodeListWorkflowNode : allWorkflowNodeListNode) + { + WorkflowDetail::WorkflowNode workflowNodeObject; + if(!workflowDetailNodeWorkflowNodeListWorkflowNode["NodeName"].isNull()) + workflowNodeObject.nodeName = workflowDetailNodeWorkflowNodeListWorkflowNode["NodeName"].asString(); + if(!workflowDetailNodeWorkflowNodeListWorkflowNode["NodeType"].isNull()) + workflowNodeObject.nodeType = workflowDetailNodeWorkflowNodeListWorkflowNode["NodeType"].asString(); + if(!workflowDetailNodeWorkflowNodeListWorkflowNode["Comment"].isNull()) + workflowNodeObject.comment = workflowDetailNodeWorkflowNodeListWorkflowNode["Comment"].asString(); + auto allAuditUserListNode = workflowDetailNodeWorkflowNodeListWorkflowNode["AuditUserList"]["AuditUser"]; + for (auto workflowDetailNodeWorkflowNodeListWorkflowNodeAuditUserListAuditUser : allAuditUserListNode) + { + WorkflowDetail::WorkflowNode::AuditUser auditUserListObject; + if(!workflowDetailNodeWorkflowNodeListWorkflowNodeAuditUserListAuditUser["UserId"].isNull()) + auditUserListObject.userId = std::stol(workflowDetailNodeWorkflowNodeListWorkflowNodeAuditUserListAuditUser["UserId"].asString()); + if(!workflowDetailNodeWorkflowNodeListWorkflowNodeAuditUserListAuditUser["NickName"].isNull()) + auditUserListObject.nickName = workflowDetailNodeWorkflowNodeListWorkflowNodeAuditUserListAuditUser["NickName"].asString(); + if(!workflowDetailNodeWorkflowNodeListWorkflowNodeAuditUserListAuditUser["RealName"].isNull()) + auditUserListObject.realName = workflowDetailNodeWorkflowNodeListWorkflowNodeAuditUserListAuditUser["RealName"].asString(); + workflowNodeObject.auditUserList.push_back(auditUserListObject); + } + workflowDetail_.workflowNodeList.push_back(workflowNodeObject); + } + 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"; + +} + +PreviewWorkflowResult::WorkflowDetail PreviewWorkflowResult::getWorkflowDetail()const +{ + return workflowDetail_; +} + +std::string PreviewWorkflowResult::getErrorCode()const +{ + return errorCode_; +} + +std::string PreviewWorkflowResult::getErrorMessage()const +{ + return errorMessage_; +} + +bool PreviewWorkflowResult::getSuccess()const +{ + return success_; +} +