aws_sdk_rds/operation/create_option_group/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_option_group::_create_option_group_output::CreateOptionGroupOutputBuilder;
3
4pub use crate::operation::create_option_group::_create_option_group_input::CreateOptionGroupInputBuilder;
5
6impl crate::operation::create_option_group::builders::CreateOptionGroupInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_option_group::CreateOptionGroupOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_option_group::CreateOptionGroupError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_option_group();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateOptionGroup`.
24///
25/// <p>Creates a new option group. You can create up to 20 option groups.</p>
26/// <p>This command doesn't apply to RDS Custom.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct CreateOptionGroupFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::create_option_group::builders::CreateOptionGroupInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::create_option_group::CreateOptionGroupOutput,
36        crate::operation::create_option_group::CreateOptionGroupError,
37    > for CreateOptionGroupFluentBuilder
38{
39    fn send(
40        self,
41        config_override: crate::config::Builder,
42    ) -> crate::client::customize::internal::BoxFuture<
43        crate::client::customize::internal::SendResult<
44            crate::operation::create_option_group::CreateOptionGroupOutput,
45            crate::operation::create_option_group::CreateOptionGroupError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl CreateOptionGroupFluentBuilder {
52    /// Creates a new `CreateOptionGroupFluentBuilder`.
53    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54        Self {
55            handle,
56            inner: ::std::default::Default::default(),
57            config_override: ::std::option::Option::None,
58        }
59    }
60    /// Access the CreateOptionGroup as a reference.
61    pub fn as_input(&self) -> &crate::operation::create_option_group::builders::CreateOptionGroupInputBuilder {
62        &self.inner
63    }
64    /// Sends the request and returns the response.
65    ///
66    /// If an error occurs, an `SdkError` will be returned with additional details that
67    /// can be matched against.
68    ///
69    /// By default, any retryable failures will be retried twice. Retry behavior
70    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71    /// set when configuring the client.
72    pub async fn send(
73        self,
74    ) -> ::std::result::Result<
75        crate::operation::create_option_group::CreateOptionGroupOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::create_option_group::CreateOptionGroupError,
78            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79        >,
80    > {
81        let input = self
82            .inner
83            .build()
84            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85        let runtime_plugins = crate::operation::create_option_group::CreateOptionGroup::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::create_option_group::CreateOptionGroup::orchestrate(&runtime_plugins, input).await
91    }
92
93    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94    pub fn customize(
95        self,
96    ) -> crate::client::customize::CustomizableOperation<
97        crate::operation::create_option_group::CreateOptionGroupOutput,
98        crate::operation::create_option_group::CreateOptionGroupError,
99        Self,
100    > {
101        crate::client::customize::CustomizableOperation::new(self)
102    }
103    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104        self.set_config_override(::std::option::Option::Some(config_override.into()));
105        self
106    }
107
108    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109        self.config_override = config_override;
110        self
111    }
112    /// <p>Specifies the name of the option group to be created.</p>
113    /// <p>Constraints:</p>
114    /// <ul>
115    /// <li>
116    /// <p>Must be 1 to 255 letters, numbers, or hyphens</p></li>
117    /// <li>
118    /// <p>First character must be a letter</p></li>
119    /// <li>
120    /// <p>Can't end with a hyphen or contain two consecutive hyphens</p></li>
121    /// </ul>
122    /// <p>Example: <code>myoptiongroup</code></p>
123    pub fn option_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.inner = self.inner.option_group_name(input.into());
125        self
126    }
127    /// <p>Specifies the name of the option group to be created.</p>
128    /// <p>Constraints:</p>
129    /// <ul>
130    /// <li>
131    /// <p>Must be 1 to 255 letters, numbers, or hyphens</p></li>
132    /// <li>
133    /// <p>First character must be a letter</p></li>
134    /// <li>
135    /// <p>Can't end with a hyphen or contain two consecutive hyphens</p></li>
136    /// </ul>
137    /// <p>Example: <code>myoptiongroup</code></p>
138    pub fn set_option_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_option_group_name(input);
140        self
141    }
142    /// <p>Specifies the name of the option group to be created.</p>
143    /// <p>Constraints:</p>
144    /// <ul>
145    /// <li>
146    /// <p>Must be 1 to 255 letters, numbers, or hyphens</p></li>
147    /// <li>
148    /// <p>First character must be a letter</p></li>
149    /// <li>
150    /// <p>Can't end with a hyphen or contain two consecutive hyphens</p></li>
151    /// </ul>
152    /// <p>Example: <code>myoptiongroup</code></p>
153    pub fn get_option_group_name(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_option_group_name()
155    }
156    /// <p>The name of the engine to associate this option group with.</p>
157    /// <p>Valid Values:</p>
158    /// <ul>
159    /// <li>
160    /// <p><code>db2-ae</code></p></li>
161    /// <li>
162    /// <p><code>db2-se</code></p></li>
163    /// <li>
164    /// <p><code>mariadb</code></p></li>
165    /// <li>
166    /// <p><code>mysql</code></p></li>
167    /// <li>
168    /// <p><code>oracle-ee</code></p></li>
169    /// <li>
170    /// <p><code>oracle-ee-cdb</code></p></li>
171    /// <li>
172    /// <p><code>oracle-se2</code></p></li>
173    /// <li>
174    /// <p><code>oracle-se2-cdb</code></p></li>
175    /// <li>
176    /// <p><code>postgres</code></p></li>
177    /// <li>
178    /// <p><code>sqlserver-ee</code></p></li>
179    /// <li>
180    /// <p><code>sqlserver-se</code></p></li>
181    /// <li>
182    /// <p><code>sqlserver-ex</code></p></li>
183    /// <li>
184    /// <p><code>sqlserver-web</code></p></li>
185    /// </ul>
186    pub fn engine_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187        self.inner = self.inner.engine_name(input.into());
188        self
189    }
190    /// <p>The name of the engine to associate this option group with.</p>
191    /// <p>Valid Values:</p>
192    /// <ul>
193    /// <li>
194    /// <p><code>db2-ae</code></p></li>
195    /// <li>
196    /// <p><code>db2-se</code></p></li>
197    /// <li>
198    /// <p><code>mariadb</code></p></li>
199    /// <li>
200    /// <p><code>mysql</code></p></li>
201    /// <li>
202    /// <p><code>oracle-ee</code></p></li>
203    /// <li>
204    /// <p><code>oracle-ee-cdb</code></p></li>
205    /// <li>
206    /// <p><code>oracle-se2</code></p></li>
207    /// <li>
208    /// <p><code>oracle-se2-cdb</code></p></li>
209    /// <li>
210    /// <p><code>postgres</code></p></li>
211    /// <li>
212    /// <p><code>sqlserver-ee</code></p></li>
213    /// <li>
214    /// <p><code>sqlserver-se</code></p></li>
215    /// <li>
216    /// <p><code>sqlserver-ex</code></p></li>
217    /// <li>
218    /// <p><code>sqlserver-web</code></p></li>
219    /// </ul>
220    pub fn set_engine_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221        self.inner = self.inner.set_engine_name(input);
222        self
223    }
224    /// <p>The name of the engine to associate this option group with.</p>
225    /// <p>Valid Values:</p>
226    /// <ul>
227    /// <li>
228    /// <p><code>db2-ae</code></p></li>
229    /// <li>
230    /// <p><code>db2-se</code></p></li>
231    /// <li>
232    /// <p><code>mariadb</code></p></li>
233    /// <li>
234    /// <p><code>mysql</code></p></li>
235    /// <li>
236    /// <p><code>oracle-ee</code></p></li>
237    /// <li>
238    /// <p><code>oracle-ee-cdb</code></p></li>
239    /// <li>
240    /// <p><code>oracle-se2</code></p></li>
241    /// <li>
242    /// <p><code>oracle-se2-cdb</code></p></li>
243    /// <li>
244    /// <p><code>postgres</code></p></li>
245    /// <li>
246    /// <p><code>sqlserver-ee</code></p></li>
247    /// <li>
248    /// <p><code>sqlserver-se</code></p></li>
249    /// <li>
250    /// <p><code>sqlserver-ex</code></p></li>
251    /// <li>
252    /// <p><code>sqlserver-web</code></p></li>
253    /// </ul>
254    pub fn get_engine_name(&self) -> &::std::option::Option<::std::string::String> {
255        self.inner.get_engine_name()
256    }
257    /// <p>Specifies the major version of the engine that this option group should be associated with.</p>
258    pub fn major_engine_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
259        self.inner = self.inner.major_engine_version(input.into());
260        self
261    }
262    /// <p>Specifies the major version of the engine that this option group should be associated with.</p>
263    pub fn set_major_engine_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
264        self.inner = self.inner.set_major_engine_version(input);
265        self
266    }
267    /// <p>Specifies the major version of the engine that this option group should be associated with.</p>
268    pub fn get_major_engine_version(&self) -> &::std::option::Option<::std::string::String> {
269        self.inner.get_major_engine_version()
270    }
271    /// <p>The description of the option group.</p>
272    pub fn option_group_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
273        self.inner = self.inner.option_group_description(input.into());
274        self
275    }
276    /// <p>The description of the option group.</p>
277    pub fn set_option_group_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
278        self.inner = self.inner.set_option_group_description(input);
279        self
280    }
281    /// <p>The description of the option group.</p>
282    pub fn get_option_group_description(&self) -> &::std::option::Option<::std::string::String> {
283        self.inner.get_option_group_description()
284    }
285    ///
286    /// Appends an item to `Tags`.
287    ///
288    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
289    ///
290    /// <p>Tags to assign to the option group.</p>
291    pub fn tags(mut self, input: crate::types::Tag) -> Self {
292        self.inner = self.inner.tags(input);
293        self
294    }
295    /// <p>Tags to assign to the option group.</p>
296    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
297        self.inner = self.inner.set_tags(input);
298        self
299    }
300    /// <p>Tags to assign to the option group.</p>
301    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
302        self.inner.get_tags()
303    }
304}