com.amazonaws.services.secretsmanager.model.RotateSecretRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-secretsmanager Show documentation
/*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
package com.amazonaws.services.secretsmanager.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class RotateSecretRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The ARN or name of the secret to rotate.
*
*
* For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.
*
*/
private String secretId;
/**
*
* A unique identifier for the new version of the secret that helps ensure idempotency. Secrets Manager uses this
* value to prevent the accidental creation of duplicate versions if there are failures and retries during rotation.
* This value becomes the VersionId
of the new version.
*
*
* If you use the Amazon Web Services CLI or one of the Amazon Web Services SDK to call this operation, then you can
* leave this parameter empty. The CLI or SDK generates a random UUID for you and includes that in the request for
* this parameter. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service
* endpoint, then you must generate a ClientRequestToken
yourself for new versions and include that
* value in the request.
*
*
* You only need to specify this value if you implement your own retry logic and you want to ensure that Secrets
* Manager doesn't attempt to create a secret version twice. We recommend that you generate a UUID-type value to ensure uniqueness within
* the specified secret.
*
*/
private String clientRequestToken;
/**
*
* The ARN of the Lambda rotation function that can rotate the secret.
*
*/
private String rotationLambdaARN;
/**
*
* A structure that defines the rotation configuration for this secret.
*
*/
private RotationRulesType rotationRules;
/**
*
* The ARN or name of the secret to rotate.
*
*
* For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.
*
*
* @param secretId
* The ARN or name of the secret to rotate.
*
* For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.
*/
public void setSecretId(String secretId) {
this.secretId = secretId;
}
/**
*
* The ARN or name of the secret to rotate.
*
*
* For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.
*
*
* @return The ARN or name of the secret to rotate.
*
* For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.
*/
public String getSecretId() {
return this.secretId;
}
/**
*
* The ARN or name of the secret to rotate.
*
*
* For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.
*
*
* @param secretId
* The ARN or name of the secret to rotate.
*
* For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RotateSecretRequest withSecretId(String secretId) {
setSecretId(secretId);
return this;
}
/**
*
* A unique identifier for the new version of the secret that helps ensure idempotency. Secrets Manager uses this
* value to prevent the accidental creation of duplicate versions if there are failures and retries during rotation.
* This value becomes the VersionId
of the new version.
*
*
* If you use the Amazon Web Services CLI or one of the Amazon Web Services SDK to call this operation, then you can
* leave this parameter empty. The CLI or SDK generates a random UUID for you and includes that in the request for
* this parameter. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service
* endpoint, then you must generate a ClientRequestToken
yourself for new versions and include that
* value in the request.
*
*
* You only need to specify this value if you implement your own retry logic and you want to ensure that Secrets
* Manager doesn't attempt to create a secret version twice. We recommend that you generate a UUID-type value to ensure uniqueness within
* the specified secret.
*
*
* @param clientRequestToken
* A unique identifier for the new version of the secret that helps ensure idempotency. Secrets Manager uses
* this value to prevent the accidental creation of duplicate versions if there are failures and retries
* during rotation. This value becomes the VersionId
of the new version.
*
* If you use the Amazon Web Services CLI or one of the Amazon Web Services SDK to call this operation, then
* you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes that in
* the request for this parameter. If you don't use the SDK and instead generate a raw HTTP request to the
* Secrets Manager service endpoint, then you must generate a ClientRequestToken
yourself for
* new versions and include that value in the request.
*
*
* You only need to specify this value if you implement your own retry logic and you want to ensure that
* Secrets Manager doesn't attempt to create a secret version twice. We recommend that you generate a UUID-type value to ensure uniqueness
* within the specified secret.
*/
public void setClientRequestToken(String clientRequestToken) {
this.clientRequestToken = clientRequestToken;
}
/**
*
* A unique identifier for the new version of the secret that helps ensure idempotency. Secrets Manager uses this
* value to prevent the accidental creation of duplicate versions if there are failures and retries during rotation.
* This value becomes the VersionId
of the new version.
*
*
* If you use the Amazon Web Services CLI or one of the Amazon Web Services SDK to call this operation, then you can
* leave this parameter empty. The CLI or SDK generates a random UUID for you and includes that in the request for
* this parameter. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service
* endpoint, then you must generate a ClientRequestToken
yourself for new versions and include that
* value in the request.
*
*
* You only need to specify this value if you implement your own retry logic and you want to ensure that Secrets
* Manager doesn't attempt to create a secret version twice. We recommend that you generate a UUID-type value to ensure uniqueness within
* the specified secret.
*
*
* @return A unique identifier for the new version of the secret that helps ensure idempotency. Secrets Manager uses
* this value to prevent the accidental creation of duplicate versions if there are failures and retries
* during rotation. This value becomes the VersionId
of the new version.
*
* If you use the Amazon Web Services CLI or one of the Amazon Web Services SDK to call this operation, then
* you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes that in
* the request for this parameter. If you don't use the SDK and instead generate a raw HTTP request to the
* Secrets Manager service endpoint, then you must generate a ClientRequestToken
yourself for
* new versions and include that value in the request.
*
*
* You only need to specify this value if you implement your own retry logic and you want to ensure that
* Secrets Manager doesn't attempt to create a secret version twice. We recommend that you generate a UUID-type value to ensure uniqueness
* within the specified secret.
*/
public String getClientRequestToken() {
return this.clientRequestToken;
}
/**
*
* A unique identifier for the new version of the secret that helps ensure idempotency. Secrets Manager uses this
* value to prevent the accidental creation of duplicate versions if there are failures and retries during rotation.
* This value becomes the VersionId
of the new version.
*
*
* If you use the Amazon Web Services CLI or one of the Amazon Web Services SDK to call this operation, then you can
* leave this parameter empty. The CLI or SDK generates a random UUID for you and includes that in the request for
* this parameter. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service
* endpoint, then you must generate a ClientRequestToken
yourself for new versions and include that
* value in the request.
*
*
* You only need to specify this value if you implement your own retry logic and you want to ensure that Secrets
* Manager doesn't attempt to create a secret version twice. We recommend that you generate a UUID-type value to ensure uniqueness within
* the specified secret.
*
*
* @param clientRequestToken
* A unique identifier for the new version of the secret that helps ensure idempotency. Secrets Manager uses
* this value to prevent the accidental creation of duplicate versions if there are failures and retries
* during rotation. This value becomes the VersionId
of the new version.
*
* If you use the Amazon Web Services CLI or one of the Amazon Web Services SDK to call this operation, then
* you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes that in
* the request for this parameter. If you don't use the SDK and instead generate a raw HTTP request to the
* Secrets Manager service endpoint, then you must generate a ClientRequestToken
yourself for
* new versions and include that value in the request.
*
*
* You only need to specify this value if you implement your own retry logic and you want to ensure that
* Secrets Manager doesn't attempt to create a secret version twice. We recommend that you generate a UUID-type value to ensure uniqueness
* within the specified secret.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RotateSecretRequest withClientRequestToken(String clientRequestToken) {
setClientRequestToken(clientRequestToken);
return this;
}
/**
*
* The ARN of the Lambda rotation function that can rotate the secret.
*
*
* @param rotationLambdaARN
* The ARN of the Lambda rotation function that can rotate the secret.
*/
public void setRotationLambdaARN(String rotationLambdaARN) {
this.rotationLambdaARN = rotationLambdaARN;
}
/**
*
* The ARN of the Lambda rotation function that can rotate the secret.
*
*
* @return The ARN of the Lambda rotation function that can rotate the secret.
*/
public String getRotationLambdaARN() {
return this.rotationLambdaARN;
}
/**
*
* The ARN of the Lambda rotation function that can rotate the secret.
*
*
* @param rotationLambdaARN
* The ARN of the Lambda rotation function that can rotate the secret.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RotateSecretRequest withRotationLambdaARN(String rotationLambdaARN) {
setRotationLambdaARN(rotationLambdaARN);
return this;
}
/**
*
* A structure that defines the rotation configuration for this secret.
*
*
* @param rotationRules
* A structure that defines the rotation configuration for this secret.
*/
public void setRotationRules(RotationRulesType rotationRules) {
this.rotationRules = rotationRules;
}
/**
*
* A structure that defines the rotation configuration for this secret.
*
*
* @return A structure that defines the rotation configuration for this secret.
*/
public RotationRulesType getRotationRules() {
return this.rotationRules;
}
/**
*
* A structure that defines the rotation configuration for this secret.
*
*
* @param rotationRules
* A structure that defines the rotation configuration for this secret.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RotateSecretRequest withRotationRules(RotationRulesType rotationRules) {
setRotationRules(rotationRules);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getSecretId() != null)
sb.append("SecretId: ").append(getSecretId()).append(",");
if (getClientRequestToken() != null)
sb.append("ClientRequestToken: ").append(getClientRequestToken()).append(",");
if (getRotationLambdaARN() != null)
sb.append("RotationLambdaARN: ").append(getRotationLambdaARN()).append(",");
if (getRotationRules() != null)
sb.append("RotationRules: ").append(getRotationRules());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof RotateSecretRequest == false)
return false;
RotateSecretRequest other = (RotateSecretRequest) obj;
if (other.getSecretId() == null ^ this.getSecretId() == null)
return false;
if (other.getSecretId() != null && other.getSecretId().equals(this.getSecretId()) == false)
return false;
if (other.getClientRequestToken() == null ^ this.getClientRequestToken() == null)
return false;
if (other.getClientRequestToken() != null && other.getClientRequestToken().equals(this.getClientRequestToken()) == false)
return false;
if (other.getRotationLambdaARN() == null ^ this.getRotationLambdaARN() == null)
return false;
if (other.getRotationLambdaARN() != null && other.getRotationLambdaARN().equals(this.getRotationLambdaARN()) == false)
return false;
if (other.getRotationRules() == null ^ this.getRotationRules() == null)
return false;
if (other.getRotationRules() != null && other.getRotationRules().equals(this.getRotationRules()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getSecretId() == null) ? 0 : getSecretId().hashCode());
hashCode = prime * hashCode + ((getClientRequestToken() == null) ? 0 : getClientRequestToken().hashCode());
hashCode = prime * hashCode + ((getRotationLambdaARN() == null) ? 0 : getRotationLambdaARN().hashCode());
hashCode = prime * hashCode + ((getRotationRules() == null) ? 0 : getRotationRules().hashCode());
return hashCode;
}
@Override
public RotateSecretRequest clone() {
return (RotateSecretRequest) super.clone();
}
}