Skip to content

Commit 489f1ba

Browse files
dazzatronusgithub-actions[bot]
authored andcommitted
chore: regenerate SDK from @shotstack/schemas v1.17.0
1 parent 7c86411 commit 489f1ba

27 files changed

Lines changed: 1464 additions & 83 deletions

.oas-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.10.4
1+
1.17.0

lib/shotstack/api/edit_api.rb

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,69 @@ def delete_template_with_http_info(id, opts = {})
8585
return data, status_code, headers
8686
end
8787

88+
# Get Generation Status
89+
# 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>
90+
# @param id [String] The generation job id returned by the generate endpoint.
91+
# @param [Hash] opts the optional parameters
92+
# @return [Object]
93+
def get_generate(id, opts = {})
94+
data, _status_code, _headers = get_generate_with_http_info(id, opts)
95+
data
96+
end
97+
98+
# Get Generation Status
99+
# 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;
100+
# @param id [String] The generation job id returned by the generate endpoint.
101+
# @param [Hash] opts the optional parameters
102+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
103+
def get_generate_with_http_info(id, opts = {})
104+
if @api_client.config.debugging
105+
@api_client.config.logger.debug 'Calling API: EditApi.get_generate ...'
106+
end
107+
# verify the required parameter 'id' is set
108+
if @api_client.config.client_side_validation && id.nil?
109+
fail ArgumentError, "Missing the required parameter 'id' when calling EditApi.get_generate"
110+
end
111+
# resource path
112+
local_var_path = '/generate/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
113+
114+
# query parameters
115+
query_params = opts[:query_params] || {}
116+
117+
# header parameters
118+
header_params = opts[:header_params] || {}
119+
# HTTP header 'Accept' (if needed)
120+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
121+
122+
# form parameters
123+
form_params = opts[:form_params] || {}
124+
125+
# http body (model)
126+
post_body = opts[:debug_body]
127+
128+
# return_type
129+
return_type = opts[:debug_return_type] || 'Object'
130+
131+
# auth_names
132+
auth_names = opts[:debug_auth_names] || ['DeveloperKey']
133+
134+
new_options = opts.merge(
135+
:operation => :"EditApi.get_generate",
136+
:header_params => header_params,
137+
:query_params => query_params,
138+
:form_params => form_params,
139+
:body => post_body,
140+
:auth_names => auth_names,
141+
:return_type => return_type
142+
)
143+
144+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
145+
if @api_client.config.debugging
146+
@api_client.config.logger.debug "API called: EditApi#get_generate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
147+
end
148+
return data, status_code, headers
149+
end
150+
88151
# Get Render Status
89152
# 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>
90153
# @param id [String] The id of the timeline render task in UUID format
@@ -284,6 +347,70 @@ def get_templates_with_http_info(opts = {})
284347
return data, status_code, headers
285348
end
286349

350+
# Generate Asset
351+
# 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>
352+
# @param [Hash] opts the optional parameters
353+
# @option opts [PostGenerateRequest] :post_generate_request A prompt-bearing image, video or audio asset to generate.
354+
# @return [PostGenerate200Response]
355+
def post_generate(opts = {})
356+
data, _status_code, _headers = post_generate_with_http_info(opts)
357+
data
358+
end
359+
360+
# Generate Asset
361+
# 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;
362+
# @param [Hash] opts the optional parameters
363+
# @option opts [PostGenerateRequest] :post_generate_request A prompt-bearing image, video or audio asset to generate.
364+
# @return [Array<(PostGenerate200Response, Integer, Hash)>] PostGenerate200Response data, response status code and response headers
365+
def post_generate_with_http_info(opts = {})
366+
if @api_client.config.debugging
367+
@api_client.config.logger.debug 'Calling API: EditApi.post_generate ...'
368+
end
369+
# resource path
370+
local_var_path = '/generate'
371+
372+
# query parameters
373+
query_params = opts[:query_params] || {}
374+
375+
# header parameters
376+
header_params = opts[:header_params] || {}
377+
# HTTP header 'Accept' (if needed)
378+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
379+
# HTTP header 'Content-Type'
380+
content_type = @api_client.select_header_content_type(['application/json'])
381+
if !content_type.nil?
382+
header_params['Content-Type'] = content_type
383+
end
384+
385+
# form parameters
386+
form_params = opts[:form_params] || {}
387+
388+
# http body (model)
389+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'post_generate_request'])
390+
391+
# return_type
392+
return_type = opts[:debug_return_type] || 'PostGenerate200Response'
393+
394+
# auth_names
395+
auth_names = opts[:debug_auth_names] || ['DeveloperKey']
396+
397+
new_options = opts.merge(
398+
:operation => :"EditApi.post_generate",
399+
:header_params => header_params,
400+
:query_params => query_params,
401+
:form_params => form_params,
402+
:body => post_body,
403+
:auth_names => auth_names,
404+
:return_type => return_type
405+
)
406+
407+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
408+
if @api_client.config.debugging
409+
@api_client.config.logger.debug "API called: EditApi#post_generate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
410+
end
411+
return data, status_code, headers
412+
end
413+
287414
# Render Asset
288415
# 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>
289416
# @param edit [Edit] The video, image or audio edit specified using JSON.

