class Twilio::REST::Conversations::V1::ConversationContext::MessageContext::DeliveryReceiptInstance
Public Class Methods
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
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
@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
@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
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
@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
@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
@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
@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 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
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
@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
@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
@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
@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
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
@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