aws_sdk_neptune/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 <i>ModifyDBParameterGroup</i>. Once you've created a DB parameter group, you need to associate it with your DB instance using <i>ModifyDBInstance</i>. 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><important>
27/// <p>After you create a DB parameter group, you should wait at least 5 minutes before creating your first DB instance that uses that DB parameter group as the default parameter group. This allows Amazon Neptune to fully complete the create action before the parameter group is used as the default for a new DB instance. This is especially important for parameters that are critical when creating the default database for a DB instance, such as the character set for the default database defined by the <code>character_set_database</code> parameter. You can use the <i>Parameter Groups</i> option of the Amazon Neptune console or the <i>DescribeDBParameters</i> command to verify that your DB parameter group has been created or modified.</p>
28/// </important>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct CreateDBParameterGroupFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::create_db_parameter_group::builders::CreateDbParameterGroupInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::create_db_parameter_group::CreateDbParameterGroupOutput,
38        crate::operation::create_db_parameter_group::CreateDBParameterGroupError,
39    > for CreateDBParameterGroupFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<
46            crate::operation::create_db_parameter_group::CreateDbParameterGroupOutput,
47            crate::operation::create_db_parameter_group::CreateDBParameterGroupError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl CreateDBParameterGroupFluentBuilder {
54    /// Creates a new `CreateDBParameterGroupFluentBuilder`.
55    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56        Self {
57            handle,
58            inner: ::std::default::Default::default(),
59            config_override: ::std::option::Option::None,
60        }
61    }
62    /// Access the CreateDBParameterGroup as a reference.
63    pub fn as_input(&self) -> &crate::operation::create_db_parameter_group::builders::CreateDbParameterGroupInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::create_db_parameter_group::CreateDbParameterGroupOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::create_db_parameter_group::CreateDBParameterGroupError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins = crate::operation::create_db_parameter_group::CreateDBParameterGroup::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::create_db_parameter_group::CreateDBParameterGroup::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::create_db_parameter_group::CreateDbParameterGroupOutput,
100        crate::operation::create_db_parameter_group::CreateDBParameterGroupError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>The name of the DB parameter group.</p>
115    /// <p>Constraints:</p>
116    /// <ul>
117    /// <li>
118    /// <p>Must be 1 to 255 letters, numbers, or hyphens.</p></li>
119    /// <li>
120    /// <p>First character must be a letter</p></li>
121    /// <li>
122    /// <p>Cannot end with a hyphen or contain two consecutive hyphens</p></li>
123    /// </ul><note>
124    /// <p>This value is stored as a lowercase string.</p>
125    /// </note>
126    pub fn db_parameter_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.db_parameter_group_name(input.into());
128        self
129    }
130    /// <p>The name of the DB parameter group.</p>
131    /// <p>Constraints:</p>
132    /// <ul>
133    /// <li>
134    /// <p>Must be 1 to 255 letters, numbers, or hyphens.</p></li>
135    /// <li>
136    /// <p>First character must be a letter</p></li>
137    /// <li>
138    /// <p>Cannot end with a hyphen or contain two consecutive hyphens</p></li>
139    /// </ul><note>
140    /// <p>This value is stored as a lowercase string.</p>
141    /// </note>
142    pub fn set_db_parameter_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.inner = self.inner.set_db_parameter_group_name(input);
144        self
145    }
146    /// <p>The name of the DB parameter group.</p>
147    /// <p>Constraints:</p>
148    /// <ul>
149    /// <li>
150    /// <p>Must be 1 to 255 letters, numbers, or hyphens.</p></li>
151    /// <li>
152    /// <p>First character must be a letter</p></li>
153    /// <li>
154    /// <p>Cannot end with a hyphen or contain two consecutive hyphens</p></li>
155    /// </ul><note>
156    /// <p>This value is stored as a lowercase string.</p>
157    /// </note>
158    pub fn get_db_parameter_group_name(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_db_parameter_group_name()
160    }
161    /// <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>
162    pub fn db_parameter_group_family(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.inner = self.inner.db_parameter_group_family(input.into());
164        self
165    }
166    /// <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>
167    pub fn set_db_parameter_group_family(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.inner = self.inner.set_db_parameter_group_family(input);
169        self
170    }
171    /// <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>
172    pub fn get_db_parameter_group_family(&self) -> &::std::option::Option<::std::string::String> {
173        self.inner.get_db_parameter_group_family()
174    }
175    /// <p>The description for the DB parameter group.</p>
176    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177        self.inner = self.inner.description(input.into());
178        self
179    }
180    /// <p>The description for the DB parameter group.</p>
181    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
182        self.inner = self.inner.set_description(input);
183        self
184    }
185    /// <p>The description for the DB parameter group.</p>
186    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
187        self.inner.get_description()
188    }
189    ///
190    /// Appends an item to `Tags`.
191    ///
192    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
193    ///
194    /// <p>The tags to be assigned to the new DB parameter group.</p>
195    pub fn tags(mut self, input: crate::types::Tag) -> Self {
196        self.inner = self.inner.tags(input);
197        self
198    }
199    /// <p>The tags to be assigned to the new DB parameter group.</p>
200    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
201        self.inner = self.inner.set_tags(input);
202        self
203    }
204    /// <p>The tags to be assigned to the new DB parameter group.</p>
205    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
206        self.inner.get_tags()
207    }
208}