class Bitmovin::Encoding::Encodings::InputStreams::Ingest

Attributes

created_at[RW]
description[RW]
encoding_id[RW]
errors[RW]
input_id[RW]
input_path[RW]
modified_at[RW]
name[RW]
position[RW]
selection_mode[RW]

Public Class Methods

new(encoding_id, hash = {}) click to toggle source
Calls superclass method Bitmovin::Resource::new
# File lib/bitmovin/encoding/encodings/input_streams/ingest.rb, line 6
def initialize(encoding_id, hash = {})
  hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash))
  @encoding_id = encoding_id

  init_instance(File.join("/v1/encoding/encodings/", encoding_id, "input-streams/ingest"))
  super(hash)

  @input_id = hash[:input_id]
  @input_path = hash[:input_path]
  @selection_mode = hash[:selection_mode]
  @position = hash[:position]

  @errors = []
end

Public Instance Methods

invalid?() click to toggle source
# File lib/bitmovin/encoding/encodings/input_streams/ingest.rb, line 26
def invalid?
  !valid?
end
valid?() click to toggle source
# File lib/bitmovin/encoding/encodings/input_streams/ingest.rb, line 21
def valid?
  validate!
  @errors.empty?
end
validate!() click to toggle source
# File lib/bitmovin/encoding/encodings/input_streams/ingest.rb, line 34
def validate!
  @errors << "input_id cannot be blank" if @input_id.blank?
  @errors << "input_path cannot be blank" if @input_path.blank?
  @errors << "selection_mode cannot be blank" if @selection_mode.blank?

  if @position.blank? && @selection_mode != "AUTO"
    @errors << "position cannot be blank if selection_mode is not AUTO"
  end
end