From 6c1dbc8b067aa615676f2312c8e09eb806775ede Mon Sep 17 00:00:00 2001 From: sdk-team Date: Tue, 12 May 2020 11:28:55 +0800 Subject: [PATCH] Supported DRM. --- CHANGELOG | 3 + VERSION | 2 +- imm/CMakeLists.txt | 12 ++ imm/include/alibabacloud/imm/ImmClient.h | 24 ++++ .../imm/model/GetContentKeyRequest.h | 60 ++++++++++ .../imm/model/GetContentKeyResult.h | 53 +++++++++ .../imm/model/GetDRMLicenseRequest.h | 57 +++++++++ .../imm/model/GetDRMLicenseResult.h | 51 +++++++++ .../imm/model/StopStreamAnalyseTaskRequest.h | 54 +++++++++ .../imm/model/StopStreamAnalyseTaskResult.h | 51 +++++++++ imm/src/ImmClient.cc | 108 ++++++++++++++++++ imm/src/model/GetContentKeyRequest.cc | 84 ++++++++++++++ imm/src/model/GetContentKeyResult.cc | 58 ++++++++++ imm/src/model/GetDRMLicenseRequest.cc | 73 ++++++++++++ imm/src/model/GetDRMLicenseResult.cc | 51 +++++++++ imm/src/model/StopStreamAnalyseTaskRequest.cc | 62 ++++++++++ imm/src/model/StopStreamAnalyseTaskResult.cc | 51 +++++++++ 17 files changed, 853 insertions(+), 1 deletion(-) create mode 100644 imm/include/alibabacloud/imm/model/GetContentKeyRequest.h create mode 100644 imm/include/alibabacloud/imm/model/GetContentKeyResult.h create mode 100644 imm/include/alibabacloud/imm/model/GetDRMLicenseRequest.h create mode 100644 imm/include/alibabacloud/imm/model/GetDRMLicenseResult.h create mode 100644 imm/include/alibabacloud/imm/model/StopStreamAnalyseTaskRequest.h create mode 100644 imm/include/alibabacloud/imm/model/StopStreamAnalyseTaskResult.h create mode 100644 imm/src/model/GetContentKeyRequest.cc create mode 100644 imm/src/model/GetContentKeyResult.cc create mode 100644 imm/src/model/GetDRMLicenseRequest.cc create mode 100644 imm/src/model/GetDRMLicenseResult.cc create mode 100644 imm/src/model/StopStreamAnalyseTaskRequest.cc create mode 100644 imm/src/model/StopStreamAnalyseTaskResult.cc diff --git a/CHANGELOG b/CHANGELOG index d972da9a3..a3cd3daa3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-05-12 Version: 1.36.404 +- Supported DRM. + 2020-05-11 Version: 1.36.403 - Add new openapi ApplyNodes. diff --git a/VERSION b/VERSION index afb4f6fd8..11311d36b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.403 \ No newline at end of file +1.36.404 \ No newline at end of file diff --git a/imm/CMakeLists.txt b/imm/CMakeLists.txt index 4237f4378..00edbc622 100644 --- a/imm/CMakeLists.txt +++ b/imm/CMakeLists.txt @@ -97,6 +97,10 @@ set(imm_public_header_model include/alibabacloud/imm/model/FindImagesByTagNamesResult.h include/alibabacloud/imm/model/FindSimilarFacesRequest.h include/alibabacloud/imm/model/FindSimilarFacesResult.h + include/alibabacloud/imm/model/GetContentKeyRequest.h + include/alibabacloud/imm/model/GetContentKeyResult.h + include/alibabacloud/imm/model/GetDRMLicenseRequest.h + include/alibabacloud/imm/model/GetDRMLicenseResult.h include/alibabacloud/imm/model/GetDocIndexRequest.h include/alibabacloud/imm/model/GetDocIndexResult.h include/alibabacloud/imm/model/GetDocIndexTaskRequest.h @@ -157,6 +161,8 @@ set(imm_public_header_model include/alibabacloud/imm/model/RefreshOfficePreviewTokenResult.h include/alibabacloud/imm/model/SearchDocIndexRequest.h include/alibabacloud/imm/model/SearchDocIndexResult.h + include/alibabacloud/imm/model/StopStreamAnalyseTaskRequest.h + include/alibabacloud/imm/model/StopStreamAnalyseTaskResult.h include/alibabacloud/imm/model/UpdateDocIndexMetaRequest.h include/alibabacloud/imm/model/UpdateDocIndexMetaResult.h include/alibabacloud/imm/model/UpdateFaceGroupRequest.h @@ -246,6 +252,10 @@ set(imm_src src/model/FindImagesByTagNamesResult.cc src/model/FindSimilarFacesRequest.cc src/model/FindSimilarFacesResult.cc + src/model/GetContentKeyRequest.cc + src/model/GetContentKeyResult.cc + src/model/GetDRMLicenseRequest.cc + src/model/GetDRMLicenseResult.cc src/model/GetDocIndexRequest.cc src/model/GetDocIndexResult.cc src/model/GetDocIndexTaskRequest.cc @@ -306,6 +316,8 @@ set(imm_src src/model/RefreshOfficePreviewTokenResult.cc src/model/SearchDocIndexRequest.cc src/model/SearchDocIndexResult.cc + src/model/StopStreamAnalyseTaskRequest.cc + src/model/StopStreamAnalyseTaskResult.cc src/model/UpdateDocIndexMetaRequest.cc src/model/UpdateDocIndexMetaResult.cc src/model/UpdateFaceGroupRequest.cc diff --git a/imm/include/alibabacloud/imm/ImmClient.h b/imm/include/alibabacloud/imm/ImmClient.h index 2ced64fce..f40f1c051 100644 --- a/imm/include/alibabacloud/imm/ImmClient.h +++ b/imm/include/alibabacloud/imm/ImmClient.h @@ -98,6 +98,10 @@ #include "model/FindImagesByTagNamesResult.h" #include "model/FindSimilarFacesRequest.h" #include "model/FindSimilarFacesResult.h" +#include "model/GetContentKeyRequest.h" +#include "model/GetContentKeyResult.h" +#include "model/GetDRMLicenseRequest.h" +#include "model/GetDRMLicenseResult.h" #include "model/GetDocIndexRequest.h" #include "model/GetDocIndexResult.h" #include "model/GetDocIndexTaskRequest.h" @@ -158,6 +162,8 @@ #include "model/RefreshOfficePreviewTokenResult.h" #include "model/SearchDocIndexRequest.h" #include "model/SearchDocIndexResult.h" +#include "model/StopStreamAnalyseTaskRequest.h" +#include "model/StopStreamAnalyseTaskResult.h" #include "model/UpdateDocIndexMetaRequest.h" #include "model/UpdateDocIndexMetaResult.h" #include "model/UpdateFaceGroupRequest.h" @@ -291,6 +297,12 @@ namespace AlibabaCloud typedef Outcome FindSimilarFacesOutcome; typedef std::future FindSimilarFacesOutcomeCallable; typedef std::function&)> FindSimilarFacesAsyncHandler; + typedef Outcome GetContentKeyOutcome; + typedef std::future GetContentKeyOutcomeCallable; + typedef std::function&)> GetContentKeyAsyncHandler; + typedef Outcome GetDRMLicenseOutcome; + typedef std::future GetDRMLicenseOutcomeCallable; + typedef std::function&)> GetDRMLicenseAsyncHandler; typedef Outcome GetDocIndexOutcome; typedef std::future GetDocIndexOutcomeCallable; typedef std::function&)> GetDocIndexAsyncHandler; @@ -381,6 +393,9 @@ namespace AlibabaCloud typedef Outcome SearchDocIndexOutcome; typedef std::future SearchDocIndexOutcomeCallable; typedef std::function&)> SearchDocIndexAsyncHandler; + typedef Outcome StopStreamAnalyseTaskOutcome; + typedef std::future StopStreamAnalyseTaskOutcomeCallable; + typedef std::function&)> StopStreamAnalyseTaskAsyncHandler; typedef Outcome UpdateDocIndexMetaOutcome; typedef std::future UpdateDocIndexMetaOutcomeCallable; typedef std::function&)> UpdateDocIndexMetaAsyncHandler; @@ -515,6 +530,12 @@ namespace AlibabaCloud FindSimilarFacesOutcome findSimilarFaces(const Model::FindSimilarFacesRequest &request)const; void findSimilarFacesAsync(const Model::FindSimilarFacesRequest& request, const FindSimilarFacesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; FindSimilarFacesOutcomeCallable findSimilarFacesCallable(const Model::FindSimilarFacesRequest& request) const; + GetContentKeyOutcome getContentKey(const Model::GetContentKeyRequest &request)const; + void getContentKeyAsync(const Model::GetContentKeyRequest& request, const GetContentKeyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetContentKeyOutcomeCallable getContentKeyCallable(const Model::GetContentKeyRequest& request) const; + GetDRMLicenseOutcome getDRMLicense(const Model::GetDRMLicenseRequest &request)const; + void getDRMLicenseAsync(const Model::GetDRMLicenseRequest& request, const GetDRMLicenseAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetDRMLicenseOutcomeCallable getDRMLicenseCallable(const Model::GetDRMLicenseRequest& request) const; GetDocIndexOutcome getDocIndex(const Model::GetDocIndexRequest &request)const; void getDocIndexAsync(const Model::GetDocIndexRequest& request, const GetDocIndexAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetDocIndexOutcomeCallable getDocIndexCallable(const Model::GetDocIndexRequest& request) const; @@ -605,6 +626,9 @@ namespace AlibabaCloud SearchDocIndexOutcome searchDocIndex(const Model::SearchDocIndexRequest &request)const; void searchDocIndexAsync(const Model::SearchDocIndexRequest& request, const SearchDocIndexAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; SearchDocIndexOutcomeCallable searchDocIndexCallable(const Model::SearchDocIndexRequest& request) const; + StopStreamAnalyseTaskOutcome stopStreamAnalyseTask(const Model::StopStreamAnalyseTaskRequest &request)const; + void stopStreamAnalyseTaskAsync(const Model::StopStreamAnalyseTaskRequest& request, const StopStreamAnalyseTaskAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + StopStreamAnalyseTaskOutcomeCallable stopStreamAnalyseTaskCallable(const Model::StopStreamAnalyseTaskRequest& request) const; UpdateDocIndexMetaOutcome updateDocIndexMeta(const Model::UpdateDocIndexMetaRequest &request)const; void updateDocIndexMetaAsync(const Model::UpdateDocIndexMetaRequest& request, const UpdateDocIndexMetaAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; UpdateDocIndexMetaOutcomeCallable updateDocIndexMetaCallable(const Model::UpdateDocIndexMetaRequest& request) const; diff --git a/imm/include/alibabacloud/imm/model/GetContentKeyRequest.h b/imm/include/alibabacloud/imm/model/GetContentKeyRequest.h new file mode 100644 index 000000000..f00c7f18b --- /dev/null +++ b/imm/include/alibabacloud/imm/model/GetContentKeyRequest.h @@ -0,0 +1,60 @@ +/* + * 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_GETCONTENTKEYREQUEST_H_ +#define ALIBABACLOUD_IMM_MODEL_GETCONTENTKEYREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imm + { + namespace Model + { + class ALIBABACLOUD_IMM_EXPORT GetContentKeyRequest : public RpcServiceRequest + { + + public: + GetContentKeyRequest(); + ~GetContentKeyRequest(); + + std::string getProject()const; + void setProject(const std::string& project); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + std::string getVersionId()const; + void setVersionId(const std::string& versionId); + std::string getDRMServerId()const; + void setDRMServerId(const std::string& dRMServerId); + std::string getKeyIds()const; + void setKeyIds(const std::string& keyIds); + + private: + std::string project_; + std::string accessKeyId_; + std::string versionId_; + std::string dRMServerId_; + std::string keyIds_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMM_MODEL_GETCONTENTKEYREQUEST_H_ \ No newline at end of file diff --git a/imm/include/alibabacloud/imm/model/GetContentKeyResult.h b/imm/include/alibabacloud/imm/model/GetContentKeyResult.h new file mode 100644 index 000000000..3f19e83fe --- /dev/null +++ b/imm/include/alibabacloud/imm/model/GetContentKeyResult.h @@ -0,0 +1,53 @@ +/* + * 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_GETCONTENTKEYRESULT_H_ +#define ALIBABACLOUD_IMM_MODEL_GETCONTENTKEYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imm + { + namespace Model + { + class ALIBABACLOUD_IMM_EXPORT GetContentKeyResult : public ServiceResult + { + public: + + + GetContentKeyResult(); + explicit GetContentKeyResult(const std::string &payload); + ~GetContentKeyResult(); + std::string getVersionId()const; + std::string getKeyInfos()const; + + protected: + void parse(const std::string &payload); + private: + std::string versionId_; + std::string keyInfos_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMM_MODEL_GETCONTENTKEYRESULT_H_ \ No newline at end of file diff --git a/imm/include/alibabacloud/imm/model/GetDRMLicenseRequest.h b/imm/include/alibabacloud/imm/model/GetDRMLicenseRequest.h new file mode 100644 index 000000000..946c70b38 --- /dev/null +++ b/imm/include/alibabacloud/imm/model/GetDRMLicenseRequest.h @@ -0,0 +1,57 @@ +/* + * 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_GETDRMLICENSEREQUEST_H_ +#define ALIBABACLOUD_IMM_MODEL_GETDRMLICENSEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imm + { + namespace Model + { + class ALIBABACLOUD_IMM_EXPORT GetDRMLicenseRequest : public RpcServiceRequest + { + + public: + GetDRMLicenseRequest(); + ~GetDRMLicenseRequest(); + + std::string getProject()const; + void setProject(const std::string& project); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + std::string getDRMType()const; + void setDRMType(const std::string& dRMType); + std::string getDRMLicense()const; + void setDRMLicense(const std::string& dRMLicense); + + private: + std::string project_; + std::string accessKeyId_; + std::string dRMType_; + std::string dRMLicense_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMM_MODEL_GETDRMLICENSEREQUEST_H_ \ No newline at end of file diff --git a/imm/include/alibabacloud/imm/model/GetDRMLicenseResult.h b/imm/include/alibabacloud/imm/model/GetDRMLicenseResult.h new file mode 100644 index 000000000..18b434c38 --- /dev/null +++ b/imm/include/alibabacloud/imm/model/GetDRMLicenseResult.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_IMM_MODEL_GETDRMLICENSERESULT_H_ +#define ALIBABACLOUD_IMM_MODEL_GETDRMLICENSERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imm + { + namespace Model + { + class ALIBABACLOUD_IMM_EXPORT GetDRMLicenseResult : public ServiceResult + { + public: + + + GetDRMLicenseResult(); + explicit GetDRMLicenseResult(const std::string &payload); + ~GetDRMLicenseResult(); + std::string getDRMData()const; + + protected: + void parse(const std::string &payload); + private: + std::string dRMData_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMM_MODEL_GETDRMLICENSERESULT_H_ \ No newline at end of file diff --git a/imm/include/alibabacloud/imm/model/StopStreamAnalyseTaskRequest.h b/imm/include/alibabacloud/imm/model/StopStreamAnalyseTaskRequest.h new file mode 100644 index 000000000..0e84f1bec --- /dev/null +++ b/imm/include/alibabacloud/imm/model/StopStreamAnalyseTaskRequest.h @@ -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. + */ + +#ifndef ALIBABACLOUD_IMM_MODEL_STOPSTREAMANALYSETASKREQUEST_H_ +#define ALIBABACLOUD_IMM_MODEL_STOPSTREAMANALYSETASKREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imm + { + namespace Model + { + class ALIBABACLOUD_IMM_EXPORT StopStreamAnalyseTaskRequest : public RpcServiceRequest + { + + public: + StopStreamAnalyseTaskRequest(); + ~StopStreamAnalyseTaskRequest(); + + 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); + + private: + std::string project_; + std::string accessKeyId_; + std::string taskId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMM_MODEL_STOPSTREAMANALYSETASKREQUEST_H_ \ No newline at end of file diff --git a/imm/include/alibabacloud/imm/model/StopStreamAnalyseTaskResult.h b/imm/include/alibabacloud/imm/model/StopStreamAnalyseTaskResult.h new file mode 100644 index 000000000..e59757e06 --- /dev/null +++ b/imm/include/alibabacloud/imm/model/StopStreamAnalyseTaskResult.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_IMM_MODEL_STOPSTREAMANALYSETASKRESULT_H_ +#define ALIBABACLOUD_IMM_MODEL_STOPSTREAMANALYSETASKRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imm + { + namespace Model + { + class ALIBABACLOUD_IMM_EXPORT StopStreamAnalyseTaskResult : public ServiceResult + { + public: + + + StopStreamAnalyseTaskResult(); + explicit StopStreamAnalyseTaskResult(const std::string &payload); + ~StopStreamAnalyseTaskResult(); + std::string getTaskId()const; + + protected: + void parse(const std::string &payload); + private: + std::string taskId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMM_MODEL_STOPSTREAMANALYSETASKRESULT_H_ \ No newline at end of file diff --git a/imm/src/ImmClient.cc b/imm/src/ImmClient.cc index a5e48d1cb..72d0c7c1a 100644 --- a/imm/src/ImmClient.cc +++ b/imm/src/ImmClient.cc @@ -1419,6 +1419,78 @@ ImmClient::FindSimilarFacesOutcomeCallable ImmClient::findSimilarFacesCallable(c return task->get_future(); } +ImmClient::GetContentKeyOutcome ImmClient::getContentKey(const GetContentKeyRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetContentKeyOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetContentKeyOutcome(GetContentKeyResult(outcome.result())); + else + return GetContentKeyOutcome(outcome.error()); +} + +void ImmClient::getContentKeyAsync(const GetContentKeyRequest& request, const GetContentKeyAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getContentKey(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ImmClient::GetContentKeyOutcomeCallable ImmClient::getContentKeyCallable(const GetContentKeyRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getContentKey(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +ImmClient::GetDRMLicenseOutcome ImmClient::getDRMLicense(const GetDRMLicenseRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetDRMLicenseOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetDRMLicenseOutcome(GetDRMLicenseResult(outcome.result())); + else + return GetDRMLicenseOutcome(outcome.error()); +} + +void ImmClient::getDRMLicenseAsync(const GetDRMLicenseRequest& request, const GetDRMLicenseAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getDRMLicense(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ImmClient::GetDRMLicenseOutcomeCallable ImmClient::getDRMLicenseCallable(const GetDRMLicenseRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getDRMLicense(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + ImmClient::GetDocIndexOutcome ImmClient::getDocIndex(const GetDocIndexRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -2499,6 +2571,42 @@ ImmClient::SearchDocIndexOutcomeCallable ImmClient::searchDocIndexCallable(const return task->get_future(); } +ImmClient::StopStreamAnalyseTaskOutcome ImmClient::stopStreamAnalyseTask(const StopStreamAnalyseTaskRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return StopStreamAnalyseTaskOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return StopStreamAnalyseTaskOutcome(StopStreamAnalyseTaskResult(outcome.result())); + else + return StopStreamAnalyseTaskOutcome(outcome.error()); +} + +void ImmClient::stopStreamAnalyseTaskAsync(const StopStreamAnalyseTaskRequest& request, const StopStreamAnalyseTaskAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, stopStreamAnalyseTask(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ImmClient::StopStreamAnalyseTaskOutcomeCallable ImmClient::stopStreamAnalyseTaskCallable(const StopStreamAnalyseTaskRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->stopStreamAnalyseTask(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + ImmClient::UpdateDocIndexMetaOutcome ImmClient::updateDocIndexMeta(const UpdateDocIndexMetaRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/imm/src/model/GetContentKeyRequest.cc b/imm/src/model/GetContentKeyRequest.cc new file mode 100644 index 000000000..cf4e1ce7a --- /dev/null +++ b/imm/src/model/GetContentKeyRequest.cc @@ -0,0 +1,84 @@ +/* + * 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::GetContentKeyRequest; + +GetContentKeyRequest::GetContentKeyRequest() : + RpcServiceRequest("imm", "2017-09-06", "GetContentKey") +{ + setMethod(HttpRequest::Method::Post); +} + +GetContentKeyRequest::~GetContentKeyRequest() +{} + +std::string GetContentKeyRequest::getProject()const +{ + return project_; +} + +void GetContentKeyRequest::setProject(const std::string& project) +{ + project_ = project; + setParameter("Project", project); +} + +std::string GetContentKeyRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void GetContentKeyRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + +std::string GetContentKeyRequest::getVersionId()const +{ + return versionId_; +} + +void GetContentKeyRequest::setVersionId(const std::string& versionId) +{ + versionId_ = versionId; + setParameter("VersionId", versionId); +} + +std::string GetContentKeyRequest::getDRMServerId()const +{ + return dRMServerId_; +} + +void GetContentKeyRequest::setDRMServerId(const std::string& dRMServerId) +{ + dRMServerId_ = dRMServerId; + setParameter("DRMServerId", dRMServerId); +} + +std::string GetContentKeyRequest::getKeyIds()const +{ + return keyIds_; +} + +void GetContentKeyRequest::setKeyIds(const std::string& keyIds) +{ + keyIds_ = keyIds; + setParameter("KeyIds", keyIds); +} + diff --git a/imm/src/model/GetContentKeyResult.cc b/imm/src/model/GetContentKeyResult.cc new file mode 100644 index 000000000..22556c293 --- /dev/null +++ b/imm/src/model/GetContentKeyResult.cc @@ -0,0 +1,58 @@ +/* + * 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; + +GetContentKeyResult::GetContentKeyResult() : + ServiceResult() +{} + +GetContentKeyResult::GetContentKeyResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetContentKeyResult::~GetContentKeyResult() +{} + +void GetContentKeyResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["VersionId"].isNull()) + versionId_ = value["VersionId"].asString(); + if(!value["KeyInfos"].isNull()) + keyInfos_ = value["KeyInfos"].asString(); + +} + +std::string GetContentKeyResult::getVersionId()const +{ + return versionId_; +} + +std::string GetContentKeyResult::getKeyInfos()const +{ + return keyInfos_; +} + diff --git a/imm/src/model/GetDRMLicenseRequest.cc b/imm/src/model/GetDRMLicenseRequest.cc new file mode 100644 index 000000000..a105cd07f --- /dev/null +++ b/imm/src/model/GetDRMLicenseRequest.cc @@ -0,0 +1,73 @@ +/* + * 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::GetDRMLicenseRequest; + +GetDRMLicenseRequest::GetDRMLicenseRequest() : + RpcServiceRequest("imm", "2017-09-06", "GetDRMLicense") +{ + setMethod(HttpRequest::Method::Post); +} + +GetDRMLicenseRequest::~GetDRMLicenseRequest() +{} + +std::string GetDRMLicenseRequest::getProject()const +{ + return project_; +} + +void GetDRMLicenseRequest::setProject(const std::string& project) +{ + project_ = project; + setParameter("Project", project); +} + +std::string GetDRMLicenseRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void GetDRMLicenseRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + +std::string GetDRMLicenseRequest::getDRMType()const +{ + return dRMType_; +} + +void GetDRMLicenseRequest::setDRMType(const std::string& dRMType) +{ + dRMType_ = dRMType; + setParameter("DRMType", dRMType); +} + +std::string GetDRMLicenseRequest::getDRMLicense()const +{ + return dRMLicense_; +} + +void GetDRMLicenseRequest::setDRMLicense(const std::string& dRMLicense) +{ + dRMLicense_ = dRMLicense; + setParameter("DRMLicense", dRMLicense); +} + diff --git a/imm/src/model/GetDRMLicenseResult.cc b/imm/src/model/GetDRMLicenseResult.cc new file mode 100644 index 000000000..032fe58dd --- /dev/null +++ b/imm/src/model/GetDRMLicenseResult.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 +#include + +using namespace AlibabaCloud::Imm; +using namespace AlibabaCloud::Imm::Model; + +GetDRMLicenseResult::GetDRMLicenseResult() : + ServiceResult() +{} + +GetDRMLicenseResult::GetDRMLicenseResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetDRMLicenseResult::~GetDRMLicenseResult() +{} + +void GetDRMLicenseResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["DRMData"].isNull()) + dRMData_ = value["DRMData"].asString(); + +} + +std::string GetDRMLicenseResult::getDRMData()const +{ + return dRMData_; +} + diff --git a/imm/src/model/StopStreamAnalyseTaskRequest.cc b/imm/src/model/StopStreamAnalyseTaskRequest.cc new file mode 100644 index 000000000..6a75c06ea --- /dev/null +++ b/imm/src/model/StopStreamAnalyseTaskRequest.cc @@ -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. + */ + +#include + +using AlibabaCloud::Imm::Model::StopStreamAnalyseTaskRequest; + +StopStreamAnalyseTaskRequest::StopStreamAnalyseTaskRequest() : + RpcServiceRequest("imm", "2017-09-06", "StopStreamAnalyseTask") +{ + setMethod(HttpRequest::Method::Post); +} + +StopStreamAnalyseTaskRequest::~StopStreamAnalyseTaskRequest() +{} + +std::string StopStreamAnalyseTaskRequest::getProject()const +{ + return project_; +} + +void StopStreamAnalyseTaskRequest::setProject(const std::string& project) +{ + project_ = project; + setParameter("Project", project); +} + +std::string StopStreamAnalyseTaskRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void StopStreamAnalyseTaskRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + +std::string StopStreamAnalyseTaskRequest::getTaskId()const +{ + return taskId_; +} + +void StopStreamAnalyseTaskRequest::setTaskId(const std::string& taskId) +{ + taskId_ = taskId; + setParameter("TaskId", taskId); +} + diff --git a/imm/src/model/StopStreamAnalyseTaskResult.cc b/imm/src/model/StopStreamAnalyseTaskResult.cc new file mode 100644 index 000000000..09696adce --- /dev/null +++ b/imm/src/model/StopStreamAnalyseTaskResult.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 +#include + +using namespace AlibabaCloud::Imm; +using namespace AlibabaCloud::Imm::Model; + +StopStreamAnalyseTaskResult::StopStreamAnalyseTaskResult() : + ServiceResult() +{} + +StopStreamAnalyseTaskResult::StopStreamAnalyseTaskResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +StopStreamAnalyseTaskResult::~StopStreamAnalyseTaskResult() +{} + +void StopStreamAnalyseTaskResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["TaskId"].isNull()) + taskId_ = value["TaskId"].asString(); + +} + +std::string StopStreamAnalyseTaskResult::getTaskId()const +{ + return taskId_; +} +