Class: Courier::Models::ElementalActionNode

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

Direct Known Subclasses

ElementalActionNodeWithType

Defined Under Namespace

Modules: Style

Instance Attribute Summary collapse

Attributes inherited from ElementalBaseNode

#channels, #if_, #loop_, #ref

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(content:, href:, action_id: nil, align: nil, background_color: nil, border_radius: nil, border_size: nil, disable_tracking: nil, font_size: nil, locales: nil, padding: nil, style: nil) ⇒ Object

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

Allows the user to execute an action. Can be a button or a link.

Parameters:

  • content (String)

    The text content of the action shown to the user.

  • href (String)

    The target URL of the action.

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

    A unique id used to identify the action when it is executed.

  • align (Symbol, Courier::Models::Alignment, nil) (defaults to: nil)

    The alignment of the action button. Defaults to "center".

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

    The background color of the action button.

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

    CSS border-radius applied to the action button. For example, 4px

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

    CSS border width applied to the action button. For example, 1px

  • disable_tracking (Boolean, nil) (defaults to: nil)

    When true, the action's href is not rewritten for click-through tracking, even w

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

    CSS font-size applied to the action button label. For example, 14px

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

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

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

    CSS padding applied to the action button. For example, 8px 16px

  • style (Symbol, Courier::Models::ElementalActionNode::Style, nil) (defaults to: nil)

    Defaults to button.



# File 'lib/courier/models/elemental_action_node.rb', line 81

Instance Attribute Details

#action_idString?

A unique id used to identify the action when it is executed.

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


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

optional :action_id, String, nil?: true

#alignSymbol, ...

The alignment of the action button. Defaults to "center".

Parameters:

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

Returns:



28
# File 'lib/courier/models/elemental_action_node.rb', line 28

optional :align, enum: -> { Courier::Alignment }, nil?: true

#background_colorString?

The background color of the action button.

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


34
# File 'lib/courier/models/elemental_action_node.rb', line 34

optional :background_color, String, nil?: true

#border_radiusString?

CSS border-radius applied to the action button. For example, 4px

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


40
# File 'lib/courier/models/elemental_action_node.rb', line 40

optional :border_radius, String, nil?: true

#border_sizeString?

CSS border width applied to the action button. For example, 1px

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


46
# File 'lib/courier/models/elemental_action_node.rb', line 46

optional :border_size, String, nil?: true

#contentString

The text content of the action shown to the user.

Parameters:

  • _ (String)

Returns:

  • (String)


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

required :content, String

#disable_trackingBoolean?

When true, the action's href is not rewritten for click-through tracking, even when click-through tracking is enabled for the workspace.

Parameters:

  • _ (Boolean, nil)

Returns:

  • (Boolean, nil)


53
# File 'lib/courier/models/elemental_action_node.rb', line 53

optional :disable_tracking, Courier::Internal::Type::Boolean, nil?: true

#font_sizeString?

CSS font-size applied to the action button label. For example, 14px

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


59
# File 'lib/courier/models/elemental_action_node.rb', line 59

optional :font_size, String, nil?: true

#hrefString

The target URL of the action.

Parameters:

  • _ (String)

Returns:

  • (String)


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

required :href, String

#localesHash{Symbol=>Courier::Models::LocaleItem}?

Region specific content. See locales docs for more details.

Parameters:

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

Returns:



67
# File 'lib/courier/models/elemental_action_node.rb', line 67

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

#paddingString?

CSS padding applied to the action button. For example, 8px 16px

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


73
# File 'lib/courier/models/elemental_action_node.rb', line 73

optional :padding, String, nil?: true

#styleSymbol, ...

Defaults to button.



79
# File 'lib/courier/models/elemental_action_node.rb', line 79

optional :style, enum: -> { Courier::ElementalActionNode::Style }, nil?: true

Instance Method Details

#to_hash{

Returns:

  • ({)


85
# File 'sig/courier/models/elemental_action_node.rbs', line 85

def to_hash: -> {