aws_sdk_ec2/protocol_serde/
shape_client_vpn_connection.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_connection(
4    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::ClientVpnConnection, ::aws_smithy_xml::decode::XmlDecodeError> {
6    #[allow(unused_mut)]
7    let mut builder = crate::types::ClientVpnConnection::builder();
8    while let Some(mut tag) = decoder.next_tag() {
9        match tag.start_el() {
10            s if s.matches("clientVpnEndpointId") /* ClientVpnEndpointId com.amazonaws.ec2#ClientVpnConnection$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("timestamp") /* Timestamp com.amazonaws.ec2#ClientVpnConnection$Timestamp */ =>  {
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_timestamp(var_2);
34            }
35            ,
36            s if s.matches("connectionId") /* ConnectionId com.amazonaws.ec2#ClientVpnConnection$ConnectionId */ =>  {
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_connection_id(var_3);
47            }
48            ,
49            s if s.matches("username") /* Username com.amazonaws.ec2#ClientVpnConnection$Username */ =>  {
50                let var_4 =
51                    Some(
52                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
53                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
54                            .into()
55                        )
56                        ?
57                    )
58                ;
59                builder = builder.set_username(var_4);
60            }
61            ,
62            s if s.matches("connectionEstablishedTime") /* ConnectionEstablishedTime com.amazonaws.ec2#ClientVpnConnection$ConnectionEstablishedTime */ =>  {
63                let var_5 =
64                    Some(
65                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
66                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
67                            .into()
68                        )
69                        ?
70                    )
71                ;
72                builder = builder.set_connection_established_time(var_5);
73            }
74            ,
75            s if s.matches("ingressBytes") /* IngressBytes com.amazonaws.ec2#ClientVpnConnection$IngressBytes */ =>  {
76                let var_6 =
77                    Some(
78                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
79                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
80                            .into()
81                        )
82                        ?
83                    )
84                ;
85                builder = builder.set_ingress_bytes(var_6);
86            }
87            ,
88            s if s.matches("egressBytes") /* EgressBytes com.amazonaws.ec2#ClientVpnConnection$EgressBytes */ =>  {
89                let var_7 =
90                    Some(
91                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
92                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
93                            .into()
94                        )
95                        ?
96                    )
97                ;
98                builder = builder.set_egress_bytes(var_7);
99            }
100            ,
101            s if s.matches("ingressPackets") /* IngressPackets com.amazonaws.ec2#ClientVpnConnection$IngressPackets */ =>  {
102                let var_8 =
103                    Some(
104                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
105                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
106                            .into()
107                        )
108                        ?
109                    )
110                ;
111                builder = builder.set_ingress_packets(var_8);
112            }
113            ,
114            s if s.matches("egressPackets") /* EgressPackets com.amazonaws.ec2#ClientVpnConnection$EgressPackets */ =>  {
115                let var_9 =
116                    Some(
117                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
118                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
119                            .into()
120                        )
121                        ?
122                    )
123                ;
124                builder = builder.set_egress_packets(var_9);
125            }
126            ,
127            s if s.matches("clientIp") /* ClientIp com.amazonaws.ec2#ClientVpnConnection$ClientIp */ =>  {
128                let var_10 =
129                    Some(
130                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
131                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
132                            .into()
133                        )
134                        ?
135                    )
136                ;
137                builder = builder.set_client_ip(var_10);
138            }
139            ,
140            s if s.matches("clientIpv6Address") /* ClientIpv6Address com.amazonaws.ec2#ClientVpnConnection$ClientIpv6Address */ =>  {
141                let var_11 =
142                    Some(
143                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
144                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
145                            .into()
146                        )
147                        ?
148                    )
149                ;
150                builder = builder.set_client_ipv6_address(var_11);
151            }
152            ,
153            s if s.matches("commonName") /* CommonName com.amazonaws.ec2#ClientVpnConnection$CommonName */ =>  {
154                let var_12 =
155                    Some(
156                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
157                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
158                            .into()
159                        )
160                        ?
161                    )
162                ;
163                builder = builder.set_common_name(var_12);
164            }
165            ,
166            s if s.matches("status") /* Status com.amazonaws.ec2#ClientVpnConnection$Status */ =>  {
167                let var_13 =
168                    Some(
169                        crate::protocol_serde::shape_client_vpn_connection_status::de_client_vpn_connection_status(&mut tag)
170                        ?
171                    )
172                ;
173                builder = builder.set_status(var_13);
174            }
175            ,
176            s if s.matches("connectionEndTime") /* ConnectionEndTime com.amazonaws.ec2#ClientVpnConnection$ConnectionEndTime */ =>  {
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_connection_end_time(var_14);
187            }
188            ,
189            s if s.matches("postureComplianceStatusSet") /* PostureComplianceStatuses com.amazonaws.ec2#ClientVpnConnection$PostureComplianceStatuses */ =>  {
190                let var_15 =
191                    Some(
192                        crate::protocol_serde::shape_value_string_list::de_value_string_list(&mut tag)
193                        ?
194                    )
195                ;
196                builder = builder.set_posture_compliance_statuses(var_15);
197            }
198            ,
199            _ => {}
200        }
201    }
202    Ok(builder.build())
203}