Class: Whatsapp::Webhook::BusinessCapabilityUpdate

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

Overview

Messaging limits, phone number limits, and capability changes for a WhatsApp Business Account. 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(max_daily_conversation_per_phone:, max_phone_numbers_per_business:) ⇒ BusinessCapabilityUpdate

Returns a new instance of BusinessCapabilityUpdate.



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

def initialize(max_daily_conversation_per_phone:, max_phone_numbers_per_business:)
  @max_daily_conversation_per_phone = max_daily_conversation_per_phone
  @max_phone_numbers_per_business = max_phone_numbers_per_business
end

Instance Attribute Details

#max_daily_conversation_per_phoneInteger?

Returns:

  • (Integer, nil)


11
12
13
# File 'lib/ruby/whatsapp/webhook/business_capability_update.rb', line 11

def max_daily_conversation_per_phone
  @max_daily_conversation_per_phone
end

#max_phone_numbers_per_businessInteger?

Returns:

  • (Integer, nil)


15
16
17
# File 'lib/ruby/whatsapp/webhook/business_capability_update.rb', line 15

def max_phone_numbers_per_business
  @max_phone_numbers_per_business
end

Class Method Details

.deserialize(data) ⇒ BusinessCapabilityUpdate

Parameters:

  • data (Hash)

    The raw value hash.

Returns:



25
26
27
28
29
30
31
32
# File 'lib/ruby/whatsapp/webhook/business_capability_update.rb', line 25

def deserialize(data)
  data ||= {}

  new(
    max_daily_conversation_per_phone: data["max_daily_conversation_per_phone"],
    max_phone_numbers_per_business: data["max_phone_numbers_per_business"]
  )
end