bitmovin-ruby 0.5.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 2f33bc3d3ad45622a17cd9a6fe6cbc446c3522be
4
- data.tar.gz: da41e2a81ae4ee3d992991f6e37182fc47b4a781
2
+ SHA256:
3
+ metadata.gz: 53be8773c2676dd4ec0932820209a81a31eac53a3d6024f62f70f0c6a8d895e6
4
+ data.tar.gz: 4436bd7136c442cc712dc08edcaeee7481fbe43a7bcc7af66a9b8963a82a32e6
5
5
  SHA512:
6
- metadata.gz: 16ffa8271ef89ba08c8d2bfe1f0a24ad97fa9af512b8b456ee568a28a8086d13d57333aab62e8ace112d6b11f2e8cbd4a21043e9ad67a9c6d2dbd1f6ed009b82
7
- data.tar.gz: d87a2fd898b955438589241e35362bc8d0922fb8894b7df9293acac302ad282e32e1ea52223254400bd50b2b2f80422ffb46924a4bd21457f2a2a406d164a7ff
6
+ metadata.gz: c5c0ba7d9bdeff8ddd069b258fc52ad426a9abe51bc32feab03c5eac512c69cc19d8241be03cb253aa7288170e121394fdb2042e040d6f2585fb58d8e1a0af7b
7
+ data.tar.gz: d817d3d2f211f98fb7957723cbea72f10dbd01500cfea7613cdc8f43896bb19aa0c397d92a1d2ed766932f0914b09c22aabad2aa43a11b63d0ca9be8d3d76428
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bitmovin-ruby (0.4.0)
4
+ bitmovin-ruby (0.7.0)
5
5
  activesupport (>= 4.0.0)
6
6
  faraday (~> 0.11.0)
7
7
  faraday_middleware (~> 0.11.0)
@@ -11,7 +11,7 @@ module Bitmovin::Encoding::Encodings::Muxings::Drms
11
11
  @muxing_id = muxing_id
12
12
  muxing_type = self.class.name.demodulize.gsub(/(.*)Muxing.*/, '\1').downcase
13
13
  encryption_type = self.class.name.demodulize.gsub(/.*Muxing(.*)Encryption/, '\1').downcase
14
- self.class.init(File.join("/v1/encoding/encodings/", encoding_id, "muxings", muxing_type, muxing_id, "drm", encryption_type))
14
+ init_instance(File.join("/v1/encoding/encodings/", encoding_id, "muxings", muxing_type, muxing_id, "drm", encryption_type))
15
15
  super(hsh)
16
16
  @outputs = (hsh[:outputs] || []).map do |output|
17
17
  Bitmovin::Encoding::StreamOutput.new(output)
@@ -1,4 +1,5 @@
1
1
  module Bitmovin::Encoding::Encodings::Muxings
2
2
  class Mp4Muxing < MuxingResource
3
+ attr_accessor :filename
3
4
  end
4
5
  end
@@ -8,7 +8,7 @@ module Bitmovin::Encoding::Encodings::Muxings
8
8
  hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash))
9
9
  @encoding_id = encoding_id
10
10
  muxing_type = self.class.name.demodulize.gsub(/(.*)Muxing/, '\1').downcase
11
- self.class.init(File.join("/v1/encoding/encodings/", encoding_id, "muxings", muxing_type))
11
+ init_instance(File.join("/v1/encoding/encodings/", encoding_id, "muxings", muxing_type))
12
12
  super(hsh)
13
13
  @outputs = (hsh[:outputs] || []).map do |output|
14
14
  Bitmovin::Encoding::StreamOutput.new(output)
@@ -3,7 +3,7 @@ module Bitmovin::Encoding::Encodings
3
3
 
4
4
  def initialize(encoding_id, stream_id, hash = {})
5
5
  @errors = []
6
- self.class.init(File.join('/v1/encoding/encodings', encoding_id, 'streams', stream_id, 'sprites'))
6
+ init_instance(File.join('/v1/encoding/encodings', encoding_id, 'streams', stream_id, 'sprites'))
7
7
 
