Class: Twilio::REST::Api::V2010::AccountContext::ConferenceContext::ParticipantContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, account_sid, conference_sid, call_sid) ⇒ ParticipantContext

Initialize the ParticipantContext



318
319
320
321
322
323
324
325
326
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 318

def initialize(version, , conference_sid, call_sid)
    super(version)

    # Path Solution
    @solution = { account_sid: , conference_sid: conference_sid, call_sid: call_sid,  }
    @uri = "/Accounts/#{@solution[:account_sid]}/Conferences/#{@solution[:conference_sid]}/Participants/#{@solution[:call_sid]}.json"

    
end

Instance Method Details

#deleteBoolean

Delete the ParticipantInstance



330
331
332
333
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 330

def delete

    @version.delete('DELETE', @uri)
end

#fetchParticipantInstance

Fetch the ParticipantInstance



338
339
340
341
342
343
344
345
346
347
348
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 338

def fetch

    payload = @version.fetch('GET', @uri)
    ParticipantInstance.new(
        @version,
        payload,
        account_sid: @solution[:account_sid],
        conference_sid: @solution[:conference_sid],
        call_sid: @solution[:call_sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



415
416
417
418
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 415

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Api.V2010.ParticipantContext #{context}>"
end

#to_sObject

Provide a user friendly representation



408
409
410
411
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 408

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Api.V2010.ParticipantContext #{context}>"
end

#update(muted: :unset, hold: :unset, hold_url: :unset, hold_method: :unset, announce_url: :unset, announce_method: :unset, wait_url: :unset, wait_method: :unset, beep_on_exit: :unset, end_conference_on_exit: :unset, coaching: :unset, call_sid_to_coach: :unset) ⇒ ParticipantInstance

Update the ParticipantInstance



365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 365

def update(
    muted: :unset, 
    hold: :unset, 
    hold_url: :unset, 
    hold_method: :unset, 
    announce_url: :unset, 
    announce_method: :unset, 
    wait_url: :unset, 
    wait_method: :unset, 
    beep_on_exit: :unset, 
    end_conference_on_exit: :unset, 
    coaching: :unset, 
    call_sid_to_coach: :unset
)

    data = Twilio::Values.of({
        'Muted' => muted,
        'Hold' => hold,
        'HoldUrl' => hold_url,
        'HoldMethod' => hold_method,
        'AnnounceUrl' => announce_url,
        'AnnounceMethod' => announce_method,
        'WaitUrl' => wait_url,
        'WaitMethod' => wait_method,
        'BeepOnExit' => beep_on_exit,
        'EndConferenceOnExit' => end_conference_on_exit,
        'Coaching' => coaching,
        'CallSidToCoach' => call_sid_to_coach,
    })

    payload = @version.update('POST', @uri, data: data)
    ParticipantInstance.new(
        @version,
        payload,
        account_sid: @solution[:account_sid],
        conference_sid: @solution[:conference_sid],
        call_sid: @solution[:call_sid],
    )
end