Class: RunApi::Veo31::Resources::ExtendVideo
- Inherits:
-
Object
- Object
- RunApi::Veo31::Resources::ExtendVideo
- Includes:
- Core::ResourceHelpers
- Defined in:
- lib/runapi/veo_3_1/resources/extend_video.rb
Overview
Veo 3.1 video extension resource. Append additional footage to a completed text-to-video or extend-video task.
Constant Summary collapse
- ENDPOINT =
"/api/v1/veo_3_1/extend_video"- RESPONSE_CLASS =
Types::ExtendVideoResponse
- COMPLETED_RESPONSE_CLASS =
Types::CompletedExtendVideoResponse
Instance Method Summary collapse
-
#create(**params) ⇒ RunApi::Veo31::Types::ExtendVideoResponse
Create a video extension task without waiting.
-
#get(id) ⇒ RunApi::Veo31::Types::ExtendVideoResponse
Get video extension task status by task ID.
-
#initialize(http) ⇒ ExtendVideo
constructor
A new instance of ExtendVideo.
-
#run(**params) ⇒ RunApi::Veo31::Types::CompletedExtendVideoResponse
Extend a video and wait until complete.
Constructor Details
#initialize(http) ⇒ ExtendVideo
Returns a new instance of ExtendVideo.
16 17 18 |
# File 'lib/runapi/veo_3_1/resources/extend_video.rb', line 16 def initialize(http) @http = http end |
Instance Method Details
#create(**params) ⇒ RunApi::Veo31::Types::ExtendVideoResponse
Create a video extension task without waiting.
33 34 35 36 37 |
# File 'lib/runapi/veo_3_1/resources/extend_video.rb', line 33 def create(**params) params = compact_params(params) validate_params!(params) request(:post, ENDPOINT, body: params) end |
#get(id) ⇒ RunApi::Veo31::Types::ExtendVideoResponse
Get video extension task status by task ID.
43 44 45 |
# File 'lib/runapi/veo_3_1/resources/extend_video.rb', line 43 def get(id) request(:get, "#{ENDPOINT}/#{id}") end |
#run(**params) ⇒ RunApi::Veo31::Types::CompletedExtendVideoResponse
Extend a video and wait until complete.
24 25 26 27 |
# File 'lib/runapi/veo_3_1/resources/extend_video.rb', line 24 def run(**params) task = create(**params) poll_until_complete { get(task.id) } end |