pub fn ser_layer_custom_action_operation(
object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::types::LayerCustomActionOperation,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
if let Some(var_1) = &input.filter_operation {
#[allow(unused_mut)]
let mut object_2 = object.key("FilterOperation").start_object();
crate::protocol_serde::shape_custom_action_filter_operation::ser_custom_action_filter_operation(&mut object_2, var_1)?;
object_2.finish();
}
if let Some(var_3) = &input.navigation_operation {
#[allow(unused_mut)]
let mut object_4 = object.key("NavigationOperation").start_object();
crate::protocol_serde::shape_custom_action_navigation_operation::ser_custom_action_navigation_operation(&mut object_4, var_3)?;
object_4.finish();
}
if let Some(var_5) = &input.url_operation {
#[allow(unused_mut)]
let mut object_6 = object.key("URLOperation").start_object();
crate::protocol_serde::shape_custom_action_url_operation::ser_custom_action_url_operation(&mut object_6, var_5)?;
object_6.finish();
}
if let Some(var_7) = &input.set_parameters_operation {
#[allow(unused_mut)]
let mut object_8 = object.key("SetParametersOperation").start_object();
crate::protocol_serde::shape_custom_action_set_parameters_operation::ser_custom_action_set_parameters_operation(&mut object_8, var_7)?;
object_8.finish();
}
Ok(())
}
pub(crate) fn de_layer_custom_action_operation<'a, I>(
tokens: &mut ::std::iter::Peekable<I>,
_value: &'a [u8],
) -> ::std::result::Result<Option<crate::types::LayerCustomActionOperation>, ::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::LayerCustomActionOperationBuilder::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() {
"FilterOperation" => {
builder = builder.set_filter_operation(
crate::protocol_serde::shape_custom_action_filter_operation::de_custom_action_filter_operation(tokens, _value)?,
);
}
"NavigationOperation" => {
builder = builder.set_navigation_operation(
crate::protocol_serde::shape_custom_action_navigation_operation::de_custom_action_navigation_operation(
tokens, _value,
)?,
);
}
"URLOperation" => {
builder = builder.set_url_operation(
crate::protocol_serde::shape_custom_action_url_operation::de_custom_action_url_operation(tokens, _value)?,
);
}
"SetParametersOperation" => {
builder = builder.set_set_parameters_operation(
crate::protocol_serde::shape_custom_action_set_parameters_operation::de_custom_action_set_parameters_operation(
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",
)),
}
}