aws_sdk_ec2/protocol_serde/
shape_spot_datafeed_subscription.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::needless_question_mark)]
3pub fn de_spot_datafeed_subscription(
4    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::SpotDatafeedSubscription, ::aws_smithy_xml::decode::XmlDecodeError> {
6    #[allow(unused_mut)]
7    let mut builder = crate::types::SpotDatafeedSubscription::builder();
8    while let Some(mut tag) = decoder.next_tag() {
9        match tag.start_el() {
10            s if s.matches("bucket") /* Bucket com.amazonaws.ec2#SpotDatafeedSubscription$Bucket */ =>  {
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_bucket(var_1);
21            }
22            ,
23            s if s.matches("fault") /* Fault com.amazonaws.ec2#SpotDatafeedSubscription$Fault */ =>  {
24                let var_2 =
25                    Some(
26                        crate::protocol_serde::shape_spot_instance_state_fault::de_spot_instance_state_fault(&mut tag)
27                        ?
28                    )
29                ;
30                builder = builder.set_fault(var_2);
31            }
32            ,
33            s if s.matches("ownerId") /* OwnerId com.amazonaws.ec2#SpotDatafeedSubscription$OwnerId */ =>  {
34                let var_3 =
35                    Some(
36                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
37                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
38                            .into()
39                        )
40                        ?
41                    )
42                ;
43                builder = builder.set_owner_id(var_3);
44            }
45            ,
46            s if s.matches("prefix") /* Prefix com.amazonaws.ec2#SpotDatafeedSubscription$Prefix */ =>  {
47                let var_4 =
48                    Some(
49                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
50                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
51                            .into()
52                        )
53                        ?
54                    )
55                ;
56                builder = builder.set_prefix(var_4);
57            }
58            ,
59            s if s.matches("state") /* State com.amazonaws.ec2#SpotDatafeedSubscription$State */ =>  {
60                let var_5 =
61                    Some(
62                        Result::<crate::types::DatafeedSubscriptionState, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
63                            crate::types::DatafeedSubscriptionState::from(
64                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
65                            )
66                        )
67                        ?
68                    )
69                ;
70                builder = builder.set_state(var_5);
71            }
72            ,
73            _ => {}
74        }
75    }
76    Ok(builder.build())
77}