aws_sdk_redshift/protocol_serde/
shape_event.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_event(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::Event, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::Event::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("SourceIdentifier") => {
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_source_identifier(var_1);
21 }
22 ,
23 s if s.matches("SourceType") => {
24 let var_2 =
25 Some(
26 Result::<crate::types::SourceType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
27 crate::types::SourceType::from(
28 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
29 )
30 )
31 ?
32 )
33 ;
34 builder = builder.set_source_type(var_2);
35 }
36 ,
37 s if s.matches("Message") => {
38 let var_3 =
39 Some(
40 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
41 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
42 .into()
43 )
44 ?
45 )
46 ;
47 builder = builder.set_message(var_3);
48 }
49 ,
50 s if s.matches("EventCategories") => {
51 let var_4 =
52 Some(
53 crate::protocol_serde::shape_event_categories_list::de_event_categories_list(&mut tag)
54 ?
55 )
56 ;
57 builder = builder.set_event_categories(var_4);
58 }
59 ,
60 s if s.matches("Severity") => {
61 let var_5 =
62 Some(
63 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
64 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
65 .into()
66 )
67 ?
68 )
69 ;
70 builder = builder.set_severity(var_5);
71 }
72 ,
73 s if s.matches("Date") => {
74 let var_6 =
75 Some(
76 ::aws_smithy_types::DateTime::from_str(
77 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
78 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
79 )
80 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.redshift#TStamp`)"))
81 ?
82 )
83 ;
84 builder = builder.set_date(var_6);
85 }
86 ,
87 s if s.matches("EventId") => {
88 let var_7 =
89 Some(
90 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
91 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
92 .into()
93 )
94 ?
95 )
96 ;
97 builder = builder.set_event_id(var_7);
98 }
99 ,
100 _ => {}
101 }
102 }
103 Ok(builder.build())
104}