Class: Whatsapp::Webhook::MessageTemplateComponentsUpdate

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

Overview

Template component modifications (e.g. Meta editing a template's header, body, or button on the business's behalf).

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(message_template_id:, message_template_name:, message_template_language:, message_template_element:) ⇒ MessageTemplateComponentsUpdate

Returns a new instance of MessageTemplateComponentsUpdate.



29
30
31
32
33
34
35
# File 'lib/ruby/whatsapp/webhook/message_template_components_update.rb', line 29

def initialize(message_template_id:, message_template_name:, message_template_language:,
  message_template_element:)
  @message_template_id = message_template_id
  @message_template_name = message_template_name
  @message_template_language = message_template_language
  @message_template_element = message_template_element
end

Instance Attribute Details

#message_template_elementString?

Returns The component that changed, e.g. "BODY".

Returns:

  • (String, nil)

    The component that changed, e.g. "BODY".



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

def message_template_element
  @message_template_element
end

#message_template_idInteger?

Returns:

  • (Integer, nil)


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

def message_template_id
  @message_template_id
end

#message_template_languageString?

Returns:

  • (String, nil)


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

def message_template_language
  @message_template_language
end

#message_template_nameString?

Returns:

  • (String, nil)


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

def message_template_name
  @message_template_name
end

Class Method Details

.deserialize(data) ⇒ MessageTemplateComponentsUpdate

Parameters:

  • data (Hash)

    The raw value hash.

Returns:



40
41
42
43
44
45
46
47
48
49
# File 'lib/ruby/whatsapp/webhook/message_template_components_update.rb', line 40

def deserialize(data)
  data ||= {}

  new(
    message_template_id: data["message_template_id"],
    message_template_name: data["message_template_name"],
    message_template_language: data["message_template_language"],
    message_template_element: data["message_template_element"]
  )
end