pub(crate) fn de_exascale_db_storage_vault<'a, I>(
tokens: &mut ::std::iter::Peekable<I>,
_value: &'a [u8],
depth: u32,
) -> ::std::result::Result<Option<crate::types::ExascaleDbStorageVault>, ::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::ExascaleDbStorageVaultBuilder::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() {
"exascaleDbStorageVaultId" => {
builder = builder.set_exascale_db_storage_vault_id(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"additionalFlashCacheInPercent" => {
builder = builder.set_additional_flash_cache_in_percent(
::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
.map(i32::try_from)
.transpose()?,
);
}
"attachedShapeAttributes" => {
builder = builder.set_attached_shape_attributes(
crate::protocol_serde::shape_shape_attribute_list::de_shape_attribute_list(tokens, _value, depth + 1)?,
);
}
"autoscaleLimitInGBs" => {
builder = builder.set_autoscale_limit_in_gbs(
::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
.map(i32::try_from)
.transpose()?,
);
}
"availabilityZone" => {
builder = builder.set_availability_zone(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"availabilityZoneId" => {
builder = builder.set_availability_zone_id(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"createdAt" => {
builder = builder.set_created_at(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
tokens.next(),
::aws_smithy_types::date_time::Format::DateTimeWithOffset,
)?);
}
"description" => {
builder = builder.set_description(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"displayName" => {
builder = builder.set_display_name(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"vmClusterArns" => {
builder = builder.set_vm_cluster_arns(crate::protocol_serde::shape_resource_arn_list::de_resource_arn_list(
tokens,
_value,
depth + 1,
)?);
}
"vmClusterCount" => {
builder = builder.set_vm_cluster_count(
::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
.map(i32::try_from)
.transpose()?,
);
}
"vmClusterIds" => {
builder = builder.set_vm_cluster_ids(crate::protocol_serde::shape_resource_id_list::de_resource_id_list(
tokens,
_value,
depth + 1,
)?);
}
"exascaleDbStorageVaultArn" => {
builder = builder.set_exascale_db_storage_vault_arn(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"highCapacityDatabaseStorage" => {
builder = builder.set_high_capacity_database_storage(
crate::protocol_serde::shape_exascale_db_storage_details::de_exascale_db_storage_details(tokens, _value, depth + 1)?,
);
}
"isAutoscaleEnabled" => {
builder = builder.set_is_autoscale_enabled(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
}
"ocid" => {
builder = builder.set_ocid(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"ociResourceAnchorName" => {
builder = builder.set_oci_resource_anchor_name(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"ociUrl" => {
builder = builder.set_oci_url(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"percentProgress" => {
builder = builder.set_percent_progress(
::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f32_lossy()),
);
}
"status" => {
builder = builder.set_status(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::ResourceStatus::from(u.as_ref())))
.transpose()?,
);
}
"statusReason" => {
builder = builder.set_status_reason(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"timeZone" => {
builder = builder.set_time_zone(
::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(
crate::serde_util::exascale_db_storage_vault_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",
)),
}
}