Class: AWSCDK::APIGatewayv2::CorsPreflightOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::APIGatewayv2::CorsPreflightOptions
- Defined in:
- api_gatewayv2/cors_preflight_options.rb
Overview
Options for the CORS Configuration.
Instance Attribute Summary collapse
-
#allow_credentials ⇒ Boolean?
readonly
Specifies whether credentials are included in the CORS request.
-
#allow_headers ⇒ Array<String>?
readonly
Represents a collection of allowed headers.
-
#allow_methods ⇒ Array<AWSCDK::APIGatewayv2::CorsHttpMethod>?
readonly
Represents a collection of allowed HTTP methods.
-
#allow_origins ⇒ Array<String>?
readonly
Represents a collection of allowed origins.
-
#expose_headers ⇒ Array<String>?
readonly
Represents a collection of exposed headers.
-
#max_age ⇒ AWSCDK::Duration?
readonly
The duration that the browser should cache preflight request results.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(allow_credentials: nil, allow_headers: nil, allow_methods: nil, allow_origins: nil, expose_headers: nil, max_age: nil) ⇒ CorsPreflightOptions
constructor
A new instance of CorsPreflightOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(allow_credentials: nil, allow_headers: nil, allow_methods: nil, allow_origins: nil, expose_headers: nil, max_age: nil) ⇒ CorsPreflightOptions
Returns a new instance of CorsPreflightOptions.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'api_gatewayv2/cors_preflight_options.rb', line 13 def initialize(allow_credentials: nil, allow_headers: nil, allow_methods: nil, allow_origins: nil, expose_headers: nil, max_age: nil) @allow_credentials = allow_credentials Jsii::Type.check_type(@allow_credentials, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "allowCredentials") unless @allow_credentials.nil? @allow_headers = allow_headers Jsii::Type.check_type(@allow_headers, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "allowHeaders") unless @allow_headers.nil? @allow_methods = allow_methods Jsii::Type.check_type(@allow_methods, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcGlnYXRld2F5djIuQ29yc0h0dHBNZXRob2QifSwia2luZCI6ImFycmF5In19")), "allowMethods") unless @allow_methods.nil? @allow_origins = allow_origins Jsii::Type.check_type(@allow_origins, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "allowOrigins") unless @allow_origins.nil? @expose_headers = expose_headers Jsii::Type.check_type(@expose_headers, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "exposeHeaders") unless @expose_headers.nil? @max_age = max_age Jsii::Type.check_type(@max_age, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "maxAge") unless @max_age.nil? end |
Instance Attribute Details
#allow_credentials ⇒ Boolean? (readonly)
Default: false
Specifies whether credentials are included in the CORS request.
32 33 34 |
# File 'api_gatewayv2/cors_preflight_options.rb', line 32 def allow_credentials @allow_credentials end |
#allow_headers ⇒ Array<String>? (readonly)
Default: - No Headers are allowed.
Represents a collection of allowed headers.
37 38 39 |
# File 'api_gatewayv2/cors_preflight_options.rb', line 37 def allow_headers @allow_headers end |
#allow_methods ⇒ Array<AWSCDK::APIGatewayv2::CorsHttpMethod>? (readonly)
Default: - No Methods are allowed.
Represents a collection of allowed HTTP methods.
42 43 44 |
# File 'api_gatewayv2/cors_preflight_options.rb', line 42 def allow_methods @allow_methods end |
#allow_origins ⇒ Array<String>? (readonly)
Default: - No Origins are allowed.
Represents a collection of allowed origins.
47 48 49 |
# File 'api_gatewayv2/cors_preflight_options.rb', line 47 def allow_origins @allow_origins end |
#expose_headers ⇒ Array<String>? (readonly)
Default: - No Expose Headers are allowed.
Represents a collection of exposed headers.
52 53 54 |
# File 'api_gatewayv2/cors_preflight_options.rb', line 52 def expose_headers @expose_headers end |
#max_age ⇒ AWSCDK::Duration? (readonly)
Default: Duration.seconds(0)
The duration that the browser should cache preflight request results.
57 58 59 |
# File 'api_gatewayv2/cors_preflight_options.rb', line 57 def max_age @max_age end |
Class Method Details
.jsii_properties ⇒ Object
59 60 61 62 63 64 65 66 67 68 |
# File 'api_gatewayv2/cors_preflight_options.rb', line 59 def self.jsii_properties { :allow_credentials => "allowCredentials", :allow_headers => "allowHeaders", :allow_methods => "allowMethods", :allow_origins => "allowOrigins", :expose_headers => "exposeHeaders", :max_age => "maxAge", } end |
Instance Method Details
#to_jsii ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'api_gatewayv2/cors_preflight_options.rb', line 70 def to_jsii result = {} result.merge!({ "allowCredentials" => @allow_credentials, "allowHeaders" => @allow_headers, "allowMethods" => @allow_methods, "allowOrigins" => @allow_origins, "exposeHeaders" => @expose_headers, "maxAge" => @max_age, }) result.compact end |