Class: Whatsapp::Webhook::SmbAppStateSync
- Inherits:
-
Object
- Object
- Whatsapp::Webhook::SmbAppStateSync
- Defined in:
- lib/ruby/whatsapp/webhook/smb_app_state_sync.rb,
lib/ruby/whatsapp/webhook/smb_app_state_sync/state_sync.rb
Overview
Contact synchronization for onboarded WhatsApp Business app users.
Best-effort schema: Meta's public docs describe this field in one line with
no published JSON example; each entry's contact shape isn't confidently
typeable from that description alone, so it's kept as a raw hash rather
than guessing further. Validate against a real payload before relying on
this in production.
Source: https://developers.facebook.com/documentation/business-messaging/whatsapp/webhooks/overview
Defined Under Namespace
Classes: StateSync
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(state_sync:) ⇒ SmbAppStateSync
constructor
A new instance of SmbAppStateSync.
Constructor Details
#initialize(state_sync:) ⇒ SmbAppStateSync
Returns a new instance of SmbAppStateSync.
18 19 20 |
# File 'lib/ruby/whatsapp/webhook/smb_app_state_sync.rb', line 18 def initialize(state_sync:) @state_sync = state_sync end |
Instance Attribute Details
#state_sync ⇒ Array<StateSync>
16 17 18 |
# File 'lib/ruby/whatsapp/webhook/smb_app_state_sync.rb', line 16 def state_sync @state_sync end |
Class Method Details
.deserialize(data) ⇒ SmbAppStateSync
25 26 27 28 29 |
# File 'lib/ruby/whatsapp/webhook/smb_app_state_sync.rb', line 25 def deserialize(data) data ||= {} new(state_sync: Array(data["state_sync"]).map { |entry| StateSync.deserialize(entry) }) end |