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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p></p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct OptionGroup {
    /// <p>Specifies the name of the option group.</p>
    pub option_group_name: ::std::option::Option<::std::string::String>,
    /// <p>Provides a description of the option group.</p>
    pub option_group_description: ::std::option::Option<::std::string::String>,
    /// <p>Indicates the name of the engine that this option group can be applied to.</p>
    pub engine_name: ::std::option::Option<::std::string::String>,
    /// <p>Indicates the major engine version associated with this option group.</p>
    pub major_engine_version: ::std::option::Option<::std::string::String>,
    /// <p>Indicates what options are available in the option group.</p>
    pub options: ::std::option::Option<::std::vec::Vec<crate::types::Option>>,
    /// <p>Indicates whether this option group can be applied to both VPC and non-VPC instances. The value <code>true</code> indicates the option group can be applied to both VPC and non-VPC instances.</p>
    pub allows_vpc_and_non_vpc_instance_memberships: ::std::option::Option<bool>,
    /// <p>If <b>AllowsVpcAndNonVpcInstanceMemberships</b> is <code>false</code>, this field is blank. If <b>AllowsVpcAndNonVpcInstanceMemberships</b> is <code>true</code> and this field is blank, then this option group can be applied to both VPC and non-VPC instances. If this field contains a value, then this option group can only be applied to instances that are in the VPC indicated by this field.</p>
    pub vpc_id: ::std::option::Option<::std::string::String>,
    /// <p>Specifies the Amazon Resource Name (ARN) for the option group.</p>
    pub option_group_arn: ::std::option::Option<::std::string::String>,
    /// <p>Specifies the name of the option group from which this option group is copied.</p>
    pub source_option_group: ::std::option::Option<::std::string::String>,
    /// <p>Specifies the Amazon Web Services account ID for the option group from which this option group is copied.</p>
    pub source_account_id: ::std::option::Option<::std::string::String>,
    /// <p>Indicates when the option group was copied.</p>
    pub copy_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl OptionGroup {
    /// <p>Specifies the name of the option group.</p>
    pub fn option_group_name(&self) -> ::std::option::Option<&str> {
        self.option_group_name.as_deref()
    }
    /// <p>Provides a description of the option group.</p>
    pub fn option_group_description(&self) -> ::std::option::Option<&str> {
        self.option_group_description.as_deref()
    }
    /// <p>Indicates the name of the engine that this option group can be applied to.</p>
    pub fn engine_name(&self) -> ::std::option::Option<&str> {
        self.engine_name.as_deref()
    }
    /// <p>Indicates the major engine version associated with this option group.</p>
    pub fn major_engine_version(&self) -> ::std::option::Option<&str> {
        self.major_engine_version.as_deref()
    }
    /// <p>Indicates what options are available in the option 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 `.options.is_none()`.
    pub fn options(&self) -> &[crate::types::Option] {
        self.options.as_deref().unwrap_or_default()
    }
    /// <p>Indicates whether this option group can be applied to both VPC and non-VPC instances. The value <code>true</code> indicates the option group can be applied to both VPC and non-VPC instances.</p>
    pub fn allows_vpc_and_non_vpc_instance_memberships(&self) -> ::std::option::Option<bool> {
        self.allows_vpc_and_non_vpc_instance_memberships
    }
    /// <p>If <b>AllowsVpcAndNonVpcInstanceMemberships</b> is <code>false</code>, this field is blank. If <b>AllowsVpcAndNonVpcInstanceMemberships</b> is <code>true</code> and this field is blank, then this option group can be applied to both VPC and non-VPC instances. If this field contains a value, then this option group can only be applied to instances that are in the VPC indicated by this field.</p>
    pub fn vpc_id(&self) -> ::std::option::Option<&str> {
        self.vpc_id.as_deref()
    }
    /// <p>Specifies the Amazon Resource Name (ARN) for the option group.</p>
    pub fn option_group_arn(&self) -> ::std::option::Option<&str> {
        self.option_group_arn.as_deref()
    }
    /// <p>Specifies the name of the option group from which this option group is copied.</p>
    pub fn source_option_group(&self) -> ::std::option::Option<&str> {
        self.source_option_group.as_deref()
    }
    /// <p>Specifies the Amazon Web Services account ID for the option group from which this option group is copied.</p>
    pub fn source_account_id(&self) -> ::std::option::Option<&str> {
        self.source_account_id.as_deref()
    }
    /// <p>Indicates when the option group was copied.</p>
    pub fn copy_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.copy_timestamp.as_ref()
    }
}
impl OptionGroup {
    /// Creates a new builder-style object to manufacture [`OptionGroup`](crate::types::OptionGroup).
    pub fn builder() -> crate::types::builders::OptionGroupBuilder {
        crate::types::builders::OptionGroupBuilder::default()
    }
}

