class Twilio::REST::Api::V2010::AccountContext::ConferenceContext::ParticipantContext
Public Class Methods
Initialize the ParticipantContext
@param [Version] version Version
that contains the resource @param [String] account_sid The SID of the
{Account}[https://www.twilio.com/docs/iam/api/account] that created the Participant resource to fetch.
@param [String] conference_sid The SID of the conference with the participant to
fetch.
@param [String] call_sid The
{Call}[https://www.twilio.com/docs/voice/api/call-resource] SID or label of the participant to fetch. Non URL safe characters in a label must be percent encoded, for example, a space character is represented as %20.
@return [ParticipantContext] ParticipantContext
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb 388 def initialize(version, account_sid, conference_sid, call_sid) 389 super(version) 390 391 # Path Solution 392 @solution = {account_sid: account_sid, conference_sid: conference_sid, call_sid: call_sid, } 393 @uri = "/Accounts/#{@solution[:account_sid]}/Conferences/#{@solution[:conference_sid]}/Participants/#{@solution[:call_sid]}.json" 394 end
Public Instance Methods
Delete the ParticipantInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb 478 def delete 479 @version.delete('DELETE', @uri) 480 end
Fetch the ParticipantInstance
@return [ParticipantInstance] Fetched ParticipantInstance
# File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb 399 def fetch 400 payload = @version.fetch('GET', @uri) 401 402 ParticipantInstance.new( 403 @version, 404 payload, 405 account_sid: @solution[:account_sid], 406 conference_sid: @solution[:conference_sid], 407 call_sid: @solution[:call_sid], 408 ) 409 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb 491 def inspect 492 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 493 "#<Twilio.Api.V2010.ParticipantContext #{context}>" 494 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb 484 def to_s 485 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 486 "#<Twilio.Api.V2010.ParticipantContext #{context}>" 487 end
Update the ParticipantInstance
@param [Boolean] muted Whether the participant should be muted. Can be `true` or
`false`. `true` will mute the participant, and `false` will un-mute them. Anything value other than `true` or `false` is interpreted as `false`.
@param [Boolean] hold Whether the participant should be on hold. Can be: `true`
or `false`. `true` puts the participant on hold, and `false` lets them rejoin the conference.
@param [String] hold_url The URL we call using the `hold_method` for music that
plays when the participant is on hold. The URL may return an MP3 file, a WAV file, or a TwiML document that contains the `<Play>`, `<Say>` or `<Redirect>` commands.
@param [String] hold_method The HTTP
method we should use to call `hold_url`.
Can be: `GET` or `POST` and the default is `GET`.
@param [String] announce_url The URL we call using the `announce_method` for an
announcement to the participant. The URL must return an MP3 file, a WAV file, or a TwiML document that contains `<Play>` or `<Say>` commands.
@param [String] announce_method The HTTP
method we should use to call
`announce_url`. Can be: `GET` or `POST` and defaults to `POST`.
@param [String] wait_url The URL we should call using the `wait_method` for the
music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. {Learn more about hold music}[https://www.twilio.com/labs/twimlets/holdmusic].
@param [String] wait_method The HTTP
method we should use to call `wait_url`.
Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file.
@param [Boolean] beep_on_exit Whether to play a notification beep to the
conference when the participant exits. Can be: `true` or `false`.
@param [Boolean] end_conference_on_exit Whether to end the conference when the
participant leaves. Can be: `true` or `false` and defaults to `false`.
@param [Boolean] coaching Whether the participant is coaching another call. Can
be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined.
@param [String] call_sid_to_coach The SID of the participant who is being
`coached`. The participant being coached is the only participant who can hear the participant who is `coaching`.
@return [ParticipantInstance] Updated ParticipantInstance
# File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb 448 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) 449 data = Twilio::Values.of({ 450 'Muted' => muted, 451 'Hold' => hold, 452 'HoldUrl' => hold_url, 453 'HoldMethod' => hold_method, 454 'AnnounceUrl' => announce_url, 455 'AnnounceMethod' => announce_method, 456 'WaitUrl' => wait_url, 457 'WaitMethod' => wait_method, 458 'BeepOnExit' => beep_on_exit, 459 'EndConferenceOnExit' => end_conference_on_exit, 460 'Coaching' => coaching, 461 'CallSidToCoach' => call_sid_to_coach, 462 }) 463 464 payload = @version.update('POST', @uri, data: data) 465 466 ParticipantInstance.new( 467 @version, 468 payload, 469 account_sid: @solution[:account_sid], 470 conference_sid: @solution[:conference_sid], 471 call_sid: @solution[:call_sid], 472 ) 473 end