Class: Twilio::REST::Conversations::V1::ServiceContext::ConversationContext::MessageContext::DeliveryReceiptInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, chat_service_sid: nil, 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
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 220

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' => message_sid  || @properties['message_sid']  ,'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#account_sidString



257
258
259
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 257

def 
    @properties['account_sid']
end

#channel_message_sidString



287
288
289
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 287

def channel_message_sid
    @properties['channel_message_sid']
end

#chat_service_sidString



263
264
265
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 263

def chat_service_sid
    @properties['chat_service_sid']
end

#contextDeliveryReceiptContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context



248
249
250
251
252
253
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 248

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_sidString



269
270
271
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 269

def conversation_sid
    @properties['conversation_sid']
end

#date_createdTime



311
312
313
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 311

def date_created
    @properties['date_created']
end

#date_updatedTime



317
318
319
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 317

def date_updated
    @properties['date_updated']
end

#error_codeString



305
306
307
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 305

def error_code
    @properties['error_code']
end

#fetchDeliveryReceiptInstance

Fetch the DeliveryReceiptInstance



330
331
332
333
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 330

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



344
345
346
347
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 344

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Conversations.V1.DeliveryReceiptInstance #{values}>"
end

#message_sidString



275
276
277
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 275

def message_sid
    @properties['message_sid']
end

#participant_sidString



293
294
295
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 293

def participant_sid
    @properties['participant_sid']
end

#sidString



281
282
283
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 281

def sid
    @properties['sid']
end

#statusDeliveryStatus



299
300
301
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 299

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



337
338
339
340
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 337

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Conversations.V1.DeliveryReceiptInstance #{values}>"
end

#urlString



323
324
325
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb', line 323

def url
    @properties['url']
end