aws_sdk_fsx/operation/copy_snapshot_and_update_volume/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::copy_snapshot_and_update_volume::_copy_snapshot_and_update_volume_output::CopySnapshotAndUpdateVolumeOutputBuilder;
3
4pub use crate::operation::copy_snapshot_and_update_volume::_copy_snapshot_and_update_volume_input::CopySnapshotAndUpdateVolumeInputBuilder;
5
6impl crate::operation::copy_snapshot_and_update_volume::builders::CopySnapshotAndUpdateVolumeInputBuilder {
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_snapshot_and_update_volume::CopySnapshotAndUpdateVolumeOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::copy_snapshot_and_update_volume::CopySnapshotAndUpdateVolumeError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.copy_snapshot_and_update_volume();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CopySnapshotAndUpdateVolume`.
24///
25/// <p>Updates an existing volume by using a snapshot from another Amazon FSx for OpenZFS file system. For more information, see <a href="https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/on-demand-replication.html">on-demand data replication</a> in the Amazon FSx for OpenZFS User Guide.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CopySnapshotAndUpdateVolumeFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::copy_snapshot_and_update_volume::builders::CopySnapshotAndUpdateVolumeInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::copy_snapshot_and_update_volume::CopySnapshotAndUpdateVolumeOutput,
35        crate::operation::copy_snapshot_and_update_volume::CopySnapshotAndUpdateVolumeError,
36    > for CopySnapshotAndUpdateVolumeFluentBuilder
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_snapshot_and_update_volume::CopySnapshotAndUpdateVolumeOutput,
44            crate::operation::copy_snapshot_and_update_volume::CopySnapshotAndUpdateVolumeError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CopySnapshotAndUpdateVolumeFluentBuilder {
51    /// Creates a new `CopySnapshotAndUpdateVolumeFluentBuilder`.
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 CopySnapshotAndUpdateVolume as a reference.
60    pub fn as_input(&self) -> &crate::operation::copy_snapshot_and_update_volume::builders::CopySnapshotAndUpdateVolumeInputBuilder {
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_snapshot_and_update_volume::CopySnapshotAndUpdateVolumeOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::copy_snapshot_and_update_volume::CopySnapshotAndUpdateVolumeError,
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_snapshot_and_update_volume::CopySnapshotAndUpdateVolume::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::copy_snapshot_and_update_volume::CopySnapshotAndUpdateVolume::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_snapshot_and_update_volume::CopySnapshotAndUpdateVolumeOutput,
97        crate::operation::copy_snapshot_and_update_volume::CopySnapshotAndUpdateVolumeError,
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>(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>
112    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.client_request_token(input.into());
114        self
115    }
116    /// <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>
117    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_client_request_token(input);
119        self
120    }
121    /// <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>
122    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_client_request_token()
124    }
125    /// <p>Specifies the ID of the volume that you are copying the snapshot to.</p>
126    pub fn volume_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.volume_id(input.into());
128        self
129    }
130    /// <p>Specifies the ID of the volume that you are copying the snapshot to.</p>
131    pub fn set_volume_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_volume_id(input);
133        self
134    }
135    /// <p>Specifies the ID of the volume that you are copying the snapshot to.</p>
136    pub fn get_volume_id(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_volume_id()
138    }
139    /// <p>The Amazon Resource Name (ARN) for a given resource. ARNs uniquely identify Amazon Web Services resources. We require an ARN when you need to specify a resource unambiguously across all of Amazon Web Services. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p>
140    pub fn source_snapshot_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.source_snapshot_arn(input.into());
142        self
143    }
144    /// <p>The Amazon Resource Name (ARN) for a given resource. ARNs uniquely identify Amazon Web Services resources. We require an ARN when you need to specify a resource unambiguously across all of Amazon Web Services. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p>
145    pub fn set_source_snapshot_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_source_snapshot_arn(input);
147        self
148    }
149    /// <p>The Amazon Resource Name (ARN) for a given resource. ARNs uniquely identify Amazon Web Services resources. We require an ARN when you need to specify a resource unambiguously across all of Amazon Web Services. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p>
150    pub fn get_source_snapshot_arn(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_source_snapshot_arn()
152    }
153    /// <p>Specifies the strategy to use when copying data from a snapshot to the volume.</p>
154    /// <ul>
155    /// <li>
156    /// <p><code>FULL_COPY</code> - Copies all data from the snapshot to the volume.</p></li>
157    /// <li>
158    /// <p><code>INCREMENTAL_COPY</code> - Copies only the snapshot data that's changed since the previous replication.</p></li>
159    /// </ul><note>
160    /// <p><code>CLONE</code> isn't a valid copy strategy option for the <code>CopySnapshotAndUpdateVolume</code> operation.</p>
161    /// </note>
162    pub fn copy_strategy(mut self, input: crate::types::OpenZfsCopyStrategy) -> Self {
163        self.inner = self.inner.copy_strategy(input);
164        self
165    }
166    /// <p>Specifies the strategy to use when copying data from a snapshot to the volume.</p>
167    /// <ul>
168    /// <li>
169    /// <p><code>FULL_COPY</code> - Copies all data from the snapshot to the volume.</p></li>
170    /// <li>
171    /// <p><code>INCREMENTAL_COPY</code> - Copies only the snapshot data that's changed since the previous replication.</p></li>
172    /// </ul><note>
173    /// <p><code>CLONE</code> isn't a valid copy strategy option for the <code>CopySnapshotAndUpdateVolume</code> operation.</p>
174    /// </note>
175    pub fn set_copy_strategy(mut self, input: ::std::option::Option<crate::types::OpenZfsCopyStrategy>) -> Self {
176        self.inner = self.inner.set_copy_strategy(input);
177        self
178    }
179    /// <p>Specifies the strategy to use when copying data from a snapshot to the volume.</p>
180    /// <ul>
181    /// <li>
182    /// <p><code>FULL_COPY</code> - Copies all data from the snapshot to the volume.</p></li>
183    /// <li>
184    /// <p><code>INCREMENTAL_COPY</code> - Copies only the snapshot data that's changed since the previous replication.</p></li>
185    /// </ul><note>
186    /// <p><code>CLONE</code> isn't a valid copy strategy option for the <code>CopySnapshotAndUpdateVolume</code> operation.</p>
187    /// </note>
188    pub fn get_copy_strategy(&self) -> &::std::option::Option<crate::types::OpenZfsCopyStrategy> {
189        self.inner.get_copy_strategy()
190    }
191    ///
192    /// Appends an item to `Options`.
193    ///
194    /// To override the contents of this collection use [`set_options`](Self::set_options).
195    ///
196    /// <p>Confirms that you want to delete data on the destination volume that wasn’t there during the previous snapshot replication.</p>
197    /// <p>Your replication will fail if you don’t include an option for a specific type of data and that data is on your destination. For example, if you don’t include <code>DELETE_INTERMEDIATE_SNAPSHOTS</code> and there are intermediate snapshots on the destination, you can’t copy the snapshot.</p>
198    /// <ul>
199    /// <li>
200    /// <p><code>DELETE_INTERMEDIATE_SNAPSHOTS</code> - Deletes snapshots on the destination volume that aren’t on the source volume.</p></li>
201    /// <li>
202    /// <p><code>DELETE_CLONED_VOLUMES</code> - Deletes snapshot clones on the destination volume that aren't on the source volume.</p></li>
203    /// <li>
204    /// <p><code>DELETE_INTERMEDIATE_DATA</code> - Overwrites snapshots on the destination volume that don’t match the source snapshot that you’re copying.</p></li>
205    /// </ul>
206    pub fn options(mut self, input: crate::types::UpdateOpenZfsVolumeOption) -> Self {
207        self.inner = self.inner.options(input);
208        self
209    }
210    /// <p>Confirms that you want to delete data on the destination volume that wasn’t there during the previous snapshot replication.</p>
211    /// <p>Your replication will fail if you don’t include an option for a specific type of data and that data is on your destination. For example, if you don’t include <code>DELETE_INTERMEDIATE_SNAPSHOTS</code> and there are intermediate snapshots on the destination, you can’t copy the snapshot.</p>
212    /// <ul>
213    /// <li>
214    /// <p><code>DELETE_INTERMEDIATE_SNAPSHOTS</code> - Deletes snapshots on the destination volume that aren’t on the source volume.</p></li>
215    /// <li>
216    /// <p><code>DELETE_CLONED_VOLUMES</code> - Deletes snapshot clones on the destination volume that aren't on the source volume.</p></li>
217    /// <li>
218    /// <p><code>DELETE_INTERMEDIATE_DATA</code> - Overwrites snapshots on the destination volume that don’t match the source snapshot that you’re copying.</p></li>
219    /// </ul>
220    pub fn set_options(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::UpdateOpenZfsVolumeOption>>) -> Self {
221        self.inner = self.inner.set_options(input);
222        self
223    }
224    /// <p>Confirms that you want to delete data on the destination volume that wasn’t there during the previous snapshot replication.</p>
225    /// <p>Your replication will fail if you don’t include an option for a specific type of data and that data is on your destination. For example, if you don’t include <code>DELETE_INTERMEDIATE_SNAPSHOTS</code> and there are intermediate snapshots on the destination, you can’t copy the snapshot.</p>
226    /// <ul>
227    /// <li>
228    /// <p><code>DELETE_INTERMEDIATE_SNAPSHOTS</code> - Deletes snapshots on the destination volume that aren’t on the source volume.</p></li>
229    /// <li>
230    /// <p><code>DELETE_CLONED_VOLUMES</code> - Deletes snapshot clones on the destination volume that aren't on the source volume.</p></li>
231    /// <li>
232    /// <p><code>DELETE_INTERMEDIATE_DATA</code> - Overwrites snapshots on the destination volume that don’t match the source snapshot that you’re copying.</p></li>
233    /// </ul>
234    pub fn get_options(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::UpdateOpenZfsVolumeOption>> {
235        self.inner.get_options()
236    }
237}