Class: AWSCDK::APIGateway::MethodProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
api_gateway/method_props.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_method:, resource:, integration: nil, options: nil) ⇒ MethodProps

Returns a new instance of MethodProps.

Parameters:



10
11
12
13
14
15
16
17
18
19
# File 'api_gateway/method_props.rb', line 10

def initialize(http_method:, resource:, integration: nil, options: nil)
  @http_method = http_method
  Jsii::Type.check_type(@http_method, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "httpMethod")
  @resource = resource
  Jsii::Type.check_type(@resource, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5JUmVzb3VyY2UifQ==")), "resource")
  @integration = integration
  Jsii::Type.check_type(@integration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5JbnRlZ3JhdGlvbiJ9")), "integration") unless @integration.nil?
  @options = options.is_a?(Hash) ? ::AWSCDK::APIGateway::MethodOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(@options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5NZXRob2RPcHRpb25zIn0=")), "options") unless @options.nil?
end

Instance Attribute Details

#http_methodString (readonly)

The HTTP method ("GET", "POST", "PUT", ...) that clients use to call this method.

Returns:

  • (String)


24
25
26
# File 'api_gateway/method_props.rb', line 24

def http_method
  @http_method
end

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

Note:

Default: - a new MockIntegration.

The backend system that the method calls when it receives a request.



36
37
38
# File 'api_gateway/method_props.rb', line 36

def integration
  @integration
end

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

Note:

Default: - No options.

Method options.



41
42
43
# File 'api_gateway/method_props.rb', line 41

def options
  @options
end

#resourceAWSCDK::APIGateway::IResource (readonly)

The resource this method is associated with.

For root resource methods, specify the RestApi object.



31
32
33
# File 'api_gateway/method_props.rb', line 31

def resource
  @resource
end

Class Method Details

.jsii_propertiesObject



43
44
45
46
47
48
49
50
# File 'api_gateway/method_props.rb', line 43

def self.jsii_properties
  {
    :http_method => "httpMethod",
    :resource => "resource",
    :integration => "integration",
    :options => "options",
  }
end

Instance Method Details

#to_jsiiObject



52
53
54
55
56
57
58
59
60
61
# File 'api_gateway/method_props.rb', line 52

def to_jsii
  result = {}
  result.merge!({
    "httpMethod" => @http_method,
    "resource" => @resource,
    "integration" => @integration,
    "options" => @options,
  })
  result.compact
end