/// A builder for [`OptionGroup`](crate::types::OptionGroup).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct OptionGroupBuilder {
    pub(crate) option_group_name: ::std::option::Option<::std::string::String>,
    pub(crate) option_group_description: ::std::option::Option<::std::string::String>,
    pub(crate) engine_name: ::std::option::Option<::std::string::String>,
    pub(crate) major_engine_version: ::std::option::Option<::std::string::String>,
    pub(crate) options: ::std::option::Option<::std::vec::Vec<crate::types::Option>>,
    pub(crate) allows_vpc_and_non_vpc_instance_memberships: ::std::option::Option<bool>,
    pub(crate) vpc_id: ::std::option::Option<::std::string::String>,
    pub(crate) option_group_arn: ::std::option::Option<::std::string::String>,
    pub(crate) source_option_group: ::std::option::Option<::std::string::String>,
    pub(crate) source_account_id: ::std::option::Option<::std::string::String>,
    pub(crate) copy_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl OptionGroupBuilder {
    /// <p>Specifies the name of the option group.</p>
    pub fn option_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.option_group_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specifies the name of the option group.</p>
    pub fn set_option_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.option_group_name = input;
        self
    }
    /// <p>Specifies the name of the option group.</p>
    pub fn get_option_group_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.option_group_name
    }
    /// <p>Provides a description of the option group.</p>
    pub fn option_group_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.option_group_description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Provides a description of the option group.</p>
    pub fn set_option_group_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.option_group_description = input;
        self
    }
    /// <p>Provides a description of the option group.</p>
    pub fn get_option_group_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.option_group_description
    }
    /// <p>Indicates the name of the engine that this option group can be applied to.</p>
    pub fn engine_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.engine_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Indicates the name of the engine that this option group can be applied to.</p>
    pub fn set_engine_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.engine_name = input;
        self
    }
    /// <p>Indicates the name of the engine that this option group can be applied to.</p>
    pub fn get_engine_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.engine_name
    }
    /// <p>Indicates the major engine version associated with this option group.</p>
    pub fn major_engine_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.major_engine_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Indicates the major engine version associated with this option group.</p>
    pub fn set_major_engine_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.major_engine_version = input;
        self
    }
    /// <p>Indicates the major engine version associated with this option group.</p>
    pub fn get_major_engine_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.major_engine_version
    }
    /// Appends an item to `options`.
    ///
    /// To override the contents of this collection use [`set_options`](Self::set_options).
    ///
    /// <p>Indicates what options are available in the option group.</p>
    pub fn options(mut self, input: crate::types::Option) -> Self {
        let mut v = self.options.unwrap_or_default();
        v.push(input);
        self.options = ::std::option::Option::Some(v);
        self
    }
    /// <p>Indicates what options are available in the option group.</p>
    pub fn set_options(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Option>>) -> Self {
        self.options = input;
        self
    }
    /// <p>Indicates what options are available in the option group.</p>
    pub fn get_options(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Option>> {
        &self.options
    }
    /// <p>Indicates whether this option group can be applied to both VPC and non-VPC instances. The value <code>true</code> indicates the option group can be applied to both VPC and non-VPC instances.</p>
    pub fn allows_vpc_and_non_vpc_instance_memberships(mut self, input: bool) -> Self {
        self.allows_vpc_and_non_vpc_instance_memberships = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether this option group can be applied to both VPC and non-VPC instances. The value <code>true</code> indicates the option group can be applied to both VPC and non-VPC instances.</p>
    pub fn set_allows_vpc_and_non_vpc_instance_memberships(mut self, input: ::std::option::Option<bool>) -> Self {
        self.allows_vpc_and_non_vpc_instance_memberships = input;
        self
    }
    /// <p>Indicates whether this option group can be applied to both VPC and non-VPC instances. The value <code>true</code> indicates the option group can be applied to both VPC and non-VPC instances.</p>
    pub fn get_allows_vpc_and_non_vpc_instance_memberships(&self) -> &::std::option::Option<bool> {
        &self.allows_vpc_and_non_vpc_instance_memberships
    }
    /// <p>If <b>AllowsVpcAndNonVpcInstanceMemberships</b> is <code>false</code>, this field is blank. If <b>AllowsVpcAndNonVpcInstanceMemberships</b> is <code>true</code> and this field is blank, then this option group can be applied to both VPC and non-VPC instances. If this field contains a value, then this option group can only be applied to instances that are in the VPC indicated by this field.</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>If <b>AllowsVpcAndNonVpcInstanceMemberships</b> is <code>false</code>, this field is blank. If <b>AllowsVpcAndNonVpcInstanceMemberships</b> is <code>true</code> and this field is blank, then this option group can be applied to both VPC and non-VPC instances. If this field contains a value, then this option group can only be applied to instances that are in the VPC indicated by this field.</p>
    pub fn set_vpc_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.vpc_id = input;
        self
    }
    /// <p>If <b>AllowsVpcAndNonVpcInstanceMemberships</b> is <code>false</code>, this field is blank. If <b>AllowsVpcAndNonVpcInstanceMemberships</b> is <code>true</code> and this field is blank, then this option group can be applied to both VPC and non-VPC instances. If this field contains a value, then this option group can only be applied to instances that are in the VPC indicated by this field.</p>
    pub fn get_vpc_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.vpc_id
    }
    /// <p>Specifies the Amazon Resource Name (ARN) for the option group.</p>
    pub fn option_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.option_group_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specifies the Amazon Resource Name (ARN) for the option group.</p>
    pub fn set_option_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.option_group_arn = input;
        self
    }
    /// <p>Specifies the Amazon Resource Name (ARN) for the option group.</p>
    pub fn get_option_group_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.option_group_arn
    }
    /// <p>Specifies the name of the option group from which this option group is copied.</p>
    pub fn source_option_group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.source_option_group = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specifies the name of the option group from which this option group is copied.</p>
    pub fn set_source_option_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.source_option_group = input;
        self
    }
    /// <p>Specifies the name of the option group from which this option group is copied.</p>
    pub fn get_source_option_group(&self) -> &::std::option::Option<::std::string::String> {
        &self.source_option_group
    }
    /// <p>Specifies the Amazon Web Services account ID for the option group from which this option group is copied.</p>
    pub fn source_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.source_account_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specifies the Amazon Web Services account ID for the option group from which this option group is copied.</p>
    pub fn set_source_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.source_account_id = input;
        self
    }
    /// <p>Specifies the Amazon Web Services account ID for the option group from which this option group is copied.</p>
    pub fn get_source_account_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.source_account_id
    }
    /// <p>Indicates when the option group was copied.</p>
    pub fn copy_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.copy_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates when the option group was copied.</p>
    pub fn set_copy_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.copy_timestamp = input;
        self
    }
    /// <p>Indicates when the option group was copied.</p>
    pub fn get_copy_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.copy_timestamp
    }
    /// Consumes the builder and constructs a [`OptionGroup`](crate::types::OptionGroup).
    pub fn build(self) -> crate::types::OptionGroup {
        crate::types::OptionGroup {
            option_group_name: self.option_group_name,
            option_group_description: self.option_group_description,
            engine_name: self.engine_name,
            major_engine_version: self.major_engine_version,
            options: self.options,
            allows_vpc_and_non_vpc_instance_memberships: self.allows_vpc_and_non_vpc_instance_memberships,
            vpc_id: self.vpc_id,
            option_group_arn: self.option_group_arn,
            source_option_group: self.source_option_group,
            source_account_id: self.source_account_id,
            copy_timestamp: self.copy_timestamp,
        }
    }
}