Class: Twi::DeliveryEvent

Inherits:
Event show all
Defined in:
lib/twi/delivery_event.rb

Overview

An event signaling the delivery of a message in a conversation.

Class Method Summary collapse

Methods inherited from Event

#code, #content, #conversation_id, #id, #image_urls, #participant, participant_params_for, #status, #target

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Twi::Resource

Class Method Details

.params_for(id:, participant_id:, message_id:, status:, code: nil) ⇒ Hash

Returns the shape of the payload send by Twilio to the callback URL.

Returns:

  • (Hash)

    the shape of the payload send by Twilio to the callback URL.



6
7
8
9
10
11
# File 'lib/twi/delivery_event.rb', line 6

def self.params_for(id:, participant_id:, message_id:, status:, code: nil)
  {
    ConversationSid: id, EventType: 'onDeliveryChanged', ParticipantSid: participant_id.to_s,
    MessageSid: message_id, Status: status.to_s, ErrorCode: code
  }.compact
end