aws_sdk_rds/operation/create_db_parameter_group/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_db_parameter_group::_create_db_parameter_group_output::CreateDbParameterGroupOutputBuilder;
3
4pub use crate::operation::create_db_parameter_group::_create_db_parameter_group_input::CreateDbParameterGroupInputBuilder;
5
6impl crate::operation::create_db_parameter_group::builders::CreateDbParameterGroupInputBuilder {
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_db_parameter_group::CreateDbParameterGroupOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_db_parameter_group::CreateDBParameterGroupError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_db_parameter_group();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateDBParameterGroup`.
24///
25/// <p>Creates a new DB parameter group.</p>
26/// <p>A DB parameter group is initially created with the default parameters for the database engine used by the DB instance. To provide custom values for any of the parameters, you must modify the group after creating it using <code>ModifyDBParameterGroup</code>. Once you've created a DB parameter group, you need to associate it with your DB instance using <code>ModifyDBInstance</code>. When you associate a new DB parameter group with a running DB instance, you need to reboot the DB instance without failover for the new DB parameter group and associated settings to take effect.</p>
27/// <p>This command doesn't apply to RDS Custom.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CreateDBParameterGroupFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::create_db_parameter_group::builders::CreateDbParameterGroupInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::create_db_parameter_group::CreateDbParameterGroupOutput,
37        crate::operation::create_db_parameter_group::CreateDBParameterGroupError,
38    > for CreateDBParameterGroupFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::create_db_parameter_group::CreateDbParameterGroupOutput,
46            crate::operation::create_db_parameter_group::CreateDBParameterGroupError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl CreateDBParameterGroupFluentBuilder {
53    /// Creates a new `CreateDBParameterGroupFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the CreateDBParameterGroup as a reference.
62    pub fn as_input(&self) -> &crate::operation::create_db_parameter_group::builders::CreateDbParameterGroupInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::create_db_parameter_group::CreateDbParameterGroupOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::create_db_parameter_group::CreateDBParameterGroupError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins = crate::operation::create_db_parameter_group::CreateDBParameterGroup::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::create_db_parameter_group::CreateDBParameterGroup::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::create_db_parameter_group::CreateDbParameterGroupOutput,
99        crate::operation::create_db_parameter_group::CreateDBParameterGroupError,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// <p>The name of the DB parameter group.</p>
114    /// <p>Constraints:</p>
115    /// <ul>
116    /// <li>
117    /// <p>Must be 1 to 255 letters, numbers, or hyphens.</p></li>
118    /// <li>
119    /// <p>First character must be a letter</p></li>
120    /// <li>
121    /// <p>Can't end with a hyphen or contain two consecutive hyphens</p></li>
122    /// </ul><note>
123    /// <p>This value is stored as a lowercase string.</p>
124    /// </note>
125    pub fn db_parameter_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.inner = self.inner.db_parameter_group_name(input.into());
127        self
128    }
129    /// <p>The name of the DB parameter group.</p>
130    /// <p>Constraints:</p>
131    /// <ul>
132    /// <li>
133    /// <p>Must be 1 to 255 letters, numbers, or hyphens.</p></li>
134    /// <li>
135    /// <p>First character must be a letter</p></li>
136    /// <li>
137    /// <p>Can't end with a hyphen or contain two consecutive hyphens</p></li>
138    /// </ul><note>
139    /// <p>This value is stored as a lowercase string.</p>
140    /// </note>
141    pub fn set_db_parameter_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.inner = self.inner.set_db_parameter_group_name(input);
143        self
144    }
145    /// <p>The name of the DB parameter group.</p>
146    /// <p>Constraints:</p>
147    /// <ul>
148    /// <li>
149    /// <p>Must be 1 to 255 letters, numbers, or hyphens.</p></li>
150    /// <li>
151    /// <p>First character must be a letter</p></li>
152    /// <li>
153    /// <p>Can't end with a hyphen or contain two consecutive hyphens</p></li>
154    /// </ul><note>
155    /// <p>This value is stored as a lowercase string.</p>
156    /// </note>
157    pub fn get_db_parameter_group_name(&self) -> &::std::option::Option<::std::string::String> {
158        self.inner.get_db_parameter_group_name()
159    }
160    /// <p>The DB parameter group family name. A DB parameter group can be associated with one and only one DB parameter group family, and can be applied only to a DB instance running a database engine and engine version compatible with that DB parameter group family.</p>
161    /// <p>To list all of the available parameter group families for a DB engine, use the following command:</p>
162    /// <p><code>aws rds describe-db-engine-versions --query "DBEngineVersions\[\].DBParameterGroupFamily" --engine</code></p>
163    /// <p>For example, to list all of the available parameter group families for the MySQL DB engine, use the following command:</p>
164    /// <p><code>aws rds describe-db-engine-versions --query "DBEngineVersions\[\].DBParameterGroupFamily" --engine mysql</code></p><note>
165    /// <p>The output contains duplicates.</p>
166    /// </note>
167    /// <p>The following are the valid DB engine values:</p>
168    /// <ul>
169    /// <li>
170    /// <p><code>aurora-mysql</code></p></li>
171    /// <li>
172    /// <p><code>aurora-postgresql</code></p></li>
173    /// <li>
174    /// <p><code>db2-ae</code></p></li>
175    /// <li>
176    /// <p><code>db2-se</code></p></li>
177    /// <li>
178    /// <p><code>mysql</code></p></li>
179    /// <li>
180    /// <p><code>oracle-ee</code></p></li>
181    /// <li>
182    /// <p><code>oracle-ee-cdb</code></p></li>
183    /// <li>
184    /// <p><code>oracle-se2</code></p></li>
185    /// <li>
186    /// <p><code>oracle-se2-cdb</code></p></li>
187    /// <li>
188    /// <p><code>postgres</code></p></li>
189    /// <li>
190    /// <p><code>sqlserver-ee</code></p></li>
191    /// <li>
192    /// <p><code>sqlserver-se</code></p></li>
193    /// <li>
194    /// <p><code>sqlserver-ex</code></p></li>
195    /// <li>
196    /// <p><code>sqlserver-web</code></p></li>
197    /// </ul>
198    pub fn db_parameter_group_family(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199        self.inner = self.inner.db_parameter_group_family(input.into());
200        self
201    }
202    /// <p>The DB parameter group family name. A DB parameter group can be associated with one and only one DB parameter group family, and can be applied only to a DB instance running a database engine and engine version compatible with that DB parameter group family.</p>
203    /// <p>To list all of the available parameter group families for a DB engine, use the following command:</p>
204    /// <p><code>aws rds describe-db-engine-versions --query "DBEngineVersions\[\].DBParameterGroupFamily" --engine</code></p>
205    /// <p>For example, to list all of the available parameter group families for the MySQL DB engine, use the following command:</p>
206    /// <p><code>aws rds describe-db-engine-versions --query "DBEngineVersions\[\].DBParameterGroupFamily" --engine mysql</code></p><note>
207    /// <p>The output contains duplicates.</p>
208    /// </note>
209    /// <p>The following are the valid DB engine values:</p>
210    /// <ul>
211    /// <li>
212    /// <p><code>aurora-mysql</code></p></li>
213    /// <li>
214    /// <p><code>aurora-postgresql</code></p></li>
215    /// <li>
216    /// <p><code>db2-ae</code></p></li>
217    /// <li>
218    /// <p><code>db2-se</code></p></li>
219    /// <li>
220    /// <p><code>mysql</code></p></li>
221    /// <li>
222    /// <p><code>oracle-ee</code></p></li>
223    /// <li>
224    /// <p><code>oracle-ee-cdb</code></p></li>
225    /// <li>
226    /// <p><code>oracle-se2</code></p></li>
227    /// <li>
228    /// <p><code>oracle-se2-cdb</code></p></li>
229    /// <li>
230    /// <p><code>postgres</code></p></li>
231    /// <li>
232    /// <p><code>sqlserver-ee</code></p></li>
233    /// <li>
234    /// <p><code>sqlserver-se</code></p></li>
235    /// <li>
236    /// <p><code>sqlserver-ex</code></p></li>
237    /// <li>
238    /// <p><code>sqlserver-web</code></p></li>
239    /// </ul>
240    pub fn set_db_parameter_group_family(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
241        self.inner = self.inner.set_db_parameter_group_family(input);
242        self
243    }
244    /// <p>The DB parameter group family name. A DB parameter group can be associated with one and only one DB parameter group family, and can be applied only to a DB instance running a database engine and engine version compatible with that DB parameter group family.</p>
245    /// <p>To list all of the available parameter group families for a DB engine, use the following command:</p>
246    /// <p><code>aws rds describe-db-engine-versions --query "DBEngineVersions\[\].DBParameterGroupFamily" --engine</code></p>
247    /// <p>For example, to list all of the available parameter group families for the MySQL DB engine, use the following command:</p>
248    /// <p><code>aws rds describe-db-engine-versions --query "DBEngineVersions\[\].DBParameterGroupFamily" --engine mysql</code></p><note>
249    /// <p>The output contains duplicates.</p>
250    /// </note>
251    /// <p>The following are the valid DB engine values:</p>
252    /// <ul>
253    /// <li>
254    /// <p><code>aurora-mysql</code></p></li>
255    /// <li>
256    /// <p><code>aurora-postgresql</code></p></li>
257    /// <li>
258    /// <p><code>db2-ae</code></p></li>
259    /// <li>
260    /// <p><code>db2-se</code></p></li>
261    /// <li>
262    /// <p><code>mysql</code></p></li>
263    /// <li>
264    /// <p><code>oracle-ee</code></p></li>
265    /// <li>
266    /// <p><code>oracle-ee-cdb</code></p></li>
267    /// <li>
268    /// <p><code>oracle-se2</code></p></li>
269    /// <li>
270    /// <p><code>oracle-se2-cdb</code></p></li>
271    /// <li>
272    /// <p><code>postgres</code></p></li>
273    /// <li>
274    /// <p><code>sqlserver-ee</code></p></li>
275    /// <li>
276    /// <p><code>sqlserver-se</code></p></li>
277    /// <li>
278    /// <p><code>sqlserver-ex</code></p></li>
279    /// <li>
280    /// <p><code>sqlserver-web</code></p></li>
281    /// </ul>
282    pub fn get_db_parameter_group_family(&self) -> &::std::option::Option<::std::string::String> {
283        self.inner.get_db_parameter_group_family()
284    }
285    /// <p>The description for the DB parameter group.</p>
286    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
287        self.inner = self.inner.description(input.into());
288        self
289    }
290    /// <p>The description for the DB parameter group.</p>
291    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
292        self.inner = self.inner.set_description(input);
293        self
294    }
295    /// <p>The description for the DB parameter group.</p>
296    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
297        self.inner.get_description()
298    }
299    ///
300    /// Appends an item to `Tags`.
301    ///
302    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
303    ///
304    /// <p>Tags to assign to the DB parameter group.</p>
305    pub fn tags(mut self, input: crate::types::Tag) -> Self {
306        self.inner = self.inner.tags(input);
307        self
308    }
309    /// <p>Tags to assign to the DB parameter group.</p>
310    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
311        self.inner = self.inner.set_tags(input);
312        self
313    }
314    /// <p>Tags to assign to the DB parameter group.</p>
315    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
316        self.inner.get_tags()
317    }
318}