aws_sdk_ec2/protocol_serde/
shape_client_vpn_authentication.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::needless_question_mark)]
3pub fn de_client_vpn_authentication(
4    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::ClientVpnAuthentication, ::aws_smithy_xml::decode::XmlDecodeError> {
6    #[allow(unused_mut)]
7    let mut builder = crate::types::ClientVpnAuthentication::builder();
8    while let Some(mut tag) = decoder.next_tag() {
9        match tag.start_el() {
10            s if s.matches("type") /* Type com.amazonaws.ec2#ClientVpnAuthentication$Type */ =>  {
11                let var_1 =
12                    Some(
13                        Result::<crate::types::ClientVpnAuthenticationType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
14                            crate::types::ClientVpnAuthenticationType::from(
15                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
16                            )
17                        )
18                        ?
19                    )
20                ;
21                builder = builder.set_type(var_1);
22            }
23            ,
24            s if s.matches("activeDirectory") /* ActiveDirectory com.amazonaws.ec2#ClientVpnAuthentication$ActiveDirectory */ =>  {
25                let var_2 =
26                    Some(
27                        crate::protocol_serde::shape_directory_service_authentication::de_directory_service_authentication(&mut tag)
28                        ?
29                    )
30                ;
31                builder = builder.set_active_directory(var_2);
32            }
33            ,
34            s if s.matches("mutualAuthentication") /* MutualAuthentication com.amazonaws.ec2#ClientVpnAuthentication$MutualAuthentication */ =>  {
35                let var_3 =
36                    Some(
37                        crate::protocol_serde::shape_certificate_authentication::de_certificate_authentication(&mut tag)
38                        ?
39                    )
40                ;
41                builder = builder.set_mutual_authentication(var_3);
42            }
43            ,
44            s if s.matches("federatedAuthentication") /* FederatedAuthentication com.amazonaws.ec2#ClientVpnAuthentication$FederatedAuthentication */ =>  {
45                let var_4 =
46                    Some(
47                        crate::protocol_serde::shape_federated_authentication::de_federated_authentication(&mut tag)
48                        ?
49                    )
50                ;
51                builder = builder.set_federated_authentication(var_4);
52            }
53            ,
54            _ => {}
55        }
56    }
57    Ok(builder.build())
58}