aws-sdk-dax 1.103.0

AWS SDK for Amazon DynamoDB Accelerator (DAX)
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 CreateSubnetGroupInput {
    /// <p>A name for the subnet group. This value is stored as a lowercase string.</p>
    pub subnet_group_name: ::std::option::Option<::std::string::String>,
    /// <p>A description for the subnet group</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>A list of VPC subnet IDs for the subnet group.</p>
    pub subnet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl CreateSubnetGroupInput {
    /// <p>A name for the subnet group. This value is stored as a lowercase string.</p>
    pub fn subnet_group_name(&self) -> ::std::option::Option<&str> {
        self.subnet_group_name.as_deref()
    }
    /// <p>A description for the subnet group</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>A list of VPC subnet IDs for the subnet group.</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 `.subnet_ids.is_none()`.
    pub fn subnet_ids(&self) -> &[::std::string::String] {
        self.subnet_ids.as_deref().unwrap_or_default()
    }
}
impl CreateSubnetGroupInput {
    /// Creates a new builder-style object to manufacture [`CreateSubnetGroupInput`](crate::operation::create_subnet_group::CreateSubnetGroupInput).
    pub fn builder() -> crate::operation::create_subnet_group::builders::CreateSubnetGroupInputBuilder {
        crate::operation::create_subnet_group::builders::CreateSubnetGroupInputBuilder::default()
    }
}

/// A builder for [`CreateSubnetGroupInput`](crate::operation::create_subnet_group::CreateSubnetGroupInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateSubnetGroupInputBuilder {
    pub(crate) subnet_group_name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) subnet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl CreateSubnetGroupInputBuilder {
    /// <p>A name for the subnet group. This value is stored as a lowercase string.</p>
    /// This field is required.
    pub fn subnet_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.subnet_group_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A name for the subnet group. This value is stored as a lowercase string.</p>
    pub fn set_subnet_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.subnet_group_name = input;
        self
    }
    /// <p>A name for the subnet group. This value is stored as a lowercase string.</p>
    pub fn get_subnet_group_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.subnet_group_name
    }
    /// <p>A description for the subnet group</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A description for the subnet group</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A description for the subnet group</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// Appends an item to `subnet_ids`.
    ///
    /// To override the contents of this collection use [`set_subnet_ids`](Self::set_subnet_ids).
    ///
    /// <p>A list of VPC subnet IDs for the subnet group.</p>
    pub fn subnet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.subnet_ids.unwrap_or_default();
        v.push(input.into());
        self.subnet_ids = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of VPC subnet IDs for the subnet group.</p>
    pub fn set_subnet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.subnet_ids = input;
        self
    }
    /// <p>A list of VPC subnet IDs for the subnet group.</p>
    pub fn get_subnet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.subnet_ids
    }
    /// Consumes the builder and constructs a [`CreateSubnetGroupInput`](crate::operation::create_subnet_group::CreateSubnetGroupInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_subnet_group::CreateSubnetGroupInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_subnet_group::CreateSubnetGroupInput {
            subnet_group_name: self.subnet_group_name,
            description: self.description,
            subnet_ids: self.subnet_ids,
        })
    }
}