From 63d14560170203d68ccb4ccab43ef8d2fa4e310e Mon Sep 17 00:00:00 2001 From: sdk-team Date: Thu, 21 Jul 2022 08:44:47 +0000 Subject: [PATCH] Add kms apis. --- CHANGELOG | 3 + VERSION | 2 +- vod/CMakeLists.txt | 8 ++ vod/include/alibabacloud/vod/VodClient.h | 16 +++ .../vod/model/DecryptKMSDataKeyRequest.h | 63 ++++++++++++ .../vod/model/DecryptKMSDataKeyResult.h | 53 ++++++++++ .../vod/model/GenerateKMSDataKeyRequest.h | 60 +++++++++++ .../vod/model/GenerateKMSDataKeyResult.h | 55 +++++++++++ vod/src/VodClient.cc | 72 ++++++++++++++ vod/src/model/DecryptKMSDataKeyRequest.cc | 99 +++++++++++++++++++ vod/src/model/DecryptKMSDataKeyResult.cc | 58 +++++++++++ vod/src/model/GenerateKMSDataKeyRequest.cc | 90 +++++++++++++++++ vod/src/model/GenerateKMSDataKeyResult.cc | 65 ++++++++++++ 13 files changed, 643 insertions(+), 1 deletion(-) create mode 100644 vod/include/alibabacloud/vod/model/DecryptKMSDataKeyRequest.h create mode 100644 vod/include/alibabacloud/vod/model/DecryptKMSDataKeyResult.h create mode 100644 vod/include/alibabacloud/vod/model/GenerateKMSDataKeyRequest.h create mode 100644 vod/include/alibabacloud/vod/model/GenerateKMSDataKeyResult.h create mode 100644 vod/src/model/DecryptKMSDataKeyRequest.cc create mode 100644 vod/src/model/DecryptKMSDataKeyResult.cc create mode 100644 vod/src/model/GenerateKMSDataKeyRequest.cc create mode 100644 vod/src/model/GenerateKMSDataKeyResult.cc diff --git a/CHANGELOG b/CHANGELOG index 3ae7d660f..8f0411cb6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2022-07-21 Version: 1.36.1194 +- Add kms apis. + 2022-07-21 Version: 1.36.1193 - Ram action config. diff --git a/VERSION b/VERSION index c12b8c66e..dad6ff7d2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1193 \ No newline at end of file +1.36.1194 \ No newline at end of file diff --git a/vod/CMakeLists.txt b/vod/CMakeLists.txt index 09201e3ab..e37aedbad 100644 --- a/vod/CMakeLists.txt +++ b/vod/CMakeLists.txt @@ -55,6 +55,8 @@ set(vod_public_header_model include/alibabacloud/vod/model/CreateUploadImageResult.h include/alibabacloud/vod/model/CreateUploadVideoRequest.h include/alibabacloud/vod/model/CreateUploadVideoResult.h + include/alibabacloud/vod/model/DecryptKMSDataKeyRequest.h + include/alibabacloud/vod/model/DecryptKMSDataKeyResult.h include/alibabacloud/vod/model/DeleteAIImageInfosRequest.h include/alibabacloud/vod/model/DeleteAIImageInfosResult.h include/alibabacloud/vod/model/DeleteAITemplateRequest.h @@ -131,6 +133,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/GenerateKMSDataKeyRequest.h + include/alibabacloud/vod/model/GenerateKMSDataKeyResult.h include/alibabacloud/vod/model/GetAIImageJobsRequest.h include/alibabacloud/vod/model/GetAIImageJobsResult.h include/alibabacloud/vod/model/GetAIMediaAuditJobRequest.h @@ -342,6 +346,8 @@ set(vod_src src/model/CreateUploadImageResult.cc src/model/CreateUploadVideoRequest.cc src/model/CreateUploadVideoResult.cc + src/model/DecryptKMSDataKeyRequest.cc + src/model/DecryptKMSDataKeyResult.cc src/model/DeleteAIImageInfosRequest.cc src/model/DeleteAIImageInfosResult.cc src/model/DeleteAITemplateRequest.cc @@ -418,6 +424,8 @@ set(vod_src src/model/DescribeVodVerifyContentResult.cc src/model/DetachAppPolicyFromIdentityRequest.cc src/model/DetachAppPolicyFromIdentityResult.cc + src/model/GenerateKMSDataKeyRequest.cc + src/model/GenerateKMSDataKeyResult.cc src/model/GetAIImageJobsRequest.cc src/model/GetAIImageJobsResult.cc src/model/GetAIMediaAuditJobRequest.cc diff --git a/vod/include/alibabacloud/vod/VodClient.h b/vod/include/alibabacloud/vod/VodClient.h index 7541dfb4b..8cfcc3ac4 100644 --- a/vod/include/alibabacloud/vod/VodClient.h +++ b/vod/include/alibabacloud/vod/VodClient.h @@ -56,6 +56,8 @@ #include "model/CreateUploadImageResult.h" #include "model/CreateUploadVideoRequest.h" #include "model/CreateUploadVideoResult.h" +#include "model/DecryptKMSDataKeyRequest.h" +#include "model/DecryptKMSDataKeyResult.h" #include "model/DeleteAIImageInfosRequest.h" #include "model/DeleteAIImageInfosResult.h" #include "model/DeleteAITemplateRequest.h" @@ -132,6 +134,8 @@ #include "model/DescribeVodVerifyContentResult.h" #include "model/DetachAppPolicyFromIdentityRequest.h" #include "model/DetachAppPolicyFromIdentityResult.h" +#include "model/GenerateKMSDataKeyRequest.h" +#include "model/GenerateKMSDataKeyResult.h" #include "model/GetAIImageJobsRequest.h" #include "model/GetAIImageJobsResult.h" #include "model/GetAIMediaAuditJobRequest.h" @@ -366,6 +370,9 @@ namespace AlibabaCloud typedef Outcome CreateUploadVideoOutcome; typedef std::future CreateUploadVideoOutcomeCallable; typedef std::function&)> CreateUploadVideoAsyncHandler; + typedef Outcome DecryptKMSDataKeyOutcome; + typedef std::future DecryptKMSDataKeyOutcomeCallable; + typedef std::function&)> DecryptKMSDataKeyAsyncHandler; typedef Outcome DeleteAIImageInfosOutcome; typedef std::future DeleteAIImageInfosOutcomeCallable; typedef std::function&)> DeleteAIImageInfosAsyncHandler; @@ -480,6 +487,9 @@ namespace AlibabaCloud typedef Outcome DetachAppPolicyFromIdentityOutcome; typedef std::future DetachAppPolicyFromIdentityOutcomeCallable; typedef std::function&)> DetachAppPolicyFromIdentityAsyncHandler; + typedef Outcome GenerateKMSDataKeyOutcome; + typedef std::future GenerateKMSDataKeyOutcomeCallable; + typedef std::function&)> GenerateKMSDataKeyAsyncHandler; typedef Outcome GetAIImageJobsOutcome; typedef std::future GetAIImageJobsOutcomeCallable; typedef std::function&)> GetAIImageJobsAsyncHandler; @@ -797,6 +807,9 @@ namespace AlibabaCloud CreateUploadVideoOutcome createUploadVideo(const Model::CreateUploadVideoRequest &request)const; void createUploadVideoAsync(const Model::CreateUploadVideoRequest& request, const CreateUploadVideoAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CreateUploadVideoOutcomeCallable createUploadVideoCallable(const Model::CreateUploadVideoRequest& request) const; + DecryptKMSDataKeyOutcome decryptKMSDataKey(const Model::DecryptKMSDataKeyRequest &request)const; + void decryptKMSDataKeyAsync(const Model::DecryptKMSDataKeyRequest& request, const DecryptKMSDataKeyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DecryptKMSDataKeyOutcomeCallable decryptKMSDataKeyCallable(const Model::DecryptKMSDataKeyRequest& request) const; DeleteAIImageInfosOutcome deleteAIImageInfos(const Model::DeleteAIImageInfosRequest &request)const; void deleteAIImageInfosAsync(const Model::DeleteAIImageInfosRequest& request, const DeleteAIImageInfosAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DeleteAIImageInfosOutcomeCallable deleteAIImageInfosCallable(const Model::DeleteAIImageInfosRequest& request) const; @@ -911,6 +924,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; + 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; GetAIImageJobsOutcome getAIImageJobs(const Model::GetAIImageJobsRequest &request)const; void getAIImageJobsAsync(const Model::GetAIImageJobsRequest& request, const GetAIImageJobsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetAIImageJobsOutcomeCallable getAIImageJobsCallable(const Model::GetAIImageJobsRequest& request) const; diff --git a/vod/include/alibabacloud/vod/model/DecryptKMSDataKeyRequest.h b/vod/include/alibabacloud/vod/model/DecryptKMSDataKeyRequest.h new file mode 100644 index 000000000..b3594d5f9 --- /dev/null +++ b/vod/include/alibabacloud/vod/model/DecryptKMSDataKeyRequest.h @@ -0,0 +1,63 @@ +/* + * 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_DECRYPTKMSDATAKEYREQUEST_H_ +#define ALIBABACLOUD_VOD_MODEL_DECRYPTKMSDATAKEYREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Vod { +namespace Model { +class ALIBABACLOUD_VOD_EXPORT DecryptKMSDataKeyRequest : public RpcServiceRequest { +public: + DecryptKMSDataKeyRequest(); + ~DecryptKMSDataKeyRequest(); + std::string getResourceOwnerId() const; + void setResourceOwnerId(const std::string &resourceOwnerId); + long getResourceRealOwnerId() const; + void setResourceRealOwnerId(long resourceRealOwnerId); + std::string getAccessKeyId() const; + void setAccessKeyId(const std::string &accessKeyId); + std::string getKmsRegionId() const; + void setKmsRegionId(const std::string &kmsRegionId); + std::string getCipherText() const; + void setCipherText(const std::string &cipherText); + std::string getResourceOwnerAccount() const; + void setResourceOwnerAccount(const std::string &resourceOwnerAccount); + std::string getOwnerAccount() const; + void setOwnerAccount(const std::string &ownerAccount); + std::string getOwnerId() const; + void setOwnerId(const std::string &ownerId); + +private: + std::string resourceOwnerId_; + long resourceRealOwnerId_; + std::string accessKeyId_; + std::string kmsRegionId_; + std::string cipherText_; + std::string resourceOwnerAccount_; + std::string ownerAccount_; + std::string ownerId_; +}; +} // namespace Model +} // namespace Vod +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_VOD_MODEL_DECRYPTKMSDATAKEYREQUEST_H_ diff --git a/vod/include/alibabacloud/vod/model/DecryptKMSDataKeyResult.h b/vod/include/alibabacloud/vod/model/DecryptKMSDataKeyResult.h new file mode 100644 index 000000000..4fd47ac67 --- /dev/null +++ b/vod/include/alibabacloud/vod/model/DecryptKMSDataKeyResult.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_VOD_MODEL_DECRYPTKMSDATAKEYRESULT_H_ +#define ALIBABACLOUD_VOD_MODEL_DECRYPTKMSDATAKEYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Vod + { + namespace Model + { + class ALIBABACLOUD_VOD_EXPORT DecryptKMSDataKeyResult : public ServiceResult + { + public: + + + DecryptKMSDataKeyResult(); + explicit DecryptKMSDataKeyResult(const std::string &payload); + ~DecryptKMSDataKeyResult(); + std::string getPlaintext()const; + std::string getKeyId()const; + + protected: + void parse(const std::string &payload); + private: + std::string plaintext_; + std::string keyId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VOD_MODEL_DECRYPTKMSDATAKEYRESULT_H_ \ No newline at end of file diff --git a/vod/include/alibabacloud/vod/model/GenerateKMSDataKeyRequest.h b/vod/include/alibabacloud/vod/model/GenerateKMSDataKeyRequest.h new file mode 100644 index 000000000..9449c3560 --- /dev/null +++ b/vod/include/alibabacloud/vod/model/GenerateKMSDataKeyRequest.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_VOD_MODEL_GENERATEKMSDATAKEYREQUEST_H_ +#define ALIBABACLOUD_VOD_MODEL_GENERATEKMSDATAKEYREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Vod { +namespace Model { +class ALIBABACLOUD_VOD_EXPORT GenerateKMSDataKeyRequest : public RpcServiceRequest { +public: + GenerateKMSDataKeyRequest(); + ~GenerateKMSDataKeyRequest(); + std::string getResourceOwnerId() const; + void setResourceOwnerId(const std::string &resourceOwnerId); + long getResourceRealOwnerId() const; + void setResourceRealOwnerId(long resourceRealOwnerId); + std::string getAccessKeyId() const; + void setAccessKeyId(const std::string &accessKeyId); + std::string getKmsRegionId() const; + void setKmsRegionId(const std::string &kmsRegionId); + std::string getResourceOwnerAccount() const; + void setResourceOwnerAccount(const std::string &resourceOwnerAccount); + std::string getOwnerAccount() const; + void setOwnerAccount(const std::string &ownerAccount); + std::string getOwnerId() const; + void setOwnerId(const std::string &ownerId); + +private: + std::string resourceOwnerId_; + long resourceRealOwnerId_; + std::string accessKeyId_; + std::string kmsRegionId_; + std::string resourceOwnerAccount_; + std::string ownerAccount_; + std::string ownerId_; +}; +} // namespace Model +} // namespace Vod +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_VOD_MODEL_GENERATEKMSDATAKEYREQUEST_H_ diff --git a/vod/include/alibabacloud/vod/model/GenerateKMSDataKeyResult.h b/vod/include/alibabacloud/vod/model/GenerateKMSDataKeyResult.h new file mode 100644 index 000000000..3e42b7857 --- /dev/null +++ b/vod/include/alibabacloud/vod/model/GenerateKMSDataKeyResult.h @@ -0,0 +1,55 @@ +/* + * 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_GENERATEKMSDATAKEYRESULT_H_ +#define ALIBABACLOUD_VOD_MODEL_GENERATEKMSDATAKEYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Vod + { + namespace Model + { + class ALIBABACLOUD_VOD_EXPORT GenerateKMSDataKeyResult : public ServiceResult + { + public: + + + GenerateKMSDataKeyResult(); + explicit GenerateKMSDataKeyResult(const std::string &payload); + ~GenerateKMSDataKeyResult(); + std::string getCiphertextBlob()const; + std::string getPlaintext()const; + std::string getKeyId()const; + + protected: + void parse(const std::string &payload); + private: + std::string ciphertextBlob_; + std::string plaintext_; + std::string keyId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VOD_MODEL_GENERATEKMSDATAKEYRESULT_H_ \ No newline at end of file diff --git a/vod/src/VodClient.cc b/vod/src/VodClient.cc index d4baa0573..064eaa0b9 100644 --- a/vod/src/VodClient.cc +++ b/vod/src/VodClient.cc @@ -663,6 +663,42 @@ VodClient::CreateUploadVideoOutcomeCallable VodClient::createUploadVideoCallable return task->get_future(); } +VodClient::DecryptKMSDataKeyOutcome VodClient::decryptKMSDataKey(const DecryptKMSDataKeyRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DecryptKMSDataKeyOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DecryptKMSDataKeyOutcome(DecryptKMSDataKeyResult(outcome.result())); + else + return DecryptKMSDataKeyOutcome(outcome.error()); +} + +void VodClient::decryptKMSDataKeyAsync(const DecryptKMSDataKeyRequest& request, const DecryptKMSDataKeyAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, decryptKMSDataKey(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +VodClient::DecryptKMSDataKeyOutcomeCallable VodClient::decryptKMSDataKeyCallable(const DecryptKMSDataKeyRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->decryptKMSDataKey(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + VodClient::DeleteAIImageInfosOutcome VodClient::deleteAIImageInfos(const DeleteAIImageInfosRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -2031,6 +2067,42 @@ VodClient::DetachAppPolicyFromIdentityOutcomeCallable VodClient::detachAppPolicy return task->get_future(); } +VodClient::GenerateKMSDataKeyOutcome VodClient::generateKMSDataKey(const GenerateKMSDataKeyRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GenerateKMSDataKeyOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GenerateKMSDataKeyOutcome(GenerateKMSDataKeyResult(outcome.result())); + else + return GenerateKMSDataKeyOutcome(outcome.error()); +} + +void VodClient::generateKMSDataKeyAsync(const GenerateKMSDataKeyRequest& request, const GenerateKMSDataKeyAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, generateKMSDataKey(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +VodClient::GenerateKMSDataKeyOutcomeCallable VodClient::generateKMSDataKeyCallable(const GenerateKMSDataKeyRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->generateKMSDataKey(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + VodClient::GetAIImageJobsOutcome VodClient::getAIImageJobs(const GetAIImageJobsRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/vod/src/model/DecryptKMSDataKeyRequest.cc b/vod/src/model/DecryptKMSDataKeyRequest.cc new file mode 100644 index 000000000..0dced0143 --- /dev/null +++ b/vod/src/model/DecryptKMSDataKeyRequest.cc @@ -0,0 +1,99 @@ +/* + * 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::DecryptKMSDataKeyRequest; + +DecryptKMSDataKeyRequest::DecryptKMSDataKeyRequest() + : RpcServiceRequest("vod", "2017-03-21", "DecryptKMSDataKey") { + setMethod(HttpRequest::Method::Post); +} + +DecryptKMSDataKeyRequest::~DecryptKMSDataKeyRequest() {} + +std::string DecryptKMSDataKeyRequest::getResourceOwnerId() const { + return resourceOwnerId_; +} + +void DecryptKMSDataKeyRequest::setResourceOwnerId(const std::string &resourceOwnerId) { + resourceOwnerId_ = resourceOwnerId; + setParameter(std::string("ResourceOwnerId"), resourceOwnerId); +} + +long DecryptKMSDataKeyRequest::getResourceRealOwnerId() const { + return resourceRealOwnerId_; +} + +void DecryptKMSDataKeyRequest::setResourceRealOwnerId(long resourceRealOwnerId) { + resourceRealOwnerId_ = resourceRealOwnerId; + setParameter(std::string("ResourceRealOwnerId"), std::to_string(resourceRealOwnerId)); +} + +std::string DecryptKMSDataKeyRequest::getAccessKeyId() const { + return accessKeyId_; +} + +void DecryptKMSDataKeyRequest::setAccessKeyId(const std::string &accessKeyId) { + accessKeyId_ = accessKeyId; + setParameter(std::string("AccessKeyId"), accessKeyId); +} + +std::string DecryptKMSDataKeyRequest::getKmsRegionId() const { + return kmsRegionId_; +} + +void DecryptKMSDataKeyRequest::setKmsRegionId(const std::string &kmsRegionId) { + kmsRegionId_ = kmsRegionId; + setParameter(std::string("KmsRegionId"), kmsRegionId); +} + +std::string DecryptKMSDataKeyRequest::getCipherText() const { + return cipherText_; +} + +void DecryptKMSDataKeyRequest::setCipherText(const std::string &cipherText) { + cipherText_ = cipherText; + setParameter(std::string("CipherText"), cipherText); +} + +std::string DecryptKMSDataKeyRequest::getResourceOwnerAccount() const { + return resourceOwnerAccount_; +} + +void DecryptKMSDataKeyRequest::setResourceOwnerAccount(const std::string &resourceOwnerAccount) { + resourceOwnerAccount_ = resourceOwnerAccount; + setParameter(std::string("ResourceOwnerAccount"), resourceOwnerAccount); +} + +std::string DecryptKMSDataKeyRequest::getOwnerAccount() const { + return ownerAccount_; +} + +void DecryptKMSDataKeyRequest::setOwnerAccount(const std::string &ownerAccount) { + ownerAccount_ = ownerAccount; + setParameter(std::string("OwnerAccount"), ownerAccount); +} + +std::string DecryptKMSDataKeyRequest::getOwnerId() const { + return ownerId_; +} + +void DecryptKMSDataKeyRequest::setOwnerId(const std::string &ownerId) { + ownerId_ = ownerId; + setParameter(std::string("OwnerId"), ownerId); +} + diff --git a/vod/src/model/DecryptKMSDataKeyResult.cc b/vod/src/model/DecryptKMSDataKeyResult.cc new file mode 100644 index 000000000..6dadde193 --- /dev/null +++ b/vod/src/model/DecryptKMSDataKeyResult.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::Vod; +using namespace AlibabaCloud::Vod::Model; + +DecryptKMSDataKeyResult::DecryptKMSDataKeyResult() : + ServiceResult() +{} + +DecryptKMSDataKeyResult::DecryptKMSDataKeyResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DecryptKMSDataKeyResult::~DecryptKMSDataKeyResult() +{} + +void DecryptKMSDataKeyResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["KeyId"].isNull()) + keyId_ = value["KeyId"].asString(); + if(!value["Plaintext"].isNull()) + plaintext_ = value["Plaintext"].asString(); + +} + +std::string DecryptKMSDataKeyResult::getPlaintext()const +{ + return plaintext_; +} + +std::string DecryptKMSDataKeyResult::getKeyId()const +{ + return keyId_; +} + diff --git a/vod/src/model/GenerateKMSDataKeyRequest.cc b/vod/src/model/GenerateKMSDataKeyRequest.cc new file mode 100644 index 000000000..88101eb42 --- /dev/null +++ b/vod/src/model/GenerateKMSDataKeyRequest.cc @@ -0,0 +1,90 @@ +/* + * 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::GenerateKMSDataKeyRequest; + +GenerateKMSDataKeyRequest::GenerateKMSDataKeyRequest() + : RpcServiceRequest("vod", "2017-03-21", "GenerateKMSDataKey") { + setMethod(HttpRequest::Method::Post); +} + +GenerateKMSDataKeyRequest::~GenerateKMSDataKeyRequest() {} + +std::string GenerateKMSDataKeyRequest::getResourceOwnerId() const { + return resourceOwnerId_; +} + +void GenerateKMSDataKeyRequest::setResourceOwnerId(const std::string &resourceOwnerId) { + resourceOwnerId_ = resourceOwnerId; + setParameter(std::string("ResourceOwnerId"), resourceOwnerId); +} + +long GenerateKMSDataKeyRequest::getResourceRealOwnerId() const { + return resourceRealOwnerId_; +} + +void GenerateKMSDataKeyRequest::setResourceRealOwnerId(long resourceRealOwnerId) { + resourceRealOwnerId_ = resourceRealOwnerId; + setParameter(std::string("ResourceRealOwnerId"), std::to_string(resourceRealOwnerId)); +} + +std::string GenerateKMSDataKeyRequest::getAccessKeyId() const { + return accessKeyId_; +} + +void GenerateKMSDataKeyRequest::setAccessKeyId(const std::string &accessKeyId) { + accessKeyId_ = accessKeyId; + setParameter(std::string("AccessKeyId"), accessKeyId); +} + +std::string GenerateKMSDataKeyRequest::getKmsRegionId() const { + return kmsRegionId_; +} + +void GenerateKMSDataKeyRequest::setKmsRegionId(const std::string &kmsRegionId) { + kmsRegionId_ = kmsRegionId; + setParameter(std::string("KmsRegionId"), kmsRegionId); +} + +std::string GenerateKMSDataKeyRequest::getResourceOwnerAccount() const { + return resourceOwnerAccount_; +} + +void GenerateKMSDataKeyRequest::setResourceOwnerAccount(const std::string &resourceOwnerAccount) { + resourceOwnerAccount_ = resourceOwnerAccount; + setParameter(std::string("ResourceOwnerAccount"), resourceOwnerAccount); +} + +std::string GenerateKMSDataKeyRequest::getOwnerAccount() const { + return ownerAccount_; +} + +void GenerateKMSDataKeyRequest::setOwnerAccount(const std::string &ownerAccount) { + ownerAccount_ = ownerAccount; + setParameter(std::string("OwnerAccount"), ownerAccount); +} + +std::string GenerateKMSDataKeyRequest::getOwnerId() const { + return ownerId_; +} + +void GenerateKMSDataKeyRequest::setOwnerId(const std::string &ownerId) { + ownerId_ = ownerId; + setParameter(std::string("OwnerId"), ownerId); +} + diff --git a/vod/src/model/GenerateKMSDataKeyResult.cc b/vod/src/model/GenerateKMSDataKeyResult.cc new file mode 100644 index 000000000..5c552fe7e --- /dev/null +++ b/vod/src/model/GenerateKMSDataKeyResult.cc @@ -0,0 +1,65 @@ +/* + * 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; + +GenerateKMSDataKeyResult::GenerateKMSDataKeyResult() : + ServiceResult() +{} + +GenerateKMSDataKeyResult::GenerateKMSDataKeyResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GenerateKMSDataKeyResult::~GenerateKMSDataKeyResult() +{} + +void GenerateKMSDataKeyResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["KeyId"].isNull()) + keyId_ = value["KeyId"].asString(); + if(!value["CiphertextBlob"].isNull()) + ciphertextBlob_ = value["CiphertextBlob"].asString(); + if(!value["Plaintext"].isNull()) + plaintext_ = value["Plaintext"].asString(); + +} + +std::string GenerateKMSDataKeyResult::getCiphertextBlob()const +{ + return ciphertextBlob_; +} + +std::string GenerateKMSDataKeyResult::getPlaintext()const +{ + return plaintext_; +} + +std::string GenerateKMSDataKeyResult::getKeyId()const +{ + return keyId_; +} +