aws_sdk_s3/protocol_serde/shape_get_object_attributes_parts.rs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(clippy::needless_question_mark)]
pub fn de_get_object_attributes_parts(
decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::types::GetObjectAttributesParts, ::aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::types::GetObjectAttributesParts::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("PartsCount") /* TotalPartsCount com.amazonaws.s3#GetObjectAttributesParts$TotalPartsCount */ => {
let var_1 =
Some(
{
<i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.s3#PartsCount`)"))
}
?
)
;
builder = builder.set_total_parts_count(var_1);
}
,
s if s.matches("PartNumberMarker") /* PartNumberMarker com.amazonaws.s3#GetObjectAttributesParts$PartNumberMarker */ => {
let var_2 =
Some(
Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_part_number_marker(var_2);
}
,
s if s.matches("NextPartNumberMarker") /* NextPartNumberMarker com.amazonaws.s3#GetObjectAttributesParts$NextPartNumberMarker */ => {
let var_3 =
Some(
Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_next_part_number_marker(var_3);
}
,
s if s.matches("MaxParts") /* MaxParts com.amazonaws.s3#GetObjectAttributesParts$MaxParts */ => {
let var_4 =
Some(
{
<i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.s3#MaxParts`)"))
}
?
)
;
builder = builder.set_max_parts(var_4);
}
,
s if s.matches("IsTruncated") /* IsTruncated com.amazonaws.s3#GetObjectAttributesParts$IsTruncated */ => {
let var_5 =
Some(
{
<bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.s3#IsTruncated`)"))
}
?
)
;
builder = builder.set_is_truncated(var_5);
}
,
s if s.matches("Part") /* Parts com.amazonaws.s3#GetObjectAttributesParts$Parts */ => {
let var_6 =
Some(
Result::<::std::vec::Vec::<crate::types::ObjectPart>, ::aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_7 = builder.parts.take().unwrap_or_default();
list_7.push(
crate::protocol_serde::shape_object_part::de_object_part(&mut tag)
?
);
list_7
})
?
)
;
builder = builder.set_parts(var_6);
}
,
_ => {}
}
}
Ok(builder.build())
}