aws_sdk_ec2/protocol_serde/
shape_firewall_stateful_rule.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::needless_question_mark)]
3pub fn de_firewall_stateful_rule(
4    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::FirewallStatefulRule, ::aws_smithy_xml::decode::XmlDecodeError> {
6    #[allow(unused_mut)]
7    let mut builder = crate::types::FirewallStatefulRule::builder();
8    while let Some(mut tag) = decoder.next_tag() {
9        match tag.start_el() {
10            s if s.matches("ruleGroupArn") /* RuleGroupArn com.amazonaws.ec2#FirewallStatefulRule$RuleGroupArn */ =>  {
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_rule_group_arn(var_1);
21            }
22            ,
23            s if s.matches("sourceSet") /* Sources com.amazonaws.ec2#FirewallStatefulRule$Sources */ =>  {
24                let var_2 =
25                    Some(
26                        crate::protocol_serde::shape_value_string_list::de_value_string_list(&mut tag)
27                        ?
28                    )
29                ;
30                builder = builder.set_sources(var_2);
31            }
32            ,
33            s if s.matches("destinationSet") /* Destinations com.amazonaws.ec2#FirewallStatefulRule$Destinations */ =>  {
34                let var_3 =
35                    Some(
36                        crate::protocol_serde::shape_value_string_list::de_value_string_list(&mut tag)
37                        ?
38                    )
39                ;
40                builder = builder.set_destinations(var_3);
41            }
42            ,
43            s if s.matches("sourcePortSet") /* SourcePorts com.amazonaws.ec2#FirewallStatefulRule$SourcePorts */ =>  {
44                let var_4 =
45                    Some(
46                        crate::protocol_serde::shape_port_range_list::de_port_range_list(&mut tag)
47                        ?
48                    )
49                ;
50                builder = builder.set_source_ports(var_4);
51            }
52            ,
53            s if s.matches("destinationPortSet") /* DestinationPorts com.amazonaws.ec2#FirewallStatefulRule$DestinationPorts */ =>  {
54                let var_5 =
55                    Some(
56                        crate::protocol_serde::shape_port_range_list::de_port_range_list(&mut tag)
57                        ?
58                    )
59                ;
60                builder = builder.set_destination_ports(var_5);
61            }
62            ,
63            s if s.matches("protocol") /* Protocol com.amazonaws.ec2#FirewallStatefulRule$Protocol */ =>  {
64                let var_6 =
65                    Some(
66                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
67                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
68                            .into()
69                        )
70                        ?
71                    )
72                ;
73                builder = builder.set_protocol(var_6);
74            }
75            ,
76            s if s.matches("ruleAction") /* RuleAction com.amazonaws.ec2#FirewallStatefulRule$RuleAction */ =>  {
77                let var_7 =
78                    Some(
79                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
80                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
81                            .into()
82                        )
83                        ?
84                    )
85                ;
86                builder = builder.set_rule_action(var_7);
87            }
88            ,
89            s if s.matches("direction") /* Direction com.amazonaws.ec2#FirewallStatefulRule$Direction */ =>  {
90                let var_8 =
91                    Some(
92                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
93                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
94                            .into()
95                        )
96                        ?
97                    )
98                ;
99                builder = builder.set_direction(var_8);
100            }
101            ,
102            _ => {}
103        }
104    }
105    Ok(builder.build())
106}