Class: Zavudev::Models::MessageContent::Button

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/zavudev/models/message_content.rb

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: nil, contacts: nil, emoji: nil, filename: nil, latitude: nil, list_button: nil, location_address: nil, location_name: nil, longitude: nil, media_id: nil, media_url: nil, mime_type: nil, react_to_message_id: nil, sections: nil, template_id: nil, template_variables: nil) ⇒ Object

Content for non-text message types (WhatsApp and Telegram).

Parameters:

  • buttons (Array<Zavudev::Models::MessageContent::Button>) (defaults to: nil)

    Interactive buttons (max 3).

  • contacts (Array<Zavudev::Models::MessageContent::Contact>) (defaults to: nil)

    Contact cards for contact messages.

  • emoji (String) (defaults to: nil)

    Emoji for reaction messages.

  • filename (String) (defaults to: nil)

    Filename for documents.

  • latitude (Float) (defaults to: nil)

    Latitude for location messages.

  • list_button (String) (defaults to: nil)

    Button text for list messages.

  • location_address (String) (defaults to: nil)

    Address of the location.

  • location_name (String) (defaults to: nil)

    Name of the location.

  • longitude (Float) (defaults to: nil)

    Longitude for location messages.

  • media_id (String) (defaults to: nil)

    WhatsApp media ID if already uploaded.

  • media_url (String) (defaults to: nil)

    URL of the media file (for image, video, audio, document, sticker).

  • mime_type (String) (defaults to: nil)

    MIME type of the media.

  • react_to_message_id (String) (defaults to: nil)

    Message ID to react to.

  • sections (Array<Zavudev::Models::MessageContent::Section>) (defaults to: nil)

    Sections for list messages.

  • template_id (String) (defaults to: nil)

    Template ID for template messages.

  • template_variables (Hash{Symbol=>String}) (defaults to: nil)

    Variables for template rendering. Keys are variable positions (1, 2, 3…).



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/zavudev/models/message_content.rb', line 137

class Button < Zavudev::Internal::Type::BaseModel
  # @!attribute id
  #
  #   @return [String]
  required :id, String

  # @!attribute title
  #
  #   @return [String]
  required :title, String

  # @!method initialize(id:, title:)
  #   @param id [String]
  #   @param title [String]
end

Instance Attribute Details

#idString

Returns:

  • (String)


141
# File 'lib/zavudev/models/message_content.rb', line 141

required :id, String

#titleString

Returns:

  • (String)


146
# File 'lib/zavudev/models/message_content.rb', line 146

required :title, String