pub(crate) fn de_task_set<'a, I>(
tokens: &mut ::std::iter::Peekable<I>,
_value: &'a [u8],
depth: u32,
) -> ::std::result::Result<Option<crate::types::TaskSet>, ::aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
{
if depth >= 128u32 {
return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
"maximum nesting depth exceeded",
));
}
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::TaskSetBuilder::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() {
"id" => {
builder = builder.set_id(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"taskSetArn" => {
builder = builder.set_task_set_arn(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"serviceArn" => {
builder = builder.set_service_arn(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"clusterArn" => {
builder = builder.set_cluster_arn(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"startedBy" => {
builder = builder.set_started_by(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"externalId" => {
builder = builder.set_external_id(
::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()?,
);
}
"taskDefinition" => {
builder = builder.set_task_definition(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"computedDesiredCount" => {
builder = builder.set_computed_desired_count(
::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
.map(i32::try_from)
.transpose()?,
);
}
"pendingCount" => {
builder = builder.set_pending_count(
::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
.map(i32::try_from)
.transpose()?,
);
}
"runningCount" => {
builder = builder.set_running_count(
::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
.map(i32::try_from)
.transpose()?,
);
}
"createdAt" => {
builder = builder.set_created_at(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
tokens.next(),
::aws_smithy_types::date_time::Format::EpochSeconds,
)?);
}
"updatedAt" => {
builder = builder.set_updated_at(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
tokens.next(),
::aws_smithy_types::date_time::Format::EpochSeconds,
)?);
}
"launchType" => {
builder = builder.set_launch_type(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::LaunchType::from(u.as_ref())))
.transpose()?,
);
}
"capacityProviderStrategy" => {
builder = builder.set_capacity_provider_strategy(
crate::protocol_serde::shape_capacity_provider_strategy::de_capacity_provider_strategy(tokens, _value, depth + 1)?,
);
}
"platformVersion" => {
builder = builder.set_platform_version(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"platformFamily" => {
builder = builder.set_platform_family(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"networkConfiguration" => {
builder = builder.set_network_configuration(
crate::protocol_serde::shape_network_configuration::de_network_configuration(tokens, _value, depth + 1)?,
);
}
"loadBalancers" => {
builder = builder.set_load_balancers(crate::protocol_serde::shape_load_balancers::de_load_balancers(
tokens,
_value,
depth + 1,
)?);
}
"serviceRegistries" => {
builder = builder.set_service_registries(crate::protocol_serde::shape_service_registries::de_service_registries(
tokens,
_value,
depth + 1,
)?);
}
"scale" => {
builder = builder.set_scale(crate::protocol_serde::shape_scale::de_scale(tokens, _value, depth + 1)?);
}
"stabilityStatus" => {
builder = builder.set_stability_status(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::StabilityStatus::from(u.as_ref())))
.transpose()?,
);
}
"stabilityStatusAt" => {
builder = builder.set_stability_status_at(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
tokens.next(),
::aws_smithy_types::date_time::Format::EpochSeconds,
)?);
}
"tags" => {
builder = builder.set_tags(crate::protocol_serde::shape_tags::de_tags(tokens, _value, depth + 1)?);
}
"fargateEphemeralStorage" => {
builder = builder.set_fargate_ephemeral_storage(
crate::protocol_serde::shape_deployment_ephemeral_storage::de_deployment_ephemeral_storage(
tokens,
_value,
depth + 1,
)?,
);
}
_ => ::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",
)),
}
}