pub(crate) fn de_cluster_info<'a, I>(
tokens: &mut ::std::iter::Peekable<I>,
_value: &'a [u8],
depth: u32,
) -> ::std::result::Result<Option<crate::types::ClusterInfo>, ::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::ClusterInfoBuilder::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() {
"activeOperationArn" => {
builder = builder.set_active_operation_arn(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"brokerNodeGroupInfo" => {
builder = builder.set_broker_node_group_info(
crate::protocol_serde::shape_broker_node_group_info::de_broker_node_group_info(tokens, _value, depth + 1)?,
);
}
"rebalancing" => {
builder = builder.set_rebalancing(crate::protocol_serde::shape_rebalancing::de_rebalancing(tokens, _value, depth + 1)?);
}
"clientAuthentication" => {
builder = builder.set_client_authentication(
crate::protocol_serde::shape_client_authentication::de_client_authentication(tokens, _value, depth + 1)?,
);
}
"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()?,
);
}
"clusterName" => {
builder = builder.set_cluster_name(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"creationTime" => {
builder = builder.set_creation_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
tokens.next(),
::aws_smithy_types::date_time::Format::DateTimeWithOffset,
)?);
}
"currentBrokerSoftwareInfo" => {
builder = builder.set_current_broker_software_info(
crate::protocol_serde::shape_broker_software_info::de_broker_software_info(tokens, _value, depth + 1)?,
);
}
"currentVersion" => {
builder = builder.set_current_version(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"encryptionInfo" => {
builder = builder.set_encryption_info(crate::protocol_serde::shape_encryption_info::de_encryption_info(
tokens,
_value,
depth + 1,
)?);
}
"enhancedMonitoring" => {
builder = builder.set_enhanced_monitoring(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::EnhancedMonitoring::from(u.as_ref())))
.transpose()?,
);
}
"openMonitoring" => {
builder = builder.set_open_monitoring(crate::protocol_serde::shape_open_monitoring::de_open_monitoring(
tokens,
_value,
depth + 1,
)?);
}
"loggingInfo" => {
builder =
builder.set_logging_info(crate::protocol_serde::shape_logging_info::de_logging_info(tokens, _value, depth + 1)?);
}
"numberOfBrokerNodes" => {
builder = builder.set_number_of_broker_nodes(
::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
.map(i32::try_from)
.transpose()?,
);
}
"state" => {
builder = builder.set_state(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::ClusterState::from(u.as_ref())))
.transpose()?,
);
}
"stateInfo" => {
builder = builder.set_state_info(crate::protocol_serde::shape_state_info::de_state_info(tokens, _value, depth + 1)?);
}
"tags" => {
builder = builder.set_tags(crate::protocol_serde::shape_map_of_string::de_map_of_string(tokens, _value, depth + 1)?);
}
"zookeeperConnectString" => {
builder = builder.set_zookeeper_connect_string(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"zookeeperConnectStringTls" => {
builder = builder.set_zookeeper_connect_string_tls(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"storageMode" => {
builder = builder.set_storage_mode(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::StorageMode::from(u.as_ref())))
.transpose()?,
);
}
"customerActionStatus" => {
builder = builder.set_customer_action_status(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::CustomerActionStatus::from(u.as_ref())))
.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",
)),
}
}