Class: Whatsapp::SubscribedApp::Response::App
- Inherits:
-
Object
- Object
- Whatsapp::SubscribedApp::Response::App
- Defined in:
- lib/ruby/whatsapp/subscribed_app/response/app.rb
Overview
One app subscribed to a WABA's webhook notifications.
Meta nests id/name/link inside whatsapp_business_api_data; this class
flattens that away since the wrapper carries no information of its own.
Source: https://developers.facebook.com/documentation/business-messaging/whatsapp/reference/whatsapp-business-account/subscribed-apps-api
Instance Attribute Summary collapse
-
#id ⇒ String?
The subscribed app's ID.
-
#link ⇒ String?
A link to the app.
-
#name ⇒ String?
The subscribed app's name.
-
#override_callback_uri ⇒ String?
The per-WABA webhook callback override, if one is set.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id: nil, name: nil, link: nil, override_callback_uri: nil) ⇒ App
constructor
A new instance of App.
Constructor Details
#initialize(id: nil, name: nil, link: nil, override_callback_uri: nil) ⇒ App
Returns a new instance of App.
32 33 34 35 36 37 |
# File 'lib/ruby/whatsapp/subscribed_app/response/app.rb', line 32 def initialize(id: nil, name: nil, link: nil, override_callback_uri: nil) @id = id @name = name @link = link @override_callback_uri = override_callback_uri end |
Instance Attribute Details
#id ⇒ String?
Returns The subscribed app's ID.
14 15 16 |
# File 'lib/ruby/whatsapp/subscribed_app/response/app.rb', line 14 def id @id end |
#link ⇒ String?
Returns A link to the app.
22 23 24 |
# File 'lib/ruby/whatsapp/subscribed_app/response/app.rb', line 22 def link @link end |
#name ⇒ String?
Returns The subscribed app's name.
18 19 20 |
# File 'lib/ruby/whatsapp/subscribed_app/response/app.rb', line 18 def name @name end |
#override_callback_uri ⇒ String?
Returns The per-WABA webhook callback override, if one is set.
26 27 28 |
# File 'lib/ruby/whatsapp/subscribed_app/response/app.rb', line 26 def override_callback_uri @override_callback_uri end |
Class Method Details
.deserialize(data) ⇒ App
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/ruby/whatsapp/subscribed_app/response/app.rb', line 42 def deserialize(data) data ||= {} api_data = data["whatsapp_business_api_data"] || {} new( id: api_data["id"], name: api_data["name"], link: api_data["link"], override_callback_uri: data["override_callback_uri"] ) end |