Class: Twilio::REST::Conversations::V1::ServiceContext::ConversationContext::MessageContext::DeliveryReceiptContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, chat_service_sid, conversation_sid, message_sid, sid) ⇒ DeliveryReceiptContext

Initialize the DeliveryReceiptContext

Parameters:

  • version (Version)

    Version that contains the resource

  • chat_service_sid (String)

    The SID of the Conversation Service the Message resource is associated with.

  • conversation_sid (String)

    The unique ID of the Conversation for this message.

  • message_sid (String)

    The SID of the message within a Conversation the delivery receipt belongs to.

  • sid (String)

    A 34 character string that uniquely identifies this resource.


180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 180

def initialize(version, chat_service_sid, conversation_sid, message_sid, sid)
  super(version)

  # Path Solution
  @solution = {
      chat_service_sid: chat_service_sid,
      conversation_sid: conversation_sid,
      message_sid: message_sid,
      sid: sid,
  }
  @uri = "/Services/#{@solution[:chat_service_sid]}/Conversations/#{@solution[:conversation_sid]}/Messages/#{@solution[:message_sid]}/Receipts/#{@solution[:sid]}"
end

Instance Method Details

#fetchDeliveryReceiptInstance

Fetch the DeliveryReceiptInstance

Returns:


196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 196

def fetch
  payload = @version.fetch('GET', @uri)

  DeliveryReceiptInstance.new(
      @version,
      payload,
      chat_service_sid: @solution[:chat_service_sid],
      conversation_sid: @solution[:conversation_sid],
      message_sid: @solution[:message_sid],
      sid: @solution[:sid],
  )
end

#inspectObject

Provide a detailed, user friendly representation


218
219
220
221
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 218

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Conversations.V1.DeliveryReceiptContext #{context}>"
end

#to_sObject

Provide a user friendly representation


211
212
213
214
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 211

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Conversations.V1.DeliveryReceiptContext #{context}>"
end