aws_sdk_docdb/operation/copy_db_cluster_snapshot/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::copy_db_cluster_snapshot::_copy_db_cluster_snapshot_output::CopyDbClusterSnapshotOutputBuilder;
3
4pub use crate::operation::copy_db_cluster_snapshot::_copy_db_cluster_snapshot_input::CopyDbClusterSnapshotInputBuilder;
5
6impl crate::operation::copy_db_cluster_snapshot::builders::CopyDbClusterSnapshotInputBuilder {
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_snapshot::CopyDbClusterSnapshotOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::copy_db_cluster_snapshot::CopyDBClusterSnapshotError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.copy_db_cluster_snapshot();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CopyDBClusterSnapshot`.
24///
25/// <p>Copies a snapshot of a cluster.</p>
26/// <p>To copy a cluster snapshot from a shared manual cluster snapshot, <code>SourceDBClusterSnapshotIdentifier</code> must be the Amazon Resource Name (ARN) of the shared cluster snapshot. You can only copy a shared DB cluster snapshot, whether encrypted or not, in the same Amazon Web Services Region.</p>
27/// <p>To cancel the copy operation after it is in progress, delete the target cluster snapshot identified by <code>TargetDBClusterSnapshotIdentifier</code> while that cluster snapshot is in the <i>copying</i> status.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CopyDBClusterSnapshotFluentBuilder {
30 handle: ::std::sync::Arc<crate::client::Handle>,
31 inner: crate::operation::copy_db_cluster_snapshot::builders::CopyDbClusterSnapshotInputBuilder,
32 config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35 crate::client::customize::internal::CustomizableSend<
36 crate::operation::copy_db_cluster_snapshot::CopyDbClusterSnapshotOutput,
37 crate::operation::copy_db_cluster_snapshot::CopyDBClusterSnapshotError,
38 > for CopyDBClusterSnapshotFluentBuilder
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::copy_db_cluster_snapshot::CopyDbClusterSnapshotOutput,
46 crate::operation::copy_db_cluster_snapshot::CopyDBClusterSnapshotError,
47 >,
48 > {
49 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50 }
51}
52impl CopyDBClusterSnapshotFluentBuilder {
53 /// Creates a new `CopyDBClusterSnapshotFluentBuilder`.
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 CopyDBClusterSnapshot as a reference.
62 pub fn as_input(&self) -> &crate::operation::copy_db_cluster_snapshot::builders::CopyDbClusterSnapshotInputBuilder {
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::copy_db_cluster_snapshot::CopyDbClusterSnapshotOutput,
77 ::aws_smithy_runtime_api::client::result::SdkError<
78 crate::operation::copy_db_cluster_snapshot::CopyDBClusterSnapshotError,
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::copy_db_cluster_snapshot::CopyDBClusterSnapshot::operation_runtime_plugins(
87 self.handle.runtime_plugins.clone(),
88 &self.handle.conf,
89 self.config_override,
90 );
91 crate::operation::copy_db_cluster_snapshot::CopyDBClusterSnapshot::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::copy_db_cluster_snapshot::CopyDbClusterSnapshotOutput,
99 crate::operation::copy_db_cluster_snapshot::CopyDBClusterSnapshotError,
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 identifier of the cluster snapshot to copy. This parameter is not case sensitive.</p>
114 /// <p>Constraints:</p>
115 /// <ul>
116 /// <li>
117 /// <p>Must specify a valid cluster snapshot in the <i>available</i> state.</p></li>
118 /// <li>
119 /// <p>If the source cluster snapshot is in the same Amazon Web Services Region as the copy, specify a valid snapshot identifier.</p></li>
120 /// <li>
121 /// <p>If the source cluster snapshot is in a different Amazon Web Services Region or owned by another Amazon Web Services account, specify the snapshot ARN.</p></li>
122 /// </ul>
123 /// <p>Example: <code>my-cluster-snapshot1</code></p>
124 pub fn source_db_cluster_snapshot_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125 self.inner = self.inner.source_db_cluster_snapshot_identifier(input.into());
126 self
127 }
128 /// <p>The identifier of the cluster snapshot to copy. This parameter is not case sensitive.</p>
129 /// <p>Constraints:</p>
130 /// <ul>
131 /// <li>
132 /// <p>Must specify a valid cluster snapshot in the <i>available</i> state.</p></li>
133 /// <li>
134 /// <p>If the source cluster snapshot is in the same Amazon Web Services Region as the copy, specify a valid snapshot identifier.</p></li>
135 /// <li>
136 /// <p>If the source cluster snapshot is in a different Amazon Web Services Region or owned by another Amazon Web Services account, specify the snapshot ARN.</p></li>
137 /// </ul>
138 /// <p>Example: <code>my-cluster-snapshot1</code></p>
139 pub fn set_source_db_cluster_snapshot_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140 self.inner = self.inner.set_source_db_cluster_snapshot_identifier(input);
141 self
142 }
143 /// <p>The identifier of the cluster snapshot to copy. This parameter is not case sensitive.</p>
144 /// <p>Constraints:</p>
145 /// <ul>
146 /// <li>
147 /// <p>Must specify a valid cluster snapshot in the <i>available</i> state.</p></li>
148 /// <li>
149 /// <p>If the source cluster snapshot is in the same Amazon Web Services Region as the copy, specify a valid snapshot identifier.</p></li>
150 /// <li>
151 /// <p>If the source cluster snapshot is in a different Amazon Web Services Region or owned by another Amazon Web Services account, specify the snapshot ARN.</p></li>
152 /// </ul>
153 /// <p>Example: <code>my-cluster-snapshot1</code></p>
154 pub fn get_source_db_cluster_snapshot_identifier(&self) -> &::std::option::Option<::std::string::String> {
155 self.inner.get_source_db_cluster_snapshot_identifier()
156 }
157 /// <p>The identifier of the new cluster snapshot to create from the source cluster snapshot. This parameter is not case sensitive.</p>
158 /// <p>Constraints:</p>
159 /// <ul>
160 /// <li>
161 /// <p>Must contain from 1 to 63 letters, numbers, or hyphens.</p></li>
162 /// <li>
163 /// <p>The first character must be a letter.</p></li>
164 /// <li>
165 /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
166 /// </ul>
167 /// <p>Example: <code>my-cluster-snapshot2</code></p>
168 pub fn target_db_cluster_snapshot_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169 self.inner = self.inner.target_db_cluster_snapshot_identifier(input.into());
170 self
171 }
172 /// <p>The identifier of the new cluster snapshot to create from the source cluster snapshot. This parameter is not case sensitive.</p>
173 /// <p>Constraints:</p>
174 /// <ul>
175 /// <li>
176 /// <p>Must contain from 1 to 63 letters, numbers, or hyphens.</p></li>
177 /// <li>
178 /// <p>The first character must be a letter.</p></li>
179 /// <li>
180 /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
181 /// </ul>
182 /// <p>Example: <code>my-cluster-snapshot2</code></p>
183 pub fn set_target_db_cluster_snapshot_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
184 self.inner = self.inner.set_target_db_cluster_snapshot_identifier(input);
185 self
186 }
187 /// <p>The identifier of the new cluster snapshot to create from the source cluster snapshot. This parameter is not case sensitive.</p>
188 /// <p>Constraints:</p>
189 /// <ul>
190 /// <li>
191 /// <p>Must contain from 1 to 63 letters, numbers, or hyphens.</p></li>
192 /// <li>
193 /// <p>The first character must be a letter.</p></li>
194 /// <li>
195 /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
196 /// </ul>
197 /// <p>Example: <code>my-cluster-snapshot2</code></p>
198 pub fn get_target_db_cluster_snapshot_identifier(&self) -> &::std::option::Option<::std::string::String> {
199 self.inner.get_target_db_cluster_snapshot_identifier()
200 }
201 /// <p>The KMS key ID for an encrypted cluster snapshot. The KMS key ID is the Amazon Resource Name (ARN), KMS key identifier, or the KMS key alias for the KMS encryption key.</p>
202 /// <p>If you copy an encrypted cluster snapshot from your Amazon Web Services account, you can specify a value for <code>KmsKeyId</code> to encrypt the copy with a new KMS encryption key. If you don't specify a value for <code>KmsKeyId</code>, then the copy of the cluster snapshot is encrypted with the same KMS key as the source cluster snapshot.</p>
203 /// <p>If you copy an encrypted cluster snapshot that is shared from another Amazon Web Services account, then you must specify a value for <code>KmsKeyId</code>.</p>
204 /// <p>To copy an encrypted cluster snapshot to another Amazon Web Services Region, set <code>KmsKeyId</code> to the KMS key ID that you want to use to encrypt the copy of the cluster snapshot in the destination Region. KMS encryption keys are specific to the Amazon Web Services Region that they are created in, and you can't use encryption keys from one Amazon Web Services Region in another Amazon Web Services Region.</p>
205 /// <p>If you copy an unencrypted cluster snapshot and specify a value for the <code>KmsKeyId</code> parameter, an error is returned.</p>
206 pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
207 self.inner = self.inner.kms_key_id(input.into());
208 self
209 }
210 /// <p>The KMS key ID for an encrypted cluster snapshot. The KMS key ID is the Amazon Resource Name (ARN), KMS key identifier, or the KMS key alias for the KMS encryption key.</p>
211 /// <p>If you copy an encrypted cluster snapshot from your Amazon Web Services account, you can specify a value for <code>KmsKeyId</code> to encrypt the copy with a new KMS encryption key. If you don't specify a value for <code>KmsKeyId</code>, then the copy of the cluster snapshot is encrypted with the same KMS key as the source cluster snapshot.</p>
212 /// <p>If you copy an encrypted cluster snapshot that is shared from another Amazon Web Services account, then you must specify a value for <code>KmsKeyId</code>.</p>
213 /// <p>To copy an encrypted cluster snapshot to another Amazon Web Services Region, set <code>KmsKeyId</code> to the KMS key ID that you want to use to encrypt the copy of the cluster snapshot in the destination Region. KMS encryption keys are specific to the Amazon Web Services Region that they are created in, and you can't use encryption keys from one Amazon Web Services Region in another Amazon Web Services Region.</p>
214 /// <p>If you copy an unencrypted cluster snapshot and specify a value for the <code>KmsKeyId</code> parameter, an error is returned.</p>
215 pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216 self.inner = self.inner.set_kms_key_id(input);
217 self
218 }
219 /// <p>The KMS key ID for an encrypted cluster snapshot. The KMS key ID is the Amazon Resource Name (ARN), KMS key identifier, or the KMS key alias for the KMS encryption key.</p>
220 /// <p>If you copy an encrypted cluster snapshot from your Amazon Web Services account, you can specify a value for <code>KmsKeyId</code> to encrypt the copy with a new KMS encryption key. If you don't specify a value for <code>KmsKeyId</code>, then the copy of the cluster snapshot is encrypted with the same KMS key as the source cluster snapshot.</p>
221 /// <p>If you copy an encrypted cluster snapshot that is shared from another Amazon Web Services account, then you must specify a value for <code>KmsKeyId</code>.</p>
222 /// <p>To copy an encrypted cluster snapshot to another Amazon Web Services Region, set <code>KmsKeyId</code> to the KMS key ID that you want to use to encrypt the copy of the cluster snapshot in the destination Region. KMS encryption keys are specific to the Amazon Web Services Region that they are created in, and you can't use encryption keys from one Amazon Web Services Region in another Amazon Web Services Region.</p>
223 /// <p>If you copy an unencrypted cluster snapshot and specify a value for the <code>KmsKeyId</code> parameter, an error is returned.</p>
224 pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
225 self.inner.get_kms_key_id()
226 }
227 /// <p>The URL that contains a Signature Version 4 signed request for the<code>CopyDBClusterSnapshot</code> API action in the Amazon Web Services Region that contains the source cluster snapshot to copy. You must use the <code>PreSignedUrl</code> parameter when copying a cluster snapshot from another Amazon Web Services Region.</p>
228 /// <p>If you are using an Amazon Web Services SDK tool or the CLI, you can specify <code>SourceRegion</code> (or <code>--source-region</code> for the CLI) instead of specifying <code>PreSignedUrl</code> manually. Specifying <code>SourceRegion</code> autogenerates a pre-signed URL that is a valid request for the operation that can be executed in the source Amazon Web Services Region.</p>
229 /// <p>The presigned URL must be a valid request for the <code>CopyDBClusterSnapshot</code> API action that can be executed in the source Amazon Web Services Region that contains the cluster snapshot to be copied. The presigned URL request must contain the following parameter values:</p>
230 /// <ul>
231 /// <li>
232 /// <p><code>SourceRegion</code> - The ID of the region that contains the snapshot to be copied.</p></li>
233 /// <li>
234 /// <p><code>SourceDBClusterSnapshotIdentifier</code> - The identifier for the the encrypted cluster snapshot to be copied. This identifier must be in the Amazon Resource Name (ARN) format for the source Amazon Web Services Region. For example, if you are copying an encrypted cluster snapshot from the us-east-1 Amazon Web Services Region, then your <code>SourceDBClusterSnapshotIdentifier</code> looks something like the following: <code>arn:aws:rds:us-east-1:12345678012:sample-cluster:sample-cluster-snapshot</code>.</p></li>
235 /// <li>
236 /// <p><code>TargetDBClusterSnapshotIdentifier</code> - The identifier for the new cluster snapshot to be created. This parameter isn't case sensitive.</p></li>
237 /// </ul>
238 pub fn pre_signed_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
239 self.inner = self.inner.pre_signed_url(input.into());
240 self
241 }
242 /// <p>The URL that contains a Signature Version 4 signed request for the<code>CopyDBClusterSnapshot</code> API action in the Amazon Web Services Region that contains the source cluster snapshot to copy. You must use the <code>PreSignedUrl</code> parameter when copying a cluster snapshot from another Amazon Web Services Region.</p>
243 /// <p>If you are using an Amazon Web Services SDK tool or the CLI, you can specify <code>SourceRegion</code> (or <code>--source-region</code> for the CLI) instead of specifying <code>PreSignedUrl</code> manually. Specifying <code>SourceRegion</code> autogenerates a pre-signed URL that is a valid request for the operation that can be executed in the source Amazon Web Services Region.</p>
244 /// <p>The presigned URL must be a valid request for the <code>CopyDBClusterSnapshot</code> API action that can be executed in the source Amazon Web Services Region that contains the cluster snapshot to be copied. The presigned URL request must contain the following parameter values:</p>
245 /// <ul>
246 /// <li>
247 /// <p><code>SourceRegion</code> - The ID of the region that contains the snapshot to be copied.</p></li>
248 /// <li>
249 /// <p><code>SourceDBClusterSnapshotIdentifier</code> - The identifier for the the encrypted cluster snapshot to be copied. This identifier must be in the Amazon Resource Name (ARN) format for the source Amazon Web Services Region. For example, if you are copying an encrypted cluster snapshot from the us-east-1 Amazon Web Services Region, then your <code>SourceDBClusterSnapshotIdentifier</code> looks something like the following: <code>arn:aws:rds:us-east-1:12345678012:sample-cluster:sample-cluster-snapshot</code>.</p></li>
250 /// <li>
251 /// <p><code>TargetDBClusterSnapshotIdentifier</code> - The identifier for the new cluster snapshot to be created. This parameter isn't case sensitive.</p></li>
252 /// </ul>
253 pub fn set_pre_signed_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
254 self.inner = self.inner.set_pre_signed_url(input);
255 self
256 }
257 /// <p>The URL that contains a Signature Version 4 signed request for the<code>CopyDBClusterSnapshot</code> API action in the Amazon Web Services Region that contains the source cluster snapshot to copy. You must use the <code>PreSignedUrl</code> parameter when copying a cluster snapshot from another Amazon Web Services Region.</p>
258 /// <p>If you are using an Amazon Web Services SDK tool or the CLI, you can specify <code>SourceRegion</code> (or <code>--source-region</code> for the CLI) instead of specifying <code>PreSignedUrl</code> manually. Specifying <code>SourceRegion</code> autogenerates a pre-signed URL that is a valid request for the operation that can be executed in the source Amazon Web Services Region.</p>
259 /// <p>The presigned URL must be a valid request for the <code>CopyDBClusterSnapshot</code> API action that can be executed in the source Amazon Web Services Region that contains the cluster snapshot to be copied. The presigned URL request must contain the following parameter values:</p>
260 /// <ul>
261 /// <li>
262 /// <p><code>SourceRegion</code> - The ID of the region that contains the snapshot to be copied.</p></li>
263 /// <li>
264 /// <p><code>SourceDBClusterSnapshotIdentifier</code> - The identifier for the the encrypted cluster snapshot to be copied. This identifier must be in the Amazon Resource Name (ARN) format for the source Amazon Web Services Region. For example, if you are copying an encrypted cluster snapshot from the us-east-1 Amazon Web Services Region, then your <code>SourceDBClusterSnapshotIdentifier</code> looks something like the following: <code>arn:aws:rds:us-east-1:12345678012:sample-cluster:sample-cluster-snapshot</code>.</p></li>
265 /// <li>
266 /// <p><code>TargetDBClusterSnapshotIdentifier</code> - The identifier for the new cluster snapshot to be created. This parameter isn't case sensitive.</p></li>
267 /// </ul>
268 pub fn get_pre_signed_url(&self) -> &::std::option::Option<::std::string::String> {
269 self.inner.get_pre_signed_url()
270 }
271 /// <p>Set to <code>true</code> to copy all tags from the source cluster snapshot to the target cluster snapshot, and otherwise <code>false</code>. The default is <code>false</code>.</p>
272 pub fn copy_tags(mut self, input: bool) -> Self {
273 self.inner = self.inner.copy_tags(input);
274 self
275 }
276 /// <p>Set to <code>true</code> to copy all tags from the source cluster snapshot to the target cluster snapshot, and otherwise <code>false</code>. The default is <code>false</code>.</p>
277 pub fn set_copy_tags(mut self, input: ::std::option::Option<bool>) -> Self {
278 self.inner = self.inner.set_copy_tags(input);
279 self
280 }
281 /// <p>Set to <code>true</code> to copy all tags from the source cluster snapshot to the target cluster snapshot, and otherwise <code>false</code>. The default is <code>false</code>.</p>
282 pub fn get_copy_tags(&self) -> &::std::option::Option<bool> {
283 self.inner.get_copy_tags()
284 }
285 ///
286 /// Appends an item to `Tags`.
287 ///
288 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
289 ///
290 /// <p>The tags to be assigned to the cluster snapshot.</p>
291 pub fn tags(mut self, input: crate::types::Tag) -> Self {
292 self.inner = self.inner.tags(input);
293 self
294 }
295 /// <p>The tags to be assigned to the cluster snapshot.</p>
296 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
297 self.inner = self.inner.set_tags(input);
298 self
299 }
300 /// <p>The tags to be assigned to the cluster snapshot.</p>
301 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
302 self.inner.get_tags()
303 }
304}