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 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 call_sid



348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 348

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



393
394
395
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 393

def 
  @properties['account_sid']
end

#call_sidString

Returns A string that uniquely identifies this call.

Returns:

  • (String)

    A string that uniquely identifies this call



399
400
401
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 399

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



405
406
407
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 405

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:



379
380
381
382
383
384
385
386
387
388
389
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 379

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



411
412
413
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 411

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



417
418
419
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 417

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Deletes the ParticipantInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



487
488
489
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 487

def delete
  context.delete
end

#end_conference_on_exitBoolean

Returns Indicates if the endConferenceOnExit was set.

Returns:

  • (Boolean)

    Indicates if the endConferenceOnExit was set



423
424
425
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 423

def end_conference_on_exit
  @properties['end_conference_on_exit']
end

#fetchParticipantInstance

Fetch a ParticipantInstance

Returns:



460
461
462
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 460

def fetch
  context.fetch
end

#holdBoolean

Returns The hold.

Returns:

  • (Boolean)

    The hold



435
436
437
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 435

def hold
  @properties['hold']
end

#inspectObject

Provide a detailed, user friendly representation



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

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



429
430
431
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 429

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



441
442
443
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 441

def start_conference_on_enter
  @properties['start_conference_on_enter']
end

#statusparticipant.Status

Returns The status.

Returns:

  • (participant.Status)

    The status



447
448
449
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 447

def status
  @properties['status']
end

#to_sObject

Provide a user friendly representation



493
494
495
496
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 493

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)

    Indicates if the participant should be muted

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

    The hold

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

    The hold_url

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

    The hold_method

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

    The announce_url

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

    The announce_method

Returns:



473
474
475
476
477
478
479
480
481
482
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 473

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



453
454
455
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 453

def uri
  @properties['uri']
end