aws_sdk_ec2/protocol_serde/
shape_analysis_acl_rule.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_analysis_acl_rule(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::AnalysisAclRule, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::AnalysisAclRule::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("cidr") => {
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(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("portRange") => {
39 let var_3 =
40 Some(
41 crate::protocol_serde::shape_port_range::de_port_range(&mut tag)
42 ?
43 )
44 ;
45 builder = builder.set_port_range(var_3);
46 }
47 ,
48 s if s.matches("protocol") => {
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_protocol(var_4);
59 }
60 ,
61 s if s.matches("ruleAction") => {
62 let var_5 =
63 Some(
64 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
65 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
66 .into()
67 )
68 ?
69 )
70 ;
71 builder = builder.set_rule_action(var_5);
72 }
73 ,
74 s if s.matches("ruleNumber") => {
75 let var_6 =
76 Some(
77 {
78 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
79 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
80 )
81 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
82 }
83 ?
84 )
85 ;
86 builder = builder.set_rule_number(var_6);
87 }
88 ,
89 _ => {}
90 }
91 }
92 Ok(builder.build())
93}