Class: Bitmovin::InputResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/bitmovin/input_resource.rb

Direct Known Subclasses

Encoding::Inputs::S3Input

Instance Attribute Summary

Attributes inherited from Resource

#created_at, #description, #id, #modified_at, #name

Instance Method Summary collapse

Methods inherited from Resource

#delete!, find, init, #init_instance, #initialize, #inspect, list, #persisted?, #save!

Methods included from Helpers

#camelize_hash, #hash_to_struct, result, #result, #underscore_hash

Constructor Details

This class inherits a constructor from Bitmovin::Resource

Instance Method Details

#analysesObject



12
13
14
# File 'lib/bitmovin/input_resource.rb', line 12

def analyses
  Encoding::Inputs::Analysis.new(@id)
end

#analyze!(options) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/bitmovin/input_resource.rb', line 3

def analyze!(options)
  path = File.join("/v1/encoding/inputs/", @id, "analysis")
  response = Bitmovin.client.post(path) do |req|
    req.body = camelize_hash(options)
  end
  result = (JSON.parse(response.body))['data']['result']
  Bitmovin::Encoding::Inputs::AnalysisTask.new(self, result['id'])
end