Class: RunApi::Topaz::Resources::UpscaleVideo
- Inherits:
-
Object
- Object
- RunApi::Topaz::Resources::UpscaleVideo
- Includes:
- Core::ResourceHelpers
- Defined in:
- lib/runapi/topaz/resources/upscale_video.rb
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.
14 15 16 |
# File 'lib/runapi/topaz/resources/upscale_video.rb', line 14 def initialize(http) @http = http end |
Instance Method Details
#create(**params) ⇒ Object
23 24 25 26 27 |
# File 'lib/runapi/topaz/resources/upscale_video.rb', line 23 def create(**params) params = compact_params(params) validate_params!(params) request(:post, ENDPOINT, body: params) end |
#get(id) ⇒ Object
29 30 31 |
# File 'lib/runapi/topaz/resources/upscale_video.rb', line 29 def get(id) request(:get, "#{ENDPOINT}/#{id}") end |
#run(**params) ⇒ Object
18 19 20 21 |
# File 'lib/runapi/topaz/resources/upscale_video.rb', line 18 def run(**params) task = create(**params) poll_until_complete { get(task.id) } end |