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"`

Indicates whether S3 Object Lock should bypass Governance-mode restrictions to process this operation. To use this header, you must have the s3:BypassGovernanceRetention permission.

This functionality is not supported for directory buckets.

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



21368
21369
21370
// File 'service/s3/api.go', line 21368

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

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

SetBucket sets the Bucket field’s value.



21395
21396
21397
21398
// File 'service/s3/api.go', line 21395

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.



21408
21409
21410
21411
// File 'service/s3/api.go', line 21408

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.



21414
21415
21416
21417
// File 'service/s3/api.go', line 21414

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.



21420
21421
21422
21423
// File 'service/s3/api.go', line 21420

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.



21426
21427
21428
21429
// File 'service/s3/api.go', line 21426

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.



21432
21433
21434
21435
// File 'service/s3/api.go', line 21432

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

SetVersionId sets the VersionId field’s value.



21438
21439
21440
21441
// File 'service/s3/api.go', line 21438

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



21359
21360
21361
// File 'service/s3/api.go', line 21359

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.



21373
21374
21375
21376
21377
21378
21379
21380
21381
21382
21383
21384
21385
21386
21387
21388
21389
21390
21391
21392
// File 'service/s3/api.go', line 21373

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 }