open GenerateDownloadDecryptkey.
This commit is contained in:
@@ -143,6 +143,8 @@ set(vod_public_header_model
|
||||
include/alibabacloud/vod/model/DescribeVodVerifyContentResult.h
|
||||
include/alibabacloud/vod/model/DetachAppPolicyFromIdentityRequest.h
|
||||
include/alibabacloud/vod/model/DetachAppPolicyFromIdentityResult.h
|
||||
include/alibabacloud/vod/model/GenerateDownloadSecretKeyRequest.h
|
||||
include/alibabacloud/vod/model/GenerateDownloadSecretKeyResult.h
|
||||
include/alibabacloud/vod/model/GenerateKMSDataKeyRequest.h
|
||||
include/alibabacloud/vod/model/GenerateKMSDataKeyResult.h
|
||||
include/alibabacloud/vod/model/GetAIImageJobsRequest.h
|
||||
@@ -454,6 +456,8 @@ set(vod_src
|
||||
src/model/DescribeVodVerifyContentResult.cc
|
||||
src/model/DetachAppPolicyFromIdentityRequest.cc
|
||||
src/model/DetachAppPolicyFromIdentityResult.cc
|
||||
src/model/GenerateDownloadSecretKeyRequest.cc
|
||||
src/model/GenerateDownloadSecretKeyResult.cc
|
||||
src/model/GenerateKMSDataKeyRequest.cc
|
||||
src/model/GenerateKMSDataKeyResult.cc
|
||||
src/model/GetAIImageJobsRequest.cc
|
||||
|
||||
@@ -144,6 +144,8 @@
|
||||
#include "model/DescribeVodVerifyContentResult.h"
|
||||
#include "model/DetachAppPolicyFromIdentityRequest.h"
|
||||
#include "model/DetachAppPolicyFromIdentityResult.h"
|
||||
#include "model/GenerateDownloadSecretKeyRequest.h"
|
||||
#include "model/GenerateDownloadSecretKeyResult.h"
|
||||
#include "model/GenerateKMSDataKeyRequest.h"
|
||||
#include "model/GenerateKMSDataKeyResult.h"
|
||||
#include "model/GetAIImageJobsRequest.h"
|
||||
@@ -522,6 +524,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::DetachAppPolicyFromIdentityResult> DetachAppPolicyFromIdentityOutcome;
|
||||
typedef std::future<DetachAppPolicyFromIdentityOutcome> DetachAppPolicyFromIdentityOutcomeCallable;
|
||||
typedef std::function<void(const VodClient*, const Model::DetachAppPolicyFromIdentityRequest&, const DetachAppPolicyFromIdentityOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetachAppPolicyFromIdentityAsyncHandler;
|
||||
typedef Outcome<Error, Model::GenerateDownloadSecretKeyResult> GenerateDownloadSecretKeyOutcome;
|
||||
typedef std::future<GenerateDownloadSecretKeyOutcome> GenerateDownloadSecretKeyOutcomeCallable;
|
||||
typedef std::function<void(const VodClient*, const Model::GenerateDownloadSecretKeyRequest&, const GenerateDownloadSecretKeyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GenerateDownloadSecretKeyAsyncHandler;
|
||||
typedef Outcome<Error, Model::GenerateKMSDataKeyResult> GenerateKMSDataKeyOutcome;
|
||||
typedef std::future<GenerateKMSDataKeyOutcome> GenerateKMSDataKeyOutcomeCallable;
|
||||
typedef std::function<void(const VodClient*, const Model::GenerateKMSDataKeyRequest&, const GenerateKMSDataKeyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GenerateKMSDataKeyAsyncHandler;
|
||||
@@ -989,6 +994,9 @@ namespace AlibabaCloud
|
||||
DetachAppPolicyFromIdentityOutcome detachAppPolicyFromIdentity(const Model::DetachAppPolicyFromIdentityRequest &request)const;
|
||||
void detachAppPolicyFromIdentityAsync(const Model::DetachAppPolicyFromIdentityRequest& request, const DetachAppPolicyFromIdentityAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
DetachAppPolicyFromIdentityOutcomeCallable detachAppPolicyFromIdentityCallable(const Model::DetachAppPolicyFromIdentityRequest& request) const;
|
||||
GenerateDownloadSecretKeyOutcome generateDownloadSecretKey(const Model::GenerateDownloadSecretKeyRequest &request)const;
|
||||
void generateDownloadSecretKeyAsync(const Model::GenerateDownloadSecretKeyRequest& request, const GenerateDownloadSecretKeyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GenerateDownloadSecretKeyOutcomeCallable generateDownloadSecretKeyCallable(const Model::GenerateDownloadSecretKeyRequest& request) const;
|
||||
GenerateKMSDataKeyOutcome generateKMSDataKey(const Model::GenerateKMSDataKeyRequest &request)const;
|
||||
void generateKMSDataKeyAsync(const Model::GenerateKMSDataKeyRequest& request, const GenerateKMSDataKeyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GenerateKMSDataKeyOutcomeCallable generateKMSDataKeyCallable(const Model::GenerateKMSDataKeyRequest& request) const;
|
||||
|
||||
@@ -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_VOD_MODEL_GENERATEDOWNLOADSECRETKEYREQUEST_H_
|
||||
#define ALIBABACLOUD_VOD_MODEL_GENERATEDOWNLOADSECRETKEYREQUEST_H_
|
||||
|
||||
#include <alibabacloud/vod/VodExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace Vod {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_VOD_EXPORT GenerateDownloadSecretKeyRequest : public RpcServiceRequest {
|
||||
public:
|
||||
GenerateDownloadSecretKeyRequest();
|
||||
~GenerateDownloadSecretKeyRequest();
|
||||
long getResourceOwnerId() const;
|
||||
void setResourceOwnerId(long resourceOwnerId);
|
||||
std::string getAppDecryptKey() const;
|
||||
void setAppDecryptKey(const std::string &appDecryptKey);
|
||||
std::string getResourceOwnerAccount() const;
|
||||
void setResourceOwnerAccount(const std::string &resourceOwnerAccount);
|
||||
std::string getAppIdentification() const;
|
||||
void setAppIdentification(const std::string &appIdentification);
|
||||
long getOwnerId() const;
|
||||
void setOwnerId(long ownerId);
|
||||
|
||||
private:
|
||||
long resourceOwnerId_;
|
||||
std::string appDecryptKey_;
|
||||
std::string resourceOwnerAccount_;
|
||||
std::string appIdentification_;
|
||||
long ownerId_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace Vod
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_VOD_MODEL_GENERATEDOWNLOADSECRETKEYREQUEST_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_VOD_MODEL_GENERATEDOWNLOADSECRETKEYRESULT_H_
|
||||
#define ALIBABACLOUD_VOD_MODEL_GENERATEDOWNLOADSECRETKEYRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/vod/VodExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Vod
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_VOD_EXPORT GenerateDownloadSecretKeyResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
GenerateDownloadSecretKeyResult();
|
||||
explicit GenerateDownloadSecretKeyResult(const std::string &payload);
|
||||
~GenerateDownloadSecretKeyResult();
|
||||
std::string getAppEncryptKey()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string appEncryptKey_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_VOD_MODEL_GENERATEDOWNLOADSECRETKEYRESULT_H_
|
||||
@@ -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