pub(crate) fn de_task_output(
decoder: &mut ::aws_smithy_cbor::Decoder,
depth: u32,
) -> ::std::result::Result<crate::types::TaskOutput, ::aws_smithy_cbor::decode::DeserializeError> {
if depth >= 128u32 {
return Err(::aws_smithy_cbor::decode::DeserializeError::custom(
"maximum nesting depth exceeded",
decoder.position(),
));
}
#[allow(unused_variables)]
fn pair(
decoder: &mut ::aws_smithy_cbor::Decoder,
depth: u32,
) -> ::std::result::Result<crate::types::TaskOutput, ::aws_smithy_cbor::decode::DeserializeError> {
Ok(match decoder.str()?.as_ref() {
"changeSet" => crate::types::TaskOutput::ChangeSet(crate::protocol_serde::shape_change_set_reference::de_change_set_reference(
decoder,
depth + 1,
)?),
_ => {
decoder.skip()?;
crate::types::TaskOutput::Unknown
}
})
}
match decoder.map()? {
None => {
let variant = pair(decoder, depth)?;
match decoder.datatype()? {
::aws_smithy_cbor::data::Type::Break => {
decoder.skip()?;
Ok(variant)
}
ty => Err(::aws_smithy_cbor::decode::DeserializeError::unexpected_union_variant(
ty,
decoder.position(),
)),
}
}
Some(1) => pair(decoder, depth),
Some(_) => Err(::aws_smithy_cbor::decode::DeserializeError::mixed_union_variants(decoder.position())),
}
}