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

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

Defined Under Namespace

Classes: AddOnResultContext, AddOnResultInstance, AddOnResultList, AddOnResultPage, TranscriptionContext, TranscriptionInstance, TranscriptionList, TranscriptionPage

Instance Method Summary collapse

Constructor Details

#initialize(version, account_sid, sid) ⇒ RecordingContext

Initialize the RecordingContext

Parameters:

  • version (Version)

    Version that contains the resource

  • account_sid (String)

    The SID of the Account that created the Recording resource to fetch.

  • sid (String)

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


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

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

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

  # Dependents
  @transcriptions = nil
  @add_on_results = nil
end

Instance Method Details

#add_on_results(sid = :unset) ⇒ AddOnResultList, AddOnResultContext

Access the add_on_results

Returns:

Raises:

  • (ArgumentError)

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

def add_on_results(sid=:unset)
  raise ArgumentError, 'sid cannot be nil' if sid.nil?

  if sid != :unset
    return AddOnResultContext.new(@version, @solution[:account_sid], @solution[:sid], sid, )
  end

  unless @add_on_results
    @add_on_results = AddOnResultList.new(
        @version,
        account_sid: @solution[:account_sid],
        reference_sid: @solution[:sid],
    )
  end

  @add_on_results
end

#deleteBoolean

Delete the RecordingInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


241
242
243
# File 'lib/twilio-ruby/rest/api/v2010/account/recording.rb', line 241

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

#fetch(include_soft_deleted: :unset) ⇒ RecordingInstance

Fetch the RecordingInstance

Parameters:

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

    A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days.

Returns:


230
231
232
233
234
235
236
# File 'lib/twilio-ruby/rest/api/v2010/account/recording.rb', line 230

def fetch(include_soft_deleted: :unset)
  params = Twilio::Values.of({'IncludeSoftDeleted' => include_soft_deleted, })

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

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

#inspectObject

Provide a detailed, user friendly representation


298
299
300
301
# File 'lib/twilio-ruby/rest/api/v2010/account/recording.rb', line 298

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

#to_sObject

Provide a user friendly representation


291
292
293
294
# File 'lib/twilio-ruby/rest/api/v2010/account/recording.rb', line 291

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

#transcriptions(sid = :unset) ⇒ TranscriptionList, TranscriptionContext

Access the transcriptions

Returns:

Raises:

  • (ArgumentError)

249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# File 'lib/twilio-ruby/rest/api/v2010/account/recording.rb', line 249

def transcriptions(sid=:unset)
  raise ArgumentError, 'sid cannot be nil' if sid.nil?

  if sid != :unset
    return TranscriptionContext.new(@version, @solution[:account_sid], @solution[:sid], sid, )
  end

  unless @transcriptions
    @transcriptions = TranscriptionList.new(
        @version,
        account_sid: @solution[:account_sid],
        recording_sid: @solution[:sid],
    )
  end

  @transcriptions
end