From 7378029031013568798ed2306e8656dfe7091692 Mon Sep 17 00:00:00 2001 From: dazzatronus <181476274+dazzatronus@users.noreply.github.com> Date: Mon, 1 Jun 2026 17:22:59 +0000 Subject: [PATCH] chore: regenerate SDK from @shotstack/schemas v1.13.0 --- .oas-version | 2 +- src/Configuration.php | 4 +- src/Model/Asset.php | 437 +++++++++++++++-------- src/Model/AudioAsset.php | 193 ++++++++++- src/Model/Clip.php | 34 ++ src/Model/Html5Asset.php | 574 +++++++++++++++++++++++++++++++ src/Model/ImageAsset.php | 89 ++++- src/Model/ImageToVideoAsset.php | 2 +- src/Model/RichCaptionAsset.php | 4 +- src/Model/RichTextBackground.php | 96 +++++- src/Model/TextBackground.php | 46 ++- src/Model/TextToImageAsset.php | 2 +- src/Model/TextToSpeechAsset.php | 2 +- src/Model/VideoAsset.php | 134 +++++++- 14 files changed, 1423 insertions(+), 196 deletions(-) create mode 100644 src/Model/Html5Asset.php 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/src/Configuration.php b/src/Configuration.php index 9e404cf..80efaa7 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -100,7 +100,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/1.10.4/PHP'; + protected $userAgent = 'OpenAPI-Generator/1.13.0/PHP'; /** * Debug switch (default set to false) @@ -433,7 +433,7 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' The version of the OpenAPI document: v1' . PHP_EOL; - $report .= ' SDK Package Version: 1.10.4' . PHP_EOL; + $report .= ' SDK Package Version: 1.13.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/src/Model/Asset.php b/src/Model/Asset.php index f48ad56..ad87a44 100644 --- a/src/Model/Asset.php +++ b/src/Model/Asset.php @@ -60,6 +60,9 @@ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'type' => 'string', 'src' => 'string', + 'prompt' => 'string', + 'seed' => 'string', + 'model' => 'string', 'transcode' => 'bool', 'trim' => 'float', 'volume' => '\ShotstackClient\Model\AudioAssetVolume', @@ -81,12 +84,16 @@ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable 'border' => '\ShotstackClient\Model\Border', 'padding' => '\ShotstackClient\Model\RichCaptionAssetPadding', 'align' => '\ShotstackClient\Model\RichTextAlignment', + 'voice' => 'string', + 'language' => 'string', + 'newscaster' => 'bool', 'effect' => 'string', 'margin' => '\ShotstackClient\Model\CaptionMargin', 'active' => '\ShotstackClient\Model\RichCaptionActive', 'html' => 'string', 'css' => 'string', 'position' => 'string', + 'js' => 'string', 'color' => 'string', 'size' => 'string', 'offset' => '\ShotstackClient\Model\Offset', @@ -95,11 +102,7 @@ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable 'rectangle' => '\ShotstackClient\Model\ShapeAssetRectangle', 'circle' => '\ShotstackClient\Model\ShapeAssetCircle', 'line' => '\ShotstackClient\Model\ShapeAssetLine', - 'prompt' => 'string', - 'aspect_ratio' => 'string', - 'voice' => 'string', - 'language' => 'string', - 'newscaster' => 'bool' + 'aspect_ratio' => 'string' ]; /** @@ -112,6 +115,9 @@ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'type' => null, 'src' => null, + 'prompt' => null, + 'seed' => null, + 'model' => null, 'transcode' => null, 'trim' => null, 'volume' => null, @@ -133,12 +139,16 @@ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable 'border' => null, 'padding' => null, 'align' => null, + 'voice' => null, + 'language' => null, + 'newscaster' => null, 'effect' => null, 'margin' => null, 'active' => null, 'html' => null, 'css' => null, 'position' => null, + 'js' => null, 'color' => null, 'size' => null, 'offset' => null, @@ -147,11 +157,7 @@ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable 'rectangle' => null, 'circle' => null, 'line' => null, - 'prompt' => null, - 'aspect_ratio' => null, - 'voice' => null, - 'language' => null, - 'newscaster' => null + 'aspect_ratio' => null ]; /** @@ -162,6 +168,9 @@ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable protected static array $openAPINullables = [ 'type' => false, 'src' => false, + 'prompt' => false, + 'seed' => false, + 'model' => false, 'transcode' => false, 'trim' => false, 'volume' => false, @@ -183,12 +192,16 @@ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable 'border' => false, 'padding' => false, 'align' => false, + 'voice' => false, + 'language' => false, + 'newscaster' => false, 'effect' => false, 'margin' => false, 'active' => false, 'html' => false, 'css' => false, 'position' => false, + 'js' => false, 'color' => false, 'size' => false, 'offset' => false, @@ -197,11 +210,7 @@ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable 'rectangle' => false, 'circle' => false, 'line' => false, - 'prompt' => false, - 'aspect_ratio' => false, - 'voice' => false, - 'language' => false, - 'newscaster' => false + 'aspect_ratio' => false ]; /** @@ -292,6 +301,9 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'type' => 'type', 'src' => 'src', + 'prompt' => 'prompt', + 'seed' => 'seed', + 'model' => 'model', 'transcode' => 'transcode', 'trim' => 'trim', 'volume' => 'volume', @@ -313,12 +325,16 @@ public function isNullableSetToNull(string $property): bool 'border' => 'border', 'padding' => 'padding', 'align' => 'align', + 'voice' => 'voice', + 'language' => 'language', + 'newscaster' => 'newscaster', 'effect' => 'effect', 'margin' => 'margin', 'active' => 'active', 'html' => 'html', 'css' => 'css', 'position' => 'position', + 'js' => 'js', 'color' => 'color', 'size' => 'size', 'offset' => 'offset', @@ -327,11 +343,7 @@ public function isNullableSetToNull(string $property): bool 'rectangle' => 'rectangle', 'circle' => 'circle', 'line' => 'line', - 'prompt' => 'prompt', - 'aspect_ratio' => 'aspectRatio', - 'voice' => 'voice', - 'language' => 'language', - 'newscaster' => 'newscaster' + 'aspect_ratio' => 'aspectRatio' ]; /** @@ -342,6 +354,9 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'type' => 'setType', 'src' => 'setSrc', + 'prompt' => 'setPrompt', + 'seed' => 'setSeed', + 'model' => 'setModel', 'transcode' => 'setTranscode', 'trim' => 'setTrim', 'volume' => 'setVolume', @@ -363,12 +378,16 @@ public function isNullableSetToNull(string $property): bool 'border' => 'setBorder', 'padding' => 'setPadding', 'align' => 'setAlign', + 'voice' => 'setVoice', + 'language' => 'setLanguage', + 'newscaster' => 'setNewscaster', 'effect' => 'setEffect', 'margin' => 'setMargin', 'active' => 'setActive', 'html' => 'setHtml', 'css' => 'setCss', 'position' => 'setPosition', + 'js' => 'setJs', 'color' => 'setColor', 'size' => 'setSize', 'offset' => 'setOffset', @@ -377,11 +396,7 @@ public function isNullableSetToNull(string $property): bool 'rectangle' => 'setRectangle', 'circle' => 'setCircle', 'line' => 'setLine', - 'prompt' => 'setPrompt', - 'aspect_ratio' => 'setAspectRatio', - 'voice' => 'setVoice', - 'language' => 'setLanguage', - 'newscaster' => 'setNewscaster' + 'aspect_ratio' => 'setAspectRatio' ]; /** @@ -392,6 +407,9 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'type' => 'getType', 'src' => 'getSrc', + 'prompt' => 'getPrompt', + 'seed' => 'getSeed', + 'model' => 'getModel', 'transcode' => 'getTranscode', 'trim' => 'getTrim', 'volume' => 'getVolume', @@ -413,12 +431,16 @@ public function isNullableSetToNull(string $property): bool 'border' => 'getBorder', 'padding' => 'getPadding', 'align' => 'getAlign', + 'voice' => 'getVoice', + 'language' => 'getLanguage', + 'newscaster' => 'getNewscaster', 'effect' => 'getEffect', 'margin' => 'getMargin', 'active' => 'getActive', 'html' => 'getHtml', 'css' => 'getCss', 'position' => 'getPosition', + 'js' => 'getJs', 'color' => 'getColor', 'size' => 'getSize', 'offset' => 'getOffset', @@ -427,11 +449,7 @@ public function isNullableSetToNull(string $property): bool 'rectangle' => 'getRectangle', 'circle' => 'getCircle', 'line' => 'getLine', - 'prompt' => 'getPrompt', - 'aspect_ratio' => 'getAspectRatio', - 'voice' => 'getVoice', - 'language' => 'getLanguage', - 'newscaster' => 'getNewscaster' + 'aspect_ratio' => 'getAspectRatio' ]; /** @@ -484,6 +502,7 @@ public function getModelName() public const TYPE_CAPTION = 'caption'; public const TYPE_RICH_CAPTION = 'rich-caption'; public const TYPE_HTML = 'html'; + public const TYPE_HTML5 = 'html5'; public const TYPE_TITLE = 'title'; public const TYPE_SHAPE = 'shape'; public const TYPE_SVG = 'svg'; @@ -552,6 +571,7 @@ public function getTypeAllowableValues() self::TYPE_CAPTION, self::TYPE_RICH_CAPTION, self::TYPE_HTML, + self::TYPE_HTML5, self::TYPE_TITLE, self::TYPE_SHAPE, self::TYPE_SVG, @@ -699,6 +719,9 @@ public function __construct(array $data = null) { $this->setIfExists('type', $data ?? [], 'video'); $this->setIfExists('src', $data ?? [], null); + $this->setIfExists('prompt', $data ?? [], null); + $this->setIfExists('seed', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); $this->setIfExists('transcode', $data ?? [], null); $this->setIfExists('trim', $data ?? [], null); $this->setIfExists('volume', $data ?? [], null); @@ -720,12 +743,16 @@ public function __construct(array $data = null) $this->setIfExists('border', $data ?? [], null); $this->setIfExists('padding', $data ?? [], null); $this->setIfExists('align', $data ?? [], null); + $this->setIfExists('voice', $data ?? [], null); + $this->setIfExists('language', $data ?? [], null); + $this->setIfExists('newscaster', $data ?? [], false); $this->setIfExists('effect', $data ?? [], null); $this->setIfExists('margin', $data ?? [], null); $this->setIfExists('active', $data ?? [], null); $this->setIfExists('html', $data ?? [], null); $this->setIfExists('css', $data ?? [], null); $this->setIfExists('position', $data ?? [], null); + $this->setIfExists('js', $data ?? [], null); $this->setIfExists('color', $data ?? [], null); $this->setIfExists('size', $data ?? [], null); $this->setIfExists('offset', $data ?? [], null); @@ -734,11 +761,7 @@ public function __construct(array $data = null) $this->setIfExists('rectangle', $data ?? [], null); $this->setIfExists('circle', $data ?? [], null); $this->setIfExists('line', $data ?? [], null); - $this->setIfExists('prompt', $data ?? [], null); $this->setIfExists('aspect_ratio', $data ?? [], null); - $this->setIfExists('voice', $data ?? [], null); - $this->setIfExists('language', $data ?? [], null); - $this->setIfExists('newscaster', $data ?? [], false); // Initialize discriminator property with the model name. $this->container['type'] = static::$openAPIModelName; @@ -790,6 +813,13 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'src', the character length must be bigger than or equal to 1."; } + if ($this->container['prompt'] === null) { + $invalidProperties[] = "'prompt' can't be null"; + } + if (!is_null($this->container['seed']) && (mb_strlen($this->container['seed']) < 1)) { + $invalidProperties[] = "invalid value for 'seed', the character length must be bigger than or equal to 1."; + } + $allowedValues = $this->getVolumeEffectAllowableValues(); if (!is_null($this->container['volume_effect']) && !in_array($this->container['volume_effect'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -819,6 +849,9 @@ public function listInvalidProperties() ); } + if ($this->container['voice'] === null) { + $invalidProperties[] = "'voice' can't be null"; + } $allowedValues = $this->getEffectAllowableValues(); if (!is_null($this->container['effect']) && !in_array($this->container['effect'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -831,6 +864,14 @@ public function listInvalidProperties() if ($this->container['html'] === null) { $invalidProperties[] = "'html' can't be null"; } + if ((mb_strlen($this->container['html']) > 1000000)) { + $invalidProperties[] = "invalid value for 'html', the character length must be smaller than or equal to 1000000."; + } + + if (!is_null($this->container['css']) && (mb_strlen($this->container['css']) > 500000)) { + $invalidProperties[] = "invalid value for 'css', the character length must be smaller than or equal to 500000."; + } + $allowedValues = $this->getPositionAllowableValues(); if (!is_null($this->container['position']) && !in_array($this->container['position'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -840,6 +881,10 @@ public function listInvalidProperties() ); } + if (!is_null($this->container['js']) && (mb_strlen($this->container['js']) > 500000)) { + $invalidProperties[] = "invalid value for 'js', the character length must be smaller than or equal to 500000."; + } + $allowedValues = $this->getSizeAllowableValues(); if (!is_null($this->container['size']) && !in_array($this->container['size'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -861,9 +906,6 @@ public function listInvalidProperties() ); } - if ($this->container['prompt'] === null) { - $invalidProperties[] = "'prompt' can't be null"; - } $allowedValues = $this->getAspectRatioAllowableValues(); if (!is_null($this->container['aspect_ratio']) && !in_array($this->container['aspect_ratio'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -873,9 +915,6 @@ public function listInvalidProperties() ); } - if ($this->container['voice'] === null) { - $invalidProperties[] = "'voice' can't be null"; - } return $invalidProperties; } @@ -960,6 +999,92 @@ public function setSrc($src) return $this; } + /** + * Gets prompt + * + * @return string + */ + public function getPrompt() + { + return $this->container['prompt']; + } + + /** + * Sets prompt + * + * @param string $prompt The instructions for modifying the image into a video sequence. + * + * @return self + */ + public function setPrompt($prompt) + { + if (is_null($prompt)) { + throw new \InvalidArgumentException('non-nullable prompt cannot be null'); + } + $this->container['prompt'] = $prompt; + + return $this; + } + + /** + * Gets seed + * + * @return string|null + */ + public function getSeed() + { + return $this->container['seed']; + } + + /** + * Sets seed + * + * @param string|null $seed 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. + * + * @return self + */ + public function setSeed($seed) + { + if (is_null($seed)) { + throw new \InvalidArgumentException('non-nullable seed cannot be null'); + } + + if ((mb_strlen($seed) < 1)) { + throw new \InvalidArgumentException('invalid length for $seed when calling Asset., must be bigger than or equal to 1.'); + } + + $this->container['seed'] = $seed; + + return $this; + } + + /** + * Gets model + * + * @return string|null + */ + public function getModel() + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param string|null $model The generation model to use when `prompt` is set (e.g. `polly-neural`). Defaults to the platform's preferred generator if omitted. + * + * @return self + */ + public function setModel($model) + { + if (is_null($model)) { + throw new \InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + /** * Gets transcode * @@ -1555,6 +1680,87 @@ public function setAlign($align) return $this; } + /** + * Gets voice + * + * @return string + */ + public function getVoice() + { + return $this->container['voice']; + } + + /** + * Sets voice + * + * @param string $voice The voice to use for the text-to-speech conversion. + * + * @return self + */ + public function setVoice($voice) + { + if (is_null($voice)) { + throw new \InvalidArgumentException('non-nullable voice cannot be null'); + } + $this->container['voice'] = $voice; + + return $this; + } + + /** + * Gets language + * + * @return string|null + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string|null $language The language code for the text-to-speech conversion. + * + * @return self + */ + public function setLanguage($language) + { + if (is_null($language)) { + throw new \InvalidArgumentException('non-nullable language cannot be null'); + } + $this->container['language'] = $language; + + return $this; + } + + /** + * Gets newscaster + * + * @return bool|null + */ + public function getNewscaster() + { + return $this->container['newscaster']; + } + + /** + * Sets newscaster + * + * @param bool|null $newscaster Set the voice to newscaster mode. + * + * @return self + */ + public function setNewscaster($newscaster) + { + if (is_null($newscaster)) { + throw new \InvalidArgumentException('non-nullable newscaster cannot be null'); + } + $this->container['newscaster'] = $newscaster; + + return $this; + } + /** * Gets effect * @@ -1659,7 +1865,7 @@ public function getHtml() /** * Sets html * - * @param string $html The HTML text string. See list of [supported HTML tags](https://shotstack.io/docs/guide/architecting-an-application/html-support/#supported-html-tags). + * @param string $html The HTML markup for the asset. Max 1,000,000 characters. * * @return self */ @@ -1668,6 +1874,10 @@ public function setHtml($html) if (is_null($html)) { throw new \InvalidArgumentException('non-nullable html cannot be null'); } + if ((mb_strlen($html) > 1000000)) { + throw new \InvalidArgumentException('invalid length for $html when calling Asset., must be smaller than or equal to 1000000.'); + } + $this->container['html'] = $html; return $this; @@ -1686,7 +1896,7 @@ public function getCss() /** * Sets css * - * @param string|null $css The CSS text string to apply styling to the HTML. See list of [support CSS properties](https://shotstack.io/docs/guide/architecting-an-application/html-support/#supported-css-properties). + * @param string|null $css The CSS string applied to the HTML. Max 500,000 characters. * * @return self */ @@ -1695,6 +1905,10 @@ public function setCss($css) if (is_null($css)) { throw new \InvalidArgumentException('non-nullable css cannot be null'); } + if ((mb_strlen($css) > 500000)) { + throw new \InvalidArgumentException('invalid length for $css when calling Asset., must be smaller than or equal to 500000.'); + } + $this->container['css'] = $css; return $this; @@ -1737,6 +1951,37 @@ public function setPosition($position) return $this; } + /** + * Gets js + * + * @return string|null + */ + public function getJs() + { + return $this->container['js']; + } + + /** + * Sets js + * + * @param string|null $js 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. + * + * @return self + */ + public function setJs($js) + { + if (is_null($js)) { + throw new \InvalidArgumentException('non-nullable js cannot be null'); + } + if ((mb_strlen($js) > 500000)) { + throw new \InvalidArgumentException('invalid length for $js when calling Asset., must be smaller than or equal to 500000.'); + } + + $this->container['js'] = $js; + + return $this; + } + /** * Gets color * @@ -1973,33 +2218,6 @@ public function setLine($line) return $this; } - /** - * Gets prompt - * - * @return string - */ - public function getPrompt() - { - return $this->container['prompt']; - } - - /** - * Sets prompt - * - * @param string $prompt The instructions for modifying the image into a video sequence. - * - * @return self - */ - public function setPrompt($prompt) - { - if (is_null($prompt)) { - throw new \InvalidArgumentException('non-nullable prompt cannot be null'); - } - $this->container['prompt'] = $prompt; - - return $this; - } - /** * Gets aspect_ratio * @@ -2036,87 +2254,6 @@ public function setAspectRatio($aspect_ratio) return $this; } - - /** - * Gets voice - * - * @return string - */ - public function getVoice() - { - return $this->container['voice']; - } - - /** - * Sets voice - * - * @param string $voice The voice to use for the text-to-speech conversion. - * - * @return self - */ - public function setVoice($voice) - { - if (is_null($voice)) { - throw new \InvalidArgumentException('non-nullable voice cannot be null'); - } - $this->container['voice'] = $voice; - - return $this; - } - - /** - * Gets language - * - * @return string|null - */ - public function getLanguage() - { - return $this->container['language']; - } - - /** - * Sets language - * - * @param string|null $language The language code for the text-to-speech conversion. - * - * @return self - */ - public function setLanguage($language) - { - if (is_null($language)) { - throw new \InvalidArgumentException('non-nullable language cannot be null'); - } - $this->container['language'] = $language; - - return $this; - } - - /** - * Gets newscaster - * - * @return bool|null - */ - public function getNewscaster() - { - return $this->container['newscaster']; - } - - /** - * Sets newscaster - * - * @param bool|null $newscaster Set the voice to newscaster mode. - * - * @return self - */ - public function setNewscaster($newscaster) - { - if (is_null($newscaster)) { - throw new \InvalidArgumentException('non-nullable newscaster cannot be null'); - } - $this->container['newscaster'] = $newscaster; - - return $this; - } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/AudioAsset.php b/src/Model/AudioAsset.php index fe9499c..5b94cce 100644 --- a/src/Model/AudioAsset.php +++ b/src/Model/AudioAsset.php @@ -35,7 +35,7 @@ * AudioAsset Class Doc Comment * * @category Class - * @description 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. + * @description 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. * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -60,6 +60,11 @@ class AudioAsset implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'type' => 'string', 'src' => 'string', + 'prompt' => 'string', + 'voice' => 'string', + 'language' => 'string', + 'newscaster' => 'bool', + 'model' => 'string', 'trim' => 'float', 'volume' => '\ShotstackClient\Model\AudioAssetVolume', 'speed' => 'float', @@ -76,6 +81,11 @@ class AudioAsset implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'type' => null, 'src' => null, + 'prompt' => null, + 'voice' => null, + 'language' => null, + 'newscaster' => null, + 'model' => null, 'trim' => null, 'volume' => null, 'speed' => 'float', @@ -90,6 +100,11 @@ class AudioAsset implements ModelInterface, ArrayAccess, \JsonSerializable protected static array $openAPINullables = [ 'type' => false, 'src' => false, + 'prompt' => false, + 'voice' => false, + 'language' => false, + 'newscaster' => false, + 'model' => false, 'trim' => false, 'volume' => false, 'speed' => false, @@ -184,6 +199,11 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'type' => 'type', 'src' => 'src', + 'prompt' => 'prompt', + 'voice' => 'voice', + 'language' => 'language', + 'newscaster' => 'newscaster', + 'model' => 'model', 'trim' => 'trim', 'volume' => 'volume', 'speed' => 'speed', @@ -198,6 +218,11 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'type' => 'setType', 'src' => 'setSrc', + 'prompt' => 'setPrompt', + 'voice' => 'setVoice', + 'language' => 'setLanguage', + 'newscaster' => 'setNewscaster', + 'model' => 'setModel', 'trim' => 'setTrim', 'volume' => 'setVolume', 'speed' => 'setSpeed', @@ -212,6 +237,11 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'type' => 'getType', 'src' => 'getSrc', + 'prompt' => 'getPrompt', + 'voice' => 'getVoice', + 'language' => 'getLanguage', + 'newscaster' => 'getNewscaster', + 'model' => 'getModel', 'trim' => 'getTrim', 'volume' => 'getVolume', 'speed' => 'getSpeed', @@ -309,6 +339,11 @@ public function __construct(array $data = null) { $this->setIfExists('type', $data ?? [], 'audio'); $this->setIfExists('src', $data ?? [], null); + $this->setIfExists('prompt', $data ?? [], null); + $this->setIfExists('voice', $data ?? [], null); + $this->setIfExists('language', $data ?? [], null); + $this->setIfExists('newscaster', $data ?? [], false); + $this->setIfExists('model', $data ?? [], null); $this->setIfExists('trim', $data ?? [], null); $this->setIfExists('volume', $data ?? [], null); $this->setIfExists('speed', $data ?? [], null); @@ -354,17 +389,18 @@ public function listInvalidProperties() ); } - if ($this->container['src'] === null) { - $invalidProperties[] = "'src' can't be null"; - } - if ((mb_strlen($this->container['src']) < 1)) { + if (!is_null($this->container['src']) && (mb_strlen($this->container['src']) < 1)) { $invalidProperties[] = "invalid value for 'src', the character length must be bigger than or equal to 1."; } - if (!preg_match("/\\S/", $this->container['src'])) { + if (!is_null($this->container['src']) && !preg_match("/\\S/", $this->container['src'])) { $invalidProperties[] = "invalid value for 'src', must be conform to the pattern /\\S/."; } + if (!is_null($this->container['prompt']) && (mb_strlen($this->container['prompt']) > 4000)) { + $invalidProperties[] = "invalid value for 'prompt', the character length must be smaller than or equal to 4000."; + } + if (!is_null($this->container['speed']) && ($this->container['speed'] > 10)) { $invalidProperties[] = "invalid value for 'speed', must be smaller than or equal to 10."; } @@ -437,7 +473,7 @@ public function setType($type) /** * Gets src * - * @return string + * @return string|null */ public function getSrc() { @@ -447,7 +483,7 @@ public function getSrc() /** * Sets src * - * @param string $src The audio source URL. The URL must be publicly accessible or include credentials. + * @param string|null $src The audio source URL. The URL must be publicly accessible or include credentials. Provide either `src` or `prompt`, not both. * * @return self */ @@ -469,6 +505,145 @@ public function setSrc($src) return $this; } + /** + * Gets prompt + * + * @return string|null + */ + public function getPrompt() + { + return $this->container['prompt']; + } + + /** + * Sets prompt + * + * @param string|null $prompt 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. + * + * @return self + */ + public function setPrompt($prompt) + { + if (is_null($prompt)) { + throw new \InvalidArgumentException('non-nullable prompt cannot be null'); + } + if ((mb_strlen($prompt) > 4000)) { + throw new \InvalidArgumentException('invalid length for $prompt when calling AudioAsset., must be smaller than or equal to 4000.'); + } + + $this->container['prompt'] = $prompt; + + return $this; + } + + /** + * Gets voice + * + * @return string|null + */ + public function getVoice() + { + return $this->container['voice']; + } + + /** + * Sets voice + * + * @param string|null $voice Voice identifier for text-to-speech generation (e.g. `Matthew`, `Joanna`). Only meaningful when `prompt` is set. + * + * @return self + */ + public function setVoice($voice) + { + if (is_null($voice)) { + throw new \InvalidArgumentException('non-nullable voice cannot be null'); + } + $this->container['voice'] = $voice; + + return $this; + } + + /** + * Gets language + * + * @return string|null + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string|null $language Optional BCP-47 language code (e.g. `en-US`) for text-to-speech. Only meaningful when `prompt` and `voice` are set. + * + * @return self + */ + public function setLanguage($language) + { + if (is_null($language)) { + throw new \InvalidArgumentException('non-nullable language cannot be null'); + } + $this->container['language'] = $language; + + return $this; + } + + /** + * Gets newscaster + * + * @return bool|null + */ + public function getNewscaster() + { + return $this->container['newscaster']; + } + + /** + * Sets newscaster + * + * @param bool|null $newscaster Set to `true` to use the voice's newscaster mode when supported. Only meaningful when `prompt` and `voice` are set. + * + * @return self + */ + public function setNewscaster($newscaster) + { + if (is_null($newscaster)) { + throw new \InvalidArgumentException('non-nullable newscaster cannot be null'); + } + $this->container['newscaster'] = $newscaster; + + return $this; + } + + /** + * Gets model + * + * @return string|null + */ + public function getModel() + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param string|null $model The generation model to use when `prompt` is set (e.g. `polly-neural`). Defaults to the platform's preferred generator if omitted. + * + * @return self + */ + public function setModel($model) + { + if (is_null($model)) { + throw new \InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + /** * Gets trim * @@ -536,7 +711,7 @@ public function getSpeed() /** * Sets speed * - * @param float|null $speed 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). + * @param float|null $speed 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). * * @return self */ diff --git a/src/Model/Clip.php b/src/Model/Clip.php index b7ec8e3..20a0d7f 100644 --- a/src/Model/Clip.php +++ b/src/Model/Clip.php @@ -58,6 +58,7 @@ class Clip implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'id' => 'string', 'asset' => '\ShotstackClient\Model\Asset', 'start' => '\ShotstackClient\Model\ClipStart', 'length' => '\ShotstackClient\Model\ClipLength', @@ -83,6 +84,7 @@ class Clip implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'id' => null, 'asset' => null, 'start' => null, 'length' => null, @@ -106,6 +108,7 @@ class Clip implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ + 'id' => false, 'asset' => false, 'start' => false, 'length' => false, @@ -209,6 +212,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'id' => 'id', 'asset' => 'asset', 'start' => 'start', 'length' => 'length', @@ -232,6 +236,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'id' => 'setId', 'asset' => 'setAsset', 'start' => 'setStart', 'length' => 'setLength', @@ -255,6 +260,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'id' => 'getId', 'asset' => 'getAsset', 'start' => 'getStart', 'length' => 'getLength', @@ -453,6 +459,7 @@ public function getFilterAllowableValues() */ public function __construct(array $data = null) { + $this->setIfExists('id', $data ?? [], null); $this->setIfExists('asset', $data ?? [], null); $this->setIfExists('start', $data ?? [], null); $this->setIfExists('length', $data ?? [], null); @@ -577,6 +584,33 @@ public function valid() } + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id 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. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** * Gets asset * diff --git a/src/Model/Html5Asset.php b/src/Model/Html5Asset.php new file mode 100644 index 0000000..ce0ab6f --- /dev/null +++ b/src/Model/Html5Asset.php @@ -0,0 +1,574 @@ + + */ +class Html5Asset implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Html5Asset'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'html' => 'string', + 'css' => 'string', + 'js' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'html' => null, + 'css' => null, + 'js' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'html' => false, + 'css' => false, + 'js' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'html' => 'html', + 'css' => 'css', + 'js' => 'js' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'html' => 'setHtml', + 'css' => 'setCss', + 'js' => 'setJs' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'html' => 'getHtml', + 'css' => 'getCss', + 'js' => 'getJs' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_HTML5 = 'html5'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_HTML5, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], 'html5'); + $this->setIfExists('html', $data ?? [], null); + $this->setIfExists('css', $data ?? [], null); + $this->setIfExists('js', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['html'] === null) { + $invalidProperties[] = "'html' can't be null"; + } + if ((mb_strlen($this->container['html']) > 1000000)) { + $invalidProperties[] = "invalid value for 'html', the character length must be smaller than or equal to 1000000."; + } + + if (!is_null($this->container['css']) && (mb_strlen($this->container['css']) > 500000)) { + $invalidProperties[] = "invalid value for 'css', the character length must be smaller than or equal to 500000."; + } + + if (!is_null($this->container['js']) && (mb_strlen($this->container['js']) > 500000)) { + $invalidProperties[] = "invalid value for 'js', the character length must be smaller than or equal to 500000."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of asset - set to `html5` for HTML5/CSS3/JS. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets html + * + * @return string + */ + public function getHtml() + { + return $this->container['html']; + } + + /** + * Sets html + * + * @param string $html The HTML markup for the asset. Max 1,000,000 characters. + * + * @return self + */ + public function setHtml($html) + { + if (is_null($html)) { + throw new \InvalidArgumentException('non-nullable html cannot be null'); + } + if ((mb_strlen($html) > 1000000)) { + throw new \InvalidArgumentException('invalid length for $html when calling Html5Asset., must be smaller than or equal to 1000000.'); + } + + $this->container['html'] = $html; + + return $this; + } + + /** + * Gets css + * + * @return string|null + */ + public function getCss() + { + return $this->container['css']; + } + + /** + * Sets css + * + * @param string|null $css The CSS string applied to the HTML. Max 500,000 characters. + * + * @return self + */ + public function setCss($css) + { + if (is_null($css)) { + throw new \InvalidArgumentException('non-nullable css cannot be null'); + } + if ((mb_strlen($css) > 500000)) { + throw new \InvalidArgumentException('invalid length for $css when calling Html5Asset., must be smaller than or equal to 500000.'); + } + + $this->container['css'] = $css; + + return $this; + } + + /** + * Gets js + * + * @return string|null + */ + public function getJs() + { + return $this->container['js']; + } + + /** + * Sets js + * + * @param string|null $js 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. + * + * @return self + */ + public function setJs($js) + { + if (is_null($js)) { + throw new \InvalidArgumentException('non-nullable js cannot be null'); + } + if ((mb_strlen($js) > 500000)) { + throw new \InvalidArgumentException('invalid length for $js when calling Html5Asset., must be smaller than or equal to 500000.'); + } + + $this->container['js'] = $js; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ImageAsset.php b/src/Model/ImageAsset.php index 657e952..3d5cf02 100644 --- a/src/Model/ImageAsset.php +++ b/src/Model/ImageAsset.php @@ -35,7 +35,7 @@ * ImageAsset Class Doc Comment * * @category Class - * @description 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. + * @description 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. * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -60,6 +60,8 @@ class ImageAsset implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'type' => 'string', 'src' => 'string', + 'prompt' => 'string', + 'model' => 'string', 'crop' => '\ShotstackClient\Model\Crop' ]; @@ -73,6 +75,8 @@ class ImageAsset implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'type' => null, 'src' => null, + 'prompt' => null, + 'model' => null, 'crop' => null ]; @@ -84,6 +88,8 @@ class ImageAsset implements ModelInterface, ArrayAccess, \JsonSerializable protected static array $openAPINullables = [ 'type' => false, 'src' => false, + 'prompt' => false, + 'model' => false, 'crop' => false ]; @@ -175,6 +181,8 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'type' => 'type', 'src' => 'src', + 'prompt' => 'prompt', + 'model' => 'model', 'crop' => 'crop' ]; @@ -186,6 +194,8 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'type' => 'setType', 'src' => 'setSrc', + 'prompt' => 'setPrompt', + 'model' => 'setModel', 'crop' => 'setCrop' ]; @@ -197,6 +207,8 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'type' => 'getType', 'src' => 'getSrc', + 'prompt' => 'getPrompt', + 'model' => 'getModel', 'crop' => 'getCrop' ]; @@ -272,6 +284,8 @@ public function __construct(array $data = null) { $this->setIfExists('type', $data ?? [], 'image'); $this->setIfExists('src', $data ?? [], null); + $this->setIfExists('prompt', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); $this->setIfExists('crop', $data ?? [], null); } @@ -314,17 +328,18 @@ public function listInvalidProperties() ); } - if ($this->container['src'] === null) { - $invalidProperties[] = "'src' can't be null"; - } - if ((mb_strlen($this->container['src']) < 1)) { + if (!is_null($this->container['src']) && (mb_strlen($this->container['src']) < 1)) { $invalidProperties[] = "invalid value for 'src', the character length must be bigger than or equal to 1."; } - if (!preg_match("/\\S/", $this->container['src'])) { + if (!is_null($this->container['src']) && !preg_match("/\\S/", $this->container['src'])) { $invalidProperties[] = "invalid value for 'src', must be conform to the pattern /\\S/."; } + if (!is_null($this->container['prompt']) && (mb_strlen($this->container['prompt']) > 4000)) { + $invalidProperties[] = "invalid value for 'prompt', the character length must be smaller than or equal to 4000."; + } + return $invalidProperties; } @@ -380,7 +395,7 @@ public function setType($type) /** * Gets src * - * @return string + * @return string|null */ public function getSrc() { @@ -390,7 +405,7 @@ public function getSrc() /** * Sets src * - * @param string $src The image source URL. The URL must be publicly accessible or include credentials. + * @param string|null $src The image source URL. The URL must be publicly accessible or include credentials. Provide either `src` or `prompt`, not both. * * @return self */ @@ -412,6 +427,64 @@ public function setSrc($src) return $this; } + /** + * Gets prompt + * + * @return string|null + */ + public function getPrompt() + { + return $this->container['prompt']; + } + + /** + * Sets prompt + * + * @param string|null $prompt 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. + * + * @return self + */ + public function setPrompt($prompt) + { + if (is_null($prompt)) { + throw new \InvalidArgumentException('non-nullable prompt cannot be null'); + } + if ((mb_strlen($prompt) > 4000)) { + throw new \InvalidArgumentException('invalid length for $prompt when calling ImageAsset., must be smaller than or equal to 4000.'); + } + + $this->container['prompt'] = $prompt; + + return $this; + } + + /** + * Gets model + * + * @return string|null + */ + public function getModel() + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param string|null $model The generation model to use when `prompt` is set (e.g. `flux-schnell`). Defaults to the platform's preferred generator if omitted. + * + * @return self + */ + public function setModel($model) + { + if (is_null($model)) { + throw new \InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + /** * Gets crop * diff --git a/src/Model/ImageToVideoAsset.php b/src/Model/ImageToVideoAsset.php index c4eb44f..1cef58c 100644 --- a/src/Model/ImageToVideoAsset.php +++ b/src/Model/ImageToVideoAsset.php @@ -35,7 +35,7 @@ * ImageToVideoAsset Class Doc Comment * * @category Class - * @description The ImageToVideoAsset lets you create a video from an image and a text prompt. + * @description **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. * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/src/Model/RichCaptionAsset.php b/src/Model/RichCaptionAsset.php index 07ef861..c650376 100644 --- a/src/Model/RichCaptionAsset.php +++ b/src/Model/RichCaptionAsset.php @@ -35,7 +35,7 @@ * RichCaptionAsset Class Doc Comment * * @category Class - * @description 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. + * @description 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. * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -449,7 +449,7 @@ public function getSrc() /** * Sets src * - * @param string $src 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. + * @param string $src 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. * * @return self */ diff --git a/src/Model/RichTextBackground.php b/src/Model/RichTextBackground.php index 0e23aae..f8769bc 100644 --- a/src/Model/RichTextBackground.php +++ b/src/Model/RichTextBackground.php @@ -60,7 +60,9 @@ class RichTextBackground implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPITypes = [ 'color' => 'string', 'opacity' => 'float', - 'border_radius' => 'float' + 'border_radius' => 'float', + 'wrap' => 'bool', + 'padding' => 'int' ]; /** @@ -73,7 +75,9 @@ class RichTextBackground implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPIFormats = [ 'color' => null, 'opacity' => null, - 'border_radius' => null + 'border_radius' => null, + 'wrap' => null, + 'padding' => null ]; /** @@ -84,7 +88,9 @@ class RichTextBackground implements ModelInterface, ArrayAccess, \JsonSerializab protected static array $openAPINullables = [ 'color' => false, 'opacity' => false, - 'border_radius' => false + 'border_radius' => false, + 'wrap' => false, + 'padding' => false ]; /** @@ -175,7 +181,9 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'color' => 'color', 'opacity' => 'opacity', - 'border_radius' => 'borderRadius' + 'border_radius' => 'borderRadius', + 'wrap' => 'wrap', + 'padding' => 'padding' ]; /** @@ -186,7 +194,9 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'color' => 'setColor', 'opacity' => 'setOpacity', - 'border_radius' => 'setBorderRadius' + 'border_radius' => 'setBorderRadius', + 'wrap' => 'setWrap', + 'padding' => 'setPadding' ]; /** @@ -197,7 +207,9 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'color' => 'getColor', 'opacity' => 'getOpacity', - 'border_radius' => 'getBorderRadius' + 'border_radius' => 'getBorderRadius', + 'wrap' => 'getWrap', + 'padding' => 'getPadding' ]; /** @@ -260,6 +272,8 @@ public function __construct(array $data = null) $this->setIfExists('color', $data ?? [], null); $this->setIfExists('opacity', $data ?? [], 1); $this->setIfExists('border_radius', $data ?? [], 0); + $this->setIfExists('wrap', $data ?? [], false); + $this->setIfExists('padding', $data ?? [], null); } /** @@ -305,6 +319,14 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'border_radius', must be bigger than or equal to 0."; } + if (!is_null($this->container['padding']) && ($this->container['padding'] > 200)) { + $invalidProperties[] = "invalid value for 'padding', must be smaller than or equal to 200."; + } + + if (!is_null($this->container['padding']) && ($this->container['padding'] < 0)) { + $invalidProperties[] = "invalid value for 'padding', must be bigger than or equal to 0."; + } + return $invalidProperties; } @@ -418,6 +440,68 @@ public function setBorderRadius($border_radius) return $this; } + + /** + * Gets wrap + * + * @return bool|null + */ + public function getWrap() + { + return $this->container['wrap']; + } + + /** + * Sets wrap + * + * @param bool|null $wrap 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`. + * + * @return self + */ + public function setWrap($wrap) + { + if (is_null($wrap)) { + throw new \InvalidArgumentException('non-nullable wrap cannot be null'); + } + $this->container['wrap'] = $wrap; + + return $this; + } + + /** + * Gets padding + * + * @return int|null + */ + public function getPadding() + { + return $this->container['padding']; + } + + /** + * Sets padding + * + * @param int|null $padding 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. + * + * @return self + */ + public function setPadding($padding) + { + if (is_null($padding)) { + throw new \InvalidArgumentException('non-nullable padding cannot be null'); + } + + if (($padding > 200)) { + throw new \InvalidArgumentException('invalid value for $padding when calling RichTextBackground., must be smaller than or equal to 200.'); + } + if (($padding < 0)) { + throw new \InvalidArgumentException('invalid value for $padding when calling RichTextBackground., must be bigger than or equal to 0.'); + } + + $this->container['padding'] = $padding; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/TextBackground.php b/src/Model/TextBackground.php index ea31b91..68092ff 100644 --- a/src/Model/TextBackground.php +++ b/src/Model/TextBackground.php @@ -61,7 +61,8 @@ class TextBackground implements ModelInterface, ArrayAccess, \JsonSerializable 'color' => 'string', 'opacity' => 'float', 'padding' => 'float', - 'border_radius' => 'float' + 'border_radius' => 'float', + 'wrap' => 'bool' ]; /** @@ -75,7 +76,8 @@ class TextBackground implements ModelInterface, ArrayAccess, \JsonSerializable 'color' => null, 'opacity' => null, 'padding' => null, - 'border_radius' => null + 'border_radius' => null, + 'wrap' => null ]; /** @@ -87,7 +89,8 @@ class TextBackground implements ModelInterface, ArrayAccess, \JsonSerializable 'color' => false, 'opacity' => false, 'padding' => false, - 'border_radius' => false + 'border_radius' => false, + 'wrap' => false ]; /** @@ -179,7 +182,8 @@ public function isNullableSetToNull(string $property): bool 'color' => 'color', 'opacity' => 'opacity', 'padding' => 'padding', - 'border_radius' => 'borderRadius' + 'border_radius' => 'borderRadius', + 'wrap' => 'wrap' ]; /** @@ -191,7 +195,8 @@ public function isNullableSetToNull(string $property): bool 'color' => 'setColor', 'opacity' => 'setOpacity', 'padding' => 'setPadding', - 'border_radius' => 'setBorderRadius' + 'border_radius' => 'setBorderRadius', + 'wrap' => 'setWrap' ]; /** @@ -203,7 +208,8 @@ public function isNullableSetToNull(string $property): bool 'color' => 'getColor', 'opacity' => 'getOpacity', 'padding' => 'getPadding', - 'border_radius' => 'getBorderRadius' + 'border_radius' => 'getBorderRadius', + 'wrap' => 'getWrap' ]; /** @@ -267,6 +273,7 @@ public function __construct(array $data = null) $this->setIfExists('opacity', $data ?? [], null); $this->setIfExists('padding', $data ?? [], null); $this->setIfExists('border_radius', $data ?? [], null); + $this->setIfExists('wrap', $data ?? [], null); } /** @@ -468,6 +475,33 @@ public function setBorderRadius($border_radius) return $this; } + + /** + * Gets wrap + * + * @return bool|null + */ + public function getWrap() + { + return $this->container['wrap']; + } + + /** + * Sets wrap + * + * @param bool|null $wrap 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. + * + * @return self + */ + public function setWrap($wrap) + { + if (is_null($wrap)) { + throw new \InvalidArgumentException('non-nullable wrap cannot be null'); + } + $this->container['wrap'] = $wrap; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/TextToImageAsset.php b/src/Model/TextToImageAsset.php index 7b25d44..94a47f1 100644 --- a/src/Model/TextToImageAsset.php +++ b/src/Model/TextToImageAsset.php @@ -35,7 +35,7 @@ * TextToImageAsset Class Doc Comment * * @category Class - * @description The TextToImageAsset lets you create a dynamic image from a text prompt. + * @description **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. * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/src/Model/TextToSpeechAsset.php b/src/Model/TextToSpeechAsset.php index 2611591..852c374 100644 --- a/src/Model/TextToSpeechAsset.php +++ b/src/Model/TextToSpeechAsset.php @@ -35,7 +35,7 @@ * TextToSpeechAsset Class Doc Comment * * @category Class - * @description 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. + * @description **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. * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/src/Model/VideoAsset.php b/src/Model/VideoAsset.php index b643b62..9679673 100644 --- a/src/Model/VideoAsset.php +++ b/src/Model/VideoAsset.php @@ -35,7 +35,7 @@ * VideoAsset Class Doc Comment * * @category Class - * @description 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. + * @description 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. * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -60,6 +60,9 @@ class VideoAsset implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'type' => 'string', 'src' => 'string', + 'prompt' => 'string', + 'seed' => 'string', + 'model' => 'string', 'transcode' => 'bool', 'trim' => 'float', 'volume' => '\ShotstackClient\Model\VideoAssetVolume', @@ -79,6 +82,9 @@ class VideoAsset implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'type' => null, 'src' => null, + 'prompt' => null, + 'seed' => null, + 'model' => null, 'transcode' => null, 'trim' => null, 'volume' => null, @@ -96,6 +102,9 @@ class VideoAsset implements ModelInterface, ArrayAccess, \JsonSerializable protected static array $openAPINullables = [ 'type' => false, 'src' => false, + 'prompt' => false, + 'seed' => false, + 'model' => false, 'transcode' => false, 'trim' => false, 'volume' => false, @@ -193,6 +202,9 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'type' => 'type', 'src' => 'src', + 'prompt' => 'prompt', + 'seed' => 'seed', + 'model' => 'model', 'transcode' => 'transcode', 'trim' => 'trim', 'volume' => 'volume', @@ -210,6 +222,9 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'type' => 'setType', 'src' => 'setSrc', + 'prompt' => 'setPrompt', + 'seed' => 'setSeed', + 'model' => 'setModel', 'transcode' => 'setTranscode', 'trim' => 'setTrim', 'volume' => 'setVolume', @@ -227,6 +242,9 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'type' => 'getType', 'src' => 'getSrc', + 'prompt' => 'getPrompt', + 'seed' => 'getSeed', + 'model' => 'getModel', 'transcode' => 'getTranscode', 'trim' => 'getTrim', 'volume' => 'getVolume', @@ -327,6 +345,9 @@ public function __construct(array $data = null) { $this->setIfExists('type', $data ?? [], 'video'); $this->setIfExists('src', $data ?? [], null); + $this->setIfExists('prompt', $data ?? [], null); + $this->setIfExists('seed', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); $this->setIfExists('transcode', $data ?? [], null); $this->setIfExists('trim', $data ?? [], null); $this->setIfExists('volume', $data ?? [], null); @@ -375,17 +396,22 @@ public function listInvalidProperties() ); } - if ($this->container['src'] === null) { - $invalidProperties[] = "'src' can't be null"; - } - if ((mb_strlen($this->container['src']) < 1)) { + if (!is_null($this->container['src']) && (mb_strlen($this->container['src']) < 1)) { $invalidProperties[] = "invalid value for 'src', the character length must be bigger than or equal to 1."; } - if (!preg_match("/\\S/", $this->container['src'])) { + if (!is_null($this->container['src']) && !preg_match("/\\S/", $this->container['src'])) { $invalidProperties[] = "invalid value for 'src', must be conform to the pattern /\\S/."; } + if (!is_null($this->container['prompt']) && (mb_strlen($this->container['prompt']) > 4000)) { + $invalidProperties[] = "invalid value for 'prompt', the character length must be smaller than or equal to 4000."; + } + + if (!is_null($this->container['seed']) && (mb_strlen($this->container['seed']) < 1)) { + $invalidProperties[] = "invalid value for 'seed', the character length must be bigger than or equal to 1."; + } + $allowedValues = $this->getVolumeEffectAllowableValues(); if (!is_null($this->container['volume_effect']) && !in_array($this->container['volume_effect'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -458,7 +484,7 @@ public function setType($type) /** * Gets src * - * @return string + * @return string|null */ public function getSrc() { @@ -468,7 +494,7 @@ public function getSrc() /** * Sets src * - * @param string $src The video source URL. The URL must be publicly accessible or include credentials. + * @param string|null $src The video source URL. The URL must be publicly accessible or include credentials. Provide either `src` or `prompt`, not both. * * @return self */ @@ -490,6 +516,96 @@ public function setSrc($src) return $this; } + /** + * Gets prompt + * + * @return string|null + */ + public function getPrompt() + { + return $this->container['prompt']; + } + + /** + * Sets prompt + * + * @param string|null $prompt 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. + * + * @return self + */ + public function setPrompt($prompt) + { + if (is_null($prompt)) { + throw new \InvalidArgumentException('non-nullable prompt cannot be null'); + } + if ((mb_strlen($prompt) > 4000)) { + throw new \InvalidArgumentException('invalid length for $prompt when calling VideoAsset., must be smaller than or equal to 4000.'); + } + + $this->container['prompt'] = $prompt; + + return $this; + } + + /** + * Gets seed + * + * @return string|null + */ + public function getSeed() + { + return $this->container['seed']; + } + + /** + * Sets seed + * + * @param string|null $seed 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. + * + * @return self + */ + public function setSeed($seed) + { + if (is_null($seed)) { + throw new \InvalidArgumentException('non-nullable seed cannot be null'); + } + + if ((mb_strlen($seed) < 1)) { + throw new \InvalidArgumentException('invalid length for $seed when calling VideoAsset., must be bigger than or equal to 1.'); + } + + $this->container['seed'] = $seed; + + return $this; + } + + /** + * Gets model + * + * @return string|null + */ + public function getModel() + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param string|null $model 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. + * + * @return self + */ + public function setModel($model) + { + if (is_null($model)) { + throw new \InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + /** * Gets transcode * @@ -621,7 +737,7 @@ public function getSpeed() /** * Sets speed * - * @param float|null $speed 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). + * @param float|null $speed 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). * * @return self */