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