aws_sdk_s3/protocol_serde/
shape_copy_object_result.rs
1#[allow(clippy::needless_question_mark)]
3pub fn de_copy_object_result(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::CopyObjectResult, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::CopyObjectResult::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("ChecksumType") => {
38 let var_3 =
39 Some(
40 Result::<crate::types::ChecksumType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
41 crate::types::ChecksumType::from(
42 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
43 )
44 )
45 ?
46 )
47 ;
48 builder = builder.set_checksum_type(var_3);
49 }
50 ,
51 s if s.matches("ChecksumCRC32") => {
52 let var_4 =
53 Some(
54 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
55 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
56 .into()
57 )
58 ?
59 )
60 ;
61 builder = builder.set_checksum_crc32(var_4);
62 }
63 ,
64 s if s.matches("ChecksumCRC32C") => {
65 let var_5 =
66 Some(
67 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
68 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
69 .into()
70 )
71 ?
72 )
73 ;
74 builder = builder.set_checksum_crc32_c(var_5);
75 }
76 ,
77 s if s.matches("ChecksumCRC64NVME") => {
78 let var_6 =
79 Some(
80 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
81 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
82 .into()
83 )
84 ?
85 )
86 ;
87 builder = builder.set_checksum_crc64_nvme(var_6);
88 }
89 ,
90 s if s.matches("ChecksumSHA1") => {
91 let var_7 =
92 Some(
93 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
94 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
95 .into()
96 )
97 ?
98 )
99 ;
100 builder = builder.set_checksum_sha1(var_7);
101 }
102 ,
103 s if s.matches("ChecksumSHA256") => {
104 let var_8 =
105 Some(
106 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
107 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
108 .into()
109 )
110 ?
111 )
112 ;
113 builder = builder.set_checksum_sha256(var_8);
114 }
115 ,
116 _ => {}
117 }
118 }
119 Ok(builder.build())
120}