Class: Twilio::REST::Proxy::V1::ServiceContext::SessionContext::InteractionInstance

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

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Instance Method Summary collapse

Constructor Details

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

Initialize the InteractionInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • service_sid (String) (defaults to: nil)

    The SID of the parent Service resource.

  • session_sid (String) (defaults to: nil)

    The SID of the parent Session resource.

  • sid (String) (defaults to: nil)

    The Twilio-provided string that uniquely identifies the Interaction resource to fetch.


231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 231

def initialize(version, payload, service_sid: nil, session_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'],
      'type' => payload['type'],
      '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,
      'sid' => sid || @properties['sid'],
  }
end

Instance Method Details

#account_sidString

Returns The SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource


302
303
304
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 302

def 
  @properties['account_sid']
end

#contextInteractionContext

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

Returns:


270
271
272
273
274
275
276
277
278
279
280
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 270

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

#dataString

Returns A JSON string that includes the message body of message interactions.

Returns:

  • (String)

    A JSON string that includes the message body of message interactions


308
309
310
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 308

def data
  @properties['data']
end

#date_createdTime

Returns The ISO 8601 date and time in GMT when the Interaction was created.

Returns:

  • (Time)

    The ISO 8601 date and time in GMT when the Interaction was created


380
381
382
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 380

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The ISO 8601 date and time in GMT when the resource was last updated.

Returns:

  • (Time)

    The ISO 8601 date and time in GMT when the resource was last updated


386
387
388
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 386

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Delete the InteractionInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


406
407
408
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 406

def delete
  context.delete
end

#fetchInteractionInstance

Fetch the InteractionInstance

Returns:


399
400
401
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 399

def fetch
  context.fetch
end

#inbound_participant_sidString

Returns The SID of the inbound Participant resource.

Returns:

  • (String)

    The SID of the inbound Participant resource


320
321
322
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 320

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


326
327
328
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 326

def inbound_resource_sid
  @properties['inbound_resource_sid']
end

#inbound_resource_statusinteraction.ResourceStatus

Returns The inbound resource status of the Interaction.

Returns:

  • (interaction.ResourceStatus)

    The inbound resource status of the Interaction


332
333
334
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 332

def inbound_resource_status
  @properties['inbound_resource_status']
end

#inbound_resource_typeString

Returns The inbound resource type.

Returns:

  • (String)

    The inbound resource type


338
339
340
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 338

def inbound_resource_type
  @properties['inbound_resource_type']
end

#inbound_resource_urlString

Returns The URL of the Twilio inbound resource.

Returns:

  • (String)

    The URL of the Twilio inbound resource


344
345
346
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 344

def inbound_resource_url
  @properties['inbound_resource_url']
end

#inspectObject

Provide a detailed, user friendly representation


419
420
421
422
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 419

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

#outbound_participant_sidString

Returns The SID of the outbound Participant.

Returns:

  • (String)

    The SID of the outbound Participant


350
351
352
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 350

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


356
357
358
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 356

def outbound_resource_sid
  @properties['outbound_resource_sid']
end

#outbound_resource_statusinteraction.ResourceStatus

Returns The outbound resource status of the Interaction.

Returns:

  • (interaction.ResourceStatus)

    The outbound resource status of the Interaction


362
363
364
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 362

def outbound_resource_status
  @properties['outbound_resource_status']
end

#outbound_resource_typeString

Returns The outbound resource type.

Returns:

  • (String)

    The outbound resource type


368
369
370
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 368

def outbound_resource_type
  @properties['outbound_resource_type']
end

#outbound_resource_urlString

Returns The URL of the Twilio outbound resource.

Returns:

  • (String)

    The URL of the Twilio outbound resource


374
375
376
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 374

def outbound_resource_url
  @properties['outbound_resource_url']
end

#service_sidString

Returns The SID of the resource's parent Service.

Returns:

  • (String)

    The SID of the resource's parent Service


296
297
298
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 296

def service_sid
  @properties['service_sid']
end

#session_sidString

Returns The SID of the resource's parent Session.

Returns:

  • (String)

    The SID of the resource's parent Session


290
291
292
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 290

def session_sid
  @properties['session_sid']
end

#sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource


284
285
286
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 284

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation


412
413
414
415
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 412

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

#typeinteraction.Type

Returns The Type of the Interaction.

Returns:

  • (interaction.Type)

    The Type of the Interaction


314
315
316
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 314

def type
  @properties['type']
end

#urlString

Returns The absolute URL of the Interaction resource.

Returns:

  • (String)

    The absolute URL of the Interaction resource


392
393
394
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 392

def url
  @properties['url']
end