Class: Whatsapp::Webhook::AccountAlerts

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

Overview

Notifications of messaging limit, business profile, and Official Business Account status changes.

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(entity_type:, entity_id:, alert_severity:, alert_status:, alert_description:) ⇒ AccountAlerts

Returns a new instance of AccountAlerts.



33
34
35
36
37
38
39
# File 'lib/ruby/whatsapp/webhook/account_alerts.rb', line 33

def initialize(entity_type:, entity_id:, alert_severity:, alert_status:, alert_description:)
  @entity_type = entity_type
  @entity_id = entity_id
  @alert_severity = alert_severity
  @alert_status = alert_status
  @alert_description = alert_description
end

Instance Attribute Details

#alert_descriptionString?

Returns:

  • (String, nil)


31
32
33
# File 'lib/ruby/whatsapp/webhook/account_alerts.rb', line 31

def alert_description
  @alert_description
end

#alert_severityString?

Returns:

  • (String, nil)


23
24
25
# File 'lib/ruby/whatsapp/webhook/account_alerts.rb', line 23

def alert_severity
  @alert_severity
end

#alert_statusString?

Returns:

  • (String, nil)


27
28
29
# File 'lib/ruby/whatsapp/webhook/account_alerts.rb', line 27

def alert_status
  @alert_status
end

#entity_idString?

Returns:

  • (String, nil)


19
20
21
# File 'lib/ruby/whatsapp/webhook/account_alerts.rb', line 19

def entity_id
  @entity_id
end

#entity_typeString?

Returns:

  • (String, nil)


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

def entity_type
  @entity_type
end

Class Method Details

.deserialize(data) ⇒ AccountAlerts

Parameters:

  • data (Hash)

    The raw value hash.

Returns:



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/ruby/whatsapp/webhook/account_alerts.rb', line 44

def deserialize(data)
  data ||= {}

  new(
    entity_type: data["entity_type"],
    entity_id: data["entity_id"],
    alert_severity: data["alert_severity"],
    alert_status: data["alert_status"],
    alert_description: data["alert_description"]
  )
end