Browse Source

Supported GetVideo Api.

sdk-team 3 years ago
parent
commit
12839600df

+ 1 - 1
VERSION

@@ -1 +1 @@
-1.36.1557
+1.36.1558

+ 4 - 0
ccc/CMakeLists.txt

@@ -147,6 +147,8 @@ set(ccc_public_header_model
 	include/alibabacloud/ccc/model/GetUploadAudioDataParamsResult.h
 	include/alibabacloud/ccc/model/GetUserRequest.h
 	include/alibabacloud/ccc/model/GetUserResult.h
+	include/alibabacloud/ccc/model/GetVideoRequest.h
+	include/alibabacloud/ccc/model/GetVideoResult.h
 	include/alibabacloud/ccc/model/GetVoicemailRecordingRequest.h
 	include/alibabacloud/ccc/model/GetVoicemailRecordingResult.h
 	include/alibabacloud/ccc/model/HoldCallRequest.h
@@ -490,6 +492,8 @@ set(ccc_src
 	src/model/GetUploadAudioDataParamsResult.cc
 	src/model/GetUserRequest.cc
 	src/model/GetUserResult.cc
+	src/model/GetVideoRequest.cc
+	src/model/GetVideoResult.cc
 	src/model/GetVoicemailRecordingRequest.cc
 	src/model/GetVoicemailRecordingResult.cc
 	src/model/HoldCallRequest.cc

+ 8 - 0
ccc/include/alibabacloud/ccc/CCCClient.h

@@ -148,6 +148,8 @@
 #include "model/GetUploadAudioDataParamsResult.h"
 #include "model/GetUserRequest.h"
 #include "model/GetUserResult.h"
+#include "model/GetVideoRequest.h"
+#include "model/GetVideoResult.h"
 #include "model/GetVoicemailRecordingRequest.h"
 #include "model/GetVoicemailRecordingResult.h"
 #include "model/HoldCallRequest.h"
@@ -560,6 +562,9 @@ namespace AlibabaCloud
 			typedef Outcome<Error, Model::GetUserResult> GetUserOutcome;
 			typedef std::future<GetUserOutcome> GetUserOutcomeCallable;
 			typedef std::function<void(const CCCClient*, const Model::GetUserRequest&, const GetUserOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetUserAsyncHandler;
+			typedef Outcome<Error, Model::GetVideoResult> GetVideoOutcome;
+			typedef std::future<GetVideoOutcome> GetVideoOutcomeCallable;
+			typedef std::function<void(const CCCClient*, const Model::GetVideoRequest&, const GetVideoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetVideoAsyncHandler;
 			typedef Outcome<Error, Model::GetVoicemailRecordingResult> GetVoicemailRecordingOutcome;
 			typedef std::future<GetVoicemailRecordingOutcome> GetVoicemailRecordingOutcomeCallable;
 			typedef std::function<void(const CCCClient*, const Model::GetVoicemailRecordingRequest&, const GetVoicemailRecordingOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetVoicemailRecordingAsyncHandler;
@@ -1075,6 +1080,9 @@ namespace AlibabaCloud
 			GetUserOutcome getUser(const Model::GetUserRequest &request)const;
 			void getUserAsync(const Model::GetUserRequest& request, const GetUserAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			GetUserOutcomeCallable getUserCallable(const Model::GetUserRequest& request) const;
+			GetVideoOutcome getVideo(const Model::GetVideoRequest &request)const;
+			void getVideoAsync(const Model::GetVideoRequest& request, const GetVideoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+			GetVideoOutcomeCallable getVideoCallable(const Model::GetVideoRequest& request) const;
 			GetVoicemailRecordingOutcome getVoicemailRecording(const Model::GetVoicemailRecordingRequest &request)const;
 			void getVoicemailRecordingAsync(const Model::GetVoicemailRecordingRequest& request, const GetVoicemailRecordingAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			GetVoicemailRecordingOutcomeCallable getVoicemailRecordingCallable(const Model::GetVoicemailRecordingRequest& request) const;

+ 45 - 0
ccc/include/alibabacloud/ccc/model/GetVideoRequest.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_CCC_MODEL_GETVIDEOREQUEST_H_
+#define ALIBABACLOUD_CCC_MODEL_GETVIDEOREQUEST_H_
+
+#include <alibabacloud/ccc/CCCExport.h>
+#include <alibabacloud/core/RpcServiceRequest.h>
+#include <string>
+#include <vector>
+#include <map>
+
+namespace AlibabaCloud {
+namespace CCC {
+namespace Model {
+class ALIBABACLOUD_CCC_EXPORT GetVideoRequest : public RpcServiceRequest {
+public:
+	GetVideoRequest();
+	~GetVideoRequest();
+	std::string getContactId() const;
+	void setContactId(const std::string &contactId);
+	std::string getInstanceId() const;
+	void setInstanceId(const std::string &instanceId);
+
+private:
+	std::string contactId_;
+	std::string instanceId_;
+};
+} // namespace Model
+} // namespace CCC
+} // namespace AlibabaCloud
+#endif // !ALIBABACLOUD_CCC_MODEL_GETVIDEOREQUEST_H_

+ 62 - 0
ccc/include/alibabacloud/ccc/model/GetVideoResult.h

@@ -0,0 +1,62 @@
+/*
+ * 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_CCC_MODEL_GETVIDEORESULT_H_
+#define ALIBABACLOUD_CCC_MODEL_GETVIDEORESULT_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/ccc/CCCExport.h>
+
+namespace AlibabaCloud
+{
+	namespace CCC
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_CCC_EXPORT GetVideoResult : public ServiceResult
+			{
+			public:
+				struct Data
+				{
+					std::string fileUrl;
+					std::string fileName;
+				};
+
+
+				GetVideoResult();
+				explicit GetVideoResult(const std::string &payload);
+				~GetVideoResult();
+				std::string getMessage()const;
+				int getHttpStatusCode()const;
+				Data getData()const;
+				std::string getCode()const;
+
+			protected:
+				void parse(const std::string &payload);
+			private:
+				std::string message_;
+				int httpStatusCode_;
+				Data data_;
+				std::string code_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_CCC_MODEL_GETVIDEORESULT_H_

+ 36 - 0
ccc/src/CCCClient.cc

@@ -2319,6 +2319,42 @@ CCCClient::GetUserOutcomeCallable CCCClient::getUserCallable(const GetUserReques
 	return task->get_future();
 }
 
+CCCClient::GetVideoOutcome CCCClient::getVideo(const GetVideoRequest &request) const
+{
+	auto endpointOutcome = endpointProvider_->getEndpoint();
+	if (!endpointOutcome.isSuccess())
+		return GetVideoOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return GetVideoOutcome(GetVideoResult(outcome.result()));
+	else
+		return GetVideoOutcome(outcome.error());
+}
+
+void CCCClient::getVideoAsync(const GetVideoRequest& request, const GetVideoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, getVideo(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+CCCClient::GetVideoOutcomeCallable CCCClient::getVideoCallable(const GetVideoRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<GetVideoOutcome()>>(
+			[this, request]()
+			{
+			return this->getVideo(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+
 CCCClient::GetVoicemailRecordingOutcome CCCClient::getVoicemailRecording(const GetVoicemailRecordingRequest &request) const
 {
 	auto endpointOutcome = endpointProvider_->getEndpoint();

+ 45 - 0
ccc/src/model/GetVideoRequest.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 <alibabacloud/ccc/model/GetVideoRequest.h>
+
+using AlibabaCloud::CCC::Model::GetVideoRequest;
+
+GetVideoRequest::GetVideoRequest()
+    : RpcServiceRequest("ccc", "2020-07-01", "GetVideo") {
+  setMethod(HttpRequest::Method::Get);
+}
+
+GetVideoRequest::~GetVideoRequest() {}
+
+std::string GetVideoRequest::getContactId() const {
+  return contactId_;
+}
+
+void GetVideoRequest::setContactId(const std::string &contactId) {
+  contactId_ = contactId;
+  setParameter(std::string("ContactId"), contactId);
+}
+
+std::string GetVideoRequest::getInstanceId() const {
+  return instanceId_;
+}
+
+void GetVideoRequest::setInstanceId(const std::string &instanceId) {
+  instanceId_ = instanceId;
+  setParameter(std::string("InstanceId"), instanceId);
+}
+

+ 75 - 0
ccc/src/model/GetVideoResult.cc

@@ -0,0 +1,75 @@
+/*
+ * 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/ccc/model/GetVideoResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::CCC;
+using namespace AlibabaCloud::CCC::Model;
+
+GetVideoResult::GetVideoResult() :
+	ServiceResult()
+{}
+
+GetVideoResult::GetVideoResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+GetVideoResult::~GetVideoResult()
+{}
+
+void GetVideoResult::parse(const std::string &payload)
+{
+	Json::Reader reader;
+	Json::Value value;
+	reader.parse(payload, value);
+	setRequestId(value["RequestId"].asString());
+	auto dataNode = value["Data"];
+	if(!dataNode["FileUrl"].isNull())
+		data_.fileUrl = dataNode["FileUrl"].asString();
+	if(!dataNode["FileName"].isNull())
+		data_.fileName = dataNode["FileName"].asString();
+	if(!value["Code"].isNull())
+		code_ = value["Code"].asString();
+	if(!value["HttpStatusCode"].isNull())
+		httpStatusCode_ = std::stoi(value["HttpStatusCode"].asString());
+	if(!value["Message"].isNull())
+		message_ = value["Message"].asString();
+
+}
+
+std::string GetVideoResult::getMessage()const
+{
+	return message_;
+}
+
+int GetVideoResult::getHttpStatusCode()const
+{
+	return httpStatusCode_;
+}
+
+GetVideoResult::Data GetVideoResult::getData()const
+{
+	return data_;
+}
+
+std::string GetVideoResult::getCode()const
+{
+	return code_;
+}
+