Class: Whatsapp::BusinessPhoneNumber::Profile::Details
- Inherits:
-
Object
- Object
- Whatsapp::BusinessPhoneNumber::Profile::Details
- Defined in:
- lib/ruby/whatsapp/business_phone_number/profile/details.rb
Overview
The business profile returned by Get.
Every field arrives only when asked for via fields, so every attribute tolerates
being absent. Nothing is validated or normalized on the way in — this is read-side
data, and a vertical Meta adds later must still round-trip untouched. Compare
against Verticals::ALL rather than expecting this class to have rejected an unknown
value, the same reasoning as Account::Details' statuses and
MessageTemplates::Response::Node's raw components.
Source: https://developers.facebook.com/documentation/business-messaging/whatsapp/reference/whatsapp-business-phone-number/whatsapp-business-profile-api
Instance Attribute Summary collapse
-
#about ⇒ String?
The text shown in the profile's About section.
-
#address ⇒ String?
The business's physical address.
-
#description ⇒ String?
The business description.
-
#email ⇒ String?
The business's contact email address.
-
#messaging_product ⇒ String?
The messaging service, always
"whatsapp"in practice. -
#profile_picture_url ⇒ String?
The URL of the profile picture.
-
#vertical ⇒ String?
One of Verticals::ALL, as sent by Meta.
-
#websites ⇒ Array<String>?
The business's website URLs.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(messaging_product: nil, about: nil, address: nil, description: nil, email: nil, profile_picture_url: nil, websites: nil, vertical: nil) ⇒ Details
constructor
A new instance of Details.
Constructor Details
#initialize(messaging_product: nil, about: nil, address: nil, description: nil, email: nil, profile_picture_url: nil, websites: nil, vertical: nil) ⇒ Details
Returns a new instance of Details.
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/ruby/whatsapp/business_phone_number/profile/details.rb', line 56 def initialize(messaging_product: nil, about: nil, address: nil, description: nil, email: nil, profile_picture_url: nil, websites: nil, vertical: nil) @messaging_product = messaging_product @about = about @address = address @description = description @email = email @profile_picture_url = profile_picture_url @websites = websites @vertical = vertical end |
Instance Attribute Details
#about ⇒ String?
Returns The text shown in the profile's About section.
22 23 24 |
# File 'lib/ruby/whatsapp/business_phone_number/profile/details.rb', line 22 def about @about end |
#address ⇒ String?
Returns The business's physical address.
26 27 28 |
# File 'lib/ruby/whatsapp/business_phone_number/profile/details.rb', line 26 def address @address end |
#description ⇒ String?
Returns The business description.
30 31 32 |
# File 'lib/ruby/whatsapp/business_phone_number/profile/details.rb', line 30 def description @description end |
#email ⇒ String?
Returns The business's contact email address.
34 35 36 |
# File 'lib/ruby/whatsapp/business_phone_number/profile/details.rb', line 34 def email @email end |
#messaging_product ⇒ String?
Returns The messaging service, always "whatsapp" in practice.
18 19 20 |
# File 'lib/ruby/whatsapp/business_phone_number/profile/details.rb', line 18 def messaging_product @messaging_product end |
#profile_picture_url ⇒ String?
Returns The URL of the profile picture.
38 39 40 |
# File 'lib/ruby/whatsapp/business_phone_number/profile/details.rb', line 38 def profile_picture_url @profile_picture_url end |
#vertical ⇒ String?
Returns One of Verticals::ALL, as sent by Meta.
46 47 48 |
# File 'lib/ruby/whatsapp/business_phone_number/profile/details.rb', line 46 def vertical @vertical end |
#websites ⇒ Array<String>?
Returns The business's website URLs.
42 43 44 |
# File 'lib/ruby/whatsapp/business_phone_number/profile/details.rb', line 42 def websites @websites end |
Class Method Details
.deserialize(response) ⇒ Details
71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/ruby/whatsapp/business_phone_number/profile/details.rb', line 71 def deserialize(response) profile = unwrap(response) new( messaging_product: profile["messaging_product"], about: profile["about"], address: profile["address"], description: profile["description"], email: profile["email"], profile_picture_url: profile["profile_picture_url"], websites: profile["websites"], vertical: profile["vertical"] ) end |