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
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.
-
#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 ‘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 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, conversation_sid: nil, message_sid: nil, sid: nil) ⇒ DeliveryReceiptInstance
Initialize the DeliveryReceiptInstance
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 225 def initialize(version, payload , conversation_sid: nil, message_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'conversation_sid' => payload['conversation_sid'], 'sid' => payload['sid'], 'message_sid' => payload['message_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 = { '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.
261 262 263 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 261 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.
285 286 287 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 285 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
252 253 254 255 256 257 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 252 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 unique ID of the [Conversation](www.twilio.com/docs/conversations/api/conversation-resource) for this message.
267 268 269 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 267 def conversation_sid @properties['conversation_sid'] end |
#date_created ⇒ Time
Returns The date that this resource was created.
309 310 311 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 309 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.
315 316 317 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 315 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,.
303 304 305 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 303 def error_code @properties['error_code'] end |
#fetch ⇒ DeliveryReceiptInstance
Fetch the DeliveryReceiptInstance
328 329 330 331 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 328 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
342 343 344 345 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 342 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.
279 280 281 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 279 def @properties['message_sid'] end |
#participant_sid ⇒ String
Returns The unique ID of the participant the delivery receipt belongs to.
291 292 293 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 291 def participant_sid @properties['participant_sid'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
273 274 275 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 273 def sid @properties['sid'] end |
#status ⇒ DeliveryStatus
297 298 299 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 297 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
335 336 337 338 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 335 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.
321 322 323 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb', line 321 def url @properties['url'] end |