pub(crate) fn de_o_auth2_defaults<'a, I>(
tokens: &mut ::std::iter::Peekable<I>,
_value: &'a [u8],
) -> ::std::result::Result<Option<crate::types::OAuth2Defaults>, ::aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
{
match tokens.next().transpose()? {
Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::types::builders::OAuth2DefaultsBuilder::default();
loop {
match tokens.next().transpose()? {
Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
"oauthScopes" => {
builder = builder.set_oauth_scopes(crate::protocol_serde::shape_o_auth_scope_list::de_o_auth_scope_list(tokens, _value)?);
}
"tokenUrls" => {
builder = builder.set_token_urls(crate::protocol_serde::shape_token_url_list::de_token_url_list(tokens, _value)?);
}
"authCodeUrls" => {
builder =
builder.set_auth_code_urls(crate::protocol_serde::shape_auth_code_url_list::de_auth_code_url_list(tokens, _value)?);
}
"oauth2GrantTypesSupported" => {
builder = builder.set_oauth2_grant_types_supported(
crate::protocol_serde::shape_o_auth2_grant_type_supported_list::de_o_auth2_grant_type_supported_list(tokens, _value)?,
);
}
"oauth2CustomProperties" => {
builder = builder.set_oauth2_custom_properties(
crate::protocol_serde::shape_o_auth2_custom_properties_list::de_o_auth2_custom_properties_list(tokens, _value)?,
);
}
_ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
},
other => {
return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {other:?}"
)))
}
}
}
Ok(Some(builder.build()))
}
_ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
)),
}
}