lib/shotstack/models/asset.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def openapi_one_of
2222
[
2323
:'AudioAsset',
2424
:'CaptionAsset',
25+
:'Html5Asset',
2526
:'HtmlAsset',
2627
:'ImageAsset',
2728
:'ImageToVideoAsset',
@@ -49,6 +50,7 @@ def openapi_discriminator_mapping
4950
:'audio' => :'AudioAsset',
5051
:'caption' => :'CaptionAsset',
5152
:'html' => :'HtmlAsset',
53+
:'html5' => :'Html5Asset',
5254
:'image' => :'ImageAsset',
5355
:'image-to-video' => :'ImageToVideoAsset',
5456
:'luma' => :'LumaAsset',

lib/shotstack/models/audio_asset.rb

Lines changed: 59 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,29 @@
1414
require 'time'
1515

1616
module Shotstack
17-
# The AudioAsset is used to add sound effects and audio at specific intervals on the timeline. The src must be a publicly accessible URL to an audio resource such as an mp3 file.
17+
# The AudioAsset adds audio to a Clip. The audio can be sourced from a URL (`src`), generated from a text prompt (`prompt`), or both. At least one of `src` or `prompt` must be provided. - **Source URL:** set `src` to a publicly accessible audio URL (e.g. mp3). - **Generated speech:** set `prompt` to the spoken text and choose a text-to-speech `model`; set the voice via `options`. - **Generated music or SFX:** set `prompt` describing the sound and choose a music generation `model`. - **Both:** `src` acts as a preview placeholder while `prompt` drives generation — the audio is regenerated from the prompt at render time. Unchanged prompts and options resolve from the generation cache. - Use `model` to choose the generator and `options` to configure it. The generated `src` is filled in automatically.
1818
class AudioAsset
1919
# The type of asset - set to `audio` for audio assets.
2020
attr_accessor :type
2121

22-
# The audio source URL. The URL must be publicly accessible or include credentials.
22+
# The audio source URL. The URL must be publicly accessible or include credentials. When `prompt` is also set, `src` serves as a preview placeholder and the audio is regenerated from the prompt at render time.
2323
attr_accessor :src
2424

25+
# A text prompt. For text-to-speech models the prompt is the spoken text; for music models it describes the sound to generate. The generated `src` is filled in automatically; an existing `src` is treated as a preview placeholder and replaced.
26+
attr_accessor :prompt
27+
28+
# The generation model to use when `prompt` is set (e.g. `polly-neural`, `elevenlabs-tts`, `elevenlabs-music`). Defaults to `elevenlabs-tts` (with a default voice) if omitted. Each model's available options are defined by the model registry.
29+
attr_accessor :model
30+
31+
# Model-specific generation settings. Valid keys and values depend on the chosen `model` and are defined by the model registry. Omitted options use the model's defaults. Unknown or invalid options are rejected.
32+
attr_accessor :options
33+
2534
# The start trim point of the audio clip, in seconds (defaults to 0). Audio will start from the in trim point. The audio will play until the file ends or the Clip length is reached.
2635
attr_accessor :trim
2736

2837
attr_accessor :volume
2938

30-
# Adjust the playback speed of the audio clip between 0 (paused) and 10 (10x normal speed), where 1 is normal speed (defaults to 1). Adjusting the speed will also adjust the duration of the clip and may require you to adjust the Clip length. For example, if you set speed to 0.5, the clip will need to be 2x as long to play the entire audio (i.e. original length / 0.5). If you set speed to 2, the clip will need to be half as long to play the entire audio (i.e. original length / 2).
39+
# Adjust the playback speed of the audio clip between 0 (paused) and 10 (10x normal speed), where 1 is normal speed (defaults to 1). Adjusting the speed will also adjust the duration of the clip and may require you to adjust the Clip length. For example, if you set speed to 0.5, the clip will need to be 2x as long to play the entire audio (i.e. original length / 0.5). If you set speed to 2, the clip will need to be half as long to play the entire audio (i.e. original length / 2).
3140
attr_accessor :speed
3241

3342
# The effect to apply to the audio asset <ul> <li>`fadeIn` - fade volume in only</li> <li>`fadeOut` - fade volume out only</li> <li>`fadeInFadeOut` - fade volume in and out</li> </ul>
@@ -60,6 +69,9 @@ def self.attribute_map
6069
{
6170
:'type' => :'type',
6271
:'src' => :'src',
72+
:'prompt' => :'prompt',
73+
:'model' => :'model',
74+
:'options' => :'options',
6375
:'trim' => :'trim',
6476
:'volume' => :'volume',
6577
:'speed' => :'speed',
@@ -77,6 +89,9 @@ def self.openapi_types
7789
{
7890
:'type' => :'String',
7991
:'src' => :'String',
92+
:'prompt' => :'String',
93+
:'model' => :'String',
94+
:'options' => :'Hash<String, Object>',
8095
:'trim' => :'Float',
8196
:'volume' => :'AudioAssetVolume',
8297
:'speed' => :'Float',
@@ -113,8 +128,20 @@ def initialize(attributes = {})
113128

114129
if attributes.key?(:'src')
115130
self.src = attributes[:'src']
116-
else
117-
self.src = nil
131+
end
132+
133+
if attributes.key?(:'prompt')
134+
self.prompt = attributes[:'prompt']
135+
end
136+
137+
if attributes.key?(:'model')
138+
self.model = attributes[:'model']
139+
end
140+
141+
if attributes.key?(:'options')
142+
if (value = attributes[:'options']).is_a?(Hash)
143+
self.options = value
144+
end
118145
end
119146

120147
if attributes.key?(:'trim')
@@ -143,19 +170,19 @@ def list_invalid_properties
143170
invalid_properties.push('invalid value for "type", type cannot be nil.')
144171
end
145172

146-
if @src.nil?
147-
invalid_properties.push('invalid value for "src", src cannot be nil.')
148-
end
149-
150-
if @src.to_s.length < 1
173+
if !@src.nil? && @src.to_s.length < 1
151174
invalid_properties.push('invalid value for "src", the character length must be great than or equal to 1.')
152175
end
153176

154177
pattern = Regexp.new(/\S/)
155-
if @src !~ pattern
178+
if !@src.nil? && @src !~ pattern
156179
invalid_properties.push("invalid value for \"src\", must conform to the pattern #{pattern}.")
157180
end
158181

182+
if !@prompt.nil? && @prompt.to_s.length > 4000
183+
invalid_properties.push('invalid value for "prompt", the character length must be smaller than or equal to 4000.')
184+
end
185+
159186
if !@speed.nil? && @speed > 10
160187
invalid_properties.push('invalid value for "speed", must be smaller than or equal to 10.')
161188
end
@@ -174,9 +201,9 @@ def valid?
174201
return false if @type.nil?
175202
type_validator = EnumAttributeValidator.new('String', ["audio"])
176203
return false unless type_validator.valid?(@type)
177-
return false if @src.nil?
178-
return false if @src.to_s.length < 1
179-
return false if @src !~ Regexp.new(/\S/)
204+
return false if !@src.nil? && @src.to_s.length < 1
205+
return false if !@src.nil? && @src !~ Regexp.new(/\S/)
206+
return false if !@prompt.nil? && @prompt.to_s.length > 4000
180207
return false if !@speed.nil? && @speed > 10
181208
return false if !@speed.nil? && @speed < 0
182209
effect_validator = EnumAttributeValidator.new('String', ["none", "fadeIn", "fadeOut", "fadeInFadeOut"])
@@ -213,6 +240,20 @@ def src=(src)
213240
@src = src
214241
end
215242

243+
# Custom attribute writer method with validation
244+
# @param [Object] prompt Value to be assigned
245+
def prompt=(prompt)
246+
if prompt.nil?
247+
fail ArgumentError, 'prompt cannot be nil'
248+
end
249+
250+
if prompt.to_s.length > 4000
251+
fail ArgumentError, 'invalid value for "prompt", the character length must be smaller than or equal to 4000.'
252+
end
253+
254+
@prompt = prompt
255+
end
256+
216257
# Custom attribute writer method with validation
217258
# @param [Object] speed Value to be assigned
218259
def speed=(speed)
@@ -248,6 +289,9 @@ def ==(o)
248289
self.class == o.class &&
249290
type == o.type &&
250291
src == o.src &&
292+
prompt == o.prompt &&
293+
model == o.model &&
294+
options == o.options &&
251295
trim == o.trim &&
252296
volume == o.volume &&
253297
speed == o.speed &&
@@ -263,7 +307,7 @@ def eql?(o)
263307
# Calculates hash code according to all attributes.
264308
# @return [Integer] Hash code
265309
def hash
266-
[type, src, trim, volume, speed, effect].hash
310+
[type, src, prompt, model, options, trim, volume, speed, effect].hash
267311
end
268312

269313
# Builds the object from hash

lib/shotstack/models/clip.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
module Shotstack
1717
# A clip is a container for a specific type of asset, i.e. a title, image, video, audio or html. You use a Clip to define when an asset will display on the timeline, how long it will play for and transitions, filters and effects to apply to it.
1818
class Clip
19+
# Optional client-generated identifier. Used by client SDKs (e.g. the Shotstack Studio SDK) to reference a clip across edits without relying on its position in the timeline. The render API does not use this field and it does not appear in render output.
20+
attr_accessor :id
21+
1922
attr_accessor :asset
2023

2124
attr_accessor :start
@@ -78,6 +81,7 @@ def valid?(value)
7881
# Attribute mapping from ruby-style variable name to JSON key.
7982
def self.attribute_map
8083
{
84+
:'id' => :'id',
8185
:'asset' => :'asset',
8286
:'start' => :'start',
8387
:'length' => :'length',
@@ -104,6 +108,7 @@ def self.acceptable_attributes
104108
# Attribute type mapping.
105109
def self.openapi_types
106110
{
111+
:'id' => :'String',
107112
:'asset' => :'Asset',
108113
:'start' => :'ClipStart',
109114
:'length' => :'ClipLength',
@@ -143,6 +148,10 @@ def initialize(attributes = {})
143148
h[k.to_sym] = v
144149
}
145150

151+
if attributes.key?(:'id')
152+
self.id = attributes[:'id']
153+
end
154+
146155
if attributes.key?(:'asset')
147156
self.asset = attributes[:'asset']
148157
else
@@ -370,6 +379,7 @@ def _alias=(_alias)
370379
def ==(o)
371380
return true if self.equal?(o)
372381
self.class == o.class &&
382+
id == o.id &&
373383
asset == o.asset &&
374384
start == o.start &&
375385
length == o.length &&
@@ -396,7 +406,7 @@ def eql?(o)
396406
# Calculates hash code according to all attributes.
397407
# @return [Integer] Hash code
398408
def hash
399-
[asset, start, length, fit, scale, width, height, position, offset, transition, effect, filter, opacity, transform, _alias].hash
409+
[id, asset, start, length, fit, scale, width, height, position, offset, transition, effect, filter, opacity, transform, _alias].hash
400410
end
401411

402412
# Builds the object from hash

lib/shotstack/models/google_drive_destination.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ def initialize(attributes = {})
7171

7272
if attributes.key?(:'options')
7373
self.options = attributes[:'options']
74-
else
75-
self.options = nil
7674
end
7775
end
7876

@@ -85,10 +83,6 @@ def list_invalid_properties
8583
invalid_properties.push('invalid value for "provider", provider cannot be nil.')
8684
end
8785

88-
if @options.nil?
89-
invalid_properties.push('invalid value for "options", options cannot be nil.')
90-
end
91-
9286
invalid_properties
9387
end
9488

@@ -97,7 +91,6 @@ def list_invalid_properties
9791
def valid?
9892
warn '[DEPRECATED] the `valid?` method is obsolete'
9993
return false if @provider.nil?
100-
return false if @options.nil?
10194
true
10295
end
10396

0 commit comments

Comments
 (0)