aws_sdk_s3/protocol_serde/
shape_get_object_legal_hold_output.rspub(crate) fn de_legal_hold_payload(
body: &[u8],
) -> std::result::Result<::std::option::Option<crate::types::ObjectLockLegalHold>, crate::operation::get_object_legal_hold::GetObjectLegalHoldError> {
(!body.is_empty())
.then(|| {
crate::protocol_serde::shape_get_object_legal_hold_output::de_legal_hold(body)
.map_err(crate::operation::get_object_legal_hold::GetObjectLegalHoldError::unhandled)
})
.transpose()
}
pub fn de_legal_hold(inp: &[u8]) -> Result<crate::types::ObjectLockLegalHold, ::aws_smithy_xml::decode::XmlDecodeError> {
let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
#[allow(unused_mut)]
let mut decoder = doc.root_element()?;
let start_el = decoder.start_el();
if !(start_el.matches("LegalHold")) {
return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
"invalid root, expected LegalHold got {:?}",
start_el
)));
}
crate::protocol_serde::shape_object_lock_legal_hold::de_object_lock_legal_hold(&mut decoder)
}