Class: Knockapi::Models::MessageInAppFeedButtonSetBlock::Button

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/knockapi/models/message_in_app_feed_button_set_block.rb,
sig/knockapi/models/message_in_app_feed_button_set_block.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(buttons:, name:, type:) ⇒ Button

A button set block in a message in an app feed.

Parameters:



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/knockapi/models/message_in_app_feed_button_set_block.rb', line 34

class Button < Knockapi::Internal::Type::BaseModel
  # @!attribute action
  #   The action to take when the button is clicked.
  #
  #   @return [String]
  required :action, String

  # @!attribute label
  #   The label of the button.
  #
  #   @return [String]
  required :label, String

  # @!attribute name
  #   The name of the button.
  #
  #   @return [String]
  required :name, String

  # @!method initialize(action:, label:, name:)
  #   A button in an in app feed message.
  #
  #   @param action [String] The action to take when the button is clicked.
  #
  #   @param label [String] The label of the button.
  #
  #   @param name [String] The name of the button.
end

Instance Attribute Details

#action ⇒ String

The action to take when the button is clicked.

Parameters:

  • value (String)

Returns:

  • (String)


39
# File 'lib/knockapi/models/message_in_app_feed_button_set_block.rb', line 39

required :action, String

#label ⇒ String

The label of the button.

Parameters:

  • value (String)

Returns:

  • (String)


45
# File 'lib/knockapi/models/message_in_app_feed_button_set_block.rb', line 45

required :label, String

#name ⇒ String

The name of the button.

Parameters:

  • value (String)

Returns:

  • (String)


51
# File 'lib/knockapi/models/message_in_app_feed_button_set_block.rb', line 51

required :name, String

Instance Method Details

#to_hash ⇒ { action: String, label: String, name: String }

Returns:

  • ({ action: String, label: String, name: String })


40
# File 'sig/knockapi/models/message_in_app_feed_button_set_block.rbs', line 40

def to_hash: -> { action: String, label: String, name: String }