aws_sdk_ec2/protocol_serde/
shape_snapshot_tier_status.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_snapshot_tier_status(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::SnapshotTierStatus, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::SnapshotTierStatus::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("snapshotId") => {
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_snapshot_id(var_1);
21 }
22 ,
23 s if s.matches("volumeId") => {
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_volume_id(var_2);
34 }
35 ,
36 s if s.matches("status") => {
37 let var_3 =
38 Some(
39 Result::<crate::types::SnapshotState, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
40 crate::types::SnapshotState::from(
41 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
42 )
43 )
44 ?
45 )
46 ;
47 builder = builder.set_status(var_3);
48 }
49 ,
50 s if s.matches("ownerId") => {
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_owner_id(var_4);
61 }
62 ,
63 s if s.matches("tagSet") => {
64 let var_5 =
65 Some(
66 crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
67 ?
68 )
69 ;
70 builder = builder.set_tags(var_5);
71 }
72 ,
73 s if s.matches("storageTier") => {
74 let var_6 =
75 Some(
76 Result::<crate::types::StorageTier, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
77 crate::types::StorageTier::from(
78 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
79 )
80 )
81 ?
82 )
83 ;
84 builder = builder.set_storage_tier(var_6);
85 }
86 ,
87 s if s.matches("lastTieringStartTime") => {
88 let var_7 =
89 Some(
90 ::aws_smithy_types::DateTime::from_str(
91 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
92 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
93 )
94 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
95 ?
96 )
97 ;
98 builder = builder.set_last_tiering_start_time(var_7);
99 }
100 ,
101 s if s.matches("lastTieringProgress") => {
102 let var_8 =
103 Some(
104 {
105 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
106 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
107 )
108 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
109 }
110 ?
111 )
112 ;
113 builder = builder.set_last_tiering_progress(var_8);
114 }
115 ,
116 s if s.matches("lastTieringOperationStatus") => {
117 let var_9 =
118 Some(
119 Result::<crate::types::TieringOperationStatus, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
120 crate::types::TieringOperationStatus::from(
121 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
122 )
123 )
124 ?
125 )
126 ;
127 builder = builder.set_last_tiering_operation_status(var_9);
128 }
129 ,
130 s if s.matches("lastTieringOperationStatusDetail") => {
131 let var_10 =
132 Some(
133 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
134 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
135 .into()
136 )
137 ?
138 )
139 ;
140 builder = builder.set_last_tiering_operation_status_detail(var_10);
141 }
142 ,
143 s if s.matches("archivalCompleteTime") => {
144 let var_11 =
145 Some(
146 ::aws_smithy_types::DateTime::from_str(
147 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
148 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
149 )
150 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
151 ?
152 )
153 ;
154 builder = builder.set_archival_complete_time(var_11);
155 }
156 ,
157 s if s.matches("restoreExpiryTime") => {
158 let var_12 =
159 Some(
160 ::aws_smithy_types::DateTime::from_str(
161 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
162 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
163 )
164 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
165 ?
166 )
167 ;
168 builder = builder.set_restore_expiry_time(var_12);
169 }
170 ,
171 _ => {}
172 }
173 }
174 Ok(builder.build())
175}