Class: Twilio::REST::Insights::V1::RoomContext::ParticipantInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, room_sid: nil, participant_sid: nil) ⇒ ParticipantInstance

Initialize the ParticipantInstance

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 Participant resource.

  • sid (String)

    The SID of the Call resource to fetch.



388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 388

def initialize(version, payload , room_sid: nil, participant_sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'participant_sid' => payload['participant_sid'],
        'participant_identity' => payload['participant_identity'],
        'join_time' => Twilio.deserialize_iso8601_datetime(payload['join_time']),
        'leave_time' => Twilio.deserialize_iso8601_datetime(payload['leave_time']),
        'duration_sec' => payload['duration_sec'],
        'account_sid' => payload['account_sid'],
        'room_sid' => payload['room_sid'],
        'status' => payload['status'],
        'codecs' => payload['codecs'],
        'end_reason' => payload['end_reason'],
        'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i,
        'error_code_url' => payload['error_code_url'],
        'media_region' => payload['media_region'],
        'properties' => payload['properties'],
        'edge_location' => payload['edge_location'],
        'publisher_info' => payload['publisher_info'],
        'url' => payload['url'],
    }

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

Instance Method Details

#account_sidString

Returns Account SID associated with the room.

Returns:

  • (String)

    Account SID associated with the room.



461
462
463
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 461

def 
    @properties['account_sid']
end

#codecsArray<Codec>

Returns Codecs detected from the participant. Can be ‘VP8`, `H264`, or `VP9`.

Returns:

  • (Array<Codec>)

    Codecs detected from the participant. Can be ‘VP8`, `H264`, or `VP9`.



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

def codecs
    @properties['codecs']
end

#contextParticipantContext

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

Returns:



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

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

#duration_secString

Returns Amount of time in seconds the participant was in the room.

Returns:

  • (String)

    Amount of time in seconds the participant was in the room.



455
456
457
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 455

def duration_sec
    @properties['duration_sec']
end

#edge_locationEdgeLocation

Returns:

  • (EdgeLocation)


515
516
517
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 515

def edge_location
    @properties['edge_location']
end

#end_reasonString

Returns Reason the participant left the room. See [the list of possible values here](www.twilio.com/docs/video/troubleshooting/video-log-analyzer-api#end_reason).

Returns:



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

def end_reason
    @properties['end_reason']
end

#error_codeString

Returns Errors encountered by the participant.

Returns:

  • (String)

    Errors encountered by the participant.



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

def error_code
    @properties['error_code']
end

#error_code_urlString

Returns Twilio error code dictionary link.

Returns:

  • (String)

    Twilio error code dictionary link.



497
498
499
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 497

def error_code_url
    @properties['error_code_url']
end

#fetchParticipantInstance

Fetch the ParticipantInstance

Returns:



534
535
536
537
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 534

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



548
549
550
551
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 548

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

#join_timeTime

Returns When the participant joined the room.

Returns:

  • (Time)

    When the participant joined the room.



443
444
445
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 443

def join_time
    @properties['join_time']
end

#leave_timeTime

Returns When the participant left the room.

Returns:

  • (Time)

    When the participant left the room.



449
450
451
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 449

def leave_time
    @properties['leave_time']
end

#media_regionTwilioRealm

Returns:

  • (TwilioRealm)


503
504
505
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 503

def media_region
    @properties['media_region']
end

#participant_identityString

Returns The application-defined string that uniquely identifies the participant within a Room.

Returns:

  • (String)

    The application-defined string that uniquely identifies the participant within a Room.



437
438
439
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 437

def participant_identity
    @properties['participant_identity']
end

#participant_sidString

Returns Unique identifier for the participant.

Returns:

  • (String)

    Unique identifier for the participant.



431
432
433
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 431

def participant_sid
    @properties['participant_sid']
end

#propertiesHash

Returns Object containing information about the participant’s data from the room. See [below](www.twilio.com/docs/video/troubleshooting/video-log-analyzer-api#properties) for more information.

Returns:



509
510
511
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 509

def properties
    @properties['properties']
end

#publisher_infoHash

Returns Object containing information about the SDK name and version. See [below](www.twilio.com/docs/video/troubleshooting/video-log-analyzer-api#publisher_info) for more information.

Returns:



521
522
523
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 521

def publisher_info
    @properties['publisher_info']
end

#room_sidString

Returns Unique identifier for the room.

Returns:

  • (String)

    Unique identifier for the room.



467
468
469
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 467

def room_sid
    @properties['room_sid']
end

#statusRoomStatus

Returns:

  • (RoomStatus)


473
474
475
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 473

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



541
542
543
544
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 541

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

#urlString

Returns URL of the participant resource.

Returns:

  • (String)

    URL of the participant resource.



527
528
529
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 527

def url
    @properties['url']
end