aws_sdk_ec2/protocol_serde/
shape_transit_gateway_multicast_domain.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_transit_gateway_multicast_domain(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::TransitGatewayMulticastDomain, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::TransitGatewayMulticastDomain::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("transitGatewayMulticastDomainId") => {
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_multicast_domain_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("transitGatewayMulticastDomainArn") => {
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_transit_gateway_multicast_domain_arn(var_3);
47 }
48 ,
49 s if s.matches("ownerId") => {
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_owner_id(var_4);
60 }
61 ,
62 s if s.matches("options") => {
63 let var_5 =
64 Some(
65 crate::protocol_serde::shape_transit_gateway_multicast_domain_options::de_transit_gateway_multicast_domain_options(&mut tag)
66 ?
67 )
68 ;
69 builder = builder.set_options(var_5);
70 }
71 ,
72 s if s.matches("state") => {
73 let var_6 =
74 Some(
75 Result::<crate::types::TransitGatewayMulticastDomainState, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
76 crate::types::TransitGatewayMulticastDomainState::from(
77 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
78 )
79 )
80 ?
81 )
82 ;
83 builder = builder.set_state(var_6);
84 }
85 ,
86 s if s.matches("creationTime") => {
87 let var_7 =
88 Some(
89 ::aws_smithy_types::DateTime::from_str(
90 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
91 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
92 )
93 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#DateTime`)"))
94 ?
95 )
96 ;
97 builder = builder.set_creation_time(var_7);
98 }
99 ,
100 s if s.matches("tagSet") => {
101 let var_8 =
102 Some(
103 crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
104 ?
105 )
106 ;
107 builder = builder.set_tags(var_8);
108 }
109 ,
110 _ => {}
111 }
112 }
113 Ok(builder.build())
114}