pub fn ser_user_token_configuration(
object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::types::UserTokenConfiguration,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
if let Some(var_1) = &input.jwt_token_type_configuration {
#[allow(unused_mut)]
let mut object_2 = object.key("JwtTokenTypeConfiguration").start_object();
crate::protocol_serde::shape_jwt_token_type_configuration::ser_jwt_token_type_configuration(&mut object_2, var_1)?;
object_2.finish();
}
if let Some(var_3) = &input.json_token_type_configuration {
#[allow(unused_mut)]
let mut object_4 = object.key("JsonTokenTypeConfiguration").start_object();
crate::protocol_serde::shape_json_token_type_configuration::ser_json_token_type_configuration(&mut object_4, var_3)?;
object_4.finish();
}
Ok(())
}
pub(crate) fn de_user_token_configuration<'a, I>(
tokens: &mut ::std::iter::Peekable<I>,
_value: &'a [u8],
) -> ::std::result::Result<Option<crate::types::UserTokenConfiguration>, ::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::UserTokenConfigurationBuilder::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() {
"JwtTokenTypeConfiguration" => {
builder = builder.set_jwt_token_type_configuration(
crate::protocol_serde::shape_jwt_token_type_configuration::de_jwt_token_type_configuration(tokens, _value)?,
);
}
"JsonTokenTypeConfiguration" => {
builder = builder.set_json_token_type_configuration(
crate::protocol_serde::shape_json_token_type_configuration::de_json_token_type_configuration(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",
)),
}
}