aws_sdk_fsx/operation/copy_backup/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::copy_backup::_copy_backup_output::CopyBackupOutputBuilder;
3
4pub use crate::operation::copy_backup::_copy_backup_input::CopyBackupInputBuilder;
5
6impl crate::operation::copy_backup::builders::CopyBackupInputBuilder {
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_backup::CopyBackupOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::copy_backup::CopyBackupError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.copy_backup();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CopyBackup`.
24///
25/// <p>Copies an existing backup within the same Amazon Web Services account to another Amazon Web Services Region (cross-Region copy) or within the same Amazon Web Services Region (in-Region copy). You can have up to five backup copy requests in progress to a single destination Region per account.</p>
26/// <p>You can use cross-Region backup copies for cross-Region disaster recovery. You can periodically take backups and copy them to another Region so that in the event of a disaster in the primary Region, you can restore from backup and recover availability quickly in the other Region. You can make cross-Region copies only within your Amazon Web Services partition. A partition is a grouping of Regions. Amazon Web Services currently has three partitions: aws (Standard Regions), aws-cn (China Regions), and aws-us-gov (Amazon Web Services GovCloud \[US\] Regions).</p>
27/// <p>You can also use backup copies to clone your file dataset to another Region or within the same Region.</p>
28/// <p>You can use the <code>SourceRegion</code> parameter to specify the Amazon Web Services Region from which the backup will be copied. For example, if you make the call from the <code>us-west-1</code> Region and want to copy a backup from the <code>us-east-2</code> Region, you specify <code>us-east-2</code> in the <code>SourceRegion</code> parameter to make a cross-Region copy. If you don't specify a Region, the backup copy is created in the same Region where the request is sent from (in-Region copy).</p>
29/// <p>For more information about creating backup copies, see <a href="https://docs.aws.amazon.com/fsx/latest/WindowsGuide/using-backups.html#copy-backups"> Copying backups</a> in the <i>Amazon FSx for Windows User Guide</i>, <a href="https://docs.aws.amazon.com/fsx/latest/LustreGuide/using-backups-fsx.html#copy-backups">Copying backups</a> in the <i>Amazon FSx for Lustre User Guide</i>, and <a href="https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/using-backups.html#copy-backups">Copying backups</a> in the <i>Amazon FSx for OpenZFS User Guide</i>.</p>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct CopyBackupFluentBuilder {
32    handle: ::std::sync::Arc<crate::client::Handle>,
33    inner: crate::operation::copy_backup::builders::CopyBackupInputBuilder,
34    config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl
37    crate::client::customize::internal::CustomizableSend<
38        crate::operation::copy_backup::CopyBackupOutput,
39        crate::operation::copy_backup::CopyBackupError,
40    > for CopyBackupFluentBuilder
41{
42    fn send(
43        self,
44        config_override: crate::config::Builder,
45    ) -> crate::client::customize::internal::BoxFuture<
46        crate::client::customize::internal::SendResult<
47            crate::operation::copy_backup::CopyBackupOutput,
48            crate::operation::copy_backup::CopyBackupError,
49        >,
50    > {
51        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
52    }
53}
54impl CopyBackupFluentBuilder {
55    /// Creates a new `CopyBackupFluentBuilder`.
56    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
57        Self {
58            handle,
59            inner: ::std::default::Default::default(),
60            config_override: ::std::option::Option::None,
61        }
62    }
63    /// Access the CopyBackup as a reference.
64    pub fn as_input(&self) -> &crate::operation::copy_backup::builders::CopyBackupInputBuilder {
65        &self.inner
66    }
67    /// Sends the request and returns the response.
68    ///
69    /// If an error occurs, an `SdkError` will be returned with additional details that
70    /// can be matched against.
71    ///
72    /// By default, any retryable failures will be retried twice. Retry behavior
73    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
74    /// set when configuring the client.
75    pub async fn send(
76        self,
77    ) -> ::std::result::Result<
78        crate::operation::copy_backup::CopyBackupOutput,
79        ::aws_smithy_runtime_api::client::result::SdkError<
80            crate::operation::copy_backup::CopyBackupError,
81            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
82        >,
83    > {
84        let input = self
85            .inner
86            .build()
87            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88        let runtime_plugins = crate::operation::copy_backup::CopyBackup::operation_runtime_plugins(
89            self.handle.runtime_plugins.clone(),
90            &self.handle.conf,
91            self.config_override,
92        );
93        crate::operation::copy_backup::CopyBackup::orchestrate(&runtime_plugins, input).await
94    }
95
96    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
97    pub fn customize(
98        self,
99    ) -> crate::client::customize::CustomizableOperation<
100        crate::operation::copy_backup::CopyBackupOutput,
101        crate::operation::copy_backup::CopyBackupError,
102        Self,
103    > {
104        crate::client::customize::CustomizableOperation::new(self)
105    }
106    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
107        self.set_config_override(::std::option::Option::Some(config_override.into()));
108        self
109    }
110
111    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
112        self.config_override = config_override;
113        self
114    }
115    /// <p>(Optional) An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
116    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.inner = self.inner.client_request_token(input.into());
118        self
119    }
120    /// <p>(Optional) An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
121    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.inner = self.inner.set_client_request_token(input);
123        self
124    }
125    /// <p>(Optional) An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
126    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
127        self.inner.get_client_request_token()
128    }
129    /// <p>The ID of the source backup. Specifies the ID of the backup that's being copied.</p>
130    pub fn source_backup_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.source_backup_id(input.into());
132        self
133    }
134    /// <p>The ID of the source backup. Specifies the ID of the backup that's being copied.</p>
135    pub fn set_source_backup_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_source_backup_id(input);
137        self
138    }
139    /// <p>The ID of the source backup. Specifies the ID of the backup that's being copied.</p>
140    pub fn get_source_backup_id(&self) -> &::std::option::Option<::std::string::String> {
141        self.inner.get_source_backup_id()
142    }
143    /// <p>The source Amazon Web Services Region of the backup. Specifies the Amazon Web Services Region from which the backup is being copied. The source and destination Regions must be in the same Amazon Web Services partition. If you don't specify a Region, <code>SourceRegion</code> defaults to the Region where the request is sent from (in-Region copy).</p>
144    pub fn source_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.inner = self.inner.source_region(input.into());
146        self
147    }
148    /// <p>The source Amazon Web Services Region of the backup. Specifies the Amazon Web Services Region from which the backup is being copied. The source and destination Regions must be in the same Amazon Web Services partition. If you don't specify a Region, <code>SourceRegion</code> defaults to the Region where the request is sent from (in-Region copy).</p>
149    pub fn set_source_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.inner = self.inner.set_source_region(input);
151        self
152    }
153    /// <p>The source Amazon Web Services Region of the backup. Specifies the Amazon Web Services Region from which the backup is being copied. The source and destination Regions must be in the same Amazon Web Services partition. If you don't specify a Region, <code>SourceRegion</code> defaults to the Region where the request is sent from (in-Region copy).</p>
154    pub fn get_source_region(&self) -> &::std::option::Option<::std::string::String> {
155        self.inner.get_source_region()
156    }
157    /// <p>Specifies the ID of the Key Management Service (KMS) key to use for encrypting data on Amazon FSx file systems, as follows:</p>
158    /// <ul>
159    /// <li>
160    /// <p>Amazon FSx for Lustre <code>PERSISTENT_1</code> and <code>PERSISTENT_2</code> deployment types only.</p>
161    /// <p><code>SCRATCH_1</code> and <code>SCRATCH_2</code> types are encrypted using the Amazon FSx service KMS key for your account.</p></li>
162    /// <li>
163    /// <p>Amazon FSx for NetApp ONTAP</p></li>
164    /// <li>
165    /// <p>Amazon FSx for OpenZFS</p></li>
166    /// <li>
167    /// <p>Amazon FSx for Windows File Server</p></li>
168    /// </ul>
169    /// <p>If a <code>KmsKeyId</code> isn't specified, the Amazon FSx-managed KMS key for your account is used. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html">Encrypt</a> in the <i>Key Management Service API Reference</i>.</p>
170    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171        self.inner = self.inner.kms_key_id(input.into());
172        self
173    }
174    /// <p>Specifies the ID of the Key Management Service (KMS) key to use for encrypting data on Amazon FSx file systems, as follows:</p>
175    /// <ul>
176    /// <li>
177    /// <p>Amazon FSx for Lustre <code>PERSISTENT_1</code> and <code>PERSISTENT_2</code> deployment types only.</p>
178    /// <p><code>SCRATCH_1</code> and <code>SCRATCH_2</code> types are encrypted using the Amazon FSx service KMS key for your account.</p></li>
179    /// <li>
180    /// <p>Amazon FSx for NetApp ONTAP</p></li>
181    /// <li>
182    /// <p>Amazon FSx for OpenZFS</p></li>
183    /// <li>
184    /// <p>Amazon FSx for Windows File Server</p></li>
185    /// </ul>
186    /// <p>If a <code>KmsKeyId</code> isn't specified, the Amazon FSx-managed KMS key for your account is used. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html">Encrypt</a> in the <i>Key Management Service API Reference</i>.</p>
187    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.inner = self.inner.set_kms_key_id(input);
189        self
190    }
191    /// <p>Specifies the ID of the Key Management Service (KMS) key to use for encrypting data on Amazon FSx file systems, as follows:</p>
192    /// <ul>
193    /// <li>
194    /// <p>Amazon FSx for Lustre <code>PERSISTENT_1</code> and <code>PERSISTENT_2</code> deployment types only.</p>
195    /// <p><code>SCRATCH_1</code> and <code>SCRATCH_2</code> types are encrypted using the Amazon FSx service KMS key for your account.</p></li>
196    /// <li>
197    /// <p>Amazon FSx for NetApp ONTAP</p></li>
198    /// <li>
199    /// <p>Amazon FSx for OpenZFS</p></li>
200    /// <li>
201    /// <p>Amazon FSx for Windows File Server</p></li>
202    /// </ul>
203    /// <p>If a <code>KmsKeyId</code> isn't specified, the Amazon FSx-managed KMS key for your account is used. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html">Encrypt</a> in the <i>Key Management Service API Reference</i>.</p>
204    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
205        self.inner.get_kms_key_id()
206    }
207    /// <p>A Boolean flag indicating whether tags from the source backup should be copied to the backup copy. This value defaults to <code>false</code>.</p>
208    /// <p>If you set <code>CopyTags</code> to <code>true</code> and the source backup has existing tags, you can use the <code>Tags</code> parameter to create new tags, provided that the sum of the source backup tags and the new tags doesn't exceed 50. Both sets of tags are merged. If there are tag conflicts (for example, two tags with the same key but different values), the tags created with the <code>Tags</code> parameter take precedence.</p>
209    pub fn copy_tags(mut self, input: bool) -> Self {
210        self.inner = self.inner.copy_tags(input);
211        self
212    }
213    /// <p>A Boolean flag indicating whether tags from the source backup should be copied to the backup copy. This value defaults to <code>false</code>.</p>
214    /// <p>If you set <code>CopyTags</code> to <code>true</code> and the source backup has existing tags, you can use the <code>Tags</code> parameter to create new tags, provided that the sum of the source backup tags and the new tags doesn't exceed 50. Both sets of tags are merged. If there are tag conflicts (for example, two tags with the same key but different values), the tags created with the <code>Tags</code> parameter take precedence.</p>
215    pub fn set_copy_tags(mut self, input: ::std::option::Option<bool>) -> Self {
216        self.inner = self.inner.set_copy_tags(input);
217        self
218    }
219    /// <p>A Boolean flag indicating whether tags from the source backup should be copied to the backup copy. This value defaults to <code>false</code>.</p>
220    /// <p>If you set <code>CopyTags</code> to <code>true</code> and the source backup has existing tags, you can use the <code>Tags</code> parameter to create new tags, provided that the sum of the source backup tags and the new tags doesn't exceed 50. Both sets of tags are merged. If there are tag conflicts (for example, two tags with the same key but different values), the tags created with the <code>Tags</code> parameter take precedence.</p>
221    pub fn get_copy_tags(&self) -> &::std::option::Option<bool> {
222        self.inner.get_copy_tags()
223    }
224    ///
225    /// Appends an item to `Tags`.
226    ///
227    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
228    ///
229    /// <p>A list of <code>Tag</code> values, with a maximum of 50 elements.</p>
230    pub fn tags(mut self, input: crate::types::Tag) -> Self {
231        self.inner = self.inner.tags(input);
232        self
233    }
234    /// <p>A list of <code>Tag</code> values, with a maximum of 50 elements.</p>
235    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
236        self.inner = self.inner.set_tags(input);
237        self
238    }
239    /// <p>A list of <code>Tag</code> values, with a maximum of 50 elements.</p>
240    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
241        self.inner.get_tags()
242    }
243}