pub fn ser_cascading_control_configuration(
object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::types::CascadingControlConfiguration,
) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> {
if let Some(var_1) = &input.source_controls {
let mut array_2 = object.key("SourceControls").start_array();
for item_3 in var_1 {
{
#[allow(unused_mut)]
let mut object_4 = array_2.value().start_object();
crate::protocol_serde::shape_cascading_control_source::ser_cascading_control_source(&mut object_4, item_3)?;
object_4.finish();
}
}
array_2.finish();
}
Ok(())
}
pub(crate) fn de_cascading_control_configuration<'a, I>(
tokens: &mut ::std::iter::Peekable<I>,
) -> Result<Option<crate::types::CascadingControlConfiguration>, ::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::CascadingControlConfigurationBuilder::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() {
"SourceControls" => {
builder = builder.set_source_controls(
crate::protocol_serde::shape_cascading_control_source_list::de_cascading_control_source_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(builder.build()))
}
_ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
)),
}
}