1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Contains the details for an Amazon RDS DB security group.</p>
/// <p>This data type is used as a response element in the <code>DescribeDBSecurityGroups</code> action.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DbSecurityGroup {
    /// <p>Provides the Amazon Web Services ID of the owner of a specific DB security group.</p>
    pub owner_id: ::std::option::Option<::std::string::String>,
    /// <p>Specifies the name of the DB security group.</p>
    pub db_security_group_name: ::std::option::Option<::std::string::String>,
    /// <p>Provides the description of the DB security group.</p>
    pub db_security_group_description: ::std::option::Option<::std::string::String>,
    /// <p>Provides the VpcId of the DB security group.</p>
    pub vpc_id: ::std::option::Option<::std::string::String>,
    /// <p>Contains a list of <code>EC2SecurityGroup</code> elements.</p>
    pub ec2_security_groups: ::std::option::Option<::std::vec::Vec<crate::types::Ec2SecurityGroup>>,
    /// <p>Contains a list of <code>IPRange</code> elements.</p>
    pub ip_ranges: ::std::option::Option<::std::vec::Vec<crate::types::IpRange>>,
    /// <p>The Amazon Resource Name (ARN) for the DB security group.</p>
    pub db_security_group_arn: ::std::option::Option<::std::string::String>,
}
impl DbSecurityGroup {
    /// <p>Provides the Amazon Web Services ID of the owner of a specific DB security group.</p>
    pub fn owner_id(&self) -> ::std::option::Option<&str> {
        self.owner_id.as_deref()
    }
    /// <p>Specifies the name of the DB security group.</p>
    pub fn db_security_group_name(&self) -> ::std::option::Option<&str> {
        self.db_security_group_name.as_deref()
    }
    /// <p>Provides the description of the DB security group.</p>
    pub fn db_security_group_description(&self) -> ::std::option::Option<&str> {
        self.db_security_group_description.as_deref()
    }
    /// <p>Provides the VpcId of the DB security group.</p>
    pub fn vpc_id(&self) -> ::std::option::Option<&str> {
        self.vpc_id.as_deref()
    }
    /// <p>Contains a list of <code>EC2SecurityGroup</code> elements.</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 `.ec2_security_groups.is_none()`.
    pub fn ec2_security_groups(&self) -> &[crate::types::Ec2SecurityGroup] {
        self.ec2_security_groups.as_deref().unwrap_or_default()
    }
    /// <p>Contains a list of <code>IPRange</code> elements.</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 `.ip_ranges.is_none()`.
    pub fn ip_ranges(&self) -> &[crate::types::IpRange] {
        self.ip_ranges.as_deref().unwrap_or_default()
    }
    /// <p>The Amazon Resource Name (ARN) for the DB security group.</p>
    pub fn db_security_group_arn(&self) -> ::std::option::Option<&str> {
        self.db_security_group_arn.as_deref()
    }
}
impl DbSecurityGroup {
    /// Creates a new builder-style object to manufacture [`DbSecurityGroup`](crate::types::DbSecurityGroup).
    pub fn builder() -> crate::types::builders::DbSecurityGroupBuilder {
        crate::types::builders::DbSecurityGroupBuilder::default()
    }
}

