diff --git a/.oas-version b/.oas-version index 18b3114..1cac385 100644 --- a/.oas-version +++ b/.oas-version @@ -1 +1 @@ -1.10.4 +1.11.0 diff --git a/src/Configuration.php b/src/Configuration.php index 9e404cf..ccbbe8e 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.11.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.11.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..d8bb2dd 100644 --- a/src/Model/Asset.php +++ b/src/Model/Asset.php @@ -87,6 +87,7 @@ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable 'html' => 'string', 'css' => 'string', 'position' => 'string', + 'js' => 'string', 'color' => 'string', 'size' => 'string', 'offset' => '\ShotstackClient\Model\Offset', @@ -139,6 +140,7 @@ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable 'html' => null, 'css' => null, 'position' => null, + 'js' => null, 'color' => null, 'size' => null, 'offset' => null, @@ -189,6 +191,7 @@ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable 'html' => false, 'css' => false, 'position' => false, + 'js' => false, 'color' => false, 'size' => false, 'offset' => false, @@ -319,6 +322,7 @@ public function isNullableSetToNull(string $property): bool 'html' => 'html', 'css' => 'css', 'position' => 'position', + 'js' => 'js', 'color' => 'color', 'size' => 'size', 'offset' => 'offset', @@ -369,6 +373,7 @@ public function isNullableSetToNull(string $property): bool 'html' => 'setHtml', 'css' => 'setCss', 'position' => 'setPosition', + 'js' => 'setJs', 'color' => 'setColor', 'size' => 'setSize', 'offset' => 'setOffset', @@ -419,6 +424,7 @@ public function isNullableSetToNull(string $property): bool 'html' => 'getHtml', 'css' => 'getCss', 'position' => 'getPosition', + 'js' => 'getJs', 'color' => 'getColor', 'size' => 'getSize', 'offset' => 'getOffset', @@ -484,6 +490,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 +559,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, @@ -726,6 +734,7 @@ public function __construct(array $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); @@ -1659,7 +1668,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. * * @return self */ @@ -1686,7 +1695,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. * * @return self */ @@ -1737,6 +1746,33 @@ 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. + * + * @return self + */ + public function setJs($js) + { + if (is_null($js)) { + throw new \InvalidArgumentException('non-nullable js cannot be null'); + } + $this->container['js'] = $js; + + return $this; + } + /** * Gets color * diff --git a/src/Model/Html5Asset.php b/src/Model/Html5Asset.php new file mode 100644 index 0000000..bece53f --- /dev/null +++ b/src/Model/Html5Asset.php @@ -0,0 +1,550 @@ + + */ +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"; + } + 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. + * + * @return self + */ + public function setHtml($html) + { + if (is_null($html)) { + throw new \InvalidArgumentException('non-nullable html cannot be null'); + } + $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. + * + * @return self + */ + public function setCss($css) + { + if (is_null($css)) { + throw new \InvalidArgumentException('non-nullable css cannot be null'); + } + $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. + * + * @return self + */ + public function setJs($js) + { + if (is_null($js)) { + throw new \InvalidArgumentException('non-nullable js cannot be null'); + } + $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/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..f355c28 100644 --- a/src/Model/RichTextBackground.php +++ b/src/Model/RichTextBackground.php @@ -60,7 +60,8 @@ class RichTextBackground implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPITypes = [ 'color' => 'string', 'opacity' => 'float', - 'border_radius' => 'float' + 'border_radius' => 'float', + 'wrap' => 'bool' ]; /** @@ -73,7 +74,8 @@ class RichTextBackground implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPIFormats = [ 'color' => null, 'opacity' => null, - 'border_radius' => null + 'border_radius' => null, + 'wrap' => null ]; /** @@ -84,7 +86,8 @@ class RichTextBackground implements ModelInterface, ArrayAccess, \JsonSerializab protected static array $openAPINullables = [ 'color' => false, 'opacity' => false, - 'border_radius' => false + 'border_radius' => false, + 'wrap' => false ]; /** @@ -175,7 +178,8 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'color' => 'color', 'opacity' => 'opacity', - 'border_radius' => 'borderRadius' + 'border_radius' => 'borderRadius', + 'wrap' => 'wrap' ]; /** @@ -186,7 +190,8 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'color' => 'setColor', 'opacity' => 'setOpacity', - 'border_radius' => 'setBorderRadius' + 'border_radius' => 'setBorderRadius', + 'wrap' => 'setWrap' ]; /** @@ -197,7 +202,8 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'color' => 'getColor', 'opacity' => 'getOpacity', - 'border_radius' => 'getBorderRadius' + 'border_radius' => 'getBorderRadius', + 'wrap' => 'getWrap' ]; /** @@ -260,6 +266,7 @@ 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); } /** @@ -418,6 +425,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 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; + } /** * 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. *