Class: RunApi::Runway::Resources::ExtendVideo
- Inherits:
-
Object
- Object
- RunApi::Runway::Resources::ExtendVideo
- Includes:
- Core::ResourceHelpers
- Defined in:
- lib/runapi/runway/resources/extend_video.rb
Overview
Runway extend-video resource. Append additional footage to a previously generated video, continuing from where the source task left off.
Constant Summary collapse
- ENDPOINT =
"/api/v1/runway/extend_video"- RESPONSE_CLASS =
Types::TaskCreateResponse
- COMPLETED_RESPONSE_CLASS =
Types::CompletedTaskResponse
- MODEL =
"runway"
Instance Method Summary collapse
-
#create(options: nil, **params) ⇒ RunApi::Runway::Types::TaskCreateResponse
Create an extend-video task without waiting for completion.
-
#get(id, options: nil) ⇒ RunApi::Runway::Types::TaskResponse
Get extend-video task status by task ID.
-
#initialize(http) ⇒ ExtendVideo
constructor
A new instance of ExtendVideo.
-
#run(options: nil, **params) ⇒ RunApi::Runway::Types::CompletedTaskResponse
Extend a video and wait until complete.
Constructor Details
#initialize(http) ⇒ ExtendVideo
Returns a new instance of ExtendVideo.
16 17 18 |
# File 'lib/runapi/runway/resources/extend_video.rb', line 16 def initialize(http) @http = http end |
Instance Method Details
#create(options: nil, **params) ⇒ RunApi::Runway::Types::TaskCreateResponse
Create an extend-video task without waiting for completion.
37 38 39 40 41 |
# File 'lib/runapi/runway/resources/extend_video.rb', line 37 def create(options: nil, **params) params = compact_params(params) validate_contract!(CONTRACT["extend-video"], params.merge(model: MODEL)) request(:post, ENDPOINT, body: params, options: ) end |
#get(id, options: nil) ⇒ RunApi::Runway::Types::TaskResponse
Get extend-video task status by task ID.
47 48 49 |
# File 'lib/runapi/runway/resources/extend_video.rb', line 47 def get(id, options: nil) request(:get, "#{ENDPOINT}/#{id}", options: ) end |
#run(options: nil, **params) ⇒ RunApi::Runway::Types::CompletedTaskResponse
Extend a video and wait until complete.
28 29 30 31 |
# File 'lib/runapi/runway/resources/extend_video.rb', line 28 def run(options: nil, **params) task = create(options: , **params) poll_until_complete { get(task.id, options: ) } end |