Class: Whatsapp::Messages::MarkMessageAsRead
- Inherits:
-
Object
- Object
- Whatsapp::Messages::MarkMessageAsRead
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/ruby/whatsapp/messages/mark_message_as_read.rb
Overview
Marks a previously received message (and every earlier message in the conversation) as read. Unlike every other message class, this has no recipient or type envelope — it targets an existing message by ID. Meta requires this within 30 days of receipt. Source: https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/mark-message-as-read
Defined Under Namespace
Modules: Defaults
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(message_id:) ⇒ MarkMessageAsRead
constructor
A new instance of MarkMessageAsRead.
-
#serialize ⇒ Hash
Serialized representation for the WhatsApp API.
Constructor Details
#initialize(message_id:) ⇒ MarkMessageAsRead
Returns a new instance of MarkMessageAsRead.
26 27 28 29 30 |
# File 'lib/ruby/whatsapp/messages/mark_message_as_read.rb', line 26 def initialize(message_id:) @message_id = validate! end |
Instance Attribute Details
#message_id ⇒ String
20 21 22 |
# File 'lib/ruby/whatsapp/messages/mark_message_as_read.rb', line 20 def @message_id end |
Instance Method Details
#serialize ⇒ Hash
Returns Serialized representation for the WhatsApp API.
33 34 35 36 37 38 39 |
# File 'lib/ruby/whatsapp/messages/mark_message_as_read.rb', line 33 def serialize { messaging_product: Defaults::MESSAGING_PRODUCT, status: Defaults::STATUS, message_id:, } end |