Class: Courier::Models::ElementalTextNode

Inherits:
ElementalBaseNode show all
Defined in:
lib/courier/models/elemental_text_node.rb,
sig/courier/models/elemental_text_node.rbs

Defined Under Namespace

Modules: Align, Format

Instance Attribute Summary collapse

Attributes inherited from ElementalBaseNode

#channels, #if_, #loop_, #ref

Class Method 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(align: nil, bold: nil, color: nil, content: nil, font_size: nil, format_: nil, italic: nil, line_height: nil, locales: nil, strikethrough: nil, text_style: nil, underline: nil) ⇒ ElementalTextNode

Some parameter documentations has been truncated, see Courier::Models::ElementalTextNode for more details.

Represents a body of text to be rendered inside of the notification.

Parameters:

  • align (Symbol, Courier::Models::ElementalTextNode::Align) (defaults to: nil) —

    Text alignment.

  • bold (String, nil) (defaults to: nil) —

    Apply bold to the text

  • color (String, nil) (defaults to: nil) —

    Specifies the color of text. Can be any valid css color value

  • content (String) (defaults to: nil) —

    The text content displayed in the notification. Either this

  • font_size (String, nil) (defaults to: nil) —

    CSS px font size for this text block, e.g. 16px. Overrides the size of the `te

  • format_ (Symbol, Courier::Models::ElementalTextNode::Format, nil) (defaults to: nil)
  • italic (String, nil) (defaults to: nil) —

    Apply italics to the text

  • line_height (String, nil) (defaults to: nil) —

    CSS line height for this text block, as a px value or a unitless multiplier, e.g

  • locales (Hash{Symbol=>Courier::Models::LocaleItem}, nil) (defaults to: nil) —

    Region specific content. See [locales docs](https://www.courier.com/docs/platfor

  • strikethrough (String, nil) (defaults to: nil) —

    Apply a strike through the text

  • text_style (Symbol, Courier::Models::TextStyle, nil) (defaults to: nil) —

    Allows the text to be rendered as a heading level.

  • underline (String, nil) (defaults to: nil) —

    Apply an underline to the text

  • align: (Courier::Models::ElementalTextNode::align) (defaults to: nil)
  • bold: (String, nil) (defaults to: nil)
  • color: (String, nil) (defaults to: nil)
  • content: (String) (defaults to: nil)
  • font_size: (String, nil) (defaults to: nil)
  • format_: (Courier::Models::ElementalTextNode::format_, nil) (defaults to: nil)
  • italic: (String, nil) (defaults to: nil)
  • line_height: (String, nil) (defaults to: nil)
  • locales: (Courier::Models::locales, nil) (defaults to: nil)
  • strikethrough: (String, nil) (defaults to: nil)
  • text_style: (Courier::Models::text_style, nil) (defaults to: nil)
  • underline: (String, nil) (defaults to: nil)


# File 'lib/courier/models/elemental_text_node.rb', line 82

Instance Attribute Details

#align ⇒ Symbol, ...

Text alignment.

Parameters:

  • _ (Courier::Models::ElementalTextNode::align)

Returns:



10
# File 'lib/courier/models/elemental_text_node.rb', line 10

optional :align, enum: -> { Courier::ElementalTextNode::Align }

#bold ⇒ String?

Apply bold to the text

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


16
# File 'lib/courier/models/elemental_text_node.rb', line 16

optional :bold, String, nil?: true

#color ⇒ String?

Specifies the color of text. Can be any valid css color value

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


22
# File 'lib/courier/models/elemental_text_node.rb', line 22

optional :color, String, nil?: true

#content ⇒ String?

The text content displayed in the notification. Either this field must be specified, or the elements field

Parameters:

  • _ (String)

Returns:

  • (String, nil)


29
# File 'lib/courier/models/elemental_text_node.rb', line 29

optional :content, String

#font_size ⇒ String?

CSS px font size for this text block, e.g. 16px. Overrides the size of the text_style preset. Email only.

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


36
# File 'lib/courier/models/elemental_text_node.rb', line 36

optional :font_size, String, nil?: true

#format_ ⇒ Symbol, ...

Parameters:

  • _ (Courier::Models::ElementalTextNode::format_, nil)

Returns:



41
# File 'lib/courier/models/elemental_text_node.rb', line 41

optional :format_, enum: -> { Courier::ElementalTextNode::Format }, api_name: :format, nil?: true

#italic ⇒ String?

Apply italics to the text

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


47
# File 'lib/courier/models/elemental_text_node.rb', line 47

optional :italic, String, nil?: true

#line_height ⇒ String?

CSS line height for this text block, as a px value or a unitless multiplier, e.g. 24px or 1.5. Email only.

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


54
# File 'lib/courier/models/elemental_text_node.rb', line 54

optional :line_height, String, nil?: true

#locales ⇒ Hash{Symbol=>Courier::Models::LocaleItem}?

Region specific content. See locales docs for more details.

Parameters:

  • _ (Courier::Models::locales, nil)

Returns:



62
# File 'lib/courier/models/elemental_text_node.rb', line 62

optional :locales, -> { Courier::Internal::Type::HashOf[Courier::LocaleItem] }, nil?: true

#strikethrough ⇒ String?

Apply a strike through the text

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


68
# File 'lib/courier/models/elemental_text_node.rb', line 68

optional :strikethrough, String, nil?: true

#text_style ⇒ Symbol, ...

Allows the text to be rendered as a heading level.

Parameters:

  • _ (Courier::Models::text_style, nil)

Returns:



74
# File 'lib/courier/models/elemental_text_node.rb', line 74

optional :text_style, enum: -> { Courier::TextStyle }, nil?: true

#underline ⇒ String?

Apply an underline to the text

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


80
# File 'lib/courier/models/elemental_text_node.rb', line 80

optional :underline, String, nil?: true

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/courier/models/elemental_text_node.rb', line 120

Instance Method Details

#to_hash ⇒ { align: Courier::Models::ElementalTextNode::align, bold: String?, color: String?, content: String, font_size: String?, format_: Courier::Models::ElementalTextNode::format_?, italic: String?, line_height: String?, locales: Courier::Models::locales?, strikethrough: String?, text_style: Courier::Models::text_style?, underline: String? }

Returns:

  • ({ align: Courier::Models::ElementalTextNode::align, bold: String?, color: String?, content: String, font_size: String?, format_: Courier::Models::ElementalTextNode::format_?, italic: String?, line_height: String?, locales: Courier::Models::locales?, strikethrough: String?, text_style: Courier::Models::text_style?, underline: String? })


89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'sig/courier/models/elemental_text_node.rbs', line 89

def to_hash: -> {
  align: Courier::Models::ElementalTextNode::align,
  bold: String?,
  color: String?,
  content: String,
  font_size: String?,
  format_: Courier::Models::ElementalTextNode::format_?,
  italic: String?,
  line_height: String?,
  locales: Courier::Models::locales?,
  strikethrough: String?,
  text_style: Courier::Models::text_style?,
  underline: String?
}