Struct: s3.LifecycleRule

import "../ibm-cos-sdk-go/service/s3"

Overview

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

For more information see, Managing your storage lifecycle (docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html) in the Amazon S3 User Guide.

Implemented Interfaces

s3crypto.Cipher, s3manager.ReadSeekerWriteTo, request.Validator, s3manager.WriterReadFrom

Structure Field Summary collapse

Service Operations collapse

Structure Field Details

AbortIncompleteMultipartUpload *AbortIncompleteMultipartUpload `type:"structure"`

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 Configuration (docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config) in the Amazon S3 User Guide.

Expiration *LifecycleExpiration `type:"structure"`

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

Filter *LifecycleRuleFilter `type:"structure" required:"true"`

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 containt a Prefix element.

Filter is a required field

ID *string `type:"string"`

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

NoncurrentVersionExpiration *NoncurrentVersionExpiration `type:"structure"`

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.

Status *string `type:"string" required:"true" enum:"ExpirationStatus"`

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

Status is a required field

Transitions []*Transition `locationName:"Transition" type:"list" flattened:"true"`

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

_ struct{} `type:"structure"`

Method Details

func (s LifecycleRule) GoString() string

GoString returns the string representation.

API parameter values that are decorated as “sensitive” in the API will not be included in the string output. The member name will be present, but the value will be replaced with “sensitive”.



15639
15640
15641
// File 'service/s3/api.go', line 15639

func (s LifecycleRule) GoString() string { return s.String() }

func (s *LifecycleRule) SetAbortIncompleteMultipartUpload(v *AbortIncompleteMultipartUpload) *LifecycleRule

SetAbortIncompleteMultipartUpload sets the AbortIncompleteMultipartUpload field's value.



15660
15661
15662
15663
// File 'service/s3/api.go', line 15660

func (s *LifecycleRule) SetAbortIncompleteMultipartUpload(v *AbortIncompleteMultipartUpload) *LifecycleRule { s.AbortIncompleteMultipartUpload = v return s }

func (s *LifecycleRule) SetExpiration(v *LifecycleExpiration) *LifecycleRule

SetExpiration sets the Expiration field's value.



15666
15667
15668
15669
// File 'service/s3/api.go', line 15666

func (s *LifecycleRule) SetExpiration(v *LifecycleExpiration) *LifecycleRule { s.Expiration = v return s }

func (s *LifecycleRule) SetFilter(v *LifecycleRuleFilter) *LifecycleRule

SetFilter sets the Filter field's value.



15672
15673
15674
15675
// File 'service/s3/api.go', line 15672

func (s *LifecycleRule) SetFilter(v *LifecycleRuleFilter) *LifecycleRule { s.Filter = v return s }

func (s *LifecycleRule) SetID(v string) *LifecycleRule

SetID sets the ID field's value.



15678
15679
15680
15681
// File 'service/s3/api.go', line 15678

func (s *LifecycleRule) SetID(v string) *LifecycleRule { s.ID = &v return s }

func (s *LifecycleRule) SetNoncurrentVersionExpiration(v *NoncurrentVersionExpiration) *LifecycleRule

SetNoncurrentVersionExpiration sets the NoncurrentVersionExpiration field's value.



15684
15685
15686
15687
// File 'service/s3/api.go', line 15684

func (s *LifecycleRule) SetNoncurrentVersionExpiration(v *NoncurrentVersionExpiration) *LifecycleRule { s.NoncurrentVersionExpiration = v return s }

func (s *LifecycleRule) SetStatus(v string) *LifecycleRule

SetStatus sets the Status field's value.



15690
15691
15692
15693
// File 'service/s3/api.go', line 15690

func (s *LifecycleRule) SetStatus(v string) *LifecycleRule { s.Status = &v return s }

func (s *LifecycleRule) SetTransitions(v []*Transition) *LifecycleRule

SetTransitions sets the Transitions field's value.



15696
15697
15698
15699
// File 'service/s3/api.go', line 15696

func (s *LifecycleRule) SetTransitions(v []*Transition) *LifecycleRule { s.Transitions = v return s }

func (s LifecycleRule) String() string

String returns the string representation.

API parameter values that are decorated as “sensitive” in the API will not be included in the string output. The member name will be present, but the value will be replaced with “sensitive”.



15630
15631
15632
// File 'service/s3/api.go', line 15630

func (s LifecycleRule) String() string { return awsutil.Prettify(s) }

func (s *LifecycleRule) Validate() error

Validate inspects the fields of the type to determine if they are valid.



15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
// File 'service/s3/api.go', line 15644

func (s *LifecycleRule) Validate() error { invalidParams := request.ErrInvalidParams{Context: "LifecycleRule"} if s.Filter == nil { invalidParams.Add(request.NewErrParamRequired("Filter")) } if s.Status == nil { invalidParams.Add(request.NewErrParamRequired("Status")) } if invalidParams.Len() > 0 { return invalidParams } return nil }