aws_sdk_ec2/protocol_serde/
shape_network_acl_entry.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_network_acl_entry(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::NetworkAclEntry, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::NetworkAclEntry::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("cidrBlock") => {
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_cidr_block(var_1);
21 }
22 ,
23 s if s.matches("egress") => {
24 let var_2 =
25 Some(
26 {
27 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
28 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
29 )
30 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
31 }
32 ?
33 )
34 ;
35 builder = builder.set_egress(var_2);
36 }
37 ,
38 s if s.matches("icmpTypeCode") => {
39 let var_3 =
40 Some(
41 crate::protocol_serde::shape_icmp_type_code::de_icmp_type_code(&mut tag)
42 ?
43 )
44 ;
45 builder = builder.set_icmp_type_code(var_3);
46 }
47 ,
48 s if s.matches("ipv6CidrBlock") => {
49 let var_4 =
50 Some(
51 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
52 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
53 .into()
54 )
55 ?
56 )
57 ;
58 builder = builder.set_ipv6_cidr_block(var_4);
59 }
60 ,
61 s if s.matches("portRange") => {
62 let var_5 =
63 Some(
64 crate::protocol_serde::shape_port_range::de_port_range(&mut tag)
65 ?
66 )
67 ;
68 builder = builder.set_port_range(var_5);
69 }
70 ,
71 s if s.matches("protocol") => {
72 let var_6 =
73 Some(
74 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
75 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
76 .into()
77 )
78 ?
79 )
80 ;
81 builder = builder.set_protocol(var_6);
82 }
83 ,
84 s if s.matches("ruleAction") => {
85 let var_7 =
86 Some(
87 Result::<crate::types::RuleAction, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
88 crate::types::RuleAction::from(
89 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
90 )
91 )
92 ?
93 )
94 ;
95 builder = builder.set_rule_action(var_7);
96 }
97 ,
98 s if s.matches("ruleNumber") => {
99 let var_8 =
100 Some(
101 {
102 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
103 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
104 )
105 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
106 }
107 ?
108 )
109 ;
110 builder = builder.set_rule_number(var_8);
111 }
112 ,
113 _ => {}
114 }
115 }
116 Ok(builder.build())
117}