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, cta_display_text: nil, cta_header_media_url: nil, cta_header_text: nil, cta_header_type: nil, cta_url: nil, emoji: nil, filename: nil, footer_text: 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_button_variables: nil, template_id: nil, template_variables: nil) ⇒ Object

Some parameter documentations has been truncated, see Zavudev::Models::MessageContent for more details.

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.

  • cta_display_text (String) (defaults to: nil)

    Button label for cta_url messages.

  • cta_header_media_url (String) (defaults to: nil)

    Public HTTPS URL of the header media when ctaHeaderType is ‘image’, ‘video’, or

  • cta_header_text (String) (defaults to: nil)

    Header text when ctaHeaderType is ‘text’.

  • cta_header_type (Symbol, Zavudev::Models::MessageContent::CtaHeaderType) (defaults to: nil)

    Optional header type for cta_url messages.

  • cta_url (String) (defaults to: nil)

    Destination URL opened in the device’s default browser when the button is tapped

  • emoji (String) (defaults to: nil)

    Emoji for reaction messages.

  • filename (String) (defaults to: nil)

    Filename for documents.

  • footer_text (String) (defaults to: nil)

    Optional footer text for cta_url messages.

  • 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_button_variables (Hash{Symbol=>String}) (defaults to: nil)

    Variables for dynamic button placeholders (URL buttons and OTP buttons). Keys ar

  • template_id (String) (defaults to: nil)

    Template ID for template messages.

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

    Variables for body placeholders. Keys are positions (1, 2, 3, …) matching the



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/zavudev/models/message_content.rb', line 215

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)


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

required :id, String

#titleString

Returns:

  • (String)


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

required :title, String