aws-sdk-backup 1.109.0

AWS SDK for AWS Backup
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 CreateBackupSelectionInput {
    /// <p>The ID of the backup plan.</p>
    pub backup_plan_id: ::std::option::Option<::std::string::String>,
    /// <p>The body of a request to assign a set of resources to a backup plan.</p>
    pub backup_selection: ::std::option::Option<crate::types::BackupSelection>,
    /// <p>A unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice. This parameter is optional.</p>
    /// <p>If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>
    pub creator_request_id: ::std::option::Option<::std::string::String>,
}
impl CreateBackupSelectionInput {
    /// <p>The ID of the backup plan.</p>
    pub fn backup_plan_id(&self) -> ::std::option::Option<&str> {
        self.backup_plan_id.as_deref()
    }
    /// <p>The body of a request to assign a set of resources to a backup plan.</p>
    pub fn backup_selection(&self) -> ::std::option::Option<&crate::types::BackupSelection> {
        self.backup_selection.as_ref()
    }
    /// <p>A unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice. This parameter is optional.</p>
    /// <p>If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>
    pub fn creator_request_id(&self) -> ::std::option::Option<&str> {
        self.creator_request_id.as_deref()
    }
}
impl CreateBackupSelectionInput {
    /// Creates a new builder-style object to manufacture [`CreateBackupSelectionInput`](crate::operation::create_backup_selection::CreateBackupSelectionInput).
    pub fn builder() -> crate::operation::create_backup_selection::builders::CreateBackupSelectionInputBuilder {
        crate::operation::create_backup_selection::builders::CreateBackupSelectionInputBuilder::default()
    }
}

/// A builder for [`CreateBackupSelectionInput`](crate::operation::create_backup_selection::CreateBackupSelectionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateBackupSelectionInputBuilder {
    pub(crate) backup_plan_id: ::std::option::Option<::std::string::String>,
    pub(crate) backup_selection: ::std::option::Option<crate::types::BackupSelection>,
    pub(crate) creator_request_id: ::std::option::Option<::std::string::String>,
}
impl CreateBackupSelectionInputBuilder {
    /// <p>The ID of the backup plan.</p>
    /// This field is required.
    pub fn backup_plan_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.backup_plan_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the backup plan.</p>
    pub fn set_backup_plan_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.backup_plan_id = input;
        self
    }
    /// <p>The ID of the backup plan.</p>
    pub fn get_backup_plan_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.backup_plan_id
    }
    /// <p>The body of a request to assign a set of resources to a backup plan.</p>
    /// This field is required.
    pub fn backup_selection(mut self, input: crate::types::BackupSelection) -> Self {
        self.backup_selection = ::std::option::Option::Some(input);
        self
    }
    /// <p>The body of a request to assign a set of resources to a backup plan.</p>
    pub fn set_backup_selection(mut self, input: ::std::option::Option<crate::types::BackupSelection>) -> Self {
        self.backup_selection = input;
        self
    }
    /// <p>The body of a request to assign a set of resources to a backup plan.</p>
    pub fn get_backup_selection(&self) -> &::std::option::Option<crate::types::BackupSelection> {
        &self.backup_selection
    }
    /// <p>A unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice. This parameter is optional.</p>
    /// <p>If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>
    pub fn creator_request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.creator_request_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice. This parameter is optional.</p>
    /// <p>If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>
    pub fn set_creator_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.creator_request_id = input;
        self
    }
    /// <p>A unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice. This parameter is optional.</p>
    /// <p>If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>
    pub fn get_creator_request_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.creator_request_id
    }
    /// Consumes the builder and constructs a [`CreateBackupSelectionInput`](crate::operation::create_backup_selection::CreateBackupSelectionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_backup_selection::CreateBackupSelectionInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_backup_selection::CreateBackupSelectionInput {
            backup_plan_id: self.backup_plan_id,
            backup_selection: self.backup_selection,
            creator_request_id: self.creator_request_id,
        })
    }
}