aws_sdk_appsync/protocol_serde/
shape_data_source_introspection_model_fields.rs

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