8
8
  @encoding_id = encoding_id
9
9
  @stream_id = stream_id
@@ -3,18 +3,20 @@ module Bitmovin::Encoding::Encodings
3
3
  attr_accessor :encoding_id
4
4
  attr_accessor :id
5
5
  attr_accessor :conditions
6
+ attr_accessor :mode
6
7
 
7
8
  def initialize(encoding_id, hash = {})
8
9
  set_defaults
9
10
  hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash))
10
11
  @encoding_id = encoding_id
11
- self.class.init(File.join("/v1/encoding/encodings/", encoding_id, "streams"))
12
+ init_instance(File.join("/v1/encoding/encodings/", encoding_id, "streams"))
12
13
  super(hash)
13
14
  @outputs = (hsh[:outputs] || []).map { |output| Bitmovin::Encoding::StreamOutput.new(output) }
14
15
  @input_streams = (hsh[:input_streams] || []).map { |input| StreamInput.new(@encoding_id, @id, input) }
15
16
 
16
17
  @errors = []
17
18
  @conditions = nil
19
+ @mode = "STANDARD"
18
20
  end
19
21
 
20
22
  attr_accessor :name, :description, :created_at, :modified_at, :create_quality_meta_data
@@ -85,7 +87,7 @@ module Bitmovin::Encoding::Encodings
85
87
  def collect_attributes
86
88
  val = Hash.new
87
89
  [:name, :description, :create_quality_meta_data,
88
- :input_streams, :outputs, :codec_config_id, :conditions].each do |name|
90
+ :input_streams, :outputs, :codec_config_id, :conditions, :mode].each do |name|
89
91
  json_name = ActiveSupport::Inflector.camelize(name.to_s, false)
90
92
  val[json_name] = instance_variable_get("@#{name}")
91
93
  end
@@ -3,7 +3,7 @@ module Bitmovin::Encoding::Encodings
3
3
 
4
4
  def initialize(encoding_id, stream_id, hash = {})
5
5
  @errors = []
6
- self.class.init(File.join('/v1/encoding/encodings', encoding_id, 'streams', stream_id, 'thumbnails'))
6
+ init_instance(File.join('/v1/encoding/encodings', encoding_id, 'streams', stream_id, 'thumbnails'))
7
7
 
8
8
  @encoding_id = encoding_id
9
9
  @stream_id = stream_id
@@ -2,8 +2,7 @@ module Bitmovin::Encoding::Manifests
2
2
  class AudioAdaptationSet < Bitmovin::Resource
3
3
  include Bitmovin::ChildCollection
4
4
  def initialize(manifest_id, period_id, hash = {})
5
- path = File.join("/v1/encoding/manifests/dash/", manifest_id, "periods", period_id, "adaptationsets/audio")
6
- self.class.init(path)
5
+ init_instance(File.join("/v1/encoding/manifests/dash/", manifest_id, "periods", period_id, "adaptationsets/audio"))
7
6
  @manifest_id = manifest_id
8
7
  @period_id = period_id
9
8
  end
@@ -1,8 +1,7 @@
1
1
  module Bitmovin::Encoding::Manifests
2
2
  class Fmp4Representation < Bitmovin::Resource
3
3
  def initialize(manifest_id, period_id, adaptationset_id, hash = {})
4
- path = File.join("/v1/encoding/manifests/dash/", manifest_id, "periods", period_id, "adaptationsets/", adaptationset_id, "representations/fmp4")
5
- self.class.init(path)
4
+ init_instance(File.join("/v1/encoding/manifests/dash/", manifest_id, "periods", period_id, "adaptationsets/", adaptationset_id, "representations/fmp4"))
6
5
  super(hash)
7
6
  @manifest_id = manifest_id
8
7
  @period_id = period_id
@@ -20,7 +20,7 @@ module Bitmovin::Encoding::Manifests
20
20
  def initialize(manifest_id, hash = {})
21
21
  hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash))
22
22
  @manifest_id = manifest_id
23
- self.class.init(File.join("/v1/encoding/manifests/hls/", manifest_id, "media/audio"))
23
+ init_instance(File.join("/v1/encoding/manifests/hls/", manifest_id, "media/audio"))
24
24
  super(hsh)
