Skip to main content

aws_sdk_rds/types/
_option_group.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p></p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct OptionGroup {
7    /// <p>Specifies the name of the option group.</p>
8    pub option_group_name: ::std::option::Option<::std::string::String>,
9    /// <p>Provides a description of the option group.</p>
10    pub option_group_description: ::std::option::Option<::std::string::String>,
11    /// <p>Indicates the name of the engine that this option group can be applied to.</p>
12    pub engine_name: ::std::option::Option<::std::string::String>,
13    /// <p>Indicates the major engine version associated with this option group.</p>
14    pub major_engine_version: ::std::option::Option<::std::string::String>,
15    /// <p>Indicates what options are available in the option group.</p>
16    pub options: ::std::option::Option<::std::vec::Vec<crate::types::Option>>,
17    /// <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>
18    pub allows_vpc_and_non_vpc_instance_memberships: ::std::option::Option<bool>,
19    /// <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>
20    pub vpc_id: ::std::option::Option<::std::string::String>,
21    /// <p>Specifies the Amazon Resource Name (ARN) for the option group.</p>
22    pub option_group_arn: ::std::option::Option<::std::string::String>,
23    /// <p>Specifies the name of the option group from which this option group is copied.</p>
24    pub source_option_group: ::std::option::Option<::std::string::String>,
25    /// <p>Specifies the Amazon Web Services account ID for the option group from which this option group is copied.</p>
26    pub source_account_id: ::std::option::Option<::std::string::String>,
27    /// <p>Indicates when the option group was copied.</p>
28    pub copy_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
29}
30impl OptionGroup {
31    /// <p>Specifies the name of the option group.</p>
32    pub fn option_group_name(&self) -> ::std::option::Option<&str> {
33        self.option_group_name.as_deref()
34    }
35    /// <p>Provides a description of the option group.</p>
36    pub fn option_group_description(&self) -> ::std::option::Option<&str> {
37        self.option_group_description.as_deref()
38    }
39    /// <p>Indicates the name of the engine that this option group can be applied to.</p>
40    pub fn engine_name(&self) -> ::std::option::Option<&str> {
41        self.engine_name.as_deref()
42    }
43    /// <p>Indicates the major engine version associated with this option group.</p>
44    pub fn major_engine_version(&self) -> ::std::option::Option<&str> {
45        self.major_engine_version.as_deref()
46    }
47    /// <p>Indicates what options are available in the option group.</p>
48    ///
49    /// 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()`.
50    pub fn options(&self) -> &[crate::types::Option] {
51        self.options.as_deref().unwrap_or_default()
52    }
53    /// <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>
54    pub fn allows_vpc_and_non_vpc_instance_memberships(&self) -> ::std::option::Option<bool> {
55        self.allows_vpc_and_non_vpc_instance_memberships
56    }
57    /// <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>
58    pub fn vpc_id(&self) -> ::std::option::Option<&str> {
59        self.vpc_id.as_deref()
60    }
61    /// <p>Specifies the Amazon Resource Name (ARN) for the option group.</p>
62    pub fn option_group_arn(&self) -> ::std::option::Option<&str> {
63        self.option_group_arn.as_deref()
64    }
65    /// <p>Specifies the name of the option group from which this option group is copied.</p>
66    pub fn source_option_group(&self) -> ::std::option::Option<&str> {
67        self.source_option_group.as_deref()
68    }
69    /// <p>Specifies the Amazon Web Services account ID for the option group from which this option group is copied.</p>
70    pub fn source_account_id(&self) -> ::std::option::Option<&str> {
71        self.source_account_id.as_deref()
72    }
73    /// <p>Indicates when the option group was copied.</p>
74    pub fn copy_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
75        self.copy_timestamp.as_ref()
76    }
77}
78impl OptionGroup {
79    /// Creates a new builder-style object to manufacture [`OptionGroup`](crate::types::OptionGroup).
80    pub fn builder() -> crate::types::builders::OptionGroupBuilder {
81        crate::types::builders::OptionGroupBuilder::default()
82    }
83}
84
85/// A builder for [`OptionGroup`](crate::types::OptionGroup).
86#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
87#[non_exhaustive]
88pub struct OptionGroupBuilder {
89    pub(crate) option_group_name: ::std::option::Option<::std::string::String>,
90    pub(crate) option_group_description: ::std::option::Option<::std::string::String>,
91    pub(crate) engine_name: ::std::option::Option<::std::string::String>,
92    pub(crate) major_engine_version: ::std::option::Option<::std::string::String>,
93    pub(crate) options: ::std::option::Option<::std::vec::Vec<crate::types::Option>>,
94    pub(crate) allows_vpc_and_non_vpc_instance_memberships: ::std::option::Option<bool>,
95    pub(crate) vpc_id: ::std::option::Option<::std::string::String>,
96    pub(crate) option_group_arn: ::std::option::Option<::std::string::String>,
97    pub(crate) source_option_group: ::std::option::Option<::std::string::String>,
98    pub(crate) source_account_id: ::std::option::Option<::std::string::String>,
99    pub(crate) copy_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
100}
101impl OptionGroupBuilder {
102    /// <p>Specifies the name of the option group.</p>
103    pub fn option_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.option_group_name = ::std::option::Option::Some(input.into());
105        self
106    }
107    /// <p>Specifies the name of the option group.</p>
108    pub fn set_option_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.option_group_name = input;
110        self
111    }
112    /// <p>Specifies the name of the option group.</p>
113    pub fn get_option_group_name(&self) -> &::std::option::Option<::std::string::String> {
114        &self.option_group_name
115    }
116    /// <p>Provides a description of the option group.</p>
117    pub fn option_group_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.option_group_description = ::std::option::Option::Some(input.into());
119        self
120    }
121    /// <p>Provides a description of the option group.</p>
122    pub fn set_option_group_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.option_group_description = input;
124        self
125    }
126    /// <p>Provides a description of the option group.</p>
127    pub fn get_option_group_description(&self) -> &::std::option::Option<::std::string::String> {
128        &self.option_group_description
129    }
130    /// <p>Indicates the name of the engine that this option group can be applied to.</p>
131    pub fn engine_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.engine_name = ::std::option::Option::Some(input.into());
133        self
134    }
135    /// <p>Indicates the name of the engine that this option group can be applied to.</p>
136    pub fn set_engine_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.engine_name = input;
138        self
139    }
140    /// <p>Indicates the name of the engine that this option group can be applied to.</p>
141    pub fn get_engine_name(&self) -> &::std::option::Option<::std::string::String> {
142        &self.engine_name
143    }
144    /// <p>Indicates the major engine version associated with this option group.</p>
145    pub fn major_engine_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.major_engine_version = ::std::option::Option::Some(input.into());
147        self
148    }
149    /// <p>Indicates the major engine version associated with this option group.</p>
150    pub fn set_major_engine_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.major_engine_version = input;
152        self
153    }
154    /// <p>Indicates the major engine version associated with this option group.</p>
155    pub fn get_major_engine_version(&self) -> &::std::option::Option<::std::string::String> {
156        &self.major_engine_version
157    }
158    /// Appends an item to `options`.
159    ///
160    /// To override the contents of this collection use [`set_options`](Self::set_options).
161    ///
162    /// <p>Indicates what options are available in the option group.</p>
163    pub fn options(mut self, input: crate::types::Option) -> Self {
164        let mut v = self.options.unwrap_or_default();
165        v.push(input);
166        self.options = ::std::option::Option::Some(v);
167        self
168    }
169    /// <p>Indicates what options are available in the option group.</p>
170    pub fn set_options(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Option>>) -> Self {
171        self.options = input;
172        self
173    }
174    /// <p>Indicates what options are available in the option group.</p>
175    pub fn get_options(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Option>> {
176        &self.options
177    }
178    /// <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>
179    pub fn allows_vpc_and_non_vpc_instance_memberships(mut self, input: bool) -> Self {
180        self.allows_vpc_and_non_vpc_instance_memberships = ::std::option::Option::Some(input);
181        self
182    }
183    /// <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>
184    pub fn set_allows_vpc_and_non_vpc_instance_memberships(mut self, input: ::std::option::Option<bool>) -> Self {
185        self.allows_vpc_and_non_vpc_instance_memberships = input;
186        self
187    }
188    /// <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>
189    pub fn get_allows_vpc_and_non_vpc_instance_memberships(&self) -> &::std::option::Option<bool> {
190        &self.allows_vpc_and_non_vpc_instance_memberships
191    }
192    /// <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>
193    pub fn vpc_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
194        self.vpc_id = ::std::option::Option::Some(input.into());
195        self
196    }
197    /// <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>
198    pub fn set_vpc_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
199        self.vpc_id = input;
200        self
201    }
202    /// <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>
203    pub fn get_vpc_id(&self) -> &::std::option::Option<::std::string::String> {
204        &self.vpc_id
205    }
206    /// <p>Specifies the Amazon Resource Name (ARN) for the option group.</p>
207    pub fn option_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208        self.option_group_arn = ::std::option::Option::Some(input.into());
209        self
210    }
211    /// <p>Specifies the Amazon Resource Name (ARN) for the option group.</p>
212    pub fn set_option_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
213        self.option_group_arn = input;
214        self
215    }
216    /// <p>Specifies the Amazon Resource Name (ARN) for the option group.</p>
217    pub fn get_option_group_arn(&self) -> &::std::option::Option<::std::string::String> {
218        &self.option_group_arn
219    }
220    /// <p>Specifies the name of the option group from which this option group is copied.</p>
221    pub fn source_option_group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
222        self.source_option_group = ::std::option::Option::Some(input.into());
223        self
224    }
225    /// <p>Specifies the name of the option group from which this option group is copied.</p>
226    pub fn set_source_option_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
227        self.source_option_group = input;
228        self
229    }
230    /// <p>Specifies the name of the option group from which this option group is copied.</p>
231    pub fn get_source_option_group(&self) -> &::std::option::Option<::std::string::String> {
232        &self.source_option_group
233    }
234    /// <p>Specifies the Amazon Web Services account ID for the option group from which this option group is copied.</p>
235    pub fn source_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
236        self.source_account_id = ::std::option::Option::Some(input.into());
237        self
238    }
239    /// <p>Specifies the Amazon Web Services account ID for the option group from which this option group is copied.</p>
240    pub fn set_source_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
241        self.source_account_id = input;
242        self
243    }
244    /// <p>Specifies the Amazon Web Services account ID for the option group from which this option group is copied.</p>
245    pub fn get_source_account_id(&self) -> &::std::option::Option<::std::string::String> {
246        &self.source_account_id
247    }
248    /// <p>Indicates when the option group was copied.</p>
249    pub fn copy_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
250        self.copy_timestamp = ::std::option::Option::Some(input);
251        self
252    }
253    /// <p>Indicates when the option group was copied.</p>
254    pub fn set_copy_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
255        self.copy_timestamp = input;
256        self
257    }
258    /// <p>Indicates when the option group was copied.</p>
259    pub fn get_copy_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
260        &self.copy_timestamp
261    }
262    /// Consumes the builder and constructs a [`OptionGroup`](crate::types::OptionGroup).
263    pub fn build(self) -> crate::types::OptionGroup {
264        crate::types::OptionGroup {
265            option_group_name: self.option_group_name,
266            option_group_description: self.option_group_description,
267            engine_name: self.engine_name,
268            major_engine_version: self.major_engine_version,
269            options: self.options,
270            allows_vpc_and_non_vpc_instance_memberships: self.allows_vpc_and_non_vpc_instance_memberships,
271            vpc_id: self.vpc_id,
272            option_group_arn: self.option_group_arn,
273            source_option_group: self.source_option_group,
274            source_account_id: self.source_account_id,
275            copy_timestamp: self.copy_timestamp,
276        }
277    }
278}