Struct: s3.PutObjectLegalHoldInput

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 containing the object that you want to place a legal hold on.

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

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 place a legal hold on.

Key is a required field

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

Container element for the Legal Hold configuration you want to apply to the specified object.

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

Ignored by COS.

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

The version ID of the object that you want to place a Legal Hold on.

_ struct{} `locationName:"PutObjectLegalHoldRequest" type:"structure" payload:"LegalHold"`

Method Details

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



20211
20212
20213
// File 'service/s3/api.go', line 20211

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

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

SetBucket sets the Bucket field's value.



20238
20239
20240
20241
// File 'service/s3/api.go', line 20238

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

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

SetExpectedBucketOwner sets the ExpectedBucketOwner field's value.



20251
20252
20253
20254
// File 'service/s3/api.go', line 20251

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

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

SetKey sets the Key field's value.



20257
20258
20259
20260
// File 'service/s3/api.go', line 20257

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

func (s *PutObjectLegalHoldInput) SetLegalHold(v *ObjectLockLegalHold) *PutObjectLegalHoldInput

SetLegalHold sets the LegalHold field's value.



20263
20264
20265
20266
// File 'service/s3/api.go', line 20263

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

SetRequestPayer sets the RequestPayer field's value.



20269
20270
20271
20272
// File 'service/s3/api.go', line 20269

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

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

SetVersionId sets the VersionId field's value.



20275
20276
20277
20278
// File 'service/s3/api.go', line 20275

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

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



20202
20203
20204
// File 'service/s3/api.go', line 20202

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

func (s *PutObjectLegalHoldInput) Validate() error

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



20216
20217
20218
20219
20220
20221
20222
20223
20224
20225
20226
20227
20228
20229
20230
20231
20232
20233
20234
20235
// File 'service/s3/api.go', line 20216

func (s *PutObjectLegalHoldInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "PutObjectLegalHoldInput"} 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 }