class Twilio::REST::Conversations::V1::ConversationContext::MessageContext::DeliveryReceiptInstance

Public Class Methods

new(version, payload, conversation_sid: nil, message_sid: nil, sid: nil) click to toggle source

Initialize the DeliveryReceiptInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] conversation_sid The unique ID of the

{Conversation}[https://www.twilio.com/docs/conversations/api/conversation-resource]
for this message.

@param [String] message_sid The SID of the message within a

{Conversation}[https://www.twilio.com/docs/conversations/api/conversation-resource]
the delivery receipt belongs to

@param [String] sid A 34 character string that uniquely identifies this

resource.

@return [DeliveryReceiptInstance] DeliveryReceiptInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb
220 def initialize(version, payload, conversation_sid: nil, message_sid: nil, sid: nil)
221   super(version)
222 
223   # Marshaled Properties
224   @properties = {
225       'account_sid' => payload['account_sid'],
226       'conversation_sid' => payload['conversation_sid'],
227       'sid' => payload['sid'],
228       'message_sid' => payload['message_sid'],
229       'channel_message_sid' => payload['channel_message_sid'],
230       'participant_sid' => payload['participant_sid'],
231       'status' => payload['status'],
232       'error_code' => payload['error_code'].to_i,
233       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
234       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
235       'url' => payload['url'],
236   }
237 
238   # Context
239   @instance_context = nil
240   @params = {
241       'conversation_sid' => conversation_sid,
242       'message_sid' => message_sid,
243       'sid' => sid || @properties['sid'],
244   }
245 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The unique ID of the Account responsible for this participant.

    # File lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb
265 def account_sid
266   @properties['account_sid']
267 end
channel_message_sid() click to toggle source

@return [String] A messaging channel-specific identifier for the message delivered to participant

    # File lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb
289 def channel_message_sid
290   @properties['channel_message_sid']
291 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [DeliveryReceiptContext] DeliveryReceiptContext for this DeliveryReceiptInstance

    # File lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb
251 def context
252   unless @instance_context
253     @instance_context = DeliveryReceiptContext.new(
254         @version,
255         @params['conversation_sid'],
256         @params['message_sid'],
257         @params['sid'],
258     )
259   end
260   @instance_context
261 end
conversation_sid() click to toggle source

@return [String] The unique ID of the Conversation for this message.

    # File lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb
271 def conversation_sid
272   @properties['conversation_sid']
273 end
date_created() click to toggle source

@return [Time] The date that this resource was created.

    # File lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb
313 def date_created
314   @properties['date_created']
315 end
date_updated() click to toggle source

@return [Time] The date that this resource was last updated.

    # File lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb
319 def date_updated
320   @properties['date_updated']
321 end
error_code() click to toggle source

@return [String] The message delivery error code for a `failed` status

    # File lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb
307 def error_code
308   @properties['error_code']
309 end
fetch() click to toggle source

Fetch the DeliveryReceiptInstance @return [DeliveryReceiptInstance] Fetched DeliveryReceiptInstance

    # File lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb
332 def fetch
333   context.fetch
334 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb
345 def inspect
346   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
347   "<Twilio.Conversations.V1.DeliveryReceiptInstance #{values}>"
348 end
message_sid() click to toggle source

@return [String] The SID of the message the delivery receipt belongs to

    # File lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb
283 def message_sid
284   @properties['message_sid']
285 end
participant_sid() click to toggle source

@return [String] The unique ID of the participant the delivery receipt belongs to.

    # File lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb
295 def participant_sid
296   @properties['participant_sid']
297 end
sid() click to toggle source

@return [String] A 34 character string that uniquely identifies this resource.

    # File lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb
277 def sid
278   @properties['sid']
279 end
status() click to toggle source

@return [delivery_receipt.DeliveryStatus] The message delivery status

    # File lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb
301 def status
302   @properties['status']
303 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb
338 def to_s
339   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
340   "<Twilio.Conversations.V1.DeliveryReceiptInstance #{values}>"
341 end
url() click to toggle source

@return [String] An absolute URL for this delivery receipt.

    # File lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb
325 def url
326   @properties['url']
327 end