aws_sdk_swf/protocol_serde/
shape_history_event.rspub(crate) fn de_history_event<'a, I>(
tokens: &mut ::std::iter::Peekable<I>,
) -> Result<Option<crate::types::HistoryEvent>, ::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::HistoryEventBuilder::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() {
"eventTimestamp" => {
builder = builder.set_event_timestamp(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
tokens.next(),
::aws_smithy_types::date_time::Format::EpochSeconds,
)?);
}
"eventType" => {
builder = builder.set_event_type(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::EventType::from(u.as_ref())))
.transpose()?,
);
}
"eventId" => {
builder = builder.set_event_id(
::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
.map(i64::try_from)
.transpose()?,
);
}
"workflowExecutionStartedEventAttributes" => {
builder = builder.set_workflow_execution_started_event_attributes(
crate::protocol_serde::shape_workflow_execution_started_event_attributes::de_workflow_execution_started_event_attributes(tokens)?
);
}
"workflowExecutionCompletedEventAttributes" => {
builder = builder.set_workflow_execution_completed_event_attributes(
crate::protocol_serde::shape_workflow_execution_completed_event_attributes::de_workflow_execution_completed_event_attributes(tokens)?
);
}
"completeWorkflowExecutionFailedEventAttributes" => {
builder = builder.set_complete_workflow_execution_failed_event_attributes(
crate::protocol_serde::shape_complete_workflow_execution_failed_event_attributes::de_complete_workflow_execution_failed_event_attributes(tokens)?
);
}
"workflowExecutionFailedEventAttributes" => {
builder = builder.set_workflow_execution_failed_event_attributes(
crate::protocol_serde::shape_workflow_execution_failed_event_attributes::de_workflow_execution_failed_event_attributes(tokens)?
);
}
"failWorkflowExecutionFailedEventAttributes" => {
builder = builder.set_fail_workflow_execution_failed_event_attributes(
crate::protocol_serde::shape_fail_workflow_execution_failed_event_attributes::de_fail_workflow_execution_failed_event_attributes(tokens)?
);
}
"workflowExecutionTimedOutEventAttributes" => {
builder = builder.set_workflow_execution_timed_out_event_attributes(
crate::protocol_serde::shape_workflow_execution_timed_out_event_attributes::de_workflow_execution_timed_out_event_attributes(tokens)?
);
}
"workflowExecutionCanceledEventAttributes" => {
builder = builder.set_workflow_execution_canceled_event_attributes(
crate::protocol_serde::shape_workflow_execution_canceled_event_attributes::de_workflow_execution_canceled_event_attributes(tokens)?
);
}
"cancelWorkflowExecutionFailedEventAttributes" => {
builder = builder.set_cancel_workflow_execution_failed_event_attributes(
crate::protocol_serde::shape_cancel_workflow_execution_failed_event_attributes::de_cancel_workflow_execution_failed_event_attributes(tokens)?
);
}
"workflowExecutionContinuedAsNewEventAttributes" => {
builder = builder.set_workflow_execution_continued_as_new_event_attributes(
crate::protocol_serde::shape_workflow_execution_continued_as_new_event_attributes::de_workflow_execution_continued_as_new_event_attributes(tokens)?
);
}
"continueAsNewWorkflowExecutionFailedEventAttributes" => {
builder = builder.set_continue_as_new_workflow_execution_failed_event_attributes(
crate::protocol_serde::shape_continue_as_new_workflow_execution_failed_event_attributes::de_continue_as_new_workflow_execution_failed_event_attributes(tokens)?
);
}
"workflowExecutionTerminatedEventAttributes" => {
builder = builder.set_workflow_execution_terminated_event_attributes(
crate::protocol_serde::shape_workflow_execution_terminated_event_attributes::de_workflow_execution_terminated_event_attributes(tokens)?
);
}
"workflowExecutionCancelRequestedEventAttributes" => {
builder = builder.set_workflow_execution_cancel_requested_event_attributes(
crate::protocol_serde::shape_workflow_execution_cancel_requested_event_attributes::de_workflow_execution_cancel_requested_event_attributes(tokens)?
);
}
"decisionTaskScheduledEventAttributes" => {
builder = builder.set_decision_task_scheduled_event_attributes(
crate::protocol_serde::shape_decision_task_scheduled_event_attributes::de_decision_task_scheduled_event_attributes(tokens)?
);
}
"decisionTaskStartedEventAttributes" => {
builder = builder.set_decision_task_started_event_attributes(
crate::protocol_serde::shape_decision_task_started_event_attributes::de_decision_task_started_event_attributes(
tokens,
)?,
);
}
"decisionTaskCompletedEventAttributes" => {
builder = builder.set_decision_task_completed_event_attributes(
crate::protocol_serde::shape_decision_task_completed_event_attributes::de_decision_task_completed_event_attributes(tokens)?
);
}
"decisionTaskTimedOutEventAttributes" => {
builder = builder.set_decision_task_timed_out_event_attributes(
crate::protocol_serde::shape_decision_task_timed_out_event_attributes::de_decision_task_timed_out_event_attributes(tokens)?
);
}
"activityTaskScheduledEventAttributes" => {
builder = builder.set_activity_task_scheduled_event_attributes(
crate::protocol_serde::shape_activity_task_scheduled_event_attributes::de_activity_task_scheduled_event_attributes(tokens)?
);
}
"activityTaskStartedEventAttributes" => {
builder = builder.set_activity_task_started_event_attributes(
crate::protocol_serde::shape_activity_task_started_event_attributes::de_activity_task_started_event_attributes(
tokens,
)?,
);
}
"activityTaskCompletedEventAttributes" => {
builder = builder.set_activity_task_completed_event_attributes(
crate::protocol_serde::shape_activity_task_completed_event_attributes::de_activity_task_completed_event_attributes(tokens)?
);
}
"activityTaskFailedEventAttributes" => {
builder = builder.set_activity_task_failed_event_attributes(
crate::protocol_serde::shape_activity_task_failed_event_attributes::de_activity_task_failed_event_attributes(
tokens,
)?,
);
}
"activityTaskTimedOutEventAttributes" => {
builder = builder.set_activity_task_timed_out_event_attributes(
crate::protocol_serde::shape_activity_task_timed_out_event_attributes::de_activity_task_timed_out_event_attributes(tokens)?
);
}
"activityTaskCanceledEventAttributes" => {
builder = builder.set_activity_task_canceled_event_attributes(
crate::protocol_serde::shape_activity_task_canceled_event_attributes::de_activity_task_canceled_event_attributes(
tokens,
)?,
);
}
"activityTaskCancelRequestedEventAttributes" => {
builder = builder.set_activity_task_cancel_requested_event_attributes(
crate::protocol_serde::shape_activity_task_cancel_requested_event_attributes::de_activity_task_cancel_requested_event_attributes(tokens)?
);
}
"workflowExecutionSignaledEventAttributes" => {
builder = builder.set_workflow_execution_signaled_event_attributes(
crate::protocol_serde::shape_workflow_execution_signaled_event_attributes::de_workflow_execution_signaled_event_attributes(tokens)?
);
}
"markerRecordedEventAttributes" => {
builder = builder.set_marker_recorded_event_attributes(
crate::protocol_serde::shape_marker_recorded_event_attributes::de_marker_recorded_event_attributes(tokens)?,
);
}
"recordMarkerFailedEventAttributes" => {
builder = builder.set_record_marker_failed_event_attributes(
crate::protocol_serde::shape_record_marker_failed_event_attributes::de_record_marker_failed_event_attributes(
tokens,
)?,
);
}
"timerStartedEventAttributes" => {
builder = builder.set_timer_started_event_attributes(
crate::protocol_serde::shape_timer_started_event_attributes::de_timer_started_event_attributes(tokens)?,
);
}
"timerFiredEventAttributes" => {
builder = builder.set_timer_fired_event_attributes(
crate::protocol_serde::shape_timer_fired_event_attributes::de_timer_fired_event_attributes(tokens)?,
);
}
"timerCanceledEventAttributes" => {
builder = builder.set_timer_canceled_event_attributes(
crate::protocol_serde::shape_timer_canceled_event_attributes::de_timer_canceled_event_attributes(tokens)?,
);
}
"startChildWorkflowExecutionInitiatedEventAttributes" => {
builder = builder.set_start_child_workflow_execution_initiated_event_attributes(
crate::protocol_serde::shape_start_child_workflow_execution_initiated_event_attributes::de_start_child_workflow_execution_initiated_event_attributes(tokens)?
);
}
"childWorkflowExecutionStartedEventAttributes" => {
builder = builder.set_child_workflow_execution_started_event_attributes(
crate::protocol_serde::shape_child_workflow_execution_started_event_attributes::de_child_workflow_execution_started_event_attributes(tokens)?
);
}
"childWorkflowExecutionCompletedEventAttributes" => {
builder = builder.set_child_workflow_execution_completed_event_attributes(
crate::protocol_serde::shape_child_workflow_execution_completed_event_attributes::de_child_workflow_execution_completed_event_attributes(tokens)?
);
}
"childWorkflowExecutionFailedEventAttributes" => {
builder = builder.set_child_workflow_execution_failed_event_attributes(
crate::protocol_serde::shape_child_workflow_execution_failed_event_attributes::de_child_workflow_execution_failed_event_attributes(tokens)?
);
}
"childWorkflowExecutionTimedOutEventAttributes" => {
builder = builder.set_child_workflow_execution_timed_out_event_attributes(
crate::protocol_serde::shape_child_workflow_execution_timed_out_event_attributes::de_child_workflow_execution_timed_out_event_attributes(tokens)?
);
}
"childWorkflowExecutionCanceledEventAttributes" => {
builder = builder.set_child_workflow_execution_canceled_event_attributes(
crate::protocol_serde::shape_child_workflow_execution_canceled_event_attributes::de_child_workflow_execution_canceled_event_attributes(tokens)?
);
}
"childWorkflowExecutionTerminatedEventAttributes" => {
builder = builder.set_child_workflow_execution_terminated_event_attributes(
crate::protocol_serde::shape_child_workflow_execution_terminated_event_attributes::de_child_workflow_execution_terminated_event_attributes(tokens)?
);
}
"signalExternalWorkflowExecutionInitiatedEventAttributes" => {
builder = builder.set_signal_external_workflow_execution_initiated_event_attributes(
crate::protocol_serde::shape_signal_external_workflow_execution_initiated_event_attributes::de_signal_external_workflow_execution_initiated_event_attributes(tokens)?
);
}
"externalWorkflowExecutionSignaledEventAttributes" => {
builder = builder.set_external_workflow_execution_signaled_event_attributes(
crate::protocol_serde::shape_external_workflow_execution_signaled_event_attributes::de_external_workflow_execution_signaled_event_attributes(tokens)?
);
}
"signalExternalWorkflowExecutionFailedEventAttributes" => {
builder = builder.set_signal_external_workflow_execution_failed_event_attributes(
crate::protocol_serde::shape_signal_external_workflow_execution_failed_event_attributes::de_signal_external_workflow_execution_failed_event_attributes(tokens)?
);
}
"externalWorkflowExecutionCancelRequestedEventAttributes" => {
builder = builder.set_external_workflow_execution_cancel_requested_event_attributes(
crate::protocol_serde::shape_external_workflow_execution_cancel_requested_event_attributes::de_external_workflow_execution_cancel_requested_event_attributes(tokens)?
);
}
"requestCancelExternalWorkflowExecutionInitiatedEventAttributes" => {
builder = builder.set_request_cancel_external_workflow_execution_initiated_event_attributes(
crate::protocol_serde::shape_request_cancel_external_workflow_execution_initiated_event_attributes::de_request_cancel_external_workflow_execution_initiated_event_attributes(tokens)?
);
}
"requestCancelExternalWorkflowExecutionFailedEventAttributes" => {
builder = builder.set_request_cancel_external_workflow_execution_failed_event_attributes(
crate::protocol_serde::shape_request_cancel_external_workflow_execution_failed_event_attributes::de_request_cancel_external_workflow_execution_failed_event_attributes(tokens)?
);
}
"scheduleActivityTaskFailedEventAttributes" => {
builder = builder.set_schedule_activity_task_failed_event_attributes(
crate::protocol_serde::shape_schedule_activity_task_failed_event_attributes::de_schedule_activity_task_failed_event_attributes(tokens)?
);
}
"requestCancelActivityTaskFailedEventAttributes" => {
builder = builder.set_request_cancel_activity_task_failed_event_attributes(
crate::protocol_serde::shape_request_cancel_activity_task_failed_event_attributes::de_request_cancel_activity_task_failed_event_attributes(tokens)?
);
}
"startTimerFailedEventAttributes" => {
builder = builder.set_start_timer_failed_event_attributes(
crate::protocol_serde::shape_start_timer_failed_event_attributes::de_start_timer_failed_event_attributes(tokens)?,
);
}
"cancelTimerFailedEventAttributes" => {
builder = builder.set_cancel_timer_failed_event_attributes(
crate::protocol_serde::shape_cancel_timer_failed_event_attributes::de_cancel_timer_failed_event_attributes(
tokens,
)?,
);
}
"startChildWorkflowExecutionFailedEventAttributes" => {
builder = builder.set_start_child_workflow_execution_failed_event_attributes(
crate::protocol_serde::shape_start_child_workflow_execution_failed_event_attributes::de_start_child_workflow_execution_failed_event_attributes(tokens)?
);
}
"lambdaFunctionScheduledEventAttributes" => {
builder = builder.set_lambda_function_scheduled_event_attributes(
crate::protocol_serde::shape_lambda_function_scheduled_event_attributes::de_lambda_function_scheduled_event_attributes(tokens)?
);
}
"lambdaFunctionStartedEventAttributes" => {
builder = builder.set_lambda_function_started_event_attributes(
crate::protocol_serde::shape_lambda_function_started_event_attributes::de_lambda_function_started_event_attributes(tokens)?
);
}
"lambdaFunctionCompletedEventAttributes" => {
builder = builder.set_lambda_function_completed_event_attributes(
crate::protocol_serde::shape_lambda_function_completed_event_attributes::de_lambda_function_completed_event_attributes(tokens)?
);
}
"lambdaFunctionFailedEventAttributes" => {
builder = builder.set_lambda_function_failed_event_attributes(
crate::protocol_serde::shape_lambda_function_failed_event_attributes::de_lambda_function_failed_event_attributes(
tokens,
)?,
);
}
"lambdaFunctionTimedOutEventAttributes" => {
builder = builder.set_lambda_function_timed_out_event_attributes(
crate::protocol_serde::shape_lambda_function_timed_out_event_attributes::de_lambda_function_timed_out_event_attributes(tokens)?
);
}
"scheduleLambdaFunctionFailedEventAttributes" => {
builder = builder.set_schedule_lambda_function_failed_event_attributes(
crate::protocol_serde::shape_schedule_lambda_function_failed_event_attributes::de_schedule_lambda_function_failed_event_attributes(tokens)?
);
}
"startLambdaFunctionFailedEventAttributes" => {
builder = builder.set_start_lambda_function_failed_event_attributes(
crate::protocol_serde::shape_start_lambda_function_failed_event_attributes::de_start_lambda_function_failed_event_attributes(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(crate::serde_util::history_event_correct_errors(builder).build().map_err(|err| {
::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err)
})?))
}
_ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
)),
}
}