pub(crate) fn de_insight_rule_contributor_datapoint(
decoder: &mut ::aws_smithy_cbor::Decoder,
) -> ::std::result::Result<crate::types::InsightRuleContributorDatapoint, ::aws_smithy_cbor::decode::DeserializeError> {
#[allow(clippy::match_single_binding)]
fn pair(
mut builder: crate::types::builders::InsightRuleContributorDatapointBuilder,
decoder: &mut ::aws_smithy_cbor::Decoder,
) -> ::std::result::Result<crate::types::builders::InsightRuleContributorDatapointBuilder, ::aws_smithy_cbor::decode::DeserializeError> {
builder = match decoder.str()?.as_ref() {
"Timestamp" => builder.set_timestamp(Some(decoder.timestamp()?)),
"ApproximateValue" => builder.set_approximate_value(Some(decoder.double()?)),
_ => {
decoder.skip()?;
builder
}
};
Ok(builder)
}
let mut builder = crate::types::builders::InsightRuleContributorDatapointBuilder::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_datapoint_correct_errors(builder).build());
}
}