Class: Twilio::REST::Conversations::V1::ConversationContext::MessageContext::DeliveryReceiptInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Conversations::V1::ConversationContext::MessageContext::DeliveryReceiptInstance
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#channel_message_sid ⇒ String
A messaging channel-specific identifier for the message delivered to participant.
-
#context ⇒ DeliveryReceiptContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#conversation_sid ⇒ String
The conversation_sid.
-
#date_created ⇒ Time
The date that this resource was created.
-
#date_updated ⇒ Time
The date that this resource was last updated.
-
#error_code ⇒ String
The message [delivery error code](www.twilio.com/docs/sms/api/message-resource#delivery-related-errors) for a ‘failed` status.
-
#fetch ⇒ DeliveryReceiptInstance
Fetch the DeliveryReceiptInstance.
-
#initialize(version, payload, conversation_sid: nil, message_sid: nil, sid: nil) ⇒ DeliveryReceiptInstance
constructor
Initialize the DeliveryReceiptInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#message_sid ⇒ String
The sid of the message the delivery receipt belongs to.
-
#participant_sid ⇒ String
The unique id of the participant the delivery receipt belongs to.
-
#sid ⇒ String
A 34 character string that uniquely identifies this resource.
-
#status ⇒ delivery_receipt.DeliveryStatus
The message delivery status.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
An absolute URL for this delivery receipt.
Constructor Details
#initialize(version, payload, conversation_sid: nil, message_sid: nil, sid: nil) ⇒ DeliveryReceiptInstance
Initialize the DeliveryReceiptInstance
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 220 def initialize(version, payload, conversation_sid: nil, message_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'message_sid' => payload['message_sid'], 'conversation_sid' => payload['conversation_sid'], 'channel_message_sid' => payload['channel_message_sid'], 'participant_sid' => payload['participant_sid'], 'status' => payload['status'], 'error_code' => payload['error_code'].to_i, 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], } # Context @instance_context = nil @params = { 'conversation_sid' => conversation_sid, 'message_sid' => , 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#channel_message_sid ⇒ String
Returns A messaging channel-specific identifier for the message delivered to participant.
282 283 284 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 282 def @properties['channel_message_sid'] end |
#context ⇒ DeliveryReceiptContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 250 def context unless @instance_context @instance_context = DeliveryReceiptContext.new( @version, @params['conversation_sid'], @params['message_sid'], @params['sid'], ) end @instance_context end |
#conversation_sid ⇒ String
Returns The conversation_sid.
276 277 278 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 276 def conversation_sid @properties['conversation_sid'] end |
#date_created ⇒ Time
Returns The date that this resource was created.
306 307 308 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 306 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated.
312 313 314 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 312 def date_updated @properties['date_updated'] end |
#error_code ⇒ String
Returns The message [delivery error code](www.twilio.com/docs/sms/api/message-resource#delivery-related-errors) for a ‘failed` status.
300 301 302 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 300 def error_code @properties['error_code'] end |
#fetch ⇒ DeliveryReceiptInstance
Fetch the DeliveryReceiptInstance
325 326 327 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 325 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
338 339 340 341 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 338 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.DeliveryReceiptInstance #{values}>" end |
#message_sid ⇒ String
Returns The sid of the message the delivery receipt belongs to.
270 271 272 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 270 def @properties['message_sid'] end |
#participant_sid ⇒ String
Returns The unique id of the participant the delivery receipt belongs to.
288 289 290 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 288 def participant_sid @properties['participant_sid'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
264 265 266 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 264 def sid @properties['sid'] end |
#status ⇒ delivery_receipt.DeliveryStatus
Returns The message delivery status.
294 295 296 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 294 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
331 332 333 334 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 331 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.DeliveryReceiptInstance #{values}>" end |
#url ⇒ String
Returns An absolute URL for this delivery receipt.
318 319 320 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 318 def url @properties['url'] end |