aws_sdk_ec2/operation/describe_subnets/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_subnets::_describe_subnets_output::DescribeSubnetsOutputBuilder;
3
4pub use crate::operation::describe_subnets::_describe_subnets_input::DescribeSubnetsInputBuilder;
5
6impl crate::operation::describe_subnets::builders::DescribeSubnetsInputBuilder {
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_subnets::DescribeSubnetsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::describe_subnets::DescribeSubnetsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.describe_subnets();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DescribeSubnets`.
24///
25/// <p>Describes your subnets. The default is to describe all your subnets. Alternatively, you can specify specific subnet IDs or filter the results to include only the subnets that match specific criteria.</p>
26/// <p>For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/configure-subnets.html">Subnets</a> in the <i>Amazon VPC User Guide</i>.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct DescribeSubnetsFluentBuilder {
29 handle: ::std::sync::Arc<crate::client::Handle>,
30 inner: crate::operation::describe_subnets::builders::DescribeSubnetsInputBuilder,
31 config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34 crate::client::customize::internal::CustomizableSend<
35 crate::operation::describe_subnets::DescribeSubnetsOutput,
36 crate::operation::describe_subnets::DescribeSubnetsError,
37 > for DescribeSubnetsFluentBuilder
38{
39 fn send(
40 self,
41 config_override: crate::config::Builder,
42 ) -> crate::client::customize::internal::BoxFuture<
43 crate::client::customize::internal::SendResult<
44 crate::operation::describe_subnets::DescribeSubnetsOutput,
45 crate::operation::describe_subnets::DescribeSubnetsError,
46 >,
47 > {
48 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49 }
50}
51impl DescribeSubnetsFluentBuilder {
52 /// Creates a new `DescribeSubnetsFluentBuilder`.
53 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54 Self {
55 handle,
56 inner: ::std::default::Default::default(),
57 config_override: ::std::option::Option::None,
58 }
59 }
60 /// Access the DescribeSubnets as a reference.
61 pub fn as_input(&self) -> &crate::operation::describe_subnets::builders::DescribeSubnetsInputBuilder {
62 &self.inner
63 }
64 /// Sends the request and returns the response.
65 ///
66 /// If an error occurs, an `SdkError` will be returned with additional details that
67 /// can be matched against.
68 ///
69 /// By default, any retryable failures will be retried twice. Retry behavior
70 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71 /// set when configuring the client.
72 pub async fn send(
73 self,
74 ) -> ::std::result::Result<
75 crate::operation::describe_subnets::DescribeSubnetsOutput,
76 ::aws_smithy_runtime_api::client::result::SdkError<
77 crate::operation::describe_subnets::DescribeSubnetsError,
78 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79 >,
80 > {
81 let input = self
82 .inner
83 .build()
84 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85 let runtime_plugins = crate::operation::describe_subnets::DescribeSubnets::operation_runtime_plugins(
86 self.handle.runtime_plugins.clone(),
87 &self.handle.conf,
88 self.config_override,
89 );
90 crate::operation::describe_subnets::DescribeSubnets::orchestrate(&runtime_plugins, input).await
91 }
92
93 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94 pub fn customize(
95 self,
96 ) -> crate::client::customize::CustomizableOperation<
97 crate::operation::describe_subnets::DescribeSubnetsOutput,
98 crate::operation::describe_subnets::DescribeSubnetsError,
99 Self,
100 > {
101 crate::client::customize::CustomizableOperation::new(self)
102 }
103 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104 self.set_config_override(::std::option::Option::Some(config_override.into()));
105 self
106 }
107
108 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109 self.config_override = config_override;
110 self
111 }
112 /// Create a paginator for this request
113 ///
114 /// Paginators are used by calling [`send().await`](crate::operation::describe_subnets::paginator::DescribeSubnetsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
115 pub fn into_paginator(self) -> crate::operation::describe_subnets::paginator::DescribeSubnetsPaginator {
116 crate::operation::describe_subnets::paginator::DescribeSubnetsPaginator::new(self.handle, self.inner)
117 }
118 ///
119 /// Appends an item to `Filters`.
120 ///
121 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
122 ///
123 /// <p>The filters.</p>
124 /// <ul>
125 /// <li>
126 /// <p><code>availability-zone</code> - The Availability Zone for the subnet. You can also use <code>availabilityZone</code> as the filter name.</p></li>
127 /// <li>
128 /// <p><code>availability-zone-id</code> - The ID of the Availability Zone for the subnet. You can also use <code>availabilityZoneId</code> as the filter name.</p></li>
129 /// <li>
130 /// <p><code>available-ip-address-count</code> - The number of IPv4 addresses in the subnet that are available.</p></li>
131 /// <li>
132 /// <p><code>cidr-block</code> - The IPv4 CIDR block of the subnet. The CIDR block you specify must exactly match the subnet's CIDR block for information to be returned for the subnet. You can also use <code>cidr</code> or <code>cidrBlock</code> as the filter names.</p></li>
133 /// <li>
134 /// <p><code>customer-owned-ipv4-pool</code> - The customer-owned IPv4 address pool associated with the subnet.</p></li>
135 /// <li>
136 /// <p><code>default-for-az</code> - Indicates whether this is the default subnet for the Availability Zone (<code>true</code> | <code>false</code>). You can also use <code>defaultForAz</code> as the filter name.</p></li>
137 /// <li>
138 /// <p><code>enable-dns64</code> - Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations.</p></li>
139 /// <li>
140 /// <p><code>enable-lni-at-device-index</code> - Indicates the device position for local network interfaces in this subnet. For example, <code>1</code> indicates local network interfaces in this subnet are the secondary network interface (eth1).</p></li>
141 /// <li>
142 /// <p><code>ipv6-cidr-block-association.ipv6-cidr-block</code> - An IPv6 CIDR block associated with the subnet.</p></li>
143 /// <li>
144 /// <p><code>ipv6-cidr-block-association.association-id</code> - An association ID for an IPv6 CIDR block associated with the subnet.</p></li>
145 /// <li>
146 /// <p><code>ipv6-cidr-block-association.state</code> - The state of an IPv6 CIDR block associated with the subnet.</p></li>
147 /// <li>
148 /// <p><code>ipv6-native</code> - Indicates whether this is an IPv6 only subnet (<code>true</code> | <code>false</code>).</p></li>
149 /// <li>
150 /// <p><code>map-customer-owned-ip-on-launch</code> - Indicates whether a network interface created in this subnet (including a network interface created by <code>RunInstances</code>) receives a customer-owned IPv4 address.</p></li>
151 /// <li>
152 /// <p><code>map-public-ip-on-launch</code> - Indicates whether instances launched in this subnet receive a public IPv4 address.</p></li>
153 /// <li>
154 /// <p><code>outpost-arn</code> - The Amazon Resource Name (ARN) of the Outpost.</p></li>
155 /// <li>
156 /// <p><code>owner-id</code> - The ID of the Amazon Web Services account that owns the subnet.</p></li>
157 /// <li>
158 /// <p><code>private-dns-name-options-on-launch.hostname-type</code> - The type of hostname to assign to instances in the subnet at launch. For IPv4-only and dual-stack (IPv4 and IPv6) subnets, an instance DNS name can be based on the instance IPv4 address (ip-name) or the instance ID (resource-name). For IPv6 only subnets, an instance DNS name must be based on the instance ID (resource-name).</p></li>
159 /// <li>
160 /// <p><code>private-dns-name-options-on-launch.enable-resource-name-dns-a-record</code> - Indicates whether to respond to DNS queries for instance hostnames with DNS A records.</p></li>
161 /// <li>
162 /// <p><code>private-dns-name-options-on-launch.enable-resource-name-dns-aaaa-record</code> - Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.</p></li>
163 /// <li>
164 /// <p><code>state</code> - The state of the subnet (<code>pending</code> | <code>available</code>).</p></li>
165 /// <li>
166 /// <p><code>subnet-arn</code> - The Amazon Resource Name (ARN) of the subnet.</p></li>
167 /// <li>
168 /// <p><code>subnet-id</code> - The ID of the subnet.</p></li>
169 /// <li>
170 /// <p><code>tag</code> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p></li>
171 /// <li>
172 /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
173 /// <li>
174 /// <p><code>vpc-id</code> - The ID of the VPC for the subnet.</p></li>
175 /// </ul>
176 pub fn filters(mut self, input: crate::types::Filter) -> Self {
177 self.inner = self.inner.filters(input);
178 self
179 }
180 /// <p>The filters.</p>
181 /// <ul>
182 /// <li>
183 /// <p><code>availability-zone</code> - The Availability Zone for the subnet. You can also use <code>availabilityZone</code> as the filter name.</p></li>
184 /// <li>
185 /// <p><code>availability-zone-id</code> - The ID of the Availability Zone for the subnet. You can also use <code>availabilityZoneId</code> as the filter name.</p></li>
186 /// <li>
187 /// <p><code>available-ip-address-count</code> - The number of IPv4 addresses in the subnet that are available.</p></li>
188 /// <li>
189 /// <p><code>cidr-block</code> - The IPv4 CIDR block of the subnet. The CIDR block you specify must exactly match the subnet's CIDR block for information to be returned for the subnet. You can also use <code>cidr</code> or <code>cidrBlock</code> as the filter names.</p></li>
190 /// <li>
191 /// <p><code>customer-owned-ipv4-pool</code> - The customer-owned IPv4 address pool associated with the subnet.</p></li>
192 /// <li>
193 /// <p><code>default-for-az</code> - Indicates whether this is the default subnet for the Availability Zone (<code>true</code> | <code>false</code>). You can also use <code>defaultForAz</code> as the filter name.</p></li>
194 /// <li>
195 /// <p><code>enable-dns64</code> - Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations.</p></li>
196 /// <li>
197 /// <p><code>enable-lni-at-device-index</code> - Indicates the device position for local network interfaces in this subnet. For example, <code>1</code> indicates local network interfaces in this subnet are the secondary network interface (eth1).</p></li>
198 /// <li>
199 /// <p><code>ipv6-cidr-block-association.ipv6-cidr-block</code> - An IPv6 CIDR block associated with the subnet.</p></li>
200 /// <li>
201 /// <p><code>ipv6-cidr-block-association.association-id</code> - An association ID for an IPv6 CIDR block associated with the subnet.</p></li>
202 /// <li>
203 /// <p><code>ipv6-cidr-block-association.state</code> - The state of an IPv6 CIDR block associated with the subnet.</p></li>
204 /// <li>
205 /// <p><code>ipv6-native</code> - Indicates whether this is an IPv6 only subnet (<code>true</code> | <code>false</code>).</p></li>
206 /// <li>
207 /// <p><code>map-customer-owned-ip-on-launch</code> - Indicates whether a network interface created in this subnet (including a network interface created by <code>RunInstances</code>) receives a customer-owned IPv4 address.</p></li>
208 /// <li>
209 /// <p><code>map-public-ip-on-launch</code> - Indicates whether instances launched in this subnet receive a public IPv4 address.</p></li>
210 /// <li>
211 /// <p><code>outpost-arn</code> - The Amazon Resource Name (ARN) of the Outpost.</p></li>
212 /// <li>
213 /// <p><code>owner-id</code> - The ID of the Amazon Web Services account that owns the subnet.</p></li>
214 /// <li>
215 /// <p><code>private-dns-name-options-on-launch.hostname-type</code> - The type of hostname to assign to instances in the subnet at launch. For IPv4-only and dual-stack (IPv4 and IPv6) subnets, an instance DNS name can be based on the instance IPv4 address (ip-name) or the instance ID (resource-name). For IPv6 only subnets, an instance DNS name must be based on the instance ID (resource-name).</p></li>
216 /// <li>
217 /// <p><code>private-dns-name-options-on-launch.enable-resource-name-dns-a-record</code> - Indicates whether to respond to DNS queries for instance hostnames with DNS A records.</p></li>
218 /// <li>
219 /// <p><code>private-dns-name-options-on-launch.enable-resource-name-dns-aaaa-record</code> - Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.</p></li>
220 /// <li>
221 /// <p><code>state</code> - The state of the subnet (<code>pending</code> | <code>available</code>).</p></li>
222 /// <li>
223 /// <p><code>subnet-arn</code> - The Amazon Resource Name (ARN) of the subnet.</p></li>
224 /// <li>
225 /// <p><code>subnet-id</code> - The ID of the subnet.</p></li>
226 /// <li>
227 /// <p><code>tag</code> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p></li>
228 /// <li>
229 /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
230 /// <li>
231 /// <p><code>vpc-id</code> - The ID of the VPC for the subnet.</p></li>
232 /// </ul>
233 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
234 self.inner = self.inner.set_filters(input);
235 self
236 }
237 /// <p>The filters.</p>
238 /// <ul>
239 /// <li>
240 /// <p><code>availability-zone</code> - The Availability Zone for the subnet. You can also use <code>availabilityZone</code> as the filter name.</p></li>
241 /// <li>
242 /// <p><code>availability-zone-id</code> - The ID of the Availability Zone for the subnet. You can also use <code>availabilityZoneId</code> as the filter name.</p></li>
243 /// <li>
244 /// <p><code>available-ip-address-count</code> - The number of IPv4 addresses in the subnet that are available.</p></li>
245 /// <li>
246 /// <p><code>cidr-block</code> - The IPv4 CIDR block of the subnet. The CIDR block you specify must exactly match the subnet's CIDR block for information to be returned for the subnet. You can also use <code>cidr</code> or <code>cidrBlock</code> as the filter names.</p></li>
247 /// <li>
248 /// <p><code>customer-owned-ipv4-pool</code> - The customer-owned IPv4 address pool associated with the subnet.</p></li>
249 /// <li>
250 /// <p><code>default-for-az</code> - Indicates whether this is the default subnet for the Availability Zone (<code>true</code> | <code>false</code>). You can also use <code>defaultForAz</code> as the filter name.</p></li>
251 /// <li>
252 /// <p><code>enable-dns64</code> - Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations.</p></li>
253 /// <li>
254 /// <p><code>enable-lni-at-device-index</code> - Indicates the device position for local network interfaces in this subnet. For example, <code>1</code> indicates local network interfaces in this subnet are the secondary network interface (eth1).</p></li>
255 /// <li>
256 /// <p><code>ipv6-cidr-block-association.ipv6-cidr-block</code> - An IPv6 CIDR block associated with the subnet.</p></li>
257 /// <li>
258 /// <p><code>ipv6-cidr-block-association.association-id</code> - An association ID for an IPv6 CIDR block associated with the subnet.</p></li>
259 /// <li>
260 /// <p><code>ipv6-cidr-block-association.state</code> - The state of an IPv6 CIDR block associated with the subnet.</p></li>
261 /// <li>
262 /// <p><code>ipv6-native</code> - Indicates whether this is an IPv6 only subnet (<code>true</code> | <code>false</code>).</p></li>
263 /// <li>
264 /// <p><code>map-customer-owned-ip-on-launch</code> - Indicates whether a network interface created in this subnet (including a network interface created by <code>RunInstances</code>) receives a customer-owned IPv4 address.</p></li>
265 /// <li>
266 /// <p><code>map-public-ip-on-launch</code> - Indicates whether instances launched in this subnet receive a public IPv4 address.</p></li>
267 /// <li>
268 /// <p><code>outpost-arn</code> - The Amazon Resource Name (ARN) of the Outpost.</p></li>
269 /// <li>
270 /// <p><code>owner-id</code> - The ID of the Amazon Web Services account that owns the subnet.</p></li>
271 /// <li>
272 /// <p><code>private-dns-name-options-on-launch.hostname-type</code> - The type of hostname to assign to instances in the subnet at launch. For IPv4-only and dual-stack (IPv4 and IPv6) subnets, an instance DNS name can be based on the instance IPv4 address (ip-name) or the instance ID (resource-name). For IPv6 only subnets, an instance DNS name must be based on the instance ID (resource-name).</p></li>
273 /// <li>
274 /// <p><code>private-dns-name-options-on-launch.enable-resource-name-dns-a-record</code> - Indicates whether to respond to DNS queries for instance hostnames with DNS A records.</p></li>
275 /// <li>
276 /// <p><code>private-dns-name-options-on-launch.enable-resource-name-dns-aaaa-record</code> - Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.</p></li>
277 /// <li>
278 /// <p><code>state</code> - The state of the subnet (<code>pending</code> | <code>available</code>).</p></li>
279 /// <li>
280 /// <p><code>subnet-arn</code> - The Amazon Resource Name (ARN) of the subnet.</p></li>
281 /// <li>
282 /// <p><code>subnet-id</code> - The ID of the subnet.</p></li>
283 /// <li>
284 /// <p><code>tag</code> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p></li>
285 /// <li>
286 /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
287 /// <li>
288 /// <p><code>vpc-id</code> - The ID of the VPC for the subnet.</p></li>
289 /// </ul>
290 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
291 self.inner.get_filters()
292 }
293 ///
294 /// Appends an item to `SubnetIds`.
295 ///
296 /// To override the contents of this collection use [`set_subnet_ids`](Self::set_subnet_ids).
297 ///
298 /// <p>The IDs of the subnets.</p>
299 /// <p>Default: Describes all your subnets.</p>
300 pub fn subnet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
301 self.inner = self.inner.subnet_ids(input.into());
302 self
303 }
304 /// <p>The IDs of the subnets.</p>
305 /// <p>Default: Describes all your subnets.</p>
306 pub fn set_subnet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
307 self.inner = self.inner.set_subnet_ids(input);
308 self
309 }
310 /// <p>The IDs of the subnets.</p>
311 /// <p>Default: Describes all your subnets.</p>
312 pub fn get_subnet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
313 self.inner.get_subnet_ids()
314 }
315 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
316 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
317 self.inner = self.inner.next_token(input.into());
318 self
319 }
320 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
321 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
322 self.inner = self.inner.set_next_token(input);
323 self
324 }
325 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
326 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
327 self.inner.get_next_token()
328 }
329 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
330 pub fn max_results(mut self, input: i32) -> Self {
331 self.inner = self.inner.max_results(input);
332 self
333 }
334 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
335 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
336 self.inner = self.inner.set_max_results(input);
337 self
338 }
339 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
340 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
341 self.inner.get_max_results()
342 }
343 /// <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>
344 pub fn dry_run(mut self, input: bool) -> Self {
345 self.inner = self.inner.dry_run(input);
346 self
347 }
348 /// <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>
349 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
350 self.inner = self.inner.set_dry_run(input);
351 self
352 }
353 /// <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>
354 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
355 self.inner.get_dry_run()
356 }
357}