Struct aws_sdk_s3::model::DefaultRetention
source · #[non_exhaustive]pub struct DefaultRetention { /* private fields */ }
Expand description
The container element for specifying the default Object Lock retention settings for new objects placed in the specified bucket.
-
The
DefaultRetention
settings require both a mode and a period. -
The
DefaultRetention
period can be eitherDays
orYears
but you must select one. You cannot specifyDays
andYears
at the same time.
Implementations§
source§impl DefaultRetention
impl DefaultRetention
sourcepub fn mode(&self) -> Option<&ObjectLockRetentionMode>
pub fn mode(&self) -> Option<&ObjectLockRetentionMode>
The default Object Lock retention mode you want to apply to new objects placed in the specified bucket. Must be used with either Days
or Years
.
source§impl DefaultRetention
impl DefaultRetention
sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder-style object to manufacture DefaultRetention
.
Examples found in repository?
src/xml_deser.rs (line 7396)
7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447
pub fn deser_structure_crate_model_default_retention(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::DefaultRetention, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::DefaultRetention::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("Mode") /* Mode com.amazonaws.s3#DefaultRetention$Mode */ => {
let var_407 =
Some(
Result::<crate::model::ObjectLockRetentionMode, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::ObjectLockRetentionMode::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_mode(var_407);
}
,
s if s.matches("Days") /* Days com.amazonaws.s3#DefaultRetention$Days */ => {
let var_408 =
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.s3#Days`)"))
}
?
)
;
builder = builder.set_days(var_408);
}
,
s if s.matches("Years") /* Years com.amazonaws.s3#DefaultRetention$Years */ => {
let var_409 =
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.s3#Years`)"))
}
?
)
;
builder = builder.set_years(var_409);
}
,
_ => {}
}
}
Ok(builder.build())
}
Trait Implementations§
source§impl Clone for DefaultRetention
impl Clone for DefaultRetention
source§fn clone(&self) -> DefaultRetention
fn clone(&self) -> DefaultRetention
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more