#[non_exhaustive]
pub struct LifecycleRule { /* private fields */ }
Expand description

A lifecycle rule for individual objects in an Amazon S3 bucket.

Implementations§

Specifies the expiration for the lifecycle of the object in the form of date, days and, whether the object has a delete marker.

Unique identifier for the rule. The value cannot be longer than 255 characters.

👎Deprecated

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.

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.

If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is not currently being applied.

Specifies when an Amazon S3 object transitions to a specified storage class.

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.

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.

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.

Creates a new builder-style object to manufacture LifecycleRule.

Examples found in repository?
src/xml_deser.rs (line 3218)
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§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more