pub fn ser_gauge_chart_arc_conditional_formatting(
object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::types::GaugeChartArcConditionalFormatting,
) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> {
if let Some(var_1) = &input.foreground_color {
#[allow(unused_mut)]
let mut object_2 = object.key("ForegroundColor").start_object();
crate::protocol_serde::shape_conditional_formatting_color::ser_conditional_formatting_color(&mut object_2, var_1)?;
object_2.finish();
}
Ok(())
}
pub(crate) fn de_gauge_chart_arc_conditional_formatting<'a, I>(
tokens: &mut ::std::iter::Peekable<I>,
) -> Result<Option<crate::types::GaugeChartArcConditionalFormatting>, ::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::GaugeChartArcConditionalFormattingBuilder::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() {
"ForegroundColor" => {
builder = builder.set_foreground_color(
crate::protocol_serde::shape_conditional_formatting_color::de_conditional_formatting_color(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",
)),
}
}