aws_sdk_ec2/protocol_serde/
shape_replace_root_volume_task.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_replace_root_volume_task(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::ReplaceRootVolumeTask, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::ReplaceRootVolumeTask::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("replaceRootVolumeTaskId") => {
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_replace_root_volume_task_id(var_1);
21 }
22 ,
23 s if s.matches("instanceId") => {
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_instance_id(var_2);
34 }
35 ,
36 s if s.matches("taskState") => {
37 let var_3 =
38 Some(
39 Result::<crate::types::ReplaceRootVolumeTaskState, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
40 crate::types::ReplaceRootVolumeTaskState::from(
41 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
42 )
43 )
44 ?
45 )
46 ;
47 builder = builder.set_task_state(var_3);
48 }
49 ,
50 s if s.matches("startTime") => {
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_start_time(var_4);
61 }
62 ,
63 s if s.matches("completeTime") => {
64 let var_5 =
65 Some(
66 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
67 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
68 .into()
69 )
70 ?
71 )
72 ;
73 builder = builder.set_complete_time(var_5);
74 }
75 ,
76 s if s.matches("tagSet") => {
77 let var_6 =
78 Some(
79 crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
80 ?
81 )
82 ;
83 builder = builder.set_tags(var_6);
84 }
85 ,
86 s if s.matches("imageId") => {
87 let var_7 =
88 Some(
89 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
90 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
91 .into()
92 )
93 ?
94 )
95 ;
96 builder = builder.set_image_id(var_7);
97 }
98 ,
99 s if s.matches("snapshotId") => {
100 let var_8 =
101 Some(
102 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
103 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
104 .into()
105 )
106 ?
107 )
108 ;
109 builder = builder.set_snapshot_id(var_8);
110 }
111 ,
112 s if s.matches("deleteReplacedRootVolume") => {
113 let var_9 =
114 Some(
115 {
116 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
117 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
118 )
119 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
120 }
121 ?
122 )
123 ;
124 builder = builder.set_delete_replaced_root_volume(var_9);
125 }
126 ,
127 _ => {}
128 }
129 }
130 Ok(builder.build())
131}