Struct: s3.CORSRule

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

Overview

Specifies a cross-origin access rule for an Amazon S3 bucket.

Implemented Interfaces

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

Structure Field Summary collapse

Service Operations collapse

Structure Field Details

AllowedHeaders []*string `locationName:"AllowedHeader" type:"list" flattened:"true"`

Headers that are specified in the Access-Control-Request-Headers header. These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers that are allowed.

AllowedMethods []*string `locationName:"AllowedMethod" type:"list" flattened:"true" required:"true"`

An HTTP method that you allow the origin to execute. Valid values are GET, PUT, HEAD, POST, and DELETE.

AllowedMethods is a required field

AllowedOrigins []*string `locationName:"AllowedOrigin" type:"list" flattened:"true" required:"true"`

One or more origins you want customers to be able to access the bucket from.

AllowedOrigins is a required field

ExposeHeaders []*string `locationName:"ExposeHeader" type:"list" flattened:"true"`

One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript XMLHttpRequest object).

MaxAgeSeconds *int64 `type:"integer"`

The time in seconds that your browser is to cache the preflight response for the specified resource.

_ struct{} `type:"structure"`

Method Details

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



7799
7800
7801
// File 'service/s3/api.go', line 7799

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

func (s *CORSRule) SetAllowedHeaders(v []*string) *CORSRule

SetAllowedHeaders sets the AllowedHeaders field's value.



7820
7821
7822
7823
// File 'service/s3/api.go', line 7820

func (s *CORSRule) SetAllowedHeaders(v []*string) *CORSRule { s.AllowedHeaders = v return s }

func (s *CORSRule) SetAllowedMethods(v []*string) *CORSRule

SetAllowedMethods sets the AllowedMethods field's value.



7826
7827
7828
7829
// File 'service/s3/api.go', line 7826

func (s *CORSRule) SetAllowedMethods(v []*string) *CORSRule { s.AllowedMethods = v return s }

func (s *CORSRule) SetAllowedOrigins(v []*string) *CORSRule

SetAllowedOrigins sets the AllowedOrigins field's value.



7832
7833
7834
7835
// File 'service/s3/api.go', line 7832

func (s *CORSRule) SetAllowedOrigins(v []*string) *CORSRule { s.AllowedOrigins = v return s }

func (s *CORSRule) SetExposeHeaders(v []*string) *CORSRule

SetExposeHeaders sets the ExposeHeaders field's value.



7838
7839
7840
7841
// File 'service/s3/api.go', line 7838

func (s *CORSRule) SetExposeHeaders(v []*string) *CORSRule { s.ExposeHeaders = v return s }

func (s *CORSRule) SetMaxAgeSeconds(v int64) *CORSRule

SetMaxAgeSeconds sets the MaxAgeSeconds field's value.



7844
7845
7846
7847
// File 'service/s3/api.go', line 7844

func (s *CORSRule) SetMaxAgeSeconds(v int64) *CORSRule { s.MaxAgeSeconds = &v return s }

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



7790
7791
7792
// File 'service/s3/api.go', line 7790

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

func (s *CORSRule) Validate() error

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



7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
// File 'service/s3/api.go', line 7804

func (s *CORSRule) Validate() error { invalidParams := request.ErrInvalidParams{Context: "CORSRule"} if s.AllowedMethods == nil { invalidParams.Add(request.NewErrParamRequired("AllowedMethods")) } if s.AllowedOrigins == nil { invalidParams.Add(request.NewErrParamRequired("AllowedOrigins")) } if invalidParams.Len() > 0 { return invalidParams } return nil }