Class: Twilio::REST::Insights::V1::RoomInstance

Inherits:
Twilio::REST::InstanceResource show all
Defined in:
lib/twilio-ruby/rest/insights/v1/room.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, room_sid: nil) ⇒ RoomInstance

Initialize the RoomInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • room_sid (String) (defaults to: nil)

    The SID of the Room resource.


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
290
291
292
293
294
295
296
297
298
299
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 263

def initialize(version, payload, room_sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'room_sid' => payload['room_sid'],
      'room_name' => payload['room_name'],
      'create_time' => Twilio.deserialize_iso8601_datetime(payload['create_time']),
      'end_time' => Twilio.deserialize_iso8601_datetime(payload['end_time']),
      'room_type' => payload['room_type'],
      'room_status' => payload['room_status'],
      'status_callback' => payload['status_callback'],
      'status_callback_method' => payload['status_callback_method'],
      'created_method' => payload['created_method'],
      'end_reason' => payload['end_reason'],
      'max_participants' => payload['max_participants'] == nil ? payload['max_participants'] : payload['max_participants'].to_i,
      'unique_participants' => payload['unique_participants'] == nil ? payload['unique_participants'] : payload['unique_participants'].to_i,
      'unique_participant_identities' => payload['unique_participant_identities'] == nil ? payload['unique_participant_identities'] : payload['unique_participant_identities'].to_i,
      'concurrent_participants' => payload['concurrent_participants'] == nil ? payload['concurrent_participants'] : payload['concurrent_participants'].to_i,
      'max_concurrent_participants' => payload['max_concurrent_participants'] == nil ? payload['max_concurrent_participants'] : payload['max_concurrent_participants'].to_i,
      'codecs' => payload['codecs'],
      'media_region' => payload['media_region'],
      'duration_sec' => payload['duration_sec'].to_i,
      'total_participant_duration_sec' => payload['total_participant_duration_sec'].to_i,
      'total_recording_duration_sec' => payload['total_recording_duration_sec'].to_i,
      'processing_state' => payload['processing_state'],
      'recording_enabled' => payload['recording_enabled'],
      'edge_location' => payload['edge_location'],
      'url' => payload['url'],
      'links' => payload['links'],
  }

  # Context
  @instance_context = nil
  @params = {'room_sid' => room_sid || @properties['room_sid'], }
end

Instance Method Details

#account_sidString

Returns Account SID associated with this room.

Returns:

  • (String)

    Account SID associated with this room.


314
315
316
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 314

def 
  @properties['account_sid']
end

#codecsArray[room.Codec]

Returns Codecs used by participants in the room.

Returns:

  • (Array[room.Codec])

    Codecs used by participants in the room.


410
411
412
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 410

def codecs
  @properties['codecs']
end

#concurrent_participantsString

Returns Actual number of concurrent participants.

Returns:

  • (String)

    Actual number of concurrent participants.


398
399
400
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 398

def concurrent_participants
  @properties['concurrent_participants']
end

#contextRoomContext

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

Returns:


305
306
307
308
309
310
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 305

def context
  unless @instance_context
    @instance_context = RoomContext.new(@version, @params['room_sid'], )
  end
  @instance_context
end

#create_timeTime

Returns Creation time of the room.

Returns:

  • (Time)

    Creation time of the room.


332
333
334
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 332

def create_time
  @properties['create_time']
end

#created_methodroom.CreatedMethod

Returns How the room was created.

Returns:

  • (room.CreatedMethod)

    How the room was created.


368
369
370
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 368

def created_method
  @properties['created_method']
end

#duration_secString

Returns Total room duration from create time to end time.

Returns:

  • (String)

    Total room duration from create time to end time.


422
423
424
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 422

def duration_sec
  @properties['duration_sec']
end

#edge_locationroom.EdgeLocation

Returns Edge location of Twilio media servers for the room.

Returns:

  • (room.EdgeLocation)

    Edge location of Twilio media servers for the room.


452
453
454
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 452

def edge_location
  @properties['edge_location']
end

#end_reasonroom.EndReason

Returns Reason the room ended.

Returns:

  • (room.EndReason)

    Reason the room ended.


374
375
376
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 374

def end_reason
  @properties['end_reason']
end

#end_timeTime

