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.

NoncurrentVersionTransitions []*NoncurrentVersionTransition `locationName:"NoncurrentVersionTransition" type:"list" flattened:"true"`

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.

Prefix *string `deprecated:"true" type:"string"`

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 (docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints).

Deprecated: Prefix has been deprecated

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”.



15807
15808
15809
// File 'service/s3/api.go', line 15807

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

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

SetAbortIncompleteMultipartUpload sets the AbortIncompleteMultipartUpload field’s value.



15833
15834
15835
15836
// File 'service/s3/api.go', line 15833

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.



15839
15840
15841
15842
// File 'service/s3/api.go', line 15839

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.



15845
15846
15847
15848
// File 'service/s3/api.go', line 15845

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.



15851
15852
15853
15854
// File 'service/s3/api.go', line 15851

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.



15857
15858
15859
15860
// File 'service/s3/api.go', line 15857

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

func (s *LifecycleRule) SetNoncurrentVersionTransitions(v []*NoncurrentVersionTransition) *LifecycleRule

SetNoncurrentVersionTransitions sets the NoncurrentVersionTransitions field’s value.



15863
15864
15865
15866
// File 'service/s3/api.go', line 15863

func (s *LifecycleRule) SetNoncurrentVersionTransitions(v []*NoncurrentVersionTransition) *LifecycleRule { s.NoncurrentVersionTransitions = v return s }

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

SetPrefix sets the Prefix field’s value.



15869
15870
15871
15872
// File 'service/s3/api.go', line 15869

func (s *LifecycleRule) SetPrefix(v string) *LifecycleRule { s.Prefix = &v return s }

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

SetStatus sets the Status field’s value.



15875
15876
15877
15878
// File 'service/s3/api.go', line 15875

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.



15881
15882
15883
15884
// File 'service/s3/api.go', line 15881

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”.



15798
15799
15800
// File 'service/s3/api.go', line 15798

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.



15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
// File 'service/s3/api.go', line 15812

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 s.Filter != nil { if err := s.Filter.Validate(); err != nil { invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) } } if invalidParams.Len() > 0 { return invalidParams } return nil }