Class: RunApi::Kling::Resources::ExtendVideo
- Inherits:
-
Object
- Object
- RunApi::Kling::Resources::ExtendVideo
- Includes:
- Core::ResourceHelpers
- Defined in:
- lib/runapi/kling/resources/extend_video.rb
Overview
Continue a completed Kling V2.5 Turbo video task.
Constant Summary collapse
- ENDPOINT =
"/api/v1/kling/extend_video"
Instance Method Summary collapse
- #create(options: nil, **params) ⇒ Object
- #get(id, options: nil) ⇒ Object
-
#initialize(http) ⇒ ExtendVideo
constructor
A new instance of ExtendVideo.
- #run(options: nil, **params) ⇒ Object
Constructor Details
#initialize(http) ⇒ ExtendVideo
Returns a new instance of ExtendVideo.
12 13 14 |
# File 'lib/runapi/kling/resources/extend_video.rb', line 12 def initialize(http) @http = http end |
Instance Method Details
#create(options: nil, **params) ⇒ Object
21 22 23 24 25 |
# File 'lib/runapi/kling/resources/extend_video.rb', line 21 def create(options: nil, **params) params = compact_params(params) validate_contract!(CONTRACT["extend-video"], params) request(:post, ENDPOINT, body: params, options: ) end |
#get(id, options: nil) ⇒ Object
27 28 29 |
# File 'lib/runapi/kling/resources/extend_video.rb', line 27 def get(id, options: nil) request(:get, "#{ENDPOINT}/#{id}", options: ) end |
#run(options: nil, **params) ⇒ Object
16 17 18 19 |
# File 'lib/runapi/kling/resources/extend_video.rb', line 16 def run(options: nil, **params) task = create(options: , **params) poll_until_complete { get(task.id, options: ) } end |