pub fn ser_rename_field(
object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::types::RenameField,
) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> {
{
object.key("Name").string(input.name.as_str());
}
{
let mut array_1 = object.key("Inputs").start_array();
for item_2 in &input.inputs {
{
array_1.value().string(item_2.as_str());
}
}
array_1.finish();
}
{
let mut array_3 = object.key("SourcePath").start_array();
for item_4 in &input.source_path {
{
array_3.value().string(item_4.as_str());
}
}
array_3.finish();
}
{
let mut array_5 = object.key("TargetPath").start_array();
for item_6 in &input.target_path {
{
array_5.value().string(item_6.as_str());
}
}
array_5.finish();
}
Ok(())
}
pub(crate) fn de_rename_field<'a, I>(
tokens: &mut ::std::iter::Peekable<I>,
) -> Result<Option<crate::types::RenameField>, ::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::RenameFieldBuilder::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() {
"Name" => {
builder = builder.set_name(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"Inputs" => {
builder = builder.set_inputs(crate::protocol_serde::shape_one_input::de_one_input(tokens)?);
}
"SourcePath" => {
builder = builder.set_source_path(
crate::protocol_serde::shape_enclosed_in_string_properties::de_enclosed_in_string_properties(tokens)?,
);
}
"TargetPath" => {
builder = builder.set_target_path(
crate::protocol_serde::shape_enclosed_in_string_properties::de_enclosed_in_string_properties(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::rename_field_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",
)),
}
}