Class: AWSCDK::APIGateway::ProxyResourceProps

Inherits:
ProxyResourceOptions
  • Object
show all
Defined in:
api_gateway/proxy_resource_props.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(default_cors_preflight_options: nil, default_integration: nil, default_method_options: nil, any_method: nil, parent:) ⇒ ProxyResourceProps

Returns a new instance of ProxyResourceProps.

Parameters:

  • default_cors_preflight_options (AWSCDK::APIGateway::CorsOptions, nil) (defaults to: nil)

    Adds a CORS preflight OPTIONS method to this resource and all child resources.

  • default_integration (AWSCDK::APIGateway::Integration, nil) (defaults to: nil)

    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, nil) (defaults to: nil)

    Method options to use as a default for all methods created within this API unless custom options are specified.

  • any_method (Boolean, nil) (defaults to: nil)

    Adds an "ANY" method to this resource.

  • parent (AWSCDK::APIGateway::IResource)

    The parent resource of this resource.



11
12
13
14
15
16
17
18
19
20
21
22
# File 'api_gateway/proxy_resource_props.rb', line 11

def initialize(default_cors_preflight_options: nil, default_integration: nil, default_method_options: nil, any_method: nil, parent:)
  @default_cors_preflight_options = default_cors_preflight_options.is_a?(Hash) ? ::AWSCDK::APIGateway::CorsOptions.new(**default_cors_preflight_options.transform_keys(&:to_sym)) : default_cors_preflight_options
  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 = default_method_options.is_a?(Hash) ? ::AWSCDK::APIGateway::MethodOptions.new(**default_method_options.transform_keys(&:to_sym)) : default_method_options
  Jsii::Type.check_type(@default_method_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5NZXRob2RPcHRpb25zIn0=")), "defaultMethodOptions") unless @default_method_options.nil?
  @any_method = any_method
  Jsii::Type.check_type(@any_method, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "anyMethod") unless @any_method.nil?
  @parent = parent
  Jsii::Type.check_type(@parent, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5JUmVzb3VyY2UifQ==")), "parent")
end

Instance Attribute Details

#any_methodBoolean? (readonly)

Note:

Default: true

Adds an "ANY" method to this resource.

If set to false, you will have to explicitly add methods to this resource after it's created.

Returns:

  • (Boolean, nil)


48
49
50
# File 'api_gateway/proxy_resource_props.rb', line 48

def any_method
  @any_method
end

#default_cors_preflight_optionsAWSCDK::APIGateway::CorsOptions? (readonly)

Note:

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/proxy_resource_props.rb', line 30

def default_cors_preflight_options
  @default_cors_preflight_options
end

#default_integrationAWSCDK::APIGateway::Integration? (readonly)

Note:

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/proxy_resource_props.rb', line 35

def default_integration
  @default_integration
end

#default_method_optionsAWSCDK::APIGateway::MethodOptions? (readonly)

Note:

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/proxy_resource_props.rb', line 40

def default_method_options
  @default_method_options
end

#parentAWSCDK::APIGateway::IResource (readonly)

The parent resource of this resource.

You can either pass another Resource object or a RestApi object here.



55
56
57
# File 'api_gateway/proxy_resource_props.rb', line 55

def parent
  @parent
end

Class Method Details

.jsii_propertiesObject



57
58
59
60
61
62
63
64
65
# File 'api_gateway/proxy_resource_props.rb', line 57

def self.jsii_properties
  {
    :default_cors_preflight_options => "defaultCorsPreflightOptions",
    :default_integration => "defaultIntegration",
    :default_method_options => "defaultMethodOptions",
    :any_method => "anyMethod",
    :parent => "parent",
  }
end

Instance Method Details

#to_jsiiObject



67
68
69
70
71
72
73
74
75
76
77
78
# File 'api_gateway/proxy_resource_props.rb', line 67

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "defaultCorsPreflightOptions" => @default_cors_preflight_options,
    "defaultIntegration" => @default_integration,
    "defaultMethodOptions" => @default_method_options,
    "anyMethod" => @any_method,
    "parent" => @parent,
  })
  result.compact
end