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



7950
7951
7952
// File 'service/s3/api.go', line 7950

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

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

SetAllowedHeaders sets the AllowedHeaders field’s value.



7971
7972
7973
7974
// File 'service/s3/api.go', line 7971

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.



7977
7978
7979
7980
// File 'service/s3/api.go', line 7977

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.



7983
7984
7985
7986
// File 'service/s3/api.go', line 7983

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.



7989
7990
7991
7992
// File 'service/s3/api.go', line 7989

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.



7995
7996
7997
7998
// File 'service/s3/api.go', line 7995

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



7941
7942
7943
// File 'service/s3/api.go', line 7941

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.



7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
// File 'service/s3/api.go', line 7955

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 }