Skip to main content

aws_sdk_iotanalytics/protocol_serde/
shape_batch_put_message_error_entries.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub(crate) fn de_batch_put_message_error_entries<'a, I>(
3    tokens: &mut ::std::iter::Peekable<I>,
4    _value: &'a [u8],
5) -> ::std::result::Result<Option<::std::vec::Vec<crate::types::BatchPutMessageErrorEntry>>, ::aws_smithy_json::deserialize::error::DeserializeError>
6where
7    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
8{
9    match tokens.next().transpose()? {
10        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
11        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
12            let mut items = Vec::new();
13            loop {
14                match tokens.peek() {
15                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
16                        tokens.next().transpose().unwrap();
17                        break;
18                    }
19                    _ => {
20                        let value = crate::protocol_serde::shape_batch_put_message_error_entry::de_batch_put_message_error_entry(tokens, _value)?;
21                        if let Some(value) = value {
22                            items.push(value);
23                        }
24                    }
25                }
26            }
27            Ok(Some(items))
28        }
29        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
30            "expected start array or null",
31        )),
32    }
33}