Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .oas-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.10.4
1.17.0
254 changes: 254 additions & 0 deletions lib/shotstack/api/edit_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,196 @@ def delete_template_with_http_info(id, opts = {})
return data, status_code, headers
end

# Get Generation Status
# Get the status of an on-demand asset generation job created with the generate endpoint. Jobs are owner-scoped. **Base URL:** <a href=\"#\">https://api.shotstack.io/edit/{version}</a>
# @param id [String] The generation job id returned by the generate endpoint.
# @param [Hash] opts the optional parameters
# @return [Object]
def get_generate(id, opts = {})
data, _status_code, _headers = get_generate_with_http_info(id, opts)
data
end

# Get Generation Status
# Get the status of an on-demand asset generation job created with the generate endpoint. Jobs are owner-scoped. **Base URL:** &lt;a href&#x3D;\&quot;#\&quot;&gt;https://api.shotstack.io/edit/{version}&lt;/a&gt;
# @param id [String] The generation job id returned by the generate endpoint.
# @param [Hash] opts the optional parameters
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
def get_generate_with_http_info(id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: EditApi.get_generate ...'
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling EditApi.get_generate"
end
# resource path
local_var_path = '/generate/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

# query parameters
query_params = opts[:query_params] || {}

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body]

# return_type
return_type = opts[:debug_return_type] || 'Object'

# auth_names
auth_names = opts[:debug_auth_names] || ['DeveloperKey']

new_options = opts.merge(
:operation => :"EditApi.get_generate",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)

data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: EditApi#get_generate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# Get Generation Model
# Get one generation model, including the JSON Schema for the options it accepts and what it costs in credits. **Base URL:** <a href=\"#\">https://api.shotstack.io/edit/{version}</a>
# @param id [String] The model identifier, as returned by the list endpoint.
# @param [Hash] opts the optional parameters
# @return [GetModel200Response]
def get_model(id, opts = {})
data, _status_code, _headers = get_model_with_http_info(id, opts)
data
end

# Get Generation Model
# Get one generation model, including the JSON Schema for the options it accepts and what it costs in credits. **Base URL:** &lt;a href&#x3D;\&quot;#\&quot;&gt;https://api.shotstack.io/edit/{version}&lt;/a&gt;
# @param id [String] The model identifier, as returned by the list endpoint.
# @param [Hash] opts the optional parameters
# @return [Array<(GetModel200Response, Integer, Hash)>] GetModel200Response data, response status code and response headers
def get_model_with_http_info(id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: EditApi.get_model ...'
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling EditApi.get_model"
end
# resource path
local_var_path = '/models/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

# query parameters
query_params = opts[:query_params] || {}

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body]

# return_type
return_type = opts[:debug_return_type] || 'GetModel200Response'

# auth_names
auth_names = opts[:debug_auth_names] || ['DeveloperKey']

new_options = opts.merge(
:operation => :"EditApi.get_model",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)

data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: EditApi#get_model\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# List Generation Models
# List the generation models available for `prompt`-bearing image, video and audio assets, with the options each accepts and what it costs in credits. Use this to populate a model picker and render its option fields, rather than hard coding a model list. A newly launched model appears here without any change on your side. Each entry carries the asset type it generates, so filter the list client side when a picker only needs one kind. Option schemas are omitted by default. Request them with `expand=options`. **Base URL:** <a href=\"#\">https://api.shotstack.io/edit/{version}</a>
# @param [Hash] opts the optional parameters
# @option opts [String] :expand Set to &#x60;options&#x60; to include each model&#39;s option schema in the list. Omitted by default to keep the response small.
# @return [GetModels200Response]
def get_models(opts = {})
data, _status_code, _headers = get_models_with_http_info(opts)
data
end

# List Generation Models
# List the generation models available for &#x60;prompt&#x60;-bearing image, video and audio assets, with the options each accepts and what it costs in credits. Use this to populate a model picker and render its option fields, rather than hard coding a model list. A newly launched model appears here without any change on your side. Each entry carries the asset type it generates, so filter the list client side when a picker only needs one kind. Option schemas are omitted by default. Request them with &#x60;expand&#x3D;options&#x60;. **Base URL:** &lt;a href&#x3D;\&quot;#\&quot;&gt;https://api.shotstack.io/edit/{version}&lt;/a&gt;
# @param [Hash] opts the optional parameters
# @option opts [String] :expand Set to &#x60;options&#x60; to include each model&#39;s option schema in the list. Omitted by default to keep the response small.
# @return [Array<(GetModels200Response, Integer, Hash)>] GetModels200Response data, response status code and response headers
def get_models_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: EditApi.get_models ...'
end
allowable_values = ["options"]
if @api_client.config.client_side_validation && opts[:'expand'] && !allowable_values.include?(opts[:'expand'])
fail ArgumentError, "invalid value for \"expand\", must be one of #{allowable_values}"
end
# resource path
local_var_path = '/models'

