Class: Bitmovin::TransferJob
- Inherits:
-
Object
- Object
- Bitmovin::TransferJob
- Extended by:
- Helpers
- Includes:
- Helpers
- Defined in:
- lib/bitmovin/transfer_job.rb
Overview
Represents a bitmovin transfer Job
Constant Summary collapse
- ATTRIBUTES =
%i{ id job_id output_id status progress created_at output_name }
Constants included from Helpers
Helpers::S3_BUCKET_IN_URL_REGEX, Helpers::S3_BUCKET_SUBDOMAIN_REGEX, Helpers::S3_OBJECT_KEY_IN_URL_REGEX, Helpers::S3_OBJECT_KEY_SUBDOMAIN_REGEX
Class Method Summary collapse
-
.create(params = {}) ⇒ Bitmovin::TransferJob
Bitmovin Transfer Job details.
-
.list(reload = false) ⇒ Array<Bitmovin::TransferJob>
Get list of available transfers related to job.
Instance Method Summary collapse
-
#create ⇒ Bitmovin::TransferJob
Creates a new bitmovin transfer job with params given within initialization.
-
#details(reload = false) ⇒ Hash
Get bitmovin encoding job details.
-
#initialize(params = {}) ⇒ TransferJob
constructor
A new instance of TransferJob.
Methods included from Helpers
deep_camelize_keys, deep_underscore_keys, extract_bucket, extract_object_key, prepare_request_json, prepare_response_json
Constructor Details
#initialize(params = {}) ⇒ TransferJob
Returns a new instance of TransferJob.
35 36 37 |
# File 'lib/bitmovin/transfer_job.rb', line 35 def initialize(params={}) @details = params end |
Class Method Details
.create(params = {}) ⇒ Bitmovin::TransferJob
Returns Bitmovin Transfer Job details.
45 46 47 |
# File 'lib/bitmovin/transfer_job.rb', line 45 def self.create(params={}) new(params).create end |
.list(reload = false) ⇒ Array<Bitmovin::TransferJob>
Get list of available transfers related to job
71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/bitmovin/transfer_job.rb', line 71 def list(reload = false) return @list if @list && !relaod get = Net::HTTP::Get.new "/api/jobs/#{ @details[:job_id] }/transfers", initheaders = headers response = Bitmovin.http.request get json = prepare_response_json(response.body) @list = json[:jobs].map { |p| Bitmovin::TransferJob.new(p) } @list end |
Instance Method Details
#create ⇒ Bitmovin::TransferJob
Creates a new bitmovin transfer job with params given within initialization
52 53 54 |
# File 'lib/bitmovin/transfer_job.rb', line 52 def create make_create_request end |
#details(reload = false) ⇒ Hash
Get bitmovin encoding job details
60 61 62 |
# File 'lib/bitmovin/transfer_job.rb', line 60 def details(reload = false) return @details end |