Skip to main content

aws_sdk_securityhub/protocol_serde/
shape_aws_route53_hosted_zone_vpcs_list.rs

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