Support key deletion protection.

This commit is contained in:
sdk-team
2021-06-02 02:33:09 +00:00
parent 216a31ec31
commit 3a2b4a3b0a
39 changed files with 1111 additions and 34 deletions

View File

@@ -31,21 +31,21 @@ KmsClient::KmsClient(const Credentials &credentials, const ClientConfiguration &
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "kms-service");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "kms");
}
KmsClient::KmsClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "kms-service");
endpointProvider_ = std::make_shared<EndpointProvider>(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<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "kms-service");
endpointProvider_ = std::make_shared<EndpointProvider>(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<const AsyncCallerContext>& 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<std::packaged_task<RotateSecretOutcome()>>(
[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<const AsyncCallerContext>& 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<std::packaged_task<SetDeletionProtectionOutcome()>>(
[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<const AsyncCallerContext>& 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<std::packaged_task<UpdateSecretRotationPolicyOutcome()>>(
[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();

View File

@@ -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_;

View File

@@ -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);
}

View File

@@ -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_;
}

View File

@@ -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_;
}

View File

@@ -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();
}

View File

@@ -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_;

View File

@@ -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");
}

View File

@@ -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<std::string> GetSecretValueResult::getVersionStages()const
return versionStages_;
}
std::string GetSecretValueResult::getAutomaticRotation()const
{
return automaticRotation_;
}

View File

@@ -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::CertificateSummary> ListCertificatesResult::
return certificateSummaryList_;
}
std::vector<ListCertificatesResult::Certificate> ListCertificatesResult::getCertificates()const
{
return certificates_;
}
int ListCertificatesResult::getTotalSize()const
{
return totalSize_;

View File

@@ -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)
{

View File

@@ -0,0 +1,51 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/kms/model/RotateSecretRequest.h>
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);
}

View File

@@ -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 <alibabacloud/kms/model/RotateSecretResult.h>
#include <json/json.h>
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_;
}

View File

@@ -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 <alibabacloud/kms/model/SetDeletionProtectionRequest.h>
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);
}

View File

@@ -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 <alibabacloud/kms/model/SetDeletionProtectionResult.h>
#include <json/json.h>
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());
}

View File

@@ -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);
}

View File

@@ -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 <alibabacloud/kms/model/UpdateSecretRotationPolicyRequest.h>
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");
}

View File

@@ -0,0 +1,51 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/kms/model/UpdateSecretRotationPolicyResult.h>
#include <json/json.h>
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_;
}