Class: AWSCDK::EventsTargets::AWSAPI

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

Overview

Use an AWS Lambda function that makes API calls as an event rule target.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(props) ⇒ AWSAPI

Returns a new instance of AWSAPI.



10
11
12
13
14
# File 'events_targets/awsapi.rb', line 10

def initialize(props)
  props = props.is_a?(Hash) ? ::AWSCDK::EventsTargets::AWSAPIProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzX3RhcmdldHMuQXdzQXBpUHJvcHMifQ==")), "props")
  Jsii::Object.instance_method(:initialize).bind(self).call(props)
end

Class Method Details

.jsii_overridable_methodsObject



16
17
18
19
20
# File 'events_targets/awsapi.rb', line 16

def self.jsii_overridable_methods
  {
    :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 AwsApi as a result from an EventBridge event.

Parameters:

Returns:



27
28
29
30
31
# File 'events_targets/awsapi.rb', line 27

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