aws_sdk_ec2/protocol_serde/
shape_metric_point.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_metric_point(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::MetricPoint, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::MetricPoint::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("startDate") => {
11 let var_1 =
12 Some(
13 ::aws_smithy_types::DateTime::from_str(
14 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
15 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
16 )
17 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
18 ?
19 )
20 ;
21 builder = builder.set_start_date(var_1);
22 }
23 ,
24 s if s.matches("endDate") => {
25 let var_2 =
26 Some(
27 ::aws_smithy_types::DateTime::from_str(
28 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
29 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
30 )
31 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
32 ?
33 )
34 ;
35 builder = builder.set_end_date(var_2);
36 }
37 ,
38 s if s.matches("value") => {
39 let var_3 =
40 Some(
41 {
42 <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
43 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
44 )
45 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (float: `com.amazonaws.ec2#Float`)"))
46 }
47 ?
48 )
49 ;
50 builder = builder.set_value(var_3);
51 }
52 ,
53 s if s.matches("status") => {
54 let var_4 =
55 Some(
56 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
57 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
58 .into()
59 )
60 ?
61 )
62 ;
63 builder = builder.set_status(var_4);
64 }
65 ,
66 _ => {}
67 }
68 }
69 Ok(builder.build())
70}