pub(crate) fn de_insight_rule_contributor(
decoder: &mut ::aws_smithy_cbor::Decoder,
) -> ::std::result::Result<crate::types::InsightRuleContributor, ::aws_smithy_cbor::decode::DeserializeError> {
#[allow(clippy::match_single_binding)]
fn pair(
mut builder: crate::types::builders::InsightRuleContributorBuilder,
decoder: &mut ::aws_smithy_cbor::Decoder,
) -> ::std::result::Result<crate::types::builders::InsightRuleContributorBuilder, ::aws_smithy_cbor::decode::DeserializeError> {
builder = match decoder.str()?.as_ref() {
"Keys" => builder.set_keys(Some(
crate::protocol_serde::shape_insight_rule_contributor_keys::de_insight_rule_contributor_keys(decoder)?,
)),
"ApproximateAggregateValue" => builder.set_approximate_aggregate_value(Some(decoder.double()?)),
"Datapoints" => builder.set_datapoints(Some(
crate::protocol_serde::shape_insight_rule_contributor_datapoints::de_insight_rule_contributor_datapoints(decoder)?,
)),
_ => {
decoder.skip()?;
builder
}
};
Ok(builder)
}
let mut builder = crate::types::builders::InsightRuleContributorBuilder::default();
match decoder.map()? {
None => loop {
match decoder.datatype()? {
::aws_smithy_cbor::data::Type::Break => {
decoder.skip()?;
break;
}
_ => {
builder = pair(builder, decoder)?;
}
};
},
Some(n) => {
for _ in 0..n {
builder = pair(builder, decoder)?;
}
}
};
#[allow(clippy::needless_question_mark)]
{
return Ok(crate::serde_util::insight_rule_contributor_correct_errors(builder).build());
}
}