Struct aws_sdk_s3::model::default_retention::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for DefaultRetention
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn mode(self, input: ObjectLockRetentionMode) -> Self
pub fn mode(self, input: ObjectLockRetentionMode) -> Self
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
.
sourcepub fn set_mode(self, input: Option<ObjectLockRetentionMode>) -> Self
pub fn set_mode(self, input: Option<ObjectLockRetentionMode>) -> Self
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
.
Examples found in repository?
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())
}
sourcepub fn days(self, input: i32) -> Self
pub fn days(self, input: i32) -> Self
The number of days that you want to specify for the default retention period. Must be used with Mode
.
sourcepub fn set_days(self, input: Option<i32>) -> Self
pub fn set_days(self, input: Option<i32>) -> Self
The number of days that you want to specify for the default retention period. Must be used with Mode
.
Examples found in repository?
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())
}
sourcepub fn years(self, input: i32) -> Self
pub fn years(self, input: i32) -> Self
The number of years that you want to specify for the default retention period. Must be used with Mode
.
sourcepub fn set_years(self, input: Option<i32>) -> Self
pub fn set_years(self, input: Option<i32>) -> Self
The number of years that you want to specify for the default retention period. Must be used with Mode
.
Examples found in repository?
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())
}
sourcepub fn build(self) -> DefaultRetention
pub fn build(self) -> DefaultRetention
Consumes the builder and constructs a DefaultRetention
.
Examples found in repository?
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())
}