aws_sdk_elasticloadbalancingv2/protocol_serde/
shape_load_balancer.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_load_balancer(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::LoadBalancer, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::LoadBalancer::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("LoadBalancerArn") => {
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_load_balancer_arn(var_1);
21 }
22 ,
23 s if s.matches("DNSName") => {
24 let var_2 =
25 Some(
26 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
27 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
28 .into()
29 )
30 ?
31 )
32 ;
33 builder = builder.set_dns_name(var_2);
34 }
35 ,
36 s if s.matches("CanonicalHostedZoneId") => {
37 let var_3 =
38 Some(
39 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
40 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
41 .into()
42 )
43 ?
44 )
45 ;
46 builder = builder.set_canonical_hosted_zone_id(var_3);
47 }
48 ,
49 s if s.matches("CreatedTime") => {
50 let var_4 =
51 Some(
52 ::aws_smithy_types::DateTime::from_str(
53 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
54 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
55 )
56 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.elasticloadbalancingv2#CreatedTime`)"))
57 ?
58 )
59 ;
60 builder = builder.set_created_time(var_4);
61 }
62 ,
63 s if s.matches("LoadBalancerName") => {
64 let var_5 =
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_load_balancer_name(var_5);
74 }
75 ,
76 s if s.matches("Scheme") => {
77 let var_6 =
78 Some(
79 Result::<crate::types::LoadBalancerSchemeEnum, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
80 crate::types::LoadBalancerSchemeEnum::from(
81 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
82 )
83 )
84 ?
85 )
86 ;
87 builder = builder.set_scheme(var_6);
88 }
89 ,
90 s if s.matches("VpcId") => {
91 let var_7 =
92 Some(
93 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
94 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
95 .into()
96 )
97 ?
98 )
99 ;
100 builder = builder.set_vpc_id(var_7);
101 }
102 ,
103 s if s.matches("State") => {
104 let var_8 =
105 Some(
106 crate::protocol_serde::shape_load_balancer_state::de_load_balancer_state(&mut tag)
107 ?
108 )
109 ;
110 builder = builder.set_state(var_8);
111 }
112 ,
113 s if s.matches("Type") => {
114 let var_9 =
115 Some(
116 Result::<crate::types::LoadBalancerTypeEnum, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
117 crate::types::LoadBalancerTypeEnum::from(
118 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
119 )
120 )
121 ?
122 )
123 ;
124 builder = builder.set_type(var_9);
125 }
126 ,
127 s if s.matches("AvailabilityZones") => {
128 let var_10 =
129 Some(
130 crate::protocol_serde::shape_availability_zones::de_availability_zones(&mut tag)
131 ?
132 )
133 ;
134 builder = builder.set_availability_zones(var_10);
135 }
136 ,
137 s if s.matches("SecurityGroups") => {
138 let var_11 =
139 Some(
140 crate::protocol_serde::shape_security_groups::de_security_groups(&mut tag)
141 ?
142 )
143 ;
144 builder = builder.set_security_groups(var_11);
145 }
146 ,
147 s if s.matches("IpAddressType") => {
148 let var_12 =
149 Some(
150 Result::<crate::types::IpAddressType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
151 crate::types::IpAddressType::from(
152 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
153 )
154 )
155 ?
156 )
157 ;
158 builder = builder.set_ip_address_type(var_12);
159 }
160 ,
161 s if s.matches("CustomerOwnedIpv4Pool") => {
162 let var_13 =
163 Some(
164 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
165 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
166 .into()
167 )
168 ?
169 )
170 ;
171 builder = builder.set_customer_owned_ipv4_pool(var_13);
172 }
173 ,
174 s if s.matches("EnforceSecurityGroupInboundRulesOnPrivateLinkTraffic") => {
175 let var_14 =
176 Some(
177 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
178 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
179 .into()
180 )
181 ?
182 )
183 ;
184 builder = builder.set_enforce_security_group_inbound_rules_on_private_link_traffic(var_14);
185 }
186 ,
187 s if s.matches("EnablePrefixForIpv6SourceNat") => {
188 let var_15 =
189 Some(
190 Result::<crate::types::EnablePrefixForIpv6SourceNatEnum, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
191 crate::types::EnablePrefixForIpv6SourceNatEnum::from(
192 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
193 )
194 )
195 ?
196 )
197 ;
198 builder = builder.set_enable_prefix_for_ipv6_source_nat(var_15);
199 }
200 ,
201 s if s.matches("IpamPools") => {
202 let var_16 =
203 Some(
204 crate::protocol_serde::shape_ipam_pools::de_ipam_pools(&mut tag)
205 ?
206 )
207 ;
208 builder = builder.set_ipam_pools(var_16);
209 }
210 ,
211 _ => {}
212 }
213 }
214 Ok(builder.build())
215}