aws_sdk_s3/protocol_serde/
shape_part.rs
1#[allow(clippy::needless_question_mark)]
3pub fn de_part(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::Part, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::Part::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("PartNumber") => {
11 let var_1 =
12 Some(
13 {
14 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
15 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
16 )
17 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.s3#PartNumber`)"))
18 }
19 ?
20 )
21 ;
22 builder = builder.set_part_number(var_1);
23 }
24 ,
25 s if s.matches("LastModified") => {
26 let var_2 =
27 Some(
28 ::aws_smithy_types::DateTime::from_str(
29 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
30 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
31 )
32 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.s3#LastModified`)"))
33 ?
34 )
35 ;
36 builder = builder.set_last_modified(var_2);
37 }
38 ,
39 s if s.matches("ETag") => {
40 let var_3 =
41 Some(
42 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
43 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
44 .into()
45 )
46 ?
47 )
48 ;
49 builder = builder.set_e_tag(var_3);
50 }
51 ,
52 s if s.matches("Size") => {
53 let var_4 =
54 Some(
55 {
56 <i64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
57 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
58 )
59 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (long: `com.amazonaws.s3#Size`)"))
60 }
61 ?
62 )
63 ;
64 builder = builder.set_size(var_4);
65 }
66 ,
67 s if s.matches("ChecksumCRC32") => {
68 let var_5 =
69 Some(
70 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
71 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
72 .into()
73 )
74 ?
75 )
76 ;
77 builder = builder.set_checksum_crc32(var_5);
78 }
79 ,
80 s if s.matches("ChecksumCRC32C") => {
81 let var_6 =
82 Some(
83 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
84 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
85 .into()
86 )
87 ?
88 )
89 ;
90 builder = builder.set_checksum_crc32_c(var_6);
91 }
92 ,
93 s if s.matches("ChecksumCRC64NVME") => {
94 let var_7 =
95 Some(
96 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
97 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
98 .into()
99 )
100 ?
101 )
102 ;
103 builder = builder.set_checksum_crc64_nvme(var_7);
104 }
105 ,
106 s if s.matches("ChecksumSHA1") => {
107 let var_8 =
108 Some(
109 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
110 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
111 .into()
112 )
113 ?
114 )
115 ;
116 builder = builder.set_checksum_sha1(var_8);
117 }
118 ,
119 s if s.matches("ChecksumSHA256") => {
120 let var_9 =
121 Some(
122 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
123 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
124 .into()
125 )
126 ?
127 )
128 ;
129 builder = builder.set_checksum_sha256(var_9);
130 }
131 ,
132 _ => {}
133 }
134 }
135 Ok(builder.build())
136}