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.


200
201
202
203
204
205
206
207
208
209
210
# File 'lib/twilio-ruby/rest/api/v2010/account/recording.rb', line 200

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)

254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/twilio-ruby/rest/api/v2010/account/recording.rb', line 254

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


224
225
226
# File 'lib/twilio-ruby/rest/api/v2010/account/recording.rb', line 224

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

#fetchRecordingInstance

Fetch the RecordingInstance

Returns:


215
216
217
218
219
# File 'lib/twilio-ruby/rest/api/v2010/account/recording.rb', line 215

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

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

#inspectObject

Provide a detailed, user friendly representation


281
282
283
284
# File 'lib/twilio-ruby/rest/api/v2010/account/recording.rb', line 281

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

#to_sObject

Provide a user friendly representation


274
275
276
277
# File 'lib/twilio-ruby/rest/api/v2010/account/recording.rb', line 274

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)

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

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