Class: WhatsAppCloudApi::Types::SendMessageResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/whatsapp_cloud_api/types.rb

Overview

Message response structure

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ SendMessageResponse

Returns a new instance of SendMessageResponse.



24
25
26
27
28
# File 'lib/whatsapp_cloud_api/types.rb', line 24

def initialize(data)
  @messaging_product = data['messaging_product']
  @contacts = data['contacts']&.map { |c| MessageContact.new(c) } || []
  @messages = data['messages']&.map { |m| MessageInfo.new(m) } || []
end

Instance Attribute Details

#contactsObject (readonly)

Returns the value of attribute contacts.



22
23
24
# File 'lib/whatsapp_cloud_api/types.rb', line 22

def contacts
  @contacts
end

#messagesObject (readonly)

Returns the value of attribute messages.



22
23
24
# File 'lib/whatsapp_cloud_api/types.rb', line 22

def messages
  @messages
end

#messaging_productObject (readonly)

Returns the value of attribute messaging_product.



22
23
24
# File 'lib/whatsapp_cloud_api/types.rb', line 22

def messaging_product
  @messaging_product
end