Class: Whatsapp::BusinessPhoneNumber::Account::Details
- Inherits:
-
Object
- Object
- Whatsapp::BusinessPhoneNumber::Account::Details
- Defined in:
- lib/ruby/whatsapp/business_phone_number/account/details.rb
Overview
The WhatsApp Business Account node returned by Get.
Only id and name are documented required; everything else arrives just when
asked for via fields, so every attribute tolerates being absent. Status values
are exposed as raw strings and are never validated on the way in — this is
read-side data, and a value Meta adds later must still round-trip. The frozen
constant modules below are for comparison, not enforcement, mirroring how
MessageTemplates::Response::Node keeps Meta's echoed payloads raw.
Source: https://developers.facebook.com/documentation/business-messaging/whatsapp/reference/whatsapp-business-account/whatsapp-business-account-api
Defined Under Namespace
Modules: OwnershipTypes, ReviewStatuses, VerificationStatuses
Instance Attribute Summary collapse
-
#account_review_status ⇒ String?
One of ReviewStatuses::ALL.
-
#business_verification_status ⇒ String?
One of VerificationStatuses::ALL.
-
#country ⇒ String?
The account's country code.
-
#id ⇒ String?
The account's unique identifier.
-
#message_template_namespace ⇒ String?
The namespace the account's templates live in.
-
#name ⇒ String?
The account's human-readable name.
-
#ownership_type ⇒ String?
One of OwnershipTypes::ALL.
-
#primary_business_location ⇒ String?
The account's primary business location.
-
#timezone_id ⇒ String?
The account's timezone identifier.
Class Method Summary collapse
Instance Method Summary collapse
-
#approved? ⇒ Boolean
Whether Meta has approved the account.
-
#initialize(id: nil, name: nil, timezone_id: nil, message_template_namespace: nil, account_review_status: nil, business_verification_status: nil, country: nil, ownership_type: nil, primary_business_location: nil) ⇒ Details
constructor
A new instance of Details.
-
#self_owned? ⇒ Boolean
Whether the account belongs to your own business, rather than to a client or a partner acting on one's behalf.
-
#verified? ⇒ Boolean
Whether the business behind the account is verified.
Constructor Details
#initialize(id: nil, name: nil, timezone_id: nil, message_template_namespace: nil, account_review_status: nil, business_verification_status: nil, country: nil, ownership_type: nil, primary_business_location: nil) ⇒ Details
Returns a new instance of Details.
97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/ruby/whatsapp/business_phone_number/account/details.rb', line 97 def initialize(id: nil, name: nil, timezone_id: nil, message_template_namespace: nil, account_review_status: nil, business_verification_status: nil, country: nil, ownership_type: nil, primary_business_location: nil) @id = id @name = name @timezone_id = timezone_id @message_template_namespace = @account_review_status = account_review_status @business_verification_status = business_verification_status @country = country @ownership_type = ownership_type @primary_business_location = primary_business_location end |
Instance Attribute Details
#account_review_status ⇒ String?
70 71 72 |
# File 'lib/ruby/whatsapp/business_phone_number/account/details.rb', line 70 def account_review_status @account_review_status end |
#business_verification_status ⇒ String?
74 75 76 |
# File 'lib/ruby/whatsapp/business_phone_number/account/details.rb', line 74 def business_verification_status @business_verification_status end |
#country ⇒ String?
Returns The account's country code.
78 79 80 |
# File 'lib/ruby/whatsapp/business_phone_number/account/details.rb', line 78 def country @country end |
#id ⇒ String?
Returns The account's unique identifier.
54 55 56 |
# File 'lib/ruby/whatsapp/business_phone_number/account/details.rb', line 54 def id @id end |
#message_template_namespace ⇒ String?
Returns The namespace the account's templates live in.
66 67 68 |
# File 'lib/ruby/whatsapp/business_phone_number/account/details.rb', line 66 def @message_template_namespace end |
#name ⇒ String?
Returns The account's human-readable name.
58 59 60 |
# File 'lib/ruby/whatsapp/business_phone_number/account/details.rb', line 58 def name @name end |
#ownership_type ⇒ String?
82 83 84 |
# File 'lib/ruby/whatsapp/business_phone_number/account/details.rb', line 82 def ownership_type @ownership_type end |
#primary_business_location ⇒ String?
Returns The account's primary business location.
86 87 88 |
# File 'lib/ruby/whatsapp/business_phone_number/account/details.rb', line 86 def primary_business_location @primary_business_location end |
#timezone_id ⇒ String?
Returns The account's timezone identifier.
62 63 64 |
# File 'lib/ruby/whatsapp/business_phone_number/account/details.rb', line 62 def timezone_id @timezone_id end |
Class Method Details
.deserialize(response) ⇒ Details
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/ruby/whatsapp/business_phone_number/account/details.rb', line 114 def deserialize(response) response ||= {} new( id: response["id"], name: response["name"], timezone_id: response["timezone_id"], message_template_namespace: response["message_template_namespace"], account_review_status: response["account_review_status"], business_verification_status: response["business_verification_status"], country: response["country"], ownership_type: response["ownership_type"], primary_business_location: response["primary_business_location"] ) end |
Instance Method Details
#approved? ⇒ Boolean
Returns Whether Meta has approved the account.
132 133 134 |
# File 'lib/ruby/whatsapp/business_phone_number/account/details.rb', line 132 def approved? account_review_status == ReviewStatuses::APPROVED end |
#self_owned? ⇒ Boolean
Returns Whether the account belongs to your own business, rather than to a client or a partner acting on one's behalf.
143 144 145 |
# File 'lib/ruby/whatsapp/business_phone_number/account/details.rb', line 143 def self_owned? ownership_type == OwnershipTypes::SELF end |
#verified? ⇒ Boolean
Returns Whether the business behind the account is verified.
137 138 139 |
# File 'lib/ruby/whatsapp/business_phone_number/account/details.rb', line 137 def verified? business_verification_status == VerificationStatuses::VERIFIED end |