aws-sdk-s3 1.108.0

AWS SDK for Amazon Simple Storage Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub(crate) fn de_get_bucket_metadata_configuration_result_payload(
    body: &[u8],
) -> std::result::Result<
    ::std::option::Option<crate::types::GetBucketMetadataConfigurationResult>,
    crate::operation::get_bucket_metadata_configuration::GetBucketMetadataConfigurationError,
> {
    (!body.is_empty())
        .then(|| {
            crate::protocol_serde::shape_get_bucket_metadata_configuration_output::de_get_bucket_metadata_configuration_result(body)
                .map_err(crate::operation::get_bucket_metadata_configuration::GetBucketMetadataConfigurationError::unhandled)
        })
        .transpose()
}

pub fn de_get_bucket_metadata_configuration_result(
    inp: &[u8],
) -> std::result::Result<crate::types::GetBucketMetadataConfigurationResult, ::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("GetBucketMetadataConfigurationResult")) {
        return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
            "invalid root, expected GetBucketMetadataConfigurationResult got {:?}",
            start_el
        )));
    }
    crate::protocol_serde::shape_get_bucket_metadata_configuration_result::de_get_bucket_metadata_configuration_result(&mut decoder)
}