Class: Twilio::REST::Insights::V1::ConferenceContext::ConferenceParticipantInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, conference_sid: nil, participant_sid: nil) ⇒ ConferenceParticipantInstance

Initialize the ConferenceParticipantInstance

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

  • sid (String)

    The SID of the Call resource to fetch.



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
265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 239

def initialize(version, payload , conference_sid: nil, participant_sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'participant_sid' => payload['participant_sid'],
        'label' => payload['label'],
        'conference_sid' => payload['conference_sid'],
        'call_sid' => payload['call_sid'],
        'account_sid' => payload['account_sid'],
        'call_direction' => payload['call_direction'],
        'from' => payload['from'],
        'to' => payload['to'],
        'call_status' => payload['call_status'],
        'country_code' => payload['country_code'],
        'is_moderator' => payload['is_moderator'],
        'join_time' => Twilio.deserialize_iso8601_datetime(payload['join_time']),
        'leave_time' => Twilio.deserialize_iso8601_datetime(payload['leave_time']),
        'duration_seconds' => payload['duration_seconds'] == nil ? payload['duration_seconds'] : payload['duration_seconds'].to_i,
        'outbound_queue_length' => payload['outbound_queue_length'] == nil ? payload['outbound_queue_length'] : payload['outbound_queue_length'].to_i,
        'outbound_time_in_queue' => payload['outbound_time_in_queue'] == nil ? payload['outbound_time_in_queue'] : payload['outbound_time_in_queue'].to_i,
        'jitter_buffer_size' => payload['jitter_buffer_size'],
        'is_coach' => payload['is_coach'],
        'coached_participants' => payload['coached_participants'],
        'participant_region' => payload['participant_region'],
        'conference_region' => payload['conference_region'],
        'call_type' => payload['call_type'],
        'processing_state' => payload['processing_state'],
        'properties' => payload['properties'],
        'events' => payload['events'],
        'metrics' => payload['metrics'],
        'url' => payload['url'],
    }

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

Instance Method Details

#account_sidString

Returns The unique SID identifier of the Account.

Returns:

  • (String)

    The unique SID identifier of the Account.



315
316
317
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 315

def 
    @properties['account_sid']
end

#call_directionCallDirection

Returns:

  • (CallDirection)


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

def call_direction
    @properties['call_direction']
end

#call_sidString

Returns Unique SID identifier of the call that generated the Participant resource.

Returns:

  • (String)

    Unique SID identifier of the call that generated the Participant resource.



309
310
311
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 309

def call_sid
    @properties['call_sid']
end

#call_statusCallStatus

Returns:

  • (CallStatus)


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

def call_status
    @properties['call_status']
end

#call_typeCallType

Returns:

  • (CallType)


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

def call_type
    @properties['call_type']
end

#coached_participantsArray<String>

Returns Call SIDs coached by this participant.

Returns:

  • (Array<String>)

    Call SIDs coached by this participant.



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

def coached_participants
    @properties['coached_participants']
end

#conference_regionRegion

Returns:

  • (Region)


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

def conference_region
    @properties['conference_region']
end

#conference_sidString

Returns The unique SID identifier of the Conference.

Returns:

  • (String)

    The unique SID identifier of the Conference.



303
304
305
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 303

def conference_sid
    @properties['conference_sid']
end

#contextConferenceParticipantContext

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

Returns:



282
283
284
285
286
287
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 282

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

#country_codeString

Returns ISO alpha-2 country code of the participant based on caller ID or called number.

Returns:

  • (String)

    ISO alpha-2 country code of the participant based on caller ID or called number.



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

def country_code
    @properties['country_code']
end

#duration_secondsString

Returns Participant durations in seconds.

Returns:

  • (String)

    Participant durations in seconds.



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

def duration_seconds
    @properties['duration_seconds']
end

#eventsHash

Returns Object containing information of actions taken by participants. Contains a dictionary of URL links to nested resources of this Conference Participant.

