aws_sdk_ec2/protocol_serde/
shape_availability_zone.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::needless_question_mark)]
3pub fn de_availability_zone(
4    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::AvailabilityZone, ::aws_smithy_xml::decode::XmlDecodeError> {
6    #[allow(unused_mut)]
7    let mut builder = crate::types::AvailabilityZone::builder();
8    while let Some(mut tag) = decoder.next_tag() {
9        match tag.start_el() {
10            s if s.matches("optInStatus") /* OptInStatus com.amazonaws.ec2#AvailabilityZone$OptInStatus */ =>  {
11                let var_1 =
12                    Some(
13                        Result::<crate::types::AvailabilityZoneOptInStatus, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
14                            crate::types::AvailabilityZoneOptInStatus::from(
15                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
16                            )
17                        )
18                        ?
19                    )
20                ;
21                builder = builder.set_opt_in_status(var_1);
22            }
23            ,
24            s if s.matches("messageSet") /* Messages com.amazonaws.ec2#AvailabilityZone$Messages */ =>  {
25                let var_2 =
26                    Some(
27                        crate::protocol_serde::shape_availability_zone_message_list::de_availability_zone_message_list(&mut tag)
28                        ?
29                    )
30                ;
31                builder = builder.set_messages(var_2);
32            }
33            ,
34            s if s.matches("regionName") /* RegionName com.amazonaws.ec2#AvailabilityZone$RegionName */ =>  {
35                let var_3 =
36                    Some(
37                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
38                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
39                            .into()
40                        )
41                        ?
42                    )
43                ;
44                builder = builder.set_region_name(var_3);
45            }
46            ,
47            s if s.matches("zoneName") /* ZoneName com.amazonaws.ec2#AvailabilityZone$ZoneName */ =>  {
48                let var_4 =
49                    Some(
50                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
51                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
52                            .into()
53                        )
54                        ?
55                    )
56                ;
57                builder = builder.set_zone_name(var_4);
58            }
59            ,
60            s if s.matches("zoneId") /* ZoneId com.amazonaws.ec2#AvailabilityZone$ZoneId */ =>  {
61                let var_5 =
62                    Some(
63                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
64                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
65                            .into()
66                        )
67                        ?
68                    )
69                ;
70                builder = builder.set_zone_id(var_5);
71            }
72            ,
73            s if s.matches("groupName") /* GroupName com.amazonaws.ec2#AvailabilityZone$GroupName */ =>  {
74                let var_6 =
75                    Some(
76                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
77                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
78                            .into()
79                        )
80                        ?
81                    )
82                ;
83                builder = builder.set_group_name(var_6);
84            }
85            ,
86            s if s.matches("networkBorderGroup") /* NetworkBorderGroup com.amazonaws.ec2#AvailabilityZone$NetworkBorderGroup */ =>  {
87                let var_7 =
88                    Some(
89                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
90                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
91                            .into()
92                        )
93                        ?
94                    )
95                ;
96                builder = builder.set_network_border_group(var_7);
97            }
98            ,
99            s if s.matches("zoneType") /* ZoneType com.amazonaws.ec2#AvailabilityZone$ZoneType */ =>  {
100                let var_8 =
101                    Some(
102                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
103                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
104                            .into()
105                        )
106                        ?
107                    )
108                ;
109                builder = builder.set_zone_type(var_8);
110            }
111            ,
112            s if s.matches("parentZoneName") /* ParentZoneName com.amazonaws.ec2#AvailabilityZone$ParentZoneName */ =>  {
113                let var_9 =
114                    Some(
115                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
116                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
117                            .into()
118                        )
119                        ?
120                    )
121                ;
122                builder = builder.set_parent_zone_name(var_9);
123            }
124            ,
125            s if s.matches("parentZoneId") /* ParentZoneId com.amazonaws.ec2#AvailabilityZone$ParentZoneId */ =>  {
126                let var_10 =
127                    Some(
128                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
129                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
130                            .into()
131                        )
132                        ?
133                    )
134                ;
135                builder = builder.set_parent_zone_id(var_10);
136            }
137            ,
138            s if s.matches("groupLongName") /* GroupLongName com.amazonaws.ec2#AvailabilityZone$GroupLongName */ =>  {
139                let var_11 =
140                    Some(
141                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
142                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
143                            .into()
144                        )
145                        ?
146                    )
147                ;
148                builder = builder.set_group_long_name(var_11);
149            }
150            ,
151            s if s.matches("zoneState") /* State com.amazonaws.ec2#AvailabilityZone$State */ =>  {
152                let var_12 =
153                    Some(
154                        Result::<crate::types::AvailabilityZoneState, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
155                            crate::types::AvailabilityZoneState::from(
156                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
157                            )
158                        )
159                        ?
160                    )
161                ;
162                builder = builder.set_state(var_12);
163            }
164            ,
165            _ => {}
166        }
167    }
168    Ok(builder.build())
169}