From 3a2b4a3b0a6fa4f6280bb1782b20f9cdcf228c30 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Wed, 2 Jun 2021 02:33:09 +0000 Subject: [PATCH] Support key deletion protection. --- CHANGELOG | 3 + VERSION | 2 +- kms/CMakeLists.txt | 12 ++ kms/include/alibabacloud/kms/KmsClient.h | 24 ++++ .../kms/model/CreateCertificateRequest.h | 6 + .../kms/model/CreateSecretRequest.h | 12 ++ .../kms/model/CreateSecretResult.h | 10 ++ .../kms/model/DescribeCertificateResult.h | 2 + .../kms/model/DescribeKeyResult.h | 2 + .../kms/model/DescribeSecretResult.h | 16 ++- .../kms/model/GetSecretValueRequest.h | 3 + .../kms/model/GetSecretValueResult.h | 12 ++ .../kms/model/ListCertificatesResult.h | 13 +- .../kms/model/ListSecretsResult.h | 1 + .../kms/model/RotateSecretRequest.h | 51 ++++++++ .../kms/model/RotateSecretResult.h | 55 +++++++++ .../kms/model/SetDeletionProtectionRequest.h | 54 +++++++++ .../kms/model/SetDeletionProtectionResult.h | 49 ++++++++ .../kms/model/UpdateSecretRequest.h | 3 + .../model/UpdateSecretRotationPolicyRequest.h | 54 +++++++++ .../model/UpdateSecretRotationPolicyResult.h | 51 ++++++++ kms/src/KmsClient.cc | 114 +++++++++++++++++- kms/src/model/CreateCertificateRequest.cc | 22 ++++ kms/src/model/CreateSecretRequest.cc | 44 +++++++ kms/src/model/CreateSecretResult.cc | 35 ++++++ kms/src/model/DescribeCertificateResult.cc | 11 +- kms/src/model/DescribeKeyResult.cc | 4 + kms/src/model/DescribeSecretResult.cc | 52 +++++++- kms/src/model/GetSecretValueRequest.cc | 11 ++ kms/src/model/GetSecretValueResult.cc | 42 +++++++ kms/src/model/ListCertificatesResult.cc | 27 ++--- kms/src/model/ListSecretsResult.cc | 2 + kms/src/model/RotateSecretRequest.cc | 51 ++++++++ kms/src/model/RotateSecretResult.cc | 65 ++++++++++ kms/src/model/SetDeletionProtectionRequest.cc | 62 ++++++++++ kms/src/model/SetDeletionProtectionResult.cc | 44 +++++++ kms/src/model/UpdateSecretRequest.cc | 11 ++ .../UpdateSecretRotationPolicyRequest.cc | 62 ++++++++++ .../model/UpdateSecretRotationPolicyResult.cc | 51 ++++++++ 39 files changed, 1111 insertions(+), 34 deletions(-) create mode 100644 kms/include/alibabacloud/kms/model/RotateSecretRequest.h create mode 100644 kms/include/alibabacloud/kms/model/RotateSecretResult.h create mode 100644 kms/include/alibabacloud/kms/model/SetDeletionProtectionRequest.h create mode 100644 kms/include/alibabacloud/kms/model/SetDeletionProtectionResult.h create mode 100644 kms/include/alibabacloud/kms/model/UpdateSecretRotationPolicyRequest.h create mode 100644 kms/include/alibabacloud/kms/model/UpdateSecretRotationPolicyResult.h create mode 100644 kms/src/model/RotateSecretRequest.cc create mode 100644 kms/src/model/RotateSecretResult.cc create mode 100644 kms/src/model/SetDeletionProtectionRequest.cc create mode 100644 kms/src/model/SetDeletionProtectionResult.cc create mode 100644 kms/src/model/UpdateSecretRotationPolicyRequest.cc create mode 100644 kms/src/model/UpdateSecretRotationPolicyResult.cc diff --git a/CHANGELOG b/CHANGELOG index 293bafa03..9b9f90ff2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2021-06-02 Version: 1.36.762 +- Support key deletion protection. + 2021-05-31 Version: 1.36.761 - Support upgrade. diff --git a/VERSION b/VERSION index 39a019006..1b76a9df9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.761 \ No newline at end of file +1.36.762 \ No newline at end of file diff --git a/kms/CMakeLists.txt b/kms/CMakeLists.txt index 61158fca7..037d96eb9 100644 --- a/kms/CMakeLists.txt +++ b/kms/CMakeLists.txt @@ -129,8 +129,12 @@ set(kms_public_header_model include/alibabacloud/kms/model/ReEncryptResult.h include/alibabacloud/kms/model/RestoreSecretRequest.h include/alibabacloud/kms/model/RestoreSecretResult.h + include/alibabacloud/kms/model/RotateSecretRequest.h + include/alibabacloud/kms/model/RotateSecretResult.h include/alibabacloud/kms/model/ScheduleKeyDeletionRequest.h include/alibabacloud/kms/model/ScheduleKeyDeletionResult.h + include/alibabacloud/kms/model/SetDeletionProtectionRequest.h + include/alibabacloud/kms/model/SetDeletionProtectionResult.h include/alibabacloud/kms/model/TagResourceRequest.h include/alibabacloud/kms/model/TagResourceResult.h include/alibabacloud/kms/model/UntagResourceRequest.h @@ -145,6 +149,8 @@ set(kms_public_header_model include/alibabacloud/kms/model/UpdateRotationPolicyResult.h include/alibabacloud/kms/model/UpdateSecretRequest.h include/alibabacloud/kms/model/UpdateSecretResult.h + include/alibabacloud/kms/model/UpdateSecretRotationPolicyRequest.h + include/alibabacloud/kms/model/UpdateSecretRotationPolicyResult.h include/alibabacloud/kms/model/UpdateSecretVersionStageRequest.h include/alibabacloud/kms/model/UpdateSecretVersionStageResult.h include/alibabacloud/kms/model/UploadCertificateRequest.h @@ -260,8 +266,12 @@ set(kms_src src/model/ReEncryptResult.cc src/model/RestoreSecretRequest.cc src/model/RestoreSecretResult.cc + src/model/RotateSecretRequest.cc + src/model/RotateSecretResult.cc src/model/ScheduleKeyDeletionRequest.cc src/model/ScheduleKeyDeletionResult.cc + src/model/SetDeletionProtectionRequest.cc + src/model/SetDeletionProtectionResult.cc src/model/TagResourceRequest.cc src/model/TagResourceResult.cc src/model/UntagResourceRequest.cc @@ -276,6 +286,8 @@ set(kms_src src/model/UpdateRotationPolicyResult.cc src/model/UpdateSecretRequest.cc src/model/UpdateSecretResult.cc + src/model/UpdateSecretRotationPolicyRequest.cc + src/model/UpdateSecretRotationPolicyResult.cc src/model/UpdateSecretVersionStageRequest.cc src/model/UpdateSecretVersionStageResult.cc src/model/UploadCertificateRequest.cc diff --git a/kms/include/alibabacloud/kms/KmsClient.h b/kms/include/alibabacloud/kms/KmsClient.h index ba9631211..6285a6701 100644 --- a/kms/include/alibabacloud/kms/KmsClient.h +++ b/kms/include/alibabacloud/kms/KmsClient.h @@ -130,8 +130,12 @@ #include "model/ReEncryptResult.h" #include "model/RestoreSecretRequest.h" #include "model/RestoreSecretResult.h" +#include "model/RotateSecretRequest.h" +#include "model/RotateSecretResult.h" #include "model/ScheduleKeyDeletionRequest.h" #include "model/ScheduleKeyDeletionResult.h" +#include "model/SetDeletionProtectionRequest.h" +#include "model/SetDeletionProtectionResult.h" #include "model/TagResourceRequest.h" #include "model/TagResourceResult.h" #include "model/UntagResourceRequest.h" @@ -146,6 +150,8 @@ #include "model/UpdateRotationPolicyResult.h" #include "model/UpdateSecretRequest.h" #include "model/UpdateSecretResult.h" +#include "model/UpdateSecretRotationPolicyRequest.h" +#include "model/UpdateSecretRotationPolicyResult.h" #include "model/UpdateSecretVersionStageRequest.h" #include "model/UpdateSecretVersionStageResult.h" #include "model/UploadCertificateRequest.h" @@ -321,9 +327,15 @@ namespace AlibabaCloud typedef Outcome RestoreSecretOutcome; typedef std::future RestoreSecretOutcomeCallable; typedef std::function&)> RestoreSecretAsyncHandler; + typedef Outcome RotateSecretOutcome; + typedef std::future RotateSecretOutcomeCallable; + typedef std::function&)> RotateSecretAsyncHandler; typedef Outcome ScheduleKeyDeletionOutcome; typedef std::future ScheduleKeyDeletionOutcomeCallable; typedef std::function&)> ScheduleKeyDeletionAsyncHandler; + typedef Outcome SetDeletionProtectionOutcome; + typedef std::future SetDeletionProtectionOutcomeCallable; + typedef std::function&)> SetDeletionProtectionAsyncHandler; typedef Outcome TagResourceOutcome; typedef std::future TagResourceOutcomeCallable; typedef std::function&)> TagResourceAsyncHandler; @@ -345,6 +357,9 @@ namespace AlibabaCloud typedef Outcome UpdateSecretOutcome; typedef std::future UpdateSecretOutcomeCallable; typedef std::function&)> UpdateSecretAsyncHandler; + typedef Outcome UpdateSecretRotationPolicyOutcome; + typedef std::future UpdateSecretRotationPolicyOutcomeCallable; + typedef std::function&)> UpdateSecretRotationPolicyAsyncHandler; typedef Outcome UpdateSecretVersionStageOutcome; typedef std::future UpdateSecretVersionStageOutcomeCallable; typedef std::function&)> UpdateSecretVersionStageAsyncHandler; @@ -518,9 +533,15 @@ namespace AlibabaCloud RestoreSecretOutcome restoreSecret(const Model::RestoreSecretRequest &request)const; void restoreSecretAsync(const Model::RestoreSecretRequest& request, const RestoreSecretAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; RestoreSecretOutcomeCallable restoreSecretCallable(const Model::RestoreSecretRequest& request) const; + RotateSecretOutcome rotateSecret(const Model::RotateSecretRequest &request)const; + void rotateSecretAsync(const Model::RotateSecretRequest& request, const RotateSecretAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RotateSecretOutcomeCallable rotateSecretCallable(const Model::RotateSecretRequest& request) const; ScheduleKeyDeletionOutcome scheduleKeyDeletion(const Model::ScheduleKeyDeletionRequest &request)const; void scheduleKeyDeletionAsync(const Model::ScheduleKeyDeletionRequest& request, const ScheduleKeyDeletionAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ScheduleKeyDeletionOutcomeCallable scheduleKeyDeletionCallable(const Model::ScheduleKeyDeletionRequest& request) const; + SetDeletionProtectionOutcome setDeletionProtection(const Model::SetDeletionProtectionRequest &request)const; + void setDeletionProtectionAsync(const Model::SetDeletionProtectionRequest& request, const SetDeletionProtectionAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + SetDeletionProtectionOutcomeCallable setDeletionProtectionCallable(const Model::SetDeletionProtectionRequest& request) const; TagResourceOutcome tagResource(const Model::TagResourceRequest &request)const; void tagResourceAsync(const Model::TagResourceRequest& request, const TagResourceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; TagResourceOutcomeCallable tagResourceCallable(const Model::TagResourceRequest& request) const; @@ -542,6 +563,9 @@ namespace AlibabaCloud UpdateSecretOutcome updateSecret(const Model::UpdateSecretRequest &request)const; void updateSecretAsync(const Model::UpdateSecretRequest& request, const UpdateSecretAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; UpdateSecretOutcomeCallable updateSecretCallable(const Model::UpdateSecretRequest& request) const; + UpdateSecretRotationPolicyOutcome updateSecretRotationPolicy(const Model::UpdateSecretRotationPolicyRequest &request)const; + void updateSecretRotationPolicyAsync(const Model::UpdateSecretRotationPolicyRequest& request, const UpdateSecretRotationPolicyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + UpdateSecretRotationPolicyOutcomeCallable updateSecretRotationPolicyCallable(const Model::UpdateSecretRotationPolicyRequest& request) const; UpdateSecretVersionStageOutcome updateSecretVersionStage(const Model::UpdateSecretVersionStageRequest &request)const; void updateSecretVersionStageAsync(const Model::UpdateSecretVersionStageRequest& request, const UpdateSecretVersionStageAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; UpdateSecretVersionStageOutcomeCallable updateSecretVersionStageCallable(const Model::UpdateSecretVersionStageRequest& request) const; diff --git a/kms/include/alibabacloud/kms/model/CreateCertificateRequest.h b/kms/include/alibabacloud/kms/model/CreateCertificateRequest.h index 5835fcb5a..beeee8e2f 100644 --- a/kms/include/alibabacloud/kms/model/CreateCertificateRequest.h +++ b/kms/include/alibabacloud/kms/model/CreateCertificateRequest.h @@ -37,6 +37,10 @@ namespace AlibabaCloud std::string getProtectionLevel()const; void setProtectionLevel(const std::string& protectionLevel); + bool getExportablePrivateKey()const; + void setExportablePrivateKey(bool exportablePrivateKey); + std::string getClientToken()const; + void setClientToken(const std::string& clientToken); std::string getSubject()const; void setSubject(const std::string& subject); std::map getSubjectAlternativeNames()const; @@ -46,6 +50,8 @@ namespace AlibabaCloud private: std::string protectionLevel_; + bool exportablePrivateKey_; + std::string clientToken_; std::string subject_; std::map subjectAlternativeNames_; std::string keySpec_; diff --git a/kms/include/alibabacloud/kms/model/CreateSecretRequest.h b/kms/include/alibabacloud/kms/model/CreateSecretRequest.h index 0323b8a75..833ddcdd6 100644 --- a/kms/include/alibabacloud/kms/model/CreateSecretRequest.h +++ b/kms/include/alibabacloud/kms/model/CreateSecretRequest.h @@ -35,29 +35,41 @@ namespace AlibabaCloud CreateSecretRequest(); ~CreateSecretRequest(); + std::string getSecretType()const; + void setSecretType(const std::string& secretType); std::string getVersionId()const; void setVersionId(const std::string& versionId); std::string getSecretData()const; void setSecretData(const std::string& secretData); std::string getDescription()const; void setDescription(const std::string& description); + std::string getRotationInterval()const; + void setRotationInterval(const std::string& rotationInterval); std::string getSecretName()const; void setSecretName(const std::string& secretName); + bool getEnableAutomaticRotation()const; + void setEnableAutomaticRotation(bool enableAutomaticRotation); std::string getEncryptionKeyId()const; void setEncryptionKeyId(const std::string& encryptionKeyId); std::string getSecretDataType()const; void setSecretDataType(const std::string& secretDataType); std::string getTags()const; void setTags(const std::string& tags); + std::string getExtendedConfig()const; + void setExtendedConfig(const std::string& extendedConfig); private: + std::string secretType_; std::string versionId_; std::string secretData_; std::string description_; + std::string rotationInterval_; std::string secretName_; + bool enableAutomaticRotation_; std::string encryptionKeyId_; std::string secretDataType_; std::string tags_; + std::string extendedConfig_; }; } diff --git a/kms/include/alibabacloud/kms/model/CreateSecretResult.h b/kms/include/alibabacloud/kms/model/CreateSecretResult.h index ba05c10f3..382428ea6 100644 --- a/kms/include/alibabacloud/kms/model/CreateSecretResult.h +++ b/kms/include/alibabacloud/kms/model/CreateSecretResult.h @@ -39,14 +39,24 @@ namespace AlibabaCloud ~CreateSecretResult(); std::string getVersionId()const; std::string getSecretName()const; + std::string getNextRotationDate()const; + std::string getSecretType()const; + std::string getRotationInterval()const; + std::string getExtendedConfig()const; std::string getArn()const; + std::string getAutomaticRotation()const; protected: void parse(const std::string &payload); private: std::string versionId_; std::string secretName_; + std::string nextRotationDate_; + std::string secretType_; + std::string rotationInterval_; + std::string extendedConfig_; std::string arn_; + std::string automaticRotation_; }; } diff --git a/kms/include/alibabacloud/kms/model/DescribeCertificateResult.h b/kms/include/alibabacloud/kms/model/DescribeCertificateResult.h index 01fb4b03e..28cbb20e3 100644 --- a/kms/include/alibabacloud/kms/model/DescribeCertificateResult.h +++ b/kms/include/alibabacloud/kms/model/DescribeCertificateResult.h @@ -54,6 +54,7 @@ namespace AlibabaCloud std::string getArn()const; std::string getNotBefore()const; std::string getTags()const; + bool getExportablePrivateKey()const; protected: void parse(const std::string &payload); @@ -75,6 +76,7 @@ namespace AlibabaCloud std::string arn_; std::string notBefore_; std::string tags_; + bool exportablePrivateKey_; }; } diff --git a/kms/include/alibabacloud/kms/model/DescribeKeyResult.h b/kms/include/alibabacloud/kms/model/DescribeKeyResult.h index 9601af1f6..6f5d12311 100644 --- a/kms/include/alibabacloud/kms/model/DescribeKeyResult.h +++ b/kms/include/alibabacloud/kms/model/DescribeKeyResult.h @@ -45,10 +45,12 @@ namespace AlibabaCloud std::string keyId; std::string primaryKeyVersion; std::string creator; + std::string deletionProtection; std::string deleteDate; std::string automaticRotation; std::string nextRotationDate; std::string materialExpireTime; + std::string deletionProtectionDescription; std::string arn; std::string keyState; }; diff --git a/kms/include/alibabacloud/kms/model/DescribeSecretResult.h b/kms/include/alibabacloud/kms/model/DescribeSecretResult.h index 259715a59..fc374e37f 100644 --- a/kms/include/alibabacloud/kms/model/DescribeSecretResult.h +++ b/kms/include/alibabacloud/kms/model/DescribeSecretResult.h @@ -42,11 +42,17 @@ namespace AlibabaCloud DescribeSecretResult(); explicit DescribeSecretResult(const std::string &payload); ~DescribeSecretResult(); - std::string getSecretName()const; std::string getDescription()const; + std::string getLastRotationDate()const; + std::string getRotationInterval()const; + std::string getSecretType()const; std::string getCreateTime()const; + std::string getAutomaticRotation()const; + std::string getSecretName()const; + std::string getNextRotationDate()const; std::string getUpdateTime()const; std::string getPlannedDeleteTime()const; + std::string getExtendedConfig()const; std::string getArn()const; std::vector getTags()const; std::string getEncryptionKeyId()const; @@ -54,11 +60,17 @@ namespace AlibabaCloud protected: void parse(const std::string &payload); private: - std::string secretName_; std::string description_; + std::string lastRotationDate_; + std::string rotationInterval_; + std::string secretType_; std::string createTime_; + std::string automaticRotation_; + std::string secretName_; + std::string nextRotationDate_; std::string updateTime_; std::string plannedDeleteTime_; + std::string extendedConfig_; std::string arn_; std::vector tags_; std::string encryptionKeyId_; diff --git a/kms/include/alibabacloud/kms/model/GetSecretValueRequest.h b/kms/include/alibabacloud/kms/model/GetSecretValueRequest.h index 222fa4168..55ebc7c4f 100644 --- a/kms/include/alibabacloud/kms/model/GetSecretValueRequest.h +++ b/kms/include/alibabacloud/kms/model/GetSecretValueRequest.h @@ -41,11 +41,14 @@ namespace AlibabaCloud void setVersionStage(const std::string& versionStage); std::string getSecretName()const; void setSecretName(const std::string& secretName); + bool getFetchExtendedConfig()const; + void setFetchExtendedConfig(bool fetchExtendedConfig); private: std::string versionId_; std::string versionStage_; std::string secretName_; + bool fetchExtendedConfig_; }; } diff --git a/kms/include/alibabacloud/kms/model/GetSecretValueResult.h b/kms/include/alibabacloud/kms/model/GetSecretValueResult.h index ecf7b4da7..2952c0749 100644 --- a/kms/include/alibabacloud/kms/model/GetSecretValueResult.h +++ b/kms/include/alibabacloud/kms/model/GetSecretValueResult.h @@ -39,20 +39,32 @@ namespace AlibabaCloud ~GetSecretValueResult(); std::string getSecretName()const; std::string getVersionId()const; + std::string getNextRotationDate()const; + std::string getRotationInterval()const; + std::string getLastRotationDate()const; + std::string getSecretType()const; std::string getCreateTime()const; std::string getSecretDataType()const; + std::string getExtendedConfig()const; std::string getSecretData()const; std::vector getVersionStages()const; + std::string getAutomaticRotation()const; protected: void parse(const std::string &payload); private: std::string secretName_; std::string versionId_; + std::string nextRotationDate_; + std::string rotationInterval_; + std::string lastRotationDate_; + std::string secretType_; std::string createTime_; std::string secretDataType_; + std::string extendedConfig_; std::string secretData_; std::vector versionStages_; + std::string automaticRotation_; }; } diff --git a/kms/include/alibabacloud/kms/model/ListCertificatesResult.h b/kms/include/alibabacloud/kms/model/ListCertificatesResult.h index faa689f3d..1eab76b41 100644 --- a/kms/include/alibabacloud/kms/model/ListCertificatesResult.h +++ b/kms/include/alibabacloud/kms/model/ListCertificatesResult.h @@ -34,14 +34,11 @@ namespace AlibabaCloud public: struct CertificateSummary { - std::string status; - std::string protectionLevel; - std::string issuer; std::string certificateId; - std::string keySpec; - std::string notBefore; - std::string notAfter; - std::string subject; + }; + struct Certificate + { + std::string certificateId; }; @@ -51,6 +48,7 @@ namespace AlibabaCloud int getPageSize()const; int getPageNumber()const; std::vector getCertificateSummaryList()const; + std::vector getCertificates()const; int getTotalSize()const; protected: @@ -59,6 +57,7 @@ namespace AlibabaCloud int pageSize_; int pageNumber_; std::vector certificateSummaryList_; + std::vector certificates_; int totalSize_; }; diff --git a/kms/include/alibabacloud/kms/model/ListSecretsResult.h b/kms/include/alibabacloud/kms/model/ListSecretsResult.h index 8577d661b..f03f37c5f 100644 --- a/kms/include/alibabacloud/kms/model/ListSecretsResult.h +++ b/kms/include/alibabacloud/kms/model/ListSecretsResult.h @@ -40,6 +40,7 @@ namespace AlibabaCloud std::string tagValue; }; std::string secretName; + std::string secretType; std::string createTime; std::string updateTime; std::string plannedDeleteTime; diff --git a/kms/include/alibabacloud/kms/model/RotateSecretRequest.h b/kms/include/alibabacloud/kms/model/RotateSecretRequest.h new file mode 100644 index 000000000..2b9453fc7 --- /dev/null +++ b/kms/include/alibabacloud/kms/model/RotateSecretRequest.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_ROTATESECRETREQUEST_H_ +#define ALIBABACLOUD_KMS_MODEL_ROTATESECRETREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT RotateSecretRequest : public RpcServiceRequest + { + + public: + RotateSecretRequest(); + ~RotateSecretRequest(); + + std::string getVersionId()const; + void setVersionId(const std::string& versionId); + std::string getSecretName()const; + void setSecretName(const std::string& secretName); + + private: + std::string versionId_; + std::string secretName_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_ROTATESECRETREQUEST_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/RotateSecretResult.h b/kms/include/alibabacloud/kms/model/RotateSecretResult.h new file mode 100644 index 000000000..71481597d --- /dev/null +++ b/kms/include/alibabacloud/kms/model/RotateSecretResult.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_ROTATESECRETRESULT_H_ +#define ALIBABACLOUD_KMS_MODEL_ROTATESECRETRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT RotateSecretResult : public ServiceResult + { + public: + + + RotateSecretResult(); + explicit RotateSecretResult(const std::string &payload); + ~RotateSecretResult(); + std::string getVersionId()const; + std::string getSecretName()const; + std::string getArn()const; + + protected: + void parse(const std::string &payload); + private: + std::string versionId_; + std::string secretName_; + std::string arn_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_ROTATESECRETRESULT_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/SetDeletionProtectionRequest.h b/kms/include/alibabacloud/kms/model/SetDeletionProtectionRequest.h new file mode 100644 index 000000000..b05b43e2d --- /dev/null +++ b/kms/include/alibabacloud/kms/model/SetDeletionProtectionRequest.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_SETDELETIONPROTECTIONREQUEST_H_ +#define ALIBABACLOUD_KMS_MODEL_SETDELETIONPROTECTIONREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT SetDeletionProtectionRequest : public RpcServiceRequest + { + + public: + SetDeletionProtectionRequest(); + ~SetDeletionProtectionRequest(); + + bool getEnableDeletionProtection()const; + void setEnableDeletionProtection(bool enableDeletionProtection); + std::string getProtectedResourceArn()const; + void setProtectedResourceArn(const std::string& protectedResourceArn); + std::string getDeletionProtectionDescription()const; + void setDeletionProtectionDescription(const std::string& deletionProtectionDescription); + + private: + bool enableDeletionProtection_; + std::string protectedResourceArn_; + std::string deletionProtectionDescription_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_SETDELETIONPROTECTIONREQUEST_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/SetDeletionProtectionResult.h b/kms/include/alibabacloud/kms/model/SetDeletionProtectionResult.h new file mode 100644 index 000000000..35d1efd25 --- /dev/null +++ b/kms/include/alibabacloud/kms/model/SetDeletionProtectionResult.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_SETDELETIONPROTECTIONRESULT_H_ +#define ALIBABACLOUD_KMS_MODEL_SETDELETIONPROTECTIONRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT SetDeletionProtectionResult : public ServiceResult + { + public: + + + SetDeletionProtectionResult(); + explicit SetDeletionProtectionResult(const std::string &payload); + ~SetDeletionProtectionResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_SETDELETIONPROTECTIONRESULT_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/UpdateSecretRequest.h b/kms/include/alibabacloud/kms/model/UpdateSecretRequest.h index c9f246cb2..e23e63b97 100644 --- a/kms/include/alibabacloud/kms/model/UpdateSecretRequest.h +++ b/kms/include/alibabacloud/kms/model/UpdateSecretRequest.h @@ -39,10 +39,13 @@ namespace AlibabaCloud void setDescription(const std::string& description); std::string getSecretName()const; void setSecretName(const std::string& secretName); + std::string getExtendedConfigCustomData()const; + void setExtendedConfigCustomData(const std::string& extendedConfigCustomData); private: std::string description_; std::string secretName_; + std::string extendedConfigCustomData_; }; } diff --git a/kms/include/alibabacloud/kms/model/UpdateSecretRotationPolicyRequest.h b/kms/include/alibabacloud/kms/model/UpdateSecretRotationPolicyRequest.h new file mode 100644 index 000000000..00c465c5b --- /dev/null +++ b/kms/include/alibabacloud/kms/model/UpdateSecretRotationPolicyRequest.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_UPDATESECRETROTATIONPOLICYREQUEST_H_ +#define ALIBABACLOUD_KMS_MODEL_UPDATESECRETROTATIONPOLICYREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT UpdateSecretRotationPolicyRequest : public RpcServiceRequest + { + + public: + UpdateSecretRotationPolicyRequest(); + ~UpdateSecretRotationPolicyRequest(); + + std::string getRotationInterval()const; + void setRotationInterval(const std::string& rotationInterval); + std::string getSecretName()const; + void setSecretName(const std::string& secretName); + bool getEnableAutomaticRotation()const; + void setEnableAutomaticRotation(bool enableAutomaticRotation); + + private: + std::string rotationInterval_; + std::string secretName_; + bool enableAutomaticRotation_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_UPDATESECRETROTATIONPOLICYREQUEST_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/UpdateSecretRotationPolicyResult.h b/kms/include/alibabacloud/kms/model/UpdateSecretRotationPolicyResult.h new file mode 100644 index 000000000..b6a37618f --- /dev/null +++ b/kms/include/alibabacloud/kms/model/UpdateSecretRotationPolicyResult.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_UPDATESECRETROTATIONPOLICYRESULT_H_ +#define ALIBABACLOUD_KMS_MODEL_UPDATESECRETROTATIONPOLICYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT UpdateSecretRotationPolicyResult : public ServiceResult + { + public: + + + UpdateSecretRotationPolicyResult(); + explicit UpdateSecretRotationPolicyResult(const std::string &payload); + ~UpdateSecretRotationPolicyResult(); + std::string getSecretName()const; + + protected: + void parse(const std::string &payload); + private: + std::string secretName_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_UPDATESECRETROTATIONPOLICYRESULT_H_ \ No newline at end of file diff --git a/kms/src/KmsClient.cc b/kms/src/KmsClient.cc index 25cbaef7e..7d1b0bad8 100644 --- a/kms/src/KmsClient.cc +++ b/kms/src/KmsClient.cc @@ -31,21 +31,21 @@ KmsClient::KmsClient(const Credentials &credentials, const ClientConfiguration & RpcServiceClient(SERVICE_NAME, std::make_shared(credentials), configuration) { auto locationClient = std::make_shared(credentials, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "kms-service"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "kms"); } KmsClient::KmsClient(const std::shared_ptr& credentialsProvider, const ClientConfiguration & configuration) : RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration) { auto locationClient = std::make_shared(credentialsProvider, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "kms-service"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "kms"); } KmsClient::KmsClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : RpcServiceClient(SERVICE_NAME, std::make_shared(accessKeyId, accessKeySecret), configuration) { auto locationClient = std::make_shared(accessKeyId, accessKeySecret, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "kms-service"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "kms"); } KmsClient::~KmsClient() @@ -1995,6 +1995,42 @@ KmsClient::RestoreSecretOutcomeCallable KmsClient::restoreSecretCallable(const R return task->get_future(); } +KmsClient::RotateSecretOutcome KmsClient::rotateSecret(const RotateSecretRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RotateSecretOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RotateSecretOutcome(RotateSecretResult(outcome.result())); + else + return RotateSecretOutcome(outcome.error()); +} + +void KmsClient::rotateSecretAsync(const RotateSecretRequest& request, const RotateSecretAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, rotateSecret(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +KmsClient::RotateSecretOutcomeCallable KmsClient::rotateSecretCallable(const RotateSecretRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->rotateSecret(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + KmsClient::ScheduleKeyDeletionOutcome KmsClient::scheduleKeyDeletion(const ScheduleKeyDeletionRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -2031,6 +2067,42 @@ KmsClient::ScheduleKeyDeletionOutcomeCallable KmsClient::scheduleKeyDeletionCall return task->get_future(); } +KmsClient::SetDeletionProtectionOutcome KmsClient::setDeletionProtection(const SetDeletionProtectionRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return SetDeletionProtectionOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return SetDeletionProtectionOutcome(SetDeletionProtectionResult(outcome.result())); + else + return SetDeletionProtectionOutcome(outcome.error()); +} + +void KmsClient::setDeletionProtectionAsync(const SetDeletionProtectionRequest& request, const SetDeletionProtectionAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, setDeletionProtection(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +KmsClient::SetDeletionProtectionOutcomeCallable KmsClient::setDeletionProtectionCallable(const SetDeletionProtectionRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->setDeletionProtection(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + KmsClient::TagResourceOutcome KmsClient::tagResource(const TagResourceRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -2283,6 +2355,42 @@ KmsClient::UpdateSecretOutcomeCallable KmsClient::updateSecretCallable(const Upd return task->get_future(); } +KmsClient::UpdateSecretRotationPolicyOutcome KmsClient::updateSecretRotationPolicy(const UpdateSecretRotationPolicyRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return UpdateSecretRotationPolicyOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return UpdateSecretRotationPolicyOutcome(UpdateSecretRotationPolicyResult(outcome.result())); + else + return UpdateSecretRotationPolicyOutcome(outcome.error()); +} + +void KmsClient::updateSecretRotationPolicyAsync(const UpdateSecretRotationPolicyRequest& request, const UpdateSecretRotationPolicyAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, updateSecretRotationPolicy(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +KmsClient::UpdateSecretRotationPolicyOutcomeCallable KmsClient::updateSecretRotationPolicyCallable(const UpdateSecretRotationPolicyRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->updateSecretRotationPolicy(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + KmsClient::UpdateSecretVersionStageOutcome KmsClient::updateSecretVersionStage(const UpdateSecretVersionStageRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/kms/src/model/CreateCertificateRequest.cc b/kms/src/model/CreateCertificateRequest.cc index c2f6d4365..f1d20716f 100644 --- a/kms/src/model/CreateCertificateRequest.cc +++ b/kms/src/model/CreateCertificateRequest.cc @@ -38,6 +38,28 @@ void CreateCertificateRequest::setProtectionLevel(const std::string& protectionL setParameter("ProtectionLevel", protectionLevel); } +bool CreateCertificateRequest::getExportablePrivateKey()const +{ + return exportablePrivateKey_; +} + +void CreateCertificateRequest::setExportablePrivateKey(bool exportablePrivateKey) +{ + exportablePrivateKey_ = exportablePrivateKey; + setParameter("ExportablePrivateKey", exportablePrivateKey ? "true" : "false"); +} + +std::string CreateCertificateRequest::getClientToken()const +{ + return clientToken_; +} + +void CreateCertificateRequest::setClientToken(const std::string& clientToken) +{ + clientToken_ = clientToken; + setParameter("ClientToken", clientToken); +} + std::string CreateCertificateRequest::getSubject()const { return subject_; diff --git a/kms/src/model/CreateSecretRequest.cc b/kms/src/model/CreateSecretRequest.cc index 8b722d3ec..ec1864c44 100644 --- a/kms/src/model/CreateSecretRequest.cc +++ b/kms/src/model/CreateSecretRequest.cc @@ -27,6 +27,17 @@ CreateSecretRequest::CreateSecretRequest() : CreateSecretRequest::~CreateSecretRequest() {} +std::string CreateSecretRequest::getSecretType()const +{ + return secretType_; +} + +void CreateSecretRequest::setSecretType(const std::string& secretType) +{ + secretType_ = secretType; + setParameter("SecretType", secretType); +} + std::string CreateSecretRequest::getVersionId()const { return versionId_; @@ -60,6 +71,17 @@ void CreateSecretRequest::setDescription(const std::string& description) setParameter("Description", description); } +std::string CreateSecretRequest::getRotationInterval()const +{ + return rotationInterval_; +} + +void CreateSecretRequest::setRotationInterval(const std::string& rotationInterval) +{ + rotationInterval_ = rotationInterval; + setParameter("RotationInterval", rotationInterval); +} + std::string CreateSecretRequest::getSecretName()const { return secretName_; @@ -71,6 +93,17 @@ void CreateSecretRequest::setSecretName(const std::string& secretName) setParameter("SecretName", secretName); } +bool CreateSecretRequest::getEnableAutomaticRotation()const +{ + return enableAutomaticRotation_; +} + +void CreateSecretRequest::setEnableAutomaticRotation(bool enableAutomaticRotation) +{ + enableAutomaticRotation_ = enableAutomaticRotation; + setParameter("EnableAutomaticRotation", enableAutomaticRotation ? "true" : "false"); +} + std::string CreateSecretRequest::getEncryptionKeyId()const { return encryptionKeyId_; @@ -104,3 +137,14 @@ void CreateSecretRequest::setTags(const std::string& tags) setParameter("Tags", tags); } +std::string CreateSecretRequest::getExtendedConfig()const +{ + return extendedConfig_; +} + +void CreateSecretRequest::setExtendedConfig(const std::string& extendedConfig) +{ + extendedConfig_ = extendedConfig; + setParameter("ExtendedConfig", extendedConfig); +} + diff --git a/kms/src/model/CreateSecretResult.cc b/kms/src/model/CreateSecretResult.cc index 85d898d3b..292b91bfd 100644 --- a/kms/src/model/CreateSecretResult.cc +++ b/kms/src/model/CreateSecretResult.cc @@ -45,6 +45,16 @@ void CreateSecretResult::parse(const std::string &payload) versionId_ = value["VersionId"].asString(); if(!value["SecretName"].isNull()) secretName_ = value["SecretName"].asString(); + if(!value["SecretType"].isNull()) + secretType_ = value["SecretType"].asString(); + if(!value["AutomaticRotation"].isNull()) + automaticRotation_ = value["AutomaticRotation"].asString(); + if(!value["RotationInterval"].isNull()) + rotationInterval_ = value["RotationInterval"].asString(); + if(!value["NextRotationDate"].isNull()) + nextRotationDate_ = value["NextRotationDate"].asString(); + if(!value["ExtendedConfig"].isNull()) + extendedConfig_ = value["ExtendedConfig"].asString(); } @@ -58,8 +68,33 @@ std::string CreateSecretResult::getSecretName()const return secretName_; } +std::string CreateSecretResult::getNextRotationDate()const +{ + return nextRotationDate_; +} + +std::string CreateSecretResult::getSecretType()const +{ + return secretType_; +} + +std::string CreateSecretResult::getRotationInterval()const +{ + return rotationInterval_; +} + +std::string CreateSecretResult::getExtendedConfig()const +{ + return extendedConfig_; +} + std::string CreateSecretResult::getArn()const { return arn_; } +std::string CreateSecretResult::getAutomaticRotation()const +{ + return automaticRotation_; +} + diff --git a/kms/src/model/DescribeCertificateResult.cc b/kms/src/model/DescribeCertificateResult.cc index fc92a3a60..326793282 100644 --- a/kms/src/model/DescribeCertificateResult.cc +++ b/kms/src/model/DescribeCertificateResult.cc @@ -48,8 +48,6 @@ void DescribeCertificateResult::parse(const std::string &payload) arn_ = value["Arn"].asString(); if(!value["KeySpec"].isNull()) keySpec_ = value["KeySpec"].asString(); - if(!value["ProtectionLevel"].isNull()) - protectionLevel_ = value["ProtectionLevel"].asString(); if(!value["Status"].isNull()) status_ = value["Status"].asString(); if(!value["CreatedAt"].isNull()) @@ -74,6 +72,10 @@ void DescribeCertificateResult::parse(const std::string &payload) subjectKeyIdentifier_ = value["SubjectKeyIdentifier"].asString(); if(!value["Tags"].isNull()) tags_ = value["Tags"].asString(); + if(!value["ExportablePrivateKey"].isNull()) + exportablePrivateKey_ = value["ExportablePrivateKey"].asString() == "true"; + if(!value["ProtectionLevel"].isNull()) + protectionLevel_ = value["ProtectionLevel"].asString(); } @@ -162,3 +164,8 @@ std::string DescribeCertificateResult::getTags()const return tags_; } +bool DescribeCertificateResult::getExportablePrivateKey()const +{ + return exportablePrivateKey_; +} + diff --git a/kms/src/model/DescribeKeyResult.cc b/kms/src/model/DescribeKeyResult.cc index 919fce610..4d1a9105d 100644 --- a/kms/src/model/DescribeKeyResult.cc +++ b/kms/src/model/DescribeKeyResult.cc @@ -74,6 +74,10 @@ void DescribeKeyResult::parse(const std::string &payload) keyMetadata_.nextRotationDate = keyMetadataNode["NextRotationDate"].asString(); if(!keyMetadataNode["KeySpec"].isNull()) keyMetadata_.keySpec = keyMetadataNode["KeySpec"].asString(); + if(!keyMetadataNode["DeletionProtection"].isNull()) + keyMetadata_.deletionProtection = keyMetadataNode["DeletionProtection"].asString(); + if(!keyMetadataNode["DeletionProtectionDescription"].isNull()) + keyMetadata_.deletionProtectionDescription = keyMetadataNode["DeletionProtectionDescription"].asString(); } diff --git a/kms/src/model/DescribeSecretResult.cc b/kms/src/model/DescribeSecretResult.cc index 2eb0b35f2..cb667482c 100644 --- a/kms/src/model/DescribeSecretResult.cc +++ b/kms/src/model/DescribeSecretResult.cc @@ -63,24 +63,61 @@ void DescribeSecretResult::parse(const std::string &payload) updateTime_ = value["UpdateTime"].asString(); if(!value["PlannedDeleteTime"].isNull()) plannedDeleteTime_ = value["PlannedDeleteTime"].asString(); + if(!value["AutomaticRotation"].isNull()) + automaticRotation_ = value["AutomaticRotation"].asString(); + if(!value["LastRotationDate"].isNull()) + lastRotationDate_ = value["LastRotationDate"].asString(); + if(!value["RotationInterval"].isNull()) + rotationInterval_ = value["RotationInterval"].asString(); + if(!value["NextRotationDate"].isNull()) + nextRotationDate_ = value["NextRotationDate"].asString(); + if(!value["ExtendedConfig"].isNull()) + extendedConfig_ = value["ExtendedConfig"].asString(); + if(!value["SecretType"].isNull()) + secretType_ = value["SecretType"].asString(); } -std::string DescribeSecretResult::getSecretName()const -{ - return secretName_; -} - std::string DescribeSecretResult::getDescription()const { return description_; } +std::string DescribeSecretResult::getLastRotationDate()const +{ + return lastRotationDate_; +} + +std::string DescribeSecretResult::getRotationInterval()const +{ + return rotationInterval_; +} + +std::string DescribeSecretResult::getSecretType()const +{ + return secretType_; +} + std::string DescribeSecretResult::getCreateTime()const { return createTime_; } +std::string DescribeSecretResult::getAutomaticRotation()const +{ + return automaticRotation_; +} + +std::string DescribeSecretResult::getSecretName()const +{ + return secretName_; +} + +std::string DescribeSecretResult::getNextRotationDate()const +{ + return nextRotationDate_; +} + std::string DescribeSecretResult::getUpdateTime()const { return updateTime_; @@ -91,6 +128,11 @@ std::string DescribeSecretResult::getPlannedDeleteTime()const return plannedDeleteTime_; } +std::string DescribeSecretResult::getExtendedConfig()const +{ + return extendedConfig_; +} + std::string DescribeSecretResult::getArn()const { return arn_; diff --git a/kms/src/model/GetSecretValueRequest.cc b/kms/src/model/GetSecretValueRequest.cc index 23b7a337f..52fa61ca8 100644 --- a/kms/src/model/GetSecretValueRequest.cc +++ b/kms/src/model/GetSecretValueRequest.cc @@ -60,3 +60,14 @@ void GetSecretValueRequest::setSecretName(const std::string& secretName) setParameter("SecretName", secretName); } +bool GetSecretValueRequest::getFetchExtendedConfig()const +{ + return fetchExtendedConfig_; +} + +void GetSecretValueRequest::setFetchExtendedConfig(bool fetchExtendedConfig) +{ + fetchExtendedConfig_ = fetchExtendedConfig; + setParameter("FetchExtendedConfig", fetchExtendedConfig ? "true" : "false"); +} + diff --git a/kms/src/model/GetSecretValueResult.cc b/kms/src/model/GetSecretValueResult.cc index 2c375a682..4ba5e89a1 100644 --- a/kms/src/model/GetSecretValueResult.cc +++ b/kms/src/model/GetSecretValueResult.cc @@ -52,6 +52,18 @@ void GetSecretValueResult::parse(const std::string &payload) secretData_ = value["SecretData"].asString(); if(!value["SecretDataType"].isNull()) secretDataType_ = value["SecretDataType"].asString(); + if(!value["AutomaticRotation"].isNull()) + automaticRotation_ = value["AutomaticRotation"].asString(); + if(!value["RotationInterval"].isNull()) + rotationInterval_ = value["RotationInterval"].asString(); + if(!value["NextRotationDate"].isNull()) + nextRotationDate_ = value["NextRotationDate"].asString(); + if(!value["ExtendedConfig"].isNull()) + extendedConfig_ = value["ExtendedConfig"].asString(); + if(!value["LastRotationDate"].isNull()) + lastRotationDate_ = value["LastRotationDate"].asString(); + if(!value["SecretType"].isNull()) + secretType_ = value["SecretType"].asString(); } @@ -65,6 +77,26 @@ std::string GetSecretValueResult::getVersionId()const return versionId_; } +std::string GetSecretValueResult::getNextRotationDate()const +{ + return nextRotationDate_; +} + +std::string GetSecretValueResult::getRotationInterval()const +{ + return rotationInterval_; +} + +std::string GetSecretValueResult::getLastRotationDate()const +{ + return lastRotationDate_; +} + +std::string GetSecretValueResult::getSecretType()const +{ + return secretType_; +} + std::string GetSecretValueResult::getCreateTime()const { return createTime_; @@ -75,6 +107,11 @@ std::string GetSecretValueResult::getSecretDataType()const return secretDataType_; } +std::string GetSecretValueResult::getExtendedConfig()const +{ + return extendedConfig_; +} + std::string GetSecretValueResult::getSecretData()const { return secretData_; @@ -85,3 +122,8 @@ std::vector GetSecretValueResult::getVersionStages()const return versionStages_; } +std::string GetSecretValueResult::getAutomaticRotation()const +{ + return automaticRotation_; +} + diff --git a/kms/src/model/ListCertificatesResult.cc b/kms/src/model/ListCertificatesResult.cc index 9776b741e..4de1a4a8a 100644 --- a/kms/src/model/ListCertificatesResult.cc +++ b/kms/src/model/ListCertificatesResult.cc @@ -45,22 +45,16 @@ void ListCertificatesResult::parse(const std::string &payload) CertificateSummary certificateSummaryListObject; if(!valueCertificateSummaryListCertificateSummary["CertificateId"].isNull()) certificateSummaryListObject.certificateId = valueCertificateSummaryListCertificateSummary["CertificateId"].asString(); - if(!valueCertificateSummaryListCertificateSummary["Subject"].isNull()) - certificateSummaryListObject.subject = valueCertificateSummaryListCertificateSummary["Subject"].asString(); - if(!valueCertificateSummaryListCertificateSummary["Issuer"].isNull()) - certificateSummaryListObject.issuer = valueCertificateSummaryListCertificateSummary["Issuer"].asString(); - if(!valueCertificateSummaryListCertificateSummary["KeySpec"].isNull()) - certificateSummaryListObject.keySpec = valueCertificateSummaryListCertificateSummary["KeySpec"].asString(); - if(!valueCertificateSummaryListCertificateSummary["ProtectionLevel"].isNull()) - certificateSummaryListObject.protectionLevel = valueCertificateSummaryListCertificateSummary["ProtectionLevel"].asString(); - if(!valueCertificateSummaryListCertificateSummary["NotBefore"].isNull()) - certificateSummaryListObject.notBefore = valueCertificateSummaryListCertificateSummary["NotBefore"].asString(); - if(!valueCertificateSummaryListCertificateSummary["NotAfter"].isNull()) - certificateSummaryListObject.notAfter = valueCertificateSummaryListCertificateSummary["NotAfter"].asString(); - if(!valueCertificateSummaryListCertificateSummary["Status"].isNull()) - certificateSummaryListObject.status = valueCertificateSummaryListCertificateSummary["Status"].asString(); certificateSummaryList_.push_back(certificateSummaryListObject); } + auto allCertificatesNode = value["Certificates"]["Certificate"]; + for (auto valueCertificatesCertificate : allCertificatesNode) + { + Certificate certificatesObject; + if(!valueCertificatesCertificate["CertificateId"].isNull()) + certificatesObject.certificateId = valueCertificatesCertificate["CertificateId"].asString(); + certificates_.push_back(certificatesObject); + } if(!value["TotalSize"].isNull()) totalSize_ = std::stoi(value["TotalSize"].asString()); if(!value["PageNumber"].isNull()) @@ -85,6 +79,11 @@ std::vector ListCertificatesResult:: return certificateSummaryList_; } +std::vector ListCertificatesResult::getCertificates()const +{ + return certificates_; +} + int ListCertificatesResult::getTotalSize()const { return totalSize_; diff --git a/kms/src/model/ListSecretsResult.cc b/kms/src/model/ListSecretsResult.cc index 54d49b952..87737866d 100644 --- a/kms/src/model/ListSecretsResult.cc +++ b/kms/src/model/ListSecretsResult.cc @@ -51,6 +51,8 @@ void ListSecretsResult::parse(const std::string &payload) secretListObject.secretName = valueSecretListSecret["SecretName"].asString(); if(!valueSecretListSecret["UpdateTime"].isNull()) secretListObject.updateTime = valueSecretListSecret["UpdateTime"].asString(); + if(!valueSecretListSecret["SecretType"].isNull()) + secretListObject.secretType = valueSecretListSecret["SecretType"].asString(); auto allTagsNode = valueSecretListSecret["Tags"]["Tag"]; for (auto valueSecretListSecretTagsTag : allTagsNode) { diff --git a/kms/src/model/RotateSecretRequest.cc b/kms/src/model/RotateSecretRequest.cc new file mode 100644 index 000000000..078753ef2 --- /dev/null +++ b/kms/src/model/RotateSecretRequest.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Kms::Model::RotateSecretRequest; + +RotateSecretRequest::RotateSecretRequest() : + RpcServiceRequest("kms", "2016-01-20", "RotateSecret") +{ + setMethod(HttpRequest::Method::Post); +} + +RotateSecretRequest::~RotateSecretRequest() +{} + +std::string RotateSecretRequest::getVersionId()const +{ + return versionId_; +} + +void RotateSecretRequest::setVersionId(const std::string& versionId) +{ + versionId_ = versionId; + setParameter("VersionId", versionId); +} + +std::string RotateSecretRequest::getSecretName()const +{ + return secretName_; +} + +void RotateSecretRequest::setSecretName(const std::string& secretName) +{ + secretName_ = secretName; + setParameter("SecretName", secretName); +} + diff --git a/kms/src/model/RotateSecretResult.cc b/kms/src/model/RotateSecretResult.cc new file mode 100644 index 000000000..a235abd11 --- /dev/null +++ b/kms/src/model/RotateSecretResult.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; + +RotateSecretResult::RotateSecretResult() : + ServiceResult() +{} + +RotateSecretResult::RotateSecretResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RotateSecretResult::~RotateSecretResult() +{} + +void RotateSecretResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["Arn"].isNull()) + arn_ = value["Arn"].asString(); + if(!value["VersionId"].isNull()) + versionId_ = value["VersionId"].asString(); + if(!value["SecretName"].isNull()) + secretName_ = value["SecretName"].asString(); + +} + +std::string RotateSecretResult::getVersionId()const +{ + return versionId_; +} + +std::string RotateSecretResult::getSecretName()const +{ + return secretName_; +} + +std::string RotateSecretResult::getArn()const +{ + return arn_; +} + diff --git a/kms/src/model/SetDeletionProtectionRequest.cc b/kms/src/model/SetDeletionProtectionRequest.cc new file mode 100644 index 000000000..7bdd3b012 --- /dev/null +++ b/kms/src/model/SetDeletionProtectionRequest.cc @@ -0,0 +1,62 @@ +/* + * 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::SetDeletionProtectionRequest; + +SetDeletionProtectionRequest::SetDeletionProtectionRequest() : + RpcServiceRequest("kms", "2016-01-20", "SetDeletionProtection") +{ + setMethod(HttpRequest::Method::Post); +} + +SetDeletionProtectionRequest::~SetDeletionProtectionRequest() +{} + +bool SetDeletionProtectionRequest::getEnableDeletionProtection()const +{ + return enableDeletionProtection_; +} + +void SetDeletionProtectionRequest::setEnableDeletionProtection(bool enableDeletionProtection) +{ + enableDeletionProtection_ = enableDeletionProtection; + setParameter("EnableDeletionProtection", enableDeletionProtection ? "true" : "false"); +} + +std::string SetDeletionProtectionRequest::getProtectedResourceArn()const +{ + return protectedResourceArn_; +} + +void SetDeletionProtectionRequest::setProtectedResourceArn(const std::string& protectedResourceArn) +{ + protectedResourceArn_ = protectedResourceArn; + setParameter("ProtectedResourceArn", protectedResourceArn); +} + +std::string SetDeletionProtectionRequest::getDeletionProtectionDescription()const +{ + return deletionProtectionDescription_; +} + +void SetDeletionProtectionRequest::setDeletionProtectionDescription(const std::string& deletionProtectionDescription) +{ + deletionProtectionDescription_ = deletionProtectionDescription; + setParameter("DeletionProtectionDescription", deletionProtectionDescription); +} + diff --git a/kms/src/model/SetDeletionProtectionResult.cc b/kms/src/model/SetDeletionProtectionResult.cc new file mode 100644 index 000000000..fec561195 --- /dev/null +++ b/kms/src/model/SetDeletionProtectionResult.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; + +SetDeletionProtectionResult::SetDeletionProtectionResult() : + ServiceResult() +{} + +SetDeletionProtectionResult::SetDeletionProtectionResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +SetDeletionProtectionResult::~SetDeletionProtectionResult() +{} + +void SetDeletionProtectionResult::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/UpdateSecretRequest.cc b/kms/src/model/UpdateSecretRequest.cc index aa6043982..6631a7d65 100644 --- a/kms/src/model/UpdateSecretRequest.cc +++ b/kms/src/model/UpdateSecretRequest.cc @@ -49,3 +49,14 @@ void UpdateSecretRequest::setSecretName(const std::string& secretName) setParameter("SecretName", secretName); } +std::string UpdateSecretRequest::getExtendedConfigCustomData()const +{ + return extendedConfigCustomData_; +} + +void UpdateSecretRequest::setExtendedConfigCustomData(const std::string& extendedConfigCustomData) +{ + extendedConfigCustomData_ = extendedConfigCustomData; + setParameter("ExtendedConfigCustomData", extendedConfigCustomData); +} + diff --git a/kms/src/model/UpdateSecretRotationPolicyRequest.cc b/kms/src/model/UpdateSecretRotationPolicyRequest.cc new file mode 100644 index 000000000..6691ea110 --- /dev/null +++ b/kms/src/model/UpdateSecretRotationPolicyRequest.cc @@ -0,0 +1,62 @@ +/* + * 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::UpdateSecretRotationPolicyRequest; + +UpdateSecretRotationPolicyRequest::UpdateSecretRotationPolicyRequest() : + RpcServiceRequest("kms", "2016-01-20", "UpdateSecretRotationPolicy") +{ + setMethod(HttpRequest::Method::Post); +} + +UpdateSecretRotationPolicyRequest::~UpdateSecretRotationPolicyRequest() +{} + +std::string UpdateSecretRotationPolicyRequest::getRotationInterval()const +{ + return rotationInterval_; +} + +void UpdateSecretRotationPolicyRequest::setRotationInterval(const std::string& rotationInterval) +{ + rotationInterval_ = rotationInterval; + setParameter("RotationInterval", rotationInterval); +} + +std::string UpdateSecretRotationPolicyRequest::getSecretName()const +{ + return secretName_; +} + +void UpdateSecretRotationPolicyRequest::setSecretName(const std::string& secretName) +{ + secretName_ = secretName; + setParameter("SecretName", secretName); +} + +bool UpdateSecretRotationPolicyRequest::getEnableAutomaticRotation()const +{ + return enableAutomaticRotation_; +} + +void UpdateSecretRotationPolicyRequest::setEnableAutomaticRotation(bool enableAutomaticRotation) +{ + enableAutomaticRotation_ = enableAutomaticRotation; + setParameter("EnableAutomaticRotation", enableAutomaticRotation ? "true" : "false"); +} + diff --git a/kms/src/model/UpdateSecretRotationPolicyResult.cc b/kms/src/model/UpdateSecretRotationPolicyResult.cc new file mode 100644 index 000000000..27d2e6d07 --- /dev/null +++ b/kms/src/model/UpdateSecretRotationPolicyResult.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Kms; +using namespace AlibabaCloud::Kms::Model; + +UpdateSecretRotationPolicyResult::UpdateSecretRotationPolicyResult() : + ServiceResult() +{} + +UpdateSecretRotationPolicyResult::UpdateSecretRotationPolicyResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +UpdateSecretRotationPolicyResult::~UpdateSecretRotationPolicyResult() +{} + +void UpdateSecretRotationPolicyResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["SecretName"].isNull()) + secretName_ = value["SecretName"].asString(); + +} + +std::string UpdateSecretRotationPolicyResult::getSecretName()const +{ + return secretName_; +} +