Class: AWSCDK::SchedulerTargets::EventBridgePutEventsEntry

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
scheduler_targets/event_bridge_put_events_entry.rb

Overview

An entry to be sent to EventBridge.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(detail:, detail_type:, event_bus:, source:) ⇒ EventBridgePutEventsEntry

Returns a new instance of EventBridgePutEventsEntry.

Parameters:

  • detail (AWSCDK::Scheduler::ScheduleTargetInput)

    The event body.

  • detail_type (String)

    Used along with the source field to help identify the fields and values expected in the detail field.

  • event_bus (AWSCDK::Events::IEventBus)

    The event bus the entry will be sent to.

  • source (String)

    The service or application that caused this event to be generated.



13
14
15
16
17
18
19
20
21
22
# File 'scheduler_targets/event_bridge_put_events_entry.rb', line 13

def initialize(detail:, detail_type:, event_bus:, source:)
  @detail = detail
  Jsii::Type.check_type(@detail, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2NoZWR1bGVyLlNjaGVkdWxlVGFyZ2V0SW5wdXQifQ==")), "detail")
  @detail_type = detail_type
  Jsii::Type.check_type(@detail_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "detailType")
  @event_bus = event_bus
  Jsii::Type.check_type(@event_bus, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLklFdmVudEJ1cyJ9")), "eventBus")
  @source = source
  Jsii::Type.check_type(@source, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "source")
end

Instance Attribute Details

#detailAWSCDK::Scheduler::ScheduleTargetInput (readonly)

The event body.

Can either be provided as an object or as a JSON-serialized string

Examples:

AWSCDK::Scheduler::ScheduleTargetInput.from_text("{\"instance-id\": \"i-1234567890abcdef0\", \"state\": \"terminated\"}")
AWSCDK::Scheduler::ScheduleTargetInput.from_object({Message: "Hello from a friendly event :)"})

Returns:



32
33
34
# File 'scheduler_targets/event_bridge_put_events_entry.rb', line 32

def detail
  @detail
end

#detail_typeString (readonly)

Used along with the source field to help identify the fields and values expected in the detail field.

For example, events by CloudTrail have detail type "AWS API Call via CloudTrail"



39
40
41
# File 'scheduler_targets/event_bridge_put_events_entry.rb', line 39

def detail_type
  @detail_type
end

#event_busAWSCDK::Events::IEventBus (readonly)

The event bus the entry will be sent to.



43
44
45
# File 'scheduler_targets/event_bridge_put_events_entry.rb', line 43

def event_bus
  @event_bus
end

#sourceString (readonly)

The service or application that caused this event to be generated.

Example value: com.example.service



50
51
52
# File 'scheduler_targets/event_bridge_put_events_entry.rb', line 50

def source
  @source
end

Class Method Details

.jsii_propertiesObject



52
53
54
55
56
57
58
59
# File 'scheduler_targets/event_bridge_put_events_entry.rb', line 52

def self.jsii_properties
  {
    :detail => "detail",
    :detail_type => "detailType",
    :event_bus => "eventBus",
    :source => "source",
  }
end

Instance Method Details

#to_jsiiObject



61
62
63
64
65
66
67
68
69
70
# File 'scheduler_targets/event_bridge_put_events_entry.rb', line 61

def to_jsii
  result = {}
  result.merge!({
    "detail" => @detail,
    "detailType" => @detail_type,
    "eventBus" => @event_bus,
    "source" => @source,
  })
  result.compact
end