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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil, conference_sid: nil, call_sid: nil) ⇒ ParticipantInstance

Initialize the ParticipantInstance

Parameters:

  • Version that contains the resource

  • payload that contains response from Twilio

  • (defaults to: nil)

    The SID of the Account that created this Participant resource.

  • The SID of the Call resource to fetch.



490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 490

def initialize(version, payload , account_sid: nil, conference_sid: nil, call_sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'call_sid' => payload['call_sid'],
        'label' => payload['label'],
        'call_sid_to_coach' => payload['call_sid_to_coach'],
        'coaching' => payload['coaching'],
        'conference_sid' => payload['conference_sid'],
        'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
        'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
        'end_conference_on_exit' => payload['end_conference_on_exit'],
        'muted' => payload['muted'],
        'hold' => payload['hold'],
        'start_conference_on_enter' => payload['start_conference_on_enter'],
        'status' => payload['status'],
        'queue_time' => payload['queue_time'],
        'uri' => payload['uri'],
    }

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

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Participant resource.

Returns:



530
531
532
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 530

def 
    @properties['account_sid']
end

#call_sidString

Returns The SID of the [Call](www.twilio.com/docs/voice/api/call-resource) the Participant resource is associated with.

Returns:



536
537
538
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 536

def call_sid
    @properties['call_sid']
end

#call_sid_to_coachString

Returns 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`.

Returns:

  • 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`.



548
549
550
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 548

def call_sid_to_coach
    @properties['call_sid_to_coach']
end

#coachingBoolean

Returns 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.

Returns:

  • 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.



554
555
556
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 554

def coaching
    @properties['coaching']
end

#conference_sidString

Returns The SID of the conference the participant is in.

Returns:

  • The SID of the conference the participant is in.



560
561
562
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 560

def conference_sid
    @properties['conference_sid']
end

#contextParticipantContext

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

Returns:

  • CallContext for this CallInstance



521
522
523
524
525
526
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 521

def context
    unless @instance_context
        @instance_context = ParticipantContext.new(@version , @params['account_sid'], @params['conference_sid'], @params['call_sid'])
    end
    @instance_context
end

#date_createdTime

Returns The date and time in GMT that the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



566
567
568
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 566

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in GMT that the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



572
573
574
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 572

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the ParticipantInstance

Returns:

  • True if delete succeeds, false otherwise



621
622
623
624
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 621

def delete

    context.delete
end

#end_conference_on_exitBoolean

Returns Whether the conference ends when the participant leaves. Can be: ‘true` or `false` and the default is `false`. If `true`, the conference ends and all other participants drop out when the participant leaves.

Returns:

  • Whether the conference ends when the participant leaves. Can be: ‘true` or `false` and the default is `false`. If `true`, the conference ends and all other participants drop out when the participant leaves.



578
579
580
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 578

def end_conference_on_exit
    @properties['end_conference_on_exit']
end

#fetchParticipantInstance

Fetch the ParticipantInstance

Returns:

  • Fetched ParticipantInstance



629
630
631
632
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 629

def fetch

    context.fetch
end

#holdBoolean

Returns Whether the participant is on hold. Can be ‘true` or `false`.

Returns:

  • Whether the participant is on hold. Can be ‘true` or `false`.



590
591
592
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 590

def hold
    @properties['hold']
end

#inspectObject

Provide a detailed, user friendly representation



689
690
691
692
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 689

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

#labelString

Returns The user-specified label of this participant, if one was given when the participant was created. This may be used to fetch, update or delete the participant.

Returns:

  • The user-specified label of this participant, if one was given when the participant was created. This may be used to fetch, update or delete the participant.



542
543
544
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 542

def label
    @properties['label']
end

#mutedBoolean

Returns Whether the participant is muted. Can be ‘true` or `false`.

Returns:

  • Whether the participant is muted. Can be ‘true` or `false`.



584
585
586
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 584

def muted
    @properties['muted']
end

#queue_timeString

Returns The wait time in milliseconds before participant’s call is placed. Only available in the response to a create participant request.

Returns:

  • The wait time in milliseconds before participant’s call is placed. Only available in the response to a create participant request.



608
609
610
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 608

def queue_time
    @properties['queue_time']
end

#start_conference_on_enterBoolean

Returns Whether the conference starts when the participant joins the conference, if it has not already started. Can be: ‘true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference.

Returns:

  • Whether the conference starts when the participant joins the conference, if it has not already started. Can be: ‘true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference.



596
597
598
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 596

def start_conference_on_enter
    @properties['start_conference_on_enter']
end

#statusStatus

Returns:



602
603
604
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 602

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



682
683
684
685
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 682

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Api.V2010.ParticipantInstance #{values}>"
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

Parameters:

  • (defaults to: :unset)

    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`.

  • (defaults to: :unset)

    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.

  • (defaults to: :unset)

    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 `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs.

  • (defaults to: :unset)

    The HTTP method we should use to call ‘hold_url`. Can be: `GET` or `POST` and the default is `GET`.

  • (defaults to: :unset)

    The URL we call using the ‘announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs.

  • (defaults to: :unset)

    The HTTP method we should use to call ‘announce_url`. Can be: `GET` or `POST` and defaults to `POST`.

  • (defaults to: :unset)

    The URL that Twilio calls using the ‘wait_method` before the conference has started. The URL may return an MP3 file, a WAV file, or a TwiML document. The default value is the URL of our standard hold music. If you do not want anything to play while waiting for the conference to start, specify an empty string by setting `wait_url` to `”`. For more details on the allowable verbs within the `waitUrl`, see the `waitUrl` attribute in the [<Conference> TwiML instruction](www.twilio.com/docs/voice/twiml/conference#attributes-waiturl).

  • (defaults to: :unset)

    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.

  • (defaults to: :unset)

    Whether to play a notification beep to the conference when the participant exits. Can be: ‘true` or `false`.

  • (defaults to: :unset)

    Whether to end the conference when the participant leaves. Can be: ‘true` or `false` and defaults to `false`.

  • (defaults to: :unset)

    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.

  • (defaults to: :unset)

    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`.

Returns:

  • Updated ParticipantInstance



649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 649

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
)

    context.update(
        muted: muted, 
        hold: hold, 
        hold_url: hold_url, 
        hold_method: hold_method, 
        announce_url: announce_url, 
        announce_method: announce_method, 
        wait_url: wait_url, 
        wait_method: wait_method, 
        beep_on_exit: beep_on_exit, 
        end_conference_on_exit: end_conference_on_exit, 
        coaching: coaching, 
        call_sid_to_coach: call_sid_to_coach, 
    )
end

#uriString

Returns The URI of the resource, relative to ‘api.twilio.com`.

Returns:



614
615
616
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 614

def uri
    @properties['uri']
end