aws_sdk_ec2/operation/replace_route/
_replace_route_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct ReplaceRouteInput {
6    pub destination_prefix_list_id: ::std::option::Option<::std::string::String>,
8    pub vpc_endpoint_id: ::std::option::Option<::std::string::String>,
10    pub local_target: ::std::option::Option<bool>,
12    pub transit_gateway_id: ::std::option::Option<::std::string::String>,
14    pub local_gateway_id: ::std::option::Option<::std::string::String>,
16    pub carrier_gateway_id: ::std::option::Option<::std::string::String>,
18    pub core_network_arn: ::std::option::Option<::std::string::String>,
20    pub dry_run: ::std::option::Option<bool>,
22    pub route_table_id: ::std::option::Option<::std::string::String>,
24    pub destination_cidr_block: ::std::option::Option<::std::string::String>,
26    pub gateway_id: ::std::option::Option<::std::string::String>,
28    pub destination_ipv6_cidr_block: ::std::option::Option<::std::string::String>,
30    pub egress_only_internet_gateway_id: ::std::option::Option<::std::string::String>,
32    pub instance_id: ::std::option::Option<::std::string::String>,
34    pub network_interface_id: ::std::option::Option<::std::string::String>,
36    pub vpc_peering_connection_id: ::std::option::Option<::std::string::String>,
38    pub nat_gateway_id: ::std::option::Option<::std::string::String>,
40}
41impl ReplaceRouteInput {
42    pub fn destination_prefix_list_id(&self) -> ::std::option::Option<&str> {
44        self.destination_prefix_list_id.as_deref()
45    }
46    pub fn vpc_endpoint_id(&self) -> ::std::option::Option<&str> {
48        self.vpc_endpoint_id.as_deref()
49    }
50    pub fn local_target(&self) -> ::std::option::Option<bool> {
52        self.local_target
53    }
54    pub fn transit_gateway_id(&self) -> ::std::option::Option<&str> {
56        self.transit_gateway_id.as_deref()
57    }
58    pub fn local_gateway_id(&self) -> ::std::option::Option<&str> {
60        self.local_gateway_id.as_deref()
61    }
62    pub fn carrier_gateway_id(&self) -> ::std::option::Option<&str> {
64        self.carrier_gateway_id.as_deref()
65    }
66    pub fn core_network_arn(&self) -> ::std::option::Option<&str> {
68        self.core_network_arn.as_deref()
69    }
70    pub fn dry_run(&self) -> ::std::option::Option<bool> {
72        self.dry_run
73    }
74    pub fn route_table_id(&self) -> ::std::option::Option<&str> {
76        self.route_table_id.as_deref()
77    }
78    pub fn destination_cidr_block(&self) -> ::std::option::Option<&str> {
80        self.destination_cidr_block.as_deref()
81    }
82    pub fn gateway_id(&self) -> ::std::option::Option<&str> {
84        self.gateway_id.as_deref()
85    }
86    pub fn destination_ipv6_cidr_block(&self) -> ::std::option::Option<&str> {
88        self.destination_ipv6_cidr_block.as_deref()
89    }
90    pub fn egress_only_internet_gateway_id(&self) -> ::std::option::Option<&str> {
92        self.egress_only_internet_gateway_id.as_deref()
93    }
94    pub fn instance_id(&self) -> ::std::option::Option<&str> {
96        self.instance_id.as_deref()
97    }
98    pub fn network_interface_id(&self) -> ::std::option::Option<&str> {
100        self.network_interface_id.as_deref()
101    }
102    pub fn vpc_peering_connection_id(&self) -> ::std::option::Option<&str> {
104        self.vpc_peering_connection_id.as_deref()
105    }
106    pub fn nat_gateway_id(&self) -> ::std::option::Option<&str> {
108        self.nat_gateway_id.as_deref()
109    }
110}
111impl ReplaceRouteInput {
112    pub fn builder() -> crate::operation::replace_route::builders::ReplaceRouteInputBuilder {
114        crate::operation::replace_route::builders::ReplaceRouteInputBuilder::default()
115    }
116}
117
118#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
120#[non_exhaustive]
121pub struct ReplaceRouteInputBuilder {
122    pub(crate) destination_prefix_list_id: ::std::option::Option<::std::string::String>,
123    pub(crate) vpc_endpoint_id: ::std::option::Option<::std::string::String>,
124    pub(crate) local_target: ::std::option::Option<bool>,
125    pub(crate) transit_gateway_id: ::std::option::Option<::std::string::String>,
126    pub(crate) local_gateway_id: ::std::option::Option<::std::string::String>,
127    pub(crate) carrier_gateway_id: ::std::option::Option<::std::string::String>,
128    pub(crate) core_network_arn: ::std::option::Option<::std::string::String>,
129    pub(crate) dry_run: ::std::option::Option<bool>,
130    pub(crate) route_table_id: ::std::option::Option<::std::string::String>,
131    pub(crate) destination_cidr_block: ::std::option::Option<::std::string::String>,
132    pub(crate) gateway_id: ::std::option::Option<::std::string::String>,
133    pub(crate) destination_ipv6_cidr_block: ::std::option::Option<::std::string::String>,
134    pub(crate) egress_only_internet_gateway_id: ::std::option::Option<::std::string::String>,
135    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
136    pub(crate) network_interface_id: ::std::option::Option<::std::string::String>,
137    pub(crate) vpc_peering_connection_id: ::std::option::Option<::std::string::String>,
138    pub(crate) nat_gateway_id: ::std::option::Option<::std::string::String>,
139}
140impl ReplaceRouteInputBuilder {
141    pub fn destination_prefix_list_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.destination_prefix_list_id = ::std::option::Option::Some(input.into());
144        self
145    }
146    pub fn set_destination_prefix_list_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.destination_prefix_list_id = input;
149        self
150    }
151    pub fn get_destination_prefix_list_id(&self) -> &::std::option::Option<::std::string::String> {
153        &self.destination_prefix_list_id
154    }
155    pub fn vpc_endpoint_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157        self.vpc_endpoint_id = ::std::option::Option::Some(input.into());
158        self
159    }
160    pub fn set_vpc_endpoint_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162        self.vpc_endpoint_id = input;
163        self
164    }
165    pub fn get_vpc_endpoint_id(&self) -> &::std::option::Option<::std::string::String> {
167        &self.vpc_endpoint_id
168    }
169    pub fn local_target(mut self, input: bool) -> Self {
171        self.local_target = ::std::option::Option::Some(input);
172        self
173    }
174    pub fn set_local_target(mut self, input: ::std::option::Option<bool>) -> Self {
176        self.local_target = input;
177        self
178    }
179    pub fn get_local_target(&self) -> &::std::option::Option<bool> {
181        &self.local_target
182    }
183    pub fn transit_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185        self.transit_gateway_id = ::std::option::Option::Some(input.into());
186        self
187    }
188    pub fn set_transit_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
190        self.transit_gateway_id = input;
191        self
192    }
193    pub fn get_transit_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
195        &self.transit_gateway_id
196    }
197    pub fn local_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199        self.local_gateway_id = ::std::option::Option::Some(input.into());
200        self
201    }
202    pub fn set_local_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204        self.local_gateway_id = input;
205        self
206    }
207    pub fn get_local_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
209        &self.local_gateway_id
210    }
211    pub fn carrier_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213        self.carrier_gateway_id = ::std::option::Option::Some(input.into());
214        self
215    }
216    pub fn set_carrier_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218        self.carrier_gateway_id = input;
219        self
220    }
221    pub fn get_carrier_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
223        &self.carrier_gateway_id
224    }
225    pub fn core_network_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
227        self.core_network_arn = ::std::option::Option::Some(input.into());
228        self
229    }
230    pub fn set_core_network_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
232        self.core_network_arn = input;
233        self
234    }
235    pub fn get_core_network_arn(&self) -> &::std::option::Option<::std::string::String> {
237        &self.core_network_arn
238    }
239    pub fn dry_run(mut self, input: bool) -> Self {
241        self.dry_run = ::std::option::Option::Some(input);
242        self
243    }
244    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
246        self.dry_run = input;
247        self
248    }
249    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
251        &self.dry_run
252    }
253    pub fn route_table_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
256        self.route_table_id = ::std::option::Option::Some(input.into());
257        self
258    }
259    pub fn set_route_table_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
261        self.route_table_id = input;
262        self
263    }
264    pub fn get_route_table_id(&self) -> &::std::option::Option<::std::string::String> {
266        &self.route_table_id
267    }
268    pub fn destination_cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
270        self.destination_cidr_block = ::std::option::Option::Some(input.into());
271        self
272    }
273    pub fn set_destination_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
275        self.destination_cidr_block = input;
276        self
277    }
278    pub fn get_destination_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
280        &self.destination_cidr_block
281    }
282    pub fn gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
284        self.gateway_id = ::std::option::Option::Some(input.into());
285        self
286    }
287    pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
289        self.gateway_id = input;
290        self
291    }
292    pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
294        &self.gateway_id
295    }
296    pub fn destination_ipv6_cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
298        self.destination_ipv6_cidr_block = ::std::option::Option::Some(input.into());
299        self
300    }
301    pub fn set_destination_ipv6_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
303        self.destination_ipv6_cidr_block = input;
304        self
305    }
306    pub fn get_destination_ipv6_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
308        &self.destination_ipv6_cidr_block
309    }
310    pub fn egress_only_internet_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
312        self.egress_only_internet_gateway_id = ::std::option::Option::Some(input.into());
313        self
314    }
315    pub fn set_egress_only_internet_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
317        self.egress_only_internet_gateway_id = input;
318        self
319    }
320    pub fn get_egress_only_internet_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
322        &self.egress_only_internet_gateway_id
323    }
324    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
326        self.instance_id = ::std::option::Option::Some(input.into());
327        self
328    }
329    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
331        self.instance_id = input;
332        self
333    }
334    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
336        &self.instance_id
337    }
338    pub fn network_interface_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
340        self.network_interface_id = ::std::option::Option::Some(input.into());
341        self
342    }
343    pub fn set_network_interface_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
345        self.network_interface_id = input;
346        self
347    }
348    pub fn get_network_interface_id(&self) -> &::std::option::Option<::std::string::String> {
350        &self.network_interface_id
351    }
352    pub fn vpc_peering_connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
354        self.vpc_peering_connection_id = ::std::option::Option::Some(input.into());
355        self
356    }
357    pub fn set_vpc_peering_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
359        self.vpc_peering_connection_id = input;
360        self
361    }
362    pub fn get_vpc_peering_connection_id(&self) -> &::std::option::Option<::std::string::String> {
364        &self.vpc_peering_connection_id
365    }
366    pub fn nat_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
368        self.nat_gateway_id = ::std::option::Option::Some(input.into());
369        self
370    }
371    pub fn set_nat_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
373        self.nat_gateway_id = input;
374        self
375    }
376    pub fn get_nat_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
378        &self.nat_gateway_id
379    }
380    pub fn build(
382        self,
383    ) -> ::std::result::Result<crate::operation::replace_route::ReplaceRouteInput, ::aws_smithy_types::error::operation::BuildError> {
384        ::std::result::Result::Ok(crate::operation::replace_route::ReplaceRouteInput {
385            destination_prefix_list_id: self.destination_prefix_list_id,
386            vpc_endpoint_id: self.vpc_endpoint_id,
387            local_target: self.local_target,
388            transit_gateway_id: self.transit_gateway_id,
389            local_gateway_id: self.local_gateway_id,
390            carrier_gateway_id: self.carrier_gateway_id,
391            core_network_arn: self.core_network_arn,
392            dry_run: self.dry_run,
393            route_table_id: self.route_table_id,
394            destination_cidr_block: self.destination_cidr_block,
395            gateway_id: self.gateway_id,
396            destination_ipv6_cidr_block: self.destination_ipv6_cidr_block,
397            egress_only_internet_gateway_id: self.egress_only_internet_gateway_id,
398            instance_id: self.instance_id,
399            network_interface_id: self.network_interface_id,
400            vpc_peering_connection_id: self.vpc_peering_connection_id,
401            nat_gateway_id: self.nat_gateway_id,
402        })
403    }
404}