Returns:

  • (Hash)

    Object containing information of actions taken by participants. Contains a dictionary of URL links to nested resources of this Conference Participant.



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

def events
    @properties['events']
end

#fetch(events: :unset, metrics: :unset) ⇒ ConferenceParticipantInstance

Fetch the ConferenceParticipantInstance

Parameters:

  • events (String) (defaults to: :unset)

    Conference events generated by application or participant activity; e.g. ‘hold`, `mute`, etc.

  • metrics (String) (defaults to: :unset)

    Object. Contains participant call quality metrics.

Returns:



456
457
458
459
460
461
462
463
464
465
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 456

def fetch(
    events: :unset, 
    metrics: :unset
)

    context.fetch(
        events: events, 
        metrics: metrics, 
    )
end

#fromString

Returns Caller ID of the calling party.

Returns:

  • (String)

    Caller ID of the calling party.



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

def from
    @properties['from']
end

#inspectObject

Provide a detailed, user friendly representation



476
477
478
479
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 476

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

#is_coachBoolean

Returns Boolean. Indicated whether participant was a coach.

Returns:

  • (Boolean)

    Boolean. Indicated whether participant was a coach.



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

def is_coach
    @properties['is_coach']
end

#is_moderatorBoolean

Returns Boolean. Indicates whether participant had startConferenceOnEnter=true or endConferenceOnExit=true.

Returns:

  • (Boolean)

    Boolean. Indicates whether participant had startConferenceOnEnter=true or endConferenceOnExit=true.



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

def is_moderator
    @properties['is_moderator']
end

#jitter_buffer_sizeJitterBufferSize

Returns:

  • (JitterBufferSize)


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

def jitter_buffer_size
    @properties['jitter_buffer_size']
end

#join_timeTime

Returns ISO 8601 timestamp of participant join event.

Returns:

  • (Time)

    ISO 8601 timestamp of participant join event.



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

def join_time
    @properties['join_time']
end

#labelString

Returns The user-specified label of this participant.

Returns:

  • (String)

    The user-specified label of this participant.



297
298
299
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 297

def label
    @properties['label']
end

#leave_timeTime

Returns ISO 8601 timestamp of participant leave event.

Returns:

  • (Time)

    ISO 8601 timestamp of participant leave event.



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

def leave_time
    @properties['leave_time']
end

#metricsHash

Returns Object. Contains participant call quality metrics.

Returns:

  • (Hash)

    Object. Contains participant call quality metrics.



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

def metrics
    @properties['metrics']
end

#outbound_queue_lengthString

Returns Add Participant API only. Estimated time in queue at call creation.

Returns:

  • (String)

    Add Participant API only. Estimated time in queue at call creation.



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

def outbound_queue_length
    @properties['outbound_queue_length']
end

#outbound_time_in_queueString

Returns Add Participant API only. Actual time in queue in seconds.

Returns:

  • (String)

    Add Participant API only. Actual time in queue in seconds.



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

def outbound_time_in_queue
    @properties['outbound_time_in_queue']
end

#participant_regionRegion

Returns:

  • (Region)


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

def participant_region
    @properties['participant_region']
end

#participant_sidString

Returns SID for this participant.

Returns:

  • (String)

    SID for this participant.



291
292
293
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 291

def participant_sid
    @properties['participant_sid']
end

#processing_stateProcessingState

Returns:

  • (ProcessingState)


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

def processing_state
    @properties['processing_state']
end

#propertiesHash

Returns Participant properties and metadata.

Returns:

  • (Hash)

    Participant properties and metadata.



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

def properties
    @properties['properties']
end

#toString

Returns Called party.

Returns:

  • (String)

    Called party.



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

def to
    @properties['to']
end

#to_sObject

Provide a user friendly representation



469
470
471
472
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 469

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

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



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

def url
    @properties['url']
end