Class: AWSCDK::EventsTargets::APIGateway

Inherits:
Jsii::Object
  • Object
show all
Includes:
AWSCDK::Events::IRuleTarget
Defined in:
events_targets/api_gateway.rb

Overview

Use an API Gateway REST APIs as a target for Amazon EventBridge rules.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rest_api, props = nil) ⇒ APIGateway

Returns a new instance of APIGateway.

Parameters:



11
12
13
14
15
16
# File 'events_targets/api_gateway.rb', line 11

def initialize(rest_api, props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::EventsTargets::APIGatewayProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(rest_api, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5JUmVzdEFwaSJ9")), "restApi")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzX3RhcmdldHMuQXBpR2F0ZXdheVByb3BzIn0=")), "props") unless props.nil?
  Jsii::Object.instance_method(:initialize).bind(self).call(rest_api, props)
end

Class Method Details

.jsii_overridable_methodsObject



18
19
20
21
22
23
24
# File 'events_targets/api_gateway.rb', line 18

def self.jsii_overridable_methods
  {
    :i_rest_api => { kind: :property, name: "iRestApi", is_optional: false },
    :rest_api => { kind: :property, name: "restApi", is_optional: false },
    :bind => { kind: :method, name: "bind", is_optional: false },
  }
end

Instance Method Details

#bind(rule, _id = nil) ⇒ AWSCDK::Events::RuleTargetConfig

Returns a RuleTarget that can be used to trigger this API Gateway REST APIs as a result from an EventBridge event.



45
46
47
48
49
# File 'events_targets/api_gateway.rb', line 45

def bind(rule, _id = nil)
  Jsii::Type.check_type(rule, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19ldmVudHMuSVJ1bGVSZWYifQ==")), "rule")
  Jsii::Type.check_type(_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "_id") unless _id.nil?
  jsii_call_method("bind", [rule, _id])
end

#i_rest_apiAWSCDK::APIGateway::IRestAPI

Returns the target IRestApi.



29
30
31
# File 'events_targets/api_gateway.rb', line 29

def i_rest_api()
  jsii_get_property("iRestApi")
end

#rest_apiAWSCDK::APIGateway::RestAPI

Deprecated.

Use the iRestApi getter instead



35
36
37
# File 'events_targets/api_gateway.rb', line 35

def rest_api()
  jsii_get_property("restApi")
end