Class: RunApi::Topaz::Resources::UpscaleVideo
- Inherits:
-
Object
- Object
- RunApi::Topaz::Resources::UpscaleVideo
- Includes:
- Core::ResourceHelpers
- Defined in:
- lib/runapi/topaz/resources/upscale_video.rb
Overview
AI-powered video upscaling resource. Supports upscale factors of 1x, 2x, and 4x.
Constant Summary collapse
- ENDPOINT =
"/api/v1/topaz/upscale_video"- RESPONSE_CLASS =
Types::UpscaleVideoResponse
- COMPLETED_RESPONSE_CLASS =
Types::CompletedUpscaleVideoResponse
Instance Method Summary collapse
- #create(**params) ⇒ Object
- #get(id) ⇒ Object
-
#initialize(http) ⇒ UpscaleVideo
constructor
A new instance of UpscaleVideo.
- #run(**params) ⇒ Object
Constructor Details
#initialize(http) ⇒ UpscaleVideo
Returns a new instance of UpscaleVideo.
16 17 18 |
# File 'lib/runapi/topaz/resources/upscale_video.rb', line 16 def initialize(http) @http = http end |
Instance Method Details
#create(**params) ⇒ Object
25 26 27 28 29 |
# File 'lib/runapi/topaz/resources/upscale_video.rb', line 25 def create(**params) params = compact_params(params) validate_params!(params) request(:post, ENDPOINT, body: params) end |
#get(id) ⇒ Object
31 32 33 |
# File 'lib/runapi/topaz/resources/upscale_video.rb', line 31 def get(id) request(:get, "#{ENDPOINT}/#{id}") end |
#run(**params) ⇒ Object
20 21 22 23 |
# File 'lib/runapi/topaz/resources/upscale_video.rb', line 20 def run(**params) task = create(**params) poll_until_complete { get(task.id) } end |