Struct: s3.PutObjectRetentionInput

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

Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"`

The bucket name that contains the object you want to apply this Object Retention configuration to.

When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points (docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) in the Amazon S3 User Guide.

Bucket is a required field

BypassGovernanceRetention *bool `location:"header" locationName:"x-amz-bypass-governance-retention" type:"boolean"`

Ignored by COS.

ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"`

Ignored by COS.

Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"`

The key name for the object that you want to apply this Object Retention configuration to.

Key is a required field

RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"`

Ignored by COS.

Retention *ObjectLockRetention `locationName:"Retention" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"`

The container element for the Object Retention configuration.

VersionId *string `location:"querystring" locationName:"versionId" type:"string"`

The version ID for the object that you want to apply this Object Retention configuration to.

_ struct{} `locationName:"PutObjectRetentionRequest" type:"structure" payload:"Retention"`

Method Details

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



20836
20837
20838
// File 'service/s3/api.go', line 20836

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

func (s *PutObjectRetentionInput) SetBucket(v string) *PutObjectRetentionInput

SetBucket sets the Bucket field's value.



20863
20864
20865
20866
// File 'service/s3/api.go', line 20863

func (s *PutObjectRetentionInput) SetBucket(v string) *PutObjectRetentionInput { s.Bucket = &v return s }

func (s *PutObjectRetentionInput) SetBypassGovernanceRetention(v bool) *PutObjectRetentionInput

SetBypassGovernanceRetention sets the BypassGovernanceRetention field's value.



20876
20877
20878
20879
// File 'service/s3/api.go', line 20876

func (s *PutObjectRetentionInput) SetBypassGovernanceRetention(v bool) *PutObjectRetentionInput { s.BypassGovernanceRetention = &v return s }

func (s *PutObjectRetentionInput) SetExpectedBucketOwner(v string) *PutObjectRetentionInput

SetExpectedBucketOwner sets the ExpectedBucketOwner field's value.



20882
20883
20884
20885
// File 'service/s3/api.go', line 20882

func (s *PutObjectRetentionInput) SetExpectedBucketOwner(v string) *PutObjectRetentionInput { s.ExpectedBucketOwner = &v return s }

func (s *PutObjectRetentionInput) SetKey(v string) *PutObjectRetentionInput

SetKey sets the Key field's value.



20888
20889
20890
20891
// File 'service/s3/api.go', line 20888

func (s *PutObjectRetentionInput) SetKey(v string) *PutObjectRetentionInput { s.Key = &v return s }

func (s *PutObjectRetentionInput) SetRequestPayer(v string) *PutObjectRetentionInput

SetRequestPayer sets the RequestPayer field's value.



20894
20895
20896
20897
// File 'service/s3/api.go', line 20894

func (s *PutObjectRetentionInput) SetRequestPayer(v string) *PutObjectRetentionInput { s.RequestPayer = &v return s }

func (s *PutObjectRetentionInput) SetRetention(v *ObjectLockRetention) *PutObjectRetentionInput

SetRetention sets the Retention field's value.



20900
20901
20902
20903
// File 'service/s3/api.go', line 20900

func (s *PutObjectRetentionInput) SetVersionId(v string) *PutObjectRetentionInput

SetVersionId sets the VersionId field's value.



20906
20907
20908
20909
// File 'service/s3/api.go', line 20906

func (s *PutObjectRetentionInput) SetVersionId(v string) *PutObjectRetentionInput { s.VersionId = &v return s }

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



20827
20828
20829
// File 'service/s3/api.go', line 20827

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

func (s *PutObjectRetentionInput) Validate() error

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



20841
20842
20843
20844
20845
20846
20847
20848
20849
20850
20851
20852
20853
20854
20855
20856
20857
20858
20859
20860
// File 'service/s3/api.go', line 20841

func (s *PutObjectRetentionInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "PutObjectRetentionInput"} if s.Bucket == nil { invalidParams.Add(request.NewErrParamRequired("Bucket")) } if s.Bucket != nil && len(*s.Bucket) < 1 { invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) } if s.Key == nil { invalidParams.Add(request.NewErrParamRequired("Key")) } if s.Key != nil && len(*s.Key) < 1 { invalidParams.Add(request.NewErrParamMinLen("Key", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil }