diff --git a/VERSION b/VERSION index ac724068d..b1dce9c88 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1840 \ No newline at end of file +1.36.1841 \ No newline at end of file diff --git a/vod/CMakeLists.txt b/vod/CMakeLists.txt index 3b578985a..6317b316b 100644 --- a/vod/CMakeLists.txt +++ b/vod/CMakeLists.txt @@ -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 diff --git a/vod/include/alibabacloud/vod/VodClient.h b/vod/include/alibabacloud/vod/VodClient.h index d346d5a42..6677e6dad 100644 --- a/vod/include/alibabacloud/vod/VodClient.h +++ b/vod/include/alibabacloud/vod/VodClient.h @@ -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 DetachAppPolicyFromIdentityOutcome; typedef std::future DetachAppPolicyFromIdentityOutcomeCallable; typedef std::function&)> DetachAppPolicyFromIdentityAsyncHandler; + typedef Outcome GenerateDownloadSecretKeyOutcome; + typedef std::future GenerateDownloadSecretKeyOutcomeCallable; + typedef std::function&)> GenerateDownloadSecretKeyAsyncHandler; typedef Outcome GenerateKMSDataKeyOutcome; typedef std::future GenerateKMSDataKeyOutcomeCallable; typedef std::function&)> 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& 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& 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& context = nullptr) const; GenerateKMSDataKeyOutcomeCallable generateKMSDataKeyCallable(const Model::GenerateKMSDataKeyRequest& request) const; diff --git a/vod/include/alibabacloud/vod/model/GenerateDownloadSecretKeyRequest.h b/vod/include/alibabacloud/vod/model/GenerateDownloadSecretKeyRequest.h new file mode 100644 index 000000000..44dbfa6ca --- /dev/null +++ b/vod/include/alibabacloud/vod/model/GenerateDownloadSecretKeyRequest.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_VOD_MODEL_GENERATEDOWNLOADSECRETKEYREQUEST_H_ +#define ALIBABACLOUD_VOD_MODEL_GENERATEDOWNLOADSECRETKEYREQUEST_H_ + +#include +#include +#include +#include +#include + +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_ diff --git a/vod/include/alibabacloud/vod/model/GenerateDownloadSecretKeyResult.h b/vod/include/alibabacloud/vod/model/GenerateDownloadSecretKeyResult.h new file mode 100644 index 000000000..82b238084 --- /dev/null +++ b/vod/include/alibabacloud/vod/model/GenerateDownloadSecretKeyResult.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 +#include +#include +#include +#include + +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_ \ No newline at end of file diff --git a/vod/src/VodClient.cc b/vod/src/VodClient.cc index 38b967dea..bf2475eed 100644 --- a/vod/src/VodClient.cc +++ b/vod/src/VodClient.cc @@ -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& 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>( + [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(); diff --git a/vod/src/model/GenerateDownloadSecretKeyRequest.cc b/vod/src/model/GenerateDownloadSecretKeyRequest.cc new file mode 100644 index 000000000..6d675cbd7 --- /dev/null +++ b/vod/src/model/GenerateDownloadSecretKeyRequest.cc @@ -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 + +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)); +} + diff --git a/vod/src/model/GenerateDownloadSecretKeyResult.cc b/vod/src/model/GenerateDownloadSecretKeyResult.cc new file mode 100644 index 000000000..a469826b1 --- /dev/null +++ b/vod/src/model/GenerateDownloadSecretKeyResult.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::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_; +} +