aws_sdk_ec2/protocol_serde/
shape_transit_gateway_options.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_transit_gateway_options(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::TransitGatewayOptions, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::TransitGatewayOptions::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("amazonSideAsn") => {
11 let var_1 =
12 Some(
13 {
14 <i64 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 (long: `com.amazonaws.ec2#Long`)"))
18 }
19 ?
20 )
21 ;
22 builder = builder.set_amazon_side_asn(var_1);
23 }
24 ,
25 s if s.matches("transitGatewayCidrBlocks") => {
26 let var_2 =
27 Some(
28 crate::protocol_serde::shape_value_string_list::de_value_string_list(&mut tag)
29 ?
30 )
31 ;
32 builder = builder.set_transit_gateway_cidr_blocks(var_2);
33 }
34 ,
35 s if s.matches("autoAcceptSharedAttachments") => {
36 let var_3 =
37 Some(
38 Result::<crate::types::AutoAcceptSharedAttachmentsValue, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
39 crate::types::AutoAcceptSharedAttachmentsValue::from(
40 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
41 )
42 )
43 ?
44 )
45 ;
46 builder = builder.set_auto_accept_shared_attachments(var_3);
47 }
48 ,
49 s if s.matches("defaultRouteTableAssociation") => {
50 let var_4 =
51 Some(
52 Result::<crate::types::DefaultRouteTableAssociationValue, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
53 crate::types::DefaultRouteTableAssociationValue::from(
54 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
55 )
56 )
57 ?
58 )
59 ;
60 builder = builder.set_default_route_table_association(var_4);
61 }
62 ,
63 s if s.matches("associationDefaultRouteTableId") => {
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_association_default_route_table_id(var_5);
74 }
75 ,
76 s if s.matches("defaultRouteTablePropagation") => {
77 let var_6 =
78 Some(
79 Result::<crate::types::DefaultRouteTablePropagationValue, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
80 crate::types::DefaultRouteTablePropagationValue::from(
81 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
82 )
83 )
84 ?
85 )
86 ;
87 builder = builder.set_default_route_table_propagation(var_6);
88 }
89 ,
90 s if s.matches("propagationDefaultRouteTableId") => {
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_propagation_default_route_table_id(var_7);
101 }
102 ,
103 s if s.matches("vpnEcmpSupport") => {
104 let var_8 =
105 Some(
106 Result::<crate::types::VpnEcmpSupportValue, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
107 crate::types::VpnEcmpSupportValue::from(
108 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
109 )
110 )
111 ?
112 )
113 ;
114 builder = builder.set_vpn_ecmp_support(var_8);
115 }
116 ,
117 s if s.matches("dnsSupport") => {
118 let var_9 =
119 Some(
120 Result::<crate::types::DnsSupportValue, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
121 crate::types::DnsSupportValue::from(
122 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
123 )
124 )
125 ?
126 )
127 ;
128 builder = builder.set_dns_support(var_9);
129 }
130 ,
131 s if s.matches("securityGroupReferencingSupport") => {
132 let var_10 =
133 Some(
134 Result::<crate::types::SecurityGroupReferencingSupportValue, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
135 crate::types::SecurityGroupReferencingSupportValue::from(
136 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
137 )
138 )
139 ?
140 )
141 ;
142 builder = builder.set_security_group_referencing_support(var_10);
143 }
144 ,
145 s if s.matches("multicastSupport") => {
146 let var_11 =
147 Some(
148 Result::<crate::types::MulticastSupportValue, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
149 crate::types::MulticastSupportValue::from(
150 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
151 )
152 )
153 ?
154 )
155 ;
156 builder = builder.set_multicast_support(var_11);
157 }
158 ,
159 _ => {}
160 }
161 }
162 Ok(builder.build())
163}