From ae4cbf1235057af6ff70c6462000ac277f7ebc94 Mon Sep 17 00:00:00 2001
From: dazzatronus <181476274+dazzatronus@users.noreply.github.com>
Date: Mon, 1 Jun 2026 17:22:33 +0000
Subject: [PATCH] chore: regenerate SDK from @shotstack/schemas v1.13.0
---
.oas-version | 2 +-
lib/shotstack/models/asset.rb | 2 +
lib/shotstack/models/audio_asset.rb | 92 ++++-
lib/shotstack/models/clip.rb | 12 +-
lib/shotstack/models/html5_asset.rb | 351 +++++++++++++++++++
lib/shotstack/models/image_asset.rb | 60 +++-
lib/shotstack/models/image_to_video_asset.rb | 2 +-
lib/shotstack/models/rich_caption_asset.rb | 4 +-
lib/shotstack/models/rich_text_background.rb | 58 ++-
lib/shotstack/models/text_background.rb | 18 +-
lib/shotstack/models/text_to_image_asset.rb | 2 +-
lib/shotstack/models/text_to_speech_asset.rb | 2 +-
lib/shotstack/models/video_asset.rb | 91 ++++-
lib/shotstack/version.rb | 2 +-
14 files changed, 639 insertions(+), 59 deletions(-)
create mode 100644 lib/shotstack/models/html5_asset.rb
diff --git a/.oas-version b/.oas-version
index 18b3114..feaae22 100644
--- a/.oas-version
+++ b/.oas-version
@@ -1 +1 @@
-1.10.4
+1.13.0
diff --git a/lib/shotstack/models/asset.rb b/lib/shotstack/models/asset.rb
index 59182bb..550a5da 100644
--- a/lib/shotstack/models/asset.rb
+++ b/lib/shotstack/models/asset.rb
@@ -22,6 +22,7 @@ def openapi_one_of
[
:'AudioAsset',
:'CaptionAsset',
+ :'Html5Asset',
:'HtmlAsset',
:'ImageAsset',
:'ImageToVideoAsset',
@@ -49,6 +50,7 @@ def openapi_discriminator_mapping
:'audio' => :'AudioAsset',
:'caption' => :'CaptionAsset',
:'html' => :'HtmlAsset',
+ :'html5' => :'Html5Asset',
:'image' => :'ImageAsset',
:'image-to-video' => :'ImageToVideoAsset',
:'luma' => :'LumaAsset',
diff --git a/lib/shotstack/models/audio_asset.rb b/lib/shotstack/models/audio_asset.rb
index 0c805f5..7a70e29 100644
--- a/lib/shotstack/models/audio_asset.rb
+++ b/lib/shotstack/models/audio_asset.rb
@@ -14,20 +14,35 @@
require 'time'
module Shotstack
- # 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.
+ # The AudioAsset adds audio to a Clip. The audio can be sourced from a URL (`src`) or generated from a text prompt (`prompt`). Exactly 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 `voice` to a voice identifier (text-to-speech). Optionally set `language`/`newscaster`. - **Generated music or SFX:** set `prompt` describing the sound; omit `voice`. - Use `model` to choose the generator. The generated `src` is filled in automatically.
class AudioAsset
# The type of asset - set to `audio` for audio assets.
attr_accessor :type
- # The audio source URL. The URL must be publicly accessible or include credentials.
+ # The audio source URL. The URL must be publicly accessible or include credentials. Provide either `src` or `prompt`, not both.
attr_accessor :src
+ # A text prompt. When `voice` is set, the prompt is the spoken text (text-to-speech). Without `voice`, the prompt describes generated music or sound effects. The generated `src` is filled in automatically.
+ attr_accessor :prompt
+
+ # Voice identifier for text-to-speech generation (e.g. `Matthew`, `Joanna`). Only meaningful when `prompt` is set.
+ attr_accessor :voice
+
+ # Optional BCP-47 language code (e.g. `en-US`) for text-to-speech. Only meaningful when `prompt` and `voice` are set.
+ attr_accessor :language
+
+ # Set to `true` to use the voice's newscaster mode when supported. Only meaningful when `prompt` and `voice` are set.
+ attr_accessor :newscaster
+
+ # The generation model to use when `prompt` is set (e.g. `polly-neural`). Defaults to the platform's preferred generator if omitted.
+ attr_accessor :model
+
# 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.
attr_accessor :trim
attr_accessor :volume
- # 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).
+ # 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).
attr_accessor :speed
# The effect to apply to the audio asset
- `fadeIn` - fade volume in only
- `fadeOut` - fade volume out only
- `fadeInFadeOut` - fade volume in and out
@@ -60,6 +75,11 @@ def self.attribute_map
{
:'type' => :'type',
:'src' => :'src',
+ :'prompt' => :'prompt',
+ :'voice' => :'voice',
+ :'language' => :'language',
+ :'newscaster' => :'newscaster',
+ :'model' => :'model',
:'trim' => :'trim',
:'volume' => :'volume',
:'speed' => :'speed',
@@ -77,6 +97,11 @@ def self.openapi_types
{
:'type' => :'String',
:'src' => :'String',
+ :'prompt' => :'String',
+ :'voice' => :'String',
+ :'language' => :'String',
+ :'newscaster' => :'Boolean',
+ :'model' => :'String',
:'trim' => :'Float',
:'volume' => :'AudioAssetVolume',
:'speed' => :'Float',
@@ -113,8 +138,28 @@ def initialize(attributes = {})
if attributes.key?(:'src')
self.src = attributes[:'src']
+ end
+
+ if attributes.key?(:'prompt')
+ self.prompt = attributes[:'prompt']
+ end
+
+ if attributes.key?(:'voice')
+ self.voice = attributes[:'voice']
+ end
+
+ if attributes.key?(:'language')
+ self.language = attributes[:'language']
+ end
+
+ if attributes.key?(:'newscaster')
+ self.newscaster = attributes[:'newscaster']
else
- self.src = nil
+ self.newscaster = false
+ end
+
+ if attributes.key?(:'model')
+ self.model = attributes[:'model']
end
if attributes.key?(:'trim')
@@ -143,19 +188,19 @@ def list_invalid_properties
invalid_properties.push('invalid value for "type", type cannot be nil.')
end
- if @src.nil?
- invalid_properties.push('invalid value for "src", src cannot be nil.')
- end
-
- if @src.to_s.length < 1
+ if !@src.nil? && @src.to_s.length < 1
invalid_properties.push('invalid value for "src", the character length must be great than or equal to 1.')
end
pattern = Regexp.new(/\S/)
- if @src !~ pattern
+ if !@src.nil? && @src !~ pattern
invalid_properties.push("invalid value for \"src\", must conform to the pattern #{pattern}.")
end
+ if !@prompt.nil? && @prompt.to_s.length > 4000
+ invalid_properties.push('invalid value for "prompt", the character length must be smaller than or equal to 4000.')
+ end
+
if !@speed.nil? && @speed > 10
invalid_properties.push('invalid value for "speed", must be smaller than or equal to 10.')
end
@@ -174,9 +219,9 @@ def valid?
return false if @type.nil?
type_validator = EnumAttributeValidator.new('String', ["audio"])
return false unless type_validator.valid?(@type)
- return false if @src.nil?
- return false if @src.to_s.length < 1
- return false if @src !~ Regexp.new(/\S/)
+ return false if !@src.nil? && @src.to_s.length < 1
+ return false if !@src.nil? && @src !~ Regexp.new(/\S/)
+ return false if !@prompt.nil? && @prompt.to_s.length > 4000
return false if !@speed.nil? && @speed > 10
return false if !@speed.nil? && @speed < 0
effect_validator = EnumAttributeValidator.new('String', ["none", "fadeIn", "fadeOut", "fadeInFadeOut"])
@@ -213,6 +258,20 @@ def src=(src)
@src = src
end
+ # Custom attribute writer method with validation
+ # @param [Object] prompt Value to be assigned
+ def prompt=(prompt)
+ if prompt.nil?
+ fail ArgumentError, 'prompt cannot be nil'
+ end
+
+ if prompt.to_s.length > 4000
+ fail ArgumentError, 'invalid value for "prompt", the character length must be smaller than or equal to 4000.'
+ end
+
+ @prompt = prompt
+ end
+
# Custom attribute writer method with validation
# @param [Object] speed Value to be assigned
def speed=(speed)
@@ -248,6 +307,11 @@ def ==(o)
self.class == o.class &&
type == o.type &&
src == o.src &&
+ prompt == o.prompt &&
+ voice == o.voice &&
+ language == o.language &&
+ newscaster == o.newscaster &&
+ model == o.model &&
trim == o.trim &&
volume == o.volume &&
speed == o.speed &&
@@ -263,7 +327,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [type, src, trim, volume, speed, effect].hash
+ [type, src, prompt, voice, language, newscaster, model, trim, volume, speed, effect].hash
end
# Builds the object from hash
diff --git a/lib/shotstack/models/clip.rb b/lib/shotstack/models/clip.rb
index c38a91d..d6c61b6 100644
--- a/lib/shotstack/models/clip.rb
+++ b/lib/shotstack/models/clip.rb
@@ -16,6 +16,9 @@
module Shotstack
# 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.
class Clip
+ # 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.
+ attr_accessor :id
+
attr_accessor :asset
attr_accessor :start
@@ -78,6 +81,7 @@ def valid?(value)
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
+ :'id' => :'id',
:'asset' => :'asset',
:'start' => :'start',
:'length' => :'length',
@@ -104,6 +108,7 @@ def self.acceptable_attributes
# Attribute type mapping.
def self.openapi_types
{
+ :'id' => :'String',
:'asset' => :'Asset',
:'start' => :'ClipStart',
:'length' => :'ClipLength',
@@ -143,6 +148,10 @@ def initialize(attributes = {})
h[k.to_sym] = v
}
+ if attributes.key?(:'id')
+ self.id = attributes[:'id']
+ end
+
if attributes.key?(:'asset')
self.asset = attributes[:'asset']
else
@@ -370,6 +379,7 @@ def _alias=(_alias)
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
+ id == o.id &&
asset == o.asset &&
start == o.start &&
length == o.length &&
@@ -396,7 +406,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [asset, start, length, fit, scale, width, height, position, offset, transition, effect, filter, opacity, transform, _alias].hash
+ [id, asset, start, length, fit, scale, width, height, position, offset, transition, effect, filter, opacity, transform, _alias].hash
end
# Builds the object from hash
diff --git a/lib/shotstack/models/html5_asset.rb b/lib/shotstack/models/html5_asset.rb
new file mode 100644
index 0000000..0b15552
--- /dev/null
+++ b/lib/shotstack/models/html5_asset.rb
@@ -0,0 +1,351 @@
+=begin
+#Shotstack
+
+# Official Ruby SDK for the Shotstack Cloud Video Editing API
+
+The version of the OpenAPI document: v1
+
+Generated by: https://openapi-generator.tech
+Generator version: 7.4.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Shotstack
+ # The Html5Asset renders full HTML5/CSS3/JS.
+ class Html5Asset
+ # The type of asset - set to `html5` for HTML5/CSS3/JS.
+ attr_accessor :type
+
+ # The HTML markup for the asset. Max 1,000,000 characters.
+ attr_accessor :html
+
+ # The CSS string applied to the HTML. Max 500,000 characters.
+ attr_accessor :css
+
+ # Optional JavaScript. Use for chart libraries, animations, or DOM manipulation. `gsap`, `d3`, `anime` and `lottie` are always available. CSS animations, transitions, and `Element.animate()` are also captured automatically. Max 500,000 characters.
+ attr_accessor :js
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'type' => :'type',
+ :'html' => :'html',
+ :'css' => :'css',
+ :'js' => :'js'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'type' => :'String',
+ :'html' => :'String',
+ :'css' => :'String',
+ :'js' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Shotstack::Html5Asset` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Shotstack::Html5Asset`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'type')
+ self.type = attributes[:'type']
+ else
+ self.type = 'html5'
+ end
+
+ if attributes.key?(:'html')
+ self.html = attributes[:'html']
+ else
+ self.html = nil
+ end
+
+ if attributes.key?(:'css')
+ self.css = attributes[:'css']
+ end
+
+ if attributes.key?(:'js')
+ self.js = attributes[:'js']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ if @type.nil?
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
+ end
+
+ if @html.nil?
+ invalid_properties.push('invalid value for "html", html cannot be nil.')
+ end
+
+ if @html.to_s.length > 1000000
+ invalid_properties.push('invalid value for "html", the character length must be smaller than or equal to 1000000.')
+ end
+
+ if !@css.nil? && @css.to_s.length > 500000
+ invalid_properties.push('invalid value for "css", the character length must be smaller than or equal to 500000.')
+ end
+
+ if !@js.nil? && @js.to_s.length > 500000
+ invalid_properties.push('invalid value for "js", the character length must be smaller than or equal to 500000.')
+ end
+
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ return false if @type.nil?
+ type_validator = EnumAttributeValidator.new('String', ["html5"])
+ return false unless type_validator.valid?(@type)
+ return false if @html.nil?
+ return false if @html.to_s.length > 1000000
+ return false if !@css.nil? && @css.to_s.length > 500000
+ return false if !@js.nil? && @js.to_s.length > 500000
+ true
+ end
+
+ # Custom attribute writer method checking allowed values (enum).
+ # @param [Object] type Object to be assigned
+ def type=(type)
+ validator = EnumAttributeValidator.new('String', ["html5"])
+ unless validator.valid?(type)
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
+ end
+ @type = type
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] html Value to be assigned
+ def html=(html)
+ if html.nil?
+ fail ArgumentError, 'html cannot be nil'
+ end
+
+ if html.to_s.length > 1000000
+ fail ArgumentError, 'invalid value for "html", the character length must be smaller than or equal to 1000000.'
+ end
+
+ @html = html
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] css Value to be assigned
+ def css=(css)
+ if css.nil?
+ fail ArgumentError, 'css cannot be nil'
+ end
+
+ if css.to_s.length > 500000
+ fail ArgumentError, 'invalid value for "css", the character length must be smaller than or equal to 500000.'
+ end
+
+ @css = css
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] js Value to be assigned
+ def js=(js)
+ if js.nil?
+ fail ArgumentError, 'js cannot be nil'
+ end
+
+ if js.to_s.length > 500000
+ fail ArgumentError, 'invalid value for "js", the character length must be smaller than or equal to 500000.'
+ end
+
+ @js = js
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ type == o.type &&
+ html == o.html &&
+ css == o.css &&
+ js == o.js
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [type, html, css, js].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Shotstack.const_get(type)
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/lib/shotstack/models/image_asset.rb b/lib/shotstack/models/image_asset.rb
index 19deda4..b0046c3 100644
--- a/lib/shotstack/models/image_asset.rb
+++ b/lib/shotstack/models/image_asset.rb
@@ -14,14 +14,20 @@
require 'time'
module Shotstack
- # The ImageAsset is used to create video from images to compose an image. The src must be a publicly accessible URL to an image resource such as a jpg or png file.
+ # The ImageAsset adds an image to a Clip. The image can be sourced from a URL (`src`) or generated from a text prompt (`prompt`). Exactly one of `src` or `prompt` must be provided. - **Source URL:** set `src` to the publicly accessible URL of a jpg or png file. - **Generated:** set `prompt` to describe the image; the engine generates it using the provider chosen by `model` and fills `src` in automatically.
class ImageAsset
# The type of asset - set to `image` for images.
attr_accessor :type
- # The image source URL. The URL must be publicly accessible or include credentials.
+ # The image source URL. The URL must be publicly accessible or include credentials. Provide either `src` or `prompt`, not both.
attr_accessor :src
+ # A text prompt to generate the image from. When set without `src`, the engine generates an image and fills `src` automatically. Use `model` to choose the generator.
+ attr_accessor :prompt
+
+ # The generation model to use when `prompt` is set (e.g. `flux-schnell`). Defaults to the platform's preferred generator if omitted.
+ attr_accessor :model
+
attr_accessor :crop
class EnumAttributeValidator
@@ -51,6 +57,8 @@ def self.attribute_map
{
:'type' => :'type',
:'src' => :'src',
+ :'prompt' => :'prompt',
+ :'model' => :'model',
:'crop' => :'crop'
}
end
@@ -65,6 +73,8 @@ def self.openapi_types
{
:'type' => :'String',
:'src' => :'String',
+ :'prompt' => :'String',
+ :'model' => :'String',
:'crop' => :'Crop'
}
end
@@ -98,8 +108,14 @@ def initialize(attributes = {})
if attributes.key?(:'src')
self.src = attributes[:'src']
- else
- self.src = nil
+ end
+
+ if attributes.key?(:'prompt')
+ self.prompt = attributes[:'prompt']
+ end
+
+ if attributes.key?(:'model')
+ self.model = attributes[:'model']
end
if attributes.key?(:'crop')
@@ -116,19 +132,19 @@ def list_invalid_properties
invalid_properties.push('invalid value for "type", type cannot be nil.')
end
- if @src.nil?
- invalid_properties.push('invalid value for "src", src cannot be nil.')
- end
-
- if @src.to_s.length < 1
+ if !@src.nil? && @src.to_s.length < 1
invalid_properties.push('invalid value for "src", the character length must be great than or equal to 1.')
end
pattern = Regexp.new(/\S/)
- if @src !~ pattern
+ if !@src.nil? && @src !~ pattern
invalid_properties.push("invalid value for \"src\", must conform to the pattern #{pattern}.")
end
+ if !@prompt.nil? && @prompt.to_s.length > 4000
+ invalid_properties.push('invalid value for "prompt", the character length must be smaller than or equal to 4000.')
+ end
+
invalid_properties
end
@@ -139,9 +155,9 @@ def valid?
return false if @type.nil?
type_validator = EnumAttributeValidator.new('String', ["image"])
return false unless type_validator.valid?(@type)
- return false if @src.nil?
- return false if @src.to_s.length < 1
- return false if @src !~ Regexp.new(/\S/)
+ return false if !@src.nil? && @src.to_s.length < 1
+ return false if !@src.nil? && @src !~ Regexp.new(/\S/)
+ return false if !@prompt.nil? && @prompt.to_s.length > 4000
true
end
@@ -174,6 +190,20 @@ def src=(src)
@src = src
end
+ # Custom attribute writer method with validation
+ # @param [Object] prompt Value to be assigned
+ def prompt=(prompt)
+ if prompt.nil?
+ fail ArgumentError, 'prompt cannot be nil'
+ end
+
+ if prompt.to_s.length > 4000
+ fail ArgumentError, 'invalid value for "prompt", the character length must be smaller than or equal to 4000.'
+ end
+
+ @prompt = prompt
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -181,6 +211,8 @@ def ==(o)
self.class == o.class &&
type == o.type &&
src == o.src &&
+ prompt == o.prompt &&
+ model == o.model &&
crop == o.crop
end
@@ -193,7 +225,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [type, src, crop].hash
+ [type, src, prompt, model, crop].hash
end
# Builds the object from hash
diff --git a/lib/shotstack/models/image_to_video_asset.rb b/lib/shotstack/models/image_to_video_asset.rb
index fa91682..17c84f8 100644
--- a/lib/shotstack/models/image_to_video_asset.rb
+++ b/lib/shotstack/models/image_to_video_asset.rb
@@ -14,7 +14,7 @@
require 'time'
module Shotstack
- # The ImageToVideoAsset lets you create a video from an image and a text prompt.
+ # **Notice: ImageToVideoAsset is deprecated. Use [VideoAsset](#tocs_videoasset) with `prompt` and `seed` instead.** This type continues to function and is internally rewritten to VideoAsset; no behaviour change for existing integrations. The ImageToVideoAsset lets you create a video from an image and a text prompt.
class ImageToVideoAsset
# The type of asset to generate - set to `image-to-video` for image-to-video.
attr_accessor :type
diff --git a/lib/shotstack/models/rich_caption_asset.rb b/lib/shotstack/models/rich_caption_asset.rb
index b1adfb8..6f97c08 100644
--- a/lib/shotstack/models/rich_caption_asset.rb
+++ b/lib/shotstack/models/rich_caption_asset.rb
@@ -14,12 +14,12 @@
require 'time'
module Shotstack
- # The RichCaptionAsset provides word-level caption animations with rich-text styling. It supports karaoke-style highlighting, word-by-word animations, and advanced typography. Use with SRT/VTT files or auto-transcription via aliases.
+ # The RichCaptionAsset provides word-level caption animations with rich-text styling. It supports karaoke-style highlighting, word-by-word animations, and advanced typography. Captions can be sourced from SRT/VTT/TTML subtitle files, from audio/video media URLs (auto-transcribed), or from alias references to other clips in the same timeline.
class RichCaptionAsset
# The type of asset - set to `rich-caption` for rich captions.
attr_accessor :type
- # The URL to an SRT or VTT subtitles file, or an alias reference to auto-generate captions from an audio or video clip. For file URLs, the URL must be publicly accessible or include credentials. For auto-captioning, use the format `alias://clip-name` where clip-name is the alias of an audio, video, or text-to-speech clip.
+ # Source for the caption words. Accepts three formats: (1) the URL to a subtitle file (`.srt`, `.vtt`, `.ttml`, or `.dfxp`) which is parsed directly; (2) the URL to an audio or video media file (`.mp4`, `.mov`, `.webm`, `.mp3`, `.wav`, `.m4a`, `.flac`, `.aac`, `.ogg`, and related formats) which is auto-transcribed; (3) an alias reference in the form `alias://clip-name` where `clip-name` is the alias of another audio, video, or text-to-speech clip in the same timeline — the referenced clip's source is auto-transcribed. For file URLs, the URL must be publicly accessible or include credentials. Content is classified at runtime and unsupported content types (HTML, PDF, images, archives) are rejected with a structured error.
attr_accessor :src
attr_accessor :font
diff --git a/lib/shotstack/models/rich_text_background.rb b/lib/shotstack/models/rich_text_background.rb
index 1df053c..b781a39 100644
--- a/lib/shotstack/models/rich_text_background.rb
+++ b/lib/shotstack/models/rich_text_background.rb
@@ -25,12 +25,20 @@ class RichTextBackground
# The border radius of the background box in pixels. Must be 0 or greater.
attr_accessor :border_radius
+ # When true, the background pill shrinks to fit the rendered text bounding box plus the asset's padding (and stroke width, if present), producing a pill or badge effect. When false (default), the background fills the full asset content area. Available on rich-text and rich-caption assets only; not supported on legacy `type: text`.
+ attr_accessor :wrap
+
+ # Inner padding in pixels between the wrap pill edge and the rendered text. Only takes effect when `wrap: true`. When omitted, the renderer applies a sensible default proportional to the font size (approximately 12% of the active page font size on rich-caption assets). Set to 0 for a pill that hugs the text exactly. Available on rich-text and rich-caption assets only.
+ attr_accessor :padding
+
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'color' => :'color',
:'opacity' => :'opacity',
- :'border_radius' => :'borderRadius'
+ :'border_radius' => :'borderRadius',
+ :'wrap' => :'wrap',
+ :'padding' => :'padding'
}
end
@@ -44,7 +52,9 @@ def self.openapi_types
{
:'color' => :'String',
:'opacity' => :'Float',
- :'border_radius' => :'Float'
+ :'border_radius' => :'Float',
+ :'wrap' => :'Boolean',
+ :'padding' => :'Integer'
}
end
@@ -84,6 +94,16 @@ def initialize(attributes = {})
else
self.border_radius = 0
end
+
+ if attributes.key?(:'wrap')
+ self.wrap = attributes[:'wrap']
+ else
+ self.wrap = false
+ end
+
+ if attributes.key?(:'padding')
+ self.padding = attributes[:'padding']
+ end
end
# Show invalid properties with the reasons. Usually used together with valid?
@@ -108,6 +128,14 @@ def list_invalid_properties
invalid_properties.push('invalid value for "border_radius", must be greater than or equal to 0.')
end
+ if !@padding.nil? && @padding > 200
+ invalid_properties.push('invalid value for "padding", must be smaller than or equal to 200.')
+ end
+
+ if !@padding.nil? && @padding < 0
+ invalid_properties.push('invalid value for "padding", must be greater than or equal to 0.')
+ end
+
invalid_properties
end
@@ -119,6 +147,8 @@ def valid?
return false if !@opacity.nil? && @opacity > 1
return false if !@opacity.nil? && @opacity < 0
return false if !@border_radius.nil? && @border_radius < 0
+ return false if !@padding.nil? && @padding > 200
+ return false if !@padding.nil? && @padding < 0
true
end
@@ -169,6 +199,24 @@ def border_radius=(border_radius)
@border_radius = border_radius
end
+ # Custom attribute writer method with validation
+ # @param [Object] padding Value to be assigned
+ def padding=(padding)
+ if padding.nil?
+ fail ArgumentError, 'padding cannot be nil'
+ end
+
+ if padding > 200
+ fail ArgumentError, 'invalid value for "padding", must be smaller than or equal to 200.'
+ end
+
+ if padding < 0
+ fail ArgumentError, 'invalid value for "padding", must be greater than or equal to 0.'
+ end
+
+ @padding = padding
+ end
+
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
@@ -176,7 +224,9 @@ def ==(o)
self.class == o.class &&
color == o.color &&
opacity == o.opacity &&
- border_radius == o.border_radius
+ border_radius == o.border_radius &&
+ wrap == o.wrap &&
+ padding == o.padding
end
# @see the `==` method
@@ -188,7 +238,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [color, opacity, border_radius].hash
+ [color, opacity, border_radius, wrap, padding].hash
end
# Builds the object from hash
diff --git a/lib/shotstack/models/text_background.rb b/lib/shotstack/models/text_background.rb
index 375cf90..fba4c52 100644
--- a/lib/shotstack/models/text_background.rb
+++ b/lib/shotstack/models/text_background.rb
@@ -28,13 +28,17 @@ class TextBackground
# The border radius of the background box in pixels for rounded corners.
attr_accessor :border_radius
+ # Not supported on legacy `text` assets. Accepted here only so validators can emit a clear migration error pointing users to `rich-text` or `rich-caption`, which support background wrapping natively.
+ attr_accessor :wrap
+
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'color' => :'color',
:'opacity' => :'opacity',
:'padding' => :'padding',
- :'border_radius' => :'borderRadius'
+ :'border_radius' => :'borderRadius',
+ :'wrap' => :'wrap'
}
end
@@ -49,7 +53,8 @@ def self.openapi_types
:'color' => :'String',
:'opacity' => :'Float',
:'padding' => :'Float',
- :'border_radius' => :'Float'
+ :'border_radius' => :'Float',
+ :'wrap' => :'Boolean'
}
end
@@ -89,6 +94,10 @@ def initialize(attributes = {})
if attributes.key?(:'border_radius')
self.border_radius = attributes[:'border_radius']
end
+
+ if attributes.key?(:'wrap')
+ self.wrap = attributes[:'wrap']
+ end
end
# Show invalid properties with the reasons. Usually used together with valid?
@@ -210,7 +219,8 @@ def ==(o)
color == o.color &&
opacity == o.opacity &&
padding == o.padding &&
- border_radius == o.border_radius
+ border_radius == o.border_radius &&
+ wrap == o.wrap
end
# @see the `==` method
@@ -222,7 +232,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [color, opacity, padding, border_radius].hash
+ [color, opacity, padding, border_radius, wrap].hash
end
# Builds the object from hash
diff --git a/lib/shotstack/models/text_to_image_asset.rb b/lib/shotstack/models/text_to_image_asset.rb
index 1d91c36..bf3a772 100644
--- a/lib/shotstack/models/text_to_image_asset.rb
+++ b/lib/shotstack/models/text_to_image_asset.rb
@@ -14,7 +14,7 @@
require 'time'
module Shotstack
- # The TextToImageAsset lets you create a dynamic image from a text prompt.
+ # **Notice: TextToImageAsset is deprecated. Use [ImageAsset](#tocs_imageasset) with `prompt` instead.** This type continues to function and is internally rewritten to ImageAsset; no behaviour change for existing integrations. The TextToImageAsset lets you create a dynamic image from a text prompt.
class TextToImageAsset
# The type of asset to generate - set to `text-to-image` for text-to-image.
attr_accessor :type
diff --git a/lib/shotstack/models/text_to_speech_asset.rb b/lib/shotstack/models/text_to_speech_asset.rb
index 35a2538..a2bc9b1 100644
--- a/lib/shotstack/models/text_to_speech_asset.rb
+++ b/lib/shotstack/models/text_to_speech_asset.rb
@@ -14,7 +14,7 @@
require 'time'
module Shotstack
- # The TextToSpeechAsset lets you generate a voice over from text using a text-to-speech service. The generated audio can be trimmed, faded and have its volume and speed adjusted using the same properties available on the AudioAsset.
+ # **Notice: TextToSpeechAsset is deprecated. Use [AudioAsset](#tocs_audioasset) with `prompt` (the spoken text) and `voice` instead.** This type continues to function and is internally rewritten to AudioAsset; no behaviour change for existing integrations. The TextToSpeechAsset lets you generate a voice over from text using a text-to-speech service. The generated audio can be trimmed, faded and have its volume and speed adjusted using the same properties available on the AudioAsset.
class TextToSpeechAsset
# The type of asset - set to `text-to-speech` for text-to-speech.
attr_accessor :type
diff --git a/lib/shotstack/models/video_asset.rb b/lib/shotstack/models/video_asset.rb
index 529a66d..3d36ea7 100644
--- a/lib/shotstack/models/video_asset.rb
+++ b/lib/shotstack/models/video_asset.rb
@@ -14,14 +14,23 @@
require 'time'
module Shotstack
- # The VideoAsset is used to create video sequences from video files. The src must be a publicly accessible URL to a video resource such as an mp4 file.
+ # The VideoAsset adds a video to a Clip. The video can be sourced from a URL (`src`) or generated from a text prompt (`prompt`), optionally seeded from a starting image (`seed`). Exactly one of `src` or `prompt` must be provided. - **Source URL:** set `src` to the URL of an mp4 (or compatible) video file. - **Generated:** set `prompt` to describe the motion. Optionally set `seed` to a starting image URL (image-to-video). Use `model` to choose the generator (e.g. `luma-ray-3`, `runpod-itv-mini`). The generated `src` is filled in automatically.
class VideoAsset
# The type of asset - set to `video` for videos.
attr_accessor :type
- # The video source URL. The URL must be publicly accessible or include credentials.
+ # The video source URL. The URL must be publicly accessible or include credentials. Provide either `src` or `prompt`, not both.
attr_accessor :src
+ # A text prompt to generate the video from. When set without `src`, the engine generates a video and fills `src` automatically. Optionally pair with `seed` for image-to-video. Use `model` to choose the generator.
+ attr_accessor :prompt
+
+ # Seed image URL for image-to-video generation. The image is used as the starting frame; `prompt` describes the motion. Has no effect unless `prompt` is set.
+ attr_accessor :seed
+
+ # The generation model to use when `prompt` is set (e.g. `luma-ray-3`, `runpod-itv-mini`). Defaults to the platform's preferred generator if omitted.
+ attr_accessor :model
+
# Set to `true` to force re-encoding of the video during preprocessing. This can help resolve compatibility issues, fix rotation problems, synchronize audio, or convert formats. The video will be processed to ensure optimal compatibility with the rendering engine.
attr_accessor :transcode
@@ -33,7 +42,7 @@ class VideoAsset
# Preset volume effects to apply to the video asset - `fadeIn` - fade volume in only
- `fadeOut` - fade volume out only
- `fadeInFadeOut` - fade volume in and out
attr_accessor :volume_effect
- # Adjust the playback speed of the video 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 video (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 video (i.e. original length / 2).
+ # Adjust the playback speed of the video 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 video (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 video (i.e. original length / 2).
attr_accessor :speed
attr_accessor :crop
@@ -67,6 +76,9 @@ def self.attribute_map
{
:'type' => :'type',
:'src' => :'src',
+ :'prompt' => :'prompt',
+ :'seed' => :'seed',
+ :'model' => :'model',
:'transcode' => :'transcode',
:'trim' => :'trim',
:'volume' => :'volume',
@@ -87,6 +99,9 @@ def self.openapi_types
{
:'type' => :'String',
:'src' => :'String',
+ :'prompt' => :'String',
+ :'seed' => :'String',
+ :'model' => :'String',
:'transcode' => :'Boolean',
:'trim' => :'Float',
:'volume' => :'VideoAssetVolume',
@@ -126,8 +141,18 @@ def initialize(attributes = {})
if attributes.key?(:'src')
self.src = attributes[:'src']
- else
- self.src = nil
+ end
+
+ if attributes.key?(:'prompt')
+ self.prompt = attributes[:'prompt']
+ end
+
+ if attributes.key?(:'seed')
+ self.seed = attributes[:'seed']
+ end
+
+ if attributes.key?(:'model')
+ self.model = attributes[:'model']
end
if attributes.key?(:'transcode')
@@ -168,19 +193,23 @@ def list_invalid_properties
invalid_properties.push('invalid value for "type", type cannot be nil.')
end
- if @src.nil?
- invalid_properties.push('invalid value for "src", src cannot be nil.')
- end
-
- if @src.to_s.length < 1
+ if !@src.nil? && @src.to_s.length < 1
invalid_properties.push('invalid value for "src", the character length must be great than or equal to 1.')
end
pattern = Regexp.new(/\S/)
- if @src !~ pattern
+ if !@src.nil? && @src !~ pattern
invalid_properties.push("invalid value for \"src\", must conform to the pattern #{pattern}.")
end
+ if !@prompt.nil? && @prompt.to_s.length > 4000
+ invalid_properties.push('invalid value for "prompt", the character length must be smaller than or equal to 4000.')
+ end
+
+ if !@seed.nil? && @seed.to_s.length < 1
+ invalid_properties.push('invalid value for "seed", the character length must be great than or equal to 1.')
+ end
+
if !@speed.nil? && @speed > 10
invalid_properties.push('invalid value for "speed", must be smaller than or equal to 10.')
end
@@ -199,9 +228,10 @@ def valid?
return false if @type.nil?
type_validator = EnumAttributeValidator.new('String', ["video"])
return false unless type_validator.valid?(@type)
- return false if @src.nil?
- return false if @src.to_s.length < 1
- return false if @src !~ Regexp.new(/\S/)
+ return false if !@src.nil? && @src.to_s.length < 1
+ return false if !@src.nil? && @src !~ Regexp.new(/\S/)
+ return false if !@prompt.nil? && @prompt.to_s.length > 4000
+ return false if !@seed.nil? && @seed.to_s.length < 1
volume_effect_validator = EnumAttributeValidator.new('String', ["none", "fadeIn", "fadeOut", "fadeInFadeOut"])
return false unless volume_effect_validator.valid?(@volume_effect)
return false if !@speed.nil? && @speed > 10
@@ -238,6 +268,34 @@ def src=(src)
@src = src
end
+ # Custom attribute writer method with validation
+ # @param [Object] prompt Value to be assigned
+ def prompt=(prompt)
+ if prompt.nil?
+ fail ArgumentError, 'prompt cannot be nil'
+ end
+
+ if prompt.to_s.length > 4000
+ fail ArgumentError, 'invalid value for "prompt", the character length must be smaller than or equal to 4000.'
+ end
+
+ @prompt = prompt
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] seed Value to be assigned
+ def seed=(seed)
+ if seed.nil?
+ fail ArgumentError, 'seed cannot be nil'
+ end
+
+ if seed.to_s.length < 1
+ fail ArgumentError, 'invalid value for "seed", the character length must be great than or equal to 1.'
+ end
+
+ @seed = seed
+ end
+
# Custom attribute writer method checking allowed values (enum).
# @param [Object] volume_effect Object to be assigned
def volume_effect=(volume_effect)
@@ -273,6 +331,9 @@ def ==(o)
self.class == o.class &&
type == o.type &&
src == o.src &&
+ prompt == o.prompt &&
+ seed == o.seed &&
+ model == o.model &&
transcode == o.transcode &&
trim == o.trim &&
volume == o.volume &&
@@ -291,7 +352,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [type, src, transcode, trim, volume, volume_effect, speed, crop, chroma_key].hash
+ [type, src, prompt, seed, model, transcode, trim, volume, volume_effect, speed, crop, chroma_key].hash
end
# Builds the object from hash
diff --git a/lib/shotstack/version.rb b/lib/shotstack/version.rb
index 9dce678..6377086 100644
--- a/lib/shotstack/version.rb
+++ b/lib/shotstack/version.rb
@@ -11,5 +11,5 @@
=end
module Shotstack
- VERSION = '1.10.4'
+ VERSION = '1.13.0'
end