Ver Fonte

Support GetOrderBaseInfo to response AttachmentKey and OriginAttachmentName information.

sdk-team há 2 anos atrás
pai
commit
2c0d297a8d

+ 1 - 1
VERSION

@@ -1 +1 @@
-1.36.1780
+1.36.1781

+ 4 - 0
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

+ 8 - 0
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<Error, Model::GetDatabaseExportOrderDetailResult> GetDatabaseExportOrderDetailOutcome;
 			typedef std::future<GetDatabaseExportOrderDetailOutcome> GetDatabaseExportOrderDetailOutcomeCallable;
 			typedef std::function<void(const Dms_enterpriseClient*, const Model::GetDatabaseExportOrderDetailRequest&, const GetDatabaseExportOrderDetailOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetDatabaseExportOrderDetailAsyncHandler;
+			typedef Outcome<Error, Model::GetDbExportDownloadURLResult> GetDbExportDownloadURLOutcome;
+			typedef std::future<GetDbExportDownloadURLOutcome> GetDbExportDownloadURLOutcomeCallable;
+			typedef std::function<void(const Dms_enterpriseClient*, const Model::GetDbExportDownloadURLRequest&, const GetDbExportDownloadURLOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetDbExportDownloadURLAsyncHandler;
 			typedef Outcome<Error, Model::GetInstanceResult> GetInstanceOutcome;
 			typedef std::future<GetInstanceOutcome> GetInstanceOutcomeCallable;
 			typedef std::function<void(const Dms_enterpriseClient*, const Model::GetInstanceRequest&, const GetInstanceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> 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<const AsyncCallerContext>& 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<const AsyncCallerContext>& 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<const AsyncCallerContext>& context = nullptr) const;
 			GetInstanceOutcomeCallable getInstanceCallable(const Model::GetInstanceRequest& request) const;

+ 48 - 0
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 <alibabacloud/dms-enterprise/Dms_enterpriseExport.h>
+#include <alibabacloud/core/RpcServiceRequest.h>
+#include <string>
+#include <vector>
+#include <map>
+
+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_

+ 63 - 0
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 <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/dms-enterprise/Dms_enterpriseExport.h>
+
+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_

+ 2 - 0
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<std::string> relatedUserNickList;
 					std::string workflowStatusDesc;
 					std::string statusDesc;
+					std::string attachmentKey;
 					long workflowInstanceId;
 					std::string committer;
 					std::vector<std::string> relatedUserList;

+ 36 - 0
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<const AsyncCallerContext>& 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<std::packaged_task<GetDbExportDownloadURLOutcome()>>(
+			[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();

+ 54 - 0
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 <alibabacloud/dms-enterprise/model/GetDbExportDownloadURLRequest.h>
+
+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);
+}
+

+ 77 - 0
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 <alibabacloud/dms-enterprise/model/GetDbExportDownloadURLResult.h>
+#include <json/json.h>
+
+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_;
+}
+

+ 4 - 0
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());