aws-sdk-redshiftserverless 1.106.0

AWS SDK for Redshift Serverless
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 UpdateSnapshotInput {
    /// <p>The name of the snapshot.</p>
    pub snapshot_name: ::std::option::Option<::std::string::String>,
    /// <p>The new retention period of the snapshot.</p>
    pub retention_period: ::std::option::Option<i32>,
}
impl UpdateSnapshotInput {
    /// <p>The name of the snapshot.</p>
    pub fn snapshot_name(&self) -> ::std::option::Option<&str> {
        self.snapshot_name.as_deref()
    }
    /// <p>The new retention period of the snapshot.</p>
    pub fn retention_period(&self) -> ::std::option::Option<i32> {
        self.retention_period
    }
}
impl UpdateSnapshotInput {
    /// Creates a new builder-style object to manufacture [`UpdateSnapshotInput`](crate::operation::update_snapshot::UpdateSnapshotInput).
    pub fn builder() -> crate::operation::update_snapshot::builders::UpdateSnapshotInputBuilder {
        crate::operation::update_snapshot::builders::UpdateSnapshotInputBuilder::default()
    }
}

/// A builder for [`UpdateSnapshotInput`](crate::operation::update_snapshot::UpdateSnapshotInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateSnapshotInputBuilder {
    pub(crate) snapshot_name: ::std::option::Option<::std::string::String>,
    pub(crate) retention_period: ::std::option::Option<i32>,
}
impl UpdateSnapshotInputBuilder {
    /// <p>The name of the snapshot.</p>
    /// This field is required.
    pub fn snapshot_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.snapshot_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the snapshot.</p>
    pub fn set_snapshot_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.snapshot_name = input;
        self
    }
    /// <p>The name of the snapshot.</p>
    pub fn get_snapshot_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.snapshot_name
    }
    /// <p>The new retention period of the snapshot.</p>
    pub fn retention_period(mut self, input: i32) -> Self {
        self.retention_period = ::std::option::Option::Some(input);
        self
    }
    /// <p>The new retention period of the snapshot.</p>
    pub fn set_retention_period(mut self, input: ::std::option::Option<i32>) -> Self {
        self.retention_period = input;
        self
    }
    /// <p>The new retention period of the snapshot.</p>
    pub fn get_retention_period(&self) -> &::std::option::Option<i32> {
        &self.retention_period
    }
    /// Consumes the builder and constructs a [`UpdateSnapshotInput`](crate::operation::update_snapshot::UpdateSnapshotInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_snapshot::UpdateSnapshotInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_snapshot::UpdateSnapshotInput {
            snapshot_name: self.snapshot_name,
            retention_period: self.retention_period,
        })
    }
}