aws-sdk-redshift 1.106.0

AWS SDK for Amazon Redshift
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p></p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct EnableSnapshotCopyInput {
    /// <p>The unique identifier of the source cluster to copy snapshots from.</p>
    /// <p>Constraints: Must be the valid name of an existing cluster that does not already have cross-region snapshot copy enabled.</p>
    pub cluster_identifier: ::std::option::Option<::std::string::String>,
    /// <p>The destination Amazon Web Services Region that you want to copy snapshots to.</p>
    /// <p>Constraints: Must be the name of a valid Amazon Web Services Region. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#redshift_region">Regions and Endpoints</a> in the Amazon Web Services General Reference.</p>
    pub destination_region: ::std::option::Option<::std::string::String>,
    /// <p>The number of days to retain automated snapshots in the destination region after they are copied from the source region.</p>
    /// <p>Default: 7.</p>
    /// <p>Constraints: Must be at least 1 and no more than 35.</p>
    pub retention_period: ::std::option::Option<i32>,
    /// <p>The name of the snapshot copy grant to use when snapshots of an Amazon Web Services KMS-encrypted cluster are copied to the destination region.</p>
    pub snapshot_copy_grant_name: ::std::option::Option<::std::string::String>,
    /// <p>The number of days to retain newly copied snapshots in the destination Amazon Web Services Region after they are copied from the source Amazon Web Services Region. If the value is -1, the manual snapshot is retained indefinitely.</p>
    /// <p>The value must be either -1 or an integer between 1 and 3,653.</p>
    pub manual_snapshot_retention_period: ::std::option::Option<i32>,
}
impl EnableSnapshotCopyInput {
    /// <p>The unique identifier of the source cluster to copy snapshots from.</p>
    /// <p>Constraints: Must be the valid name of an existing cluster that does not already have cross-region snapshot copy enabled.</p>
    pub fn cluster_identifier(&self) -> ::std::option::Option<&str> {
        self.cluster_identifier.as_deref()
    }
    /// <p>The destination Amazon Web Services Region that you want to copy snapshots to.</p>
    /// <p>Constraints: Must be the name of a valid Amazon Web Services Region. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#redshift_region">Regions and Endpoints</a> in the Amazon Web Services General Reference.</p>
    pub fn destination_region(&self) -> ::std::option::Option<&str> {
        self.destination_region.as_deref()
    }
    /// <p>The number of days to retain automated snapshots in the destination region after they are copied from the source region.</p>
    /// <p>Default: 7.</p>
    /// <p>Constraints: Must be at least 1 and no more than 35.</p>
    pub fn retention_period(&self) -> ::std::option::Option<i32> {
        self.retention_period
    }
    /// <p>The name of the snapshot copy grant to use when snapshots of an Amazon Web Services KMS-encrypted cluster are copied to the destination region.</p>
    pub fn snapshot_copy_grant_name(&self) -> ::std::option::Option<&str> {
        self.snapshot_copy_grant_name.as_deref()
    }
    /// <p>The number of days to retain newly copied snapshots in the destination Amazon Web Services Region after they are copied from the source Amazon Web Services Region. If the value is -1, the manual snapshot is retained indefinitely.</p>
    /// <p>The value must be either -1 or an integer between 1 and 3,653.</p>
    pub fn manual_snapshot_retention_period(&self) -> ::std::option::Option<i32> {
        self.manual_snapshot_retention_period
    }
}
impl EnableSnapshotCopyInput {
    /// Creates a new builder-style object to manufacture [`EnableSnapshotCopyInput`](crate::operation::enable_snapshot_copy::EnableSnapshotCopyInput).
    pub fn builder() -> crate::operation::enable_snapshot_copy::builders::EnableSnapshotCopyInputBuilder {
        crate::operation::enable_snapshot_copy::builders::EnableSnapshotCopyInputBuilder::default()
    }
}