25
25
  end
26
26
 
@@ -13,7 +13,7 @@ module Bitmovin::Encoding::Manifests
13
13
  def initialize(manifest_id, hash = {})
14
14
  hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash))
15
15
  @manifest_id = manifest_id
16
- self.class.init(File.join("/v1/encoding/manifests/hls/", manifest_id, "streams"))
16
+ init_instance(File.join("/v1/encoding/manifests/hls/", manifest_id, "streams"))
17
17
  super(hsh)
18
18
  end
19
19
  end
@@ -1,11 +1,10 @@
1
1
  module Bitmovin::Encoding::Manifests
2
2
  class HlsVariantStreamList < Bitmovin::Resource
3
- init "streams"
4
3
  attr_accessor :manifest_id
5
4
 
6
5
  def initialize(manifest_id)
7
6
  @manifest_id = manifest_id
8
- self.class.init(File.join("/v1/encoding/manifests/", manifest_id, "streams"))
7
+ init_instance(File.join("/v1/encoding/manifests/", manifest_id, "streams"))
9
8
  #super(hsh)
10
9
  end
11
10
 
@@ -3,7 +3,7 @@ module Bitmovin::Encoding::Manifests
3
3
  def initialize(hash = {})
4
4
  hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash))
5
5
  muxing_type = self.class.name.demodulize.gsub(/(.*)Muxing/, '\1').downcase
6
- self.class.init(File.join("/v1/encoding/manifests/", encoding_id, "muxings", muxing_type))
6
+ init_instance(File.join("/v1/encoding/manifests/", encoding_id, "muxings", muxing_type))
7
7
  super(hsh)
8
8
  @outputs = (hsh[:outputs] || []).map do |output|
9
9
  Bitmovin::Encoding::Encodings::StreamOutput.new(encoding_id, @id, output)
@@ -3,7 +3,7 @@ module Bitmovin::Encoding::Manifests
3
3
  include Bitmovin::ChildCollection
4
4
 
5
5
  def initialize(manifest_id, hash = {})
6
- self.class.init(File.join("/v1/encoding/manifests/dash/", manifest_id, "periods"))
6
+ init_instance(File.join("/v1/encoding/manifests/dash/", manifest_id, "periods"))
7
7
  @manifest_id = manifest_id
8
8
  super(hash)
9
9
  @video_adaptationsets = nil
@@ -2,8 +2,7 @@ module Bitmovin::Encoding::Manifests
2
2
  class VideoAdaptationSet < Bitmovin::Resource
3
3
  include Bitmovin::ChildCollection
4
4
  def initialize(manifest_id, period_id, hash = {})
5
- path = File.join("/v1/encoding/manifests/dash/", manifest_id, "periods", period_id, "adaptationsets/video")
6
- self.class.init(path)
5
+ init_instance(File.join("/v1/encoding/manifests/dash/", manifest_id, "periods", period_id, "adaptationsets/video"))
7
6
  super(hash)
8
7
  @manifest_id = manifest_id
9
8
  @period_id = period_id
@@ -10,7 +10,11 @@ module Bitmovin::Helpers
10
10
  def camelize_hash(hash)
11
11
  ret = Hash.new
12
12
  hash.each do |key, value|
13
- ret[ActiveSupport::Inflector.camelize(key, false)] = value
13
+ if value.is_a?(Hash)
14
+ ret[ActiveSupport::Inflector.camelize(key, false)] = camelize_hash(value)
15
+ else
16
+ ret[ActiveSupport::Inflector.camelize(key, false)] = value
17
+ end
14
18
  end
15
19
  ret
16
20
  end
@@ -8,7 +8,6 @@ module Bitmovin
8
8
  end
9
9
  attr_reader :resource_path
10
10
 
11
-
12
11
  def list(limit = 100, offset = 0)
13
12
  response = Bitmovin.client.get @resource_path, limit: limit, offset: offset
14
13
  Bitmovin::Helpers.result(response)['items'].map do |item|
