From 032fbad25855a352e78dbb6b60689514229aa750 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Tue, 8 Oct 2019 11:28:14 +0800 Subject: [PATCH] Generated 2016-01-20 for Kms. --- CHANGELOG | 3 + VERSION | 2 +- kms/CMakeLists.txt | 24 ++- kms/include/alibabacloud/kms/KmsClient.h | 40 ++++ .../alibabacloud/kms/model/CreateKeyRequest.h | 6 + .../alibabacloud/kms/model/CreateKeyResult.h | 9 +- .../alibabacloud/kms/model/DecryptResult.h | 2 + .../kms/model/DescribeKeyResult.h | 9 +- .../kms/model/DescribeKeyVersionRequest.h | 51 +++++ .../kms/model/DescribeKeyVersionResult.h | 57 ++++++ .../alibabacloud/kms/model/EncryptResult.h | 2 + .../kms/model/GenerateDataKeyResult.h | 2 + .../GenerateDataKeyWithoutPlaintextRequest.h | 57 ++++++ .../GenerateDataKeyWithoutPlaintextResult.h | 55 ++++++ .../kms/model/ListKeyVersionsRequest.h | 54 ++++++ .../kms/model/ListKeyVersionsResult.h | 63 ++++++ .../kms/model/UpdateKeyDescriptionRequest.h | 51 +++++ .../kms/model/UpdateKeyDescriptionResult.h | 49 +++++ .../kms/model/UpdateRotationPolicyRequest.h | 54 ++++++ .../kms/model/UpdateRotationPolicyResult.h | 49 +++++ kms/src/KmsClient.cc | 180 ++++++++++++++++++ kms/src/model/CreateKeyRequest.cc | 22 +++ kms/src/model/CreateKeyResult.cc | 10 + kms/src/model/DecryptResult.cc | 7 + kms/src/model/DescribeKeyResult.cc | 10 + kms/src/model/DescribeKeyVersionRequest.cc | 49 +++++ kms/src/model/DescribeKeyVersionResult.cc | 56 ++++++ kms/src/model/EncryptResult.cc | 7 + kms/src/model/GenerateDataKeyResult.cc | 7 + .../GenerateDataKeyWithoutPlaintextRequest.cc | 71 +++++++ .../GenerateDataKeyWithoutPlaintextResult.cc | 65 +++++++ kms/src/model/ListKeyVersionsRequest.cc | 60 ++++++ kms/src/model/ListKeyVersionsResult.cc | 82 ++++++++ kms/src/model/UpdateKeyDescriptionRequest.cc | 49 +++++ kms/src/model/UpdateKeyDescriptionResult.cc | 44 +++++ kms/src/model/UpdateRotationPolicyRequest.cc | 60 ++++++ kms/src/model/UpdateRotationPolicyResult.cc | 44 +++++ 37 files changed, 1455 insertions(+), 7 deletions(-) create mode 100644 kms/include/alibabacloud/kms/model/DescribeKeyVersionRequest.h create mode 100644 kms/include/alibabacloud/kms/model/DescribeKeyVersionResult.h create mode 100644 kms/include/alibabacloud/kms/model/GenerateDataKeyWithoutPlaintextRequest.h create mode 100644 kms/include/alibabacloud/kms/model/GenerateDataKeyWithoutPlaintextResult.h create mode 100644 kms/include/alibabacloud/kms/model/ListKeyVersionsRequest.h create mode 100644 kms/include/alibabacloud/kms/model/ListKeyVersionsResult.h create mode 100644 kms/include/alibabacloud/kms/model/UpdateKeyDescriptionRequest.h create mode 100644 kms/include/alibabacloud/kms/model/UpdateKeyDescriptionResult.h create mode 100644 kms/include/alibabacloud/kms/model/UpdateRotationPolicyRequest.h create mode 100644 kms/include/alibabacloud/kms/model/UpdateRotationPolicyResult.h create mode 100644 kms/src/model/DescribeKeyVersionRequest.cc create mode 100644 kms/src/model/DescribeKeyVersionResult.cc create mode 100644 kms/src/model/GenerateDataKeyWithoutPlaintextRequest.cc create mode 100644 kms/src/model/GenerateDataKeyWithoutPlaintextResult.cc create mode 100644 kms/src/model/ListKeyVersionsRequest.cc create mode 100644 kms/src/model/ListKeyVersionsResult.cc create mode 100644 kms/src/model/UpdateKeyDescriptionRequest.cc create mode 100644 kms/src/model/UpdateKeyDescriptionResult.cc create mode 100644 kms/src/model/UpdateRotationPolicyRequest.cc create mode 100644 kms/src/model/UpdateRotationPolicyResult.cc diff --git a/CHANGELOG b/CHANGELOG index a6b93301e..b035c1ec4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2019-10-08 Version 1.36.144 +- Generated 2016-01-20 for `Kms`. + 2019-09-26 Version 1.36.143 - Supported RingConfig for BindAxb,BindAxn,BindAxg,BindAxnExtension. - Add QuerySubsId. diff --git a/VERSION b/VERSION index 71f253e77..c34b79d65 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.143 \ No newline at end of file +1.36.144 \ No newline at end of file diff --git a/kms/CMakeLists.txt b/kms/CMakeLists.txt index b6f38f872..3afd999dc 100644 --- a/kms/CMakeLists.txt +++ b/kms/CMakeLists.txt @@ -35,6 +35,8 @@ set(kms_public_header_model include/alibabacloud/kms/model/DeleteKeyMaterialResult.h include/alibabacloud/kms/model/DescribeKeyRequest.h include/alibabacloud/kms/model/DescribeKeyResult.h + include/alibabacloud/kms/model/DescribeKeyVersionRequest.h + include/alibabacloud/kms/model/DescribeKeyVersionResult.h include/alibabacloud/kms/model/DescribeRegionsRequest.h include/alibabacloud/kms/model/DescribeRegionsResult.h include/alibabacloud/kms/model/DescribeServiceRequest.h @@ -47,6 +49,8 @@ set(kms_public_header_model include/alibabacloud/kms/model/EncryptResult.h include/alibabacloud/kms/model/GenerateDataKeyRequest.h include/alibabacloud/kms/model/GenerateDataKeyResult.h + include/alibabacloud/kms/model/GenerateDataKeyWithoutPlaintextRequest.h + include/alibabacloud/kms/model/GenerateDataKeyWithoutPlaintextResult.h include/alibabacloud/kms/model/GetParametersForImportRequest.h include/alibabacloud/kms/model/GetParametersForImportResult.h include/alibabacloud/kms/model/ImportKeyMaterialRequest.h @@ -55,6 +59,8 @@ set(kms_public_header_model include/alibabacloud/kms/model/ListAliasesResult.h include/alibabacloud/kms/model/ListAliasesByKeyIdRequest.h include/alibabacloud/kms/model/ListAliasesByKeyIdResult.h + include/alibabacloud/kms/model/ListKeyVersionsRequest.h + include/alibabacloud/kms/model/ListKeyVersionsResult.h include/alibabacloud/kms/model/ListKeysRequest.h include/alibabacloud/kms/model/ListKeysResult.h include/alibabacloud/kms/model/ListResourceTagsRequest.h @@ -66,7 +72,11 @@ set(kms_public_header_model include/alibabacloud/kms/model/UntagResourceRequest.h include/alibabacloud/kms/model/UntagResourceResult.h include/alibabacloud/kms/model/UpdateAliasRequest.h - include/alibabacloud/kms/model/UpdateAliasResult.h ) + include/alibabacloud/kms/model/UpdateAliasResult.h + include/alibabacloud/kms/model/UpdateKeyDescriptionRequest.h + include/alibabacloud/kms/model/UpdateKeyDescriptionResult.h + include/alibabacloud/kms/model/UpdateRotationPolicyRequest.h + include/alibabacloud/kms/model/UpdateRotationPolicyResult.h ) set(kms_src src/KmsClient.cc @@ -84,6 +94,8 @@ set(kms_src src/model/DeleteKeyMaterialResult.cc src/model/DescribeKeyRequest.cc src/model/DescribeKeyResult.cc + src/model/DescribeKeyVersionRequest.cc + src/model/DescribeKeyVersionResult.cc src/model/DescribeRegionsRequest.cc src/model/DescribeRegionsResult.cc src/model/DescribeServiceRequest.cc @@ -96,6 +108,8 @@ set(kms_src src/model/EncryptResult.cc src/model/GenerateDataKeyRequest.cc src/model/GenerateDataKeyResult.cc + src/model/GenerateDataKeyWithoutPlaintextRequest.cc + src/model/GenerateDataKeyWithoutPlaintextResult.cc src/model/GetParametersForImportRequest.cc src/model/GetParametersForImportResult.cc src/model/ImportKeyMaterialRequest.cc @@ -104,6 +118,8 @@ set(kms_src src/model/ListAliasesResult.cc src/model/ListAliasesByKeyIdRequest.cc src/model/ListAliasesByKeyIdResult.cc + src/model/ListKeyVersionsRequest.cc + src/model/ListKeyVersionsResult.cc src/model/ListKeysRequest.cc src/model/ListKeysResult.cc src/model/ListResourceTagsRequest.cc @@ -115,7 +131,11 @@ set(kms_src src/model/UntagResourceRequest.cc src/model/UntagResourceResult.cc src/model/UpdateAliasRequest.cc - src/model/UpdateAliasResult.cc ) + src/model/UpdateAliasResult.cc + src/model/UpdateKeyDescriptionRequest.cc + src/model/UpdateKeyDescriptionResult.cc + src/model/UpdateRotationPolicyRequest.cc + src/model/UpdateRotationPolicyResult.cc ) add_library(kms ${LIB_TYPE} ${kms_public_header} diff --git a/kms/include/alibabacloud/kms/KmsClient.h b/kms/include/alibabacloud/kms/KmsClient.h index 7b7c6d418..ecdfee942 100644 --- a/kms/include/alibabacloud/kms/KmsClient.h +++ b/kms/include/alibabacloud/kms/KmsClient.h @@ -36,6 +36,8 @@ #include "model/DeleteKeyMaterialResult.h" #include "model/DescribeKeyRequest.h" #include "model/DescribeKeyResult.h" +#include "model/DescribeKeyVersionRequest.h" +#include "model/DescribeKeyVersionResult.h" #include "model/DescribeRegionsRequest.h" #include "model/DescribeRegionsResult.h" #include "model/DescribeServiceRequest.h" @@ -48,6 +50,8 @@ #include "model/EncryptResult.h" #include "model/GenerateDataKeyRequest.h" #include "model/GenerateDataKeyResult.h" +#include "model/GenerateDataKeyWithoutPlaintextRequest.h" +#include "model/GenerateDataKeyWithoutPlaintextResult.h" #include "model/GetParametersForImportRequest.h" #include "model/GetParametersForImportResult.h" #include "model/ImportKeyMaterialRequest.h" @@ -56,6 +60,8 @@ #include "model/ListAliasesResult.h" #include "model/ListAliasesByKeyIdRequest.h" #include "model/ListAliasesByKeyIdResult.h" +#include "model/ListKeyVersionsRequest.h" +#include "model/ListKeyVersionsResult.h" #include "model/ListKeysRequest.h" #include "model/ListKeysResult.h" #include "model/ListResourceTagsRequest.h" @@ -68,6 +74,10 @@ #include "model/UntagResourceResult.h" #include "model/UpdateAliasRequest.h" #include "model/UpdateAliasResult.h" +#include "model/UpdateKeyDescriptionRequest.h" +#include "model/UpdateKeyDescriptionResult.h" +#include "model/UpdateRotationPolicyRequest.h" +#include "model/UpdateRotationPolicyResult.h" namespace AlibabaCloud @@ -98,6 +108,9 @@ namespace AlibabaCloud typedef Outcome DescribeKeyOutcome; typedef std::future DescribeKeyOutcomeCallable; typedef std::function&)> DescribeKeyAsyncHandler; + typedef Outcome DescribeKeyVersionOutcome; + typedef std::future DescribeKeyVersionOutcomeCallable; + typedef std::function&)> DescribeKeyVersionAsyncHandler; typedef Outcome DescribeRegionsOutcome; typedef std::future DescribeRegionsOutcomeCallable; typedef std::function&)> DescribeRegionsAsyncHandler; @@ -116,6 +129,9 @@ namespace AlibabaCloud typedef Outcome GenerateDataKeyOutcome; typedef std::future GenerateDataKeyOutcomeCallable; typedef std::function&)> GenerateDataKeyAsyncHandler; + typedef Outcome GenerateDataKeyWithoutPlaintextOutcome; + typedef std::future GenerateDataKeyWithoutPlaintextOutcomeCallable; + typedef std::function&)> GenerateDataKeyWithoutPlaintextAsyncHandler; typedef Outcome GetParametersForImportOutcome; typedef std::future GetParametersForImportOutcomeCallable; typedef std::function&)> GetParametersForImportAsyncHandler; @@ -128,6 +144,9 @@ namespace AlibabaCloud typedef Outcome ListAliasesByKeyIdOutcome; typedef std::future ListAliasesByKeyIdOutcomeCallable; typedef std::function&)> ListAliasesByKeyIdAsyncHandler; + typedef Outcome ListKeyVersionsOutcome; + typedef std::future ListKeyVersionsOutcomeCallable; + typedef std::function&)> ListKeyVersionsAsyncHandler; typedef Outcome ListKeysOutcome; typedef std::future ListKeysOutcomeCallable; typedef std::function&)> ListKeysAsyncHandler; @@ -146,6 +165,12 @@ namespace AlibabaCloud typedef Outcome UpdateAliasOutcome; typedef std::future UpdateAliasOutcomeCallable; typedef std::function&)> UpdateAliasAsyncHandler; + typedef Outcome UpdateKeyDescriptionOutcome; + typedef std::future UpdateKeyDescriptionOutcomeCallable; + typedef std::function&)> UpdateKeyDescriptionAsyncHandler; + typedef Outcome UpdateRotationPolicyOutcome; + typedef std::future UpdateRotationPolicyOutcomeCallable; + typedef std::function&)> UpdateRotationPolicyAsyncHandler; KmsClient(const Credentials &credentials, const ClientConfiguration &configuration); KmsClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); @@ -172,6 +197,9 @@ namespace AlibabaCloud DescribeKeyOutcome describeKey(const Model::DescribeKeyRequest &request)const; void describeKeyAsync(const Model::DescribeKeyRequest& request, const DescribeKeyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DescribeKeyOutcomeCallable describeKeyCallable(const Model::DescribeKeyRequest& request) const; + DescribeKeyVersionOutcome describeKeyVersion(const Model::DescribeKeyVersionRequest &request)const; + void describeKeyVersionAsync(const Model::DescribeKeyVersionRequest& request, const DescribeKeyVersionAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DescribeKeyVersionOutcomeCallable describeKeyVersionCallable(const Model::DescribeKeyVersionRequest& request) const; DescribeRegionsOutcome describeRegions(const Model::DescribeRegionsRequest &request)const; void describeRegionsAsync(const Model::DescribeRegionsRequest& request, const DescribeRegionsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DescribeRegionsOutcomeCallable describeRegionsCallable(const Model::DescribeRegionsRequest& request) const; @@ -190,6 +218,9 @@ namespace AlibabaCloud GenerateDataKeyOutcome generateDataKey(const Model::GenerateDataKeyRequest &request)const; void generateDataKeyAsync(const Model::GenerateDataKeyRequest& request, const GenerateDataKeyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GenerateDataKeyOutcomeCallable generateDataKeyCallable(const Model::GenerateDataKeyRequest& request) const; + GenerateDataKeyWithoutPlaintextOutcome generateDataKeyWithoutPlaintext(const Model::GenerateDataKeyWithoutPlaintextRequest &request)const; + void generateDataKeyWithoutPlaintextAsync(const Model::GenerateDataKeyWithoutPlaintextRequest& request, const GenerateDataKeyWithoutPlaintextAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GenerateDataKeyWithoutPlaintextOutcomeCallable generateDataKeyWithoutPlaintextCallable(const Model::GenerateDataKeyWithoutPlaintextRequest& request) const; GetParametersForImportOutcome getParametersForImport(const Model::GetParametersForImportRequest &request)const; void getParametersForImportAsync(const Model::GetParametersForImportRequest& request, const GetParametersForImportAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetParametersForImportOutcomeCallable getParametersForImportCallable(const Model::GetParametersForImportRequest& request) const; @@ -202,6 +233,9 @@ namespace AlibabaCloud ListAliasesByKeyIdOutcome listAliasesByKeyId(const Model::ListAliasesByKeyIdRequest &request)const; void listAliasesByKeyIdAsync(const Model::ListAliasesByKeyIdRequest& request, const ListAliasesByKeyIdAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListAliasesByKeyIdOutcomeCallable listAliasesByKeyIdCallable(const Model::ListAliasesByKeyIdRequest& request) const; + ListKeyVersionsOutcome listKeyVersions(const Model::ListKeyVersionsRequest &request)const; + void listKeyVersionsAsync(const Model::ListKeyVersionsRequest& request, const ListKeyVersionsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListKeyVersionsOutcomeCallable listKeyVersionsCallable(const Model::ListKeyVersionsRequest& request) const; ListKeysOutcome listKeys(const Model::ListKeysRequest &request)const; void listKeysAsync(const Model::ListKeysRequest& request, const ListKeysAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListKeysOutcomeCallable listKeysCallable(const Model::ListKeysRequest& request) const; @@ -220,6 +254,12 @@ namespace AlibabaCloud UpdateAliasOutcome updateAlias(const Model::UpdateAliasRequest &request)const; void updateAliasAsync(const Model::UpdateAliasRequest& request, const UpdateAliasAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; UpdateAliasOutcomeCallable updateAliasCallable(const Model::UpdateAliasRequest& request) const; + UpdateKeyDescriptionOutcome updateKeyDescription(const Model::UpdateKeyDescriptionRequest &request)const; + void updateKeyDescriptionAsync(const Model::UpdateKeyDescriptionRequest& request, const UpdateKeyDescriptionAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + UpdateKeyDescriptionOutcomeCallable updateKeyDescriptionCallable(const Model::UpdateKeyDescriptionRequest& request) const; + UpdateRotationPolicyOutcome updateRotationPolicy(const Model::UpdateRotationPolicyRequest &request)const; + void updateRotationPolicyAsync(const Model::UpdateRotationPolicyRequest& request, const UpdateRotationPolicyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + UpdateRotationPolicyOutcomeCallable updateRotationPolicyCallable(const Model::UpdateRotationPolicyRequest& request) const; private: std::shared_ptr endpointProvider_; diff --git a/kms/include/alibabacloud/kms/model/CreateKeyRequest.h b/kms/include/alibabacloud/kms/model/CreateKeyRequest.h index 4f8ff1f38..ed2e22dc6 100644 --- a/kms/include/alibabacloud/kms/model/CreateKeyRequest.h +++ b/kms/include/alibabacloud/kms/model/CreateKeyRequest.h @@ -43,12 +43,18 @@ namespace AlibabaCloud void setOrigin(const std::string& origin); std::string getDescription()const; void setDescription(const std::string& description); + std::string getRotationInterval()const; + void setRotationInterval(const std::string& rotationInterval); + bool getEnableAutomaticRotation()const; + void setEnableAutomaticRotation(bool enableAutomaticRotation); private: std::string protectionLevel_; std::string keyUsage_; std::string origin_; std::string description_; + std::string rotationInterval_; + bool enableAutomaticRotation_; }; } diff --git a/kms/include/alibabacloud/kms/model/CreateKeyResult.h b/kms/include/alibabacloud/kms/model/CreateKeyResult.h index 493100479..941024546 100644 --- a/kms/include/alibabacloud/kms/model/CreateKeyResult.h +++ b/kms/include/alibabacloud/kms/model/CreateKeyResult.h @@ -38,13 +38,18 @@ namespace AlibabaCloud std::string creationDate; std::string protectionLevel; std::string description; - std::string materialExpireTime; + std::string lastRotationDate; + std::string rotationInterval; std::string keyUsage; std::string keyId; + std::string primaryKeyVersion; std::string creator; + std::string deleteDate; + std::string automaticRotation; + std::string nextRotationDate; + std::string materialExpireTime; std::string arn; std::string keyState; - std::string deleteDate; }; diff --git a/kms/include/alibabacloud/kms/model/DecryptResult.h b/kms/include/alibabacloud/kms/model/DecryptResult.h index 3c2d94994..7b30bcdda 100644 --- a/kms/include/alibabacloud/kms/model/DecryptResult.h +++ b/kms/include/alibabacloud/kms/model/DecryptResult.h @@ -39,12 +39,14 @@ namespace AlibabaCloud ~DecryptResult(); std::string getPlaintext()const; std::string getKeyId()const; + std::string getKeyVersionId()const; protected: void parse(const std::string &payload); private: std::string plaintext_; std::string keyId_; + std::string keyVersionId_; }; } diff --git a/kms/include/alibabacloud/kms/model/DescribeKeyResult.h b/kms/include/alibabacloud/kms/model/DescribeKeyResult.h index 5408d114e..e01ad8d81 100644 --- a/kms/include/alibabacloud/kms/model/DescribeKeyResult.h +++ b/kms/include/alibabacloud/kms/model/DescribeKeyResult.h @@ -38,13 +38,18 @@ namespace AlibabaCloud std::string creationDate; std::string protectionLevel; std::string description; - std::string materialExpireTime; + std::string lastRotationDate; + std::string rotationInterval; std::string keyUsage; std::string keyId; + std::string primaryKeyVersion; std::string creator; + std::string deleteDate; + std::string automaticRotation; + std::string nextRotationDate; + std::string materialExpireTime; std::string arn; std::string keyState; - std::string deleteDate; }; diff --git a/kms/include/alibabacloud/kms/model/DescribeKeyVersionRequest.h b/kms/include/alibabacloud/kms/model/DescribeKeyVersionRequest.h new file mode 100644 index 000000000..325a2f795 --- /dev/null +++ b/kms/include/alibabacloud/kms/model/DescribeKeyVersionRequest.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_KMS_MODEL_DESCRIBEKEYVERSIONREQUEST_H_ +#define ALIBABACLOUD_KMS_MODEL_DESCRIBEKEYVERSIONREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT DescribeKeyVersionRequest : public RpcServiceRequest + { + + public: + DescribeKeyVersionRequest(); + ~DescribeKeyVersionRequest(); + + std::string getKeyVersionId()const; + void setKeyVersionId(const std::string& keyVersionId); + std::string getKeyId()const; + void setKeyId(const std::string& keyId); + + private: + std::string keyVersionId_; + std::string keyId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_DESCRIBEKEYVERSIONREQUEST_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/DescribeKeyVersionResult.h b/kms/include/alibabacloud/kms/model/DescribeKeyVersionResult.h new file mode 100644 index 000000000..365725552 --- /dev/null +++ b/kms/include/alibabacloud/kms/model/DescribeKeyVersionResult.h @@ -0,0 +1,57 @@ +/* + * 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_KMS_MODEL_DESCRIBEKEYVERSIONRESULT_H_ +#define ALIBABACLOUD_KMS_MODEL_DESCRIBEKEYVERSIONRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT DescribeKeyVersionResult : public ServiceResult + { + public: + struct KeyVersion + { + std::string creationDate; + std::string keyId; + std::string keyVersionId; + }; + + + DescribeKeyVersionResult(); + explicit DescribeKeyVersionResult(const std::string &payload); + ~DescribeKeyVersionResult(); + KeyVersion getKeyVersion()const; + + protected: + void parse(const std::string &payload); + private: + KeyVersion keyVersion_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_DESCRIBEKEYVERSIONRESULT_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/EncryptResult.h b/kms/include/alibabacloud/kms/model/EncryptResult.h index 17fca41cb..54889417e 100644 --- a/kms/include/alibabacloud/kms/model/EncryptResult.h +++ b/kms/include/alibabacloud/kms/model/EncryptResult.h @@ -39,12 +39,14 @@ namespace AlibabaCloud ~EncryptResult(); std::string getCiphertextBlob()const; std::string getKeyId()const; + std::string getKeyVersionId()const; protected: void parse(const std::string &payload); private: std::string ciphertextBlob_; std::string keyId_; + std::string keyVersionId_; }; } diff --git a/kms/include/alibabacloud/kms/model/GenerateDataKeyResult.h b/kms/include/alibabacloud/kms/model/GenerateDataKeyResult.h index db977cec2..60549a7af 100644 --- a/kms/include/alibabacloud/kms/model/GenerateDataKeyResult.h +++ b/kms/include/alibabacloud/kms/model/GenerateDataKeyResult.h @@ -40,6 +40,7 @@ namespace AlibabaCloud std::string getCiphertextBlob()const; std::string getPlaintext()const; std::string getKeyId()const; + std::string getKeyVersionId()const; protected: void parse(const std::string &payload); @@ -47,6 +48,7 @@ namespace AlibabaCloud std::string ciphertextBlob_; std::string plaintext_; std::string keyId_; + std::string keyVersionId_; }; } diff --git a/kms/include/alibabacloud/kms/model/GenerateDataKeyWithoutPlaintextRequest.h b/kms/include/alibabacloud/kms/model/GenerateDataKeyWithoutPlaintextRequest.h new file mode 100644 index 000000000..aced2174c --- /dev/null +++ b/kms/include/alibabacloud/kms/model/GenerateDataKeyWithoutPlaintextRequest.h @@ -0,0 +1,57 @@ +/* + * 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_KMS_MODEL_GENERATEDATAKEYWITHOUTPLAINTEXTREQUEST_H_ +#define ALIBABACLOUD_KMS_MODEL_GENERATEDATAKEYWITHOUTPLAINTEXTREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT GenerateDataKeyWithoutPlaintextRequest : public RpcServiceRequest + { + + public: + GenerateDataKeyWithoutPlaintextRequest(); + ~GenerateDataKeyWithoutPlaintextRequest(); + + std::string getEncryptionContext()const; + void setEncryptionContext(const std::string& encryptionContext); + std::string getKeyId()const; + void setKeyId(const std::string& keyId); + std::string getKeySpec()const; + void setKeySpec(const std::string& keySpec); + int getNumberOfBytes()const; + void setNumberOfBytes(int numberOfBytes); + + private: + std::string encryptionContext_; + std::string keyId_; + std::string keySpec_; + int numberOfBytes_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_GENERATEDATAKEYWITHOUTPLAINTEXTREQUEST_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/GenerateDataKeyWithoutPlaintextResult.h b/kms/include/alibabacloud/kms/model/GenerateDataKeyWithoutPlaintextResult.h new file mode 100644 index 000000000..7c246e3ff --- /dev/null +++ b/kms/include/alibabacloud/kms/model/GenerateDataKeyWithoutPlaintextResult.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_KMS_MODEL_GENERATEDATAKEYWITHOUTPLAINTEXTRESULT_H_ +#define ALIBABACLOUD_KMS_MODEL_GENERATEDATAKEYWITHOUTPLAINTEXTRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT GenerateDataKeyWithoutPlaintextResult : public ServiceResult + { + public: + + + GenerateDataKeyWithoutPlaintextResult(); + explicit GenerateDataKeyWithoutPlaintextResult(const std::string &payload); + ~GenerateDataKeyWithoutPlaintextResult(); + std::string getCiphertextBlob()const; + std::string getKeyId()const; + std::string getKeyVersionId()const; + + protected: + void parse(const std::string &payload); + private: + std::string ciphertextBlob_; + std::string keyId_; + std::string keyVersionId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_GENERATEDATAKEYWITHOUTPLAINTEXTRESULT_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/ListKeyVersionsRequest.h b/kms/include/alibabacloud/kms/model/ListKeyVersionsRequest.h new file mode 100644 index 000000000..a73bd8ca7 --- /dev/null +++ b/kms/include/alibabacloud/kms/model/ListKeyVersionsRequest.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_KMS_MODEL_LISTKEYVERSIONSREQUEST_H_ +#define ALIBABACLOUD_KMS_MODEL_LISTKEYVERSIONSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT ListKeyVersionsRequest : public RpcServiceRequest + { + + public: + ListKeyVersionsRequest(); + ~ListKeyVersionsRequest(); + + int getPageSize()const; + void setPageSize(int pageSize); + std::string getKeyId()const; + void setKeyId(const std::string& keyId); + int getPageNumber()const; + void setPageNumber(int pageNumber); + + private: + int pageSize_; + std::string keyId_; + int pageNumber_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_LISTKEYVERSIONSREQUEST_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/ListKeyVersionsResult.h b/kms/include/alibabacloud/kms/model/ListKeyVersionsResult.h new file mode 100644 index 000000000..2f5d0d2d5 --- /dev/null +++ b/kms/include/alibabacloud/kms/model/ListKeyVersionsResult.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_KMS_MODEL_LISTKEYVERSIONSRESULT_H_ +#define ALIBABACLOUD_KMS_MODEL_LISTKEYVERSIONSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT ListKeyVersionsResult : public ServiceResult + { + public: + struct KeyVersion + { + std::string creationDate; + std::string keyId; + std::string keyVersionId; + }; + + + ListKeyVersionsResult(); + explicit ListKeyVersionsResult(const std::string &payload); + ~ListKeyVersionsResult(); + std::vector getKeyVersions()const; + int getTotalCount()const; + int getPageSize()const; + int getPageNumber()const; + + protected: + void parse(const std::string &payload); + private: + std::vector keyVersions_; + int totalCount_; + int pageSize_; + int pageNumber_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_LISTKEYVERSIONSRESULT_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/UpdateKeyDescriptionRequest.h b/kms/include/alibabacloud/kms/model/UpdateKeyDescriptionRequest.h new file mode 100644 index 000000000..877f13317 --- /dev/null +++ b/kms/include/alibabacloud/kms/model/UpdateKeyDescriptionRequest.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_KMS_MODEL_UPDATEKEYDESCRIPTIONREQUEST_H_ +#define ALIBABACLOUD_KMS_MODEL_UPDATEKEYDESCRIPTIONREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT UpdateKeyDescriptionRequest : public RpcServiceRequest + { + + public: + UpdateKeyDescriptionRequest(); + ~UpdateKeyDescriptionRequest(); + + std::string getKeyId()const; + void setKeyId(const std::string& keyId); + std::string getDescription()const; + void setDescription(const std::string& description); + + private: + std::string keyId_; + std::string description_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_UPDATEKEYDESCRIPTIONREQUEST_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/UpdateKeyDescriptionResult.h b/kms/include/alibabacloud/kms/model/UpdateKeyDescriptionResult.h new file mode 100644 index 000000000..4e6fdbf46 --- /dev/null +++ b/kms/include/alibabacloud/kms/model/UpdateKeyDescriptionResult.h @@ -0,0 +1,49 @@ +/* + * 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_KMS_MODEL_UPDATEKEYDESCRIPTIONRESULT_H_ +#define ALIBABACLOUD_KMS_MODEL_UPDATEKEYDESCRIPTIONRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT UpdateKeyDescriptionResult : public ServiceResult + { + public: + + + UpdateKeyDescriptionResult(); + explicit UpdateKeyDescriptionResult(const std::string &payload); + ~UpdateKeyDescriptionResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_UPDATEKEYDESCRIPTIONRESULT_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/UpdateRotationPolicyRequest.h b/kms/include/alibabacloud/kms/model/UpdateRotationPolicyRequest.h new file mode 100644 index 000000000..9659d947a --- /dev/null +++ b/kms/include/alibabacloud/kms/model/UpdateRotationPolicyRequest.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_KMS_MODEL_UPDATEROTATIONPOLICYREQUEST_H_ +#define ALIBABACLOUD_KMS_MODEL_UPDATEROTATIONPOLICYREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT UpdateRotationPolicyRequest : public RpcServiceRequest + { + + public: + UpdateRotationPolicyRequest(); + ~UpdateRotationPolicyRequest(); + + std::string getKeyId()const; + void setKeyId(const std::string& keyId); + std::string getRotationInterval()const; + void setRotationInterval(const std::string& rotationInterval); + bool getEnableAutomaticRotation()const; + void setEnableAutomaticRotation(bool enableAutomaticRotation); + + private: + std::string keyId_; + std::string rotationInterval_; + bool enableAutomaticRotation_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_UPDATEROTATIONPOLICYREQUEST_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/UpdateRotationPolicyResult.h b/kms/include/alibabacloud/kms/model/UpdateRotationPolicyResult.h new file mode 100644 index 000000000..88b8a3980 --- /dev/null +++ b/kms/include/alibabacloud/kms/model/UpdateRotationPolicyResult.h @@ -0,0 +1,49 @@ +/* + * 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_KMS_MODEL_UPDATEROTATIONPOLICYRESULT_H_ +#define ALIBABACLOUD_KMS_MODEL_UPDATEROTATIONPOLICYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT UpdateRotationPolicyResult : public ServiceResult + { + public: + + + UpdateRotationPolicyResult(); + explicit UpdateRotationPolicyResult(const std::string &payload); + ~UpdateRotationPolicyResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_UPDATEROTATIONPOLICYRESULT_H_ \ No newline at end of file diff --git a/kms/src/KmsClient.cc b/kms/src/KmsClient.cc index 73b9bc061..5a28b9a2e 100644 --- a/kms/src/KmsClient.cc +++ b/kms/src/KmsClient.cc @@ -303,6 +303,42 @@ KmsClient::DescribeKeyOutcomeCallable KmsClient::describeKeyCallable(const Descr return task->get_future(); } +KmsClient::DescribeKeyVersionOutcome KmsClient::describeKeyVersion(const DescribeKeyVersionRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DescribeKeyVersionOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DescribeKeyVersionOutcome(DescribeKeyVersionResult(outcome.result())); + else + return DescribeKeyVersionOutcome(outcome.error()); +} + +void KmsClient::describeKeyVersionAsync(const DescribeKeyVersionRequest& request, const DescribeKeyVersionAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, describeKeyVersion(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +KmsClient::DescribeKeyVersionOutcomeCallable KmsClient::describeKeyVersionCallable(const DescribeKeyVersionRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->describeKeyVersion(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + KmsClient::DescribeRegionsOutcome KmsClient::describeRegions(const DescribeRegionsRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -519,6 +555,42 @@ KmsClient::GenerateDataKeyOutcomeCallable KmsClient::generateDataKeyCallable(con return task->get_future(); } +KmsClient::GenerateDataKeyWithoutPlaintextOutcome KmsClient::generateDataKeyWithoutPlaintext(const GenerateDataKeyWithoutPlaintextRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GenerateDataKeyWithoutPlaintextOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GenerateDataKeyWithoutPlaintextOutcome(GenerateDataKeyWithoutPlaintextResult(outcome.result())); + else + return GenerateDataKeyWithoutPlaintextOutcome(outcome.error()); +} + +void KmsClient::generateDataKeyWithoutPlaintextAsync(const GenerateDataKeyWithoutPlaintextRequest& request, const GenerateDataKeyWithoutPlaintextAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, generateDataKeyWithoutPlaintext(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +KmsClient::GenerateDataKeyWithoutPlaintextOutcomeCallable KmsClient::generateDataKeyWithoutPlaintextCallable(const GenerateDataKeyWithoutPlaintextRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->generateDataKeyWithoutPlaintext(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + KmsClient::GetParametersForImportOutcome KmsClient::getParametersForImport(const GetParametersForImportRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -663,6 +735,42 @@ KmsClient::ListAliasesByKeyIdOutcomeCallable KmsClient::listAliasesByKeyIdCallab return task->get_future(); } +KmsClient::ListKeyVersionsOutcome KmsClient::listKeyVersions(const ListKeyVersionsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListKeyVersionsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListKeyVersionsOutcome(ListKeyVersionsResult(outcome.result())); + else + return ListKeyVersionsOutcome(outcome.error()); +} + +void KmsClient::listKeyVersionsAsync(const ListKeyVersionsRequest& request, const ListKeyVersionsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listKeyVersions(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +KmsClient::ListKeyVersionsOutcomeCallable KmsClient::listKeyVersionsCallable(const ListKeyVersionsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listKeyVersions(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + KmsClient::ListKeysOutcome KmsClient::listKeys(const ListKeysRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -879,3 +987,75 @@ KmsClient::UpdateAliasOutcomeCallable KmsClient::updateAliasCallable(const Updat return task->get_future(); } +KmsClient::UpdateKeyDescriptionOutcome KmsClient::updateKeyDescription(const UpdateKeyDescriptionRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return UpdateKeyDescriptionOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return UpdateKeyDescriptionOutcome(UpdateKeyDescriptionResult(outcome.result())); + else + return UpdateKeyDescriptionOutcome(outcome.error()); +} + +void KmsClient::updateKeyDescriptionAsync(const UpdateKeyDescriptionRequest& request, const UpdateKeyDescriptionAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, updateKeyDescription(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +KmsClient::UpdateKeyDescriptionOutcomeCallable KmsClient::updateKeyDescriptionCallable(const UpdateKeyDescriptionRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->updateKeyDescription(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +KmsClient::UpdateRotationPolicyOutcome KmsClient::updateRotationPolicy(const UpdateRotationPolicyRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return UpdateRotationPolicyOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return UpdateRotationPolicyOutcome(UpdateRotationPolicyResult(outcome.result())); + else + return UpdateRotationPolicyOutcome(outcome.error()); +} + +void KmsClient::updateRotationPolicyAsync(const UpdateRotationPolicyRequest& request, const UpdateRotationPolicyAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, updateRotationPolicy(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +KmsClient::UpdateRotationPolicyOutcomeCallable KmsClient::updateRotationPolicyCallable(const UpdateRotationPolicyRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->updateRotationPolicy(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/kms/src/model/CreateKeyRequest.cc b/kms/src/model/CreateKeyRequest.cc index d6f72b2da..37983af2f 100644 --- a/kms/src/model/CreateKeyRequest.cc +++ b/kms/src/model/CreateKeyRequest.cc @@ -69,3 +69,25 @@ void CreateKeyRequest::setDescription(const std::string& description) setCoreParameter("Description", description); } +std::string CreateKeyRequest::getRotationInterval()const +{ + return rotationInterval_; +} + +void CreateKeyRequest::setRotationInterval(const std::string& rotationInterval) +{ + rotationInterval_ = rotationInterval; + setCoreParameter("RotationInterval", rotationInterval); +} + +bool CreateKeyRequest::getEnableAutomaticRotation()const +{ + return enableAutomaticRotation_; +} + +void CreateKeyRequest::setEnableAutomaticRotation(bool enableAutomaticRotation) +{ + enableAutomaticRotation_ = enableAutomaticRotation; + setCoreParameter("EnableAutomaticRotation", enableAutomaticRotation ? "true" : "false"); +} + diff --git a/kms/src/model/CreateKeyResult.cc b/kms/src/model/CreateKeyResult.cc index 96c267236..c95d6e65a 100644 --- a/kms/src/model/CreateKeyResult.cc +++ b/kms/src/model/CreateKeyResult.cc @@ -62,6 +62,16 @@ void CreateKeyResult::parse(const std::string &payload) keyMetadata_.materialExpireTime = keyMetadataNode["MaterialExpireTime"].asString(); if(!keyMetadataNode["ProtectionLevel"].isNull()) keyMetadata_.protectionLevel = keyMetadataNode["ProtectionLevel"].asString(); + if(!keyMetadataNode["PrimaryKeyVersion"].isNull()) + keyMetadata_.primaryKeyVersion = keyMetadataNode["PrimaryKeyVersion"].asString(); + if(!keyMetadataNode["LastRotationDate"].isNull()) + keyMetadata_.lastRotationDate = keyMetadataNode["LastRotationDate"].asString(); + if(!keyMetadataNode["AutomaticRotation"].isNull()) + keyMetadata_.automaticRotation = keyMetadataNode["AutomaticRotation"].asString(); + if(!keyMetadataNode["RotationInterval"].isNull()) + keyMetadata_.rotationInterval = keyMetadataNode["RotationInterval"].asString(); + if(!keyMetadataNode["NextRotationDate"].isNull()) + keyMetadata_.nextRotationDate = keyMetadataNode["NextRotationDate"].asString(); } diff --git a/kms/src/model/DecryptResult.cc b/kms/src/model/DecryptResult.cc index dbe9ffabc..98ea4208c 100644 --- a/kms/src/model/DecryptResult.cc +++ b/kms/src/model/DecryptResult.cc @@ -43,6 +43,8 @@ void DecryptResult::parse(const std::string &payload) plaintext_ = value["Plaintext"].asString(); if(!value["KeyId"].isNull()) keyId_ = value["KeyId"].asString(); + if(!value["KeyVersionId"].isNull()) + keyVersionId_ = value["KeyVersionId"].asString(); } @@ -56,3 +58,8 @@ std::string DecryptResult::getKeyId()const return keyId_; } +std::string DecryptResult::getKeyVersionId()const +{ + return keyVersionId_; +} + diff --git a/kms/src/model/DescribeKeyResult.cc b/kms/src/model/DescribeKeyResult.cc index a2f015973..b4f5bfbb6 100644 --- a/kms/src/model/DescribeKeyResult.cc +++ b/kms/src/model/DescribeKeyResult.cc @@ -62,6 +62,16 @@ void DescribeKeyResult::parse(const std::string &payload) keyMetadata_.materialExpireTime = keyMetadataNode["MaterialExpireTime"].asString(); if(!keyMetadataNode["ProtectionLevel"].isNull()) keyMetadata_.protectionLevel = keyMetadataNode["ProtectionLevel"].asString(); + if(!keyMetadataNode["PrimaryKeyVersion"].isNull()) + keyMetadata_.primaryKeyVersion = keyMetadataNode["PrimaryKeyVersion"].asString(); + if(!keyMetadataNode["LastRotationDate"].isNull()) + keyMetadata_.lastRotationDate = keyMetadataNode["LastRotationDate"].asString(); + if(!keyMetadataNode["AutomaticRotation"].isNull()) + keyMetadata_.automaticRotation = keyMetadataNode["AutomaticRotation"].asString(); + if(!keyMetadataNode["RotationInterval"].isNull()) + keyMetadata_.rotationInterval = keyMetadataNode["RotationInterval"].asString(); + if(!keyMetadataNode["NextRotationDate"].isNull()) + keyMetadata_.nextRotationDate = keyMetadataNode["NextRotationDate"].asString(); } diff --git a/kms/src/model/DescribeKeyVersionRequest.cc b/kms/src/model/DescribeKeyVersionRequest.cc new file mode 100644 index 000000000..9ca21ef65 --- /dev/null +++ b/kms/src/model/DescribeKeyVersionRequest.cc @@ -0,0 +1,49 @@ +/* + * 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::Kms::Model::DescribeKeyVersionRequest; + +DescribeKeyVersionRequest::DescribeKeyVersionRequest() : + RpcServiceRequest("kms", "2016-01-20", "DescribeKeyVersion") +{} + +DescribeKeyVersionRequest::~DescribeKeyVersionRequest() +{} + +std::string DescribeKeyVersionRequest::getKeyVersionId()const +{ + return keyVersionId_; +} + +void DescribeKeyVersionRequest::setKeyVersionId(const std::string& keyVersionId) +{ + keyVersionId_ = keyVersionId; + setCoreParameter("KeyVersionId", keyVersionId); +} + +std::string DescribeKeyVersionRequest::getKeyId()const +{ + return keyId_; +} + +void DescribeKeyVersionRequest::setKeyId(const std::string& keyId) +{ + keyId_ = keyId; + setCoreParameter("KeyId", keyId); +} + diff --git a/kms/src/model/DescribeKeyVersionResult.cc b/kms/src/model/DescribeKeyVersionResult.cc new file mode 100644 index 000000000..ffd0b05f1 --- /dev/null +++ b/kms/src/model/DescribeKeyVersionResult.cc @@ -0,0 +1,56 @@ +/* + * 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::Kms; +using namespace AlibabaCloud::Kms::Model; + +DescribeKeyVersionResult::DescribeKeyVersionResult() : + ServiceResult() +{} + +DescribeKeyVersionResult::DescribeKeyVersionResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DescribeKeyVersionResult::~DescribeKeyVersionResult() +{} + +void DescribeKeyVersionResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto keyVersionNode = value["KeyVersion"]; + if(!keyVersionNode["KeyId"].isNull()) + keyVersion_.keyId = keyVersionNode["KeyId"].asString(); + if(!keyVersionNode["KeyVersionId"].isNull()) + keyVersion_.keyVersionId = keyVersionNode["KeyVersionId"].asString(); + if(!keyVersionNode["CreationDate"].isNull()) + keyVersion_.creationDate = keyVersionNode["CreationDate"].asString(); + +} + +DescribeKeyVersionResult::KeyVersion DescribeKeyVersionResult::getKeyVersion()const +{ + return keyVersion_; +} + diff --git a/kms/src/model/EncryptResult.cc b/kms/src/model/EncryptResult.cc index 768f7c6cb..224066621 100644 --- a/kms/src/model/EncryptResult.cc +++ b/kms/src/model/EncryptResult.cc @@ -43,6 +43,8 @@ void EncryptResult::parse(const std::string &payload) ciphertextBlob_ = value["CiphertextBlob"].asString(); if(!value["KeyId"].isNull()) keyId_ = value["KeyId"].asString(); + if(!value["KeyVersionId"].isNull()) + keyVersionId_ = value["KeyVersionId"].asString(); } @@ -56,3 +58,8 @@ std::string EncryptResult::getKeyId()const return keyId_; } +std::string EncryptResult::getKeyVersionId()const +{ + return keyVersionId_; +} + diff --git a/kms/src/model/GenerateDataKeyResult.cc b/kms/src/model/GenerateDataKeyResult.cc index 6fe3d76a1..e485307d7 100644 --- a/kms/src/model/GenerateDataKeyResult.cc +++ b/kms/src/model/GenerateDataKeyResult.cc @@ -45,6 +45,8 @@ void GenerateDataKeyResult::parse(const std::string &payload) keyId_ = value["KeyId"].asString(); if(!value["Plaintext"].isNull()) plaintext_ = value["Plaintext"].asString(); + if(!value["KeyVersionId"].isNull()) + keyVersionId_ = value["KeyVersionId"].asString(); } @@ -63,3 +65,8 @@ std::string GenerateDataKeyResult::getKeyId()const return keyId_; } +std::string GenerateDataKeyResult::getKeyVersionId()const +{ + return keyVersionId_; +} + diff --git a/kms/src/model/GenerateDataKeyWithoutPlaintextRequest.cc b/kms/src/model/GenerateDataKeyWithoutPlaintextRequest.cc new file mode 100644 index 000000000..15f267610 --- /dev/null +++ b/kms/src/model/GenerateDataKeyWithoutPlaintextRequest.cc @@ -0,0 +1,71 @@ +/* + * 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::Kms::Model::GenerateDataKeyWithoutPlaintextRequest; + +GenerateDataKeyWithoutPlaintextRequest::GenerateDataKeyWithoutPlaintextRequest() : + RpcServiceRequest("kms", "2016-01-20", "GenerateDataKeyWithoutPlaintext") +{} + +GenerateDataKeyWithoutPlaintextRequest::~GenerateDataKeyWithoutPlaintextRequest() +{} + +std::string GenerateDataKeyWithoutPlaintextRequest::getEncryptionContext()const +{ + return encryptionContext_; +} + +void GenerateDataKeyWithoutPlaintextRequest::setEncryptionContext(const std::string& encryptionContext) +{ + encryptionContext_ = encryptionContext; + setCoreParameter("EncryptionContext", encryptionContext); +} + +std::string GenerateDataKeyWithoutPlaintextRequest::getKeyId()const +{ + return keyId_; +} + +void GenerateDataKeyWithoutPlaintextRequest::setKeyId(const std::string& keyId) +{ + keyId_ = keyId; + setCoreParameter("KeyId", keyId); +} + +std::string GenerateDataKeyWithoutPlaintextRequest::getKeySpec()const +{ + return keySpec_; +} + +void GenerateDataKeyWithoutPlaintextRequest::setKeySpec(const std::string& keySpec) +{ + keySpec_ = keySpec; + setCoreParameter("KeySpec", keySpec); +} + +int GenerateDataKeyWithoutPlaintextRequest::getNumberOfBytes()const +{ + return numberOfBytes_; +} + +void GenerateDataKeyWithoutPlaintextRequest::setNumberOfBytes(int numberOfBytes) +{ + numberOfBytes_ = numberOfBytes; + setCoreParameter("NumberOfBytes", std::to_string(numberOfBytes)); +} + diff --git a/kms/src/model/GenerateDataKeyWithoutPlaintextResult.cc b/kms/src/model/GenerateDataKeyWithoutPlaintextResult.cc new file mode 100644 index 000000000..243e488db --- /dev/null +++ b/kms/src/model/GenerateDataKeyWithoutPlaintextResult.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::Kms; +using namespace AlibabaCloud::Kms::Model; + +GenerateDataKeyWithoutPlaintextResult::GenerateDataKeyWithoutPlaintextResult() : + ServiceResult() +{} + +GenerateDataKeyWithoutPlaintextResult::GenerateDataKeyWithoutPlaintextResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GenerateDataKeyWithoutPlaintextResult::~GenerateDataKeyWithoutPlaintextResult() +{} + +void GenerateDataKeyWithoutPlaintextResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["CiphertextBlob"].isNull()) + ciphertextBlob_ = value["CiphertextBlob"].asString(); + if(!value["KeyId"].isNull()) + keyId_ = value["KeyId"].asString(); + if(!value["KeyVersionId"].isNull()) + keyVersionId_ = value["KeyVersionId"].asString(); + +} + +std::string GenerateDataKeyWithoutPlaintextResult::getCiphertextBlob()const +{ + return ciphertextBlob_; +} + +std::string GenerateDataKeyWithoutPlaintextResult::getKeyId()const +{ + return keyId_; +} + +std::string GenerateDataKeyWithoutPlaintextResult::getKeyVersionId()const +{ + return keyVersionId_; +} + diff --git a/kms/src/model/ListKeyVersionsRequest.cc b/kms/src/model/ListKeyVersionsRequest.cc new file mode 100644 index 000000000..fffff9041 --- /dev/null +++ b/kms/src/model/ListKeyVersionsRequest.cc @@ -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. + */ + +#include + +using AlibabaCloud::Kms::Model::ListKeyVersionsRequest; + +ListKeyVersionsRequest::ListKeyVersionsRequest() : + RpcServiceRequest("kms", "2016-01-20", "ListKeyVersions") +{} + +ListKeyVersionsRequest::~ListKeyVersionsRequest() +{} + +int ListKeyVersionsRequest::getPageSize()const +{ + return pageSize_; +} + +void ListKeyVersionsRequest::setPageSize(int pageSize) +{ + pageSize_ = pageSize; + setCoreParameter("PageSize", std::to_string(pageSize)); +} + +std::string ListKeyVersionsRequest::getKeyId()const +{ + return keyId_; +} + +void ListKeyVersionsRequest::setKeyId(const std::string& keyId) +{ + keyId_ = keyId; + setCoreParameter("KeyId", keyId); +} + +int ListKeyVersionsRequest::getPageNumber()const +{ + return pageNumber_; +} + +void ListKeyVersionsRequest::setPageNumber(int pageNumber) +{ + pageNumber_ = pageNumber; + setCoreParameter("PageNumber", std::to_string(pageNumber)); +} + diff --git a/kms/src/model/ListKeyVersionsResult.cc b/kms/src/model/ListKeyVersionsResult.cc new file mode 100644 index 000000000..711cdd917 --- /dev/null +++ b/kms/src/model/ListKeyVersionsResult.cc @@ -0,0 +1,82 @@ +/* + * 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::Kms; +using namespace AlibabaCloud::Kms::Model; + +ListKeyVersionsResult::ListKeyVersionsResult() : + ServiceResult() +{} + +ListKeyVersionsResult::ListKeyVersionsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListKeyVersionsResult::~ListKeyVersionsResult() +{} + +void ListKeyVersionsResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allKeyVersionsNode = value["KeyVersions"]["KeyVersion"]; + for (auto valueKeyVersionsKeyVersion : allKeyVersionsNode) + { + KeyVersion keyVersionsObject; + if(!valueKeyVersionsKeyVersion["KeyId"].isNull()) + keyVersionsObject.keyId = valueKeyVersionsKeyVersion["KeyId"].asString(); + if(!valueKeyVersionsKeyVersion["KeyVersionId"].isNull()) + keyVersionsObject.keyVersionId = valueKeyVersionsKeyVersion["KeyVersionId"].asString(); + if(!valueKeyVersionsKeyVersion["CreationDate"].isNull()) + keyVersionsObject.creationDate = valueKeyVersionsKeyVersion["CreationDate"].asString(); + keyVersions_.push_back(keyVersionsObject); + } + if(!value["TotalCount"].isNull()) + totalCount_ = std::stoi(value["TotalCount"].asString()); + if(!value["PageNumber"].isNull()) + pageNumber_ = std::stoi(value["PageNumber"].asString()); + if(!value["PageSize"].isNull()) + pageSize_ = std::stoi(value["PageSize"].asString()); + +} + +std::vector ListKeyVersionsResult::getKeyVersions()const +{ + return keyVersions_; +} + +int ListKeyVersionsResult::getTotalCount()const +{ + return totalCount_; +} + +int ListKeyVersionsResult::getPageSize()const +{ + return pageSize_; +} + +int ListKeyVersionsResult::getPageNumber()const +{ + return pageNumber_; +} + diff --git a/kms/src/model/UpdateKeyDescriptionRequest.cc b/kms/src/model/UpdateKeyDescriptionRequest.cc new file mode 100644 index 000000000..9cda16f84 --- /dev/null +++ b/kms/src/model/UpdateKeyDescriptionRequest.cc @@ -0,0 +1,49 @@ +/* + * 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::Kms::Model::UpdateKeyDescriptionRequest; + +UpdateKeyDescriptionRequest::UpdateKeyDescriptionRequest() : + RpcServiceRequest("kms", "2016-01-20", "UpdateKeyDescription") +{} + +UpdateKeyDescriptionRequest::~UpdateKeyDescriptionRequest() +{} + +std::string UpdateKeyDescriptionRequest::getKeyId()const +{ + return keyId_; +} + +void UpdateKeyDescriptionRequest::setKeyId(const std::string& keyId) +{ + keyId_ = keyId; + setCoreParameter("KeyId", keyId); +} + +std::string UpdateKeyDescriptionRequest::getDescription()const +{ + return description_; +} + +void UpdateKeyDescriptionRequest::setDescription(const std::string& description) +{ + description_ = description; + setCoreParameter("Description", description); +} + diff --git a/kms/src/model/UpdateKeyDescriptionResult.cc b/kms/src/model/UpdateKeyDescriptionResult.cc new file mode 100644 index 000000000..0b6c7fa3b --- /dev/null +++ b/kms/src/model/UpdateKeyDescriptionResult.cc @@ -0,0 +1,44 @@ +/* + * 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::Kms; +using namespace AlibabaCloud::Kms::Model; + +UpdateKeyDescriptionResult::UpdateKeyDescriptionResult() : + ServiceResult() +{} + +UpdateKeyDescriptionResult::UpdateKeyDescriptionResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +UpdateKeyDescriptionResult::~UpdateKeyDescriptionResult() +{} + +void UpdateKeyDescriptionResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} + diff --git a/kms/src/model/UpdateRotationPolicyRequest.cc b/kms/src/model/UpdateRotationPolicyRequest.cc new file mode 100644 index 000000000..3f50cc4d0 --- /dev/null +++ b/kms/src/model/UpdateRotationPolicyRequest.cc @@ -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. + */ + +#include + +using AlibabaCloud::Kms::Model::UpdateRotationPolicyRequest; + +UpdateRotationPolicyRequest::UpdateRotationPolicyRequest() : + RpcServiceRequest("kms", "2016-01-20", "UpdateRotationPolicy") +{} + +UpdateRotationPolicyRequest::~UpdateRotationPolicyRequest() +{} + +std::string UpdateRotationPolicyRequest::getKeyId()const +{ + return keyId_; +} + +void UpdateRotationPolicyRequest::setKeyId(const std::string& keyId) +{ + keyId_ = keyId; + setCoreParameter("KeyId", keyId); +} + +std::string UpdateRotationPolicyRequest::getRotationInterval()const +{ + return rotationInterval_; +} + +void UpdateRotationPolicyRequest::setRotationInterval(const std::string& rotationInterval) +{ + rotationInterval_ = rotationInterval; + setCoreParameter("RotationInterval", rotationInterval); +} + +bool UpdateRotationPolicyRequest::getEnableAutomaticRotation()const +{ + return enableAutomaticRotation_; +} + +void UpdateRotationPolicyRequest::setEnableAutomaticRotation(bool enableAutomaticRotation) +{ + enableAutomaticRotation_ = enableAutomaticRotation; + setCoreParameter("EnableAutomaticRotation", enableAutomaticRotation ? "true" : "false"); +} + diff --git a/kms/src/model/UpdateRotationPolicyResult.cc b/kms/src/model/UpdateRotationPolicyResult.cc new file mode 100644 index 000000000..fb0c5dbd3 --- /dev/null +++ b/kms/src/model/UpdateRotationPolicyResult.cc @@ -0,0 +1,44 @@ +/* + * 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::Kms; +using namespace AlibabaCloud::Kms::Model; + +UpdateRotationPolicyResult::UpdateRotationPolicyResult() : + ServiceResult() +{} + +UpdateRotationPolicyResult::UpdateRotationPolicyResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +UpdateRotationPolicyResult::~UpdateRotationPolicyResult() +{} + +void UpdateRotationPolicyResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} +