aws_sdk_ec2/operation/create_route/
_create_route_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateRouteInput {
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 transit_gateway_id: ::std::option::Option<::std::string::String>,
12 pub local_gateway_id: ::std::option::Option<::std::string::String>,
14 pub carrier_gateway_id: ::std::option::Option<::std::string::String>,
17 pub core_network_arn: ::std::option::Option<::std::string::String>,
19 pub odb_network_arn: ::std::option::Option<::std::string::String>,
21 pub dry_run: ::std::option::Option<bool>,
23 pub route_table_id: ::std::option::Option<::std::string::String>,
25 pub destination_cidr_block: ::std::option::Option<::std::string::String>,
27 pub gateway_id: ::std::option::Option<::std::string::String>,
29 pub destination_ipv6_cidr_block: ::std::option::Option<::std::string::String>,
31 pub egress_only_internet_gateway_id: ::std::option::Option<::std::string::String>,
33 pub instance_id: ::std::option::Option<::std::string::String>,
35 pub network_interface_id: ::std::option::Option<::std::string::String>,
37 pub vpc_peering_connection_id: ::std::option::Option<::std::string::String>,
39 pub nat_gateway_id: ::std::option::Option<::std::string::String>,
41}
42impl CreateRouteInput {
43 pub fn destination_prefix_list_id(&self) -> ::std::option::Option<&str> {
45 self.destination_prefix_list_id.as_deref()
46 }
47 pub fn vpc_endpoint_id(&self) -> ::std::option::Option<&str> {
49 self.vpc_endpoint_id.as_deref()
50 }
51 pub fn transit_gateway_id(&self) -> ::std::option::Option<&str> {
53 self.transit_gateway_id.as_deref()
54 }
55 pub fn local_gateway_id(&self) -> ::std::option::Option<&str> {
57 self.local_gateway_id.as_deref()
58 }
59 pub fn carrier_gateway_id(&self) -> ::std::option::Option<&str> {
62 self.carrier_gateway_id.as_deref()
63 }
64 pub fn core_network_arn(&self) -> ::std::option::Option<&str> {
66 self.core_network_arn.as_deref()
67 }
68 pub fn odb_network_arn(&self) -> ::std::option::Option<&str> {
70 self.odb_network_arn.as_deref()
71 }
72 pub fn dry_run(&self) -> ::std::option::Option<bool> {
74 self.dry_run
75 }
76 pub fn route_table_id(&self) -> ::std::option::Option<&str> {
78 self.route_table_id.as_deref()
79 }
80 pub fn destination_cidr_block(&self) -> ::std::option::Option<&str> {
82 self.destination_cidr_block.as_deref()
83 }
84 pub fn gateway_id(&self) -> ::std::option::Option<&str> {
86 self.gateway_id.as_deref()
87 }
88 pub fn destination_ipv6_cidr_block(&self) -> ::std::option::Option<&str> {
90 self.destination_ipv6_cidr_block.as_deref()
91 }
92 pub fn egress_only_internet_gateway_id(&self) -> ::std::option::Option<&str> {
94 self.egress_only_internet_gateway_id.as_deref()
95 }
96 pub fn instance_id(&self) -> ::std::option::Option<&str> {
98 self.instance_id.as_deref()
99 }
100 pub fn network_interface_id(&self) -> ::std::option::Option<&str> {
102 self.network_interface_id.as_deref()
103 }
104 pub fn vpc_peering_connection_id(&self) -> ::std::option::Option<&str> {
106 self.vpc_peering_connection_id.as_deref()
107 }
108 pub fn nat_gateway_id(&self) -> ::std::option::Option<&str> {
110 self.nat_gateway_id.as_deref()
111 }
112}
113impl CreateRouteInput {
114 pub fn builder() -> crate::operation::create_route::builders::CreateRouteInputBuilder {
116 crate::operation::create_route::builders::CreateRouteInputBuilder::default()
117 }
118}
119
120#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
122#[non_exhaustive]
123pub struct CreateRouteInputBuilder {
124 pub(crate) destination_prefix_list_id: ::std::option::Option<::std::string::String>,
125 pub(crate) vpc_endpoint_id: ::std::option::Option<::std::string::String>,
126 pub(crate) transit_gateway_id: ::std::option::Option<::std::string::String>,
127 pub(crate) local_gateway_id: ::std::option::Option<::std::string::String>,
128 pub(crate) carrier_gateway_id: ::std::option::Option<::std::string::String>,
129 pub(crate) core_network_arn: ::std::option::Option<::std::string::String>,
130 pub(crate) odb_network_arn: ::std::option::Option<::std::string::String>,
131 pub(crate) dry_run: ::std::option::Option<bool>,
132 pub(crate) route_table_id: ::std::option::Option<::std::string::String>,
133 pub(crate) destination_cidr_block: ::std::option::Option<::std::string::String>,
134 pub(crate) gateway_id: ::std::option::Option<::std::string::String>,
135 pub(crate) destination_ipv6_cidr_block: ::std::option::Option<::std::string::String>,
136 pub(crate) egress_only_internet_gateway_id: ::std::option::Option<::std::string::String>,
137 pub(crate) instance_id: ::std::option::Option<::std::string::String>,
138 pub(crate) network_interface_id: ::std::option::Option<::std::string::String>,
139 pub(crate) vpc_peering_connection_id: ::std::option::Option<::std::string::String>,
140 pub(crate) nat_gateway_id: ::std::option::Option<::std::string::String>,
141}
142impl CreateRouteInputBuilder {
143 pub fn destination_prefix_list_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145 self.destination_prefix_list_id = ::std::option::Option::Some(input.into());
146 self
147 }
148 pub fn set_destination_prefix_list_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150 self.destination_prefix_list_id = input;
151 self
152 }
153 pub fn get_destination_prefix_list_id(&self) -> &::std::option::Option<::std::string::String> {
155 &self.destination_prefix_list_id
156 }
157 pub fn vpc_endpoint_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159 self.vpc_endpoint_id = ::std::option::Option::Some(input.into());
160 self
161 }
162 pub fn set_vpc_endpoint_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164 self.vpc_endpoint_id = input;
165 self
166 }
167 pub fn get_vpc_endpoint_id(&self) -> &::std::option::Option<::std::string::String> {
169 &self.vpc_endpoint_id
170 }
171 pub fn transit_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173 self.transit_gateway_id = ::std::option::Option::Some(input.into());
174 self
175 }
176 pub fn set_transit_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178 self.transit_gateway_id = input;
179 self
180 }
181 pub fn get_transit_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
183 &self.transit_gateway_id
184 }
185 pub fn local_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187 self.local_gateway_id = ::std::option::Option::Some(input.into());
188 self
189 }
190 pub fn set_local_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192 self.local_gateway_id = input;
193 self
194 }
195 pub fn get_local_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
197 &self.local_gateway_id
198 }
199 pub fn carrier_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
202 self.carrier_gateway_id = ::std::option::Option::Some(input.into());
203 self
204 }
205 pub fn set_carrier_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
208 self.carrier_gateway_id = input;
209 self
210 }
211 pub fn get_carrier_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
214 &self.carrier_gateway_id
215 }
216 pub fn core_network_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
218 self.core_network_arn = ::std::option::Option::Some(input.into());
219 self
220 }
221 pub fn set_core_network_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
223 self.core_network_arn = input;
224 self
225 }
226 pub fn get_core_network_arn(&self) -> &::std::option::Option<::std::string::String> {
228 &self.core_network_arn
229 }
230 pub fn odb_network_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
232 self.odb_network_arn = ::std::option::Option::Some(input.into());
233 self
234 }
235 pub fn set_odb_network_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
237 self.odb_network_arn = input;
238 self
239 }
240 pub fn get_odb_network_arn(&self) -> &::std::option::Option<::std::string::String> {
242 &self.odb_network_arn
243 }
244 pub fn dry_run(mut self, input: bool) -> Self {
246 self.dry_run = ::std::option::Option::Some(input);
247 self
248 }
249 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
251 self.dry_run = input;
252 self
253 }
254 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
256 &self.dry_run
257 }
258 pub fn route_table_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
261 self.route_table_id = ::std::option::Option::Some(input.into());
262 self
263 }
264 pub fn set_route_table_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
266 self.route_table_id = input;
267 self
268 }
269 pub fn get_route_table_id(&self) -> &::std::option::Option<::std::string::String> {
271 &self.route_table_id
272 }
273 pub fn destination_cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
275 self.destination_cidr_block = ::std::option::Option::Some(input.into());
276 self
277 }
278 pub fn set_destination_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
280 self.destination_cidr_block = input;
281 self
282 }
283 pub fn get_destination_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
285 &self.destination_cidr_block
286 }
287 pub fn gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
289 self.gateway_id = ::std::option::Option::Some(input.into());
290 self
291 }
292 pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
294 self.gateway_id = input;
295 self
296 }
297 pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
299 &self.gateway_id
300 }
301 pub fn destination_ipv6_cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
303 self.destination_ipv6_cidr_block = ::std::option::Option::Some(input.into());
304 self
305 }
306 pub fn set_destination_ipv6_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
308 self.destination_ipv6_cidr_block = input;
309 self
310 }
311 pub fn get_destination_ipv6_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
313 &self.destination_ipv6_cidr_block
314 }
315 pub fn egress_only_internet_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
317 self.egress_only_internet_gateway_id = ::std::option::Option::Some(input.into());
318 self
319 }
320 pub fn set_egress_only_internet_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
322 self.egress_only_internet_gateway_id = input;
323 self
324 }
325 pub fn get_egress_only_internet_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
327 &self.egress_only_internet_gateway_id
328 }
329 pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
331 self.instance_id = ::std::option::Option::Some(input.into());
332 self
333 }
334 pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
336 self.instance_id = input;
337 self
338 }
339 pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
341 &self.instance_id
342 }
343 pub fn network_interface_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
345 self.network_interface_id = ::std::option::Option::Some(input.into());
346 self
347 }
348 pub fn set_network_interface_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
350 self.network_interface_id = input;
351 self
352 }
353 pub fn get_network_interface_id(&self) -> &::std::option::Option<::std::string::String> {
355 &self.network_interface_id
356 }
357 pub fn vpc_peering_connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
359 self.vpc_peering_connection_id = ::std::option::Option::Some(input.into());
360 self
361 }
362 pub fn set_vpc_peering_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
364 self.vpc_peering_connection_id = input;
365 self
366 }
367 pub fn get_vpc_peering_connection_id(&self) -> &::std::option::Option<::std::string::String> {
369 &self.vpc_peering_connection_id
370 }
371 pub fn nat_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
373 self.nat_gateway_id = ::std::option::Option::Some(input.into());
374 self
375 }
376 pub fn set_nat_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
378 self.nat_gateway_id = input;
379 self
380 }
381 pub fn get_nat_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
383 &self.nat_gateway_id
384 }
385 pub fn build(self) -> ::std::result::Result<crate::operation::create_route::CreateRouteInput, ::aws_smithy_types::error::operation::BuildError> {
387 ::std::result::Result::Ok(crate::operation::create_route::CreateRouteInput {
388 destination_prefix_list_id: self.destination_prefix_list_id,
389 vpc_endpoint_id: self.vpc_endpoint_id,
390 transit_gateway_id: self.transit_gateway_id,
391 local_gateway_id: self.local_gateway_id,
392 carrier_gateway_id: self.carrier_gateway_id,
393 core_network_arn: self.core_network_arn,
394 odb_network_arn: self.odb_network_arn,
395 dry_run: self.dry_run,
396 route_table_id: self.route_table_id,
397 destination_cidr_block: self.destination_cidr_block,
398 gateway_id: self.gateway_id,
399 destination_ipv6_cidr_block: self.destination_ipv6_cidr_block,
400 egress_only_internet_gateway_id: self.egress_only_internet_gateway_id,
401 instance_id: self.instance_id,
402 network_interface_id: self.network_interface_id,
403 vpc_peering_connection_id: self.vpc_peering_connection_id,
404 nat_gateway_id: self.nat_gateway_id,
405 })
406 }
407}