aws_sdk_ec2/protocol_serde/
shape_image_usage_report.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_image_usage_report(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::ImageUsageReport, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::ImageUsageReport::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("imageId") => {
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_image_id(var_1);
21 }
22 ,
23 s if s.matches("reportId") => {
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_report_id(var_2);
34 }
35 ,
36 s if s.matches("resourceTypeSet") => {
37 let var_3 =
38 Some(
39 crate::protocol_serde::shape_image_usage_resource_type_list::de_image_usage_resource_type_list(&mut tag)
40 ?
41 )
42 ;
43 builder = builder.set_resource_types(var_3);
44 }
45 ,
46 s if s.matches("accountIdSet") => {
47 let var_4 =
48 Some(
49 crate::protocol_serde::shape_user_id_list::de_user_id_list(&mut tag)
50 ?
51 )
52 ;
53 builder = builder.set_account_ids(var_4);
54 }
55 ,
56 s if s.matches("state") => {
57 let var_5 =
58 Some(
59 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
60 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
61 .into()
62 )
63 ?
64 )
65 ;
66 builder = builder.set_state(var_5);
67 }
68 ,
69 s if s.matches("stateReason") => {
70 let var_6 =
71 Some(
72 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
73 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
74 .into()
75 )
76 ?
77 )
78 ;
79 builder = builder.set_state_reason(var_6);
80 }
81 ,
82 s if s.matches("creationTime") => {
83 let var_7 =
84 Some(
85 ::aws_smithy_types::DateTime::from_str(
86 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
87 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
88 )
89 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
90 ?
91 )
92 ;
93 builder = builder.set_creation_time(var_7);
94 }
95 ,
96 s if s.matches("expirationTime") => {
97 let var_8 =
98 Some(
99 ::aws_smithy_types::DateTime::from_str(
100 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
101 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
102 )
103 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
104 ?
105 )
106 ;
107 builder = builder.set_expiration_time(var_8);
108 }
109 ,
110 s if s.matches("tagSet") => {
111 let var_9 =
112 Some(
113 crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
114 ?
115 )
116 ;
117 builder = builder.set_tags(var_9);
118 }
119 ,
120 _ => {}
121 }
122 }
123 Ok(builder.build())
124}