aws_sdk_ec2/operation/describe_route_tables/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_route_tables::_describe_route_tables_output::DescribeRouteTablesOutputBuilder;
3
4pub use crate::operation::describe_route_tables::_describe_route_tables_input::DescribeRouteTablesInputBuilder;
5
6impl crate::operation::describe_route_tables::builders::DescribeRouteTablesInputBuilder {
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_route_tables::DescribeRouteTablesOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::describe_route_tables::DescribeRouteTablesError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.describe_route_tables();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DescribeRouteTables`.
24///
25/// <p>Describes your route tables. The default is to describe all your route tables. Alternatively, you can specify specific route table IDs or filter the results to include only the route tables that match specific criteria.</p>
26/// <p>Each subnet in your VPC must be associated with a route table. If a subnet is not explicitly associated with any route table, it is implicitly associated with the main route table. This command does not return the subnet ID for implicit associations.</p>
27/// <p>For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html">Route tables</a> in the <i>Amazon VPC User Guide</i>.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct DescribeRouteTablesFluentBuilder {
30 handle: ::std::sync::Arc<crate::client::Handle>,
31 inner: crate::operation::describe_route_tables::builders::DescribeRouteTablesInputBuilder,
32 config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35 crate::client::customize::internal::CustomizableSend<
36 crate::operation::describe_route_tables::DescribeRouteTablesOutput,
37 crate::operation::describe_route_tables::DescribeRouteTablesError,
38 > for DescribeRouteTablesFluentBuilder
39{
40 fn send(
41 self,
42 config_override: crate::config::Builder,
43 ) -> crate::client::customize::internal::BoxFuture<
44 crate::client::customize::internal::SendResult<
45 crate::operation::describe_route_tables::DescribeRouteTablesOutput,
46 crate::operation::describe_route_tables::DescribeRouteTablesError,
47 >,
48 > {
49 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50 }
51}
52impl DescribeRouteTablesFluentBuilder {
53 /// Creates a new `DescribeRouteTablesFluentBuilder`.
54 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55 Self {
56 handle,
57 inner: ::std::default::Default::default(),
58 config_override: ::std::option::Option::None,
59 }
60 }
61 /// Access the DescribeRouteTables as a reference.
62 pub fn as_input(&self) -> &crate::operation::describe_route_tables::builders::DescribeRouteTablesInputBuilder {
63 &self.inner
64 }
65 /// Sends the request and returns the response.
66 ///
67 /// If an error occurs, an `SdkError` will be returned with additional details that
68 /// can be matched against.
69 ///
70 /// By default, any retryable failures will be retried twice. Retry behavior
71 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72 /// set when configuring the client.
73 pub async fn send(
74 self,
75 ) -> ::std::result::Result<
76 crate::operation::describe_route_tables::DescribeRouteTablesOutput,
77 ::aws_smithy_runtime_api::client::result::SdkError<
78 crate::operation::describe_route_tables::DescribeRouteTablesError,
79 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80 >,
81 > {
82 let input = self
83 .inner
84 .build()
85 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86 let runtime_plugins = crate::operation::describe_route_tables::DescribeRouteTables::operation_runtime_plugins(
87 self.handle.runtime_plugins.clone(),
88 &self.handle.conf,
89 self.config_override,
90 );
91 crate::operation::describe_route_tables::DescribeRouteTables::orchestrate(&runtime_plugins, input).await
92 }
93
94 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95 pub fn customize(
96 self,
97 ) -> crate::client::customize::CustomizableOperation<
98 crate::operation::describe_route_tables::DescribeRouteTablesOutput,
99 crate::operation::describe_route_tables::DescribeRouteTablesError,
100 Self,
101 > {
102 crate::client::customize::CustomizableOperation::new(self)
103 }
104 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105 self.set_config_override(::std::option::Option::Some(config_override.into()));
106 self
107 }
108
109 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110 self.config_override = config_override;
111 self
112 }
113 /// Create a paginator for this request
114 ///
115 /// Paginators are used by calling [`send().await`](crate::operation::describe_route_tables::paginator::DescribeRouteTablesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
116 pub fn into_paginator(self) -> crate::operation::describe_route_tables::paginator::DescribeRouteTablesPaginator {
117 crate::operation::describe_route_tables::paginator::DescribeRouteTablesPaginator::new(self.handle, self.inner)
118 }
119 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
120 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 self.inner = self.inner.next_token(input.into());
122 self
123 }
124 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
125 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126 self.inner = self.inner.set_next_token(input);
127 self
128 }
129 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
130 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
131 self.inner.get_next_token()
132 }
133 /// <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>
134 pub fn max_results(mut self, input: i32) -> Self {
135 self.inner = self.inner.max_results(input);
136 self
137 }
138 /// <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>
139 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
140 self.inner = self.inner.set_max_results(input);
141 self
142 }
143 /// <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>
144 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
145 self.inner.get_max_results()
146 }
147 /// <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>
148 pub fn dry_run(mut self, input: bool) -> Self {
149 self.inner = self.inner.dry_run(input);
150 self
151 }
152 /// <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>
153 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
154 self.inner = self.inner.set_dry_run(input);
155 self
156 }
157 /// <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>
158 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
159 self.inner.get_dry_run()
160 }
161 ///
162 /// Appends an item to `RouteTableIds`.
163 ///
164 /// To override the contents of this collection use [`set_route_table_ids`](Self::set_route_table_ids).
165 ///
166 /// <p>The IDs of the route tables.</p>
167 pub fn route_table_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168 self.inner = self.inner.route_table_ids(input.into());
169 self
170 }
171 /// <p>The IDs of the route tables.</p>
172 pub fn set_route_table_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
173 self.inner = self.inner.set_route_table_ids(input);
174 self
175 }
176 /// <p>The IDs of the route tables.</p>
177 pub fn get_route_table_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
178 self.inner.get_route_table_ids()
179 }
180 ///
181 /// Appends an item to `Filters`.
182 ///
183 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
184 ///
185 /// <p>The filters.</p>
186 /// <ul>
187 /// <li>
188 /// <p><code>association.gateway-id</code> - The ID of the gateway involved in the association.</p></li>
189 /// <li>
190 /// <p><code>association.route-table-association-id</code> - The ID of an association ID for the route table.</p></li>
191 /// <li>
192 /// <p><code>association.route-table-id</code> - The ID of the route table involved in the association.</p></li>
193 /// <li>
194 /// <p><code>association.subnet-id</code> - The ID of the subnet involved in the association.</p></li>
195 /// <li>
196 /// <p><code>association.main</code> - Indicates whether the route table is the main route table for the VPC (<code>true</code> | <code>false</code>). Route tables that do not have an association ID are not returned in the response.</p></li>
197 /// <li>
198 /// <p><code>owner-id</code> - The ID of the Amazon Web Services account that owns the route table.</p></li>
199 /// <li>
200 /// <p><code>route-table-id</code> - The ID of the route table.</p></li>
201 /// <li>
202 /// <p><code>route.destination-cidr-block</code> - The IPv4 CIDR range specified in a route in the table.</p></li>
203 /// <li>
204 /// <p><code>route.destination-ipv6-cidr-block</code> - The IPv6 CIDR range specified in a route in the route table.</p></li>
205 /// <li>
206 /// <p><code>route.destination-prefix-list-id</code> - The ID (prefix) of the Amazon Web Services service specified in a route in the table.</p></li>
207 /// <li>
208 /// <p><code>route.egress-only-internet-gateway-id</code> - The ID of an egress-only Internet gateway specified in a route in the route table.</p></li>
209 /// <li>
210 /// <p><code>route.gateway-id</code> - The ID of a gateway specified in a route in the table.</p></li>
211 /// <li>
212 /// <p><code>route.instance-id</code> - The ID of an instance specified in a route in the table.</p></li>
213 /// <li>
214 /// <p><code>route.nat-gateway-id</code> - The ID of a NAT gateway.</p></li>
215 /// <li>
216 /// <p><code>route.transit-gateway-id</code> - The ID of a transit gateway.</p></li>
217 /// <li>
218 /// <p><code>route.origin</code> - Describes how the route was created. <code>CreateRouteTable</code> indicates that the route was automatically created when the route table was created; <code>CreateRoute</code> indicates that the route was manually added to the route table; <code>EnableVgwRoutePropagation</code> indicates that the route was propagated by route propagation.</p></li>
219 /// <li>
220 /// <p><code>route.state</code> - The state of a route in the route table (<code>active</code> | <code>blackhole</code>). The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, the specified NAT instance has been terminated, and so on).</p></li>
221 /// <li>
222 /// <p><code>route.vpc-peering-connection-id</code> - The ID of a VPC peering connection specified in a route in the table.</p></li>
223 /// <li>
224 /// <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>
225 /// <li>
226 /// <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>
227 /// <li>
228 /// <p><code>vpc-id</code> - The ID of the VPC for the route table.</p></li>
229 /// </ul>
230 pub fn filters(mut self, input: crate::types::Filter) -> Self {
231 self.inner = self.inner.filters(input);
232 self
233 }
234 /// <p>The filters.</p>
235 /// <ul>
236 /// <li>
237 /// <p><code>association.gateway-id</code> - The ID of the gateway involved in the association.</p></li>
238 /// <li>
239 /// <p><code>association.route-table-association-id</code> - The ID of an association ID for the route table.</p></li>
240 /// <li>
241 /// <p><code>association.route-table-id</code> - The ID of the route table involved in the association.</p></li>
242 /// <li>
243 /// <p><code>association.subnet-id</code> - The ID of the subnet involved in the association.</p></li>
244 /// <li>
245 /// <p><code>association.main</code> - Indicates whether the route table is the main route table for the VPC (<code>true</code> | <code>false</code>). Route tables that do not have an association ID are not returned in the response.</p></li>
246 /// <li>
247 /// <p><code>owner-id</code> - The ID of the Amazon Web Services account that owns the route table.</p></li>
248 /// <li>
249 /// <p><code>route-table-id</code> - The ID of the route table.</p></li>
250 /// <li>
251 /// <p><code>route.destination-cidr-block</code> - The IPv4 CIDR range specified in a route in the table.</p></li>
252 /// <li>
253 /// <p><code>route.destination-ipv6-cidr-block</code> - The IPv6 CIDR range specified in a route in the route table.</p></li>
254 /// <li>
255 /// <p><code>route.destination-prefix-list-id</code> - The ID (prefix) of the Amazon Web Services service specified in a route in the table.</p></li>
256 /// <li>
257 /// <p><code>route.egress-only-internet-gateway-id</code> - The ID of an egress-only Internet gateway specified in a route in the route table.</p></li>
258 /// <li>
259 /// <p><code>route.gateway-id</code> - The ID of a gateway specified in a route in the table.</p></li>
260 /// <li>
261 /// <p><code>route.instance-id</code> - The ID of an instance specified in a route in the table.</p></li>
262 /// <li>
263 /// <p><code>route.nat-gateway-id</code> - The ID of a NAT gateway.</p></li>
264 /// <li>
265 /// <p><code>route.transit-gateway-id</code> - The ID of a transit gateway.</p></li>
266 /// <li>
267 /// <p><code>route.origin</code> - Describes how the route was created. <code>CreateRouteTable</code> indicates that the route was automatically created when the route table was created; <code>CreateRoute</code> indicates that the route was manually added to the route table; <code>EnableVgwRoutePropagation</code> indicates that the route was propagated by route propagation.</p></li>
268 /// <li>
269 /// <p><code>route.state</code> - The state of a route in the route table (<code>active</code> | <code>blackhole</code>). The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, the specified NAT instance has been terminated, and so on).</p></li>
270 /// <li>
271 /// <p><code>route.vpc-peering-connection-id</code> - The ID of a VPC peering connection specified in a route in the table.</p></li>
272 /// <li>
273 /// <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>
274 /// <li>
275 /// <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>
276 /// <li>
277 /// <p><code>vpc-id</code> - The ID of the VPC for the route table.</p></li>
278 /// </ul>
279 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
280 self.inner = self.inner.set_filters(input);
281 self
282 }
283 /// <p>The filters.</p>
284 /// <ul>
285 /// <li>
286 /// <p><code>association.gateway-id</code> - The ID of the gateway involved in the association.</p></li>
287 /// <li>
288 /// <p><code>association.route-table-association-id</code> - The ID of an association ID for the route table.</p></li>
289 /// <li>
290 /// <p><code>association.route-table-id</code> - The ID of the route table involved in the association.</p></li>
291 /// <li>
292 /// <p><code>association.subnet-id</code> - The ID of the subnet involved in the association.</p></li>
293 /// <li>
294 /// <p><code>association.main</code> - Indicates whether the route table is the main route table for the VPC (<code>true</code> | <code>false</code>). Route tables that do not have an association ID are not returned in the response.</p></li>
295 /// <li>
296 /// <p><code>owner-id</code> - The ID of the Amazon Web Services account that owns the route table.</p></li>
297 /// <li>
298 /// <p><code>route-table-id</code> - The ID of the route table.</p></li>
299 /// <li>
300 /// <p><code>route.destination-cidr-block</code> - The IPv4 CIDR range specified in a route in the table.</p></li>
301 /// <li>
302 /// <p><code>route.destination-ipv6-cidr-block</code> - The IPv6 CIDR range specified in a route in the route table.</p></li>
303 /// <li>
304 /// <p><code>route.destination-prefix-list-id</code> - The ID (prefix) of the Amazon Web Services service specified in a route in the table.</p></li>
305 /// <li>
306 /// <p><code>route.egress-only-internet-gateway-id</code> - The ID of an egress-only Internet gateway specified in a route in the route table.</p></li>
307 /// <li>
308 /// <p><code>route.gateway-id</code> - The ID of a gateway specified in a route in the table.</p></li>
309 /// <li>
310 /// <p><code>route.instance-id</code> - The ID of an instance specified in a route in the table.</p></li>
311 /// <li>
312 /// <p><code>route.nat-gateway-id</code> - The ID of a NAT gateway.</p></li>
313 /// <li>
314 /// <p><code>route.transit-gateway-id</code> - The ID of a transit gateway.</p></li>
315 /// <li>
316 /// <p><code>route.origin</code> - Describes how the route was created. <code>CreateRouteTable</code> indicates that the route was automatically created when the route table was created; <code>CreateRoute</code> indicates that the route was manually added to the route table; <code>EnableVgwRoutePropagation</code> indicates that the route was propagated by route propagation.</p></li>
317 /// <li>
318 /// <p><code>route.state</code> - The state of a route in the route table (<code>active</code> | <code>blackhole</code>). The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, the specified NAT instance has been terminated, and so on).</p></li>
319 /// <li>
320 /// <p><code>route.vpc-peering-connection-id</code> - The ID of a VPC peering connection specified in a route in the table.</p></li>
321 /// <li>
322 /// <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>
323 /// <li>
324 /// <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>
325 /// <li>
326 /// <p><code>vpc-id</code> - The ID of the VPC for the route table.</p></li>
327 /// </ul>
328 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
329 self.inner.get_filters()
330 }
331}