Struct: s3.ProtectionConfiguration

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

Implemented Interfaces

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

Structure Field Summary collapse

Service Operations collapse

Structure Field Details

DefaultRetention *BucketProtectionDefaultRetention `type:"structure" required:"true"`

Default retention period for an object, if a PUT of an object does not specify a retention period this value will be converted to seconds and used.

DefaultRetention is a required field

EnablePermanentRetention *bool `type:"boolean"`

Enable permanent retention for an object.

MaximumRetention *BucketProtectionMaximumRetention `type:"structure" required:"true"`

Maximum retention period for an object, if a PUT of an object specifies a longer retention period the PUT object will fail.

MaximumRetention is a required field

MinimumRetention *BucketProtectionMinimumRetention `type:"structure" required:"true"`

Minimum retention period for an object, if a PUT of an object specifies a shorter retention period the PUT object will fail.

MinimumRetention is a required field

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

Retention status of a bucket.

Status is a required field

_ struct{} `type:"structure"`

Method Details

func (s ProtectionConfiguration) 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”.



18682
18683
18684
// File 'service/s3/api.go', line 18682

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

func (s *ProtectionConfiguration) SetDefaultRetention(v *BucketProtectionDefaultRetention) *ProtectionConfiguration

SetDefaultRetention sets the DefaultRetention field's value.



18724
18725
18726
18727
// File 'service/s3/api.go', line 18724

func (s *ProtectionConfiguration) SetEnablePermanentRetention(v bool) *ProtectionConfiguration

SetEnablePermanentRetention sets the EnablePermanentRetention field's value.



18730
18731
18732
18733
// File 'service/s3/api.go', line 18730

func (s *ProtectionConfiguration) SetEnablePermanentRetention(v bool) *ProtectionConfiguration { s.EnablePermanentRetention = &v return s }

func (s *ProtectionConfiguration) SetMaximumRetention(v *BucketProtectionMaximumRetention) *ProtectionConfiguration

SetMaximumRetention sets the MaximumRetention field's value.



18736
18737
18738
18739
// File 'service/s3/api.go', line 18736

func (s *ProtectionConfiguration) SetMinimumRetention(v *BucketProtectionMinimumRetention) *ProtectionConfiguration

SetMinimumRetention sets the MinimumRetention field's value.



18742
18743
18744
18745
// File 'service/s3/api.go', line 18742

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

SetStatus sets the Status field's value.



18748
18749
18750
18751
// File 'service/s3/api.go', line 18748

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

func (s ProtectionConfiguration) 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”.



18673
18674
18675
// File 'service/s3/api.go', line 18673

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

func (s *ProtectionConfiguration) Validate() error

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



18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
// File 'service/s3/api.go', line 18687

func (s *ProtectionConfiguration) Validate() error { invalidParams := request.ErrInvalidParams{Context: "ProtectionConfiguration"} if s.DefaultRetention == nil { invalidParams.Add(request.NewErrParamRequired("DefaultRetention")) } if s.MaximumRetention == nil { invalidParams.Add(request.NewErrParamRequired("MaximumRetention")) } if s.MinimumRetention == nil { invalidParams.Add(request.NewErrParamRequired("MinimumRetention")) } if s.Status == nil { invalidParams.Add(request.NewErrParamRequired("Status")) } if s.DefaultRetention != nil { if err := s.DefaultRetention.Validate(); err != nil { invalidParams.AddNested("DefaultRetention", err.(request.ErrInvalidParams)) } } if s.MaximumRetention != nil { if err := s.MaximumRetention.Validate(); err != nil { invalidParams.AddNested("MaximumRetention", err.(request.ErrInvalidParams)) } } if s.MinimumRetention != nil { if err := s.MinimumRetention.Validate(); err != nil { invalidParams.AddNested("MinimumRetention", err.(request.ErrInvalidParams)) } } if invalidParams.Len() > 0 { return invalidParams } return nil }