From 2c0d297a8d702ead126c09c07e916d280fcc1fc8 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Thu, 12 Oct 2023 08:05:31 +0000 Subject: [PATCH] Support GetOrderBaseInfo to response AttachmentKey and OriginAttachmentName information. --- VERSION | 2 +- dms-enterprise/CMakeLists.txt | 4 + .../dms-enterprise/Dms_enterpriseClient.h | 8 ++ .../model/GetDbExportDownloadURLRequest.h | 48 ++++++++++++ .../model/GetDbExportDownloadURLResult.h | 63 +++++++++++++++ .../model/GetOrderBaseInfoResult.h | 2 + dms-enterprise/src/Dms-enterpriseClient.cc | 36 +++++++++ .../model/GetDbExportDownloadURLRequest.cc | 54 +++++++++++++ .../src/model/GetDbExportDownloadURLResult.cc | 77 +++++++++++++++++++ .../src/model/GetOrderBaseInfoResult.cc | 4 + 10 files changed, 297 insertions(+), 1 deletion(-) create mode 100644 dms-enterprise/include/alibabacloud/dms-enterprise/model/GetDbExportDownloadURLRequest.h create mode 100644 dms-enterprise/include/alibabacloud/dms-enterprise/model/GetDbExportDownloadURLResult.h create mode 100644 dms-enterprise/src/model/GetDbExportDownloadURLRequest.cc create mode 100644 dms-enterprise/src/model/GetDbExportDownloadURLResult.cc diff --git a/VERSION b/VERSION index 99034063a..0e7e9e1f1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1780 \ No newline at end of file +1.36.1781 \ No newline at end of file diff --git a/dms-enterprise/CMakeLists.txt b/dms-enterprise/CMakeLists.txt index e737dee5c..63a68e69f 100644 --- a/dms-enterprise/CMakeLists.txt +++ b/dms-enterprise/CMakeLists.txt @@ -181,6 +181,8 @@ set(dms-enterprise_public_header_model include/alibabacloud/dms-enterprise/model/GetDatabaseResult.h include/alibabacloud/dms-enterprise/model/GetDatabaseExportOrderDetailRequest.h include/alibabacloud/dms-enterprise/model/GetDatabaseExportOrderDetailResult.h + include/alibabacloud/dms-enterprise/model/GetDbExportDownloadURLRequest.h + include/alibabacloud/dms-enterprise/model/GetDbExportDownloadURLResult.h include/alibabacloud/dms-enterprise/model/GetInstanceRequest.h include/alibabacloud/dms-enterprise/model/GetInstanceResult.h include/alibabacloud/dms-enterprise/model/GetIntervalLimitOfSLARequest.h @@ -612,6 +614,8 @@ set(dms-enterprise_src src/model/GetDatabaseResult.cc src/model/GetDatabaseExportOrderDetailRequest.cc src/model/GetDatabaseExportOrderDetailResult.cc + src/model/GetDbExportDownloadURLRequest.cc + src/model/GetDbExportDownloadURLResult.cc src/model/GetInstanceRequest.cc src/model/GetInstanceResult.cc src/model/GetIntervalLimitOfSLARequest.cc diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h b/dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h index 592997019..8a0a40968 100644 --- a/dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h @@ -182,6 +182,8 @@ #include "model/GetDatabaseResult.h" #include "model/GetDatabaseExportOrderDetailRequest.h" #include "model/GetDatabaseExportOrderDetailResult.h" +#include "model/GetDbExportDownloadURLRequest.h" +#include "model/GetDbExportDownloadURLResult.h" #include "model/GetInstanceRequest.h" #include "model/GetInstanceResult.h" #include "model/GetIntervalLimitOfSLARequest.h" @@ -699,6 +701,9 @@ namespace AlibabaCloud typedef Outcome GetDatabaseExportOrderDetailOutcome; typedef std::future GetDatabaseExportOrderDetailOutcomeCallable; typedef std::function&)> GetDatabaseExportOrderDetailAsyncHandler; + typedef Outcome GetDbExportDownloadURLOutcome; + typedef std::future GetDbExportDownloadURLOutcomeCallable; + typedef std::function&)> GetDbExportDownloadURLAsyncHandler; typedef Outcome GetInstanceOutcome; typedef std::future GetInstanceOutcomeCallable; typedef std::function&)> GetInstanceAsyncHandler; @@ -1346,6 +1351,9 @@ namespace AlibabaCloud GetDatabaseExportOrderDetailOutcome getDatabaseExportOrderDetail(const Model::GetDatabaseExportOrderDetailRequest &request)const; void getDatabaseExportOrderDetailAsync(const Model::GetDatabaseExportOrderDetailRequest& request, const GetDatabaseExportOrderDetailAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetDatabaseExportOrderDetailOutcomeCallable getDatabaseExportOrderDetailCallable(const Model::GetDatabaseExportOrderDetailRequest& request) const; + GetDbExportDownloadURLOutcome getDbExportDownloadURL(const Model::GetDbExportDownloadURLRequest &request)const; + void getDbExportDownloadURLAsync(const Model::GetDbExportDownloadURLRequest& request, const GetDbExportDownloadURLAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetDbExportDownloadURLOutcomeCallable getDbExportDownloadURLCallable(const Model::GetDbExportDownloadURLRequest& request) const; GetInstanceOutcome getInstance(const Model::GetInstanceRequest &request)const; void getInstanceAsync(const Model::GetInstanceRequest& request, const GetInstanceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetInstanceOutcomeCallable getInstanceCallable(const Model::GetInstanceRequest& request) const; diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetDbExportDownloadURLRequest.h b/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetDbExportDownloadURLRequest.h new file mode 100644 index 000000000..7348008a1 --- /dev/null +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetDbExportDownloadURLRequest.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_DMS_ENTERPRISE_MODEL_GETDBEXPORTDOWNLOADURLREQUEST_H_ +#define ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETDBEXPORTDOWNLOADURLREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Dms_enterprise { +namespace Model { +class ALIBABACLOUD_DMS_ENTERPRISE_EXPORT GetDbExportDownloadURLRequest : public RpcServiceRequest { +public: + GetDbExportDownloadURLRequest(); + ~GetDbExportDownloadURLRequest(); + long getTid() const; + void setTid(long tid); + long getOrderId() const; + void setOrderId(long orderId); + std::string getActionName() const; + void setActionName(const std::string &actionName); + +private: + long tid_; + long orderId_; + std::string actionName_; +}; +} // namespace Model +} // namespace Dms_enterprise +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETDBEXPORTDOWNLOADURLREQUEST_H_ diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetDbExportDownloadURLResult.h b/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetDbExportDownloadURLResult.h new file mode 100644 index 000000000..1889dbb5f --- /dev/null +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetDbExportDownloadURLResult.h @@ -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. + */ + +#ifndef ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETDBEXPORTDOWNLOADURLRESULT_H_ +#define ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETDBEXPORTDOWNLOADURLRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Dms_enterprise + { + namespace Model + { + class ALIBABACLOUD_DMS_ENTERPRISE_EXPORT GetDbExportDownloadURLResult : public ServiceResult + { + public: + struct DownloadURLResult + { + bool hasResult; + std::string tipMessage; + std::string uRL; + }; + + + GetDbExportDownloadURLResult(); + explicit GetDbExportDownloadURLResult(const std::string &payload); + ~GetDbExportDownloadURLResult(); + DownloadURLResult getDownloadURLResult()const; + std::string getErrorCode()const; + std::string getErrorMessage()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + DownloadURLResult downloadURLResult_; + std::string errorCode_; + std::string errorMessage_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETDBEXPORTDOWNLOADURLRESULT_H_ \ No newline at end of file diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetOrderBaseInfoResult.h b/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetOrderBaseInfoResult.h index 8278af2da..1a2af7216 100644 --- a/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetOrderBaseInfoResult.h +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetOrderBaseInfoResult.h @@ -35,6 +35,7 @@ namespace AlibabaCloud struct OrderBaseInfo { std::string comment; + std::string originAttachmentName; std::string createTime; std::string lastModifyTime; long orderId; @@ -44,6 +45,7 @@ namespace AlibabaCloud std::vector relatedUserNickList; std::string workflowStatusDesc; std::string statusDesc; + std::string attachmentKey; long workflowInstanceId; std::string committer; std::vector relatedUserList; diff --git a/dms-enterprise/src/Dms-enterpriseClient.cc b/dms-enterprise/src/Dms-enterpriseClient.cc index 57f609a0e..c4356bc69 100644 --- a/dms-enterprise/src/Dms-enterpriseClient.cc +++ b/dms-enterprise/src/Dms-enterpriseClient.cc @@ -2931,6 +2931,42 @@ Dms_enterpriseClient::GetDatabaseExportOrderDetailOutcomeCallable Dms_enterprise return task->get_future(); } +Dms_enterpriseClient::GetDbExportDownloadURLOutcome Dms_enterpriseClient::getDbExportDownloadURL(const GetDbExportDownloadURLRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetDbExportDownloadURLOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetDbExportDownloadURLOutcome(GetDbExportDownloadURLResult(outcome.result())); + else + return GetDbExportDownloadURLOutcome(outcome.error()); +} + +void Dms_enterpriseClient::getDbExportDownloadURLAsync(const GetDbExportDownloadURLRequest& request, const GetDbExportDownloadURLAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getDbExportDownloadURL(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +Dms_enterpriseClient::GetDbExportDownloadURLOutcomeCallable Dms_enterpriseClient::getDbExportDownloadURLCallable(const GetDbExportDownloadURLRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getDbExportDownloadURL(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + Dms_enterpriseClient::GetInstanceOutcome Dms_enterpriseClient::getInstance(const GetInstanceRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/dms-enterprise/src/model/GetDbExportDownloadURLRequest.cc b/dms-enterprise/src/model/GetDbExportDownloadURLRequest.cc new file mode 100644 index 000000000..8211d731e --- /dev/null +++ b/dms-enterprise/src/model/GetDbExportDownloadURLRequest.cc @@ -0,0 +1,54 @@ +/* + * 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::GetDbExportDownloadURLRequest; + +GetDbExportDownloadURLRequest::GetDbExportDownloadURLRequest() + : RpcServiceRequest("dms-enterprise", "2018-11-01", "GetDbExportDownloadURL") { + setMethod(HttpRequest::Method::Post); +} + +GetDbExportDownloadURLRequest::~GetDbExportDownloadURLRequest() {} + +long GetDbExportDownloadURLRequest::getTid() const { + return tid_; +} + +void GetDbExportDownloadURLRequest::setTid(long tid) { + tid_ = tid; + setParameter(std::string("Tid"), std::to_string(tid)); +} + +long GetDbExportDownloadURLRequest::getOrderId() const { + return orderId_; +} + +void GetDbExportDownloadURLRequest::setOrderId(long orderId) { + orderId_ = orderId; + setParameter(std::string("OrderId"), std::to_string(orderId)); +} + +std::string GetDbExportDownloadURLRequest::getActionName() const { + return actionName_; +} + +void GetDbExportDownloadURLRequest::setActionName(const std::string &actionName) { + actionName_ = actionName; + setParameter(std::string("ActionName"), actionName); +} + diff --git a/dms-enterprise/src/model/GetDbExportDownloadURLResult.cc b/dms-enterprise/src/model/GetDbExportDownloadURLResult.cc new file mode 100644 index 000000000..2bbc14e98 --- /dev/null +++ b/dms-enterprise/src/model/GetDbExportDownloadURLResult.cc @@ -0,0 +1,77 @@ +/* + * 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; + +GetDbExportDownloadURLResult::GetDbExportDownloadURLResult() : + ServiceResult() +{} + +GetDbExportDownloadURLResult::GetDbExportDownloadURLResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetDbExportDownloadURLResult::~GetDbExportDownloadURLResult() +{} + +void GetDbExportDownloadURLResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto downloadURLResultNode = value["DownloadURLResult"]; + if(!downloadURLResultNode["HasResult"].isNull()) + downloadURLResult_.hasResult = downloadURLResultNode["HasResult"].asString() == "true"; + if(!downloadURLResultNode["TipMessage"].isNull()) + downloadURLResult_.tipMessage = downloadURLResultNode["TipMessage"].asString(); + if(!downloadURLResultNode["URL"].isNull()) + downloadURLResult_.uRL = downloadURLResultNode["URL"].asString(); + 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"; + +} + +GetDbExportDownloadURLResult::DownloadURLResult GetDbExportDownloadURLResult::getDownloadURLResult()const +{ + return downloadURLResult_; +} + +std::string GetDbExportDownloadURLResult::getErrorCode()const +{ + return errorCode_; +} + +std::string GetDbExportDownloadURLResult::getErrorMessage()const +{ + return errorMessage_; +} + +bool GetDbExportDownloadURLResult::getSuccess()const +{ + return success_; +} + diff --git a/dms-enterprise/src/model/GetOrderBaseInfoResult.cc b/dms-enterprise/src/model/GetOrderBaseInfoResult.cc index 65435acf4..008526102 100644 --- a/dms-enterprise/src/model/GetOrderBaseInfoResult.cc +++ b/dms-enterprise/src/model/GetOrderBaseInfoResult.cc @@ -62,6 +62,10 @@ void GetOrderBaseInfoResult::parse(const std::string &payload) orderBaseInfo_.pluginType = orderBaseInfoNode["PluginType"].asString(); if(!orderBaseInfoNode["OrderId"].isNull()) orderBaseInfo_.orderId = std::stol(orderBaseInfoNode["OrderId"].asString()); + if(!orderBaseInfoNode["AttachmentKey"].isNull()) + orderBaseInfo_.attachmentKey = orderBaseInfoNode["AttachmentKey"].asString(); + if(!orderBaseInfoNode["OriginAttachmentName"].isNull()) + orderBaseInfo_.originAttachmentName = orderBaseInfoNode["OriginAttachmentName"].asString(); auto allRelatedUserNickList = orderBaseInfoNode["RelatedUserNickList"]["UserNicks"]; for (auto value : allRelatedUserNickList) orderBaseInfo_.relatedUserNickList.push_back(value.asString());