aws-sdk-secretsmanager 1.104.0

AWS SDK for AWS Secrets Manager
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct RotateSecretInput {
    /// <p>The ARN or name of the secret to rotate.</p>
    /// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN. See <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen">Finding a secret from a partial ARN</a>.</p>
    pub secret_id: ::std::option::Option<::std::string::String>,
    /// <p>A unique identifier for the new version of the secret. 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.</p><note>
    /// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes it as the value for this parameter in the request.</p>
    /// </note>
    /// <p>If you generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> and include it in the request.</p>
    /// <p>This value helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during a rotation. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness of your versions within the specified secret.</p>
    pub client_request_token: ::std::option::Option<::std::string::String>,
    /// <p>For secrets that use a Lambda rotation function to rotate, the ARN of the Lambda rotation function.</p>
    /// <p>For secrets that use <i>managed rotation</i>, omit this field. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_managed.html">Managed rotation</a> in the <i>Secrets Manager User Guide</i>.</p>
    pub rotation_lambda_arn: ::std::option::Option<::std::string::String>,
    /// <p>A structure that defines the rotation configuration for this secret.</p><important>
    /// <p>When changing an existing rotation schedule and setting <code>RotateImmediately</code> to <code>false</code>:</p>
    /// <ul>
    /// <li>
    /// <p>If using <code>AutomaticallyAfterDays</code> or a <code>ScheduleExpression</code> with <code>rate()</code>, the previously scheduled rotation might still occur.</p></li>
    /// <li>
    /// <p>To prevent unintended rotations, use a <code>ScheduleExpression</code> with <code>cron()</code> for granular control over rotation windows.</p></li>
    /// </ul>
    /// </important>
    pub rotation_rules: ::std::option::Option<crate::types::RotationRulesType>,
    /// <p>The metadata needed to successfully rotate a managed external secret. A list of key value pairs in JSON format specified by the partner. For more information about the required information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html">Using Secrets Manager managed external secrets</a></p>
    pub external_secret_rotation_metadata: ::std::option::Option<::std::vec::Vec<crate::types::ExternalSecretRotationMetadataItem>>,
    /// <p>The Amazon Resource Name (ARN) of the role that allows Secrets Manager to rotate a secret held by a third-party partner. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-security.html">Security and permissions</a>.</p>
    pub external_secret_rotation_role_arn: ::std::option::Option<::std::string::String>,
    /// <p>Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window. The rotation schedule is defined in <code>RotateSecretRequest$RotationRules</code>.</p>
    /// <p>The default for <code>RotateImmediately</code> is <code>true</code>. If you don't specify this value, Secrets Manager rotates the secret immediately.</p>
    /// <p>If you set <code>RotateImmediately</code> to <code>false</code>, Secrets Manager tests the rotation configuration by running the <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html"> <code>testSecret</code> step</a> of the Lambda rotation function. This test creates an <code>AWSPENDING</code> version of the secret and then removes it.</p>
    /// <p>When changing an existing rotation schedule and setting <code>RotateImmediately</code> to <code>false</code>:</p>
    /// <ul>
    /// <li>
    /// <p>If using <code>AutomaticallyAfterDays</code> or a <code>ScheduleExpression</code> with <code>rate()</code>, the previously scheduled rotation might still occur.</p></li>
    /// <li>
    /// <p>To prevent unintended rotations, use a <code>ScheduleExpression</code> with <code>cron()</code> for granular control over rotation windows.</p></li>
    /// </ul>
    /// <p>Rotation is an asynchronous process. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html">How rotation works</a>.</p>
    pub rotate_immediately: ::std::option::Option<bool>,
}
impl RotateSecretInput {
    /// <p>The ARN or name of the secret to rotate.</p>
    /// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN. See <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen">Finding a secret from a partial ARN</a>.</p>
    pub fn secret_id(&self) -> ::std::option::Option<&str> {
        self.secret_id.as_deref()
    }
    /// <p>A unique identifier for the new version of the secret. 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.</p><note>
    /// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes it as the value for this parameter in the request.</p>
    /// </note>
    /// <p>If you generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> and include it in the request.</p>
    /// <p>This value helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during a rotation. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness of your versions within the specified secret.</p>
    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
        self.client_request_token.as_deref()
    }
    /// <p>For secrets that use a Lambda rotation function to rotate, the ARN of the Lambda rotation function.</p>
    /// <p>For secrets that use <i>managed rotation</i>, omit this field. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_managed.html">Managed rotation</a> in the <i>Secrets Manager User Guide</i>.</p>
    pub fn rotation_lambda_arn(&self) -> ::std::option::Option<&str> {
        self.rotation_lambda_arn.as_deref()
    }
    /// <p>A structure that defines the rotation configuration for this secret.</p><important>
    /// <p>When changing an existing rotation schedule and setting <code>RotateImmediately</code> to <code>false</code>:</p>
    /// <ul>
    /// <li>
    /// <p>If using <code>AutomaticallyAfterDays</code> or a <code>ScheduleExpression</code> with <code>rate()</code>, the previously scheduled rotation might still occur.</p></li>
    /// <li>
    /// <p>To prevent unintended rotations, use a <code>ScheduleExpression</code> with <code>cron()</code> for granular control over rotation windows.</p></li>
    /// </ul>
    /// </important>
    pub fn rotation_rules(&self) -> ::std::option::Option<&crate::types::RotationRulesType> {
        self.rotation_rules.as_ref()
    }
    /// <p>The metadata needed to successfully rotate a managed external secret. A list of key value pairs in JSON format specified by the partner. For more information about the required information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html">Using Secrets Manager managed external secrets</a></p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.external_secret_rotation_metadata.is_none()`.
    pub fn external_secret_rotation_metadata(&self) -> &[crate::types::ExternalSecretRotationMetadataItem] {
        self.external_secret_rotation_metadata.as_deref().unwrap_or_default()
    }
    /// <p>The Amazon Resource Name (ARN) of the role that allows Secrets Manager to rotate a secret held by a third-party partner. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-security.html">Security and permissions</a>.</p>
    pub fn external_secret_rotation_role_arn(&self) -> ::std::option::Option<&str> {
        self.external_secret_rotation_role_arn.as_deref()
    }
    /// <p>Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window. The rotation schedule is defined in <code>RotateSecretRequest$RotationRules</code>.</p>
    /// <p>The default for <code>RotateImmediately</code> is <code>true</code>. If you don't specify this value, Secrets Manager rotates the secret immediately.</p>
    /// <p>If you set <code>RotateImmediately</code> to <code>false</code>, Secrets Manager tests the rotation configuration by running the <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html"> <code>testSecret</code> step</a> of the Lambda rotation function. This test creates an <code>AWSPENDING</code> version of the secret and then removes it.</p>
    /// <p>When changing an existing rotation schedule and setting <code>RotateImmediately</code> to <code>false</code>:</p>
    /// <ul>
    /// <li>
    /// <p>If using <code>AutomaticallyAfterDays</code> or a <code>ScheduleExpression</code> with <code>rate()</code>, the previously scheduled rotation might still occur.</p></li>
    /// <li>
    /// <p>To prevent unintended rotations, use a <code>ScheduleExpression</code> with <code>cron()</code> for granular control over rotation windows.</p></li>
    /// </ul>
    /// <p>Rotation is an asynchronous process. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html">How rotation works</a>.</p>
    pub fn rotate_immediately(&self) -> ::std::option::Option<bool> {
        self.rotate_immediately
    }
}
impl RotateSecretInput {
    /// Creates a new builder-style object to manufacture [`RotateSecretInput`](crate::operation::rotate_secret::RotateSecretInput).
    pub fn builder() -> crate::operation::rotate_secret::builders::RotateSecretInputBuilder {
        crate::operation::rotate_secret::builders::RotateSecretInputBuilder::default()
    }
}

