aws_sdk_s3/protocol_serde/
shape_object_part.rs
1#[allow(clippy::needless_question_mark)]
3pub fn de_object_part(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::ObjectPart, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::ObjectPart::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("Size") => {
26 let var_2 =
27 Some(
28 {
29 <i64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
30 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
31 )
32 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (long: `com.amazonaws.s3#Size`)"))
33 }
34 ?
35 )
36 ;
37 builder = builder.set_size(var_2);
38 }
39 ,
40 s if s.matches("ChecksumCRC32") => {
41 let var_3 =
42 Some(
43 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
44 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
45 .into()
46 )
47 ?
48 )
49 ;
50 builder = builder.set_checksum_crc32(var_3);
51 }
52 ,
53 s if s.matches("ChecksumCRC32C") => {
54 let var_4 =
55 Some(
56 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
57 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
58 .into()
59 )
60 ?
61 )
62 ;
63 builder = builder.set_checksum_crc32_c(var_4);
64 }
65 ,
66 s if s.matches("ChecksumCRC64NVME") => {
67 let var_5 =
68 Some(
69 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
70 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
71 .into()
72 )
73 ?
74 )
75 ;
76 builder = builder.set_checksum_crc64_nvme(var_5);
77 }
78 ,
79 s if s.matches("ChecksumSHA1") => {
80 let var_6 =
81 Some(
82 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
83 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
84 .into()
85 )
86 ?
87 )
88 ;
89 builder = builder.set_checksum_sha1(var_6);
90 }
91 ,
92 s if s.matches("ChecksumSHA256") => {
93 let var_7 =
94 Some(
95 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
96 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
97 .into()
98 )
99 ?
100 )
101 ;
102 builder = builder.set_checksum_sha256(var_7);
103 }
104 ,
105 _ => {}
106 }
107 }
108 Ok(builder.build())
109}