Class: Wave::Captions
- Inherits:
-
Object
- Object
- Wave::Captions
- Defined in:
- lib/wave/captions.rb
Overview
Captions — Auto-captioning and multi-language translation
Instance Method Summary collapse
-
#create_job(body) ⇒ Object
Create a caption job (operationId: createCaptionJob, POST /captions).
-
#delete_job(job_id) ⇒ Object
Delete a caption job (operationId: deleteCaptionJob, DELETE /captions/jobId).
-
#download(job_id, language, format: nil) ⇒ Object
Download captions (operationId: downloadCaptions, GET /captions/jobId/download).
-
#get_job(job_id) ⇒ Object
Get a caption job (operationId: getCaptionJob, GET /captions/jobId).
-
#initialize(client) ⇒ Captions
constructor
A new instance of Captions.
-
#list(page: nil, per_page: nil, video_id: nil, status: nil) ⇒ Object
List caption jobs (operationId: listCaptions, GET /captions).
Constructor Details
#initialize(client) ⇒ Captions
Returns a new instance of Captions.
6 7 8 |
# File 'lib/wave/captions.rb', line 6 def initialize(client) @client = client end |
Instance Method Details
#create_job(body) ⇒ Object
Create a caption job (operationId: createCaptionJob, POST /captions).
22 23 24 |
# File 'lib/wave/captions.rb', line 22 def create_job(body) @client.request("POST", "/captions", body: body) end |
#delete_job(job_id) ⇒ Object
Delete a caption job (operationId: deleteCaptionJob, DELETE /captions/jobId).
32 33 34 |
# File 'lib/wave/captions.rb', line 32 def delete_job(job_id) @client.request("DELETE", "/captions/#{job_id}") end |
#download(job_id, language, format: nil) ⇒ Object
Download captions (operationId: downloadCaptions, GET /captions/jobId/download).
37 38 39 40 41 42 43 |
# File 'lib/wave/captions.rb', line 37 def download(job_id, language, format: nil) query = { "language" => language, "format" => format, } @client.request("GET", "/captions/#{job_id}/download", query: query) end |
#get_job(job_id) ⇒ Object
Get a caption job (operationId: getCaptionJob, GET /captions/jobId).
27 28 29 |
# File 'lib/wave/captions.rb', line 27 def get_job(job_id) @client.request("GET", "/captions/#{job_id}") end |
#list(page: nil, per_page: nil, video_id: nil, status: nil) ⇒ Object
List caption jobs (operationId: listCaptions, GET /captions).
11 12 13 14 15 16 17 18 19 |
# File 'lib/wave/captions.rb', line 11 def list(page: nil, per_page: nil, video_id: nil, status: nil) query = { "page" => page, "perPage" => per_page, "videoId" => video_id, "status" => status, } @client.request("GET", "/captions", query: query) end |