aws-sdk-backup 1.110.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 CreateFrameworkInput {
    /// <p>The unique name of the framework. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters (a-z, A-Z), numbers (0-9), and underscores (_).</p>
    pub framework_name: ::std::option::Option<::std::string::String>,
    /// <p>An optional description of the framework with a maximum of 1,024 characters.</p>
    pub framework_description: ::std::option::Option<::std::string::String>,
    /// <p>The controls that make up the framework. Each control in the list has a name, input parameters, and scope.</p>
    pub framework_controls: ::std::option::Option<::std::vec::Vec<crate::types::FrameworkControl>>,
    /// <p>A customer-chosen string that you can use to distinguish between otherwise identical calls to <code>CreateFrameworkInput</code>. 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 tags to assign to the framework.</p>
    pub framework_tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateFrameworkInput {
    /// <p>The unique name of the framework. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters (a-z, A-Z), numbers (0-9), and underscores (_).</p>
    pub fn framework_name(&self) -> ::std::option::Option<&str> {
        self.framework_name.as_deref()
    }
    /// <p>An optional description of the framework with a maximum of 1,024 characters.</p>
    pub fn framework_description(&self) -> ::std::option::Option<&str> {
        self.framework_description.as_deref()
    }
    /// <p>The controls that make up the framework. Each control in the list has a name, input parameters, and scope.</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 `.framework_controls.is_none()`.
    pub fn framework_controls(&self) -> &[crate::types::FrameworkControl] {
        self.framework_controls.as_deref().unwrap_or_default()
    }
    /// <p>A customer-chosen string that you can use to distinguish between otherwise identical calls to <code>CreateFrameworkInput</code>. 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 tags to assign to the framework.</p>
    pub fn framework_tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.framework_tags.as_ref()
    }
}
impl CreateFrameworkInput {
    /// Creates a new builder-style object to manufacture [`CreateFrameworkInput`](crate::operation::create_framework::CreateFrameworkInput).
    pub fn builder() -> crate::operation::create_framework::builders::CreateFrameworkInputBuilder {
        crate::operation::create_framework::builders::CreateFrameworkInputBuilder::default()
    }
}

/// A builder for [`CreateFrameworkInput`](crate::operation::create_framework::CreateFrameworkInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateFrameworkInputBuilder {
    pub(crate) framework_name: ::std::option::Option<::std::string::String>,
    pub(crate) framework_description: ::std::option::Option<::std::string::String>,
    pub(crate) framework_controls: ::std::option::Option<::std::vec::Vec<crate::types::FrameworkControl>>,
    pub(crate) idempotency_token: ::std::option::Option<::std::string::String>,
    pub(crate) framework_tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateFrameworkInputBuilder {
    /// <p>The unique name of the framework. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters (a-z, A-Z), numbers (0-9), and underscores (_).</p>
    /// This field is required.
    pub fn framework_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.framework_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique name of the framework. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters (a-z, A-Z), numbers (0-9), and underscores (_).</p>
    pub fn set_framework_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.framework_name = input;
        self
    }
    /// <p>The unique name of the framework. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters (a-z, A-Z), numbers (0-9), and underscores (_).</p>
    pub fn get_framework_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.framework_name
    }
    /// <p>An optional description of the framework with a maximum of 1,024 characters.</p>
    pub fn framework_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.framework_description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An optional description of the framework with a maximum of 1,024 characters.</p>
    pub fn set_framework_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.framework_description = input;
        self
    }
    /// <p>An optional description of the framework with a maximum of 1,024 characters.</p>
    pub fn get_framework_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.framework_description
    }
    /// Appends an item to `framework_controls`.
    ///
    /// To override the contents of this collection use [`set_framework_controls`](Self::set_framework_controls).
    ///
    /// <p>The controls that make up the framework. Each control in the list has a name, input parameters, and scope.</p>
    pub fn framework_controls(mut self, input: crate::types::FrameworkControl) -> Self {
        let mut v = self.framework_controls.unwrap_or_default();
        v.push(input);
        self.framework_controls = ::std::option::Option::Some(v);
        self
    }
    /// <p>The controls that make up the framework. Each control in the list has a name, input parameters, and scope.</p>
    pub fn set_framework_controls(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FrameworkControl>>) -> Self {
        self.framework_controls = input;
        self
    }
    /// <p>The controls that make up the framework. Each control in the list has a name, input parameters, and scope.</p>
    pub fn get_framework_controls(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FrameworkControl>> {
        &self.framework_controls
    }
    /// <p>A customer-chosen string that you can use to distinguish between otherwise identical calls to <code>CreateFrameworkInput</code>. 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>A customer-chosen string that you can use to distinguish between otherwise identical calls to <code>CreateFrameworkInput</code>. 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>A customer-chosen string that you can use to distinguish between otherwise identical calls to <code>CreateFrameworkInput</code>. 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
    }
    /// Adds a key-value pair to `framework_tags`.
    ///
    /// To override the contents of this collection use [`set_framework_tags`](Self::set_framework_tags).
    ///
    /// <p>The tags to assign to the framework.</p>
    pub fn framework_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.framework_tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.framework_tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The tags to assign to the framework.</p>
    pub fn set_framework_tags(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.framework_tags = input;
        self
    }
    /// <p>The tags to assign to the framework.</p>
    pub fn get_framework_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.framework_tags
    }
    /// Consumes the builder and constructs a [`CreateFrameworkInput`](crate::operation::create_framework::CreateFrameworkInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_framework::CreateFrameworkInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_framework::CreateFrameworkInput {
            framework_name: self.framework_name,
            framework_description: self.framework_description,
            framework_controls: self.framework_controls,
            idempotency_token: self.idempotency_token,
            framework_tags: self.framework_tags,
        })
    }
}