aws_sdk_s3/protocol_serde/
shape_object_lock_configuration.rspub fn ser_object_lock_configuration(
input: &crate::types::ObjectLockConfiguration,
writer: ::aws_smithy_xml::encode::ElWriter,
) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> {
#[allow(unused_mut)]
let mut scope = writer.finish();
if let Some(var_1) = &input.object_lock_enabled {
let mut inner_writer = scope.start_el("ObjectLockEnabled").finish();
inner_writer.data(var_1.as_str());
}
if let Some(var_2) = &input.rule {
let inner_writer = scope.start_el("Rule");
crate::protocol_serde::shape_object_lock_rule::ser_object_lock_rule(var_2, inner_writer)?
}
scope.finish();
Ok(())
}
#[allow(clippy::needless_question_mark)]
pub fn de_object_lock_configuration(
decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::types::ObjectLockConfiguration, ::aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::types::ObjectLockConfiguration::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("ObjectLockEnabled") => {
let var_3 =
Some(
Result::<crate::types::ObjectLockEnabled, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::types::ObjectLockEnabled::from(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_object_lock_enabled(var_3);
}
,
s if s.matches("Rule") => {
let var_4 =
Some(
crate::protocol_serde::shape_object_lock_rule::de_object_lock_rule(&mut tag)
?
)
;
builder = builder.set_rule(var_4);
}
,
_ => {}
}
}
Ok(builder.build())
}