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](www.twilio.com/docs/iam/api/account) responsible for this participant.
-
#channel_message_sid ⇒ String
A messaging channel-specific identifier for the message delivered to participant e.g.
-
#chat_service_sid ⇒ String
The SID of the [Conversation Service](www.twilio.com/docs/conversations/api/service-resource) the Message 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](www.twilio.com/docs/conversations/api/conversation-resource) 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](www.twilio.com/docs/sms/api/message-resource#delivery-related-errors) for a
failedstatus,. -
#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 within a [Conversation](www.twilio.com/docs/conversations/api/conversation-resource) 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 ⇒ DeliveryStatus
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
An absolute API resource 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
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 388 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'] == nil ? payload['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 || @properties['chat_service_sid'] ,'conversation_sid' => conversation_sid || @properties['conversation_sid'] ,'message_sid' => || @properties['message_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique ID of the [Account](www.twilio.com/docs/iam/api/account) responsible for this participant.
426 427 428 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 426 def account_sid @properties['account_sid'] end |
#channel_message_sid ⇒ String
Returns A messaging channel-specific identifier for the message delivered to participant e.g. SMxx for SMS, WAxx for Whatsapp etc.
456 457 458 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 456 def @properties['channel_message_sid'] end |
#chat_service_sid ⇒ String
Returns The SID of the [Conversation Service](www.twilio.com/docs/conversations/api/service-resource) the Message resource is associated with.
432 433 434 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 432 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
417 418 419 420 421 422 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 417 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](www.twilio.com/docs/conversations/api/conversation-resource) for this message.
438 439 440 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 438 def conversation_sid @properties['conversation_sid'] end |
#date_created ⇒ Time
Returns The date that this resource was created.
480 481 482 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 480 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated. null if the delivery receipt has not been updated.
486 487 488 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 486 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,.
474 475 476 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 474 def error_code @properties['error_code'] end |
#fetch ⇒ DeliveryReceiptInstance
Fetch the DeliveryReceiptInstance
499 500 501 502 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 499 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
513 514 515 516 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 513 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 within a [Conversation](www.twilio.com/docs/conversations/api/conversation-resource) the delivery receipt belongs to.
444 445 446 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 444 def @properties['message_sid'] end |
#participant_sid ⇒ String
Returns The unique ID of the participant the delivery receipt belongs to.
462 463 464 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 462 def participant_sid @properties['participant_sid'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
450 451 452 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 450 def sid @properties['sid'] end |
#status ⇒ DeliveryStatus
468 469 470 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 468 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
506 507 508 509 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 506 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.DeliveryReceiptInstance #{values}>" end |
#url ⇒ String
Returns An absolute API resource URL for this delivery receipt.
492 493 494 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 492 def url @properties['url'] end |