Class: Courier::Models::NotificationTemplateContent

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/courier/models/notification_template_content.rb,
sig/courier/models/notification_template_content.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(elements:, version:) ⇒ NotificationTemplateContent

Elemental content of a notification template. Template variables read the data sent with the message through the data. prefix, as in {{data.name}}, and the recipient's profile through profile..



# File 'lib/courier/models/notification_template_content.rb', line 17

Instance Attribute Details

#elements ⇒ Array<Courier::Models::ElementalTextNodeWithType, Courier::Models::ElementalMetaNodeWithType, Courier::Models::ElementalChannelNodeWithType, Courier::Models::ElementalImageNodeWithType, Courier::Models::ElementalActionNodeWithType, Courier::Models::ElementalDividerNodeWithType, Courier::Models::ElementalQuoteNodeWithType, Courier::Models::ElementalHTMLNodeWithType>



9
# File 'lib/courier/models/notification_template_content.rb', line 9

required :elements, -> { Courier::Internal::Type::ArrayOf[union: Courier::ElementalNode] }

#version ⇒ String

For example, "2022-01-01"

Parameters:

  • value (String)

Returns:

  • (String)


15
# File 'lib/courier/models/notification_template_content.rb', line 15

required :version, String

Instance Method Details

#to_hash ⇒ { elements: ::Array[Courier::Models::elemental_node], version: String }

Returns:

  • ({ elements: ::Array[Courier::Models::elemental_node], version: String })


16
17
18
19
# File 'sig/courier/models/notification_template_content.rbs', line 16

def to_hash: -> {
  elements: ::Array[Courier::Models::elemental_node],
  version: String
}