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

Public Class Methods

new(version, payload, chat_service_sid: nil, 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] chat_service_sid The SID of the {Conversation

Service}[https://www.twilio.com/docs/conversations/api/service-resource] the
Message resource is associated with.

@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/service/conversation/message/delivery_receipt.rb
241 def initialize(version, payload, chat_service_sid: nil, conversation_sid: nil, message_sid: nil, sid: nil)
242   super(version)
243 
244   # Marshaled Properties
245   @properties = {
246       'account_sid' => payload['account_sid'],
247       'chat_service_sid' => payload['chat_service_sid'],
248       'conversation_sid' => payload['conversation_sid'],
249       'message_sid' => payload['message_sid'],
250       'sid' => payload['sid'],
251       'channel_message_sid' => payload['channel_message_sid'],
252       'participant_sid' => payload['participant_sid'],
253       'status' => payload['status'],
254       'error_code' => payload['error_code'].to_i,
255       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
256       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
257       'url' => payload['url'],
258   }
259 
260   # Context
261   @instance_context = nil
262   @params = {
263       'chat_service_sid' => chat_service_sid,
264       'conversation_sid' => conversation_sid,
265       'message_sid' => message_sid,
266       'sid' => sid || @properties['sid'],
267   }
268 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/service/conversation/message/delivery_receipt.rb
289 def account_sid
290   @properties['account_sid']
291 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/service/conversation/message/delivery_receipt.rb
319 def channel_message_sid
320   @properties['channel_message_sid']
321 end
chat_service_sid() click to toggle source

@return [String] The SID of the Conversation Service that the resource is associated with.

    # File lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb
295 def chat_service_sid
296   @properties['chat_service_sid']
297 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/service/conversation/message/delivery_receipt.rb
274 def context
275   unless @instance_context
276     @instance_context = DeliveryReceiptContext.new(
277         @version,
278         @params['chat_service_sid'],
279         @params['conversation_sid'],
280         @params['message_sid'],
281         @params['sid'],
282     )
283   end
284   @instance_context
285 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/service/conversation/message/delivery_receipt.rb
301 def conversation_sid
302   @properties['conversation_sid']
303 end
date_created() click to toggle source

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

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

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

    # File lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb
349 def date_updated
350   @properties['date_updated']
351 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/service/conversation/message/delivery_receipt.rb
337 def error_code
338   @properties['error_code']
339 end
fetch() click to toggle source

Fetch the DeliveryReceiptInstance @return [DeliveryReceiptInstance] Fetched DeliveryReceiptInstance

    # File lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb
362 def fetch
363   context.fetch
364 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb
375 def inspect
376   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
377   "<Twilio.Conversations.V1.DeliveryReceiptInstance #{values}>"
378 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/service/conversation/message/delivery_receipt.rb
307 def message_sid
308   @properties['message_sid']
309 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/service/conversation/message/delivery_receipt.rb
325 def participant_sid
326   @properties['participant_sid']
327 end
sid() click to toggle source

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

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

@return [delivery_receipt.DeliveryStatus] The message delivery status

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

Provide a user friendly representation

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

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

    # File lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb
355 def url
356   @properties['url']
357 end