aws_sdk_rds/operation/delete_db_cluster/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_db_cluster::_delete_db_cluster_output::DeleteDbClusterOutputBuilder;
3
4pub use crate::operation::delete_db_cluster::_delete_db_cluster_input::DeleteDbClusterInputBuilder;
5
6impl crate::operation::delete_db_cluster::builders::DeleteDbClusterInputBuilder {
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::delete_db_cluster::DeleteDbClusterOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::delete_db_cluster::DeleteDBClusterError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.delete_db_cluster();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DeleteDBCluster`.
24///
25/// <p>The DeleteDBCluster action deletes a previously provisioned DB cluster. When you delete a DB cluster, all automated backups for that DB cluster are deleted and can't be recovered. Manual DB cluster snapshots of the specified DB cluster are not deleted.</p>
26/// <p>If you're deleting a Multi-AZ DB cluster with read replicas, all cluster members are terminated and read replicas are promoted to standalone instances.</p>
27/// <p>For more information on Amazon Aurora, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html"> What is Amazon Aurora?</a> in the <i>Amazon Aurora User Guide</i>.</p>
28/// <p>For more information on Multi-AZ DB clusters, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html"> Multi-AZ DB cluster deployments</a> in the <i>Amazon RDS User Guide</i>.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct DeleteDBClusterFluentBuilder {
31 handle: ::std::sync::Arc<crate::client::Handle>,
32 inner: crate::operation::delete_db_cluster::builders::DeleteDbClusterInputBuilder,
33 config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36 crate::client::customize::internal::CustomizableSend<
37 crate::operation::delete_db_cluster::DeleteDbClusterOutput,
38 crate::operation::delete_db_cluster::DeleteDBClusterError,
39 > for DeleteDBClusterFluentBuilder
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::delete_db_cluster::DeleteDbClusterOutput,
47 crate::operation::delete_db_cluster::DeleteDBClusterError,
48 >,
49 > {
50 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51 }
52}
53impl DeleteDBClusterFluentBuilder {
54 /// Creates a new `DeleteDBClusterFluentBuilder`.
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 DeleteDBCluster as a reference.
63 pub fn as_input(&self) -> &crate::operation::delete_db_cluster::builders::DeleteDbClusterInputBuilder {
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::delete_db_cluster::DeleteDbClusterOutput,
78 ::aws_smithy_runtime_api::client::result::SdkError<
79 crate::operation::delete_db_cluster::DeleteDBClusterError,
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::delete_db_cluster::DeleteDBCluster::operation_runtime_plugins(
88 self.handle.runtime_plugins.clone(),
89 &self.handle.conf,
90 self.config_override,
91 );
92 crate::operation::delete_db_cluster::DeleteDBCluster::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::delete_db_cluster::DeleteDbClusterOutput,
100 crate::operation::delete_db_cluster::DeleteDBClusterError,
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 DB cluster identifier for the DB cluster to be deleted. This parameter isn't case-sensitive.</p>
115 /// <p>Constraints:</p>
116 /// <ul>
117 /// <li>
118 /// <p>Must match an existing DBClusterIdentifier.</p></li>
119 /// </ul>
120 pub fn db_cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 self.inner = self.inner.db_cluster_identifier(input.into());
122 self
123 }
124 /// <p>The DB cluster identifier for the DB cluster to be deleted. This parameter isn't case-sensitive.</p>
125 /// <p>Constraints:</p>
126 /// <ul>
127 /// <li>
128 /// <p>Must match an existing DBClusterIdentifier.</p></li>
129 /// </ul>
130 pub fn set_db_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131 self.inner = self.inner.set_db_cluster_identifier(input);
132 self
133 }
134 /// <p>The DB cluster identifier for the DB cluster to be deleted. This parameter isn't case-sensitive.</p>
135 /// <p>Constraints:</p>
136 /// <ul>
137 /// <li>
138 /// <p>Must match an existing DBClusterIdentifier.</p></li>
139 /// </ul>
140 pub fn get_db_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
141 self.inner.get_db_cluster_identifier()
142 }
143 /// <p>Specifies whether to skip the creation of a final DB cluster snapshot before RDS deletes the DB cluster. If you set this value to <code>true</code>, RDS doesn't create a final DB cluster snapshot. If you set this value to <code>false</code> or don't specify it, RDS creates a DB cluster snapshot before it deletes the DB cluster. By default, this parameter is disabled, so RDS creates a final DB cluster snapshot.</p><note>
144 /// <p>If <code>SkipFinalSnapshot</code> is disabled, you must specify a value for the <code>FinalDBSnapshotIdentifier</code> parameter.</p>
145 /// </note>
146 pub fn skip_final_snapshot(mut self, input: bool) -> Self {
147 self.inner = self.inner.skip_final_snapshot(input);
148 self
149 }
150 /// <p>Specifies whether to skip the creation of a final DB cluster snapshot before RDS deletes the DB cluster. If you set this value to <code>true</code>, RDS doesn't create a final DB cluster snapshot. If you set this value to <code>false</code> or don't specify it, RDS creates a DB cluster snapshot before it deletes the DB cluster. By default, this parameter is disabled, so RDS creates a final DB cluster snapshot.</p><note>
151 /// <p>If <code>SkipFinalSnapshot</code> is disabled, you must specify a value for the <code>FinalDBSnapshotIdentifier</code> parameter.</p>
152 /// </note>
153 pub fn set_skip_final_snapshot(mut self, input: ::std::option::Option<bool>) -> Self {
154 self.inner = self.inner.set_skip_final_snapshot(input);
155 self
156 }
157 /// <p>Specifies whether to skip the creation of a final DB cluster snapshot before RDS deletes the DB cluster. If you set this value to <code>true</code>, RDS doesn't create a final DB cluster snapshot. If you set this value to <code>false</code> or don't specify it, RDS creates a DB cluster snapshot before it deletes the DB cluster. By default, this parameter is disabled, so RDS creates a final DB cluster snapshot.</p><note>
158 /// <p>If <code>SkipFinalSnapshot</code> is disabled, you must specify a value for the <code>FinalDBSnapshotIdentifier</code> parameter.</p>
159 /// </note>
160 pub fn get_skip_final_snapshot(&self) -> &::std::option::Option<bool> {
161 self.inner.get_skip_final_snapshot()
162 }
163 /// <p>The DB cluster snapshot identifier of the new DB cluster snapshot created when <code>SkipFinalSnapshot</code> is disabled.</p><note>
164 /// <p>If you specify this parameter and also skip the creation of a final DB cluster snapshot with the <code>SkipFinalShapshot</code> parameter, the request results in an error.</p>
165 /// </note>
166 /// <p>Constraints:</p>
167 /// <ul>
168 /// <li>
169 /// <p>Must be 1 to 255 letters, numbers, or hyphens.</p></li>
170 /// <li>
171 /// <p>First character must be a letter</p></li>
172 /// <li>
173 /// <p>Can't end with a hyphen or contain two consecutive hyphens</p></li>
174 /// </ul>
175 pub fn final_db_snapshot_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
176 self.inner = self.inner.final_db_snapshot_identifier(input.into());
177 self
178 }
179 /// <p>The DB cluster snapshot identifier of the new DB cluster snapshot created when <code>SkipFinalSnapshot</code> is disabled.</p><note>
180 /// <p>If you specify this parameter and also skip the creation of a final DB cluster snapshot with the <code>SkipFinalShapshot</code> parameter, the request results in an error.</p>
181 /// </note>
182 /// <p>Constraints:</p>
183 /// <ul>
184 /// <li>
185 /// <p>Must be 1 to 255 letters, numbers, or hyphens.</p></li>
186 /// <li>
187 /// <p>First character must be a letter</p></li>
188 /// <li>
189 /// <p>Can't end with a hyphen or contain two consecutive hyphens</p></li>
190 /// </ul>
191 pub fn set_final_db_snapshot_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192 self.inner = self.inner.set_final_db_snapshot_identifier(input);
193 self
194 }
195 /// <p>The DB cluster snapshot identifier of the new DB cluster snapshot created when <code>SkipFinalSnapshot</code> is disabled.</p><note>
196 /// <p>If you specify this parameter and also skip the creation of a final DB cluster snapshot with the <code>SkipFinalShapshot</code> parameter, the request results in an error.</p>
197 /// </note>
198 /// <p>Constraints:</p>
199 /// <ul>
200 /// <li>
201 /// <p>Must be 1 to 255 letters, numbers, or hyphens.</p></li>
202 /// <li>
203 /// <p>First character must be a letter</p></li>
204 /// <li>
205 /// <p>Can't end with a hyphen or contain two consecutive hyphens</p></li>
206 /// </ul>
207 pub fn get_final_db_snapshot_identifier(&self) -> &::std::option::Option<::std::string::String> {
208 self.inner.get_final_db_snapshot_identifier()
209 }
210 /// <p>Specifies whether to remove automated backups immediately after the DB cluster is deleted. This parameter isn't case-sensitive. The default is to remove automated backups immediately after the DB cluster is deleted, unless the Amazon Web Services Backup policy specifies a point-in-time restore rule.</p>
211 pub fn delete_automated_backups(mut self, input: bool) -> Self {
212 self.inner = self.inner.delete_automated_backups(input);
213 self
214 }
215 /// <p>Specifies whether to remove automated backups immediately after the DB cluster is deleted. This parameter isn't case-sensitive. The default is to remove automated backups immediately after the DB cluster is deleted, unless the Amazon Web Services Backup policy specifies a point-in-time restore rule.</p>
216 pub fn set_delete_automated_backups(mut self, input: ::std::option::Option<bool>) -> Self {
217 self.inner = self.inner.set_delete_automated_backups(input);
218 self
219 }
220 /// <p>Specifies whether to remove automated backups immediately after the DB cluster is deleted. This parameter isn't case-sensitive. The default is to remove automated backups immediately after the DB cluster is deleted, unless the Amazon Web Services Backup policy specifies a point-in-time restore rule.</p>
221 pub fn get_delete_automated_backups(&self) -> &::std::option::Option<bool> {
222 self.inner.get_delete_automated_backups()
223 }
224}