Skip to main content

aws_sdk_neptune/operation/modify_db_subnet_group/
_modify_db_subnet_group_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct ModifyDbSubnetGroupInput {
6    /// <p>The name for the DB subnet group. This value is stored as a lowercase string. You can't modify the default subnet group.</p>
7    /// <p>Constraints: Must match the name of an existing DBSubnetGroup. Must not be default.</p>
8    /// <p>Example: <code>mySubnetgroup</code></p>
9    pub db_subnet_group_name: ::std::option::Option<::std::string::String>,
10    /// <p>The description for the DB subnet group.</p>
11    pub db_subnet_group_description: ::std::option::Option<::std::string::String>,
12    /// <p>The EC2 subnet IDs for the DB subnet group.</p>
13    pub subnet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
14}
15impl ModifyDbSubnetGroupInput {
16    /// <p>The name for the DB subnet group. This value is stored as a lowercase string. You can't modify the default subnet group.</p>
17    /// <p>Constraints: Must match the name of an existing DBSubnetGroup. Must not be default.</p>
18    /// <p>Example: <code>mySubnetgroup</code></p>
19    pub fn db_subnet_group_name(&self) -> ::std::option::Option<&str> {
20        self.db_subnet_group_name.as_deref()
21    }
22    /// <p>The description for the DB subnet group.</p>
23    pub fn db_subnet_group_description(&self) -> ::std::option::Option<&str> {
24        self.db_subnet_group_description.as_deref()
25    }
26    /// <p>The EC2 subnet IDs for the DB subnet group.</p>
27    ///
28    /// 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()`.
29    pub fn subnet_ids(&self) -> &[::std::string::String] {
30        self.subnet_ids.as_deref().unwrap_or_default()
31    }
32}
33impl ModifyDbSubnetGroupInput {
34    /// Creates a new builder-style object to manufacture [`ModifyDbSubnetGroupInput`](crate::operation::modify_db_subnet_group::ModifyDbSubnetGroupInput).
35    pub fn builder() -> crate::operation::modify_db_subnet_group::builders::ModifyDbSubnetGroupInputBuilder {
36        crate::operation::modify_db_subnet_group::builders::ModifyDbSubnetGroupInputBuilder::default()
37    }
38}
39
40/// A builder for [`ModifyDbSubnetGroupInput`](crate::operation::modify_db_subnet_group::ModifyDbSubnetGroupInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct ModifyDbSubnetGroupInputBuilder {
44    pub(crate) db_subnet_group_name: ::std::option::Option<::std::string::String>,
45    pub(crate) db_subnet_group_description: ::std::option::Option<::std::string::String>,
46    pub(crate) subnet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
47}
48impl ModifyDbSubnetGroupInputBuilder {
49    /// <p>The name for the DB subnet group. This value is stored as a lowercase string. You can't modify the default subnet group.</p>
50    /// <p>Constraints: Must match the name of an existing DBSubnetGroup. Must not be default.</p>
51    /// <p>Example: <code>mySubnetgroup</code></p>
52    /// This field is required.
53    pub fn db_subnet_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
54        self.db_subnet_group_name = ::std::option::Option::Some(input.into());
55        self
56    }
57    /// <p>The name for the DB subnet group. This value is stored as a lowercase string. You can't modify the default subnet group.</p>
58    /// <p>Constraints: Must match the name of an existing DBSubnetGroup. Must not be default.</p>
59    /// <p>Example: <code>mySubnetgroup</code></p>
60    pub fn set_db_subnet_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
61        self.db_subnet_group_name = input;
62        self
63    }
64    /// <p>The name for the DB subnet group. This value is stored as a lowercase string. You can't modify the default subnet group.</p>
65    /// <p>Constraints: Must match the name of an existing DBSubnetGroup. Must not be default.</p>
66    /// <p>Example: <code>mySubnetgroup</code></p>
67    pub fn get_db_subnet_group_name(&self) -> &::std::option::Option<::std::string::String> {
68        &self.db_subnet_group_name
69    }
70    /// <p>The description for the DB subnet group.</p>
71    pub fn db_subnet_group_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
72        self.db_subnet_group_description = ::std::option::Option::Some(input.into());
73        self
74    }
75    /// <p>The description for the DB subnet group.</p>
76    pub fn set_db_subnet_group_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
77        self.db_subnet_group_description = input;
78        self
79    }
80    /// <p>The description for the DB subnet group.</p>
81    pub fn get_db_subnet_group_description(&self) -> &::std::option::Option<::std::string::String> {
82        &self.db_subnet_group_description
83    }
84    /// Appends an item to `subnet_ids`.
85    ///
86    /// To override the contents of this collection use [`set_subnet_ids`](Self::set_subnet_ids).
87    ///
88    /// <p>The EC2 subnet IDs for the DB subnet group.</p>
89    pub fn subnet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90        let mut v = self.subnet_ids.unwrap_or_default();
91        v.push(input.into());
92        self.subnet_ids = ::std::option::Option::Some(v);
93        self
94    }
95    /// <p>The EC2 subnet IDs for the DB subnet group.</p>
96    pub fn set_subnet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
97        self.subnet_ids = input;
98        self
99    }
100    /// <p>The EC2 subnet IDs for the DB subnet group.</p>
101    pub fn get_subnet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
102        &self.subnet_ids
103    }
104    /// Consumes the builder and constructs a [`ModifyDbSubnetGroupInput`](crate::operation::modify_db_subnet_group::ModifyDbSubnetGroupInput).
105    pub fn build(
106        self,
107    ) -> ::std::result::Result<crate::operation::modify_db_subnet_group::ModifyDbSubnetGroupInput, ::aws_smithy_types::error::operation::BuildError>
108    {
109        ::std::result::Result::Ok(crate::operation::modify_db_subnet_group::ModifyDbSubnetGroupInput {
110            db_subnet_group_name: self.db_subnet_group_name,
111            db_subnet_group_description: self.db_subnet_group_description,
112            subnet_ids: self.subnet_ids,
113        })
114    }
115}