aws_sdk_networkmanager/operation/get_network_routes/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_network_routes::_get_network_routes_output::GetNetworkRoutesOutputBuilder;
3
4pub use crate::operation::get_network_routes::_get_network_routes_input::GetNetworkRoutesInputBuilder;
5
6impl crate::operation::get_network_routes::builders::GetNetworkRoutesInputBuilder {
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::get_network_routes::GetNetworkRoutesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_network_routes::GetNetworkRoutesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_network_routes();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetNetworkRoutes`.
24///
25/// <p>Gets the network routes of the specified global network.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct GetNetworkRoutesFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::get_network_routes::builders::GetNetworkRoutesInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::get_network_routes::GetNetworkRoutesOutput,
35        crate::operation::get_network_routes::GetNetworkRoutesError,
36    > for GetNetworkRoutesFluentBuilder
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::get_network_routes::GetNetworkRoutesOutput,
44            crate::operation::get_network_routes::GetNetworkRoutesError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl GetNetworkRoutesFluentBuilder {
51    /// Creates a new `GetNetworkRoutesFluentBuilder`.
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 GetNetworkRoutes as a reference.
60    pub fn as_input(&self) -> &crate::operation::get_network_routes::builders::GetNetworkRoutesInputBuilder {
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::get_network_routes::GetNetworkRoutesOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::get_network_routes::GetNetworkRoutesError,
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::get_network_routes::GetNetworkRoutes::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::get_network_routes::GetNetworkRoutes::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::get_network_routes::GetNetworkRoutesOutput,
97        crate::operation::get_network_routes::GetNetworkRoutesError,
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    /// <p>The ID of the global network.</p>
112    pub fn global_network_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.global_network_id(input.into());
114        self
115    }
116    /// <p>The ID of the global network.</p>
117    pub fn set_global_network_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_global_network_id(input);
119        self
120    }
121    /// <p>The ID of the global network.</p>
122    pub fn get_global_network_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_global_network_id()
124    }
125    /// <p>The ID of the route table.</p>
126    pub fn route_table_identifier(mut self, input: crate::types::RouteTableIdentifier) -> Self {
127        self.inner = self.inner.route_table_identifier(input);
128        self
129    }
130    /// <p>The ID of the route table.</p>
131    pub fn set_route_table_identifier(mut self, input: ::std::option::Option<crate::types::RouteTableIdentifier>) -> Self {
132        self.inner = self.inner.set_route_table_identifier(input);
133        self
134    }
135    /// <p>The ID of the route table.</p>
136    pub fn get_route_table_identifier(&self) -> &::std::option::Option<crate::types::RouteTableIdentifier> {
137        self.inner.get_route_table_identifier()
138    }
139    ///
140    /// Appends an item to `ExactCidrMatches`.
141    ///
142    /// To override the contents of this collection use [`set_exact_cidr_matches`](Self::set_exact_cidr_matches).
143    ///
144    /// <p>An exact CIDR block.</p>
145    pub fn exact_cidr_matches(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.inner = self.inner.exact_cidr_matches(input.into());
147        self
148    }
149    /// <p>An exact CIDR block.</p>
150    pub fn set_exact_cidr_matches(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
151        self.inner = self.inner.set_exact_cidr_matches(input);
152        self
153    }
154    /// <p>An exact CIDR block.</p>
155    pub fn get_exact_cidr_matches(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
156        self.inner.get_exact_cidr_matches()
157    }
158    ///
159    /// Appends an item to `LongestPrefixMatches`.
160    ///
161    /// To override the contents of this collection use [`set_longest_prefix_matches`](Self::set_longest_prefix_matches).
162    ///
163    /// <p>The most specific route that matches the traffic (longest prefix match).</p>
164    pub fn longest_prefix_matches(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.inner = self.inner.longest_prefix_matches(input.into());
166        self
167    }
168    /// <p>The most specific route that matches the traffic (longest prefix match).</p>
169    pub fn set_longest_prefix_matches(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
170        self.inner = self.inner.set_longest_prefix_matches(input);
171        self
172    }
173    /// <p>The most specific route that matches the traffic (longest prefix match).</p>
174    pub fn get_longest_prefix_matches(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
175        self.inner.get_longest_prefix_matches()
176    }
177    ///
178    /// Appends an item to `SubnetOfMatches`.
179    ///
180    /// To override the contents of this collection use [`set_subnet_of_matches`](Self::set_subnet_of_matches).
181    ///
182    /// <p>The routes with a subnet that match the specified CIDR filter.</p>
183    pub fn subnet_of_matches(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184        self.inner = self.inner.subnet_of_matches(input.into());
185        self
186    }
187    /// <p>The routes with a subnet that match the specified CIDR filter.</p>
188    pub fn set_subnet_of_matches(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
189        self.inner = self.inner.set_subnet_of_matches(input);
190        self
191    }
192    /// <p>The routes with a subnet that match the specified CIDR filter.</p>
193    pub fn get_subnet_of_matches(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
194        self.inner.get_subnet_of_matches()
195    }
196    ///
197    /// Appends an item to `SupernetOfMatches`.
198    ///
199    /// To override the contents of this collection use [`set_supernet_of_matches`](Self::set_supernet_of_matches).
200    ///
201    /// <p>The routes with a CIDR that encompasses the CIDR filter. Example: If you specify 10.0.1.0/30, then the result returns 10.0.1.0/29.</p>
202    pub fn supernet_of_matches(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
203        self.inner = self.inner.supernet_of_matches(input.into());
204        self
205    }
206    /// <p>The routes with a CIDR that encompasses the CIDR filter. Example: If you specify 10.0.1.0/30, then the result returns 10.0.1.0/29.</p>
207    pub fn set_supernet_of_matches(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
208        self.inner = self.inner.set_supernet_of_matches(input);
209        self
210    }
211    /// <p>The routes with a CIDR that encompasses the CIDR filter. Example: If you specify 10.0.1.0/30, then the result returns 10.0.1.0/29.</p>
212    pub fn get_supernet_of_matches(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
213        self.inner.get_supernet_of_matches()
214    }
215    ///
216    /// Appends an item to `PrefixListIds`.
217    ///
218    /// To override the contents of this collection use [`set_prefix_list_ids`](Self::set_prefix_list_ids).
219    ///
220    /// <p>The IDs of the prefix lists.</p>
221    pub fn prefix_list_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
222        self.inner = self.inner.prefix_list_ids(input.into());
223        self
224    }
225    /// <p>The IDs of the prefix lists.</p>
226    pub fn set_prefix_list_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
227        self.inner = self.inner.set_prefix_list_ids(input);
228        self
229    }
230    /// <p>The IDs of the prefix lists.</p>
231    pub fn get_prefix_list_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
232        self.inner.get_prefix_list_ids()
233    }
234    ///
235    /// Appends an item to `States`.
236    ///
237    /// To override the contents of this collection use [`set_states`](Self::set_states).
238    ///
239    /// <p>The route states.</p>
240    pub fn states(mut self, input: crate::types::RouteState) -> Self {
241        self.inner = self.inner.states(input);
242        self
243    }
244    /// <p>The route states.</p>
245    pub fn set_states(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RouteState>>) -> Self {
246        self.inner = self.inner.set_states(input);
247        self
248    }
249    /// <p>The route states.</p>
250    pub fn get_states(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RouteState>> {
251        self.inner.get_states()
252    }
253    ///
254    /// Appends an item to `Types`.
255    ///
256    /// To override the contents of this collection use [`set_types`](Self::set_types).
257    ///
258    /// <p>The route types.</p>
259    pub fn types(mut self, input: crate::types::RouteType) -> Self {
260        self.inner = self.inner.types(input);
261        self
262    }
263    /// <p>The route types.</p>
264    pub fn set_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RouteType>>) -> Self {
265        self.inner = self.inner.set_types(input);
266        self
267    }
268    /// <p>The route types.</p>
269    pub fn get_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RouteType>> {
270        self.inner.get_types()
271    }
272    ///
273    /// Adds a key-value pair to `DestinationFilters`.
274    ///
275    /// To override the contents of this collection use [`set_destination_filters`](Self::set_destination_filters).
276    ///
277    /// <p>Filter by route table destination. Possible Values: TRANSIT_GATEWAY_ATTACHMENT_ID, RESOURCE_ID, or RESOURCE_TYPE.</p>
278    pub fn destination_filters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<::std::string::String>) -> Self {
279        self.inner = self.inner.destination_filters(k.into(), v);
280        self
281    }
282    /// <p>Filter by route table destination. Possible Values: TRANSIT_GATEWAY_ATTACHMENT_ID, RESOURCE_ID, or RESOURCE_TYPE.</p>
283    pub fn set_destination_filters(
284        mut self,
285        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
286    ) -> Self {
287        self.inner = self.inner.set_destination_filters(input);
288        self
289    }
290    /// <p>Filter by route table destination. Possible Values: TRANSIT_GATEWAY_ATTACHMENT_ID, RESOURCE_ID, or RESOURCE_TYPE.</p>
291    pub fn get_destination_filters(
292        &self,
293    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
294        self.inner.get_destination_filters()
295    }
296}