# query parameters
query_params = opts[:query_params] || {}
query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body]

# return_type
return_type = opts[:debug_return_type] || 'GetModels200Response'

# auth_names
auth_names = opts[:debug_auth_names] || ['DeveloperKey']

new_options = opts.merge(
:operation => :"EditApi.get_models",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)

data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: EditApi#get_models\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# Get Render Status
# Get the rendering status, temporary asset url and details of a render by ID. **Base URL:** <a href=\"#\">https://api.shotstack.io/edit/{version}</a>
# @param id [String] The id of the timeline render task in UUID format
Expand Down Expand Up @@ -284,6 +474,70 @@ def get_templates_with_http_info(opts = {})
return data, status_code, headers
end

# Generate Asset
# Generate a single image, video or audio asset from a text prompt without rendering a full edit. Submit a prompt-bearing asset; the response is immediate when an identical asset has been generated before (results are cached by prompt, model and options), otherwise the job is queued and can be polled via the status endpoint. Generation is billed in credits per asset. Identical repeat requests resolve from the cache at no charge. **Base URL:** <a href=\"#\">https://api.shotstack.io/edit/{version}</a>
# @param [Hash] opts the optional parameters
# @option opts [PostGenerateRequest] :post_generate_request A prompt-bearing image, video or audio asset to generate.
# @return [PostGenerate200Response]
def post_generate(opts = {})
data, _status_code, _headers = post_generate_with_http_info(opts)
data
end

# Generate Asset
# Generate a single image, video or audio asset from a text prompt without rendering a full edit. Submit a prompt-bearing asset; the response is immediate when an identical asset has been generated before (results are cached by prompt, model and options), otherwise the job is queued and can be polled via the status endpoint. Generation is billed in credits per asset. Identical repeat requests resolve from the cache at no charge. **Base URL:** &lt;a href&#x3D;\&quot;#\&quot;&gt;https://api.shotstack.io/edit/{version}&lt;/a&gt;
# @param [Hash] opts the optional parameters
# @option opts [PostGenerateRequest] :post_generate_request A prompt-bearing image, video or audio asset to generate.
# @return [Array<(PostGenerate200Response, Integer, Hash)>] PostGenerate200Response data, response status code and response headers
def post_generate_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: EditApi.post_generate ...'
end
# resource path
local_var_path = '/generate'

# query parameters
query_params = opts[:query_params] || {}

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'post_generate_request'])

# return_type
return_type = opts[:debug_return_type] || 'PostGenerate200Response'

# auth_names
auth_names = opts[:debug_auth_names] || ['DeveloperKey']

new_options = opts.merge(
:operation => :"EditApi.post_generate",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)

data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: EditApi#post_generate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# Render Asset
# Queue and render the contents of an [Edit](#tocs_edit) as a video, image or audio file. **Rendering Process:** 1. **Validation**: The edit JSON is validated 2. **Download**: All assets are downloaded and cached 3. **Preprocessing**: Video assets are automatically processed to fix compatibility issues 4. **Rendering**: The timeline is rendered using the processed assets 5. **Output**: The final media file is generated and stored **Video Preprocessing:** Video assets undergo automatic preprocessing to ensure compatibility. You can force preprocessing by setting `\"transcode\": true` on video assets. See [Preprocessing](#preprocessing) for more details. **Base URL:** <a href=\"#\">https://api.shotstack.io/edit/{version}</a>
# @param edit [Edit] The video, image or audio edit specified using JSON.
Expand Down
2 changes: 2 additions & 0 deletions lib/shotstack/models/asset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def openapi_one_of
[
:'AudioAsset',
:'CaptionAsset',
:'Html5Asset',
:'HtmlAsset',
:'ImageAsset',
:'ImageToVideoAsset',
Expand Down Expand Up @@ -49,6 +50,7 @@ def openapi_discriminator_mapping
:'audio' => :'AudioAsset',
:'caption' => :'CaptionAsset',
:'html' => :'HtmlAsset',
:'html5' => :'Html5Asset',
:'image' => :'ImageAsset',
:'image-to-video' => :'ImageToVideoAsset',
:'luma' => :'LumaAsset',
Expand Down
Loading