소스 검색

Add DescribeDcdnRefreshTaskById.

sdk-team 5 년 전
부모
커밋
f1434348f4

+ 3 - 0
CHANGELOG

@@ -1,3 +1,6 @@
+2021-05-17 Version: 1.36.738
+- Add DescribeDcdnRefreshTaskById.
+
 2021-05-14 Version: 1.36.737
 - Release ExtractFingerPrint.
 

+ 1 - 1
VERSION

@@ -1 +1 @@
-1.36.737
+1.36.738

+ 4 - 0
dcdn/CMakeLists.txt

@@ -171,6 +171,8 @@ set(dcdn_public_header_model
 	include/alibabacloud/dcdn/model/DescribeDcdnOfflineLogDeliveryStatusResult.h
 	include/alibabacloud/dcdn/model/DescribeDcdnRefreshQuotaRequest.h
 	include/alibabacloud/dcdn/model/DescribeDcdnRefreshQuotaResult.h
+	include/alibabacloud/dcdn/model/DescribeDcdnRefreshTaskByIdRequest.h
+	include/alibabacloud/dcdn/model/DescribeDcdnRefreshTaskByIdResult.h
 	include/alibabacloud/dcdn/model/DescribeDcdnRefreshTasksRequest.h
 	include/alibabacloud/dcdn/model/DescribeDcdnRefreshTasksResult.h
 	include/alibabacloud/dcdn/model/DescribeDcdnRegionAndIspRequest.h
@@ -422,6 +424,8 @@ set(dcdn_src
 	src/model/DescribeDcdnOfflineLogDeliveryStatusResult.cc
 	src/model/DescribeDcdnRefreshQuotaRequest.cc
 	src/model/DescribeDcdnRefreshQuotaResult.cc
+	src/model/DescribeDcdnRefreshTaskByIdRequest.cc
+	src/model/DescribeDcdnRefreshTaskByIdResult.cc
 	src/model/DescribeDcdnRefreshTasksRequest.cc
 	src/model/DescribeDcdnRefreshTasksResult.cc
 	src/model/DescribeDcdnRegionAndIspRequest.cc

+ 8 - 0
dcdn/include/alibabacloud/dcdn/DcdnClient.h

@@ -172,6 +172,8 @@
 #include "model/DescribeDcdnOfflineLogDeliveryStatusResult.h"
 #include "model/DescribeDcdnRefreshQuotaRequest.h"
 #include "model/DescribeDcdnRefreshQuotaResult.h"
+#include "model/DescribeDcdnRefreshTaskByIdRequest.h"
+#include "model/DescribeDcdnRefreshTaskByIdResult.h"
 #include "model/DescribeDcdnRefreshTasksRequest.h"
 #include "model/DescribeDcdnRefreshTasksResult.h"
 #include "model/DescribeDcdnRegionAndIspRequest.h"
@@ -504,6 +506,9 @@ namespace AlibabaCloud
 			typedef Outcome<Error, Model::DescribeDcdnRefreshQuotaResult> DescribeDcdnRefreshQuotaOutcome;
 			typedef std::future<DescribeDcdnRefreshQuotaOutcome> DescribeDcdnRefreshQuotaOutcomeCallable;
 			typedef std::function<void(const DcdnClient*, const Model::DescribeDcdnRefreshQuotaRequest&, const DescribeDcdnRefreshQuotaOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeDcdnRefreshQuotaAsyncHandler;
+			typedef Outcome<Error, Model::DescribeDcdnRefreshTaskByIdResult> DescribeDcdnRefreshTaskByIdOutcome;
+			typedef std::future<DescribeDcdnRefreshTaskByIdOutcome> DescribeDcdnRefreshTaskByIdOutcomeCallable;
+			typedef std::function<void(const DcdnClient*, const Model::DescribeDcdnRefreshTaskByIdRequest&, const DescribeDcdnRefreshTaskByIdOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeDcdnRefreshTaskByIdAsyncHandler;
 			typedef Outcome<Error, Model::DescribeDcdnRefreshTasksResult> DescribeDcdnRefreshTasksOutcome;
 			typedef std::future<DescribeDcdnRefreshTasksOutcome> DescribeDcdnRefreshTasksOutcomeCallable;
 			typedef std::function<void(const DcdnClient*, const Model::DescribeDcdnRefreshTasksRequest&, const DescribeDcdnRefreshTasksOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeDcdnRefreshTasksAsyncHandler;
@@ -881,6 +886,9 @@ namespace AlibabaCloud
 			DescribeDcdnRefreshQuotaOutcome describeDcdnRefreshQuota(const Model::DescribeDcdnRefreshQuotaRequest &request)const;
 			void describeDcdnRefreshQuotaAsync(const Model::DescribeDcdnRefreshQuotaRequest& request, const DescribeDcdnRefreshQuotaAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			DescribeDcdnRefreshQuotaOutcomeCallable describeDcdnRefreshQuotaCallable(const Model::DescribeDcdnRefreshQuotaRequest& request) const;
+			DescribeDcdnRefreshTaskByIdOutcome describeDcdnRefreshTaskById(const Model::DescribeDcdnRefreshTaskByIdRequest &request)const;
+			void describeDcdnRefreshTaskByIdAsync(const Model::DescribeDcdnRefreshTaskByIdRequest& request, const DescribeDcdnRefreshTaskByIdAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+			DescribeDcdnRefreshTaskByIdOutcomeCallable describeDcdnRefreshTaskByIdCallable(const Model::DescribeDcdnRefreshTaskByIdRequest& request) const;
 			DescribeDcdnRefreshTasksOutcome describeDcdnRefreshTasks(const Model::DescribeDcdnRefreshTasksRequest &request)const;
 			void describeDcdnRefreshTasksAsync(const Model::DescribeDcdnRefreshTasksRequest& request, const DescribeDcdnRefreshTasksAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			DescribeDcdnRefreshTasksOutcomeCallable describeDcdnRefreshTasksCallable(const Model::DescribeDcdnRefreshTasksRequest& request) const;

+ 51 - 0
dcdn/include/alibabacloud/dcdn/model/DescribeDcdnRefreshTaskByIdRequest.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_DCDN_MODEL_DESCRIBEDCDNREFRESHTASKBYIDREQUEST_H_
+#define ALIBABACLOUD_DCDN_MODEL_DESCRIBEDCDNREFRESHTASKBYIDREQUEST_H_
+
+#include <string>
+#include <vector>
+#include <alibabacloud/core/RpcServiceRequest.h>
+#include <alibabacloud/dcdn/DcdnExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Dcdn
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_DCDN_EXPORT DescribeDcdnRefreshTaskByIdRequest : public RpcServiceRequest
+			{
+
+			public:
+				DescribeDcdnRefreshTaskByIdRequest();
+				~DescribeDcdnRefreshTaskByIdRequest();
+
+				std::string getTaskId()const;
+				void setTaskId(const std::string& taskId);
+				long getOwnerId()const;
+				void setOwnerId(long ownerId);
+
+            private:
+				std::string taskId_;
+				long ownerId_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_DCDN_MODEL_DESCRIBEDCDNREFRESHTASKBYIDREQUEST_H_

+ 63 - 0
dcdn/include/alibabacloud/dcdn/model/DescribeDcdnRefreshTaskByIdResult.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_DCDN_MODEL_DESCRIBEDCDNREFRESHTASKBYIDRESULT_H_
+#define ALIBABACLOUD_DCDN_MODEL_DESCRIBEDCDNREFRESHTASKBYIDRESULT_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/dcdn/DcdnExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Dcdn
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_DCDN_EXPORT DescribeDcdnRefreshTaskByIdResult : public ServiceResult
+			{
+			public:
+				struct CDNTask
+				{
+					std::string status;
+					std::string objectType;
+					std::string objectPath;
+					std::string taskId;
+					std::string description;
+					std::string creationTime;
+					std::string process;
+				};
+
+
+				DescribeDcdnRefreshTaskByIdResult();
+				explicit DescribeDcdnRefreshTaskByIdResult(const std::string &payload);
+				~DescribeDcdnRefreshTaskByIdResult();
+				long getTotalCount()const;
+				std::vector<CDNTask> getTasks()const;
+
+			protected:
+				void parse(const std::string &payload);
+			private:
+				long totalCount_;
+				std::vector<CDNTask> tasks_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_DCDN_MODEL_DESCRIBEDCDNREFRESHTASKBYIDRESULT_H_

+ 36 - 0
dcdn/src/DcdnClient.cc

@@ -2751,6 +2751,42 @@ DcdnClient::DescribeDcdnRefreshQuotaOutcomeCallable DcdnClient::describeDcdnRefr
 	return task->get_future();
 }
 
+DcdnClient::DescribeDcdnRefreshTaskByIdOutcome DcdnClient::describeDcdnRefreshTaskById(const DescribeDcdnRefreshTaskByIdRequest &request) const
+{
+	auto endpointOutcome = endpointProvider_->getEndpoint();
+	if (!endpointOutcome.isSuccess())
+		return DescribeDcdnRefreshTaskByIdOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return DescribeDcdnRefreshTaskByIdOutcome(DescribeDcdnRefreshTaskByIdResult(outcome.result()));
+	else
+		return DescribeDcdnRefreshTaskByIdOutcome(outcome.error());
+}
+
+void DcdnClient::describeDcdnRefreshTaskByIdAsync(const DescribeDcdnRefreshTaskByIdRequest& request, const DescribeDcdnRefreshTaskByIdAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, describeDcdnRefreshTaskById(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+DcdnClient::DescribeDcdnRefreshTaskByIdOutcomeCallable DcdnClient::describeDcdnRefreshTaskByIdCallable(const DescribeDcdnRefreshTaskByIdRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<DescribeDcdnRefreshTaskByIdOutcome()>>(
+			[this, request]()
+			{
+			return this->describeDcdnRefreshTaskById(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+
 DcdnClient::DescribeDcdnRefreshTasksOutcome DcdnClient::describeDcdnRefreshTasks(const DescribeDcdnRefreshTasksRequest &request) const
 {
 	auto endpointOutcome = endpointProvider_->getEndpoint();

+ 51 - 0
dcdn/src/model/DescribeDcdnRefreshTaskByIdRequest.cc

@@ -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.
+ */
+
+#include <alibabacloud/dcdn/model/DescribeDcdnRefreshTaskByIdRequest.h>
+
+using AlibabaCloud::Dcdn::Model::DescribeDcdnRefreshTaskByIdRequest;
+
+DescribeDcdnRefreshTaskByIdRequest::DescribeDcdnRefreshTaskByIdRequest() :
+	RpcServiceRequest("dcdn", "2018-01-15", "DescribeDcdnRefreshTaskById")
+{
+	setMethod(HttpRequest::Method::Post);
+}
+
+DescribeDcdnRefreshTaskByIdRequest::~DescribeDcdnRefreshTaskByIdRequest()
+{}
+
+std::string DescribeDcdnRefreshTaskByIdRequest::getTaskId()const
+{
+	return taskId_;
+}
+
+void DescribeDcdnRefreshTaskByIdRequest::setTaskId(const std::string& taskId)
+{
+	taskId_ = taskId;
+	setParameter("TaskId", taskId);
+}
+
+long DescribeDcdnRefreshTaskByIdRequest::getOwnerId()const
+{
+	return ownerId_;
+}
+
+void DescribeDcdnRefreshTaskByIdRequest::setOwnerId(long ownerId)
+{
+	ownerId_ = ownerId;
+	setParameter("OwnerId", std::to_string(ownerId));
+}
+

+ 76 - 0
dcdn/src/model/DescribeDcdnRefreshTaskByIdResult.cc

@@ -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.
+ */
+
+#include <alibabacloud/dcdn/model/DescribeDcdnRefreshTaskByIdResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::Dcdn;
+using namespace AlibabaCloud::Dcdn::Model;
+
+DescribeDcdnRefreshTaskByIdResult::DescribeDcdnRefreshTaskByIdResult() :
+	ServiceResult()
+{}
+
+DescribeDcdnRefreshTaskByIdResult::DescribeDcdnRefreshTaskByIdResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+DescribeDcdnRefreshTaskByIdResult::~DescribeDcdnRefreshTaskByIdResult()
+{}
+
+void DescribeDcdnRefreshTaskByIdResult::parse(const std::string &payload)
+{
+	Json::Reader reader;
+	Json::Value value;
+	reader.parse(payload, value);
+	setRequestId(value["RequestId"].asString());
+	auto allTasksNode = value["Tasks"]["CDNTask"];
+	for (auto valueTasksCDNTask : allTasksNode)
+	{
+		CDNTask tasksObject;
+		if(!valueTasksCDNTask["TaskId"].isNull())
+			tasksObject.taskId = valueTasksCDNTask["TaskId"].asString();
+		if(!valueTasksCDNTask["ObjectPath"].isNull())
+			tasksObject.objectPath = valueTasksCDNTask["ObjectPath"].asString();
+		if(!valueTasksCDNTask["Process"].isNull())
+			tasksObject.process = valueTasksCDNTask["Process"].asString();
+		if(!valueTasksCDNTask["Status"].isNull())
+			tasksObject.status = valueTasksCDNTask["Status"].asString();
+		if(!valueTasksCDNTask["CreationTime"].isNull())
+			tasksObject.creationTime = valueTasksCDNTask["CreationTime"].asString();
+		if(!valueTasksCDNTask["Description"].isNull())
+			tasksObject.description = valueTasksCDNTask["Description"].asString();
+		if(!valueTasksCDNTask["ObjectType"].isNull())
+			tasksObject.objectType = valueTasksCDNTask["ObjectType"].asString();
+		tasks_.push_back(tasksObject);
+	}
+	if(!value["TotalCount"].isNull())
+		totalCount_ = std::stol(value["TotalCount"].asString());
+
+}
+
+long DescribeDcdnRefreshTaskByIdResult::getTotalCount()const
+{
+	return totalCount_;
+}
+
+std::vector<DescribeDcdnRefreshTaskByIdResult::CDNTask> DescribeDcdnRefreshTaskByIdResult::getTasks()const
+{
+	return tasks_;
+}
+