Class: RunApi::Veo31::Resources::TextToVideo
- Inherits:
-
Object
- Object
- RunApi::Veo31::Resources::TextToVideo
- Includes:
- Core::ResourceHelpers
- Defined in:
- lib/runapi/veo_3_1/resources/text_to_video.rb
Overview
Veo 3.1 text-to-video resource.
Constant Summary collapse
- ENDPOINT =
"/api/v1/veo_3_1/text_to_video"- RESPONSE_CLASS =
Types::TextToVideoResponse
- COMPLETED_RESPONSE_CLASS =
Types::CompletedTextToVideoResponse
Instance Method Summary collapse
- #create(**params) ⇒ Object
- #get(id) ⇒ Object
-
#initialize(http) ⇒ TextToVideo
constructor
A new instance of TextToVideo.
- #run(**params) ⇒ Object
Constructor Details
#initialize(http) ⇒ TextToVideo
Returns a new instance of TextToVideo.
15 16 17 |
# File 'lib/runapi/veo_3_1/resources/text_to_video.rb', line 15 def initialize(http) @http = http end |
Instance Method Details
#create(**params) ⇒ Object
24 25 26 27 28 |
# File 'lib/runapi/veo_3_1/resources/text_to_video.rb', line 24 def create(**params) params = compact_params(params) validate_params!(params) request(:post, ENDPOINT, body: params) end |
#get(id) ⇒ Object
30 31 32 |
# File 'lib/runapi/veo_3_1/resources/text_to_video.rb', line 30 def get(id) request(:get, "#{ENDPOINT}/#{id}") end |
#run(**params) ⇒ Object
19 20 21 22 |
# File 'lib/runapi/veo_3_1/resources/text_to_video.rb', line 19 def run(**params) task = create(**params) poll_until_complete { get(task.id) } end |