Class: Twilio::REST::Media::V1::MediaRecordingContext

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

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected]

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ MediaRecordingContext

Initialize the MediaRecordingContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The SID of the MediaRecording resource to fetch.


192
193
194
195
196
197
198
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 192

def initialize(version, sid)
  super(version)

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

Instance Method Details

#deleteBoolean

Delete the MediaRecordingInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


203
204
205
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 203

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

#fetchMediaRecordingInstance

Fetch the MediaRecordingInstance

Returns:


210
211
212
213
214
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 210

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

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

#inspectObject

Provide a detailed, user friendly representation


225
226
227
228
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 225

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

#to_sObject

Provide a user friendly representation


218
219
220
221
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 218

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