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 dry_run: ::std::option::Option<bool>,
21 pub route_table_id: ::std::option::Option<::std::string::String>,
23 pub destination_cidr_block: ::std::option::Option<::std::string::String>,
25 pub gateway_id: ::std::option::Option<::std::string::String>,
27 pub destination_ipv6_cidr_block: ::std::option::Option<::std::string::String>,
29 pub egress_only_internet_gateway_id: ::std::option::Option<::std::string::String>,
31 pub instance_id: ::std::option::Option<::std::string::String>,
33 pub network_interface_id: ::std::option::Option<::std::string::String>,
35 pub vpc_peering_connection_id: ::std::option::Option<::std::string::String>,
37 pub nat_gateway_id: ::std::option::Option<::std::string::String>,
39}
40impl CreateRouteInput {
41 pub fn destination_prefix_list_id(&self) -> ::std::option::Option<&str> {
43 self.destination_prefix_list_id.as_deref()
44 }
45 pub fn vpc_endpoint_id(&self) -> ::std::option::Option<&str> {
47 self.vpc_endpoint_id.as_deref()
48 }
49 pub fn transit_gateway_id(&self) -> ::std::option::Option<&str> {
51 self.transit_gateway_id.as_deref()
52 }
53 pub fn local_gateway_id(&self) -> ::std::option::Option<&str> {
55 self.local_gateway_id.as_deref()
56 }
57 pub fn carrier_gateway_id(&self) -> ::std::option::Option<&str> {
60 self.carrier_gateway_id.as_deref()
61 }
62 pub fn core_network_arn(&self) -> ::std::option::Option<&str> {
64 self.core_network_arn.as_deref()
65 }
66 pub fn dry_run(&self) -> ::std::option::Option<bool> {
68 self.dry_run
69 }
70 pub fn route_table_id(&self) -> ::std::option::Option<&str> {
72 self.route_table_id.as_deref()
73 }
74 pub fn destination_cidr_block(&self) -> ::std::option::Option<&str> {
76 self.destination_cidr_block.as_deref()
77 }
78 pub fn gateway_id(&self) -> ::std::option::Option<&str> {
80 self.gateway_id.as_deref()
81 }
82 pub fn destination_ipv6_cidr_block(&self) -> ::std::option::Option<&str> {
84 self.destination_ipv6_cidr_block.as_deref()
85 }
86 pub fn egress_only_internet_gateway_id(&self) -> ::std::option::Option<&str> {
88 self.egress_only_internet_gateway_id.as_deref()
89 }
90 pub fn instance_id(&self) -> ::std::option::Option<&str> {
92 self.instance_id.as_deref()
93 }
94 pub fn network_interface_id(&self) -> ::std::option::Option<&str> {
96 self.network_interface_id.as_deref()
97 }
98 pub fn vpc_peering_connection_id(&self) -> ::std::option::Option<&str> {
100 self.vpc_peering_connection_id.as_deref()
101 }
102 pub fn nat_gateway_id(&self) -> ::std::option::Option<&str> {
104 self.nat_gateway_id.as_deref()
105 }
106}
107impl CreateRouteInput {
108 pub fn builder() -> crate::operation::create_route::builders::CreateRouteInputBuilder {
110 crate::operation::create_route::builders::CreateRouteInputBuilder::default()
111 }
112}
113
114#[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 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 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 pub fn get_destination_prefix_list_id(&self) -> &::std::option::Option<::std::string::String> {
148 &self.destination_prefix_list_id
149 }
150 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 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 pub fn get_vpc_endpoint_id(&self) -> &::std::option::Option<::std::string::String> {
162 &self.vpc_endpoint_id
163 }
164 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 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 pub fn get_transit_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
176 &self.transit_gateway_id
177 }
178 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 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 pub fn get_local_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
190 &self.local_gateway_id
191 }
192 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 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 pub fn get_carrier_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
207 &self.carrier_gateway_id
208 }
209 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 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 pub fn get_core_network_arn(&self) -> &::std::option::Option<::std::string::String> {
221 &self.core_network_arn
222 }
223 pub fn dry_run(mut self, input: bool) -> Self {
225 self.dry_run = ::std::option::Option::Some(input);
226 self
227 }
228 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
230 self.dry_run = input;
231 self
232 }
233 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
235 &self.dry_run
236 }
237 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 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 pub fn get_route_table_id(&self) -> &::std::option::Option<::std::string::String> {
250 &self.route_table_id
251 }
252 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 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 pub fn get_destination_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
264 &self.destination_cidr_block
265 }
266 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 pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
273 self.gateway_id = input;
274 self
275 }
276 pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
278 &self.gateway_id
279 }
280 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 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 pub fn get_destination_ipv6_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
292 &self.destination_ipv6_cidr_block
293 }
294 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 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 pub fn get_egress_only_internet_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
306 &self.egress_only_internet_gateway_id
307 }
308 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 pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
315 self.instance_id = input;
316 self
317 }
318 pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
320 &self.instance_id
321 }
322 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 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 pub fn get_network_interface_id(&self) -> &::std::option::Option<::std::string::String> {
334 &self.network_interface_id
335 }
336 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 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 pub fn get_vpc_peering_connection_id(&self) -> &::std::option::Option<::std::string::String> {
348 &self.vpc_peering_connection_id
349 }
350 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 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 pub fn get_nat_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
362 &self.nat_gateway_id
363 }
364 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}