aws_sdk_ec2/operation/describe_availability_zones/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_availability_zones::_describe_availability_zones_output::DescribeAvailabilityZonesOutputBuilder;
3
4pub use crate::operation::describe_availability_zones::_describe_availability_zones_input::DescribeAvailabilityZonesInputBuilder;
5
6impl crate::operation::describe_availability_zones::builders::DescribeAvailabilityZonesInputBuilder {
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::describe_availability_zones::DescribeAvailabilityZonesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_availability_zones::DescribeAvailabilityZonesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_availability_zones();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeAvailabilityZones`.
24///
25/// <p>Describes the Availability Zones, Local Zones, and Wavelength Zones that are available to you.</p>
26/// <p>For more information about Availability Zones, Local Zones, and Wavelength Zones, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html">Regions and zones</a> in the <i>Amazon EC2 User Guide</i>.</p><note>
27/// <p>The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.</p>
28/// </note>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct DescribeAvailabilityZonesFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::describe_availability_zones::builders::DescribeAvailabilityZonesInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::describe_availability_zones::DescribeAvailabilityZonesOutput,
38        crate::operation::describe_availability_zones::DescribeAvailabilityZonesError,
39    > for DescribeAvailabilityZonesFluentBuilder
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::describe_availability_zones::DescribeAvailabilityZonesOutput,
47            crate::operation::describe_availability_zones::DescribeAvailabilityZonesError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl DescribeAvailabilityZonesFluentBuilder {
54    /// Creates a new `DescribeAvailabilityZonesFluentBuilder`.
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 DescribeAvailabilityZones as a reference.
63    pub fn as_input(&self) -> &crate::operation::describe_availability_zones::builders::DescribeAvailabilityZonesInputBuilder {
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::describe_availability_zones::DescribeAvailabilityZonesOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::describe_availability_zones::DescribeAvailabilityZonesError,
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::describe_availability_zones::DescribeAvailabilityZones::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::describe_availability_zones::DescribeAvailabilityZones::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::describe_availability_zones::DescribeAvailabilityZonesOutput,
100        crate::operation::describe_availability_zones::DescribeAvailabilityZonesError,
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    ///
115    /// Appends an item to `ZoneNames`.
116    ///
117    /// To override the contents of this collection use [`set_zone_names`](Self::set_zone_names).
118    ///
119    /// <p>The names of the Availability Zones, Local Zones, and Wavelength Zones.</p>
120    pub fn zone_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.zone_names(input.into());
122        self
123    }
124    /// <p>The names of the Availability Zones, Local Zones, and Wavelength Zones.</p>
125    pub fn set_zone_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
126        self.inner = self.inner.set_zone_names(input);
127        self
128    }
129    /// <p>The names of the Availability Zones, Local Zones, and Wavelength Zones.</p>
130    pub fn get_zone_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
131        self.inner.get_zone_names()
132    }
133    ///
134    /// Appends an item to `ZoneIds`.
135    ///
136    /// To override the contents of this collection use [`set_zone_ids`](Self::set_zone_ids).
137    ///
138    /// <p>The IDs of the Availability Zones, Local Zones, and Wavelength Zones.</p>
139    pub fn zone_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140        self.inner = self.inner.zone_ids(input.into());
141        self
142    }
143    /// <p>The IDs of the Availability Zones, Local Zones, and Wavelength Zones.</p>
144    pub fn set_zone_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
145        self.inner = self.inner.set_zone_ids(input);
146        self
147    }
148    /// <p>The IDs of the Availability Zones, Local Zones, and Wavelength Zones.</p>
149    pub fn get_zone_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
150        self.inner.get_zone_ids()
151    }
152    /// <p>Include all Availability Zones, Local Zones, and Wavelength Zones regardless of your opt-in status.</p>
153    /// <p>If you do not use this parameter, the results include only the zones for the Regions where you have chosen the option to opt in.</p>
154    pub fn all_availability_zones(mut self, input: bool) -> Self {
155        self.inner = self.inner.all_availability_zones(input);
156        self
157    }
158    /// <p>Include all Availability Zones, Local Zones, and Wavelength Zones regardless of your opt-in status.</p>
159    /// <p>If you do not use this parameter, the results include only the zones for the Regions where you have chosen the option to opt in.</p>
160    pub fn set_all_availability_zones(mut self, input: ::std::option::Option<bool>) -> Self {
161        self.inner = self.inner.set_all_availability_zones(input);
162        self
163    }
164    /// <p>Include all Availability Zones, Local Zones, and Wavelength Zones regardless of your opt-in status.</p>
165    /// <p>If you do not use this parameter, the results include only the zones for the Regions where you have chosen the option to opt in.</p>
166    pub fn get_all_availability_zones(&self) -> &::std::option::Option<bool> {
167        self.inner.get_all_availability_zones()
168    }
169    /// <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>
170    pub fn dry_run(mut self, input: bool) -> Self {
171        self.inner = self.inner.dry_run(input);
172        self
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 set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
176        self.inner = self.inner.set_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 get_dry_run(&self) -> &::std::option::Option<bool> {
181        self.inner.get_dry_run()
182    }
183    ///
184    /// Appends an item to `Filters`.
185    ///
186    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
187    ///
188    /// <p>The filters.</p>
189    /// <ul>
190    /// <li>
191    /// <p><code>group-long-name</code> - The long name of the zone group for the Availability Zone (for example, <code>US West (Oregon) 1</code>), the Local Zone (for example, for Zone group <code>us-west-2-lax-1</code>, it is <code>US West (Los Angeles)</code>, or the Wavelength Zone (for example, for Zone group <code>us-east-1-wl1</code>, it is <code>US East (Verizon)</code>.</p></li>
192    /// <li>
193    /// <p><code>group-name</code> - The name of the zone group for the Availability Zone (for example, <code>us-east-1-zg-1</code>), the Local Zone (for example, <code>us-west-2-lax-1</code>), or the Wavelength Zone (for example, <code>us-east-1-wl1</code>).</p></li>
194    /// <li>
195    /// <p><code>message</code> - The Zone message.</p></li>
196    /// <li>
197    /// <p><code>opt-in-status</code> - The opt-in status (<code>opted-in</code> | <code>not-opted-in</code> | <code>opt-in-not-required</code>).</p></li>
198    /// <li>
199    /// <p><code>parent-zone-id</code> - The ID of the zone that handles some of the Local Zone and Wavelength Zone control plane operations, such as API calls.</p></li>
200    /// <li>
201    /// <p><code>parent-zone-name</code> - The ID of the zone that handles some of the Local Zone and Wavelength Zone control plane operations, such as API calls.</p></li>
202    /// <li>
203    /// <p><code>region-name</code> - The name of the Region for the Zone (for example, <code>us-east-1</code>).</p></li>
204    /// <li>
205    /// <p><code>state</code> - The state of the Availability Zone, the Local Zone, or the Wavelength Zone (<code>available</code> | <code>unavailable</code> | <code>constrained</code>).</p></li>
206    /// <li>
207    /// <p><code>zone-id</code> - The ID of the Availability Zone (for example, <code>use1-az1</code>), the Local Zone (for example, <code>usw2-lax1-az1</code>), or the Wavelength Zone (for example, <code>us-east-1-wl1-bos-wlz-1</code>).</p></li>
208    /// <li>
209    /// <p><code>zone-name</code> - The name of the Availability Zone (for example, <code>us-east-1a</code>), the Local Zone (for example, <code>us-west-2-lax-1a</code>), or the Wavelength Zone (for example, <code>us-east-1-wl1-bos-wlz-1</code>).</p></li>
210    /// <li>
211    /// <p><code>zone-type</code> - The type of zone (<code>availability-zone</code> | <code>local-zone</code> | <code>wavelength-zone</code>).</p></li>
212    /// </ul>
213    pub fn filters(mut self, input: crate::types::Filter) -> Self {
214        self.inner = self.inner.filters(input);
215        self
216    }
217    /// <p>The filters.</p>
218    /// <ul>
219    /// <li>
220    /// <p><code>group-long-name</code> - The long name of the zone group for the Availability Zone (for example, <code>US West (Oregon) 1</code>), the Local Zone (for example, for Zone group <code>us-west-2-lax-1</code>, it is <code>US West (Los Angeles)</code>, or the Wavelength Zone (for example, for Zone group <code>us-east-1-wl1</code>, it is <code>US East (Verizon)</code>.</p></li>
221    /// <li>
222    /// <p><code>group-name</code> - The name of the zone group for the Availability Zone (for example, <code>us-east-1-zg-1</code>), the Local Zone (for example, <code>us-west-2-lax-1</code>), or the Wavelength Zone (for example, <code>us-east-1-wl1</code>).</p></li>
223    /// <li>
224    /// <p><code>message</code> - The Zone message.</p></li>
225    /// <li>
226    /// <p><code>opt-in-status</code> - The opt-in status (<code>opted-in</code> | <code>not-opted-in</code> | <code>opt-in-not-required</code>).</p></li>
227    /// <li>
228    /// <p><code>parent-zone-id</code> - The ID of the zone that handles some of the Local Zone and Wavelength Zone control plane operations, such as API calls.</p></li>
229    /// <li>
230    /// <p><code>parent-zone-name</code> - The ID of the zone that handles some of the Local Zone and Wavelength Zone control plane operations, such as API calls.</p></li>
231    /// <li>
232    /// <p><code>region-name</code> - The name of the Region for the Zone (for example, <code>us-east-1</code>).</p></li>
233    /// <li>
234    /// <p><code>state</code> - The state of the Availability Zone, the Local Zone, or the Wavelength Zone (<code>available</code> | <code>unavailable</code> | <code>constrained</code>).</p></li>
235    /// <li>
236    /// <p><code>zone-id</code> - The ID of the Availability Zone (for example, <code>use1-az1</code>), the Local Zone (for example, <code>usw2-lax1-az1</code>), or the Wavelength Zone (for example, <code>us-east-1-wl1-bos-wlz-1</code>).</p></li>
237    /// <li>
238    /// <p><code>zone-name</code> - The name of the Availability Zone (for example, <code>us-east-1a</code>), the Local Zone (for example, <code>us-west-2-lax-1a</code>), or the Wavelength Zone (for example, <code>us-east-1-wl1-bos-wlz-1</code>).</p></li>
239    /// <li>
240    /// <p><code>zone-type</code> - The type of zone (<code>availability-zone</code> | <code>local-zone</code> | <code>wavelength-zone</code>).</p></li>
241    /// </ul>
242    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
243        self.inner = self.inner.set_filters(input);
244        self
245    }
246    /// <p>The filters.</p>
247    /// <ul>
248    /// <li>
249    /// <p><code>group-long-name</code> - The long name of the zone group for the Availability Zone (for example, <code>US West (Oregon) 1</code>), the Local Zone (for example, for Zone group <code>us-west-2-lax-1</code>, it is <code>US West (Los Angeles)</code>, or the Wavelength Zone (for example, for Zone group <code>us-east-1-wl1</code>, it is <code>US East (Verizon)</code>.</p></li>
250    /// <li>
251    /// <p><code>group-name</code> - The name of the zone group for the Availability Zone (for example, <code>us-east-1-zg-1</code>), the Local Zone (for example, <code>us-west-2-lax-1</code>), or the Wavelength Zone (for example, <code>us-east-1-wl1</code>).</p></li>
252    /// <li>
253    /// <p><code>message</code> - The Zone message.</p></li>
254    /// <li>
255    /// <p><code>opt-in-status</code> - The opt-in status (<code>opted-in</code> | <code>not-opted-in</code> | <code>opt-in-not-required</code>).</p></li>
256    /// <li>
257    /// <p><code>parent-zone-id</code> - The ID of the zone that handles some of the Local Zone and Wavelength Zone control plane operations, such as API calls.</p></li>
258    /// <li>
259    /// <p><code>parent-zone-name</code> - The ID of the zone that handles some of the Local Zone and Wavelength Zone control plane operations, such as API calls.</p></li>
260    /// <li>
261    /// <p><code>region-name</code> - The name of the Region for the Zone (for example, <code>us-east-1</code>).</p></li>
262    /// <li>
263    /// <p><code>state</code> - The state of the Availability Zone, the Local Zone, or the Wavelength Zone (<code>available</code> | <code>unavailable</code> | <code>constrained</code>).</p></li>
264    /// <li>
265    /// <p><code>zone-id</code> - The ID of the Availability Zone (for example, <code>use1-az1</code>), the Local Zone (for example, <code>usw2-lax1-az1</code>), or the Wavelength Zone (for example, <code>us-east-1-wl1-bos-wlz-1</code>).</p></li>
266    /// <li>
267    /// <p><code>zone-name</code> - The name of the Availability Zone (for example, <code>us-east-1a</code>), the Local Zone (for example, <code>us-west-2-lax-1a</code>), or the Wavelength Zone (for example, <code>us-east-1-wl1-bos-wlz-1</code>).</p></li>
268    /// <li>
269    /// <p><code>zone-type</code> - The type of zone (<code>availability-zone</code> | <code>local-zone</code> | <code>wavelength-zone</code>).</p></li>
270    /// </ul>
271    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
272        self.inner.get_filters()
273    }
274}