Class: RunApi::Luma::Resources::ModifyVideo
- Inherits:
-
Object
- Object
- RunApi::Luma::Resources::ModifyVideo
- Includes:
- Core::ResourceHelpers
- Defined in:
- lib/runapi/luma/resources/modify_video.rb
Overview
Luma video modification resource. Apply prompt-guided visual edits to an existing video while preserving its motion.
Constant Summary collapse
- ENDPOINT =
"/api/v1/luma/modify_video"- RESPONSE_CLASS =
Types::ModifyVideoResponse
- COMPLETED_RESPONSE_CLASS =
Types::CompletedModifyVideoResponse
Instance Method Summary collapse
-
#create(**params) ⇒ RunApi::Luma::Types::ModifyVideoResponse
Start a video modification task.
-
#get(id) ⇒ RunApi::Luma::Types::ModifyVideoResponse
Get video modification task status by task ID.
-
#initialize(http) ⇒ ModifyVideo
constructor
A new instance of ModifyVideo.
-
#run(**params) ⇒ RunApi::Luma::Types::CompletedModifyVideoResponse
Modify a video and wait until complete.
Constructor Details
#initialize(http) ⇒ ModifyVideo
Returns a new instance of ModifyVideo.
15 16 17 |
# File 'lib/runapi/luma/resources/modify_video.rb', line 15 def initialize(http) @http = http end |
Instance Method Details
#create(**params) ⇒ RunApi::Luma::Types::ModifyVideoResponse
Start a video modification task.
32 33 34 35 36 |
# File 'lib/runapi/luma/resources/modify_video.rb', line 32 def create(**params) params = compact_params(params) validate_params!(params) request(:post, ENDPOINT, body: params) end |
#get(id) ⇒ RunApi::Luma::Types::ModifyVideoResponse
Get video modification task status by task ID.
42 43 44 |
# File 'lib/runapi/luma/resources/modify_video.rb', line 42 def get(id) request(:get, "#{ENDPOINT}/#{id}") end |
#run(**params) ⇒ RunApi::Luma::Types::CompletedModifyVideoResponse
Modify a video and wait until complete.
23 24 25 26 |
# File 'lib/runapi/luma/resources/modify_video.rb', line 23 def run(**params) task = create(**params) poll_until_complete { get(task.id) } end |