Class: Sentdm::Models::TemplateEvent

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/sentdm/models/template_event.rb,
sig/sentdm/models/template_event.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(event: nil, field: nil, payload: nil, timestamp: nil) ⇒ Object

Some parameter documentations has been truncated, see Sentdm::Models::TemplateEvent for more details.

The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares this shape and varies only in Payload.

Parameters:

  • event (String, nil) (defaults to: nil)

    The specific event within the family, for example message.delivered or

  • field (String) (defaults to: nil)

    The event family, for example message or templates. Route on this first, then

  • payload (Sentdm::Models::TemplateEventPayload, nil) (defaults to: nil)

    Body of a template status event. Delivered when a template's review outcome chan

  • timestamp (String) (defaults to: nil)

    When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission



# File 'lib/sentdm/models/template_event.rb', line 36

Instance Attribute Details

#eventString?

The specific event within the family, for example message.delivered or message.received. Absent on events that have no subtype, so treat it as optional.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


12
# File 'lib/sentdm/models/template_event.rb', line 12

optional :event, String, nil?: true

#fieldString?

The event family, for example message or templates. Route on this first, then on event for the specific change.

Parameters:

  • (String)

Returns:

  • (String, nil)


19
# File 'lib/sentdm/models/template_event.rb', line 19

optional :field, String

#payloadSentdm::Models::TemplateEventPayload?

Body of a template status event. Delivered when a template's review outcome changes, so you can react without polling.

Parameters:

Returns:



26
# File 'lib/sentdm/models/template_event.rb', line 26

optional :payload, -> { Sentdm::TemplateEventPayload }, nil?: true

#timestampString?

When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission time, not the time the underlying change happened. Use the timestamp inside the payload for the latter.

Parameters:

  • (String)

Returns:

  • (String, nil)


34
# File 'lib/sentdm/models/template_event.rb', line 34

optional :timestamp, String

Instance Method Details

#to_hash{

Returns:

  • ({)


31
# File 'sig/sentdm/models/template_event.rbs', line 31

def to_hash: -> {