aws_sdk_ec2/operation/create_route/
_create_route_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateRouteInput {
6    /// <p>The ID of a prefix list used for the destination match.</p>
7    pub destination_prefix_list_id: ::std::option::Option<::std::string::String>,
8    /// <p>The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.</p>
9    pub vpc_endpoint_id: ::std::option::Option<::std::string::String>,
10    /// <p>The ID of a transit gateway.</p>
11    pub transit_gateway_id: ::std::option::Option<::std::string::String>,
12    /// <p>The ID of the local gateway.</p>
13    pub local_gateway_id: ::std::option::Option<::std::string::String>,
14    /// <p>The ID of the carrier gateway.</p>
15    /// <p>You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.</p>
16    pub carrier_gateway_id: ::std::option::Option<::std::string::String>,
17    /// <p>The Amazon Resource Name (ARN) of the core network.</p>
18    pub core_network_arn: ::std::option::Option<::std::string::String>,
19    /// <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>
20    pub dry_run: ::std::option::Option<bool>,
21    /// <p>The ID of the route table for the route.</p>
22    pub route_table_id: ::std::option::Option<::std::string::String>,
23    /// <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>
24    pub destination_cidr_block: ::std::option::Option<::std::string::String>,
25    /// <p>The ID of an internet gateway or virtual private gateway attached to your VPC.</p>
26    pub gateway_id: ::std::option::Option<::std::string::String>,
27    /// <p>The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.</p>
28    pub destination_ipv6_cidr_block: ::std::option::Option<::std::string::String>,
29    /// <p>\[IPv6 traffic only\] The ID of an egress-only internet gateway.</p>
30    pub egress_only_internet_gateway_id: ::std::option::Option<::std::string::String>,
31    /// <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>
32    pub instance_id: ::std::option::Option<::std::string::String>,
33    /// <p>The ID of a network interface.</p>
34    pub network_interface_id: ::std::option::Option<::std::string::String>,
35    /// <p>The ID of a VPC peering connection.</p>
36    pub vpc_peering_connection_id: ::std::option::Option<::std::string::String>,
37    /// <p>\[IPv4 traffic only\] The ID of a NAT gateway.</p>
38    pub nat_gateway_id: ::std::option::Option<::std::string::String>,
39}
40impl CreateRouteInput {
41    /// <p>The ID of a prefix list used for the destination match.</p>
42    pub fn destination_prefix_list_id(&self) -> ::std::option::Option<&str> {
43        self.destination_prefix_list_id.as_deref()
44    }
45    /// <p>The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.</p>
46    pub fn vpc_endpoint_id(&self) -> ::std::option::Option<&str> {
47        self.vpc_endpoint_id.as_deref()
48    }
49    /// <p>The ID of a transit gateway.</p>
50    pub fn transit_gateway_id(&self) -> ::std::option::Option<&str> {
51        self.transit_gateway_id.as_deref()
52    }
53    /// <p>The ID of the local gateway.</p>
54    pub fn local_gateway_id(&self) -> ::std::option::Option<&str> {
55        self.local_gateway_id.as_deref()
56    }
57    /// <p>The ID of the carrier gateway.</p>
58    /// <p>You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.</p>
59    pub fn carrier_gateway_id(&self) -> ::std::option::Option<&str> {
60        self.carrier_gateway_id.as_deref()
61    }
62    /// <p>The Amazon Resource Name (ARN) of the core network.</p>
63    pub fn core_network_arn(&self) -> ::std::option::Option<&str> {
64        self.core_network_arn.as_deref()
65    }
66    /// <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>
67    pub fn dry_run(&self) -> ::std::option::Option<bool> {
68        self.dry_run
69    }
70    /// <p>The ID of the route table for the route.</p>
71    pub fn route_table_id(&self) -> ::std::option::Option<&str> {
72        self.route_table_id.as_deref()
73    }
74    /// <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>
75    pub fn destination_cidr_block(&self) -> ::std::option::Option<&str> {
76        self.destination_cidr_block.as_deref()
77    }
78    /// <p>The ID of an internet gateway or virtual private gateway attached to your VPC.</p>
79    pub fn gateway_id(&self) -> ::std::option::Option<&str> {
80        self.gateway_id.as_deref()
81    }
82    /// <p>The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.</p>
83    pub fn destination_ipv6_cidr_block(&self) -> ::std::option::Option<&str> {
84        self.destination_ipv6_cidr_block.as_deref()
85    }
86    /// <p>\[IPv6 traffic only\] The ID of an egress-only internet gateway.</p>
87    pub fn egress_only_internet_gateway_id(&self) -> ::std::option::Option<&str> {
88        self.egress_only_internet_gateway_id.as_deref()
89    }
90    /// <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>
91    pub fn instance_id(&self) -> ::std::option::Option<&str> {
92        self.instance_id.as_deref()
93    }
94    /// <p>The ID of a network interface.</p>
95    pub fn network_interface_id(&self) -> ::std::option::Option<&str> {
96        self.network_interface_id.as_deref()
97    }
98    /// <p>The ID of a VPC peering connection.</p>
99    pub fn vpc_peering_connection_id(&self) -> ::std::option::Option<&str> {
100        self.vpc_peering_connection_id.as_deref()
101    }
102    /// <p>\[IPv4 traffic only\] The ID of a NAT gateway.</p>
103    pub fn nat_gateway_id(&self) -> ::std::option::Option<&str> {
104        self.nat_gateway_id.as_deref()
105    }
106}
107impl CreateRouteInput {
108    /// Creates a new builder-style object to manufacture [`CreateRouteInput`](crate::operation::create_route::CreateRouteInput).
109    pub fn builder() -> crate::operation::create_route::builders::CreateRouteInputBuilder {
110        crate::operation::create_route::builders::CreateRouteInputBuilder::default()
111    }
112}
113
114/// A builder for [`CreateRouteInput`](crate::operation::create_route::CreateRouteInput).
115#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
116#[non_exhaustive]
117pub struct CreateRouteInputBuilder {
118    pub(crate) destination_prefix_list_id: ::std::option::Option<::std::string::String>,
119    pub(crate) vpc_endpoint_id: ::std::option::Option<::std::string::String>,
120    pub(crate) transit_gateway_id: ::std::option::Option<::std::string::String>,
121    pub(crate) local_gateway_id: ::std::option::Option<::std::string::String>,
122    pub(crate) carrier_gateway_id: ::std::option::Option<::std::string::String>,
123    pub(crate) core_network_arn: ::std::option::Option<::std::string::String>,
124    pub(crate) dry_run: ::std::option::Option<bool>,
125    pub(crate) route_table_id: ::std::option::Option<::std::string::String>,
126    pub(crate) destination_cidr_block: ::std::option::Option<::std::string::String>,
127    pub(crate) gateway_id: ::std::option::Option<::std::string::String>,
128    pub(crate) destination_ipv6_cidr_block: ::std::option::Option<::std::string::String>,
129    pub(crate) egress_only_internet_gateway_id: ::std::option::Option<::std::string::String>,
130    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
131    pub(crate) network_interface_id: ::std::option::Option<::std::string::String>,
132    pub(crate) vpc_peering_connection_id: ::std::option::Option<::std::string::String>,
133    pub(crate) nat_gateway_id: ::std::option::Option<::std::string::String>,
134}
135impl CreateRouteInputBuilder {
136    /// <p>The ID of a prefix list used for the destination match.</p>
137    pub fn destination_prefix_list_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.destination_prefix_list_id = ::std::option::Option::Some(input.into());
139        self
140    }
141    /// <p>The ID of a prefix list used for the destination match.</p>
142    pub fn set_destination_prefix_list_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.destination_prefix_list_id = input;
144        self
145    }
146    /// <p>The ID of a prefix list used for the destination match.</p>
147    pub fn get_destination_prefix_list_id(&self) -> &::std::option::Option<::std::string::String> {
148        &self.destination_prefix_list_id
149    }
150    /// <p>The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.</p>
151    pub fn vpc_endpoint_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152        self.vpc_endpoint_id = ::std::option::Option::Some(input.into());
153        self
154    }
155    /// <p>The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.</p>
156    pub fn set_vpc_endpoint_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157        self.vpc_endpoint_id = input;
158        self
159    }
160    /// <p>The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.</p>
161    pub fn get_vpc_endpoint_id(&self) -> &::std::option::Option<::std::string::String> {
162        &self.vpc_endpoint_id
163    }
164    /// <p>The ID of a transit gateway.</p>
165    pub fn transit_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166        self.transit_gateway_id = ::std::option::Option::Some(input.into());
167        self
168    }
169    /// <p>The ID of a transit gateway.</p>
170    pub fn set_transit_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
171        self.transit_gateway_id = input;
172        self
173    }
174    /// <p>The ID of a transit gateway.</p>
175    pub fn get_transit_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
176        &self.transit_gateway_id
177    }
178    /// <p>The ID of the local gateway.</p>
179    pub fn local_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180        self.local_gateway_id = ::std::option::Option::Some(input.into());
181        self
182    }
183    /// <p>The ID of the local gateway.</p>
184    pub fn set_local_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
185        self.local_gateway_id = input;
186        self
187    }
188    /// <p>The ID of the local gateway.</p>
189    pub fn get_local_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
190        &self.local_gateway_id
191    }
192    /// <p>The ID of the carrier gateway.</p>
193    /// <p>You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.</p>
194    pub fn carrier_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
195        self.carrier_gateway_id = ::std::option::Option::Some(input.into());
196        self
197    }
198    /// <p>The ID of the carrier gateway.</p>
199    /// <p>You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.</p>
200    pub fn set_carrier_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
201        self.carrier_gateway_id = input;
202        self
203    }
204    /// <p>The ID of the carrier gateway.</p>
205    /// <p>You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.</p>
206    pub fn get_carrier_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
207        &self.carrier_gateway_id
208    }
209    /// <p>The Amazon Resource Name (ARN) of the core network.</p>
210    pub fn core_network_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
211        self.core_network_arn = ::std::option::Option::Some(input.into());
212        self
213    }
214    /// <p>The Amazon Resource Name (ARN) of the core network.</p>
215    pub fn set_core_network_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216        self.core_network_arn = input;
217        self
218    }
219    /// <p>The Amazon Resource Name (ARN) of the core network.</p>
220    pub fn get_core_network_arn(&self) -> &::std::option::Option<::std::string::String> {
221        &self.core_network_arn
222    }
223    /// <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>
224    pub fn dry_run(mut self, input: bool) -> Self {
225        self.dry_run = ::std::option::Option::Some(input);
226        self
227    }
228    /// <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>
229    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
230        self.dry_run = input;
231        self
232    }
233    /// <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>
234    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
235        &self.dry_run
236    }
237    /// <p>The ID of the route table for the route.</p>
238    /// This field is required.
239    pub fn route_table_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
240        self.route_table_id = ::std::option::Option::Some(input.into());
241        self
242    }
243    /// <p>The ID of the route table for the route.</p>
244    pub fn set_route_table_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
245        self.route_table_id = input;
246        self
247    }
248    /// <p>The ID of the route table for the route.</p>
249    pub fn get_route_table_id(&self) -> &::std::option::Option<::std::string::String> {
250        &self.route_table_id
251    }
252    /// <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>
253    pub fn destination_cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
254        self.destination_cidr_block = ::std::option::Option::Some(input.into());
255        self
256    }
257    /// <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>
258    pub fn set_destination_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
259        self.destination_cidr_block = input;
260        self
261    }
262    /// <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>
263    pub fn get_destination_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
264        &self.destination_cidr_block
265    }
266    /// <p>The ID of an internet gateway or virtual private gateway attached to your VPC.</p>
267    pub fn gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
268        self.gateway_id = ::std::option::Option::Some(input.into());
269        self
270    }
271    /// <p>The ID of an internet gateway or virtual private gateway attached to your VPC.</p>
272    pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
273        self.gateway_id = input;
274        self
275    }
276    /// <p>The ID of an internet gateway or virtual private gateway attached to your VPC.</p>
277    pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
278        &self.gateway_id
279    }
280    /// <p>The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.</p>
281    pub fn destination_ipv6_cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
282        self.destination_ipv6_cidr_block = ::std::option::Option::Some(input.into());
283        self
284    }
285    /// <p>The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.</p>
286    pub fn set_destination_ipv6_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
287        self.destination_ipv6_cidr_block = input;
288        self
289    }
290    /// <p>The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.</p>
291    pub fn get_destination_ipv6_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
292        &self.destination_ipv6_cidr_block
293    }
294    /// <p>\[IPv6 traffic only\] The ID of an egress-only internet gateway.</p>
295    pub fn egress_only_internet_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
296        self.egress_only_internet_gateway_id = ::std::option::Option::Some(input.into());
297        self
298    }
299    /// <p>\[IPv6 traffic only\] The ID of an egress-only internet gateway.</p>
300    pub fn set_egress_only_internet_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
301        self.egress_only_internet_gateway_id = input;
302        self
303    }
304    /// <p>\[IPv6 traffic only\] The ID of an egress-only internet gateway.</p>
305    pub fn get_egress_only_internet_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
306        &self.egress_only_internet_gateway_id
307    }
308    /// <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>
309    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
310        self.instance_id = ::std::option::Option::Some(input.into());
311        self
312    }
313    /// <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>
314    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
315        self.instance_id = input;
316        self
317    }
318    /// <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>
319    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
320        &self.instance_id
321    }
322    /// <p>The ID of a network interface.</p>
323    pub fn network_interface_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
324        self.network_interface_id = ::std::option::Option::Some(input.into());
325        self
326    }
327    /// <p>The ID of a network interface.</p>
328    pub fn set_network_interface_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
329        self.network_interface_id = input;
330        self
331    }
332    /// <p>The ID of a network interface.</p>
333    pub fn get_network_interface_id(&self) -> &::std::option::Option<::std::string::String> {
334        &self.network_interface_id
335    }
336    /// <p>The ID of a VPC peering connection.</p>
337    pub fn vpc_peering_connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
338        self.vpc_peering_connection_id = ::std::option::Option::Some(input.into());
339        self
340    }
341    /// <p>The ID of a VPC peering connection.</p>
342    pub fn set_vpc_peering_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
343        self.vpc_peering_connection_id = input;
344        self
345    }
346    /// <p>The ID of a VPC peering connection.</p>
347    pub fn get_vpc_peering_connection_id(&self) -> &::std::option::Option<::std::string::String> {
348        &self.vpc_peering_connection_id
349    }
350    /// <p>\[IPv4 traffic only\] The ID of a NAT gateway.</p>
351    pub fn nat_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
352        self.nat_gateway_id = ::std::option::Option::Some(input.into());
353        self
354    }
355    /// <p>\[IPv4 traffic only\] The ID of a NAT gateway.</p>
356    pub fn set_nat_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
357        self.nat_gateway_id = input;
358        self
359    }
360    /// <p>\[IPv4 traffic only\] The ID of a NAT gateway.</p>
361    pub fn get_nat_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
362        &self.nat_gateway_id
363    }
364    /// Consumes the builder and constructs a [`CreateRouteInput`](crate::operation::create_route::CreateRouteInput).
365    pub fn build(self) -> ::std::result::Result<crate::operation::create_route::CreateRouteInput, ::aws_smithy_types::error::operation::BuildError> {
366        ::std::result::Result::Ok(crate::operation::create_route::CreateRouteInput {
367            destination_prefix_list_id: self.destination_prefix_list_id,
368            vpc_endpoint_id: self.vpc_endpoint_id,
369            transit_gateway_id: self.transit_gateway_id,
370            local_gateway_id: self.local_gateway_id,
371            carrier_gateway_id: self.carrier_gateway_id,
372            core_network_arn: self.core_network_arn,
373            dry_run: self.dry_run,
374            route_table_id: self.route_table_id,
375            destination_cidr_block: self.destination_cidr_block,
376            gateway_id: self.gateway_id,
377            destination_ipv6_cidr_block: self.destination_ipv6_cidr_block,
378            egress_only_internet_gateway_id: self.egress_only_internet_gateway_id,
379            instance_id: self.instance_id,
380            network_interface_id: self.network_interface_id,
381            vpc_peering_connection_id: self.vpc_peering_connection_id,
382            nat_gateway_id: self.nat_gateway_id,
383        })
384    }
385}