Class: Twilio::REST::Conversations::V1::ServiceContext::ConversationContext::MessageContext::DeliveryReceiptInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Conversations::V1::ServiceContext::ConversationContext::MessageContext::DeliveryReceiptInstance
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique ID of the Account responsible for this participant.
-
#channel_message_sid ⇒ String
A messaging channel-specific identifier for the message delivered to participant.
-
#chat_service_sid ⇒ String
The SID of the Conversation Service that the resource is associated with.
-
#context ⇒ DeliveryReceiptContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#conversation_sid ⇒ String
The unique ID of the Conversation for this message.
-
#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 for a `failed` status.
-
#fetch ⇒ DeliveryReceiptInstance
Fetch the DeliveryReceiptInstance.
-
#initialize(version, payload, chat_service_sid: nil, 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, chat_service_sid: nil, conversation_sid: nil, message_sid: nil, sid: nil) ⇒ DeliveryReceiptInstance
Initialize the DeliveryReceiptInstance
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 241 def initialize(version, payload, chat_service_sid: nil, conversation_sid: nil, message_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'chat_service_sid' => payload['chat_service_sid'], 'conversation_sid' => payload['conversation_sid'], 'message_sid' => payload['message_sid'], 'sid' => payload['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 = { 'chat_service_sid' => chat_service_sid, 'conversation_sid' => conversation_sid, 'message_sid' => , 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique ID of the Account responsible for this participant.
289 290 291 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 289 def account_sid @properties['account_sid'] end |
#channel_message_sid ⇒ String
Returns A messaging channel-specific identifier for the message delivered to participant.
319 320 321 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 319 def @properties['channel_message_sid'] end |
#chat_service_sid ⇒ String
Returns The SID of the Conversation Service that the resource is associated with.
295 296 297 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 295 def chat_service_sid @properties['chat_service_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
274 275 276 277 278 279 280 281 282 283 284 285 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 274 def context unless @instance_context @instance_context = DeliveryReceiptContext.new( @version, @params['chat_service_sid'], @params['conversation_sid'], @params['message_sid'], @params['sid'], ) end @instance_context end |
#conversation_sid ⇒ String
Returns The unique ID of the Conversation for this message.
301 302 303 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 301 def conversation_sid @properties['conversation_sid'] end |
#date_created ⇒ Time
Returns The date that this resource was created.
343 344 345 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 343 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated.
349 350 351 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 349 def date_updated @properties['date_updated'] end |
#error_code ⇒ String
Returns The message delivery error code for a `failed` status.
337 338 339 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 337 def error_code @properties['error_code'] end |
#fetch ⇒ DeliveryReceiptInstance
Fetch the DeliveryReceiptInstance
362 363 364 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 362 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
375 376 377 378 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 375 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.
307 308 309 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 307 def @properties['message_sid'] end |
#participant_sid ⇒ String
Returns The unique ID of the participant the delivery receipt belongs to.
325 326 327 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 325 def participant_sid @properties['participant_sid'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
313 314 315 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 313 def sid @properties['sid'] end |
#status ⇒ delivery_receipt.DeliveryStatus
Returns The message delivery status.
331 332 333 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 331 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
368 369 370 371 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 368 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.
355 356 357 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 355 def url @properties['url'] end |