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 (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String) (defaults to: nil)

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

  • conference_sid (String) (defaults to: nil)

    The SID of the conference the participant is in.

  • call_sid (String) (defaults to: nil)

    The [Call](www.twilio.com/docs/api/voice/call) SID of the resource to fetch.



474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 474

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'],
      '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'],
      'uri' => payload['uri'],
  }

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

Instance Method Details

#account_sidString

Returns The SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource



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

def 
  @properties['account_sid']
end

#call_sidString

Returns The SID of the Call the resource is associated with.

Returns:

  • (String)

    The SID of the Call the resource is associated with



527
528
529
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 527

def call_sid
  @properties['call_sid']
end

#call_sid_to_coachString

Returns The SID of the participant who is being ‘coached`.

Returns:

  • (String)

    The SID of the participant who is being ‘coached`



533
534
535
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 533

def call_sid_to_coach
  @properties['call_sid_to_coach']
end

#coachingBoolean

Returns Indicates if the participant changed to coach.

Returns:

  • (Boolean)

    Indicates if the participant changed to coach



539
540
541
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 539

def coaching
  @properties['coaching']
end

#conference_sidString

Returns The SID of the conference the participant is in.

Returns:

  • (String)

    The SID of the conference the participant is in



545
546
547
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 545

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:



507
508
509
510
511
512
513
514
515
516
517
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 507

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 RFC 2822 date and time in GMT that the resource was created.

Returns:

  • (Time)

    The RFC 2822 date and time in GMT that the resource was created



551
552
553
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 551

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The RFC 2822 date and time in GMT that the resource was last updated.

Returns:

  • (Time)

    The RFC 2822 date and time in GMT that the resource was last updated



557
558
559
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 557

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Deletes the ParticipantInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



661
662
663
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 661

def delete
  context.delete
end

#end_conference_on_exitBoolean

Returns Whether the conference ends when the participant leaves.

Returns:

  • (Boolean)

    Whether the conference ends when the participant leaves



563
564
565
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 563

def end_conference_on_exit
  @properties['end_conference_on_exit']
end

#fetchParticipantInstance

Fetch a ParticipantInstance

Returns:



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

def fetch
  context.fetch
end

#holdBoolean

Returns Whether the participant is on hold.

Returns:

  • (Boolean)

    Whether the participant is on hold



575
576
577
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 575

def hold
  @properties['hold']
end

#inspectObject

Provide a detailed, user friendly representation



674
675
676
677
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 674

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

#mutedBoolean

Returns Whether the participant is muted.

Returns:

  • (Boolean)

    Whether the participant is muted



569
570
571
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 569

def muted
  @properties['muted']
end

#start_conference_on_enterBoolean

Returns Whether the conference starts when the participant joins the conference.

Returns:

  • (Boolean)

    Whether the conference starts when the participant joins the conference



581
582
583
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 581

def start_conference_on_enter
  @properties['start_conference_on_enter']
end

#statusparticipant.Status

Returns The status of the participant’s call in a session.

Returns:

  • (participant.Status)

    The status of the participant’s call in a session



587
588
589
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 587

def status
  @properties['status']
end

#to_sObject

Provide a user friendly representation



667
668
669
670
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 667

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:

  • muted (Boolean) (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`.

  • hold (Boolean) (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.

  • hold_url (String) (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 the `<Play>`, `<Say>` or `<Redirect>` commands.

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

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

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

    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.

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

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

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

    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](www.twilio.com/labs/twimlets/holdmusic).

  • wait_method (String) (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.

  • beep_on_exit (Boolean) (defaults to: :unset)

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

  • end_conference_on_exit (Boolean) (defaults to: :unset)

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

  • coaching (Boolean) (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.

  • call_sid_to_coach (String) (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:



641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 641

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:

  • (String)

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



593
594
595
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 593

def uri
  @properties['uri']
end