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



259
260
261
262
263
264
265
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 259

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



325
326
327
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 325

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

#fetchParticipantInstance

Fetch a ParticipantInstance



270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 270

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



331
332
333
334
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 331

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



297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb', line 297

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