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