Class: Whatsapp::Webhook::SmbAppStateSync

Inherits:
Object
  • Object
show all
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

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_syncArray<StateSync>

Returns:



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

Parameters:

  • data (Hash)

    The raw value hash.

Returns:



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