Class: Twilio::REST::Video::V1::RecordingContext

Inherits:
InstanceContext show all
Defined in:
lib/twilio-ruby/rest/video/v1/recording.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ RecordingContext

Initialize the RecordingContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The Recording Sid that uniquely identifies the Recording to fetch.



213
214
215
216
217
218
219
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 213

def initialize(version, sid)
  super(version)

  # Path Solution
  @solution = {sid: sid, }
  @uri = "/Recordings/#{@solution[:sid]}"
end

Instance Method Details

#deleteBoolean

Deletes the RecordingInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



239
240
241
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 239

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

#fetchRecordingInstance

Fetch a RecordingInstance

Returns:



224
225
226
227
228
229
230
231
232
233
234
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 224

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

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

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

#inspectObject

Provide a detailed, user friendly representation



252
253
254
255
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 252

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

#to_sObject

Provide a user friendly representation



245
246
247
248
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 245

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