aws_sdk_ec2/protocol_serde/
shape_vpn_connection_options.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_vpn_connection_options(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::VpnConnectionOptions, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::VpnConnectionOptions::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("enableAcceleration") => {
11 let var_1 =
12 Some(
13 {
14 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
15 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
16 )
17 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
18 }
19 ?
20 )
21 ;
22 builder = builder.set_enable_acceleration(var_1);
23 }
24 ,
25 s if s.matches("staticRoutesOnly") => {
26 let var_2 =
27 Some(
28 {
29 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
30 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
31 )
32 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
33 }
34 ?
35 )
36 ;
37 builder = builder.set_static_routes_only(var_2);
38 }
39 ,
40 s if s.matches("localIpv4NetworkCidr") => {
41 let var_3 =
42 Some(
43 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
44 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
45 .into()
46 )
47 ?
48 )
49 ;
50 builder = builder.set_local_ipv4_network_cidr(var_3);
51 }
52 ,
53 s if s.matches("remoteIpv4NetworkCidr") => {
54 let var_4 =
55 Some(
56 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
57 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
58 .into()
59 )
60 ?
61 )
62 ;
63 builder = builder.set_remote_ipv4_network_cidr(var_4);
64 }
65 ,
66 s if s.matches("localIpv6NetworkCidr") => {
67 let var_5 =
68 Some(
69 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
70 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
71 .into()
72 )
73 ?
74 )
75 ;
76 builder = builder.set_local_ipv6_network_cidr(var_5);
77 }
78 ,
79 s if s.matches("remoteIpv6NetworkCidr") => {
80 let var_6 =
81 Some(
82 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
83 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
84 .into()
85 )
86 ?
87 )
88 ;
89 builder = builder.set_remote_ipv6_network_cidr(var_6);
90 }
91 ,
92 s if s.matches("outsideIpAddressType") => {
93 let var_7 =
94 Some(
95 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
96 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
97 .into()
98 )
99 ?
100 )
101 ;
102 builder = builder.set_outside_ip_address_type(var_7);
103 }
104 ,
105 s if s.matches("transportTransitGatewayAttachmentId") => {
106 let var_8 =
107 Some(
108 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
109 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
110 .into()
111 )
112 ?
113 )
114 ;
115 builder = builder.set_transport_transit_gateway_attachment_id(var_8);
116 }
117 ,
118 s if s.matches("tunnelInsideIpVersion") => {
119 let var_9 =
120 Some(
121 Result::<crate::types::TunnelInsideIpVersion, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
122 crate::types::TunnelInsideIpVersion::from(
123 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
124 )
125 )
126 ?
127 )
128 ;
129 builder = builder.set_tunnel_inside_ip_version(var_9);
130 }
131 ,
132 s if s.matches("tunnelOptionSet") => {
133 let var_10 =
134 Some(
135 crate::protocol_serde::shape_tunnel_options_list::de_tunnel_options_list(&mut tag)
136 ?
137 )
138 ;
139 builder = builder.set_tunnel_options(var_10);
140 }
141 ,
142 _ => {}
143 }
144 }
145 Ok(builder.build())
146}