Struct aws_sdk_s3::model::LifecycleRule
source · #[non_exhaustive]pub struct LifecycleRule { /* private fields */ }
Expand description
A lifecycle rule for individual objects in an Amazon S3 bucket.
Implementations§
source§impl LifecycleRule
impl LifecycleRule
sourcepub fn expiration(&self) -> Option<&LifecycleExpiration>
pub fn expiration(&self) -> Option<&LifecycleExpiration>
Specifies the expiration for the lifecycle of the object in the form of date, days and, whether the object has a delete marker.
sourcepub fn id(&self) -> Option<&str>
pub fn id(&self) -> Option<&str>
Unique identifier for the rule. The value cannot be longer than 255 characters.
sourcepub fn prefix(&self) -> Option<&str>
👎Deprecated
pub fn prefix(&self) -> Option<&str>
Prefix identifying one or more objects to which the rule applies. This is no longer used; use Filter
instead.
Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints.
sourcepub fn filter(&self) -> Option<&LifecycleRuleFilter>
pub fn filter(&self) -> Option<&LifecycleRuleFilter>
The Filter
is used to identify objects that a Lifecycle Rule applies to. A Filter
must have exactly one of Prefix
, Tag
, or And
specified. Filter
is required if the LifecycleRule
does not contain a Prefix
element.
sourcepub fn status(&self) -> Option<&ExpirationStatus>
pub fn status(&self) -> Option<&ExpirationStatus>
If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is not currently being applied.
sourcepub fn transitions(&self) -> Option<&[Transition]>
pub fn transitions(&self) -> Option<&[Transition]>
Specifies when an Amazon S3 object transitions to a specified storage class.
sourcepub fn noncurrent_version_transitions(
&self
) -> Option<&[NoncurrentVersionTransition]>
pub fn noncurrent_version_transitions(
&self
) -> Option<&[NoncurrentVersionTransition]>
Specifies the transition rule for the lifecycle rule that describes when noncurrent objects transition to a specific storage class. If your bucket is versioning-enabled (or versioning is suspended), you can set this action to request that Amazon S3 transition noncurrent object versions to a specific storage class at a set period in the object's lifetime.
sourcepub fn noncurrent_version_expiration(
&self
) -> Option<&NoncurrentVersionExpiration>
pub fn noncurrent_version_expiration(
&self
) -> Option<&NoncurrentVersionExpiration>
Specifies when noncurrent object versions expire. Upon expiration, Amazon S3 permanently deletes the noncurrent object versions. You set this lifecycle configuration action on a bucket that has versioning enabled (or suspended) to request that Amazon S3 delete noncurrent object versions at a specific period in the object's lifetime.
sourcepub fn abort_incomplete_multipart_upload(
&self
) -> Option<&AbortIncompleteMultipartUpload>
pub fn abort_incomplete_multipart_upload(
&self
) -> Option<&AbortIncompleteMultipartUpload>
Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload. For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Policy in the Amazon S3 User Guide.
source§impl LifecycleRule
impl LifecycleRule
sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder-style object to manufacture LifecycleRule
.
Examples found in repository?
3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339
pub fn deser_structure_crate_model_lifecycle_rule(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::LifecycleRule, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::LifecycleRule::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("Expiration") /* Expiration com.amazonaws.s3#LifecycleRule$Expiration */ => {
let var_170 =
Some(
crate::xml_deser::deser_structure_crate_model_lifecycle_expiration(&mut tag)
?
)
;
builder = builder.set_expiration(var_170);
}
,
s if s.matches("ID") /* ID com.amazonaws.s3#LifecycleRule$ID */ => {
let var_171 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_id(var_171);
}
,
s if s.matches("Prefix") /* Prefix com.amazonaws.s3#LifecycleRule$Prefix */ => {
let var_172 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_prefix(var_172);
}
,
s if s.matches("Filter") /* Filter com.amazonaws.s3#LifecycleRule$Filter */ => {
let var_173 =
Some(
crate::xml_deser::deser_union_crate_model_lifecycle_rule_filter(&mut tag)
?
)
;
builder = builder.set_filter(var_173);
}
,
s if s.matches("Status") /* Status com.amazonaws.s3#LifecycleRule$Status */ => {
let var_174 =
Some(
Result::<crate::model::ExpirationStatus, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::ExpirationStatus::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_status(var_174);
}
,
s if s.matches("Transition") /* Transitions com.amazonaws.s3#LifecycleRule$Transitions */ => {
let var_175 =
Some(
Result::<std::vec::Vec<crate::model::Transition>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_176 = builder.transitions.take().unwrap_or_default();
list_176.push(
crate::xml_deser::deser_structure_crate_model_transition(&mut tag)
?
);
list_176
})
?
)
;
builder = builder.set_transitions(var_175);
}
,
s if s.matches("NoncurrentVersionTransition") /* NoncurrentVersionTransitions com.amazonaws.s3#LifecycleRule$NoncurrentVersionTransitions */ => {
let var_177 =
Some(
Result::<std::vec::Vec<crate::model::NoncurrentVersionTransition>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_178 = builder.noncurrent_version_transitions.take().unwrap_or_default();
list_178.push(
crate::xml_deser::deser_structure_crate_model_noncurrent_version_transition(&mut tag)
?
);
list_178
})
?
)
;
builder = builder.set_noncurrent_version_transitions(var_177);
}
,
s if s.matches("NoncurrentVersionExpiration") /* NoncurrentVersionExpiration com.amazonaws.s3#LifecycleRule$NoncurrentVersionExpiration */ => {
let var_179 =
Some(
crate::xml_deser::deser_structure_crate_model_noncurrent_version_expiration(&mut tag)
?
)
;
builder = builder.set_noncurrent_version_expiration(var_179);
}
,
s if s.matches("AbortIncompleteMultipartUpload") /* AbortIncompleteMultipartUpload com.amazonaws.s3#LifecycleRule$AbortIncompleteMultipartUpload */ => {
let var_180 =
Some(
crate::xml_deser::deser_structure_crate_model_abort_incomplete_multipart_upload(&mut tag)
?
)
;
builder = builder.set_abort_incomplete_multipart_upload(var_180);
}
,
_ => {}
}
}
Ok(builder.build())
}
Trait Implementations§
source§impl Clone for LifecycleRule
impl Clone for LifecycleRule
source§fn clone(&self) -> LifecycleRule
fn clone(&self) -> LifecycleRule
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more