/// A builder for [`RotateSecretInput`](crate::operation::rotate_secret::RotateSecretInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RotateSecretInputBuilder {
    pub(crate) secret_id: ::std::option::Option<::std::string::String>,
    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
    pub(crate) rotation_lambda_arn: ::std::option::Option<::std::string::String>,
    pub(crate) rotation_rules: ::std::option::Option<crate::types::RotationRulesType>,
    pub(crate) external_secret_rotation_metadata: ::std::option::Option<::std::vec::Vec<crate::types::ExternalSecretRotationMetadataItem>>,
    pub(crate) external_secret_rotation_role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) rotate_immediately: ::std::option::Option<bool>,
}
impl RotateSecretInputBuilder {
    /// <p>The ARN or name of the secret to rotate.</p>
    /// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN. See <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen">Finding a secret from a partial ARN</a>.</p>
    /// This field is required.
    pub fn secret_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.secret_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN or name of the secret to rotate.</p>
    /// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN. See <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen">Finding a secret from a partial ARN</a>.</p>
    pub fn set_secret_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.secret_id = input;
        self
    }
    /// <p>The ARN or name of the secret to rotate.</p>
    /// <p>For an ARN, we recommend that you specify a complete ARN rather than a partial ARN. See <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen">Finding a secret from a partial ARN</a>.</p>
    pub fn get_secret_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.secret_id
    }
    /// <p>A unique identifier for the new version of the secret. 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.</p><note>
    /// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes it as the value for this parameter in the request.</p>
    /// </note>
    /// <p>If you generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> and include it in the request.</p>
    /// <p>This value helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during a rotation. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness of your versions within the specified secret.</p>
    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_request_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique identifier for the new version of the secret. 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.</p><note>
    /// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes it as the value for this parameter in the request.</p>
    /// </note>
    /// <p>If you generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> and include it in the request.</p>
    /// <p>This value helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during a rotation. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness of your versions within the specified secret.</p>
    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_request_token = input;
        self
    }
    /// <p>A unique identifier for the new version of the secret. 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.</p><note>
    /// <p>If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes it as the value for this parameter in the request.</p>
    /// </note>
    /// <p>If you generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a <code>ClientRequestToken</code> and include it in the request.</p>
    /// <p>This value helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during a rotation. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type</a> value to ensure uniqueness of your versions within the specified secret.</p>
    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_request_token
    }
    /// <p>For secrets that use a Lambda rotation function to rotate, the ARN of the Lambda rotation function.</p>
    /// <p>For secrets that use <i>managed rotation</i>, omit this field. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_managed.html">Managed rotation</a> in the <i>Secrets Manager User Guide</i>.</p>
    pub fn rotation_lambda_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.rotation_lambda_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>For secrets that use a Lambda rotation function to rotate, the ARN of the Lambda rotation function.</p>
    /// <p>For secrets that use <i>managed rotation</i>, omit this field. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_managed.html">Managed rotation</a> in the <i>Secrets Manager User Guide</i>.</p>
    pub fn set_rotation_lambda_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.rotation_lambda_arn = input;
        self
    }
    /// <p>For secrets that use a Lambda rotation function to rotate, the ARN of the Lambda rotation function.</p>
    /// <p>For secrets that use <i>managed rotation</i>, omit this field. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_managed.html">Managed rotation</a> in the <i>Secrets Manager User Guide</i>.</p>
    pub fn get_rotation_lambda_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.rotation_lambda_arn
    }
    /// <p>A structure that defines the rotation configuration for this secret.</p><important>
    /// <p>When changing an existing rotation schedule and setting <code>RotateImmediately</code> to <code>false</code>:</p>
    /// <ul>
    /// <li>
    /// <p>If using <code>AutomaticallyAfterDays</code> or a <code>ScheduleExpression</code> with <code>rate()</code>, the previously scheduled rotation might still occur.</p></li>
    /// <li>
    /// <p>To prevent unintended rotations, use a <code>ScheduleExpression</code> with <code>cron()</code> for granular control over rotation windows.</p></li>
    /// </ul>
    /// </important>
    pub fn rotation_rules(mut self, input: crate::types::RotationRulesType) -> Self {
        self.rotation_rules = ::std::option::Option::Some(input);
        self
    }
    /// <p>A structure that defines the rotation configuration for this secret.</p><important>
    /// <p>When changing an existing rotation schedule and setting <code>RotateImmediately</code> to <code>false</code>:</p>
    /// <ul>
    /// <li>
    /// <p>If using <code>AutomaticallyAfterDays</code> or a <code>ScheduleExpression</code> with <code>rate()</code>, the previously scheduled rotation might still occur.</p></li>
    /// <li>
    /// <p>To prevent unintended rotations, use a <code>ScheduleExpression</code> with <code>cron()</code> for granular control over rotation windows.</p></li>
    /// </ul>
    /// </important>
    pub fn set_rotation_rules(mut self, input: ::std::option::Option<crate::types::RotationRulesType>) -> Self {
        self.rotation_rules = input;
        self
    }
    /// <p>A structure that defines the rotation configuration for this secret.</p><important>
    /// <p>When changing an existing rotation schedule and setting <code>RotateImmediately</code> to <code>false</code>:</p>
    /// <ul>
    /// <li>
    /// <p>If using <code>AutomaticallyAfterDays</code> or a <code>ScheduleExpression</code> with <code>rate()</code>, the previously scheduled rotation might still occur.</p></li>
    /// <li>
    /// <p>To prevent unintended rotations, use a <code>ScheduleExpression</code> with <code>cron()</code> for granular control over rotation windows.</p></li>
    /// </ul>
    /// </important>
    pub fn get_rotation_rules(&self) -> &::std::option::Option<crate::types::RotationRulesType> {
        &self.rotation_rules
    }
    /// Appends an item to `external_secret_rotation_metadata`.
    ///
    /// To override the contents of this collection use [`set_external_secret_rotation_metadata`](Self::set_external_secret_rotation_metadata).
    ///
    /// <p>The metadata needed to successfully rotate a managed external secret. A list of key value pairs in JSON format specified by the partner. For more information about the required information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html">Using Secrets Manager managed external secrets</a></p>
    pub fn external_secret_rotation_metadata(mut self, input: crate::types::ExternalSecretRotationMetadataItem) -> Self {
        let mut v = self.external_secret_rotation_metadata.unwrap_or_default();
        v.push(input);
        self.external_secret_rotation_metadata = ::std::option::Option::Some(v);
        self
    }
    /// <p>The metadata needed to successfully rotate a managed external secret. A list of key value pairs in JSON format specified by the partner. For more information about the required information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html">Using Secrets Manager managed external secrets</a></p>
    pub fn set_external_secret_rotation_metadata(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<crate::types::ExternalSecretRotationMetadataItem>>,
    ) -> Self {
        self.external_secret_rotation_metadata = input;
        self
    }
    /// <p>The metadata needed to successfully rotate a managed external secret. A list of key value pairs in JSON format specified by the partner. For more information about the required information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html">Using Secrets Manager managed external secrets</a></p>
    pub fn get_external_secret_rotation_metadata(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ExternalSecretRotationMetadataItem>> {
        &self.external_secret_rotation_metadata
    }
    /// <p>The Amazon Resource Name (ARN) of the role that allows Secrets Manager to rotate a secret held by a third-party partner. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-security.html">Security and permissions</a>.</p>
    pub fn external_secret_rotation_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.external_secret_rotation_role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the role that allows Secrets Manager to rotate a secret held by a third-party partner. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-security.html">Security and permissions</a>.</p>
    pub fn set_external_secret_rotation_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.external_secret_rotation_role_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the role that allows Secrets Manager to rotate a secret held by a third-party partner. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-security.html">Security and permissions</a>.</p>
    pub fn get_external_secret_rotation_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.external_secret_rotation_role_arn
    }
    /// <p>Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window. The rotation schedule is defined in <code>RotateSecretRequest$RotationRules</code>.</p>
    /// <p>The default for <code>RotateImmediately</code> is <code>true</code>. If you don't specify this value, Secrets Manager rotates the secret immediately.</p>
    /// <p>If you set <code>RotateImmediately</code> to <code>false</code>, Secrets Manager tests the rotation configuration by running the <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html"> <code>testSecret</code> step</a> of the Lambda rotation function. This test creates an <code>AWSPENDING</code> version of the secret and then removes it.</p>
    /// <p>When changing an existing rotation schedule and setting <code>RotateImmediately</code> to <code>false</code>:</p>
    /// <ul>
    /// <li>
    /// <p>If using <code>AutomaticallyAfterDays</code> or a <code>ScheduleExpression</code> with <code>rate()</code>, the previously scheduled rotation might still occur.</p></li>
    /// <li>
    /// <p>To prevent unintended rotations, use a <code>ScheduleExpression</code> with <code>cron()</code> for granular control over rotation windows.</p></li>
    /// </ul>
    /// <p>Rotation is an asynchronous process. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html">How rotation works</a>.</p>
    pub fn rotate_immediately(mut self, input: bool) -> Self {
        self.rotate_immediately = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window. The rotation schedule is defined in <code>RotateSecretRequest$RotationRules</code>.</p>
    /// <p>The default for <code>RotateImmediately</code> is <code>true</code>. If you don't specify this value, Secrets Manager rotates the secret immediately.</p>
    /// <p>If you set <code>RotateImmediately</code> to <code>false</code>, Secrets Manager tests the rotation configuration by running the <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html"> <code>testSecret</code> step</a> of the Lambda rotation function. This test creates an <code>AWSPENDING</code> version of the secret and then removes it.</p>
    /// <p>When changing an existing rotation schedule and setting <code>RotateImmediately</code> to <code>false</code>:</p>
    /// <ul>
    /// <li>
    /// <p>If using <code>AutomaticallyAfterDays</code> or a <code>ScheduleExpression</code> with <code>rate()</code>, the previously scheduled rotation might still occur.</p></li>
    /// <li>
    /// <p>To prevent unintended rotations, use a <code>ScheduleExpression</code> with <code>cron()</code> for granular control over rotation windows.</p></li>
    /// </ul>
    /// <p>Rotation is an asynchronous process. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html">How rotation works</a>.</p>
    pub fn set_rotate_immediately(mut self, input: ::std::option::Option<bool>) -> Self {
        self.rotate_immediately = input;
        self
    }
    /// <p>Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window. The rotation schedule is defined in <code>RotateSecretRequest$RotationRules</code>.</p>
    /// <p>The default for <code>RotateImmediately</code> is <code>true</code>. If you don't specify this value, Secrets Manager rotates the secret immediately.</p>
    /// <p>If you set <code>RotateImmediately</code> to <code>false</code>, Secrets Manager tests the rotation configuration by running the <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html"> <code>testSecret</code> step</a> of the Lambda rotation function. This test creates an <code>AWSPENDING</code> version of the secret and then removes it.</p>
    /// <p>When changing an existing rotation schedule and setting <code>RotateImmediately</code> to <code>false</code>:</p>
    /// <ul>
    /// <li>
    /// <p>If using <code>AutomaticallyAfterDays</code> or a <code>ScheduleExpression</code> with <code>rate()</code>, the previously scheduled rotation might still occur.</p></li>
    /// <li>
    /// <p>To prevent unintended rotations, use a <code>ScheduleExpression</code> with <code>cron()</code> for granular control over rotation windows.</p></li>
    /// </ul>
    /// <p>Rotation is an asynchronous process. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html">How rotation works</a>.</p>
    pub fn get_rotate_immediately(&self) -> &::std::option::Option<bool> {
        &self.rotate_immediately
    }
    /// Consumes the builder and constructs a [`RotateSecretInput`](crate::operation::rotate_secret::RotateSecretInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::rotate_secret::RotateSecretInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::rotate_secret::RotateSecretInput {
            secret_id: self.secret_id,
            client_request_token: self.client_request_token,
            rotation_lambda_arn: self.rotation_lambda_arn,
            rotation_rules: self.rotation_rules,
            external_secret_rotation_metadata: self.external_secret_rotation_metadata,
            external_secret_rotation_role_arn: self.external_secret_rotation_role_arn,
            rotate_immediately: self.rotate_immediately,
        })
    }
}