Struct: s3.PutBucketCorsInput

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

Specifies the bucket impacted by the corsconfiguration.

Bucket is a required field

CORSConfiguration *CORSConfiguration `locationName:"CORSConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"`

Describes the cross-origin access configuration for objects in an Amazon S3 bucket. For more information, see Enabling Cross-Origin Resource Sharing (docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) in the Amazon S3 User Guide.

CORSConfiguration is a required field

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

Ignored by COS.

_ struct{} `locationName:"PutBucketCorsRequest" type:"structure" payload:"CORSConfiguration"`

Method Details

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



18767
18768
18769
// File 'service/s3/api.go', line 18767

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

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

SetBucket sets the Bucket field's value.



18796
18797
18798
18799
// File 'service/s3/api.go', line 18796

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

func (s *PutBucketCorsInput) SetCORSConfiguration(v *CORSConfiguration) *PutBucketCorsInput

SetCORSConfiguration sets the CORSConfiguration field's value.



18809
18810
18811
18812
// File 'service/s3/api.go', line 18809

func (s *PutBucketCorsInput) SetCORSConfiguration(v *CORSConfiguration) *PutBucketCorsInput { s.CORSConfiguration = v return s }

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

SetExpectedBucketOwner sets the ExpectedBucketOwner field's value.



18815
18816
18817
18818
// File 'service/s3/api.go', line 18815

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

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



18758
18759
18760
// File 'service/s3/api.go', line 18758

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

func (s *PutBucketCorsInput) Validate() error

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



18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18786
18787
18788
18789
18790
18791
18792
18793
// File 'service/s3/api.go', line 18772

func (s *PutBucketCorsInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "PutBucketCorsInput"} 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.CORSConfiguration == nil { invalidParams.Add(request.NewErrParamRequired("CORSConfiguration")) } if s.CORSConfiguration != nil { if err := s.CORSConfiguration.Validate(); err != nil { invalidParams.AddNested("CORSConfiguration", err.(request.ErrInvalidParams)) } } if invalidParams.Len() > 0 { return invalidParams } return nil }