Returns End time for the room.

Returns:

  • (Time)

    End time for the room.


338
339
340
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 338

def end_time
  @properties['end_time']
end

#fetchRoomInstance

Fetch the RoomInstance

Returns:


471
472
473
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 471

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation


491
492
493
494
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 491

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

Returns Room subresources.

Returns:

  • (String)

    Room subresources.


464
465
466
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 464

def links
  @properties['links']
end

#max_concurrent_participantsString

Returns Maximum number of participants allowed in the room at the same time allowed by the application settings.

Returns:

  • (String)

    Maximum number of participants allowed in the room at the same time allowed by the application settings.


404
405
406
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 404

def max_concurrent_participants
  @properties['max_concurrent_participants']
end

#max_participantsString

Returns Max number of total participants allowed by the application settings.

Returns:

  • (String)

    Max number of total participants allowed by the application settings.


380
381
382
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 380

def max_participants
  @properties['max_participants']
end

#media_regionroom.TwilioRealm

Returns Region of Twilio media servers for the room.

Returns:

  • (room.TwilioRealm)

    Region of Twilio media servers for the room.


416
417
418
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 416

def media_region
  @properties['media_region']
end

#participantsparticipants

Access the participants

Returns:


478
479
480
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 478

def participants
  context.participants
end

#processing_stateroom.ProcessingState

Returns Video Log Analyzer resource state. Will be either `in-progress` or `complete`.

Returns:

  • (room.ProcessingState)

    Video Log Analyzer resource state. Will be either `in-progress` or `complete`.


440
441
442
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 440

def processing_state
  @properties['processing_state']
end

#recording_enabledBoolean

Returns Boolean indicating if recording is enabled for the room.

Returns:

  • (Boolean)

    Boolean indicating if recording is enabled for the room.


446
447
448
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 446

def recording_enabled
  @properties['recording_enabled']
end

#room_nameString

Returns room friendly name.

Returns:

  • (String)

    room friendly name.


326
327
328
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 326

def room_name
  @properties['room_name']
end

#room_sidString

Returns Unique identifier for the room.

Returns:

  • (String)

    Unique identifier for the room.


320
321
322
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 320

def room_sid
  @properties['room_sid']
end

#room_statusroom.RoomStatus

Returns Status of the room.

Returns:

  • (room.RoomStatus)

    Status of the room.


350
351
352
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 350

def room_status
  @properties['room_status']
end

#room_typeroom.RoomType

Returns Type of room.

Returns:

  • (room.RoomType)

    Type of room.


344
345
346
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 344

def room_type
  @properties['room_type']
end

#status_callbackString

Returns Webhook provided for status callbacks.

Returns:

  • (String)

    Webhook provided for status callbacks.


356
357
358
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 356

def status_callback
  @properties['status_callback']
end

#status_callback_methodString

Returns HTTP method provided for status callback URL.

Returns:

  • (String)

    HTTP method provided for status callback URL.


362
363
364
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 362

def status_callback_method
  @properties['status_callback_method']
end

#to_sObject

Provide a user friendly representation


484
485
486
487
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 484

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

#total_participant_duration_secString

Returns Combined amount of participant time in the room.

Returns:

  • (String)

    Combined amount of participant time in the room.


428
429
430
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 428

def total_participant_duration_sec
  @properties['total_participant_duration_sec']
end

#total_recording_duration_secString

Returns Combined amount of recorded seconds for participants in the room.

Returns:

  • (String)

    Combined amount of recorded seconds for participants in the room.


434
435
436
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 434

def total_recording_duration_sec
  @properties['total_recording_duration_sec']
end

#unique_participant_identitiesString

Returns Unique number of participant identities.

Returns:

  • (String)

    Unique number of participant identities.


392
393
394
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 392

def unique_participant_identities
  @properties['unique_participant_identities']
end

#unique_participantsString

Returns Number of participants. May include duplicate identities for participants who left and rejoined.

Returns:

  • (String)

    Number of participants. May include duplicate identities for participants who left and rejoined.


386
387
388
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 386

def unique_participants
  @properties['unique_participants']
end

#urlString

Returns URL for the room resource.

Returns:

  • (String)

    URL for the room resource.


458
459
460
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 458

def url
  @properties['url']
end