pub(crate) fn de_ontap_volume_configuration<'a, I>(
tokens: &mut ::std::iter::Peekable<I>,
_value: &'a [u8],
) -> ::std::result::Result<Option<crate::types::OntapVolumeConfiguration>, ::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::OntapVolumeConfigurationBuilder::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() {
"FlexCacheEndpointType" => {
builder = builder.set_flex_cache_endpoint_type(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::FlexCacheEndpointType::from(u.as_ref())))
.transpose()?,
);
}
"JunctionPath" => {
builder = builder.set_junction_path(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"SecurityStyle" => {
builder = builder.set_security_style(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::SecurityStyle::from(u.as_ref())))
.transpose()?,
);
}
"SizeInMegabytes" => {
builder = builder.set_size_in_megabytes(
::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
.map(i32::try_from)
.transpose()?,
);
}
"StorageEfficiencyEnabled" => {
builder =
builder.set_storage_efficiency_enabled(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
}
"StorageVirtualMachineId" => {
builder = builder.set_storage_virtual_machine_id(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"StorageVirtualMachineRoot" => {
builder =
builder.set_storage_virtual_machine_root(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
}
"TieringPolicy" => {
builder = builder.set_tiering_policy(crate::protocol_serde::shape_tiering_policy::de_tiering_policy(tokens, _value)?);
}
"UUID" => {
builder = builder.set_uuid(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"OntapVolumeType" => {
builder = builder.set_ontap_volume_type(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::OntapVolumeType::from(u.as_ref())))
.transpose()?,
);
}
"SnapshotPolicy" => {
builder = builder.set_snapshot_policy(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"CopyTagsToBackups" => {
builder = builder.set_copy_tags_to_backups(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
}
"SnaplockConfiguration" => {
builder = builder.set_snaplock_configuration(
crate::protocol_serde::shape_snaplock_configuration::de_snaplock_configuration(tokens, _value)?,
);
}
"VolumeStyle" => {
builder = builder.set_volume_style(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::VolumeStyle::from(u.as_ref())))
.transpose()?,
);
}
"AggregateConfiguration" => {
builder = builder.set_aggregate_configuration(
crate::protocol_serde::shape_aggregate_configuration::de_aggregate_configuration(tokens, _value)?,
);
}
"SizeInBytes" => {
builder = builder.set_size_in_bytes(
::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
.map(i64::try_from)
.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",
)),
}
}