aws_sdk_swf/protocol_serde/
shape_workflow_execution_configuration.rs1pub(crate) fn de_workflow_execution_configuration<'a, I>(
3 tokens: &mut ::std::iter::Peekable<I>,
4) -> ::std::result::Result<Option<crate::types::WorkflowExecutionConfiguration>, ::aws_smithy_json::deserialize::error::DeserializeError>
5where
6 I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
7{
8 match tokens.next().transpose()? {
9 Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
10 Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
11 #[allow(unused_mut)]
12 let mut builder = crate::types::builders::WorkflowExecutionConfigurationBuilder::default();
13 loop {
14 match tokens.next().transpose()? {
15 Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
16 Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
17 "taskStartToCloseTimeout" => {
18 builder = builder.set_task_start_to_close_timeout(
19 ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
20 .map(|s| s.to_unescaped().map(|u| u.into_owned()))
21 .transpose()?,
22 );
23 }
24 "executionStartToCloseTimeout" => {
25 builder = builder.set_execution_start_to_close_timeout(
26 ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
27 .map(|s| s.to_unescaped().map(|u| u.into_owned()))
28 .transpose()?,
29 );
30 }
31 "taskList" => {
32 builder = builder.set_task_list(crate::protocol_serde::shape_task_list::de_task_list(tokens)?);
33 }
34 "taskPriority" => {
35 builder = builder.set_task_priority(
36 ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
37 .map(|s| s.to_unescaped().map(|u| u.into_owned()))
38 .transpose()?,
39 );
40 }
41 "childPolicy" => {
42 builder = builder.set_child_policy(
43 ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
44 .map(|s| s.to_unescaped().map(|u| crate::types::ChildPolicy::from(u.as_ref())))
45 .transpose()?,
46 );
47 }
48 "lambdaRole" => {
49 builder = builder.set_lambda_role(
50 ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
51 .map(|s| s.to_unescaped().map(|u| u.into_owned()))
52 .transpose()?,
53 );
54 }
55 _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
56 },
57 other => {
58 return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
59 "expected object key or end object, found: {:?}",
60 other
61 )))
62 }
63 }
64 }
65 Ok(Some(
66 crate::serde_util::workflow_execution_configuration_correct_errors(builder)
67 .build()
68 .map_err(|err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?,
69 ))
70 }
71 _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
72 "expected start object or null",
73 )),
74 }
75}