class Twilio::REST::Api::V2010::AccountContext::ConferenceContext::ParticipantInstance

Public Class Methods

new(version, payload, account_sid: nil, conference_sid: nil, call_sid: nil) click to toggle source

Initialize the ParticipantInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] account_sid The SID of the

{Account}[https://www.twilio.com/docs/iam/api/account] that created the
Participant resource.

@param [String] conference_sid The SID of the conference the participant is in. @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 [ParticipantInstance] ParticipantInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
511 def initialize(version, payload, account_sid: nil, conference_sid: nil, call_sid: nil)
512   super(version)
513 
514   # Marshaled Properties
515   @properties = {
516       'account_sid' => payload['account_sid'],
517       'call_sid' => payload['call_sid'],
518       'label' => payload['label'],
519       'call_sid_to_coach' => payload['call_sid_to_coach'],
520       'coaching' => payload['coaching'],
521       'conference_sid' => payload['conference_sid'],
522       'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
523       'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
524       'end_conference_on_exit' => payload['end_conference_on_exit'],
525       'muted' => payload['muted'],
526       'hold' => payload['hold'],
527       'start_conference_on_enter' => payload['start_conference_on_enter'],
528       'status' => payload['status'],
529       'uri' => payload['uri'],
530   }
531 
532   # Context
533   @instance_context = nil
534   @params = {
535       'account_sid' => account_sid,
536       'conference_sid' => conference_sid,
537       'call_sid' => call_sid || @properties['call_sid'],
538   }
539 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
559 def account_sid
560   @properties['account_sid']
561 end
call_sid() click to toggle source

@return [String] The SID of the Call the resource is associated with

    # File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
565 def call_sid
566   @properties['call_sid']
567 end
call_sid_to_coach() click to toggle source

@return [String] The SID of the participant who is being `coached`

    # File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
577 def call_sid_to_coach
578   @properties['call_sid_to_coach']
579 end
coaching() click to toggle source

@return [Boolean] Indicates if the participant changed to coach

    # File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
583 def coaching
584   @properties['coaching']
585 end
conference_sid() click to toggle source

@return [String] The SID of the conference the participant is in

    # File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
589 def conference_sid
590   @properties['conference_sid']
591 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [ParticipantContext] ParticipantContext for this ParticipantInstance

    # File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
545 def context
546   unless @instance_context
547     @instance_context = ParticipantContext.new(
548         @version,
549         @params['account_sid'],
550         @params['conference_sid'],
551         @params['call_sid'],
552     )
553   end
554   @instance_context
555 end
date_created() click to toggle source

@return [Time] The RFC 2822 date and time in GMT that the resource was created

    # File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
595 def date_created
596   @properties['date_created']
597 end
date_updated() click to toggle source

@return [Time] The RFC 2822 date and time in GMT that the resource was last updated

    # File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
601 def date_updated
602   @properties['date_updated']
603 end
delete() click to toggle source

Delete the ParticipantInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
705 def delete
706   context.delete
707 end
end_conference_on_exit() click to toggle source

@return [Boolean] Whether the conference ends when the participant leaves

    # File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
607 def end_conference_on_exit
608   @properties['end_conference_on_exit']
609 end
fetch() click to toggle source

Fetch the ParticipantInstance @return [ParticipantInstance] Fetched ParticipantInstance

    # File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
644 def fetch
645   context.fetch
646 end
hold() click to toggle source

@return [Boolean] Whether the participant is on hold

    # File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
619 def hold
620   @properties['hold']
621 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
718 def inspect
719   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
720   "<Twilio.Api.V2010.ParticipantInstance #{values}>"
721 end
label() click to toggle source

@return [String] The label of this participant

    # File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
571 def label
572   @properties['label']
573 end
muted() click to toggle source

@return [Boolean] Whether the participant is muted

    # File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
613 def muted
614   @properties['muted']
615 end
start_conference_on_enter() click to toggle source

@return [Boolean] Whether the conference starts when the participant joins the conference

    # File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
625 def start_conference_on_enter
626   @properties['start_conference_on_enter']
627 end
status() click to toggle source

@return [participant.Status] The status of the participant's call in a session

    # File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
631 def status
632   @properties['status']
633 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
711 def to_s
712   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
713   "<Twilio.Api.V2010.ParticipantInstance #{values}>"
714 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) click to toggle source

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
685 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)
686   context.update(
687       muted: muted,
688       hold: hold,
689       hold_url: hold_url,
690       hold_method: hold_method,
691       announce_url: announce_url,
692       announce_method: announce_method,
693       wait_url: wait_url,
694       wait_method: wait_method,
695       beep_on_exit: beep_on_exit,
696       end_conference_on_exit: end_conference_on_exit,
697       coaching: coaching,
698       call_sid_to_coach: call_sid_to_coach,
699   )
700 end
uri() click to toggle source

@return [String] The URI of the resource, relative to `api.twilio.com`

    # File lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
637 def uri
638   @properties['uri']
639 end