aws_sdk_ec2/protocol_serde/
shape_client_vpn_endpoint.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_client_vpn_endpoint(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::ClientVpnEndpoint, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::ClientVpnEndpoint::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("clientVpnEndpointId") => {
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_client_vpn_endpoint_id(var_1);
21 }
22 ,
23 s if s.matches("description") => {
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_description(var_2);
34 }
35 ,
36 s if s.matches("status") => {
37 let var_3 =
38 Some(
39 crate::protocol_serde::shape_client_vpn_endpoint_status::de_client_vpn_endpoint_status(&mut tag)
40 ?
41 )
42 ;
43 builder = builder.set_status(var_3);
44 }
45 ,
46 s if s.matches("creationTime") => {
47 let var_4 =
48 Some(
49 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
50 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
51 .into()
52 )
53 ?
54 )
55 ;
56 builder = builder.set_creation_time(var_4);
57 }
58 ,
59 s if s.matches("deletionTime") => {
60 let var_5 =
61 Some(
62 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
63 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
64 .into()
65 )
66 ?
67 )
68 ;
69 builder = builder.set_deletion_time(var_5);
70 }
71 ,
72 s if s.matches("dnsName") => {
73 let var_6 =
74 Some(
75 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
76 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
77 .into()
78 )
79 ?
80 )
81 ;
82 builder = builder.set_dns_name(var_6);
83 }
84 ,
85 s if s.matches("clientCidrBlock") => {
86 let var_7 =
87 Some(
88 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
89 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
90 .into()
91 )
92 ?
93 )
94 ;
95 builder = builder.set_client_cidr_block(var_7);
96 }
97 ,
98 s if s.matches("dnsServer") => {
99 let var_8 =
100 Some(
101 crate::protocol_serde::shape_value_string_list::de_value_string_list(&mut tag)
102 ?
103 )
104 ;
105 builder = builder.set_dns_servers(var_8);
106 }
107 ,
108 s if s.matches("splitTunnel") => {
109 let var_9 =
110 Some(
111 {
112 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
113 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
114 )
115 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
116 }
117 ?
118 )
119 ;
120 builder = builder.set_split_tunnel(var_9);
121 }
122 ,
123 s if s.matches("vpnProtocol") => {
124 let var_10 =
125 Some(
126 Result::<crate::types::VpnProtocol, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
127 crate::types::VpnProtocol::from(
128 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
129 )
130 )
131 ?
132 )
133 ;
134 builder = builder.set_vpn_protocol(var_10);
135 }
136 ,
137 s if s.matches("transportProtocol") => {
138 let var_11 =
139 Some(
140 Result::<crate::types::TransportProtocol, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
141 crate::types::TransportProtocol::from(
142 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
143 )
144 )
145 ?
146 )
147 ;
148 builder = builder.set_transport_protocol(var_11);
149 }
150 ,
151 s if s.matches("vpnPort") => {
152 let var_12 =
153 Some(
154 {
155 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
156 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
157 )
158 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
159 }
160 ?
161 )
162 ;
163 builder = builder.set_vpn_port(var_12);
164 }
165 ,
166 s if s.matches("associatedTargetNetwork") => {
167 let var_13 =
168 Some(
169 crate::protocol_serde::shape_associated_target_network_set::de_associated_target_network_set(&mut tag)
170 ?
171 )
172 ;
173 builder = builder.set_associated_target_networks(var_13);
174 }
175 ,
176 s if s.matches("serverCertificateArn") => {
177 let var_14 =
178 Some(
179 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
180 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
181 .into()
182 )
183 ?
184 )
185 ;
186 builder = builder.set_server_certificate_arn(var_14);
187 }
188 ,
189 s if s.matches("authenticationOptions") => {
190 let var_15 =
191 Some(
192 crate::protocol_serde::shape_client_vpn_authentication_list::de_client_vpn_authentication_list(&mut tag)
193 ?
194 )
195 ;
196 builder = builder.set_authentication_options(var_15);
197 }
198 ,
199 s if s.matches("connectionLogOptions") => {
200 let var_16 =
201 Some(
202 crate::protocol_serde::shape_connection_log_response_options::de_connection_log_response_options(&mut tag)
203 ?
204 )
205 ;
206 builder = builder.set_connection_log_options(var_16);
207 }
208 ,
209 s if s.matches("tagSet") => {
210 let var_17 =
211 Some(
212 crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
213 ?
214 )
215 ;
216 builder = builder.set_tags(var_17);
217 }
218 ,
219 s if s.matches("securityGroupIdSet") => {
220 let var_18 =
221 Some(
222 crate::protocol_serde::shape_client_vpn_security_group_id_set::de_client_vpn_security_group_id_set(&mut tag)
223 ?
224 )
225 ;
226 builder = builder.set_security_group_ids(var_18);
227 }
228 ,
229 s if s.matches("vpcId") => {
230 let var_19 =
231 Some(
232 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
233 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
234 .into()
235 )
236 ?
237 )
238 ;
239 builder = builder.set_vpc_id(var_19);
240 }
241 ,
242 s if s.matches("selfServicePortalUrl") => {
243 let var_20 =
244 Some(
245 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
246 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
247 .into()
248 )
249 ?
250 )
251 ;
252 builder = builder.set_self_service_portal_url(var_20);
253 }
254 ,
255 s if s.matches("clientConnectOptions") => {
256 let var_21 =
257 Some(
258 crate::protocol_serde::shape_client_connect_response_options::de_client_connect_response_options(&mut tag)
259 ?
260 )
261 ;
262 builder = builder.set_client_connect_options(var_21);
263 }
264 ,
265 s if s.matches("sessionTimeoutHours") => {
266 let var_22 =
267 Some(
268 {
269 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
270 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
271 )
272 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
273 }
274 ?
275 )
276 ;
277 builder = builder.set_session_timeout_hours(var_22);
278 }
279 ,
280 s if s.matches("clientLoginBannerOptions") => {
281 let var_23 =
282 Some(
283 crate::protocol_serde::shape_client_login_banner_response_options::de_client_login_banner_response_options(&mut tag)
284 ?
285 )
286 ;
287 builder = builder.set_client_login_banner_options(var_23);
288 }
289 ,
290 s if s.matches("clientRouteEnforcementOptions") => {
291 let var_24 =
292 Some(
293 crate::protocol_serde::shape_client_route_enforcement_response_options::de_client_route_enforcement_response_options(&mut tag)
294 ?
295 )
296 ;
297 builder = builder.set_client_route_enforcement_options(var_24);
298 }
299 ,
300 s if s.matches("disconnectOnSessionTimeout") => {
301 let var_25 =
302 Some(
303 {
304 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
305 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
306 )
307 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
308 }
309 ?
310 )
311 ;
312 builder = builder.set_disconnect_on_session_timeout(var_25);
313 }
314 ,
315 s if s.matches("endpointIpAddressType") => {
316 let var_26 =
317 Some(
318 Result::<crate::types::EndpointIpAddressType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
319 crate::types::EndpointIpAddressType::from(
320 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
321 )
322 )
323 ?
324 )
325 ;
326 builder = builder.set_endpoint_ip_address_type(var_26);
327 }
328 ,
329 s if s.matches("trafficIpAddressType") => {
330 let var_27 =
331 Some(
332 Result::<crate::types::TrafficIpAddressType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
333 crate::types::TrafficIpAddressType::from(
334 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
335 )
336 )
337 ?
338 )
339 ;
340 builder = builder.set_traffic_ip_address_type(var_27);
341 }
342 ,
343 _ => {}
344 }
345 }
346 Ok(builder.build())
347}