aws_sdk_s3/protocol_serde/
shape_delete_marker_entry.rs
1#[allow(clippy::needless_question_mark)]
3pub fn de_delete_marker_entry(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::DeleteMarkerEntry, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::DeleteMarkerEntry::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("Owner") => {
11 let var_1 =
12 Some(
13 crate::protocol_serde::shape_owner::de_owner(&mut tag)
14 ?
15 )
16 ;
17 builder = builder.set_owner(var_1);
18 }
19 ,
20 s if s.matches("Key") => {
21 let var_2 =
22 Some(
23 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
24 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
25 .into()
26 )
27 ?
28 )
29 ;
30 builder = builder.set_key(var_2);
31 }
32 ,
33 s if s.matches("VersionId") => {
34 let var_3 =
35 Some(
36 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
37 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
38 .into()
39 )
40 ?
41 )
42 ;
43 builder = builder.set_version_id(var_3);
44 }
45 ,
46 s if s.matches("IsLatest") => {
47 let var_4 =
48 Some(
49 {
50 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
51 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
52 )
53 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.s3#IsLatest`)"))
54 }
55 ?
56 )
57 ;
58 builder = builder.set_is_latest(var_4);
59 }
60 ,
61 s if s.matches("LastModified") => {
62 let var_5 =
63 Some(
64 ::aws_smithy_types::DateTime::from_str(
65 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
66 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
67 )
68 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.s3#LastModified`)"))
69 ?
70 )
71 ;
72 builder = builder.set_last_modified(var_5);
73 }
74 ,
75 _ => {}
76 }
77 }
78 Ok(builder.build())
79}