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

  • conference_sid (String) (defaults to: nil)

    The conference_sid

  • participant_sid (String) (defaults to: nil)

    The participant_sid



223
224
225
226
227
228
229
230
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
265
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 223

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_state' => payload['call_state'],
      '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,
      'whisper' => payload['whisper'],
      'agent_audio' => payload['agent_audio'],
      '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'],
      'quality_issues' => payload['quality_issues'] == nil ? payload['quality_issues'] : payload['quality_issues'].to_i,
      'properties' => payload['properties'],
      'events' => payload['events'],
      'metrics' => payload['metrics'],
      'url' => payload['url'],
  }

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

Instance Method Details

#account_sidString

Returns The account_sid.

Returns:

  • (String)

    The account_sid



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

def 
  @properties['account_sid']
end

#agent_audioBoolean

Returns The agent_audio.

Returns:

  • (Boolean)

    The agent_audio



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

def agent_audio
  @properties['agent_audio']
end

#call_directionconference_participant.CallDirection

Returns The call_direction.

Returns:

  • (conference_participant.CallDirection)

    The call_direction



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

def call_direction
  @properties['call_direction']
end

#call_sidString

Returns The call_sid.

Returns:

  • (String)

    The call_sid



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

def call_sid
  @properties['call_sid']
end

#call_stateconference_participant.CallState

Returns The call_state.

Returns:

  • (conference_participant.CallState)

    The call_state



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

def call_state
  @properties['call_state']
end

#call_typeconference_participant.CallType

Returns The call_type.

Returns:

  • (conference_participant.CallType)

    The call_type



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

def call_type
  @properties['call_type']
end

#coached_participantsArray[String]

Returns The coached_participants.

Returns:

  • (Array[String])

    The coached_participants



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

def coached_participants
  @properties['coached_participants']
end

#conference_regionconference_participant.Region

Returns The conference_region.

Returns:

  • (conference_participant.Region)

    The conference_region



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

def conference_region
  @properties['conference_region']
end

#conference_sidString

Returns The conference_sid.

Returns:

  • (String)

    The conference_sid



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

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:



271
272
273
274
275
276
277
278
279
280
# File 'lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb', line 271

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

#country_codeString

Returns The country_code.

Returns:

  • (String)

    The country_code



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

def country_code
  @properties['country_code']
end

#duration_secondsString

Returns The duration_seconds.

Returns:

  • (String)

    The duration_seconds



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

def duration_seconds
  @properties['duration_seconds']
end

#eventsHash

Returns The events.

Returns:

  • (Hash)

    The events



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

def events
  @properties['events']
end

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

Fetch the ConferenceParticipantInstance

Parameters:

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

    The events

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

    The metrics

Returns:



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

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

#fromString

Returns The from.

Returns:

  • (String)

    The from



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

def from
  @properties['from']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#is_coachBoolean

Returns The is_coach.

Returns:

  • (Boolean)

    The is_coach



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

def is_coach
  @properties['is_coach']
end

#is_moderatorBoolean

Returns The is_moderator.

Returns:

  • (Boolean)

    The is_moderator



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

def is_moderator
  @properties['is_moderator']
end

#jitter_buffer_sizeconference_participant.JitterBufferSize

Returns The jitter_buffer_size.

Returns:

  • (conference_participant.JitterBufferSize)

    The jitter_buffer_size



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

def jitter_buffer_size
  @properties['jitter_buffer_size']
end

#join_timeTime

Returns The join_time.

Returns:

  • (Time)

    The join_time



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

def join_time
  @properties['join_time']
end

#labelString

Returns The label.

Returns:

  • (String)

    The label



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

def label
  @properties['label']
end

#leave_timeTime

Returns The leave_time.

Returns:

  • (Time)

    The leave_time



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

def leave_time
  @properties['leave_time']
end

#metricsHash

Returns The metrics.

Returns:

  • (Hash)

    The metrics



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

def metrics
  @properties['metrics']
end

#outbound_queue_lengthString

Returns The outbound_queue_length.

Returns:

  • (String)

    The outbound_queue_length



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

def outbound_queue_length
  @properties['outbound_queue_length']
end

#outbound_time_in_queueString

Returns The outbound_time_in_queue.

Returns:

  • (String)

    The outbound_time_in_queue



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

def outbound_time_in_queue
  @properties['outbound_time_in_queue']
end

#participant_regionconference_participant.Region

Returns The participant_region.

Returns:

  • (conference_participant.Region)

    The participant_region



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

def participant_region
  @properties['participant_region']
end

#participant_sidString

Returns The participant_sid.

Returns:

  • (String)

    The participant_sid



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

def participant_sid
  @properties['participant_sid']
end

#propertiesHash

Returns The properties.

Returns:

  • (Hash)

    The properties



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

def properties
  @properties['properties']
end

#quality_issuesString

Returns The quality_issues.

Returns:

  • (String)

    The quality_issues



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

def quality_issues
  @properties['quality_issues']
end

#toString

Returns The to.

Returns:

  • (String)

    The to



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

def to
  @properties['to']
end

#to_sObject

Provide a user friendly representation



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

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

#urlString

Returns The url.

Returns:

  • (String)

    The url



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

def url
  @properties['url']
end

#whisperString

Returns The whisper.

Returns:

  • (String)

    The whisper



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

def whisper
  @properties['whisper']
end