aws_sdk_ec2/operation/disable_fast_snapshot_restores/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::disable_fast_snapshot_restores::_disable_fast_snapshot_restores_output::DisableFastSnapshotRestoresOutputBuilder;
3
4pub use crate::operation::disable_fast_snapshot_restores::_disable_fast_snapshot_restores_input::DisableFastSnapshotRestoresInputBuilder;
5
6impl crate::operation::disable_fast_snapshot_restores::builders::DisableFastSnapshotRestoresInputBuilder {
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::disable_fast_snapshot_restores::DisableFastSnapshotRestoresOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::disable_fast_snapshot_restores::DisableFastSnapshotRestoresError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.disable_fast_snapshot_restores();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DisableFastSnapshotRestores`.
24///
25/// <p>Disables fast snapshot restores for the specified snapshots in the specified Availability Zones.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct DisableFastSnapshotRestoresFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::disable_fast_snapshot_restores::builders::DisableFastSnapshotRestoresInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::disable_fast_snapshot_restores::DisableFastSnapshotRestoresOutput,
35        crate::operation::disable_fast_snapshot_restores::DisableFastSnapshotRestoresError,
36    > for DisableFastSnapshotRestoresFluentBuilder
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::disable_fast_snapshot_restores::DisableFastSnapshotRestoresOutput,
44            crate::operation::disable_fast_snapshot_restores::DisableFastSnapshotRestoresError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl DisableFastSnapshotRestoresFluentBuilder {
51    /// Creates a new `DisableFastSnapshotRestoresFluentBuilder`.
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 DisableFastSnapshotRestores as a reference.
60    pub fn as_input(&self) -> &crate::operation::disable_fast_snapshot_restores::builders::DisableFastSnapshotRestoresInputBuilder {
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::disable_fast_snapshot_restores::DisableFastSnapshotRestoresOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::disable_fast_snapshot_restores::DisableFastSnapshotRestoresError,
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::disable_fast_snapshot_restores::DisableFastSnapshotRestores::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::disable_fast_snapshot_restores::DisableFastSnapshotRestores::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::disable_fast_snapshot_restores::DisableFastSnapshotRestoresOutput,
97        crate::operation::disable_fast_snapshot_restores::DisableFastSnapshotRestoresError,
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    ///
112    /// Appends an item to `AvailabilityZones`.
113    ///
114    /// To override the contents of this collection use [`set_availability_zones`](Self::set_availability_zones).
115    ///
116    /// <p>One or more Availability Zones. For example, <code>us-east-2a</code>.</p>
117    /// <p>Either <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code> must be specified in the request, but not both.</p>
118    pub fn availability_zones(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.inner = self.inner.availability_zones(input.into());
120        self
121    }
122    /// <p>One or more Availability Zones. For example, <code>us-east-2a</code>.</p>
123    /// <p>Either <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code> must be specified in the request, but not both.</p>
124    pub fn set_availability_zones(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
125        self.inner = self.inner.set_availability_zones(input);
126        self
127    }
128    /// <p>One or more Availability Zones. For example, <code>us-east-2a</code>.</p>
129    /// <p>Either <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code> must be specified in the request, but not both.</p>
130    pub fn get_availability_zones(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
131        self.inner.get_availability_zones()
132    }
133    ///
134    /// Appends an item to `AvailabilityZoneIds`.
135    ///
136    /// To override the contents of this collection use [`set_availability_zone_ids`](Self::set_availability_zone_ids).
137    ///
138    /// <p>One or more Availability Zone IDs. For example, <code>use2-az1</code>.</p>
139    /// <p>Either <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code> must be specified in the request, but not both.</p>
140    pub fn availability_zone_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.availability_zone_ids(input.into());
142        self
143    }
144    /// <p>One or more Availability Zone IDs. For example, <code>use2-az1</code>.</p>
145    /// <p>Either <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code> must be specified in the request, but not both.</p>
146    pub fn set_availability_zone_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
147        self.inner = self.inner.set_availability_zone_ids(input);
148        self
149    }
150    /// <p>One or more Availability Zone IDs. For example, <code>use2-az1</code>.</p>
151    /// <p>Either <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code> must be specified in the request, but not both.</p>
152    pub fn get_availability_zone_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
153        self.inner.get_availability_zone_ids()
154    }
155    ///
156    /// Appends an item to `SourceSnapshotIds`.
157    ///
158    /// To override the contents of this collection use [`set_source_snapshot_ids`](Self::set_source_snapshot_ids).
159    ///
160    /// <p>The IDs of one or more snapshots. For example, <code>snap-1234567890abcdef0</code>.</p>
161    pub fn source_snapshot_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162        self.inner = self.inner.source_snapshot_ids(input.into());
163        self
164    }
165    /// <p>The IDs of one or more snapshots. For example, <code>snap-1234567890abcdef0</code>.</p>
166    pub fn set_source_snapshot_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
167        self.inner = self.inner.set_source_snapshot_ids(input);
168        self
169    }
170    /// <p>The IDs of one or more snapshots. For example, <code>snap-1234567890abcdef0</code>.</p>
171    pub fn get_source_snapshot_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
172        self.inner.get_source_snapshot_ids()
173    }
174    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
175    pub fn dry_run(mut self, input: bool) -> Self {
176        self.inner = self.inner.dry_run(input);
177        self
178    }
179    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
180    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
181        self.inner = self.inner.set_dry_run(input);
182        self
183    }
184    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
185    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
186        self.inner.get_dry_run()
187    }
188}