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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, account_sid, conference_sid, sid) ⇒ RecordingContext

Initialize the RecordingContext

Parameters:

  • version (Version)

    Version that contains the resource

  • account_sid (String)

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

  • conference_sid (String)

    The Conference SID that identifies the conference associated with the recording to fetch.

  • sid (String)

    The Twilio-provided string that uniquely identifies the Conference Recording resource to fetch.



191
192
193
194
195
196
197
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb', line 191

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

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

Instance Method Details

#deleteBoolean

Deletes the RecordingInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



251
252
253
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb', line 251

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

#fetchRecordingInstance

Fetch a RecordingInstance

Returns:



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb', line 230

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

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

  RecordingInstance.new(
      @version,
      payload,
      account_sid: @solution[:account_sid],
      conference_sid: @solution[:conference_sid],
      sid: @solution[:sid],
  )
end

#inspectObject

Provide a detailed, user friendly representation



264
265
266
267
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb', line 264

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Api.V2010.RecordingContext #{context}>"
end

#to_sObject

Provide a user friendly representation



257
258
259
260
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb', line 257

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Api.V2010.RecordingContext #{context}>"
end

#update(status: nil, pause_behavior: :unset) ⇒ RecordingInstance

Update the RecordingInstance

Parameters:

  • status (recording.Status) (defaults to: nil)

    The new status of the recording. Can be: ‘stopped`, `paused`, `in-progress`.

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

    Whether to record during a pause. Can be: ‘skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`.

Returns:



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb', line 209

def update(status: nil, pause_behavior: :unset)
  data = Twilio::Values.of({'Status' => status, 'PauseBehavior' => pause_behavior, })

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

  RecordingInstance.new(
      @version,
      payload,
      account_sid: @solution[:account_sid],
      conference_sid: @solution[:conference_sid],
      sid: @solution[:sid],
  )
end