Supported DRM.

This commit is contained in:
sdk-team
2020-05-12 11:28:55 +08:00
parent ab7e92063b
commit 6c1dbc8b06
17 changed files with 853 additions and 1 deletions

View File

@@ -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<const AsyncCallerContext>& 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<std::packaged_task<GetContentKeyOutcome()>>(
[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<const AsyncCallerContext>& 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<std::packaged_task<GetDRMLicenseOutcome()>>(
[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<const AsyncCallerContext>& 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<std::packaged_task<StopStreamAnalyseTaskOutcome()>>(
[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();

View File

@@ -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 <alibabacloud/imm/model/GetContentKeyRequest.h>
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);
}

View File

@@ -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 <alibabacloud/imm/model/GetContentKeyResult.h>
#include <json/json.h>
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_;
}

View File

@@ -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 <alibabacloud/imm/model/GetDRMLicenseRequest.h>
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);
}

View File

@@ -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/imm/model/GetDRMLicenseResult.h>
#include <json/json.h>
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_;
}

View File

@@ -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 <alibabacloud/imm/model/StopStreamAnalyseTaskRequest.h>
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);
}

View File

@@ -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/imm/model/StopStreamAnalyseTaskResult.h>
#include <json/json.h>
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_;
}