Class: AWSCDK::APIGateway::ResourceProps
- Inherits:
-
ResourceOptions
- Object
- ResourceOptions
- AWSCDK::APIGateway::ResourceProps
- Defined in:
- api_gateway/resource_props.rb
Instance Attribute Summary collapse
-
#default_cors_preflight_options ⇒ AWSCDK::APIGateway::CorsOptions?
readonly
Adds a CORS preflight OPTIONS method to this resource and all child resources.
-
#default_integration ⇒ AWSCDK::APIGateway::Integration?
readonly
An integration to use as a default for all methods created within this API unless an integration is specified.
-
#default_method_options ⇒ AWSCDK::APIGateway::MethodOptions?
readonly
Method options to use as a default for all methods created within this API unless custom options are specified.
-
#parent ⇒ AWSCDK::APIGateway::IResource
readonly
The parent resource of this resource.
-
#path_part ⇒ String
readonly
A path name for the resource.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(default_cors_preflight_options: nil, default_integration: nil, default_method_options: nil, parent:, path_part:) ⇒ ResourceProps
constructor
A new instance of ResourceProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(default_cors_preflight_options: nil, default_integration: nil, default_method_options: nil, parent:, path_part:) ⇒ ResourceProps
Returns a new instance of ResourceProps.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'api_gateway/resource_props.rb', line 11 def initialize(default_cors_preflight_options: nil, default_integration: nil, default_method_options: nil, parent:, path_part:) @default_cors_preflight_options = .is_a?(Hash) ? ::AWSCDK::APIGateway::CorsOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(@default_cors_preflight_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5Db3JzT3B0aW9ucyJ9")), "defaultCorsPreflightOptions") unless @default_cors_preflight_options.nil? @default_integration = default_integration Jsii::Type.check_type(@default_integration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5JbnRlZ3JhdGlvbiJ9")), "defaultIntegration") unless @default_integration.nil? @default_method_options = .is_a?(Hash) ? ::AWSCDK::APIGateway::MethodOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(@default_method_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5NZXRob2RPcHRpb25zIn0=")), "defaultMethodOptions") unless @default_method_options.nil? @parent = parent Jsii::Type.check_type(@parent, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5JUmVzb3VyY2UifQ==")), "parent") @path_part = path_part Jsii::Type.check_type(@path_part, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "pathPart") end |
Instance Attribute Details
#default_cors_preflight_options ⇒ AWSCDK::APIGateway::CorsOptions? (readonly)
Default: - CORS is disabled
Adds a CORS preflight OPTIONS method to this resource and all child resources.
You can add CORS at the resource-level using add_cors_preflight.
30 31 32 |
# File 'api_gateway/resource_props.rb', line 30 def @default_cors_preflight_options end |
#default_integration ⇒ AWSCDK::APIGateway::Integration? (readonly)
Default: - Inherited from parent.
An integration to use as a default for all methods created within this API unless an integration is specified.
35 36 37 |
# File 'api_gateway/resource_props.rb', line 35 def default_integration @default_integration end |
#default_method_options ⇒ AWSCDK::APIGateway::MethodOptions? (readonly)
Default: - Inherited from parent.
Method options to use as a default for all methods created within this API unless custom options are specified.
40 41 42 |
# File 'api_gateway/resource_props.rb', line 40 def @default_method_options end |
#parent ⇒ AWSCDK::APIGateway::IResource (readonly)
The parent resource of this resource.
You can either pass another
Resource object or a RestApi object here.
47 48 49 |
# File 'api_gateway/resource_props.rb', line 47 def parent @parent end |
#path_part ⇒ String (readonly)
A path name for the resource.
51 52 53 |
# File 'api_gateway/resource_props.rb', line 51 def path_part @path_part end |
Class Method Details
.jsii_properties ⇒ Object
53 54 55 56 57 58 59 60 61 |
# File 'api_gateway/resource_props.rb', line 53 def self.jsii_properties { :default_cors_preflight_options => "defaultCorsPreflightOptions", :default_integration => "defaultIntegration", :default_method_options => "defaultMethodOptions", :parent => "parent", :path_part => "pathPart", } end |
Instance Method Details
#to_jsii ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'api_gateway/resource_props.rb', line 63 def to_jsii result = {} result.merge!(super) result.merge!({ "defaultCorsPreflightOptions" => @default_cors_preflight_options, "defaultIntegration" => @default_integration, "defaultMethodOptions" => @default_method_options, "parent" => @parent, "pathPart" => @path_part, }) result.compact end |