Class: Bitmovin::Encoding::Encodings::EncodingTask
- Defined in:
- lib/bitmovin/encoding/encodings/encoding_task.rb
Instance Attribute Summary collapse
-
#cloud_region ⇒ Object
Returns the value of attribute cloud_region.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#description ⇒ Object
Returns the value of attribute description.
-
#encoder_version ⇒ Object
Returns the value of attribute encoder_version.
-
#id ⇒ Object
Returns the value of attribute id.
-
#infrastructure_id ⇒ Object
Returns the value of attribute infrastructure_id.
-
#modified_at ⇒ Object
Returns the value of attribute modified_at.
-
#name ⇒ Object
Returns the value of attribute name.
-
#status ⇒ Object
Returns the value of attribute status.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #full_status ⇒ Object
- #ignore_fields ⇒ Object
-
#initialize(hash = {}) ⇒ EncodingTask
constructor
A new instance of EncodingTask.
- #live? ⇒ Boolean
- #muxings ⇒ Object
- #progress ⇒ Object
- #save! ⇒ Object
- #start!(hsh = {}) ⇒ Object
- #streams ⇒ Object
- #vod? ⇒ Boolean
Methods inherited from Resource
#delete!, find, init, #init_instance, #inspect, #persisted?
Methods included from Helpers
#camelize_hash, #hash_to_struct, result, #result, #underscore_hash
Constructor Details
#initialize(hash = {}) ⇒ EncodingTask
Returns a new instance of EncodingTask.
5 6 7 8 9 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 5 def initialize(hash = {}) super(hash) @stream_list = StreamList.new(@id) @muxing_list = MuxingList.new(@id) end |
Instance Attribute Details
#cloud_region ⇒ Object
Returns the value of attribute cloud_region.
13 14 15 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 13 def cloud_region @cloud_region end |
#created_at ⇒ Object
Returns the value of attribute created_at.
12 13 14 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 12 def created_at @created_at end |
#description ⇒ Object
Returns the value of attribute description.
11 12 13 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 11 def description @description end |
#encoder_version ⇒ Object
Returns the value of attribute encoder_version.
13 14 15 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 13 def encoder_version @encoder_version end |
#id ⇒ Object
Returns the value of attribute id.
11 12 13 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 11 def id @id end |
#infrastructure_id ⇒ Object
Returns the value of attribute infrastructure_id.
13 14 15 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 13 def infrastructure_id @infrastructure_id end |
#modified_at ⇒ Object
Returns the value of attribute modified_at.
12 13 14 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 12 def modified_at @modified_at end |
#name ⇒ Object
Returns the value of attribute name.
11 12 13 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 11 def name @name end |
#status ⇒ Object
Returns the value of attribute status.
13 14 15 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 13 def status @status end |
#type ⇒ Object
Returns the value of attribute type.
13 14 15 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 13 def type @type end |
Class Method Details
.list(limit = 100, offset = 0) ⇒ Object
60 61 62 63 64 65 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 60 def self.list(limit = 100, offset = 0) response = Bitmovin.client.get("/v1/encoding/encodings", { limit: limit, offset: offset }) Bitmovin::Helpers.result(response)['items'].map do |item| EncodingTask.new(item) end end |
Instance Method Details
#full_status ⇒ Object
46 47 48 49 50 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 46 def full_status path = File.join("/v1/encoding/encodings/", @id, "status") response = Bitmovin.client.get(path) hash_to_struct(result(response)) end |
#ignore_fields ⇒ Object
31 32 33 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 31 def ignore_fields [:@stream_list, :@muxing_list] end |
#live? ⇒ Boolean
15 16 17 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 15 def live? type == "LIVE" end |
#muxings ⇒ Object
27 28 29 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 27 def muxings @muxing_list end |
#progress ⇒ Object
56 57 58 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 56 def progress full_status.progress end |
#save! ⇒ Object
35 36 37 38 39 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 35 def save! super @stream_list = StreamList.new(@id) @muxing_list = MuxingList.new(@id) end |
#start!(hsh = {}) ⇒ Object
41 42 43 44 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 41 def start!(hsh = {}) path = File.join("/v1/encoding/encodings/", @id, "start") Bitmovin.client.post(path, camelize_hash(hsh)) end |
#streams ⇒ Object
23 24 25 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 23 def streams @stream_list end |
#vod? ⇒ Boolean
19 20 21 |
# File 'lib/bitmovin/encoding/encodings/encoding_task.rb', line 19 def vod? type == "VOD" end |