pub fn ser_aws_step_function_state_machine_details(
object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::types::AwsStepFunctionStateMachineDetails,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
if let Some(var_1) = &input.label {
object.key("Label").string(var_1.as_str());
}
if let Some(var_2) = &input.logging_configuration {
#[allow(unused_mut)]
let mut object_3 = object.key("LoggingConfiguration").start_object();
crate::protocol_serde::shape_aws_step_function_state_machine_logging_configuration_details::ser_aws_step_function_state_machine_logging_configuration_details(&mut object_3, var_2)?;
object_3.finish();
}
if let Some(var_4) = &input.name {
object.key("Name").string(var_4.as_str());
}
if let Some(var_5) = &input.role_arn {
object.key("RoleArn").string(var_5.as_str());
}
if let Some(var_6) = &input.state_machine_arn {
object.key("StateMachineArn").string(var_6.as_str());
}
if let Some(var_7) = &input.status {
object.key("Status").string(var_7.as_str());
}
if let Some(var_8) = &input.tracing_configuration {
#[allow(unused_mut)]
let mut object_9 = object.key("TracingConfiguration").start_object();
crate::protocol_serde::shape_aws_step_function_state_machine_tracing_configuration_details::ser_aws_step_function_state_machine_tracing_configuration_details(&mut object_9, var_8)?;
object_9.finish();
}
if let Some(var_10) = &input.r#type {
object.key("Type").string(var_10.as_str());
}
Ok(())
}
pub(crate) fn de_aws_step_function_state_machine_details<'a, I>(
tokens: &mut ::std::iter::Peekable<I>,
_value: &'a [u8],
) -> ::std::result::Result<Option<crate::types::AwsStepFunctionStateMachineDetails>, ::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::AwsStepFunctionStateMachineDetailsBuilder::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() {
"Label" => {
builder = builder.set_label(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"LoggingConfiguration" => {
builder = builder.set_logging_configuration(
crate::protocol_serde::shape_aws_step_function_state_machine_logging_configuration_details::de_aws_step_function_state_machine_logging_configuration_details(tokens, _value)?
);
}
"Name" => {
builder = builder.set_name(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"RoleArn" => {
builder = builder.set_role_arn(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"StateMachineArn" => {
builder = builder.set_state_machine_arn(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"Status" => {
builder = builder.set_status(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"TracingConfiguration" => {
builder = builder.set_tracing_configuration(
crate::protocol_serde::shape_aws_step_function_state_machine_tracing_configuration_details::de_aws_step_function_state_machine_tracing_configuration_details(tokens, _value)?
);
}
"Type" => {
builder = builder.set_type(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
_ => ::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",
)),
}
}