pub fn ser_stream_configuration_session_storage(
object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::types::StreamConfigurationSessionStorage,
) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> {
if let Some(var_1) = &input.root {
#[allow(unused_mut)]
let mut object_2 = object.key("root").start_object();
crate::protocol_serde::shape_streaming_session_storage_root::ser_streaming_session_storage_root(&mut object_2, var_1)?;
object_2.finish();
}
{
let mut array_3 = object.key("mode").start_array();
for item_4 in &input.mode {
{
array_3.value().string(item_4.as_str());
}
}
array_3.finish();
}
Ok(())
}
pub(crate) fn de_stream_configuration_session_storage<'a, I>(
tokens: &mut ::std::iter::Peekable<I>,
) -> Result<Option<crate::types::StreamConfigurationSessionStorage>, ::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::StreamConfigurationSessionStorageBuilder::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() {
"root" => {
builder = builder
.set_root(crate::protocol_serde::shape_streaming_session_storage_root::de_streaming_session_storage_root(tokens)?);
}
"mode" => {
builder = builder.set_mode(
crate::protocol_serde::shape_streaming_session_storage_mode_list::de_streaming_session_storage_mode_list(tokens)?,
);
}
_ => ::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(
crate::serde_util::stream_configuration_session_storage_correct_errors(builder)
.build()
.map_err(|err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?,
))
}
_ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
)),
}
}