Struct aws_sdk_s3::model::object_lock_configuration::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for ObjectLockConfiguration
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn object_lock_enabled(self, input: ObjectLockEnabled) -> Self
pub fn object_lock_enabled(self, input: ObjectLockEnabled) -> Self
Indicates whether this bucket has an Object Lock configuration enabled. Enable ObjectLockEnabled
when you apply ObjectLockConfiguration
to a bucket.
sourcepub fn set_object_lock_enabled(self, input: Option<ObjectLockEnabled>) -> Self
pub fn set_object_lock_enabled(self, input: Option<ObjectLockEnabled>) -> Self
Indicates whether this bucket has an Object Lock configuration enabled. Enable ObjectLockEnabled
when you apply ObjectLockConfiguration
to a bucket.
Examples found in repository?
5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112
pub fn deser_structure_crate_model_object_lock_configuration(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::ObjectLockConfiguration, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::ObjectLockConfiguration::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("ObjectLockEnabled") /* ObjectLockEnabled com.amazonaws.s3#ObjectLockConfiguration$ObjectLockEnabled */ => {
let var_287 =
Some(
Result::<crate::model::ObjectLockEnabled, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::ObjectLockEnabled::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_object_lock_enabled(var_287);
}
,
s if s.matches("Rule") /* Rule com.amazonaws.s3#ObjectLockConfiguration$Rule */ => {
let var_288 =
Some(
crate::xml_deser::deser_structure_crate_model_object_lock_rule(&mut tag)
?
)
;
builder = builder.set_rule(var_288);
}
,
_ => {}
}
}
Ok(builder.build())
}
sourcepub fn rule(self, input: ObjectLockRule) -> Self
pub fn rule(self, input: ObjectLockRule) -> Self
Specifies the Object Lock rule for the specified object. Enable the this rule when you apply ObjectLockConfiguration
to a bucket. Bucket settings require both a mode and a period. The period can be either Days
or Years
but you must select one. You cannot specify Days
and Years
at the same time.
sourcepub fn set_rule(self, input: Option<ObjectLockRule>) -> Self
pub fn set_rule(self, input: Option<ObjectLockRule>) -> Self
Specifies the Object Lock rule for the specified object. Enable the this rule when you apply ObjectLockConfiguration
to a bucket. Bucket settings require both a mode and a period. The period can be either Days
or Years
but you must select one. You cannot specify Days
and Years
at the same time.
Examples found in repository?
5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112
pub fn deser_structure_crate_model_object_lock_configuration(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::ObjectLockConfiguration, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::ObjectLockConfiguration::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("ObjectLockEnabled") /* ObjectLockEnabled com.amazonaws.s3#ObjectLockConfiguration$ObjectLockEnabled */ => {
let var_287 =
Some(
Result::<crate::model::ObjectLockEnabled, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::ObjectLockEnabled::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_object_lock_enabled(var_287);
}
,
s if s.matches("Rule") /* Rule com.amazonaws.s3#ObjectLockConfiguration$Rule */ => {
let var_288 =
Some(
crate::xml_deser::deser_structure_crate_model_object_lock_rule(&mut tag)
?
)
;
builder = builder.set_rule(var_288);
}
,
_ => {}
}
}
Ok(builder.build())
}
sourcepub fn build(self) -> ObjectLockConfiguration
pub fn build(self) -> ObjectLockConfiguration
Consumes the builder and constructs a ObjectLockConfiguration
.
Examples found in repository?
5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112
pub fn deser_structure_crate_model_object_lock_configuration(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::ObjectLockConfiguration, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::ObjectLockConfiguration::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("ObjectLockEnabled") /* ObjectLockEnabled com.amazonaws.s3#ObjectLockConfiguration$ObjectLockEnabled */ => {
let var_287 =
Some(
Result::<crate::model::ObjectLockEnabled, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::ObjectLockEnabled::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_object_lock_enabled(var_287);
}
,
s if s.matches("Rule") /* Rule com.amazonaws.s3#ObjectLockConfiguration$Rule */ => {
let var_288 =
Some(
crate::xml_deser::deser_structure_crate_model_object_lock_rule(&mut tag)
?
)
;
builder = builder.set_rule(var_288);
}
,
_ => {}
}
}
Ok(builder.build())
}