Class: Whatsapp::Webhook::UserPreferences
- Inherits:
-
Object
- Object
- Whatsapp::Webhook::UserPreferences
- Defined in:
- lib/ruby/whatsapp/webhook/user_preferences.rb
Overview
User marketing message preference changes (e.g. a customer opting out of marketing messages).
Best-effort schema: Meta's public docs describe this field in one line with no published JSON example. Validate against a real payload (App Dashboard "send test payload") before relying on these attribute names in production. Source: https://developers.facebook.com/documentation/business-messaging/whatsapp/webhooks/overview
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(wa_id:, detail:, value:, timestamp:) ⇒ UserPreferences
constructor
A new instance of UserPreferences.
Constructor Details
#initialize(wa_id:, detail:, value:, timestamp:) ⇒ UserPreferences
Returns a new instance of UserPreferences.
29 30 31 32 33 34 |
# File 'lib/ruby/whatsapp/webhook/user_preferences.rb', line 29 def initialize(wa_id:, detail:, value:, timestamp:) @wa_id = wa_id @detail = detail @value = value @timestamp = end |
Instance Attribute Details
#detail ⇒ String?
19 20 21 |
# File 'lib/ruby/whatsapp/webhook/user_preferences.rb', line 19 def detail @detail end |
#timestamp ⇒ String?
27 28 29 |
# File 'lib/ruby/whatsapp/webhook/user_preferences.rb', line 27 def @timestamp end |
#value ⇒ String?
Returns e.g. "stop", "resume".
23 24 25 |
# File 'lib/ruby/whatsapp/webhook/user_preferences.rb', line 23 def value @value end |
#wa_id ⇒ String?
15 16 17 |
# File 'lib/ruby/whatsapp/webhook/user_preferences.rb', line 15 def wa_id @wa_id end |
Class Method Details
.deserialize(data) ⇒ UserPreferences
39 40 41 42 43 |
# File 'lib/ruby/whatsapp/webhook/user_preferences.rb', line 39 def deserialize(data) data ||= {} new(wa_id: data["wa_id"], detail: data["detail"], value: data["value"], timestamp: data["timestamp"]) end |