aws_sdk_docdb/operation/copy_db_cluster_parameter_group/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::copy_db_cluster_parameter_group::_copy_db_cluster_parameter_group_output::CopyDbClusterParameterGroupOutputBuilder;
3
4pub use crate::operation::copy_db_cluster_parameter_group::_copy_db_cluster_parameter_group_input::CopyDbClusterParameterGroupInputBuilder;
5
6impl crate::operation::copy_db_cluster_parameter_group::builders::CopyDbClusterParameterGroupInputBuilder {
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::copy_db_cluster_parameter_group::CopyDbClusterParameterGroupOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::copy_db_cluster_parameter_group::CopyDBClusterParameterGroupError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.copy_db_cluster_parameter_group();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CopyDBClusterParameterGroup`.
24///
25/// <p>Copies the specified cluster parameter group.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CopyDBClusterParameterGroupFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::copy_db_cluster_parameter_group::builders::CopyDbClusterParameterGroupInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::copy_db_cluster_parameter_group::CopyDbClusterParameterGroupOutput,
35        crate::operation::copy_db_cluster_parameter_group::CopyDBClusterParameterGroupError,
36    > for CopyDBClusterParameterGroupFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::copy_db_cluster_parameter_group::CopyDbClusterParameterGroupOutput,
44            crate::operation::copy_db_cluster_parameter_group::CopyDBClusterParameterGroupError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CopyDBClusterParameterGroupFluentBuilder {
51    /// Creates a new `CopyDBClusterParameterGroupFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CopyDBClusterParameterGroup as a reference.
60    pub fn as_input(&self) -> &crate::operation::copy_db_cluster_parameter_group::builders::CopyDbClusterParameterGroupInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::copy_db_cluster_parameter_group::CopyDbClusterParameterGroupOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::copy_db_cluster_parameter_group::CopyDBClusterParameterGroupError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::copy_db_cluster_parameter_group::CopyDBClusterParameterGroup::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::copy_db_cluster_parameter_group::CopyDBClusterParameterGroup::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::copy_db_cluster_parameter_group::CopyDbClusterParameterGroupOutput,
97        crate::operation::copy_db_cluster_parameter_group::CopyDBClusterParameterGroupError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The identifier or Amazon Resource Name (ARN) for the source cluster parameter group.</p>
112    /// <p>Constraints:</p>
113    /// <ul>
114    /// <li>
115    /// <p>Must specify a valid cluster parameter group.</p></li>
116    /// <li>
117    /// <p>If the source cluster parameter group is in the same Amazon Web Services Region as the copy, specify a valid parameter group identifier; for example, <code>my-db-cluster-param-group</code>, or a valid ARN.</p></li>
118    /// <li>
119    /// <p>If the source parameter group is in a different Amazon Web Services Region than the copy, specify a valid cluster parameter group ARN; for example, <code>arn:aws:rds:us-east-1:123456789012:sample-cluster:sample-parameter-group</code>.</p></li>
120    /// </ul>
121    pub fn source_db_cluster_parameter_group_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.inner = self.inner.source_db_cluster_parameter_group_identifier(input.into());
123        self
124    }
125    /// <p>The identifier or Amazon Resource Name (ARN) for the source cluster parameter group.</p>
126    /// <p>Constraints:</p>
127    /// <ul>
128    /// <li>
129    /// <p>Must specify a valid cluster parameter group.</p></li>
130    /// <li>
131    /// <p>If the source cluster parameter group is in the same Amazon Web Services Region as the copy, specify a valid parameter group identifier; for example, <code>my-db-cluster-param-group</code>, or a valid ARN.</p></li>
132    /// <li>
133    /// <p>If the source parameter group is in a different Amazon Web Services Region than the copy, specify a valid cluster parameter group ARN; for example, <code>arn:aws:rds:us-east-1:123456789012:sample-cluster:sample-parameter-group</code>.</p></li>
134    /// </ul>
135    pub fn set_source_db_cluster_parameter_group_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_source_db_cluster_parameter_group_identifier(input);
137        self
138    }
139    /// <p>The identifier or Amazon Resource Name (ARN) for the source cluster parameter group.</p>
140    /// <p>Constraints:</p>
141    /// <ul>
142    /// <li>
143    /// <p>Must specify a valid cluster parameter group.</p></li>
144    /// <li>
145    /// <p>If the source cluster parameter group is in the same Amazon Web Services Region as the copy, specify a valid parameter group identifier; for example, <code>my-db-cluster-param-group</code>, or a valid ARN.</p></li>
146    /// <li>
147    /// <p>If the source parameter group is in a different Amazon Web Services Region than the copy, specify a valid cluster parameter group ARN; for example, <code>arn:aws:rds:us-east-1:123456789012:sample-cluster:sample-parameter-group</code>.</p></li>
148    /// </ul>
149    pub fn get_source_db_cluster_parameter_group_identifier(&self) -> &::std::option::Option<::std::string::String> {
150        self.inner.get_source_db_cluster_parameter_group_identifier()
151    }
152    /// <p>The identifier for the copied cluster parameter group.</p>
153    /// <p>Constraints:</p>
154    /// <ul>
155    /// <li>
156    /// <p>Cannot be null, empty, or blank.</p></li>
157    /// <li>
158    /// <p>Must contain from 1 to 255 letters, numbers, or hyphens.</p></li>
159    /// <li>
160    /// <p>The first character must be a letter.</p></li>
161    /// <li>
162    /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
163    /// </ul>
164    /// <p>Example: <code>my-cluster-param-group1</code></p>
165    pub fn target_db_cluster_parameter_group_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166        self.inner = self.inner.target_db_cluster_parameter_group_identifier(input.into());
167        self
168    }
169    /// <p>The identifier for the copied cluster parameter group.</p>
170    /// <p>Constraints:</p>
171    /// <ul>
172    /// <li>
173    /// <p>Cannot be null, empty, or blank.</p></li>
174    /// <li>
175    /// <p>Must contain from 1 to 255 letters, numbers, or hyphens.</p></li>
176    /// <li>
177    /// <p>The first character must be a letter.</p></li>
178    /// <li>
179    /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
180    /// </ul>
181    /// <p>Example: <code>my-cluster-param-group1</code></p>
182    pub fn set_target_db_cluster_parameter_group_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183        self.inner = self.inner.set_target_db_cluster_parameter_group_identifier(input);
184        self
185    }
186    /// <p>The identifier for the copied cluster parameter group.</p>
187    /// <p>Constraints:</p>
188    /// <ul>
189    /// <li>
190    /// <p>Cannot be null, empty, or blank.</p></li>
191    /// <li>
192    /// <p>Must contain from 1 to 255 letters, numbers, or hyphens.</p></li>
193    /// <li>
194    /// <p>The first character must be a letter.</p></li>
195    /// <li>
196    /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
197    /// </ul>
198    /// <p>Example: <code>my-cluster-param-group1</code></p>
199    pub fn get_target_db_cluster_parameter_group_identifier(&self) -> &::std::option::Option<::std::string::String> {
200        self.inner.get_target_db_cluster_parameter_group_identifier()
201    }
202    /// <p>A description for the copied cluster parameter group.</p>
203    pub fn target_db_cluster_parameter_group_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
204        self.inner = self.inner.target_db_cluster_parameter_group_description(input.into());
205        self
206    }
207    /// <p>A description for the copied cluster parameter group.</p>
208    pub fn set_target_db_cluster_parameter_group_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
209        self.inner = self.inner.set_target_db_cluster_parameter_group_description(input);
210        self
211    }
212    /// <p>A description for the copied cluster parameter group.</p>
213    pub fn get_target_db_cluster_parameter_group_description(&self) -> &::std::option::Option<::std::string::String> {
214        self.inner.get_target_db_cluster_parameter_group_description()
215    }
216    ///
217    /// Appends an item to `Tags`.
218    ///
219    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
220    ///
221    /// <p>The tags that are to be assigned to the parameter group.</p>
222    pub fn tags(mut self, input: crate::types::Tag) -> Self {
223        self.inner = self.inner.tags(input);
224        self
225    }
226    /// <p>The tags that are to be assigned to the parameter group.</p>
227    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
228        self.inner = self.inner.set_tags(input);
229        self
230    }
231    /// <p>The tags that are to be assigned to the parameter group.</p>
232    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
233        self.inner.get_tags()
234    }
235}