From e5ea19cdfbb0668ba6cebab7a9d8b030dece35a5 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Fri, 23 Oct 2020 03:01:46 +0000 Subject: [PATCH] Support feedback. --- CHANGELOG | 3 + imm/CMakeLists.txt | 8 +- imm/include/alibabacloud/imm/ImmClient.h | 8 ++ .../imm/model/VideoAnalyseFeedbackRequest.h | 69 +++++++++++ .../imm/model/VideoAnalyseFeedbackResult.h | 49 ++++++++ imm/src/ImmClient.cc | 36 ++++++ imm/src/model/VideoAnalyseFeedbackRequest.cc | 117 ++++++++++++++++++ imm/src/model/VideoAnalyseFeedbackResult.cc | 44 +++++++ 8 files changed, 332 insertions(+), 2 deletions(-) create mode 100644 imm/include/alibabacloud/imm/model/VideoAnalyseFeedbackRequest.h create mode 100644 imm/include/alibabacloud/imm/model/VideoAnalyseFeedbackResult.h create mode 100644 imm/src/model/VideoAnalyseFeedbackRequest.cc create mode 100644 imm/src/model/VideoAnalyseFeedbackResult.cc diff --git a/CHANGELOG b/CHANGELOG index 750503707..3f950a93a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-10-23 Version: patch +- Support feedback. + 2020-10-22 Version: patch - Add Pipeline Member api. diff --git a/imm/CMakeLists.txt b/imm/CMakeLists.txt index a12dcd00d..36eff58f5 100644 --- a/imm/CMakeLists.txt +++ b/imm/CMakeLists.txt @@ -176,7 +176,9 @@ set(imm_public_header_model include/alibabacloud/imm/model/UpdateProjectRequest.h include/alibabacloud/imm/model/UpdateProjectResult.h include/alibabacloud/imm/model/UpdateSetRequest.h - include/alibabacloud/imm/model/UpdateSetResult.h ) + include/alibabacloud/imm/model/UpdateSetResult.h + include/alibabacloud/imm/model/VideoAnalyseFeedbackRequest.h + include/alibabacloud/imm/model/VideoAnalyseFeedbackResult.h ) set(imm_src src/ImmClient.cc @@ -335,7 +337,9 @@ set(imm_src src/model/UpdateProjectRequest.cc src/model/UpdateProjectResult.cc src/model/UpdateSetRequest.cc - src/model/UpdateSetResult.cc ) + src/model/UpdateSetResult.cc + src/model/VideoAnalyseFeedbackRequest.cc + src/model/VideoAnalyseFeedbackResult.cc ) add_library(imm ${LIB_TYPE} ${imm_public_header} diff --git a/imm/include/alibabacloud/imm/ImmClient.h b/imm/include/alibabacloud/imm/ImmClient.h index 35500ce07..9ba0b784f 100644 --- a/imm/include/alibabacloud/imm/ImmClient.h +++ b/imm/include/alibabacloud/imm/ImmClient.h @@ -178,6 +178,8 @@ #include "model/UpdateProjectResult.h" #include "model/UpdateSetRequest.h" #include "model/UpdateSetResult.h" +#include "model/VideoAnalyseFeedbackRequest.h" +#include "model/VideoAnalyseFeedbackResult.h" namespace AlibabaCloud @@ -421,6 +423,9 @@ namespace AlibabaCloud typedef Outcome UpdateSetOutcome; typedef std::future UpdateSetOutcomeCallable; typedef std::function&)> UpdateSetAsyncHandler; + typedef Outcome VideoAnalyseFeedbackOutcome; + typedef std::future VideoAnalyseFeedbackOutcomeCallable; + typedef std::function&)> VideoAnalyseFeedbackAsyncHandler; ImmClient(const Credentials &credentials, const ClientConfiguration &configuration); ImmClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); @@ -660,6 +665,9 @@ namespace AlibabaCloud UpdateSetOutcome updateSet(const Model::UpdateSetRequest &request)const; void updateSetAsync(const Model::UpdateSetRequest& request, const UpdateSetAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; UpdateSetOutcomeCallable updateSetCallable(const Model::UpdateSetRequest& request) const; + VideoAnalyseFeedbackOutcome videoAnalyseFeedback(const Model::VideoAnalyseFeedbackRequest &request)const; + void videoAnalyseFeedbackAsync(const Model::VideoAnalyseFeedbackRequest& request, const VideoAnalyseFeedbackAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + VideoAnalyseFeedbackOutcomeCallable videoAnalyseFeedbackCallable(const Model::VideoAnalyseFeedbackRequest& request) const; private: std::shared_ptr endpointProvider_; diff --git a/imm/include/alibabacloud/imm/model/VideoAnalyseFeedbackRequest.h b/imm/include/alibabacloud/imm/model/VideoAnalyseFeedbackRequest.h new file mode 100644 index 000000000..3a570af39 --- /dev/null +++ b/imm/include/alibabacloud/imm/model/VideoAnalyseFeedbackRequest.h @@ -0,0 +1,69 @@ +/* + * 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_IMM_MODEL_VIDEOANALYSEFEEDBACKREQUEST_H_ +#define ALIBABACLOUD_IMM_MODEL_VIDEOANALYSEFEEDBACKREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imm + { + namespace Model + { + class ALIBABACLOUD_IMM_EXPORT VideoAnalyseFeedbackRequest : public RpcServiceRequest + { + + public: + VideoAnalyseFeedbackRequest(); + ~VideoAnalyseFeedbackRequest(); + + std::string getNote()const; + void setNote(const std::string& note); + std::string getProject()const; + void setProject(const std::string& project); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + std::string getTaskId()const; + void setTaskId(const std::string& taskId); + std::string getFrames()const; + void setFrames(const std::string& frames); + std::string getSuggestion()const; + void setSuggestion(const std::string& suggestion); + std::string getUri()const; + void setUri(const std::string& uri); + std::string getScenes()const; + void setScenes(const std::string& scenes); + + private: + std::string note_; + std::string project_; + std::string accessKeyId_; + std::string taskId_; + std::string frames_; + std::string suggestion_; + std::string uri_; + std::string scenes_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMM_MODEL_VIDEOANALYSEFEEDBACKREQUEST_H_ \ No newline at end of file diff --git a/imm/include/alibabacloud/imm/model/VideoAnalyseFeedbackResult.h b/imm/include/alibabacloud/imm/model/VideoAnalyseFeedbackResult.h new file mode 100644 index 000000000..e97e67092 --- /dev/null +++ b/imm/include/alibabacloud/imm/model/VideoAnalyseFeedbackResult.h @@ -0,0 +1,49 @@ +/* + * 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_IMM_MODEL_VIDEOANALYSEFEEDBACKRESULT_H_ +#define ALIBABACLOUD_IMM_MODEL_VIDEOANALYSEFEEDBACKRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imm + { + namespace Model + { + class ALIBABACLOUD_IMM_EXPORT VideoAnalyseFeedbackResult : public ServiceResult + { + public: + + + VideoAnalyseFeedbackResult(); + explicit VideoAnalyseFeedbackResult(const std::string &payload); + ~VideoAnalyseFeedbackResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_IMM_MODEL_VIDEOANALYSEFEEDBACKRESULT_H_ \ No newline at end of file diff --git a/imm/src/ImmClient.cc b/imm/src/ImmClient.cc index 093290e5a..47e6a3f80 100644 --- a/imm/src/ImmClient.cc +++ b/imm/src/ImmClient.cc @@ -2859,3 +2859,39 @@ ImmClient::UpdateSetOutcomeCallable ImmClient::updateSetCallable(const UpdateSet return task->get_future(); } +ImmClient::VideoAnalyseFeedbackOutcome ImmClient::videoAnalyseFeedback(const VideoAnalyseFeedbackRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return VideoAnalyseFeedbackOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return VideoAnalyseFeedbackOutcome(VideoAnalyseFeedbackResult(outcome.result())); + else + return VideoAnalyseFeedbackOutcome(outcome.error()); +} + +void ImmClient::videoAnalyseFeedbackAsync(const VideoAnalyseFeedbackRequest& request, const VideoAnalyseFeedbackAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, videoAnalyseFeedback(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ImmClient::VideoAnalyseFeedbackOutcomeCallable ImmClient::videoAnalyseFeedbackCallable(const VideoAnalyseFeedbackRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->videoAnalyseFeedback(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/imm/src/model/VideoAnalyseFeedbackRequest.cc b/imm/src/model/VideoAnalyseFeedbackRequest.cc new file mode 100644 index 000000000..480437112 --- /dev/null +++ b/imm/src/model/VideoAnalyseFeedbackRequest.cc @@ -0,0 +1,117 @@ +/* + * 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::Imm::Model::VideoAnalyseFeedbackRequest; + +VideoAnalyseFeedbackRequest::VideoAnalyseFeedbackRequest() : + RpcServiceRequest("imm", "2017-09-06", "VideoAnalyseFeedback") +{ + setMethod(HttpRequest::Method::Post); +} + +VideoAnalyseFeedbackRequest::~VideoAnalyseFeedbackRequest() +{} + +std::string VideoAnalyseFeedbackRequest::getNote()const +{ + return note_; +} + +void VideoAnalyseFeedbackRequest::setNote(const std::string& note) +{ + note_ = note; + setParameter("Note", note); +} + +std::string VideoAnalyseFeedbackRequest::getProject()const +{ + return project_; +} + +void VideoAnalyseFeedbackRequest::setProject(const std::string& project) +{ + project_ = project; + setParameter("Project", project); +} + +std::string VideoAnalyseFeedbackRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void VideoAnalyseFeedbackRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + +std::string VideoAnalyseFeedbackRequest::getTaskId()const +{ + return taskId_; +} + +void VideoAnalyseFeedbackRequest::setTaskId(const std::string& taskId) +{ + taskId_ = taskId; + setParameter("TaskId", taskId); +} + +std::string VideoAnalyseFeedbackRequest::getFrames()const +{ + return frames_; +} + +void VideoAnalyseFeedbackRequest::setFrames(const std::string& frames) +{ + frames_ = frames; + setParameter("Frames", frames); +} + +std::string VideoAnalyseFeedbackRequest::getSuggestion()const +{ + return suggestion_; +} + +void VideoAnalyseFeedbackRequest::setSuggestion(const std::string& suggestion) +{ + suggestion_ = suggestion; + setParameter("Suggestion", suggestion); +} + +std::string VideoAnalyseFeedbackRequest::getUri()const +{ + return uri_; +} + +void VideoAnalyseFeedbackRequest::setUri(const std::string& uri) +{ + uri_ = uri; + setParameter("Uri", uri); +} + +std::string VideoAnalyseFeedbackRequest::getScenes()const +{ + return scenes_; +} + +void VideoAnalyseFeedbackRequest::setScenes(const std::string& scenes) +{ + scenes_ = scenes; + setParameter("Scenes", scenes); +} + diff --git a/imm/src/model/VideoAnalyseFeedbackResult.cc b/imm/src/model/VideoAnalyseFeedbackResult.cc new file mode 100644 index 000000000..e23a9460e --- /dev/null +++ b/imm/src/model/VideoAnalyseFeedbackResult.cc @@ -0,0 +1,44 @@ +/* + * 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::Imm; +using namespace AlibabaCloud::Imm::Model; + +VideoAnalyseFeedbackResult::VideoAnalyseFeedbackResult() : + ServiceResult() +{} + +VideoAnalyseFeedbackResult::VideoAnalyseFeedbackResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +VideoAnalyseFeedbackResult::~VideoAnalyseFeedbackResult() +{} + +void VideoAnalyseFeedbackResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} +