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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, account_sid, conference_sid, call_sid) ⇒ ParticipantContext

Initialize the ParticipantContext

Parameters:

  • version (Version)

    Version that contains the resource

  • account_sid (String)

    The account_sid

  • conference_sid (String)

    The string that uniquely identifies the conference this participant is in

  • call_sid (String)

    The call_sid



267
268
269
270
271
272
273
274
275
276
277
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 267

def initialize(version, , conference_sid, call_sid)
  super(version)

  # Path Solution
  @solution = {
      account_sid: ,
      conference_sid: conference_sid,
      call_sid: call_sid,
  }
  @uri = "/Accounts/#{@solution[:account_sid]}/Conferences/#{@solution[:conference_sid]}/Participants/#{@solution[:call_sid]}.json"
end

Instance Method Details

#deleteBoolean

Deletes the ParticipantInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



337
338
339
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 337

def delete
  @version.delete('delete', @uri)
end

#fetchParticipantInstance

Fetch a ParticipantInstance

Returns:



282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 282

def fetch
  params = Twilio::Values.of({})

  payload = @version.fetch(
      'GET',
      @uri,
      params,
  )

  ParticipantInstance.new(
      @version,
      payload,
      account_sid: @solution[:account_sid],
      conference_sid: @solution[:conference_sid],
      call_sid: @solution[:call_sid],
  )
end

#to_sObject

Provide a user friendly representation



343
344
345
346
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 343

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



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 309

def update(muted: :unset, hold: :unset, hold_url: :unset, hold_method: :unset, announce_url: :unset, announce_method: :unset)
  data = Twilio::Values.of({
      'Muted' => muted,
      'Hold' => hold,
      'HoldUrl' => hold_url,
      'HoldMethod' => hold_method,
      'AnnounceUrl' => announce_url,
      'AnnounceMethod' => announce_method,
  })

  payload = @version.update(
      'POST',
      @uri,
      data: data,
  )

  ParticipantInstance.new(
      @version,
      payload,
      account_sid: @solution[:account_sid],
      conference_sid: @solution[:conference_sid],
      call_sid: @solution[:call_sid],
  )
end