pub fn ser_detailed_status_codes_metrics(
input: &crate::types::DetailedStatusCodesMetrics,
writer: ::aws_smithy_xml::encode::ElWriter,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
#[allow(unused_mut)]
let mut scope = writer.finish();
if input.is_enabled {
let mut inner_writer = scope.start_el("IsEnabled").finish();
inner_writer.data(::aws_smithy_types::primitive::Encoder::from(input.is_enabled).encode());
}
scope.finish();
Ok(())
}
#[allow(clippy::needless_question_mark)]
pub fn de_detailed_status_codes_metrics(
decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
depth: u32,
) -> ::std::result::Result<crate::types::DetailedStatusCodesMetrics, ::aws_smithy_xml::decode::XmlDecodeError> {
if depth >= 128u32 {
return Err(::aws_smithy_xml::decode::XmlDecodeError::custom("maximum nesting depth exceeded"));
}
#[allow(unused_mut)]
let mut builder = crate::types::DetailedStatusCodesMetrics::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("IsEnabled") => {
let var_1 =
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.s3control#IsEnabled`)"))
}
?
)
;
builder = builder.set_is_enabled(var_1);
}
,
_ => {}
}
}
Ok(builder.build())
}