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 unique id of the [Account](www.twilio.com/docs/iam/api/account) that created this conference

  • conference_sid (String) (defaults to: nil)

    A 34 character string that identifies the conference this participant is in

  • call_sid (String) (defaults to: nil)

    The Participant’s unique Call SID.



427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 427

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'],
      '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 unique sid that identifies this account.

Returns:

  • (String)

    The unique sid that identifies this account



472
473
474
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 472

def 
  @properties['account_sid']
end

#call_sidString

Returns A string that uniquely identifies this call.

Returns:

  • (String)

    A string that uniquely identifies this call



478
479
480
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 478

def call_sid
  @properties['call_sid']
end

#conference_sidString

Returns A string that uniquely identifies this conference.

Returns:

  • (String)

    A string that uniquely identifies this conference



484
485
486
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 484

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:



458
459
460
461
462
463
464
465
466
467
468
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 458

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 this resource was created.

Returns:

  • (Time)

    The date this resource was created



490
491
492
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 490

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The date this resource was last updated.

Returns:

  • (Time)

    The date this resource was last updated



496
497
498
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 496

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Deletes the ParticipantInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



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

def delete
  context.delete
end

#end_conference_on_exitBoolean

Returns Indicates if the endConferenceOnExit was set.

Returns:

  • (Boolean)

    Indicates if the endConferenceOnExit was set



502
503
504
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 502

def end_conference_on_exit
  @properties['end_conference_on_exit']
end

#fetchParticipantInstance

Fetch a ParticipantInstance

Returns:



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

def fetch
  context.fetch
end

#holdBoolean

Returns true if this participant is currently held.

Returns:

  • (Boolean)

    true if this participant is currently held.



514
515
516
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 514

def hold
  @properties['hold']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#mutedBoolean

Returns Indicates if the participant is muted.

Returns:

  • (Boolean)

    Indicates if the participant is muted



508
509
510
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 508

def muted
  @properties['muted']
end

#start_conference_on_enterBoolean

Returns Indicates if the startConferenceOnEnter attribute was set.

Returns:

  • (Boolean)

    Indicates if the startConferenceOnEnter attribute was set



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

def start_conference_on_enter
  @properties['start_conference_on_enter']
end

#statusparticipant.Status

Returns The status.

Returns:

  • (participant.Status)

    The status



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

def status
  @properties['status']
end

#to_sObject

Provide a user friendly representation



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

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) ⇒ ParticipantInstance

Update the ParticipantInstance

Parameters:

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

    Specifying ‘true` will mute the participant, while `false` will un-mute. Anything other than `true` or `false` is interpreted as `false`.

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

    Specifying ‘true` will hold the participant, while `false` will remove them from hold.

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

    The ‘HoldUrl’ attribute lets you specify a URL for music that plays when a participant is on hold. The URL may be an MP3, a WAV or a TwiML document that uses ‘<Play>`, `<Say>` or `<Redirect>`.

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

    Specify the HTTP method Twilio should use to request your ‘HoldUrl`, either `GET` or `POST`. Defaults to `GET`.

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

    The ‘AnnounceUrl’ attribute lets you specify a URL for announcing something to the participant. The URL may return an MP3, a WAV or a TwiML document with ‘<Play>` or `<Say>`.

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

    Specify the HTTP method Twilio should use to request your ‘AnnounceUrl`, either `GET` or `POST`. Defaults to `POST`.

Returns:



561
562
563
564
565
566
567
568
569
570
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 561

def update(muted: :unset, hold: :unset, hold_url: :unset, hold_method: :unset, announce_url: :unset, announce_method: :unset)
  context.update(
      muted: muted,
      hold: hold,
      hold_url: hold_url,
      hold_method: hold_method,
      announce_url: announce_url,
      announce_method: announce_method,
  )
end

#uriString

Returns The URI for this resource.

Returns:

  • (String)

    The URI for this resource



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

def uri
  @properties['uri']
end