Class: Zavudev::Models::MessageContent
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Zavudev::Models::MessageContent
- Defined in:
- lib/zavudev/models/message_content.rb
Defined Under Namespace
Modules: CtaHeaderType Classes: Button, Contact, Section
Instance Attribute Summary collapse
-
#buttons ⇒ Array<Zavudev::Models::MessageContent::Button>?
Interactive buttons (max 3).
-
#contacts ⇒ Array<Zavudev::Models::MessageContent::Contact>?
Contact cards for contact messages.
-
#cta_display_text ⇒ String?
Button label for cta_url messages.
-
#cta_header_media_url ⇒ String?
Public HTTPS URL of the header media when ctaHeaderType is ‘image’, ‘video’, or ‘document’.
-
#cta_header_text ⇒ String?
Header text when ctaHeaderType is ‘text’.
-
#cta_header_type ⇒ Symbol, ...
Optional header type for cta_url messages.
-
#cta_url ⇒ String?
Destination URL opened in the device’s default browser when the button is tapped.
-
#emoji ⇒ String?
Emoji for reaction messages.
-
#filename ⇒ String?
Filename for documents.
-
#footer_text ⇒ String?
Optional footer text for cta_url messages.
-
#latitude ⇒ Float?
Latitude for location messages.
-
#list_button ⇒ String?
Button text for list messages.
-
#location_address ⇒ String?
Address of the location.
-
#location_name ⇒ String?
Name of the location.
-
#longitude ⇒ Float?
Longitude for location messages.
-
#media_id ⇒ String?
WhatsApp media ID if already uploaded.
-
#media_url ⇒ String?
URL of the media file (for image, video, audio, document, sticker).
-
#mime_type ⇒ String?
MIME type of the media.
-
#react_to_message_id ⇒ String?
Message ID to react to.
-
#sections ⇒ Array<Zavudev::Models::MessageContent::Section>?
Sections for list messages.
-
#template_button_variables ⇒ Hash{Symbol=>String}?
Variables for dynamic button placeholders (URL buttons and OTP buttons).
-
#template_id ⇒ String?
Template ID for template messages.
-
#template_variables ⇒ Hash{Symbol=>String}?
Variables for body placeholders.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(name: nil, phones: nil) ⇒ Object constructor
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(name: nil, phones: nil) ⇒ Object
|
|
# File 'lib/zavudev/models/message_content.rb', line 226
|
Instance Attribute Details
#buttons ⇒ Array<Zavudev::Models::MessageContent::Button>?
Interactive buttons (max 3).
10 |
# File 'lib/zavudev/models/message_content.rb', line 10 optional :buttons, -> { Zavudev::Internal::Type::ArrayOf[Zavudev::MessageContent::Button] } |
#contacts ⇒ Array<Zavudev::Models::MessageContent::Contact>?
Contact cards for contact messages.
16 |
# File 'lib/zavudev/models/message_content.rb', line 16 optional :contacts, -> { Zavudev::Internal::Type::ArrayOf[Zavudev::MessageContent::Contact] } |
#cta_display_text ⇒ String?
Button label for cta_url messages.
22 |
# File 'lib/zavudev/models/message_content.rb', line 22 optional :cta_display_text, String, api_name: :ctaDisplayText |
#cta_header_media_url ⇒ String?
Public HTTPS URL of the header media when ctaHeaderType is ‘image’, ‘video’, or ‘document’. WhatsApp fetches this URL — it must be publicly reachable and return the declared content type.
30 |
# File 'lib/zavudev/models/message_content.rb', line 30 optional :cta_header_media_url, String, api_name: :ctaHeaderMediaUrl |
#cta_header_text ⇒ String?
Header text when ctaHeaderType is ‘text’.
36 |
# File 'lib/zavudev/models/message_content.rb', line 36 optional :cta_header_text, String, api_name: :ctaHeaderText |
#cta_header_type ⇒ Symbol, ...
Optional header type for cta_url messages.
42 |
# File 'lib/zavudev/models/message_content.rb', line 42 optional :cta_header_type, enum: -> { Zavudev::MessageContent::CtaHeaderType }, api_name: :ctaHeaderType |
#cta_url ⇒ String?
Destination URL opened in the device’s default browser when the button is tapped. Used with messageType=cta_url. WhatsApp requires HTTPS in production.
49 |
# File 'lib/zavudev/models/message_content.rb', line 49 optional :cta_url, String, api_name: :ctaUrl |
#emoji ⇒ String?
Emoji for reaction messages.
55 |
# File 'lib/zavudev/models/message_content.rb', line 55 optional :emoji, String |
#filename ⇒ String?
Filename for documents.
61 |
# File 'lib/zavudev/models/message_content.rb', line 61 optional :filename, String |
#footer_text ⇒ String?
Optional footer text for cta_url messages.
67 |
# File 'lib/zavudev/models/message_content.rb', line 67 optional :footer_text, String, api_name: :footerText |
#latitude ⇒ Float?
Latitude for location messages.
73 |
# File 'lib/zavudev/models/message_content.rb', line 73 optional :latitude, Float |
#list_button ⇒ String?
Button text for list messages.
79 |
# File 'lib/zavudev/models/message_content.rb', line 79 optional :list_button, String, api_name: :listButton |
#location_address ⇒ String?
Address of the location.
85 |
# File 'lib/zavudev/models/message_content.rb', line 85 optional :location_address, String, api_name: :locationAddress |
#location_name ⇒ String?
Name of the location.
91 |
# File 'lib/zavudev/models/message_content.rb', line 91 optional :location_name, String, api_name: :locationName |
#longitude ⇒ Float?
Longitude for location messages.
97 |
# File 'lib/zavudev/models/message_content.rb', line 97 optional :longitude, Float |
#media_id ⇒ String?
WhatsApp media ID if already uploaded.
103 |
# File 'lib/zavudev/models/message_content.rb', line 103 optional :media_id, String, api_name: :mediaId |
#media_url ⇒ String?
URL of the media file (for image, video, audio, document, sticker).
109 |
# File 'lib/zavudev/models/message_content.rb', line 109 optional :media_url, String, api_name: :mediaUrl |
#mime_type ⇒ String?
MIME type of the media.
115 |
# File 'lib/zavudev/models/message_content.rb', line 115 optional :mime_type, String, api_name: :mimeType |
#react_to_message_id ⇒ String?
Message ID to react to.
121 |
# File 'lib/zavudev/models/message_content.rb', line 121 optional :react_to_message_id, String, api_name: :reactToMessageId |
#sections ⇒ Array<Zavudev::Models::MessageContent::Section>?
Sections for list messages.
127 |
# File 'lib/zavudev/models/message_content.rb', line 127 optional :sections, -> { Zavudev::Internal::Type::ArrayOf[Zavudev::MessageContent::Section] } |
#template_button_variables ⇒ Hash{Symbol=>String}?
Variables for dynamic button placeholders (URL buttons and OTP buttons). Keys are the button index (0, 1, 2) in the template’s ‘buttons` array — not the placeholder name. Values substitute the `{1}` placeholder inside that button’s URL.
**WhatsApp constraints:**
-
URL buttons only accept ‘{1}` — positional, numeric, no whitespace, no name. Named placeholders like `{token}` are stored as literal URL text by Meta and cannot be substituted.
-
At most one placeholder per URL button.
-
A template may have at most three buttons.
-
Static URL buttons (no placeholder) and ‘quick_reply` buttons are not included here.
146 147 148 |
# File 'lib/zavudev/models/message_content.rb', line 146 optional :template_button_variables, Zavudev::Internal::Type::HashOf[String], api_name: :templateButtonVariables |
#template_id ⇒ String?
Template ID for template messages.
154 |
# File 'lib/zavudev/models/message_content.rb', line 154 optional :template_id, String, api_name: :templateId |
#template_variables ⇒ Hash{Symbol=>String}?
Variables for body placeholders. Keys are positions (1, 2, 3, …) matching the order placeholders appear in the template body.
161 |
# File 'lib/zavudev/models/message_content.rb', line 161 optional :template_variables, Zavudev::Internal::Type::HashOf[String], api_name: :templateVariables |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/zavudev/models/message_content.rb', line 258
|