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
Instance Method Summary collapse
-
#create(**params) ⇒ RunApi::Runway::Types::TaskCreateResponse
Create an extend-video task without waiting for completion.
-
#get(id) ⇒ RunApi::Runway::Types::TaskResponse
Get extend-video task status by task ID.
-
#initialize(http) ⇒ ExtendVideo
constructor
A new instance of ExtendVideo.
-
#run(**params) ⇒ RunApi::Runway::Types::CompletedTaskResponse
Extend a video and wait until complete.
Constructor Details
#initialize(http) ⇒ ExtendVideo
Returns a new instance of ExtendVideo.
15 16 17 |
# File 'lib/runapi/runway/resources/extend_video.rb', line 15 def initialize(http) @http = http end |
Instance Method Details
#create(**params) ⇒ RunApi::Runway::Types::TaskCreateResponse
Create an extend-video task without waiting for completion.
36 37 38 39 40 |
# File 'lib/runapi/runway/resources/extend_video.rb', line 36 def create(**params) params = compact_params(params) validate_params!(params) request(:post, ENDPOINT, body: params) end |
#get(id) ⇒ RunApi::Runway::Types::TaskResponse
Get extend-video task status by task ID.
46 47 48 |
# File 'lib/runapi/runway/resources/extend_video.rb', line 46 def get(id) request(:get, "#{ENDPOINT}/#{id}") end |
#run(**params) ⇒ RunApi::Runway::Types::CompletedTaskResponse
Extend a video and wait until complete.
27 28 29 30 |
# File 'lib/runapi/runway/resources/extend_video.rb', line 27 def run(**params) task = create(**params) poll_until_complete { get(task.id) } end |