aws_sdk_s3/protocol_serde/
shape_copy_part_result.rs
1#[allow(clippy::needless_question_mark)]
3pub fn de_copy_part_result(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::CopyPartResult, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::CopyPartResult::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("ETag") => {
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_e_tag(var_1);
21 }
22 ,
23 s if s.matches("LastModified") => {
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.s3#LastModified`)"))
31 ?
32 )
33 ;
34 builder = builder.set_last_modified(var_2);
35 }
36 ,
37 s if s.matches("ChecksumCRC32") => {
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_checksum_crc32(var_3);
48 }
49 ,
50 s if s.matches("ChecksumCRC32C") => {
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_checksum_crc32_c(var_4);
61 }
62 ,
63 s if s.matches("ChecksumCRC64NVME") => {
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_checksum_crc64_nvme(var_5);
74 }
75 ,
76 s if s.matches("ChecksumSHA1") => {
77 let var_6 =
78 Some(
79 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
80 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
81 .into()
82 )
83 ?
84 )
85 ;
86 builder = builder.set_checksum_sha1(var_6);
87 }
88 ,
89 s if s.matches("ChecksumSHA256") => {
90 let var_7 =
91 Some(
92 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
93 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
94 .into()
95 )
96 ?
97 )
98 ;
99 builder = builder.set_checksum_sha256(var_7);
100 }
101 ,
102 _ => {}
103 }
104 }
105 Ok(builder.build())
106}