aws_sdk_ec2/protocol_serde/
shape_network_interface.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_network_interface(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::NetworkInterface, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::NetworkInterface::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("association") => {
11 let var_1 =
12 Some(
13 crate::protocol_serde::shape_network_interface_association::de_network_interface_association(&mut tag)
14 ?
15 )
16 ;
17 builder = builder.set_association(var_1);
18 }
19 ,
20 s if s.matches("attachment") => {
21 let var_2 =
22 Some(
23 crate::protocol_serde::shape_network_interface_attachment::de_network_interface_attachment(&mut tag)
24 ?
25 )
26 ;
27 builder = builder.set_attachment(var_2);
28 }
29 ,
30 s if s.matches("availabilityZone") => {
31 let var_3 =
32 Some(
33 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
34 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
35 .into()
36 )
37 ?
38 )
39 ;
40 builder = builder.set_availability_zone(var_3);
41 }
42 ,
43 s if s.matches("connectionTrackingConfiguration") => {
44 let var_4 =
45 Some(
46 crate::protocol_serde::shape_connection_tracking_configuration::de_connection_tracking_configuration(&mut tag)
47 ?
48 )
49 ;
50 builder = builder.set_connection_tracking_configuration(var_4);
51 }
52 ,
53 s if s.matches("description") => {
54 let var_5 =
55 Some(
56 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
57 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
58 .into()
59 )
60 ?
61 )
62 ;
63 builder = builder.set_description(var_5);
64 }
65 ,
66 s if s.matches("groupSet") => {
67 let var_6 =
68 Some(
69 crate::protocol_serde::shape_group_identifier_list::de_group_identifier_list(&mut tag)
70 ?
71 )
72 ;
73 builder = builder.set_groups(var_6);
74 }
75 ,
76 s if s.matches("interfaceType") => {
77 let var_7 =
78 Some(
79 Result::<crate::types::NetworkInterfaceType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
80 crate::types::NetworkInterfaceType::from(
81 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
82 )
83 )
84 ?
85 )
86 ;
87 builder = builder.set_interface_type(var_7);
88 }
89 ,
90 s if s.matches("ipv6AddressesSet") => {
91 let var_8 =
92 Some(
93 crate::protocol_serde::shape_network_interface_ipv6_addresses_list::de_network_interface_ipv6_addresses_list(&mut tag)
94 ?
95 )
96 ;
97 builder = builder.set_ipv6_addresses(var_8);
98 }
99 ,
100 s if s.matches("macAddress") => {
101 let var_9 =
102 Some(
103 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
104 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
105 .into()
106 )
107 ?
108 )
109 ;
110 builder = builder.set_mac_address(var_9);
111 }
112 ,
113 s if s.matches("networkInterfaceId") => {
114 let var_10 =
115 Some(
116 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
117 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
118 .into()
119 )
120 ?
121 )
122 ;
123 builder = builder.set_network_interface_id(var_10);
124 }
125 ,
126 s if s.matches("outpostArn") => {
127 let var_11 =
128 Some(
129 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
130 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
131 .into()
132 )
133 ?
134 )
135 ;
136 builder = builder.set_outpost_arn(var_11);
137 }
138 ,
139 s if s.matches("ownerId") => {
140 let var_12 =
141 Some(
142 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
143 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
144 .into()
145 )
146 ?
147 )
148 ;
149 builder = builder.set_owner_id(var_12);
150 }
151 ,
152 s if s.matches("privateDnsName") => {
153 let var_13 =
154 Some(
155 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
156 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
157 .into()
158 )
159 ?
160 )
161 ;
162 builder = builder.set_private_dns_name(var_13);
163 }
164 ,
165 s if s.matches("publicDnsName") => {
166 let var_14 =
167 Some(
168 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
169 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
170 .into()
171 )
172 ?
173 )
174 ;
175 builder = builder.set_public_dns_name(var_14);
176 }
177 ,
178 s if s.matches("publicIpDnsNameOptions") => {
179 let var_15 =
180 Some(
181 crate::protocol_serde::shape_public_ip_dns_name_options::de_public_ip_dns_name_options(&mut tag)
182 ?
183 )
184 ;
185 builder = builder.set_public_ip_dns_name_options(var_15);
186 }
187 ,
188 s if s.matches("privateIpAddress") => {
189 let var_16 =
190 Some(
191 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
192 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
193 .into()
194 )
195 ?
196 )
197 ;
198 builder = builder.set_private_ip_address(var_16);
199 }
200 ,
201 s if s.matches("privateIpAddressesSet") => {
202 let var_17 =
203 Some(
204 crate::protocol_serde::shape_network_interface_private_ip_address_list::de_network_interface_private_ip_address_list(&mut tag)
205 ?
206 )
207 ;
208 builder = builder.set_private_ip_addresses(var_17);
209 }
210 ,
211 s if s.matches("ipv4PrefixSet") => {
212 let var_18 =
213 Some(
214 crate::protocol_serde::shape_ipv4_prefixes_list::de_ipv4_prefixes_list(&mut tag)
215 ?
216 )
217 ;
218 builder = builder.set_ipv4_prefixes(var_18);
219 }
220 ,
221 s if s.matches("ipv6PrefixSet") => {
222 let var_19 =
223 Some(
224 crate::protocol_serde::shape_ipv6_prefixes_list::de_ipv6_prefixes_list(&mut tag)
225 ?
226 )
227 ;
228 builder = builder.set_ipv6_prefixes(var_19);
229 }
230 ,
231 s if s.matches("requesterId") => {
232 let var_20 =
233 Some(
234 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
235 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
236 .into()
237 )
238 ?
239 )
240 ;
241 builder = builder.set_requester_id(var_20);
242 }
243 ,
244 s if s.matches("requesterManaged") => {
245 let var_21 =
246 Some(
247 {
248 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
249 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
250 )
251 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
252 }
253 ?
254 )
255 ;
256 builder = builder.set_requester_managed(var_21);
257 }
258 ,
259 s if s.matches("sourceDestCheck") => {
260 let var_22 =
261 Some(
262 {
263 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
264 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
265 )
266 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
267 }
268 ?
269 )
270 ;
271 builder = builder.set_source_dest_check(var_22);
272 }
273 ,
274 s if s.matches("status") => {
275 let var_23 =
276 Some(
277 Result::<crate::types::NetworkInterfaceStatus, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
278 crate::types::NetworkInterfaceStatus::from(
279 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
280 )
281 )
282 ?
283 )
284 ;
285 builder = builder.set_status(var_23);
286 }
287 ,
288 s if s.matches("subnetId") => {
289 let var_24 =
290 Some(
291 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
292 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
293 .into()
294 )
295 ?
296 )
297 ;
298 builder = builder.set_subnet_id(var_24);
299 }
300 ,
301 s if s.matches("tagSet") => {
302 let var_25 =
303 Some(
304 crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
305 ?
306 )
307 ;
308 builder = builder.set_tag_set(var_25);
309 }
310 ,
311 s if s.matches("vpcId") => {
312 let var_26 =
313 Some(
314 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
315 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
316 .into()
317 )
318 ?
319 )
320 ;
321 builder = builder.set_vpc_id(var_26);
322 }
323 ,
324 s if s.matches("denyAllIgwTraffic") => {
325 let var_27 =
326 Some(
327 {
328 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
329 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
330 )
331 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
332 }
333 ?
334 )
335 ;
336 builder = builder.set_deny_all_igw_traffic(var_27);
337 }
338 ,
339 s if s.matches("ipv6Native") => {
340 let var_28 =
341 Some(
342 {
343 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
344 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
345 )
346 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
347 }
348 ?
349 )
350 ;
351 builder = builder.set_ipv6_native(var_28);
352 }
353 ,
354 s if s.matches("ipv6Address") => {
355 let var_29 =
356 Some(
357 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
358 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
359 .into()
360 )
361 ?
362 )
363 ;
364 builder = builder.set_ipv6_address(var_29);
365 }
366 ,
367 s if s.matches("operator") => {
368 let var_30 =
369 Some(
370 crate::protocol_serde::shape_operator_response::de_operator_response(&mut tag)
371 ?
372 )
373 ;
374 builder = builder.set_operator(var_30);
375 }
376 ,
377 s if s.matches("associatedSubnetSet") => {
378 let var_31 =
379 Some(
380 crate::protocol_serde::shape_associated_subnet_list::de_associated_subnet_list(&mut tag)
381 ?
382 )
383 ;
384 builder = builder.set_associated_subnets(var_31);
385 }
386 ,
387 _ => {}
388 }
389 }
390 Ok(builder.build())
391}