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

Inherits:
Twilio::REST::InstanceResource show all
Defined in:
lib/twilio-ruby/rest/insights/v1/room.rb

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

  • account_sid (String)

    The SID of the Account that created this Room resource.

  • sid (String)

    The SID of the Call resource to fetch.



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
300
301
302
303
304
305
306
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 270

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'],
        'total_participant_duration_sec' => payload['total_participant_duration_sec'],
        'total_recording_duration_sec' => payload['total_recording_duration_sec'],
        '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.



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

def 
    @properties['account_sid']
end

#codecsArray<Codec>

Returns Codecs used by participants in the room. Can be ‘VP8`, `H264`, or `VP9`.

Returns:

  • (Array<Codec>)

    Codecs used by participants in the room. Can be ‘VP8`, `H264`, or `VP9`.



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

def codecs
    @properties['codecs']
end

#concurrent_participantsString

Returns Actual number of concurrent participants.

Returns:

  • (String)

    Actual number of concurrent participants.



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

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:



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

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.



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

def create_time
    @properties['create_time']
end

#created_methodCreatedMethod

Returns:

  • (CreatedMethod)


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

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.



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

def duration_sec
    @properties['duration_sec']
end

#edge_locationEdgeLocation

Returns:

  • (EdgeLocation)


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

def edge_location
    @properties['edge_location']
end

#end_reasonEndReason

Returns:

  • (EndReason)


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

def end_reason
    @properties['end_reason']
end

#end_timeTime

Returns End time for the room.

Returns:

  • (Time)

    End time for the room.



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

def end_time
    @properties['end_time']
end

#fetchRoomInstance

Fetch the RoomInstance

Returns:



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

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



499
500
501
502
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 499

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

Returns Room subresources.

Returns:

  • (Hash)

    Room subresources.



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

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.



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

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.



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

def max_participants
    @properties['max_participants']
end

#media_regionTwilioRealm

Returns:

  • (TwilioRealm)


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

def media_region
    @properties['media_region']
end

#participantsparticipants

Access the participants

Returns:



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

def participants
    context.participants
end

#processing_stateProcessingState

Returns:

  • (ProcessingState)


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

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.



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

def recording_enabled
    @properties['recording_enabled']
end

#room_nameString

Returns Room friendly name.

Returns:

  • (String)

    Room friendly name.



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

def room_name
    @properties['room_name']
end

#room_sidString

Returns Unique identifier for the room.

Returns:

  • (String)

    Unique identifier for the room.



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

def room_sid
    @properties['room_sid']
end

#room_statusRoomStatus

Returns:

  • (RoomStatus)


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

def room_status
    @properties['room_status']
end

#room_typeRoomType

Returns:

  • (RoomType)


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

def room_type
    @properties['room_type']
end

#status_callbackString

Returns Webhook provided for status callbacks.

Returns:

  • (String)

    Webhook provided for status callbacks.



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

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.



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

def status_callback_method
    @properties['status_callback_method']
end

#to_sObject

Provide a user friendly representation



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

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.



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

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.



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

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.



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

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.



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

def unique_participants
    @properties['unique_participants']
end

#urlString

Returns URL for the room resource.

Returns:

  • (String)

    URL for the room resource.



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

def url
    @properties['url']
end