Class: Whatsapp::Webhook::SmbAppStateSync::StateSync
- Inherits:
-
Object
- Object
- Whatsapp::Webhook::SmbAppStateSync::StateSync
- Defined in:
- lib/ruby/whatsapp/webhook/smb_app_state_sync/state_sync.rb
Overview
A single contact-sync entry within an smb_app_state_sync notification.
Instance Attribute Summary collapse
-
#action ⇒ String?
E.g.
-
#contact ⇒ Hash
Left untyped — Meta's docs don't publish this entry's schema.
- #type ⇒ String?
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type:, action:, contact:) ⇒ StateSync
constructor
A new instance of StateSync.
Constructor Details
#initialize(type:, action:, contact:) ⇒ StateSync
Returns a new instance of StateSync.
20 21 22 23 24 |
# File 'lib/ruby/whatsapp/webhook/smb_app_state_sync/state_sync.rb', line 20 def initialize(type:, action:, contact:) @type = type @action = action @contact = contact end |
Instance Attribute Details
#action ⇒ String?
Returns e.g. "add", "remove", "update".
14 15 16 |
# File 'lib/ruby/whatsapp/webhook/smb_app_state_sync/state_sync.rb', line 14 def action @action end |
#contact ⇒ Hash
Returns Left untyped — Meta's docs don't publish this entry's schema.
18 19 20 |
# File 'lib/ruby/whatsapp/webhook/smb_app_state_sync/state_sync.rb', line 18 def contact @contact end |
#type ⇒ String?
10 11 12 |
# File 'lib/ruby/whatsapp/webhook/smb_app_state_sync/state_sync.rb', line 10 def type @type end |
Class Method Details
.deserialize(data) ⇒ StateSync
29 30 31 32 33 |
# File 'lib/ruby/whatsapp/webhook/smb_app_state_sync/state_sync.rb', line 29 def deserialize(data) data ||= {} new(type: data["type"], action: data["action"], contact: data["contact"] || {}) end |