From 679b7805c41be920a94f572ce38dc7b1d4dfb813 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Fri, 20 Dec 2019 11:42:08 +0800 Subject: [PATCH] Supported Search stream predict task list use modelId for IVISION. --- CHANGELOG | 3 + VERSION | 2 +- ivision/CMakeLists.txt | 8 +- .../alibabacloud/ivision/IvisionClient.h | 8 -- .../model/DescribeStreamPredictsRequest.h | 3 + .../ivision/model/VideoPredictRequest.h | 66 ----------- .../ivision/model/VideoPredictResult.h | 51 --------- ivision/src/IvisionClient.cc | 36 ------ .../model/DescribeStreamPredictsRequest.cc | 11 ++ ivision/src/model/VideoPredictRequest.cc | 106 ------------------ ivision/src/model/VideoPredictResult.cc | 51 --------- 11 files changed, 20 insertions(+), 325 deletions(-) delete mode 100644 ivision/include/alibabacloud/ivision/model/VideoPredictRequest.h delete mode 100644 ivision/include/alibabacloud/ivision/model/VideoPredictResult.h delete mode 100644 ivision/src/model/VideoPredictRequest.cc delete mode 100644 ivision/src/model/VideoPredictResult.cc diff --git a/CHANGELOG b/CHANGELOG index 4ef17a6f4..801847a12 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2019-12-20 Version 1.36.220 +- Supported Search stream predict task list use modelId for IVISION. + 2019-12-20 Version 1.36.219 - Add result value for OnsConsumerStatus. diff --git a/VERSION b/VERSION index 2c2cdb5ee..9d6734dac 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.219 \ No newline at end of file +1.36.220 \ No newline at end of file diff --git a/ivision/CMakeLists.txt b/ivision/CMakeLists.txt index c1bbc86db..7e8d43b00 100644 --- a/ivision/CMakeLists.txt +++ b/ivision/CMakeLists.txt @@ -46,9 +46,7 @@ set(ivision_public_header_model include/alibabacloud/ivision/model/StopStreamPredictRequest.h include/alibabacloud/ivision/model/StopStreamPredictResult.h include/alibabacloud/ivision/model/UnregisterFaceRequest.h - include/alibabacloud/ivision/model/UnregisterFaceResult.h - include/alibabacloud/ivision/model/VideoPredictRequest.h - include/alibabacloud/ivision/model/VideoPredictResult.h ) + include/alibabacloud/ivision/model/UnregisterFaceResult.h ) set(ivision_src src/IvisionClient.cc @@ -77,9 +75,7 @@ set(ivision_src src/model/StopStreamPredictRequest.cc src/model/StopStreamPredictResult.cc src/model/UnregisterFaceRequest.cc - src/model/UnregisterFaceResult.cc - src/model/VideoPredictRequest.cc - src/model/VideoPredictResult.cc ) + src/model/UnregisterFaceResult.cc ) add_library(ivision ${LIB_TYPE} ${ivision_public_header} diff --git a/ivision/include/alibabacloud/ivision/IvisionClient.h b/ivision/include/alibabacloud/ivision/IvisionClient.h index 5f496dada..0e781ca62 100644 --- a/ivision/include/alibabacloud/ivision/IvisionClient.h +++ b/ivision/include/alibabacloud/ivision/IvisionClient.h @@ -48,8 +48,6 @@ #include "model/StopStreamPredictResult.h" #include "model/UnregisterFaceRequest.h" #include "model/UnregisterFaceResult.h" -#include "model/VideoPredictRequest.h" -#include "model/VideoPredictResult.h" namespace AlibabaCloud @@ -98,9 +96,6 @@ namespace AlibabaCloud typedef Outcome UnregisterFaceOutcome; typedef std::future UnregisterFaceOutcomeCallable; typedef std::function&)> UnregisterFaceAsyncHandler; - typedef Outcome VideoPredictOutcome; - typedef std::future VideoPredictOutcomeCallable; - typedef std::function&)> VideoPredictAsyncHandler; IvisionClient(const Credentials &credentials, const ClientConfiguration &configuration); IvisionClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); @@ -145,9 +140,6 @@ namespace AlibabaCloud UnregisterFaceOutcome unregisterFace(const Model::UnregisterFaceRequest &request)const; void unregisterFaceAsync(const Model::UnregisterFaceRequest& request, const UnregisterFaceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; UnregisterFaceOutcomeCallable unregisterFaceCallable(const Model::UnregisterFaceRequest& request) const; - VideoPredictOutcome videoPredict(const Model::VideoPredictRequest &request)const; - void videoPredictAsync(const Model::VideoPredictRequest& request, const VideoPredictAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; - VideoPredictOutcomeCallable videoPredictCallable(const Model::VideoPredictRequest& request) const; private: std::shared_ptr endpointProvider_; diff --git a/ivision/include/alibabacloud/ivision/model/DescribeStreamPredictsRequest.h b/ivision/include/alibabacloud/ivision/model/DescribeStreamPredictsRequest.h index 1f421cdb3..04f628781 100644 --- a/ivision/include/alibabacloud/ivision/model/DescribeStreamPredictsRequest.h +++ b/ivision/include/alibabacloud/ivision/model/DescribeStreamPredictsRequest.h @@ -43,6 +43,8 @@ namespace AlibabaCloud void setPageSize(long pageSize); std::string getShowLog()const; void setShowLog(const std::string& showLog); + std::string getModelId()const; + void setModelId(const std::string& modelId); long getCurrentPage()const; void setCurrentPage(long currentPage); long getOwnerId()const; @@ -53,6 +55,7 @@ namespace AlibabaCloud std::string predictIds_; long pageSize_; std::string showLog_; + std::string modelId_; long currentPage_; long ownerId_; diff --git a/ivision/include/alibabacloud/ivision/model/VideoPredictRequest.h b/ivision/include/alibabacloud/ivision/model/VideoPredictRequest.h deleted file mode 100644 index 4adca375e..000000000 --- a/ivision/include/alibabacloud/ivision/model/VideoPredictRequest.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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_IVISION_MODEL_VIDEOPREDICTREQUEST_H_ -#define ALIBABACLOUD_IVISION_MODEL_VIDEOPREDICTREQUEST_H_ - -#include -#include -#include -#include - -namespace AlibabaCloud -{ - namespace Ivision - { - namespace Model - { - class ALIBABACLOUD_IVISION_EXPORT VideoPredictRequest : public RpcServiceRequest - { - - public: - VideoPredictRequest(); - ~VideoPredictRequest(); - - std::string getDataUrl()const; - void setDataUrl(const std::string& dataUrl); - std::string getClientToken()const; - void setClientToken(const std::string& clientToken); - std::string getNotify()const; - void setNotify(const std::string& notify); - std::string getOutput()const; - void setOutput(const std::string& output); - std::string getShowLog()const; - void setShowLog(const std::string& showLog); - std::string getModels()const; - void setModels(const std::string& models); - long getOwnerId()const; - void setOwnerId(long ownerId); - - private: - std::string dataUrl_; - std::string clientToken_; - std::string notify_; - std::string output_; - std::string showLog_; - std::string models_; - long ownerId_; - - }; - } - } -} -#endif // !ALIBABACLOUD_IVISION_MODEL_VIDEOPREDICTREQUEST_H_ \ No newline at end of file diff --git a/ivision/include/alibabacloud/ivision/model/VideoPredictResult.h b/ivision/include/alibabacloud/ivision/model/VideoPredictResult.h deleted file mode 100644 index c42925ae4..000000000 --- a/ivision/include/alibabacloud/ivision/model/VideoPredictResult.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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_IVISION_MODEL_VIDEOPREDICTRESULT_H_ -#define ALIBABACLOUD_IVISION_MODEL_VIDEOPREDICTRESULT_H_ - -#include -#include -#include -#include -#include - -namespace AlibabaCloud -{ - namespace Ivision - { - namespace Model - { - class ALIBABACLOUD_IVISION_EXPORT VideoPredictResult : public ServiceResult - { - public: - - - VideoPredictResult(); - explicit VideoPredictResult(const std::string &payload); - ~VideoPredictResult(); - std::string getPredictId()const; - - protected: - void parse(const std::string &payload); - private: - std::string predictId_; - - }; - } - } -} -#endif // !ALIBABACLOUD_IVISION_MODEL_VIDEOPREDICTRESULT_H_ \ No newline at end of file diff --git a/ivision/src/IvisionClient.cc b/ivision/src/IvisionClient.cc index 5df0e5af7..244395f02 100644 --- a/ivision/src/IvisionClient.cc +++ b/ivision/src/IvisionClient.cc @@ -519,39 +519,3 @@ IvisionClient::UnregisterFaceOutcomeCallable IvisionClient::unregisterFaceCallab return task->get_future(); } -IvisionClient::VideoPredictOutcome IvisionClient::videoPredict(const VideoPredictRequest &request) const -{ - auto endpointOutcome = endpointProvider_->getEndpoint(); - if (!endpointOutcome.isSuccess()) - return VideoPredictOutcome(endpointOutcome.error()); - - auto outcome = makeRequest(endpointOutcome.result(), request); - - if (outcome.isSuccess()) - return VideoPredictOutcome(VideoPredictResult(outcome.result())); - else - return VideoPredictOutcome(outcome.error()); -} - -void IvisionClient::videoPredictAsync(const VideoPredictRequest& request, const VideoPredictAsyncHandler& handler, const std::shared_ptr& context) const -{ - auto fn = [this, request, handler, context]() - { - handler(this, request, videoPredict(request), context); - }; - - asyncExecute(new Runnable(fn)); -} - -IvisionClient::VideoPredictOutcomeCallable IvisionClient::videoPredictCallable(const VideoPredictRequest &request) const -{ - auto task = std::make_shared>( - [this, request]() - { - return this->videoPredict(request); - }); - - asyncExecute(new Runnable([task]() { (*task)(); })); - return task->get_future(); -} - diff --git a/ivision/src/model/DescribeStreamPredictsRequest.cc b/ivision/src/model/DescribeStreamPredictsRequest.cc index 0cc09f4ba..6bf91413d 100644 --- a/ivision/src/model/DescribeStreamPredictsRequest.cc +++ b/ivision/src/model/DescribeStreamPredictsRequest.cc @@ -71,6 +71,17 @@ void DescribeStreamPredictsRequest::setShowLog(const std::string& showLog) setCoreParameter("ShowLog", showLog); } +std::string DescribeStreamPredictsRequest::getModelId()const +{ + return modelId_; +} + +void DescribeStreamPredictsRequest::setModelId(const std::string& modelId) +{ + modelId_ = modelId; + setCoreParameter("ModelId", modelId); +} + long DescribeStreamPredictsRequest::getCurrentPage()const { return currentPage_; diff --git a/ivision/src/model/VideoPredictRequest.cc b/ivision/src/model/VideoPredictRequest.cc deleted file mode 100644 index a82f7055e..000000000 --- a/ivision/src/model/VideoPredictRequest.cc +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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::Ivision::Model::VideoPredictRequest; - -VideoPredictRequest::VideoPredictRequest() : - RpcServiceRequest("ivision", "2019-03-08", "VideoPredict") -{ - setMethod(HttpRequest::Method::Post); -} - -VideoPredictRequest::~VideoPredictRequest() -{} - -std::string VideoPredictRequest::getDataUrl()const -{ - return dataUrl_; -} - -void VideoPredictRequest::setDataUrl(const std::string& dataUrl) -{ - dataUrl_ = dataUrl; - setCoreParameter("DataUrl", dataUrl); -} - -std::string VideoPredictRequest::getClientToken()const -{ - return clientToken_; -} - -void VideoPredictRequest::setClientToken(const std::string& clientToken) -{ - clientToken_ = clientToken; - setCoreParameter("ClientToken", clientToken); -} - -std::string VideoPredictRequest::getNotify()const -{ - return notify_; -} - -void VideoPredictRequest::setNotify(const std::string& notify) -{ - notify_ = notify; - setCoreParameter("Notify", notify); -} - -std::string VideoPredictRequest::getOutput()const -{ - return output_; -} - -void VideoPredictRequest::setOutput(const std::string& output) -{ - output_ = output; - setCoreParameter("Output", output); -} - -std::string VideoPredictRequest::getShowLog()const -{ - return showLog_; -} - -void VideoPredictRequest::setShowLog(const std::string& showLog) -{ - showLog_ = showLog; - setCoreParameter("ShowLog", showLog); -} - -std::string VideoPredictRequest::getModels()const -{ - return models_; -} - -void VideoPredictRequest::setModels(const std::string& models) -{ - models_ = models; - setCoreParameter("Models", models); -} - -long VideoPredictRequest::getOwnerId()const -{ - return ownerId_; -} - -void VideoPredictRequest::setOwnerId(long ownerId) -{ - ownerId_ = ownerId; - setCoreParameter("OwnerId", std::to_string(ownerId)); -} - diff --git a/ivision/src/model/VideoPredictResult.cc b/ivision/src/model/VideoPredictResult.cc deleted file mode 100644 index 2ef225da8..000000000 --- a/ivision/src/model/VideoPredictResult.cc +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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::Ivision; -using namespace AlibabaCloud::Ivision::Model; - -VideoPredictResult::VideoPredictResult() : - ServiceResult() -{} - -VideoPredictResult::VideoPredictResult(const std::string &payload) : - ServiceResult() -{ - parse(payload); -} - -VideoPredictResult::~VideoPredictResult() -{} - -void VideoPredictResult::parse(const std::string &payload) -{ - Json::Reader reader; - Json::Value value; - reader.parse(payload, value); - setRequestId(value["RequestId"].asString()); - if(!value["PredictId"].isNull()) - predictId_ = value["PredictId"].asString(); - -} - -std::string VideoPredictResult::getPredictId()const -{ - return predictId_; -} -