open GenerateDownloadDecryptkey.
This commit is contained in:
@@ -2247,6 +2247,42 @@ VodClient::DetachAppPolicyFromIdentityOutcomeCallable VodClient::detachAppPolicy
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
VodClient::GenerateDownloadSecretKeyOutcome VodClient::generateDownloadSecretKey(const GenerateDownloadSecretKeyRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GenerateDownloadSecretKeyOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GenerateDownloadSecretKeyOutcome(GenerateDownloadSecretKeyResult(outcome.result()));
|
||||
else
|
||||
return GenerateDownloadSecretKeyOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void VodClient::generateDownloadSecretKeyAsync(const GenerateDownloadSecretKeyRequest& request, const GenerateDownloadSecretKeyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, generateDownloadSecretKey(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
VodClient::GenerateDownloadSecretKeyOutcomeCallable VodClient::generateDownloadSecretKeyCallable(const GenerateDownloadSecretKeyRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GenerateDownloadSecretKeyOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->generateDownloadSecretKey(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
VodClient::GenerateKMSDataKeyOutcome VodClient::generateKMSDataKey(const GenerateKMSDataKeyRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
72
vod/src/model/GenerateDownloadSecretKeyRequest.cc
Normal file
72
vod/src/model/GenerateDownloadSecretKeyRequest.cc
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* 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/vod/model/GenerateDownloadSecretKeyRequest.h>
|
||||
|
||||
using AlibabaCloud::Vod::Model::GenerateDownloadSecretKeyRequest;
|
||||
|
||||
GenerateDownloadSecretKeyRequest::GenerateDownloadSecretKeyRequest()
|
||||
: RpcServiceRequest("vod", "2017-03-21", "GenerateDownloadSecretKey") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GenerateDownloadSecretKeyRequest::~GenerateDownloadSecretKeyRequest() {}
|
||||
|
||||
long GenerateDownloadSecretKeyRequest::getResourceOwnerId() const {
|
||||
return resourceOwnerId_;
|
||||
}
|
||||
|
||||
void GenerateDownloadSecretKeyRequest::setResourceOwnerId(long resourceOwnerId) {
|
||||
resourceOwnerId_ = resourceOwnerId;
|
||||
setParameter(std::string("ResourceOwnerId"), std::to_string(resourceOwnerId));
|
||||
}
|
||||
|
||||
std::string GenerateDownloadSecretKeyRequest::getAppDecryptKey() const {
|
||||
return appDecryptKey_;
|
||||
}
|
||||
|
||||
void GenerateDownloadSecretKeyRequest::setAppDecryptKey(const std::string &appDecryptKey) {
|
||||
appDecryptKey_ = appDecryptKey;
|
||||
setParameter(std::string("AppDecryptKey"), appDecryptKey);
|
||||
}
|
||||
|
||||
std::string GenerateDownloadSecretKeyRequest::getResourceOwnerAccount() const {
|
||||
return resourceOwnerAccount_;
|
||||
}
|
||||
|
||||
void GenerateDownloadSecretKeyRequest::setResourceOwnerAccount(const std::string &resourceOwnerAccount) {
|
||||
resourceOwnerAccount_ = resourceOwnerAccount;
|
||||
setParameter(std::string("ResourceOwnerAccount"), resourceOwnerAccount);
|
||||
}
|
||||
|
||||
std::string GenerateDownloadSecretKeyRequest::getAppIdentification() const {
|
||||
return appIdentification_;
|
||||
}
|
||||
|
||||
void GenerateDownloadSecretKeyRequest::setAppIdentification(const std::string &appIdentification) {
|
||||
appIdentification_ = appIdentification;
|
||||
setParameter(std::string("AppIdentification"), appIdentification);
|
||||
}
|
||||
|
||||
long GenerateDownloadSecretKeyRequest::getOwnerId() const {
|
||||
return ownerId_;
|
||||
}
|
||||
|
||||
void GenerateDownloadSecretKeyRequest::setOwnerId(long ownerId) {
|
||||
ownerId_ = ownerId;
|
||||
setParameter(std::string("OwnerId"), std::to_string(ownerId));
|
||||
}
|
||||
|
||||
51
vod/src/model/GenerateDownloadSecretKeyResult.cc
Normal file
51
vod/src/model/GenerateDownloadSecretKeyResult.cc
Normal 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/vod/model/GenerateDownloadSecretKeyResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Vod;
|
||||
using namespace AlibabaCloud::Vod::Model;
|
||||
|
||||
GenerateDownloadSecretKeyResult::GenerateDownloadSecretKeyResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GenerateDownloadSecretKeyResult::GenerateDownloadSecretKeyResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GenerateDownloadSecretKeyResult::~GenerateDownloadSecretKeyResult()
|
||||
{}
|
||||
|
||||
void GenerateDownloadSecretKeyResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["AppEncryptKey"].isNull())
|
||||
appEncryptKey_ = value["AppEncryptKey"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GenerateDownloadSecretKeyResult::getAppEncryptKey()const
|
||||
{
|
||||
return appEncryptKey_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user