aws_sdk_rds/protocol_serde/
shape_export_task.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_export_task(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::ExportTask, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::ExportTask::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("ExportTaskIdentifier") => {
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_export_task_identifier(var_1);
21 }
22 ,
23 s if s.matches("SourceArn") => {
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_source_arn(var_2);
34 }
35 ,
36 s if s.matches("ExportOnly") => {
37 let var_3 =
38 Some(
39 crate::protocol_serde::shape_string_list::de_string_list(&mut tag)
40 ?
41 )
42 ;
43 builder = builder.set_export_only(var_3);
44 }
45 ,
46 s if s.matches("SnapshotTime") => {
47 let var_4 =
48 Some(
49 ::aws_smithy_types::DateTime::from_str(
50 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
51 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
52 )
53 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.rds#TStamp`)"))
54 ?
55 )
56 ;
57 builder = builder.set_snapshot_time(var_4);
58 }
59 ,
60 s if s.matches("TaskStartTime") => {
61 let var_5 =
62 Some(
63 ::aws_smithy_types::DateTime::from_str(
64 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
65 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
66 )
67 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.rds#TStamp`)"))
68 ?
69 )
70 ;
71 builder = builder.set_task_start_time(var_5);
72 }
73 ,
74 s if s.matches("TaskEndTime") => {
75 let var_6 =
76 Some(
77 ::aws_smithy_types::DateTime::from_str(
78 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
79 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
80 )
81 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.rds#TStamp`)"))
82 ?
83 )
84 ;
85 builder = builder.set_task_end_time(var_6);
86 }
87 ,
88 s if s.matches("S3Bucket") => {
89 let var_7 =
90 Some(
91 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
92 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
93 .into()
94 )
95 ?
96 )
97 ;
98 builder = builder.set_s3_bucket(var_7);
99 }
100 ,
101 s if s.matches("S3Prefix") => {
102 let var_8 =
103 Some(
104 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
105 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
106 .into()
107 )
108 ?
109 )
110 ;
111 builder = builder.set_s3_prefix(var_8);
112 }
113 ,
114 s if s.matches("IamRoleArn") => {
115 let var_9 =
116 Some(
117 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
118 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
119 .into()
120 )
121 ?
122 )
123 ;
124 builder = builder.set_iam_role_arn(var_9);
125 }
126 ,
127 s if s.matches("KmsKeyId") => {
128 let var_10 =
129 Some(
130 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
131 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
132 .into()
133 )
134 ?
135 )
136 ;
137 builder = builder.set_kms_key_id(var_10);
138 }
139 ,
140 s if s.matches("Status") => {
141 let var_11 =
142 Some(
143 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
144 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
145 .into()
146 )
147 ?
148 )
149 ;
150 builder = builder.set_status(var_11);
151 }
152 ,
153 s if s.matches("PercentProgress") => {
154 let var_12 =
155 Some(
156 {
157 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
158 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
159 )
160 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.rds#Integer`)"))
161 }
162 ?
163 )
164 ;
165 builder = builder.set_percent_progress(var_12);
166 }
167 ,
168 s if s.matches("TotalExtractedDataInGB") => {
169 let var_13 =
170 Some(
171 {
172 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
173 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
174 )
175 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.rds#Integer`)"))
176 }
177 ?
178 )
179 ;
180 builder = builder.set_total_extracted_data_in_gb(var_13);
181 }
182 ,
183 s if s.matches("FailureCause") => {
184 let var_14 =
185 Some(
186 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
187 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
188 .into()
189 )
190 ?
191 )
192 ;
193 builder = builder.set_failure_cause(var_14);
194 }
195 ,
196 s if s.matches("WarningMessage") => {
197 let var_15 =
198 Some(
199 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
200 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
201 .into()
202 )
203 ?
204 )
205 ;
206 builder = builder.set_warning_message(var_15);
207 }
208 ,
209 s if s.matches("SourceType") => {
210 let var_16 =
211 Some(
212 Result::<crate::types::ExportSourceType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
213 crate::types::ExportSourceType::from(
214 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
215 )
216 )
217 ?
218 )
219 ;
220 builder = builder.set_source_type(var_16);
221 }
222 ,
223 _ => {}
224 }
225 }
226 Ok(builder.build())
227}