pub fn ser_s3_initiate_restore_object_operation(
input: &crate::types::S3InitiateRestoreObjectOperation,
writer: ::aws_smithy_xml::encode::ElWriter,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
#[allow(unused_mut)]
let mut scope = writer.finish();
if let Some(var_1) = &input.expiration_in_days {
let mut inner_writer = scope.start_el("ExpirationInDays").finish();
inner_writer.data(::aws_smithy_types::primitive::Encoder::from(*var_1).encode());
}
if let Some(var_2) = &input.glacier_job_tier {
let mut inner_writer = scope.start_el("GlacierJobTier").finish();
inner_writer.data(var_2.as_str());
}
scope.finish();
Ok(())
}
#[allow(clippy::needless_question_mark)]
pub fn de_s3_initiate_restore_object_operation(
decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
depth: u32,
) -> ::std::result::Result<crate::types::S3InitiateRestoreObjectOperation, ::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::S3InitiateRestoreObjectOperation::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("ExpirationInDays") => {
let var_3 =
Some(
{
<i32 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 (integer: `com.amazonaws.s3control#S3ExpirationInDays`)"))
}
?
)
;
builder = builder.set_expiration_in_days(var_3);
}
,
s if s.matches("GlacierJobTier") => {
let var_4 =
Some(
Result::<crate::types::S3GlacierJobTier, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::types::S3GlacierJobTier::from(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_glacier_job_tier(var_4);
}
,
_ => {}
}
}
Ok(builder.build())
}