aws_sdk_s3/protocol_serde/
shape_get_object_lock_configuration_output.rs
1pub(crate) fn de_object_lock_configuration_payload(
3 body: &[u8],
4) -> std::result::Result<
5 ::std::option::Option<crate::types::ObjectLockConfiguration>,
6 crate::operation::get_object_lock_configuration::GetObjectLockConfigurationError,
7> {
8 (!body.is_empty())
9 .then(|| {
10 crate::protocol_serde::shape_get_object_lock_configuration_output::de_object_lock_configuration(body)
11 .map_err(crate::operation::get_object_lock_configuration::GetObjectLockConfigurationError::unhandled)
12 })
13 .transpose()
14}
15
16pub fn de_object_lock_configuration(
17 inp: &[u8],
18) -> std::result::Result<crate::types::ObjectLockConfiguration, ::aws_smithy_xml::decode::XmlDecodeError> {
19 let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
20 #[allow(unused_mut)]
21 let mut decoder = doc.root_element()?;
22 let start_el = decoder.start_el();
23 if !(start_el.matches("ObjectLockConfiguration")) {
24 return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
25 "invalid root, expected ObjectLockConfiguration got {:?}",
26 start_el
27 )));
28 }
29 crate::protocol_serde::shape_object_lock_configuration::de_object_lock_configuration(&mut decoder)
30}