@@ -22,6 +21,10 @@ module Bitmovin
22
21
  end
23
22
  end
24
23
 
24
+ def init_instance(path)
25
+ @instance_resource_path = path
26
+ end
27
+
25
28
  attr_accessor :id, :name, :description, :created_at, :modified_at
26
29
 
27
30
 
@@ -35,7 +38,7 @@ module Bitmovin
35
38
  end
36
39
 
37
40
  response = Bitmovin.client.post do |post|
38
- post.url self.class.resource_path
41
+ post.url resource_path
39
42
  post.body = collect_attributes
40
43
  end
41
44
  yield(response.body) if block_given?
@@ -48,7 +51,7 @@ module Bitmovin
48
51
  end
49
52
 
50
53
  def delete!
51
- Bitmovin.client.delete File.join(self.class.resource_path, @id)
54
+ Bitmovin.client.delete File.join(resource_path, @id)
52
55
  end
53
56
 
54
57
  def inspect
@@ -57,6 +60,10 @@ module Bitmovin
57
60
 
58
61
  private
59
62
 
63
+ def resource_path
64
+ @instance_resource_path || self.class.resource_path
65
+ end
66
+
60
67
  def init_from_hash(hash = {})
61
68
  hash.each do |name, value|
62
69
  instance_variable_set("@#{ActiveSupport::Inflector.underscore(name)}", value)
@@ -69,10 +76,13 @@ module Bitmovin
69
76
  if (self.respond_to?(:ignore_fields))
70
77
  ignored_variables = self.ignore_fields
71
78
  end
79
+ ignored_variables.push(:@instance_resource_path)
80
+
72
81
  instance_variables.each do |name|
73
82
  if ignored_variables.include?(name)
74
83
  next
75
84
  end
85
+
76
86
  if name == :@max_ctu_size
77
87
  val['maxCTUSize'] = instance_variable_get(name)
78
88
  else
@@ -1,3 +1,3 @@
1
1
  module Bitmovin
2
- VERSION = "0.5.0"
2
+ VERSION = "0.7.0"
3
3
  end
@@ -4,7 +4,7 @@ module Bitmovin::Webhooks
4
4
  def initialize(encoding_id, hash = {})
5
5
  if encoding_id.kind_of?(String)
6
6
  @encoding_id = encoding_id
7
- self.class.init("notifications/webhooks/encoding/encodings/#{encoding_id}/error")
7
+ init_instance("notifications/webhooks/encoding/encodings/#{encoding_id}/error")
8
8
  else
9
9
  hash = encoding_id
10
10
  end
@@ -4,7 +4,7 @@ module Bitmovin::Webhooks
4
4
  def initialize(encoding_id = {}, hash = {})
5
5
  if encoding_id.kind_of?(String)
6
6
  @encoding_id = encoding_id
7
- self.class.init("notifications/webhooks/encoding/encodings/#{encoding_id}/finished")
7
+ init_instance("notifications/webhooks/encoding/encodings/#{encoding_id}/finished")
8
8
  else
9
9
  hash = encoding_id
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitmovin-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Hoelbling-Inzko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-10 00:00:00.000000000 Z
11
+ date: 2019-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -28,20 +28,20 @@ dependencies:
28
28
  name: httpclient
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 2.8.3
34
- - - ">="
34
+ - - "~>"
35
35
  - !ruby/object:Gem::Version
36
36
  version: 2.8.3
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - "~>"
41
+ - - ">="
42
42
  - !ruby/object:Gem::Version
43
43
  version: 2.8.3
44
- - - ">="
44
+ - - "~>"
45
45
  - !ruby/object:Gem::Version
46
46
  version: 2.8.3
47
47
  - !ruby/object:Gem::Dependency
@@ -227,8 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  - !ruby/object:Gem::Version
228
228
  version: '0'
229
229
  requirements: []
230
- rubyforge_project:
231
- rubygems_version: 2.6.11
230
+ rubygems_version: 3.0.1
232
231
  signing_key:
233
232
  specification_version: 4
234
233
  summary: Api Client for the Bitmovin API