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)]
pub struct CreateLegalHoldInput {
    /// <p>The title of the legal hold.</p>
    pub title: ::std::option::Option<::std::string::String>,
    /// <p>The description of the legal hold.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>This is a user-chosen string used to distinguish between otherwise identical calls. Retrying a successful request with the same idempotency token results in a success message with no action taken.</p>
    pub idempotency_token: ::std::option::Option<::std::string::String>,
    /// <p>The criteria to assign a set of resources, such as resource types or backup vaults.</p>
    pub recovery_point_selection: ::std::option::Option<crate::types::RecoveryPointSelection>,
    /// <p>Optional tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateLegalHoldInput {
    /// <p>The title of the legal hold.</p>
    pub fn title(&self) -> ::std::option::Option<&str> {
        self.title.as_deref()
    }
    /// <p>The description of the legal hold.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>This is a user-chosen string used to distinguish between otherwise identical calls. Retrying a successful request with the same idempotency token results in a success message with no action taken.</p>
    pub fn idempotency_token(&self) -> ::std::option::Option<&str> {
        self.idempotency_token.as_deref()
    }
    /// <p>The criteria to assign a set of resources, such as resource types or backup vaults.</p>
    pub fn recovery_point_selection(&self) -> ::std::option::Option<&crate::types::RecoveryPointSelection> {
        self.recovery_point_selection.as_ref()
    }
    /// <p>Optional tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl ::std::fmt::Debug for CreateLegalHoldInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateLegalHoldInput");
        formatter.field("title", &self.title);
        formatter.field("description", &self.description);
        formatter.field("idempotency_token", &self.idempotency_token);
        formatter.field("recovery_point_selection", &self.recovery_point_selection);
        formatter.field("tags", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}
impl CreateLegalHoldInput {
    /// Creates a new builder-style object to manufacture [`CreateLegalHoldInput`](crate::operation::create_legal_hold::CreateLegalHoldInput).
    pub fn builder() -> crate::operation::create_legal_hold::builders::CreateLegalHoldInputBuilder {
        crate::operation::create_legal_hold::builders::CreateLegalHoldInputBuilder::default()
    }
}

/// A builder for [`CreateLegalHoldInput`](crate::operation::create_legal_hold::CreateLegalHoldInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateLegalHoldInputBuilder {
    pub(crate) title: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) idempotency_token: ::std::option::Option<::std::string::String>,
    pub(crate) recovery_point_selection: ::std::option::Option<crate::types::RecoveryPointSelection>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateLegalHoldInputBuilder {
    /// <p>The title of the legal hold.</p>
    /// This field is required.
    pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.title = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The title of the legal hold.</p>
    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.title = input;
        self
    }
    /// <p>The title of the legal hold.</p>
    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
        &self.title
    }
    /// <p>The description of the legal hold.</p>
    /// This field is required.
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description of the legal hold.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The description of the legal hold.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>This is a user-chosen string used to distinguish between otherwise identical calls. Retrying a successful request with the same idempotency token results in a success message with no action taken.</p>
    pub fn idempotency_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.idempotency_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>This is a user-chosen string used to distinguish between otherwise identical calls. Retrying a successful request with the same idempotency token results in a success message with no action taken.</p>
    pub fn set_idempotency_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.idempotency_token = input;
        self
    }
    /// <p>This is a user-chosen string used to distinguish between otherwise identical calls. Retrying a successful request with the same idempotency token results in a success message with no action taken.</p>
    pub fn get_idempotency_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.idempotency_token
    }
    /// <p>The criteria to assign a set of resources, such as resource types or backup vaults.</p>
    pub fn recovery_point_selection(mut self, input: crate::types::RecoveryPointSelection) -> Self {
        self.recovery_point_selection = ::std::option::Option::Some(input);
        self
    }
    /// <p>The criteria to assign a set of resources, such as resource types or backup vaults.</p>
    pub fn set_recovery_point_selection(mut self, input: ::std::option::Option<crate::types::RecoveryPointSelection>) -> Self {
        self.recovery_point_selection = input;
        self
    }
    /// <p>The criteria to assign a set of resources, such as resource types or backup vaults.</p>
    pub fn get_recovery_point_selection(&self) -> &::std::option::Option<crate::types::RecoveryPointSelection> {
        &self.recovery_point_selection
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Optional tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>Optional tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>Optional tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateLegalHoldInput`](crate::operation::create_legal_hold::CreateLegalHoldInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_legal_hold::CreateLegalHoldInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_legal_hold::CreateLegalHoldInput {
            title: self.title,
            description: self.description,
            idempotency_token: self.idempotency_token,
            recovery_point_selection: self.recovery_point_selection,
            tags: self.tags,
        })
    }
}
impl ::std::fmt::Debug for CreateLegalHoldInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateLegalHoldInputBuilder");
        formatter.field("title", &self.title);
        formatter.field("description", &self.description);
        formatter.field("idempotency_token", &self.idempotency_token);
        formatter.field("recovery_point_selection", &self.recovery_point_selection);
        formatter.field("tags", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}