Class: Whatsapp::Webhook::PhoneNumberNameUpdate

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby/whatsapp/webhook/phone_number_name_update.rb

Overview

Display name verification outcomes for a business phone number.

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

Constructor Details

#initialize(phone_number:, decision:, requested_verified_name:, rejection_reason: nil) ⇒ PhoneNumberNameUpdate

Returns a new instance of PhoneNumberNameUpdate.



28
29
30
31
32
33
# File 'lib/ruby/whatsapp/webhook/phone_number_name_update.rb', line 28

def initialize(phone_number:, decision:, requested_verified_name:, rejection_reason: nil)
  @phone_number = phone_number
  @decision = decision
  @requested_verified_name = requested_verified_name
  @rejection_reason = rejection_reason
end

Instance Attribute Details

#decisionString?

Returns e.g. "APPROVED", "REJECTED".

Returns:

  • (String, nil)

    e.g. "APPROVED", "REJECTED".



18
19
20
# File 'lib/ruby/whatsapp/webhook/phone_number_name_update.rb', line 18

def decision
  @decision
end

#phone_numberString?

Returns:

  • (String, nil)


14
15
16
# File 'lib/ruby/whatsapp/webhook/phone_number_name_update.rb', line 14

def phone_number
  @phone_number
end

#rejection_reasonString?

Returns:

  • (String, nil)


26
27
28
# File 'lib/ruby/whatsapp/webhook/phone_number_name_update.rb', line 26

def rejection_reason
  @rejection_reason
end

#requested_verified_nameString?

Returns:

  • (String, nil)


22
23
24
# File 'lib/ruby/whatsapp/webhook/phone_number_name_update.rb', line 22

def requested_verified_name
  @requested_verified_name
end

Class Method Details

.deserialize(data) ⇒ PhoneNumberNameUpdate

Parameters:

  • data (Hash)

    The raw value hash.

Returns:



38
39
40
41
42
43
44
45
46
47
# File 'lib/ruby/whatsapp/webhook/phone_number_name_update.rb', line 38

def deserialize(data)
  data ||= {}

  new(
    phone_number: data["phone_number"],
    decision: data["decision"],
    requested_verified_name: data["requested_verified_name"],
    rejection_reason: data["rejection_reason"]
  )
end