pub(crate) fn de_data_repository_configuration<'a, I>(
tokens: &mut ::std::iter::Peekable<I>,
) -> Result<Option<crate::types::DataRepositoryConfiguration>, ::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::DataRepositoryConfigurationBuilder::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() {
"Lifecycle" => {
builder = builder.set_lifecycle(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::DataRepositoryLifecycle::from(u.as_ref())))
.transpose()?,
);
}
"ImportPath" => {
builder = builder.set_import_path(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"ExportPath" => {
builder = builder.set_export_path(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"ImportedFileChunkSize" => {
builder = builder.set_imported_file_chunk_size(
::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
.map(i32::try_from)
.transpose()?,
);
}
"AutoImportPolicy" => {
builder = builder.set_auto_import_policy(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::AutoImportPolicyType::from(u.as_ref())))
.transpose()?,
);
}
"FailureDetails" => {
builder = builder.set_failure_details(
crate::protocol_serde::shape_data_repository_failure_details::de_data_repository_failure_details(tokens)?,
);
}
_ => ::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",
)),
}
}