aws_sdk_ec2/protocol_serde/
shape_local_gateway_route.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_local_gateway_route(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::LocalGatewayRoute, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::LocalGatewayRoute::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("destinationCidrBlock") => {
11 let var_1 =
12 Some(
13 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
14 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
15 .into()
16 )
17 ?
18 )
19 ;
20 builder = builder.set_destination_cidr_block(var_1);
21 }
22 ,
23 s if s.matches("localGatewayVirtualInterfaceGroupId") => {
24 let var_2 =
25 Some(
26 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
27 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
28 .into()
29 )
30 ?
31 )
32 ;
33 builder = builder.set_local_gateway_virtual_interface_group_id(var_2);
34 }
35 ,
36 s if s.matches("type") => {
37 let var_3 =
38 Some(
39 Result::<crate::types::LocalGatewayRouteType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
40 crate::types::LocalGatewayRouteType::from(
41 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
42 )
43 )
44 ?
45 )
46 ;
47 builder = builder.set_type(var_3);
48 }
49 ,
50 s if s.matches("state") => {
51 let var_4 =
52 Some(
53 Result::<crate::types::LocalGatewayRouteState, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
54 crate::types::LocalGatewayRouteState::from(
55 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
56 )
57 )
58 ?
59 )
60 ;
61 builder = builder.set_state(var_4);
62 }
63 ,
64 s if s.matches("localGatewayRouteTableId") => {
65 let var_5 =
66 Some(
67 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
68 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
69 .into()
70 )
71 ?
72 )
73 ;
74 builder = builder.set_local_gateway_route_table_id(var_5);
75 }
76 ,
77 s if s.matches("localGatewayRouteTableArn") => {
78 let var_6 =
79 Some(
80 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
81 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
82 .into()
83 )
84 ?
85 )
86 ;
87 builder = builder.set_local_gateway_route_table_arn(var_6);
88 }
89 ,
90 s if s.matches("ownerId") => {
91 let var_7 =
92 Some(
93 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
94 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
95 .into()
96 )
97 ?
98 )
99 ;
100 builder = builder.set_owner_id(var_7);
101 }
102 ,
103 s if s.matches("subnetId") => {
104 let var_8 =
105 Some(
106 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
107 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
108 .into()
109 )
110 ?
111 )
112 ;
113 builder = builder.set_subnet_id(var_8);
114 }
115 ,
116 s if s.matches("coipPoolId") => {
117 let var_9 =
118 Some(
119 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
120 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
121 .into()
122 )
123 ?
124 )
125 ;
126 builder = builder.set_coip_pool_id(var_9);
127 }
128 ,
129 s if s.matches("networkInterfaceId") => {
130 let var_10 =
131 Some(
132 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
133 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
134 .into()
135 )
136 ?
137 )
138 ;
139 builder = builder.set_network_interface_id(var_10);
140 }
141 ,
142 s if s.matches("destinationPrefixListId") => {
143 let var_11 =
144 Some(
145 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
146 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
147 .into()
148 )
149 ?
150 )
151 ;
152 builder = builder.set_destination_prefix_list_id(var_11);
153 }
154 ,
155 _ => {}
156 }
157 }
158 Ok(builder.build())
159}