aws_sdk_quicksight/protocol_serde/
shape_table_conditional_formatting.rs1pub fn ser_table_conditional_formatting(
3 object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
4 input: &crate::types::TableConditionalFormatting,
5) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
6 if let Some(var_1) = &input.conditional_formatting_options {
7 let mut array_2 = object.key("ConditionalFormattingOptions").start_array();
8 for item_3 in var_1 {
9 {
10 #[allow(unused_mut)]
11 let mut object_4 = array_2.value().start_object();
12 crate::protocol_serde::shape_table_conditional_formatting_option::ser_table_conditional_formatting_option(&mut object_4, item_3)?;
13 object_4.finish();
14 }
15 }
16 array_2.finish();
17 }
18 Ok(())
19}
20
21pub(crate) fn de_table_conditional_formatting<'a, I>(
22 tokens: &mut ::std::iter::Peekable<I>,
23 _value: &'a [u8],
24) -> ::std::result::Result<Option<crate::types::TableConditionalFormatting>, ::aws_smithy_json::deserialize::error::DeserializeError>
25where
26 I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
27{
28 match tokens.next().transpose()? {
29 Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
30 Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
31 #[allow(unused_mut)]
32 let mut builder = crate::types::builders::TableConditionalFormattingBuilder::default();
33 loop {
34 match tokens.next().transpose()? {
35 Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
36 Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
37 match key.to_unescaped()?.as_ref() {
38 "ConditionalFormattingOptions" => {
39 builder = builder.set_conditional_formatting_options(
40 crate::protocol_serde::shape_table_conditional_formatting_option_list::de_table_conditional_formatting_option_list(tokens, _value)?
41 );
42 }
43 _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
44 }
45 }
46 other => {
47 return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
48 "expected object key or end object, found: {other:?}"
49 )))
50 }
51 }
52 }
53 Ok(Some(builder.build()))
54 }
55 _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
56 "expected start object or null",
57 )),
58 }
59}