aws_sdk_ec2/operation/create_route/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_route::_create_route_output::CreateRouteOutputBuilder;
3
4pub use crate::operation::create_route::_create_route_input::CreateRouteInputBuilder;
5
6impl crate::operation::create_route::builders::CreateRouteInputBuilder {
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::create_route::CreateRouteOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_route::CreateRouteError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_route();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateRoute`.
24///
25/// <p>Creates a route in a route table within a VPC.</p>
26/// <p>You must specify either a destination CIDR block or a prefix list ID. You must also specify exactly one of the resources from the parameter list.</p>
27/// <p>When determining how to route traffic, we use the route with the most specific match. For example, traffic is destined for the IPv4 address <code>192.0.2.3</code>, and the route table includes the following two IPv4 routes:</p>
28/// <ul>
29/// <li>
30/// <p><code>192.0.2.0/24</code> (goes to some target A)</p></li>
31/// <li>
32/// <p><code>192.0.2.0/28</code> (goes to some target B)</p></li>
33/// </ul>
34/// <p>Both routes apply to the traffic destined for <code>192.0.2.3</code>. However, the second route in the list covers a smaller number of IP addresses and is therefore more specific, so we use that route to determine where to target the traffic.</p>
35/// <p>For more information about route tables, 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>
36#[derive(::std::clone::Clone, ::std::fmt::Debug)]
37pub struct CreateRouteFluentBuilder {
38    handle: ::std::sync::Arc<crate::client::Handle>,
39    inner: crate::operation::create_route::builders::CreateRouteInputBuilder,
40    config_override: ::std::option::Option<crate::config::Builder>,
41}
42impl
43    crate::client::customize::internal::CustomizableSend<
44        crate::operation::create_route::CreateRouteOutput,
45        crate::operation::create_route::CreateRouteError,
46    > for CreateRouteFluentBuilder
47{
48    fn send(
49        self,
50        config_override: crate::config::Builder,
51    ) -> crate::client::customize::internal::BoxFuture<
52        crate::client::customize::internal::SendResult<
53            crate::operation::create_route::CreateRouteOutput,
54            crate::operation::create_route::CreateRouteError,
55        >,
56    > {
57        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
58    }
59}
60impl CreateRouteFluentBuilder {
61    /// Creates a new `CreateRouteFluentBuilder`.
62    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
63        Self {
64            handle,
65            inner: ::std::default::Default::default(),
66            config_override: ::std::option::Option::None,
67        }
68    }
69    /// Access the CreateRoute as a reference.
70    pub fn as_input(&self) -> &crate::operation::create_route::builders::CreateRouteInputBuilder {
71        &self.inner
72    }
73    /// Sends the request and returns the response.
74    ///
75    /// If an error occurs, an `SdkError` will be returned with additional details that
76    /// can be matched against.
77    ///
78    /// By default, any retryable failures will be retried twice. Retry behavior
79    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
80    /// set when configuring the client.
81    pub async fn send(
82        self,
83    ) -> ::std::result::Result<
84        crate::operation::create_route::CreateRouteOutput,
85        ::aws_smithy_runtime_api::client::result::SdkError<
86            crate::operation::create_route::CreateRouteError,
87            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
88        >,
89    > {
90        let input = self
91            .inner
92            .build()
93            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
94        let runtime_plugins = crate::operation::create_route::CreateRoute::operation_runtime_plugins(
95            self.handle.runtime_plugins.clone(),
96            &self.handle.conf,
97            self.config_override,
98        );
99        crate::operation::create_route::CreateRoute::orchestrate(&runtime_plugins, input).await
100    }
101
102    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
103    pub fn customize(
104        self,
105    ) -> crate::client::customize::CustomizableOperation<
106        crate::operation::create_route::CreateRouteOutput,
107        crate::operation::create_route::CreateRouteError,
108        Self,
109    > {
110        crate::client::customize::CustomizableOperation::new(self)
111    }
112    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
113        self.set_config_override(::std::option::Option::Some(config_override.into()));
114        self
115    }
116
117    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
118        self.config_override = config_override;
119        self
120    }
121    /// <p>The ID of a prefix list used for the destination match.</p>
122    pub fn destination_prefix_list_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.inner = self.inner.destination_prefix_list_id(input.into());
124        self
125    }
126    /// <p>The ID of a prefix list used for the destination match.</p>
127    pub fn set_destination_prefix_list_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.inner = self.inner.set_destination_prefix_list_id(input);
129        self
130    }
131    /// <p>The ID of a prefix list used for the destination match.</p>
132    pub fn get_destination_prefix_list_id(&self) -> &::std::option::Option<::std::string::String> {
133        self.inner.get_destination_prefix_list_id()
134    }
135    /// <p>The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.</p>
136    pub fn vpc_endpoint_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.inner = self.inner.vpc_endpoint_id(input.into());
138        self
139    }
140    /// <p>The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.</p>
141    pub fn set_vpc_endpoint_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.inner = self.inner.set_vpc_endpoint_id(input);
143        self
144    }
145    /// <p>The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.</p>
146    pub fn get_vpc_endpoint_id(&self) -> &::std::option::Option<::std::string::String> {
147        self.inner.get_vpc_endpoint_id()
148    }
149    /// <p>The ID of a transit gateway.</p>
150    pub fn transit_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.inner = self.inner.transit_gateway_id(input.into());
152        self
153    }
154    /// <p>The ID of a transit gateway.</p>
155    pub fn set_transit_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.inner = self.inner.set_transit_gateway_id(input);
157        self
158    }
159    /// <p>The ID of a transit gateway.</p>
160    pub fn get_transit_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
161        self.inner.get_transit_gateway_id()
162    }
163    /// <p>The ID of the local gateway.</p>
164    pub fn local_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.inner = self.inner.local_gateway_id(input.into());
166        self
167    }
168    /// <p>The ID of the local gateway.</p>
169    pub fn set_local_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.inner = self.inner.set_local_gateway_id(input);
171        self
172    }
173    /// <p>The ID of the local gateway.</p>
174    pub fn get_local_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
175        self.inner.get_local_gateway_id()
176    }
177    /// <p>The ID of the carrier gateway.</p>
178    /// <p>You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.</p>
179    pub fn carrier_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180        self.inner = self.inner.carrier_gateway_id(input.into());
181        self
182    }
183    /// <p>The ID of the carrier gateway.</p>
184    /// <p>You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.</p>
185    pub fn set_carrier_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186        self.inner = self.inner.set_carrier_gateway_id(input);
187        self
188    }
189    /// <p>The ID of the carrier gateway.</p>
190    /// <p>You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.</p>
191    pub fn get_carrier_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
192        self.inner.get_carrier_gateway_id()
193    }
194    /// <p>The Amazon Resource Name (ARN) of the core network.</p>
195    pub fn core_network_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
196        self.inner = self.inner.core_network_arn(input.into());
197        self
198    }
199    /// <p>The Amazon Resource Name (ARN) of the core network.</p>
200    pub fn set_core_network_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
201        self.inner = self.inner.set_core_network_arn(input);
202        self
203    }
204    /// <p>The Amazon Resource Name (ARN) of the core network.</p>
205    pub fn get_core_network_arn(&self) -> &::std::option::Option<::std::string::String> {
206        self.inner.get_core_network_arn()
207    }
208    /// <p>The Amazon Resource Name (ARN) of the ODB network.</p>
209    pub fn odb_network_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
210        self.inner = self.inner.odb_network_arn(input.into());
211        self
212    }
213    /// <p>The Amazon Resource Name (ARN) of the ODB network.</p>
214    pub fn set_odb_network_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
215        self.inner = self.inner.set_odb_network_arn(input);
216        self
217    }
218    /// <p>The Amazon Resource Name (ARN) of the ODB network.</p>
219    pub fn get_odb_network_arn(&self) -> &::std::option::Option<::std::string::String> {
220        self.inner.get_odb_network_arn()
221    }
222    /// <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>
223    pub fn dry_run(mut self, input: bool) -> Self {
224        self.inner = self.inner.dry_run(input);
225        self
226    }
227    /// <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>
228    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
229        self.inner = self.inner.set_dry_run(input);
230        self
231    }
232    /// <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>
233    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
234        self.inner.get_dry_run()
235    }
236    /// <p>The ID of the route table for the route.</p>
237    pub fn route_table_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
238        self.inner = self.inner.route_table_id(input.into());
239        self
240    }
241    /// <p>The ID of the route table for the route.</p>
242    pub fn set_route_table_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
243        self.inner = self.inner.set_route_table_id(input);
244        self
245    }
246    /// <p>The ID of the route table for the route.</p>
247    pub fn get_route_table_id(&self) -> &::std::option::Option<::std::string::String> {
248        self.inner.get_route_table_id()
249    }
250    /// <p>The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify <code>100.68.0.18/18</code>, we modify it to <code>100.68.0.0/18</code>.</p>
251    pub fn destination_cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
252        self.inner = self.inner.destination_cidr_block(input.into());
253        self
254    }
255    /// <p>The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify <code>100.68.0.18/18</code>, we modify it to <code>100.68.0.0/18</code>.</p>
256    pub fn set_destination_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
257        self.inner = self.inner.set_destination_cidr_block(input);
258        self
259    }
260    /// <p>The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify <code>100.68.0.18/18</code>, we modify it to <code>100.68.0.0/18</code>.</p>
261    pub fn get_destination_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
262        self.inner.get_destination_cidr_block()
263    }
264    /// <p>The ID of an internet gateway or virtual private gateway attached to your VPC.</p>
265    pub fn gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
266        self.inner = self.inner.gateway_id(input.into());
267        self
268    }
269    /// <p>The ID of an internet gateway or virtual private gateway attached to your VPC.</p>
270    pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
271        self.inner = self.inner.set_gateway_id(input);
272        self
273    }
274    /// <p>The ID of an internet gateway or virtual private gateway attached to your VPC.</p>
275    pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
276        self.inner.get_gateway_id()
277    }
278    /// <p>The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.</p>
279    pub fn destination_ipv6_cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
280        self.inner = self.inner.destination_ipv6_cidr_block(input.into());
281        self
282    }
283    /// <p>The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.</p>
284    pub fn set_destination_ipv6_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
285        self.inner = self.inner.set_destination_ipv6_cidr_block(input);
286        self
287    }
288    /// <p>The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.</p>
289    pub fn get_destination_ipv6_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
290        self.inner.get_destination_ipv6_cidr_block()
291    }
292    /// <p>\[IPv6 traffic only\] The ID of an egress-only internet gateway.</p>
293    pub fn egress_only_internet_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
294        self.inner = self.inner.egress_only_internet_gateway_id(input.into());
295        self
296    }
297    /// <p>\[IPv6 traffic only\] The ID of an egress-only internet gateway.</p>
298    pub fn set_egress_only_internet_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
299        self.inner = self.inner.set_egress_only_internet_gateway_id(input);
300        self
301    }
302    /// <p>\[IPv6 traffic only\] The ID of an egress-only internet gateway.</p>
303    pub fn get_egress_only_internet_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
304        self.inner.get_egress_only_internet_gateway_id()
305    }
306    /// <p>The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.</p>
307    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
308        self.inner = self.inner.instance_id(input.into());
309        self
310    }
311    /// <p>The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.</p>
312    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
313        self.inner = self.inner.set_instance_id(input);
314        self
315    }
316    /// <p>The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.</p>
317    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
318        self.inner.get_instance_id()
319    }
320    /// <p>The ID of a network interface.</p>
321    pub fn network_interface_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
322        self.inner = self.inner.network_interface_id(input.into());
323        self
324    }
325    /// <p>The ID of a network interface.</p>
326    pub fn set_network_interface_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
327        self.inner = self.inner.set_network_interface_id(input);
328        self
329    }
330    /// <p>The ID of a network interface.</p>
331    pub fn get_network_interface_id(&self) -> &::std::option::Option<::std::string::String> {
332        self.inner.get_network_interface_id()
333    }
334    /// <p>The ID of a VPC peering connection.</p>
335    pub fn vpc_peering_connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
336        self.inner = self.inner.vpc_peering_connection_id(input.into());
337        self
338    }
339    /// <p>The ID of a VPC peering connection.</p>
340    pub fn set_vpc_peering_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
341        self.inner = self.inner.set_vpc_peering_connection_id(input);
342        self
343    }
344    /// <p>The ID of a VPC peering connection.</p>
345    pub fn get_vpc_peering_connection_id(&self) -> &::std::option::Option<::std::string::String> {
346        self.inner.get_vpc_peering_connection_id()
347    }
348    /// <p>\[IPv4 traffic only\] The ID of a NAT gateway.</p>
349    pub fn nat_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
350        self.inner = self.inner.nat_gateway_id(input.into());
351        self
352    }
353    /// <p>\[IPv4 traffic only\] The ID of a NAT gateway.</p>
354    pub fn set_nat_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
355        self.inner = self.inner.set_nat_gateway_id(input);
356        self
357    }
358    /// <p>\[IPv4 traffic only\] The ID of a NAT gateway.</p>
359    pub fn get_nat_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
360        self.inner.get_nat_gateway_id()
361    }
362}