aws_sdk_neptune/operation/delete_db_instance/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_db_instance::_delete_db_instance_output::DeleteDbInstanceOutputBuilder;
3
4pub use crate::operation::delete_db_instance::_delete_db_instance_input::DeleteDbInstanceInputBuilder;
5
6impl crate::operation::delete_db_instance::builders::DeleteDbInstanceInputBuilder {
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_instance::DeleteDbInstanceOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::delete_db_instance::DeleteDBInstanceError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.delete_db_instance();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DeleteDBInstance`.
24///
25/// <p>The DeleteDBInstance action deletes a previously provisioned DB instance. When you delete a DB instance, all automated backups for that instance are deleted and can't be recovered. Manual DB snapshots of the DB instance to be deleted by <code>DeleteDBInstance</code> are not deleted.</p>
26/// <p>If you request a final DB snapshot the status of the Amazon Neptune DB instance is <code>deleting</code> until the DB snapshot is created. The API action <code>DescribeDBInstance</code> is used to monitor the status of this operation. The action can't be canceled or reverted once submitted.</p>
27/// <p>Note that when a DB instance is in a failure state and has a status of <code>failed</code>, <code>incompatible-restore</code>, or <code>incompatible-network</code>, you can only delete it when the <code>SkipFinalSnapshot</code> parameter is set to <code>true</code>.</p>
28/// <p>You can't delete a DB instance if it is the only instance in the DB cluster, or if it has deletion protection enabled.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct DeleteDBInstanceFluentBuilder {
31 handle: ::std::sync::Arc<crate::client::Handle>,
32 inner: crate::operation::delete_db_instance::builders::DeleteDbInstanceInputBuilder,
33 config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36 crate::client::customize::internal::CustomizableSend<
37 crate::operation::delete_db_instance::DeleteDbInstanceOutput,
38 crate::operation::delete_db_instance::DeleteDBInstanceError,
39 > for DeleteDBInstanceFluentBuilder
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_instance::DeleteDbInstanceOutput,
47 crate::operation::delete_db_instance::DeleteDBInstanceError,
48 >,
49 > {
50 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51 }
52}
53impl DeleteDBInstanceFluentBuilder {
54 /// Creates a new `DeleteDBInstanceFluentBuilder`.
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 DeleteDBInstance as a reference.
63 pub fn as_input(&self) -> &crate::operation::delete_db_instance::builders::DeleteDbInstanceInputBuilder {
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_instance::DeleteDbInstanceOutput,
78 ::aws_smithy_runtime_api::client::result::SdkError<
79 crate::operation::delete_db_instance::DeleteDBInstanceError,
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_instance::DeleteDBInstance::operation_runtime_plugins(
88 self.handle.runtime_plugins.clone(),
89 &self.handle.conf,
90 self.config_override,
91 );
92 crate::operation::delete_db_instance::DeleteDBInstance::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_instance::DeleteDbInstanceOutput,
100 crate::operation::delete_db_instance::DeleteDBInstanceError,
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 instance identifier for the DB instance to be deleted. This parameter isn't case-sensitive.</p>
115 /// <p>Constraints:</p>
116 /// <ul>
117 /// <li>
118 /// <p>Must match the name of an existing DB instance.</p></li>
119 /// </ul>
120 pub fn db_instance_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 self.inner = self.inner.db_instance_identifier(input.into());
122 self
123 }
124 /// <p>The DB instance identifier for the DB instance to be deleted. This parameter isn't case-sensitive.</p>
125 /// <p>Constraints:</p>
126 /// <ul>
127 /// <li>
128 /// <p>Must match the name of an existing DB instance.</p></li>
129 /// </ul>
130 pub fn set_db_instance_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131 self.inner = self.inner.set_db_instance_identifier(input);
132 self
133 }
134 /// <p>The DB instance identifier for the DB instance to be deleted. This parameter isn't case-sensitive.</p>
135 /// <p>Constraints:</p>
136 /// <ul>
137 /// <li>
138 /// <p>Must match the name of an existing DB instance.</p></li>
139 /// </ul>
140 pub fn get_db_instance_identifier(&self) -> &::std::option::Option<::std::string::String> {
141 self.inner.get_db_instance_identifier()
142 }
143 /// <p>Determines whether a final DB snapshot is created before the DB instance is deleted. If <code>true</code> is specified, no DBSnapshot is created. If <code>false</code> is specified, a DB snapshot is created before the DB instance is deleted.</p>
144 /// <p>Note that when a DB instance is in a failure state and has a status of 'failed', 'incompatible-restore', or 'incompatible-network', it can only be deleted when the SkipFinalSnapshot parameter is set to "true".</p>
145 /// <p>Specify <code>true</code> when deleting a Read Replica.</p><note>
146 /// <p>The FinalDBSnapshotIdentifier parameter must be specified if SkipFinalSnapshot is <code>false</code>.</p>
147 /// </note>
148 /// <p>Default: <code>false</code></p>
149 pub fn skip_final_snapshot(mut self, input: bool) -> Self {
150 self.inner = self.inner.skip_final_snapshot(input);
151 self
152 }
153 /// <p>Determines whether a final DB snapshot is created before the DB instance is deleted. If <code>true</code> is specified, no DBSnapshot is created. If <code>false</code> is specified, a DB snapshot is created before the DB instance is deleted.</p>
154 /// <p>Note that when a DB instance is in a failure state and has a status of 'failed', 'incompatible-restore', or 'incompatible-network', it can only be deleted when the SkipFinalSnapshot parameter is set to "true".</p>
155 /// <p>Specify <code>true</code> when deleting a Read Replica.</p><note>
156 /// <p>The FinalDBSnapshotIdentifier parameter must be specified if SkipFinalSnapshot is <code>false</code>.</p>
157 /// </note>
158 /// <p>Default: <code>false</code></p>
159 pub fn set_skip_final_snapshot(mut self, input: ::std::option::Option<bool>) -> Self {
160 self.inner = self.inner.set_skip_final_snapshot(input);
161 self
162 }
163 /// <p>Determines whether a final DB snapshot is created before the DB instance is deleted. If <code>true</code> is specified, no DBSnapshot is created. If <code>false</code> is specified, a DB snapshot is created before the DB instance is deleted.</p>
164 /// <p>Note that when a DB instance is in a failure state and has a status of 'failed', 'incompatible-restore', or 'incompatible-network', it can only be deleted when the SkipFinalSnapshot parameter is set to "true".</p>
165 /// <p>Specify <code>true</code> when deleting a Read Replica.</p><note>
166 /// <p>The FinalDBSnapshotIdentifier parameter must be specified if SkipFinalSnapshot is <code>false</code>.</p>
167 /// </note>
168 /// <p>Default: <code>false</code></p>
169 pub fn get_skip_final_snapshot(&self) -> &::std::option::Option<bool> {
170 self.inner.get_skip_final_snapshot()
171 }
172 /// <p>The DBSnapshotIdentifier of the new DBSnapshot created when SkipFinalSnapshot is set to <code>false</code>.</p><note>
173 /// <p>Specifying this parameter and also setting the SkipFinalShapshot parameter to true results in an error.</p>
174 /// </note>
175 /// <p>Constraints:</p>
176 /// <ul>
177 /// <li>
178 /// <p>Must be 1 to 255 letters or numbers.</p></li>
179 /// <li>
180 /// <p>First character must be a letter</p></li>
181 /// <li>
182 /// <p>Cannot end with a hyphen or contain two consecutive hyphens</p></li>
183 /// <li>
184 /// <p>Cannot be specified when deleting a Read Replica.</p></li>
185 /// </ul>
186 pub fn final_db_snapshot_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187 self.inner = self.inner.final_db_snapshot_identifier(input.into());
188 self
189 }
190 /// <p>The DBSnapshotIdentifier of the new DBSnapshot created when SkipFinalSnapshot is set to <code>false</code>.</p><note>
191 /// <p>Specifying this parameter and also setting the SkipFinalShapshot parameter to true results in an error.</p>
192 /// </note>
193 /// <p>Constraints:</p>
194 /// <ul>
195 /// <li>
196 /// <p>Must be 1 to 255 letters or numbers.</p></li>
197 /// <li>
198 /// <p>First character must be a letter</p></li>
199 /// <li>
200 /// <p>Cannot end with a hyphen or contain two consecutive hyphens</p></li>
201 /// <li>
202 /// <p>Cannot be specified when deleting a Read Replica.</p></li>
203 /// </ul>
204 pub fn set_final_db_snapshot_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
205 self.inner = self.inner.set_final_db_snapshot_identifier(input);
206 self
207 }
208 /// <p>The DBSnapshotIdentifier of the new DBSnapshot created when SkipFinalSnapshot is set to <code>false</code>.</p><note>
209 /// <p>Specifying this parameter and also setting the SkipFinalShapshot parameter to true results in an error.</p>
210 /// </note>
211 /// <p>Constraints:</p>
212 /// <ul>
213 /// <li>
214 /// <p>Must be 1 to 255 letters or numbers.</p></li>
215 /// <li>
216 /// <p>First character must be a letter</p></li>
217 /// <li>
218 /// <p>Cannot end with a hyphen or contain two consecutive hyphens</p></li>
219 /// <li>
220 /// <p>Cannot be specified when deleting a Read Replica.</p></li>
221 /// </ul>
222 pub fn get_final_db_snapshot_identifier(&self) -> &::std::option::Option<::std::string::String> {
223 self.inner.get_final_db_snapshot_identifier()
224 }
225}