/// A builder for [`EnableSnapshotCopyInput`](crate::operation::enable_snapshot_copy::EnableSnapshotCopyInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EnableSnapshotCopyInputBuilder {
    pub(crate) cluster_identifier: ::std::option::Option<::std::string::String>,
    pub(crate) destination_region: ::std::option::Option<::std::string::String>,
    pub(crate) retention_period: ::std::option::Option<i32>,
    pub(crate) snapshot_copy_grant_name: ::std::option::Option<::std::string::String>,
    pub(crate) manual_snapshot_retention_period: ::std::option::Option<i32>,
}
impl EnableSnapshotCopyInputBuilder {
    /// <p>The unique identifier of the source cluster to copy snapshots from.</p>
    /// <p>Constraints: Must be the valid name of an existing cluster that does not already have cross-region snapshot copy enabled.</p>
    /// This field is required.
    pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.cluster_identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the source cluster to copy snapshots from.</p>
    /// <p>Constraints: Must be the valid name of an existing cluster that does not already have cross-region snapshot copy enabled.</p>
    pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.cluster_identifier = input;
        self
    }
    /// <p>The unique identifier of the source cluster to copy snapshots from.</p>
    /// <p>Constraints: Must be the valid name of an existing cluster that does not already have cross-region snapshot copy enabled.</p>
    pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.cluster_identifier
    }
    /// <p>The destination Amazon Web Services Region that you want to copy snapshots to.</p>
    /// <p>Constraints: Must be the name of a valid Amazon Web Services Region. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#redshift_region">Regions and Endpoints</a> in the Amazon Web Services General Reference.</p>
    /// This field is required.
    pub fn destination_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.destination_region = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The destination Amazon Web Services Region that you want to copy snapshots to.</p>
    /// <p>Constraints: Must be the name of a valid Amazon Web Services Region. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#redshift_region">Regions and Endpoints</a> in the Amazon Web Services General Reference.</p>
    pub fn set_destination_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.destination_region = input;
        self
    }
    /// <p>The destination Amazon Web Services Region that you want to copy snapshots to.</p>
    /// <p>Constraints: Must be the name of a valid Amazon Web Services Region. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#redshift_region">Regions and Endpoints</a> in the Amazon Web Services General Reference.</p>
    pub fn get_destination_region(&self) -> &::std::option::Option<::std::string::String> {
        &self.destination_region
    }
    /// <p>The number of days to retain automated snapshots in the destination region after they are copied from the source region.</p>
    /// <p>Default: 7.</p>
    /// <p>Constraints: Must be at least 1 and no more than 35.</p>
    pub fn retention_period(mut self, input: i32) -> Self {
        self.retention_period = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of days to retain automated snapshots in the destination region after they are copied from the source region.</p>
    /// <p>Default: 7.</p>
    /// <p>Constraints: Must be at least 1 and no more than 35.</p>
    pub fn set_retention_period(mut self, input: ::std::option::Option<i32>) -> Self {
        self.retention_period = input;
        self
    }
    /// <p>The number of days to retain automated snapshots in the destination region after they are copied from the source region.</p>
    /// <p>Default: 7.</p>
    /// <p>Constraints: Must be at least 1 and no more than 35.</p>
    pub fn get_retention_period(&self) -> &::std::option::Option<i32> {
        &self.retention_period
    }
    /// <p>The name of the snapshot copy grant to use when snapshots of an Amazon Web Services KMS-encrypted cluster are copied to the destination region.</p>
    pub fn snapshot_copy_grant_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.snapshot_copy_grant_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the snapshot copy grant to use when snapshots of an Amazon Web Services KMS-encrypted cluster are copied to the destination region.</p>
    pub fn set_snapshot_copy_grant_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.snapshot_copy_grant_name = input;
        self
    }
    /// <p>The name of the snapshot copy grant to use when snapshots of an Amazon Web Services KMS-encrypted cluster are copied to the destination region.</p>
    pub fn get_snapshot_copy_grant_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.snapshot_copy_grant_name
    }
    /// <p>The number of days to retain newly copied snapshots in the destination Amazon Web Services Region after they are copied from the source Amazon Web Services Region. If the value is -1, the manual snapshot is retained indefinitely.</p>
    /// <p>The value must be either -1 or an integer between 1 and 3,653.</p>
    pub fn manual_snapshot_retention_period(mut self, input: i32) -> Self {
        self.manual_snapshot_retention_period = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of days to retain newly copied snapshots in the destination Amazon Web Services Region after they are copied from the source Amazon Web Services Region. If the value is -1, the manual snapshot is retained indefinitely.</p>
    /// <p>The value must be either -1 or an integer between 1 and 3,653.</p>
    pub fn set_manual_snapshot_retention_period(mut self, input: ::std::option::Option<i32>) -> Self {
        self.manual_snapshot_retention_period = input;
        self
    }
    /// <p>The number of days to retain newly copied snapshots in the destination Amazon Web Services Region after they are copied from the source Amazon Web Services Region. If the value is -1, the manual snapshot is retained indefinitely.</p>
    /// <p>The value must be either -1 or an integer between 1 and 3,653.</p>
    pub fn get_manual_snapshot_retention_period(&self) -> &::std::option::Option<i32> {
        &self.manual_snapshot_retention_period
    }
    /// Consumes the builder and constructs a [`EnableSnapshotCopyInput`](crate::operation::enable_snapshot_copy::EnableSnapshotCopyInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::enable_snapshot_copy::EnableSnapshotCopyInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::enable_snapshot_copy::EnableSnapshotCopyInput {
            cluster_identifier: self.cluster_identifier,
            destination_region: self.destination_region,
            retention_period: self.retention_period,
            snapshot_copy_grant_name: self.snapshot_copy_grant_name,
            manual_snapshot_retention_period: self.manual_snapshot_retention_period,
        })
    }
}