/// A builder for [`DbSecurityGroup`](crate::types::DbSecurityGroup).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct DbSecurityGroupBuilder {
    pub(crate) owner_id: ::std::option::Option<::std::string::String>,
    pub(crate) db_security_group_name: ::std::option::Option<::std::string::String>,
    pub(crate) db_security_group_description: ::std::option::Option<::std::string::String>,
    pub(crate) vpc_id: ::std::option::Option<::std::string::String>,
    pub(crate) ec2_security_groups: ::std::option::Option<::std::vec::Vec<crate::types::Ec2SecurityGroup>>,
    pub(crate) ip_ranges: ::std::option::Option<::std::vec::Vec<crate::types::IpRange>>,
    pub(crate) db_security_group_arn: ::std::option::Option<::std::string::String>,
}
impl DbSecurityGroupBuilder {
    /// <p>Provides the Amazon Web Services ID of the owner of a specific DB security group.</p>
    pub fn owner_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.owner_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Provides the Amazon Web Services ID of the owner of a specific DB security group.</p>
    pub fn set_owner_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.owner_id = input;
        self
    }
    /// <p>Provides the Amazon Web Services ID of the owner of a specific DB security group.</p>
    pub fn get_owner_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.owner_id
    }
    /// <p>Specifies the name of the DB security group.</p>
    pub fn db_security_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.db_security_group_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specifies the name of the DB security group.</p>
    pub fn set_db_security_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.db_security_group_name = input;
        self
    }
    /// <p>Specifies the name of the DB security group.</p>
    pub fn get_db_security_group_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.db_security_group_name
    }
    /// <p>Provides the description of the DB security group.</p>
    pub fn db_security_group_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.db_security_group_description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Provides the description of the DB security group.</p>
    pub fn set_db_security_group_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.db_security_group_description = input;
        self
    }
    /// <p>Provides the description of the DB security group.</p>
    pub fn get_db_security_group_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.db_security_group_description
    }
    /// <p>Provides the VpcId of the DB security group.</p>
    pub fn vpc_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.vpc_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Provides the VpcId of the DB security group.</p>
    pub fn set_vpc_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.vpc_id = input;
        self
    }
    /// <p>Provides the VpcId of the DB security group.</p>
    pub fn get_vpc_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.vpc_id
    }
    /// Appends an item to `ec2_security_groups`.
    ///
    /// To override the contents of this collection use [`set_ec2_security_groups`](Self::set_ec2_security_groups).
    ///
    /// <p>Contains a list of <code>EC2SecurityGroup</code> elements.</p>
    pub fn ec2_security_groups(mut self, input: crate::types::Ec2SecurityGroup) -> Self {
        let mut v = self.ec2_security_groups.unwrap_or_default();
        v.push(input);
        self.ec2_security_groups = ::std::option::Option::Some(v);
        self
    }
    /// <p>Contains a list of <code>EC2SecurityGroup</code> elements.</p>
    pub fn set_ec2_security_groups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Ec2SecurityGroup>>) -> Self {
        self.ec2_security_groups = input;
        self
    }
    /// <p>Contains a list of <code>EC2SecurityGroup</code> elements.</p>
    pub fn get_ec2_security_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Ec2SecurityGroup>> {
        &self.ec2_security_groups
    }
    /// Appends an item to `ip_ranges`.
    ///
    /// To override the contents of this collection use [`set_ip_ranges`](Self::set_ip_ranges).
    ///
    /// <p>Contains a list of <code>IPRange</code> elements.</p>
    pub fn ip_ranges(mut self, input: crate::types::IpRange) -> Self {
        let mut v = self.ip_ranges.unwrap_or_default();
        v.push(input);
        self.ip_ranges = ::std::option::Option::Some(v);
        self
    }
    /// <p>Contains a list of <code>IPRange</code> elements.</p>
    pub fn set_ip_ranges(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IpRange>>) -> Self {
        self.ip_ranges = input;
        self
    }
    /// <p>Contains a list of <code>IPRange</code> elements.</p>
    pub fn get_ip_ranges(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IpRange>> {
        &self.ip_ranges
    }
    /// <p>The Amazon Resource Name (ARN) for the DB security group.</p>
    pub fn db_security_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.db_security_group_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) for the DB security group.</p>
    pub fn set_db_security_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.db_security_group_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) for the DB security group.</p>
    pub fn get_db_security_group_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.db_security_group_arn
    }
    /// Consumes the builder and constructs a [`DbSecurityGroup`](crate::types::DbSecurityGroup).
    pub fn build(self) -> crate::types::DbSecurityGroup {
        crate::types::DbSecurityGroup {
            owner_id: self.owner_id,
            db_security_group_name: self.db_security_group_name,
            db_security_group_description: self.db_security_group_description,
            vpc_id: self.vpc_id,
            ec2_security_groups: self.ec2_security_groups,
            ip_ranges: self.ip_ranges,
            db_security_group_arn: self.db_security_group_arn,
        }
    }
}