Class: Twilio::REST::Preview::Proxy::ServiceContext::SessionContext::ParticipantContext::MessageInteractionInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, service_sid: nil, session_sid: nil, participant_sid: nil, sid: nil) ⇒ MessageInteractionInstance

Initialize the MessageInteractionInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • service_sid (String) (defaults to: nil)

    The unique SID identifier of the Service.

  • session_sid (String) (defaults to: nil)

    The unique SID identifier of the Session.

  • participant_sid (String) (defaults to: nil)

    The participant_sid

  • sid (String) (defaults to: nil)

    A 34 character string that uniquely identifies this Interaction.



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 254

def initialize(version, payload, service_sid: nil, session_sid: nil, participant_sid: nil, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'session_sid' => payload['session_sid'],
      'service_sid' => payload['service_sid'],
      'account_sid' => payload['account_sid'],
      'data' => payload['data'],
      'status' => payload['status'],
      'participant_sid' => payload['participant_sid'],
      'inbound_participant_sid' => payload['inbound_participant_sid'],
      'inbound_resource_sid' => payload['inbound_resource_sid'],
      'inbound_resource_status' => payload['inbound_resource_status'],
      'inbound_resource_type' => payload['inbound_resource_type'],
      'inbound_resource_url' => payload['inbound_resource_url'],
      'outbound_participant_sid' => payload['outbound_participant_sid'],
      'outbound_resource_sid' => payload['outbound_resource_sid'],
      'outbound_resource_status' => payload['outbound_resource_status'],
      'outbound_resource_type' => payload['outbound_resource_type'],
      'outbound_resource_url' => payload['outbound_resource_url'],
      '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 = {
      'service_sid' => service_sid,
      'session_sid' => session_sid,
      'participant_sid' => participant_sid,
      'sid' => sid || @properties['sid'],
  }
end

Instance Method Details

#account_sidString

Returns Account Sid.

Returns:

  • (String)

    Account Sid.



328
329
330
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 328

def 
  @properties['account_sid']
end

#contextMessageInteractionContext

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

Returns:



295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 295

def context
  unless @instance_context
    @instance_context = MessageInteractionContext.new(
        @version,
        @params['service_sid'],
        @params['session_sid'],
        @params['participant_sid'],
        @params['sid'],
    )
  end
  @instance_context
end

#dataString

Returns What happened in this Interaction.

Returns:

  • (String)

    What happened in this Interaction.



334
335
336
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 334

def data
  @properties['data']
end

#date_createdTime

Returns The date this Interaction was created.

Returns:

  • (Time)

    The date this Interaction was created



412
413
414
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 412

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The date this Interaction was updated.

Returns:

  • (Time)

    The date this Interaction was updated



418
419
420
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 418

def date_updated
  @properties['date_updated']
end

#fetchMessageInteractionInstance

Fetch a MessageInteractionInstance

Returns:



431
432
433
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 431

def fetch
  context.fetch
end

#inbound_participant_sidString

Returns The inbound_participant_sid.

Returns:

  • (String)

    The inbound_participant_sid



352
353
354
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 352

def inbound_participant_sid
  @properties['inbound_participant_sid']
end

#inbound_resource_sidString

Returns The SID of the inbound resource.

Returns:

  • (String)

    The SID of the inbound resource.



358
359
360
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 358

def inbound_resource_sid
  @properties['inbound_resource_sid']
end

#inbound_resource_statusmessage_interaction.ResourceStatus

Returns The Inbound Resource Status of this Interaction.

Returns:

  • (message_interaction.ResourceStatus)

    The Inbound Resource Status of this Interaction



364
365
366
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 364

def inbound_resource_status
  @properties['inbound_resource_status']
end

#inbound_resource_typeString

Returns The Twilio object type of the inbound resource.

Returns:

  • (String)

    The Twilio object type of the inbound resource.



370
371
372
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 370

def inbound_resource_type
  @properties['inbound_resource_type']
end

#inbound_resource_urlString

Returns The URL of the inbound resource.

Returns:

  • (String)

    The URL of the inbound resource.



376
377
378
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 376

def inbound_resource_url
  @properties['inbound_resource_url']
end

#inspectObject

Provide a detailed, user friendly representation



444
445
446
447
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 444

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

#outbound_participant_sidString

Returns The outbound_participant_sid.

Returns:

  • (String)

    The outbound_participant_sid



382
383
384
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 382

def outbound_participant_sid
  @properties['outbound_participant_sid']
end

#outbound_resource_sidString

Returns The SID of the outbound resource.

Returns:

  • (String)

    The SID of the outbound resource.



388
389
390
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 388

def outbound_resource_sid
  @properties['outbound_resource_sid']
end

#outbound_resource_statusmessage_interaction.ResourceStatus

Returns The Outbound Resource Status of this Interaction.

Returns:

  • (message_interaction.ResourceStatus)

    The Outbound Resource Status of this Interaction



394
395
396
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 394

def outbound_resource_status
  @properties['outbound_resource_status']
end

#outbound_resource_typeString

Returns The Twilio object type of the outbound resource.

Returns:

  • (String)

    The Twilio object type of the outbound resource.



400
401
402
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 400

def outbound_resource_type
  @properties['outbound_resource_type']
end

#outbound_resource_urlString

Returns The URL of the outbound resource.

Returns:

  • (String)

    The URL of the outbound resource.



406
407
408
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 406

def outbound_resource_url
  @properties['outbound_resource_url']
end

#participant_sidString

Returns The participant_sid.

Returns:

  • (String)

    The participant_sid



346
347
348
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 346

def participant_sid
  @properties['participant_sid']
end

#service_sidString

Returns Service Sid.

Returns:

  • (String)

    Service Sid.



322
323
324
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 322

def service_sid
  @properties['service_sid']
end

#session_sidString

Returns Session Sid.

Returns:

  • (String)

    Session Sid.



316
317
318
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 316

def session_sid
  @properties['session_sid']
end

#sidString

Returns A string that uniquely identifies this Interaction.

Returns:

  • (String)

    A string that uniquely identifies this Interaction.



310
311
312
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 310

def sid
  @properties['sid']
end

#statusmessage_interaction.Status

Returns The Status of this Interaction.

Returns:

  • (message_interaction.Status)

    The Status of this Interaction



340
341
342
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 340

def status
  @properties['status']
end

#to_sObject

Provide a user friendly representation



437
438
439
440
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 437

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

#urlString

Returns The URL of this Interaction.

Returns:

  • (String)

    The URL of this Interaction.



424
425
426
# File 'lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb', line 424

def url
  @properties['url']
end