aws_sdk_ec2/protocol_serde/
shape_transit_gateway_route_table.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_transit_gateway_route_table(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::TransitGatewayRouteTable, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::TransitGatewayRouteTable::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("transitGatewayRouteTableId") => {
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_transit_gateway_route_table_id(var_1);
21 }
22 ,
23 s if s.matches("transitGatewayId") => {
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_transit_gateway_id(var_2);
34 }
35 ,
36 s if s.matches("state") => {
37 let var_3 =
38 Some(
39 Result::<crate::types::TransitGatewayRouteTableState, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
40 crate::types::TransitGatewayRouteTableState::from(
41 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
42 )
43 )
44 ?
45 )
46 ;
47 builder = builder.set_state(var_3);
48 }
49 ,
50 s if s.matches("defaultAssociationRouteTable") => {
51 let var_4 =
52 Some(
53 {
54 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
55 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
56 )
57 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
58 }
59 ?
60 )
61 ;
62 builder = builder.set_default_association_route_table(var_4);
63 }
64 ,
65 s if s.matches("defaultPropagationRouteTable") => {
66 let var_5 =
67 Some(
68 {
69 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
70 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
71 )
72 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
73 }
74 ?
75 )
76 ;
77 builder = builder.set_default_propagation_route_table(var_5);
78 }
79 ,
80 s if s.matches("creationTime") => {
81 let var_6 =
82 Some(
83 ::aws_smithy_types::DateTime::from_str(
84 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
85 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
86 )
87 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#DateTime`)"))
88 ?
89 )
90 ;
91 builder = builder.set_creation_time(var_6);
92 }
93 ,
94 s if s.matches("tagSet") => {
95 let var_7 =
96 Some(
97 crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
98 ?
99 )
100 ;
101 builder = builder.set_tags(var_7);
102 }
103 ,
104 _ => {}
105 }
106 }
107 Ok(builder.build())
108}