Class: Twilio::REST::Media::V1::MediaProcessorContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ MediaProcessorContext

Initialize the MediaProcessorContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The SID of the MediaProcessor resource to fetch.


205
206
207
208
209
210
211
# File 'lib/twilio-ruby/rest/media/v1/media_processor.rb', line 205

def initialize(version, sid)
  super(version)

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

Instance Method Details

#fetchMediaProcessorInstance

Fetch the MediaProcessorInstance

Returns:


216
217
218
219
220
# File 'lib/twilio-ruby/rest/media/v1/media_processor.rb', line 216

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

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

#inspectObject

Provide a detailed, user friendly representation


244
245
246
247
# File 'lib/twilio-ruby/rest/media/v1/media_processor.rb', line 244

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

#to_sObject

Provide a user friendly representation


237
238
239
240
# File 'lib/twilio-ruby/rest/media/v1/media_processor.rb', line 237

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

#update(status: nil) ⇒ MediaProcessorInstance

Update the MediaProcessorInstance

Parameters:

  • status (media_processor.UpdateStatus) (defaults to: nil)

    The status of the MediaProcessor. Can be `ended`.

Returns:


227
228
229
230
231
232
233
# File 'lib/twilio-ruby/rest/media/v1/media_processor.rb', line 227

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

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

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