pub fn ser_body_section_repeat_configuration(
object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::types::BodySectionRepeatConfiguration,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
if let Some(var_1) = &input.dimension_configurations {
let mut array_2 = object.key("DimensionConfigurations").start_array();
for item_3 in var_1 {
{
#[allow(unused_mut)]
let mut object_4 = array_2.value().start_object();
crate::protocol_serde::shape_body_section_repeat_dimension_configuration::ser_body_section_repeat_dimension_configuration(
&mut object_4,
item_3,
)?;
object_4.finish();
}
}
array_2.finish();
}
if let Some(var_5) = &input.page_break_configuration {
#[allow(unused_mut)]
let mut object_6 = object.key("PageBreakConfiguration").start_object();
crate::protocol_serde::shape_body_section_repeat_page_break_configuration::ser_body_section_repeat_page_break_configuration(
&mut object_6,
var_5,
)?;
object_6.finish();
}
if let Some(var_7) = &input.non_repeating_visuals {
let mut array_8 = object.key("NonRepeatingVisuals").start_array();
for item_9 in var_7 {
{
array_8.value().string(item_9.as_str());
}
}
array_8.finish();
}
Ok(())
}
pub(crate) fn de_body_section_repeat_configuration<'a, I>(
tokens: &mut ::std::iter::Peekable<I>,
_value: &'a [u8],
) -> ::std::result::Result<Option<crate::types::BodySectionRepeatConfiguration>, ::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::BodySectionRepeatConfigurationBuilder::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() {
"DimensionConfigurations" => {
builder = builder.set_dimension_configurations(
crate::protocol_serde::shape_body_section_repeat_dimension_configuration_list::de_body_section_repeat_dimension_configuration_list(tokens, _value)?
);
}
"PageBreakConfiguration" => {
builder = builder.set_page_break_configuration(
crate::protocol_serde::shape_body_section_repeat_page_break_configuration::de_body_section_repeat_page_break_configuration(tokens, _value)?
);
}
"NonRepeatingVisuals" => {
builder = builder.set_non_repeating_visuals(
crate::protocol_serde::shape_non_repeating_visuals_list::de_non_repeating_visuals_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",
)),
}
}