pub fn ser_storage_lens_table_destination(
input: &crate::types::StorageLensTableDestination,
writer: ::aws_smithy_xml::encode::ElWriter,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
#[allow(unused_mut)]
let mut scope = writer.finish();
{
let mut inner_writer = scope.start_el("IsEnabled").finish();
inner_writer.data(::aws_smithy_types::primitive::Encoder::from(input.is_enabled).encode());
}
if let Some(var_1) = &input.encryption {
let inner_writer = scope.start_el("Encryption");
crate::protocol_serde::shape_storage_lens_data_export_encryption::ser_storage_lens_data_export_encryption(var_1, inner_writer)?
}
scope.finish();
Ok(())
}
#[allow(clippy::needless_question_mark)]
pub fn de_storage_lens_table_destination(
decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
depth: u32,
) -> ::std::result::Result<crate::types::StorageLensTableDestination, ::aws_smithy_xml::decode::XmlDecodeError> {
if depth >= 128u32 {
return Err(::aws_smithy_xml::decode::XmlDecodeError::custom("maximum nesting depth exceeded"));
}
#[allow(unused_mut)]
let mut builder = crate::types::StorageLensTableDestination::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("IsEnabled") => {
let var_2 =
Some(
{
<bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.s3control#IsEnabled`)"))
}
?
)
;
builder = builder.set_is_enabled(var_2);
}
,
s if s.matches("Encryption") => {
let var_3 =
Some(
crate::protocol_serde::shape_storage_lens_data_export_encryption::de_storage_lens_data_export_encryption(&mut tag, depth + 1)
?
)
;
builder = builder.set_encryption(var_3);
}
,
_ => {}
}
}
Ok(crate::serde_util::storage_lens_table_destination_correct_errors(builder).build())
}