aws_sdk_ec2/protocol_serde/
shape_store_image_task_result.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_store_image_task_result(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::StoreImageTaskResult, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::StoreImageTaskResult::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("amiId") => {
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_ami_id(var_1);
21 }
22 ,
23 s if s.matches("taskStartTime") => {
24 let var_2 =
25 Some(
26 ::aws_smithy_types::DateTime::from_str(
27 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
28 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
29 )
30 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
31 ?
32 )
33 ;
34 builder = builder.set_task_start_time(var_2);
35 }
36 ,
37 s if s.matches("bucket") => {
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_bucket(var_3);
48 }
49 ,
50 s if s.matches("s3objectKey") => {
51 let var_4 =
52 Some(
53 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
54 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
55 .into()
56 )
57 ?
58 )
59 ;
60 builder = builder.set_s3object_key(var_4);
61 }
62 ,
63 s if s.matches("progressPercentage") => {
64 let var_5 =
65 Some(
66 {
67 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
68 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
69 )
70 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
71 }
72 ?
73 )
74 ;
75 builder = builder.set_progress_percentage(var_5);
76 }
77 ,
78 s if s.matches("storeTaskState") => {
79 let var_6 =
80 Some(
81 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
82 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
83 .into()
84 )
85 ?
86 )
87 ;
88 builder = builder.set_store_task_state(var_6);
89 }
90 ,
91 s if s.matches("storeTaskFailureReason") => {
92 let var_7 =
93 Some(
94 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
95 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
96 .into()
97 )
98 ?
99 )
100 ;
101 builder = builder.set_store_task_failure_reason(var_7);
102 }
103 ,
104 _ => {}
105 }
106 }
107 Ok(builder.build())
108}