aws_sdk_ec2/operation/export_transit_gateway_routes/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::export_transit_gateway_routes::_export_transit_gateway_routes_output::ExportTransitGatewayRoutesOutputBuilder;
3
4pub use crate::operation::export_transit_gateway_routes::_export_transit_gateway_routes_input::ExportTransitGatewayRoutesInputBuilder;
5
6impl crate::operation::export_transit_gateway_routes::builders::ExportTransitGatewayRoutesInputBuilder {
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::export_transit_gateway_routes::ExportTransitGatewayRoutesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::export_transit_gateway_routes::ExportTransitGatewayRoutesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.export_transit_gateway_routes();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ExportTransitGatewayRoutes`.
24///
25/// <p>Exports routes from the specified transit gateway route table to the specified S3 bucket. By default, all routes are exported. Alternatively, you can filter by CIDR range.</p>
26/// <p>The routes are saved to the specified bucket in a JSON file. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/tgw/tgw-route-tables.html#tgw-export-route-tables">Export route tables to Amazon S3</a> in the <i>Amazon Web Services Transit Gateways Guide</i>.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct ExportTransitGatewayRoutesFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::export_transit_gateway_routes::builders::ExportTransitGatewayRoutesInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::export_transit_gateway_routes::ExportTransitGatewayRoutesOutput,
36        crate::operation::export_transit_gateway_routes::ExportTransitGatewayRoutesError,
37    > for ExportTransitGatewayRoutesFluentBuilder
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::export_transit_gateway_routes::ExportTransitGatewayRoutesOutput,
45            crate::operation::export_transit_gateway_routes::ExportTransitGatewayRoutesError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl ExportTransitGatewayRoutesFluentBuilder {
52    /// Creates a new `ExportTransitGatewayRoutesFluentBuilder`.
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 ExportTransitGatewayRoutes as a reference.
61    pub fn as_input(&self) -> &crate::operation::export_transit_gateway_routes::builders::ExportTransitGatewayRoutesInputBuilder {
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::export_transit_gateway_routes::ExportTransitGatewayRoutesOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::export_transit_gateway_routes::ExportTransitGatewayRoutesError,
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::export_transit_gateway_routes::ExportTransitGatewayRoutes::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::export_transit_gateway_routes::ExportTransitGatewayRoutes::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::export_transit_gateway_routes::ExportTransitGatewayRoutesOutput,
98        crate::operation::export_transit_gateway_routes::ExportTransitGatewayRoutesError,
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    /// <p>The ID of the route table.</p>
113    pub fn transit_gateway_route_table_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.inner = self.inner.transit_gateway_route_table_id(input.into());
115        self
116    }
117    /// <p>The ID of the route table.</p>
118    pub fn set_transit_gateway_route_table_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119        self.inner = self.inner.set_transit_gateway_route_table_id(input);
120        self
121    }
122    /// <p>The ID of the route table.</p>
123    pub fn get_transit_gateway_route_table_id(&self) -> &::std::option::Option<::std::string::String> {
124        self.inner.get_transit_gateway_route_table_id()
125    }
126    ///
127    /// Appends an item to `Filters`.
128    ///
129    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
130    ///
131    /// <p>One or more filters. The possible values are:</p>
132    /// <ul>
133    /// <li>
134    /// <p><code>attachment.transit-gateway-attachment-id</code> - The id of the transit gateway attachment.</p></li>
135    /// <li>
136    /// <p><code>attachment.resource-id</code> - The resource id of the transit gateway attachment.</p></li>
137    /// <li>
138    /// <p><code>route-search.exact-match</code> - The exact match of the specified filter.</p></li>
139    /// <li>
140    /// <p><code>route-search.longest-prefix-match</code> - The longest prefix that matches the route.</p></li>
141    /// <li>
142    /// <p><code>route-search.subnet-of-match</code> - The routes with a subnet that match the specified CIDR filter.</p></li>
143    /// <li>
144    /// <p><code>route-search.supernet-of-match</code> - The routes with a CIDR that encompass the CIDR filter. For example, if you have 10.0.1.0/29 and 10.0.1.0/31 routes in your route table and you specify supernet-of-match as 10.0.1.0/30, then the result returns 10.0.1.0/29.</p></li>
145    /// <li>
146    /// <p><code>state</code> - The state of the route (<code>active</code> | <code>blackhole</code>).</p></li>
147    /// <li>
148    /// <p><code>transit-gateway-route-destination-cidr-block</code> - The CIDR range.</p></li>
149    /// <li>
150    /// <p><code>type</code> - The type of route (<code>propagated</code> | <code>static</code>).</p></li>
151    /// </ul>
152    pub fn filters(mut self, input: crate::types::Filter) -> Self {
153        self.inner = self.inner.filters(input);
154        self
155    }
156    /// <p>One or more filters. The possible values are:</p>
157    /// <ul>
158    /// <li>
159    /// <p><code>attachment.transit-gateway-attachment-id</code> - The id of the transit gateway attachment.</p></li>
160    /// <li>
161    /// <p><code>attachment.resource-id</code> - The resource id of the transit gateway attachment.</p></li>
162    /// <li>
163    /// <p><code>route-search.exact-match</code> - The exact match of the specified filter.</p></li>
164    /// <li>
165    /// <p><code>route-search.longest-prefix-match</code> - The longest prefix that matches the route.</p></li>
166    /// <li>
167    /// <p><code>route-search.subnet-of-match</code> - The routes with a subnet that match the specified CIDR filter.</p></li>
168    /// <li>
169    /// <p><code>route-search.supernet-of-match</code> - The routes with a CIDR that encompass the CIDR filter. For example, if you have 10.0.1.0/29 and 10.0.1.0/31 routes in your route table and you specify supernet-of-match as 10.0.1.0/30, then the result returns 10.0.1.0/29.</p></li>
170    /// <li>
171    /// <p><code>state</code> - The state of the route (<code>active</code> | <code>blackhole</code>).</p></li>
172    /// <li>
173    /// <p><code>transit-gateway-route-destination-cidr-block</code> - The CIDR range.</p></li>
174    /// <li>
175    /// <p><code>type</code> - The type of route (<code>propagated</code> | <code>static</code>).</p></li>
176    /// </ul>
177    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
178        self.inner = self.inner.set_filters(input);
179        self
180    }
181    /// <p>One or more filters. The possible values are:</p>
182    /// <ul>
183    /// <li>
184    /// <p><code>attachment.transit-gateway-attachment-id</code> - The id of the transit gateway attachment.</p></li>
185    /// <li>
186    /// <p><code>attachment.resource-id</code> - The resource id of the transit gateway attachment.</p></li>
187    /// <li>
188    /// <p><code>route-search.exact-match</code> - The exact match of the specified filter.</p></li>
189    /// <li>
190    /// <p><code>route-search.longest-prefix-match</code> - The longest prefix that matches the route.</p></li>
191    /// <li>
192    /// <p><code>route-search.subnet-of-match</code> - The routes with a subnet that match the specified CIDR filter.</p></li>
193    /// <li>
194    /// <p><code>route-search.supernet-of-match</code> - The routes with a CIDR that encompass the CIDR filter. For example, if you have 10.0.1.0/29 and 10.0.1.0/31 routes in your route table and you specify supernet-of-match as 10.0.1.0/30, then the result returns 10.0.1.0/29.</p></li>
195    /// <li>
196    /// <p><code>state</code> - The state of the route (<code>active</code> | <code>blackhole</code>).</p></li>
197    /// <li>
198    /// <p><code>transit-gateway-route-destination-cidr-block</code> - The CIDR range.</p></li>
199    /// <li>
200    /// <p><code>type</code> - The type of route (<code>propagated</code> | <code>static</code>).</p></li>
201    /// </ul>
202    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
203        self.inner.get_filters()
204    }
205    /// <p>The name of the S3 bucket.</p>
206    pub fn s3_bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
207        self.inner = self.inner.s3_bucket(input.into());
208        self
209    }
210    /// <p>The name of the S3 bucket.</p>
211    pub fn set_s3_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
212        self.inner = self.inner.set_s3_bucket(input);
213        self
214    }
215    /// <p>The name of the S3 bucket.</p>
216    pub fn get_s3_bucket(&self) -> &::std::option::Option<::std::string::String> {
217        self.inner.get_s3_bucket()
218    }
219    /// <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>
220    pub fn dry_run(mut self, input: bool) -> Self {
221        self.inner = self.inner.dry_run(input);
222        self
223    }
224    /// <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>
225    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
226        self.inner = self.inner.set_dry_run(input);
227        self
228    }
229    /// <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>
230    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
231        self.inner.get_dry_run()
232    }
233}