diff --git a/README.md b/README.md index ab310d2..791129b 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ For examples of how to use the SDK to create videos using code checkout the PHP - [Video Editing](#video-editing) - [Video Editing Example](#video-editing-example) - [Status Check Example](#status-check-example) + - [Save a Template Example](#save-a-template-example) + - [Render a Template Example](#render-a-template-example) - [Video Editing Schemas](#video-editing-schemas) - [Edit()](#edit) - [Timeline()](#timeline) @@ -38,18 +40,34 @@ For examples of how to use the SDK to create videos using code checkout the PHP - [SkewTransformation()](#skewtransformation) - [FlipTransformation()](#fliptransformation) - [MergeField()](#mergefield) + - [Template Schemas](#template-schemas) + - [Template()](#template) + - [TemplateRender()](#templaterender) - [Output Schemas](#output-schemas) - [Output()](#output) - [Size()](#size) - [Range()](#range) - [Poster()](#poster) - [Thumbnail()](#thumbnail) + - [Destinations](#destinations) - [ShotstackDestination()](#shotstackdestination) + - [MuxDestination()](#muxdestination) + - [MuxDestinationOptions()](#muxdestinationoptions) + - [S3Destination()](#s3destination) + - [S3DestinationOptions()](#s3destinationoptions) - [Render Response Schemas](#render-response-schemas) - [QueuedResponse()](#queuedresponse) - [QueuedResponseData()](#queuedresponsedata) - [RenderResponse()](#renderresponse) - [RenderResponseData()](#renderresponsedata) + - [Template Response Schemas](#template-response-schemas) + - [TemplateResponse()](#templateresponse) + - [TemplateResponseData()](#templateresponsedata) + - [TemplateDataResponse()](#templatedataresponse) + - [TemplateDataResponseData()](#templatedataresponsedata) + - [TemplateListResponse()](#templatelistresponse) + - [TemplateListResponseData()](#templatelistresponsedata) + - [TemplateListResponseItem()](#templatelistresponseitem) - [Inspecting Media](#inspecting-media) - [Probe Example](#probe-example) - [Probe Schemas](#probe-schemas) @@ -138,7 +156,8 @@ $render = $client->postRender($edit)->getResponse(); ### Status Check Example The example request below can be called a few seconds after the render above is posted. It will return the status of -the render, which can take several seconds to process. +the render, which can take several seconds to process. It uses the `render->getId()` method returned by the `postRender` +request. ```php use Shotstack\Client\Api\EditApi; @@ -157,6 +176,120 @@ if ($video->getStatus() === 'done') { } ``` +### Save a Template Example + +The example below uses the Edit we create in the [Video Editing Example](#video-editing-example) and saves it as a +template. The template can be rendered at a later date and can include placeholders. Placeholders can be replaced +when rendered using [merge fields](#mergefield). + +This example uses a placeholder for the video src (URL), trim (TRIM), and length (LENGTH) to allow you to trim any video +using a template. + +```php +setHost('https://api.shotstack.io/stage') + ->setApiKey('x-api-key', 'H7jKyj90kd09lbLOF7J900jNbSWS67X87xs9j0cD'); // use the correct API key + +$client = new EditApi(null, $config); + +$videoAsset = new videoAsset(); +$videoAsset + ->setSrc('{{ URL }}') + ->setTrim('{{ TRIM }}'); + +$videoClip = new Clip(); +$videoClip + ->setAsset($videoAsset) + ->setStart(0) + ->setLength('{{ LENGTH }}'); + +$track = new Track(); +$track + ->setClips([$videoClip]); + +$timeline = new Timeline(); +$timeline + ->setTracks([$track]); + +$output = new Output(); +$output + ->setFormat('mp4') + ->setResolution('sd'); + +$edit = new Edit(); +$edit + ->setTimeline($timeline) + ->setOutput($output); + +$template = new Template(); +$template + ->setName('Trim Template') + ->setTemplate($edit); + +$response = $client->postTemplate($template)->getResponse(); +``` + +### Render a Template Example + +The example below renders the template we created in the previous example and includes merge fields that will replace +the placeholders. Once submitted use the returned render ID and call the [Status Check Example](#status-check-example) +to get the render progress. It uses the `response->getId()` method returned by the `postTemplate` request. + +```php +use Shotstack\Client\Api\EditApi; +use Shotstack\Client\Configuration; + +$config = Configuration::getDefaultConfiguration() + ->setHost('https://api.shotstack.io/stage') + ->setApiKey('x-api-key', 'H7jKyj90kd09lbLOF7J900jNbSWS67X87xs9j0cD'); // use the correct API key + +$client = new EditApi(null, $config); + +$mergeFieldUrl = new MergeField(); +$mergeFieldUrl + ->setFind('URL') + ->setReplace('https://s3-ap-southeast-2.amazonaws.com/shotstack-assets/footage/skater.hd.mp4'); + +$mergeFieldTrim = new MergeField(); +$mergeFieldTrim + ->setFind('TRIM') + ->setReplace(3); + +$mergeFieldLength = new MergeField(); +$mergeFieldLength + ->setFind('LENGTH') + ->setReplace(6); + +$template = new TemplateRender(); +$template + ->setId($response->id) + ->setMerge([ + $mergeFieldUrl, + $mergeFieldTrim, + $mergeFieldLength, + ]); + +$video = $client->postTemplateRender($template)->getResponse(); + +if ($video->getStatus() === 'done') { + echo $video->getUrl(); +} +``` + ## Video Editing Schemas The following schemas are used to prepare a video edit. @@ -175,8 +308,8 @@ $edit ->setTimeline($timeline) ->setOutput($output) ->setMerge($merge) - ->setCallback("https://my-server.com/callback.php") - ->setDisk("local"); + ->setCallback('https://my-server.com/callback.php') + ->setDisk('local'); ``` #### Methods: @@ -187,7 +320,7 @@ setTimeline([\Shotstack\Client\Model\Timeline](#timeline)) | A timeline represen setOutput([\Shotstack\Client\Model\Output](#output)) | The output format, render range and type of media to generate. | Y setMerge([\Shotstack\Client\Model\MergeField[]](#mergefield) $mergeField) | An array of key/value pairs that provides an easy way to create templates with placeholders. The placeholders can be used to find and replace keys with values. For example you can search for the placeholder `{{NAME}}` and replace it with the value `Jane`. | - setCallback(string $callback) | An optional webhook callback URL used to receive status notifications when a render completes or fails. See [webhooks](https://shotstack.io/docs/guide/architecting-an-application/webhooks/) for more details. | - -setDisk(string $disk) | The disk type to use for storing footage and assets for each render. See [disk types](https://shotstack.io/docs/guide/architecting-an-application/disk-types/) for more details. [default to `local`] | - +setDisk(string $disk) | **(Deprecated)** The disk type to use for storing footage and assets for each render. See [disk types](https://shotstack.io/docs/guide/architecting-an-application/disk-types/) for more details. [default to `local`] | - ----- @@ -350,6 +483,7 @@ $videoAsset ->setSrc('https://shotstack-assets.s3.aws.com/mountain.mp4') ->setTrim(5) ->setVolume(0.5) + ->setVolumeEffect('fadeIn') ->setCrop($crop); ``` @@ -360,6 +494,7 @@ Method | Description | Required setSrc(string $url) | The video source URL. The URL must be publicly accessible or include credentials. | Y setTrim(float $seconds) | The start trim point of the video clip, in seconds (defaults to 0). Videos will start from the in trim point. The video will play until the file ends or the Clip length is reached. | - setVolume(float $level) | Set the volume for the video clip between 0 and 1 where 0 is muted and 1 is full volume (defaults to 0). | - +setVolumeEffect(string $effect) | The volume effect to apply to the video asset. | - setCrop([\Shotstack\Client\Model\Crop](#crop) $crop) | Crop the sides of an asset by a relative amount. The size of the crop is specified using a scale between 0 and 1, relative to the screen width - i.e. a left crop of 0.5 will crop half of the asset from the left, a top crop of 0.25 will crop the top by quarter of the asset. | - --- @@ -550,8 +685,8 @@ $offset Method | Description | Required :--- | :--- | :---: -setX(float $x) | Offset an asset on the horizontal axis (left or right), range varies from -1 to 1. Positive numbers move the asset right, negative left. For all assets except titles the distance moved is relative to the width of the viewport - i.e. an X offset of 0.5 will move the asset half the screen width to the right. [default to `0`] | - -setY(float $y) | Offset an asset on the vertical axis (up or down), range varies from -1 to 1. Positive numbers move the asset up, negative down. For all assets except titles the distance moved is relative to the height of the viewport - i.e. an Y offset of 0.5 will move the asset up half the screen height. [default to `0`] | - +setX(float $x) | Offset an asset on the horizontal axis (left or right), range varies from -10 to 10. Positive numbers move the asset right, negative left. For all assets except titles the distance moved is relative to the width of the viewport - i.e. an X offset of 0.5 will move the asset half the screen width to the right. [default to `0`] | - +setY(float $y) | Offset an asset on the vertical axis (up or down), range varies from -10 to 10. Positive numbers move the asset up, negative down. For all assets except titles the distance moved is relative to the height of the viewport - i.e. a Y offset of 0.5 will move the asset up half the screen height. [default to `0`] | - --- @@ -703,6 +838,58 @@ setReplace($replace) | The replacement value. The replacement can be any valid J --- +## Template Schemas + +The following schemas specify how to use templates to store and render templates. A template lets you save an +[Edit](#edit) that can be rendered by its template ID and optionally include merge fields that are merged with the +template when rendered. + +### Template() + +A template is a saved [Edit](#edit) than can be loaded and re-used. + +#### Example: + +```php +use Shotstack\Client\Model\Template; + +$template = new Template(); +$template + ->setName('My Template') + ->setTemplate($edit); +``` + +#### Methods: + +Method | Description | Required +:--- | :--- | :---: +setName(string $name) | The template name. | Y +setTemplate([\Shotstack\Client\Model\Edit](#edit) $edit)) | An edit defines the arrangement of a video on a timeline, an audio edit or an image design and the output format. | Y + +### TemplateRender() + +Configure the id and optional merge fields to render a template by id. + +#### Example: + +```php +use Shotstack\Client\Model\TemplateRender; + +$render = new TemplateRender(); +$render + ->setId('21e781c0-8232-4418-fec1-cc99f0280c21') + ->setMerge($merge); +``` + +#### Methods: + +Method | Description | Required +:--- | :--- | :---: +setId(string $id) | The id of the template to render in UUID format. | Y +setMerge([\Shotstack\Client\Model\MergeField[]](#mergefield) $mergeFields) | An array of key/value pairs that provides an easy way to create templates with placeholders. The placeholders can be used to find and replace keys with values. For example you can search for the placeholder `{{NAME}}` and replace it with the value `Jane`. | - + +--- + ## Output Schemas The following schemas specify the output format and settings. @@ -725,6 +912,7 @@ $output ->setScaleTo('preview') ->setQuality('mediue') ->setRepeat(true) + ->setMute(false) ->setRange($range) ->setPoster($poster) ->setThumbnail($thumbnail) @@ -743,10 +931,11 @@ setFps(float $fps) | Override the default frames per second. Useful for when the setScaleTo(string $scaleTo) | Override the resolution and scale the video or image to render at a different size. When using scaleTo the asset should be edited at the resolution dimensions, i.e. use font sizes that look best at HD, then use scaleTo to output the file at SD and the text will be scaled to the correct size. This is useful if you want to create multiple asset sizes. | - setQuality(string $quality) | Adjust the output quality of the video, image or audio. Adjusting quality affects render speed, download speeds and storage requirements due to file size. The default `medium` provides the most optimized choice for all three factors. | - setRepeat(bool $repeat) | Loop settings for gif files. Set to `true` to loop, `false` to play only once. [default to `true`] | - +setMute(bool $mute) | Mute the audio track of the output video. Set to `true` to mute, `false` to un-mute. | - setRange([\Shotstack\Client\Model\Range](#range) $range) | Specify a time range to render, i.e. to render only a portion of a video or audio file. Omit this setting to export the entire video. Range can also be used to render a frame at a specific time point - setting a range and output format as `jpg` will output a single frame image at the range `start` point. | - setPoster([\Shotstack\Client\Model\Poster](#poster) $poster) | Generate a poster image from a specific point on the timeline. | - setThumbnail([\Shotstack\Client\Model\Thumbnail](#thumbnail) $thumbnail) | Generate a thumbnail image from a specific point on the timeline. | - -setDestinations([AnyOfShotstackDestination[]](#shotstackdestination) $destinations) | A destination is a location where output files can be sent to for serving or hosting. By default all rendered assets are automatically sent to the Shotstack hosting destination. [ShotstackDestination](#shotstackdestination) is currently the only option with plans to add more in the future such as S3, YouTube, Vimeo and Mux. If you do not require hosting you can opt-out using the `exclude` property. | - +setDestinations([\Shotstack\Client\Model\Destinations[]](#destinations) $destinations) | A destination is a location where output files can be sent to for serving or hosting. By default all rendered assets are automatically sent to the Shotstack hosting destination. | - --- @@ -844,6 +1033,7 @@ setScale(float $scale) | Scale the thumbnail size to a fraction of the viewport --- +## Destinations ### ShotstackDestination() Send rendered assets to the Shotstack hosting and CDN service. This destination is enabled by default. @@ -866,6 +1056,102 @@ Method | Description | Required setProvider(string $provider) | The destination to send rendered assets to - set to `shotstack` for Shotstack hosting and CDN. [default to `shotstack`] | Y setExclude(bool $exclude) | Set to `true` to opt-out from the Shotstack hosting and CDN service. All files must be downloaded within 24 hours of rendering. [default to `false`] | - +### MuxDestination() + +Send rendered videos to the [Mux](https://shotstack.io/docs/guide/serving-assets/destinations/mux) video hosting and +streaming service. Mux credentials are required and added via the +[dashboard](https://dashboard.shotstack.io/integrations/mux), not in the request. + +#### Example: + +```php +use Shotstack\Client\Model\MuxDestination; + +$muxDestination = new MuxDestination(); +$muxDestination + ->setProvider('mux') + ->setOptions($muxDestinationOptions); +``` + +#### Methods: + +Name | Description | Required +:--- | :--- | :---: +setProvider(string $provider) | The destination to send rendered assets to - set to `mux` for Mux. | Y +setOptions([Shotstack\Client\Model\MuxDestinationOptions](#muxdestinationoptions) options) | Additional Mux configuration and features. | - + +### MuxDestinationOptions() + +Pass additional options to control how Mux processes video. Currently supports playback policy option. + +#### Example: + +```php +use Shotstack\Client\Model\MuxDestinationOptions; + +$muxDestinationOptions = new MuxDestinationOptions(); +$muxDestinationOptions + ->setPlaybackPolicy(['public']); +``` + +#### Methods: + +Name | Description | Required +:--- | :--- | :---: +setPlaybackPolicy([string] $policy) | Sets the Mux `playback_policy` option. Value is an array of strings - use **public**, **signed**, or both. | - + +### S3Destination() + +Send rendered videos to an [Amazon S3](https://shotstack.io/docs/guide/serving-assets/destinations/s3) bucket. Send +files to any region with your own prefix and filename. AWS credentials are required and added via the +[dashboard](https://dashboard.shotstack.io/integrations/s3), not in the request. + +#### Example: + +```php +use Shotstack\Client\Model\S3Destination; + +$s3Destination = new S3Destination(); +$s3Destination + ->setProvider('s3') + ->setOptions($s3DestinationOptions); +``` + +#### Methods: + +Name | Description | Required +:--- | :--- | :---: +setProvider(string provider) | The destination to send rendered assets to - set to `s3` for S3. | Y +setOptions([Shotstack\Client\Model\S3DestinationOptions](#s3destinationoptions) options) | Additional S3 configuration options. | - + +### S3DestinationOptions() + +Pass additional options to control how files are stored in S3. + +#### Example: + +```php +use Shotstack\Client\Model\S3DestinationOptions; + +$s3DestinationOptions = new S3DestinationOptions(); +$s3DestinationOptions + ->setRegion('us-east-1'); + ->setBucket('my-bucket'); + ->setPrefix('my-renders'); + ->setFilename('my-file'); + ->setAcl('public-read'); +``` + +#### Methods: + +Name | Description | Required +:--- | :--- | :---: +setRegion(string $region) | Choose the region to send the file to. Must be a valid [AWS region](https://docs.aws.amazon.com/general/latest/gr/s3.html#s3_region) string like `us-east-1` or `ap-southeast-2` | Y +setBucket(string $bucket) | The bucket name to send files to. The bucket must exist in the AWS account before files can be sent. | Y +setPrefix(string $prefix) | A prefix for the file being sent. This is typically a folder name, i.e. `videos` or `customerId/videos`. | - +setFilename(string $filename) | Use your own filename instead of the default render ID filename. Note: omit the file extension as this will be appended depending n the output format. Also `poster.jpg` and `-thumb.jpg` will be appended for poster and thumbnail images. | - +setAcl(string $acl) | Sets the S3 Access Control List (acl) permissions. Default is `private`. Must use a valid S3 [Canned ACL](https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl). | - + --- ## Render Response Schemas @@ -935,6 +1221,98 @@ getData(): [\Shotstack\Client\Model\Edit](#edit) | The timeline and output data getCreated(): string | The time the render task was initially queued. | Y getUpdated(): string | The time the render status was last updated. | Y +--- + +## Template Response Schemas + +The following schemas are returned by the templates endpoint, including create, update and rendering a template. + +### TemplateResponse() + +The response received after a [template](#create-template) is submitted. The template is saved and a unique +template id is returned. + +#### Methods: + +Method | Description | Required +:--- | :--- | :---: +getSuccess(): bool | `true` if successfully queued, else `false`. | Y +getMessage(): string | `Created`, `Bad Request` or an error message. | Y +getResponse(): [\Shotstack\Client\Model\TemplateResponseData](#templateresponsedata) | `TemplateResponseData` or an error message. | Y + +### TemplateResponseData() + +The response data returned with the [TemplateResponse](#templateresponse). + +#### Methods: + +Method | Description | Required +:--- | :--- | :---: +getMessage(): string | Success response message or error details. | Y +getId(): string | The unique id of the template in UUID format. | Y + +### TemplateDataResponse() + +The template data including the template name and [Edit](#edit). + +#### Methods: + +Method | Description | Required +:--- | :--- | :---: +getSuccess(): bool | `true` if successfully queued, else `false`. | Y +getMessage(): string | `Created`, `Bad Request` or an error message. | Y +getResponse(): [\Shotstack\Client\Model\TemplateDataResponseData](#templatedataresponsedata) | `TemplateDataResponseData` or an error message. | Y + +### TemplateDataResponseData() + +The response data returned with the [TemplateDataResponse](#templatedataresponse). + +#### Methods: + +Method | Description | Required +:--- | :--- | :---: +getId(): string | The unique id of the template in UUID format. | Y +getName(): string | The template name. | Y +getOwner(): string | The owner id of the templates. | Y +getTemplate(): [\Shotstack\Client\Model\Edit](#edit) | `Edit` or an error message. | Y + +### TemplateListResponse() + +A list of previously saved templates. + +#### Methods: + +Method | Description | Required +:--- | :--- | :---: +getSuccess(): bool | `true` if successfully queued, else `false`. | Y +getMessage(): string | `Created`, `Bad Request` or an error message. | Y +getResponse(): [\Shotstack\Client\Model\TemplateListResponseData](#templatelistresponsedata) | `TemplateListResponseData` or an error message. | Y + +### TemplateListResponseData() + +The response data returned with the [TemplateListResponse](#templatelistresponse). + +#### Methods: + +Method | Description | Required +:--- | :--- | :---: +getOwner(): bool | The owner id of the templates. | Y +getTemplates(): [\Shotstack\Client\Model\TemplateListResponseItem[]](#templatelistresponseitem) | The list of templates. | Y + +### TemplateListResponseItem() + +The individual template item returned with the [TemplateListResponseData](#templatelistresponsedata) templates +list. + +#### Methods: + +Method | Description | Required +:--- | :--- | :---: +getId(): string | The unique id of the template in UUID format. | Y +getName(): string | The template name | Y +getCreated(): string | The time the template was created. | - +getUpdated(): string | The time the template was last updated. | - + --- ## Inspecting Media diff --git a/src/Model/Asset.php b/src/Model/Asset.php index 5f1a5f8..4ed1e14 100644 --- a/src/Model/Asset.php +++ b/src/Model/Asset.php @@ -35,7 +35,7 @@ * Asset Class Doc Comment * * @category Class - * @description The type of asset to display for the duration of this Clip. Value must be one of: <ul> <li><a href=\"#tocs_videoasset\">VideoAsset</a></li> <li><a href=\"#tocs_imageasset\">ImageAsset</a></li> <li><a href=\"#tocs_titleasset\">TitleAsset</a></li> <li><a href=\"#tocs_htmlasset\">HtmlAsset</a></li> <li><a href=\"#tocs_audioasset\">AudioAsset</a></li> <li><a href=\"#tocs_lumaasset\">LumaAsset</a></li> </ul> + * @description The type of asset to display for the duration of the Clip. Value must be one of: <ul> <li><a href=\"#tocs_videoasset\">VideoAsset</a></li> <li><a href=\"#tocs_imageasset\">ImageAsset</a></li> <li><a href=\"#tocs_titleasset\">TitleAsset</a></li> <li><a href=\"#tocs_htmlasset\">HtmlAsset</a></li> <li><a href=\"#tocs_audioasset\">AudioAsset</a></li> <li><a href=\"#tocs_lumaasset\">LumaAsset</a></li> </ul> * @package Shotstack\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -64,6 +64,7 @@ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable 'src' => 'string', 'trim' => 'float', 'volume' => 'float', + 'volume_effect' => 'string', 'crop' => '\Shotstack\Client\Model\Crop', 'text' => 'string', 'style' => 'string', @@ -91,6 +92,7 @@ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable 'src' => null, 'trim' => null, 'volume' => null, + 'volume_effect' => null, 'crop' => null, 'text' => null, 'style' => null, @@ -137,6 +139,7 @@ public static function openAPIFormats() 'src' => 'src', 'trim' => 'trim', 'volume' => 'volume', + 'volume_effect' => 'volumeEffect', 'crop' => 'crop', 'text' => 'text', 'style' => 'style', @@ -162,6 +165,7 @@ public static function openAPIFormats() 'src' => 'setSrc', 'trim' => 'setTrim', 'volume' => 'setVolume', + 'volume_effect' => 'setVolumeEffect', 'crop' => 'setCrop', 'text' => 'setText', 'style' => 'setStyle', @@ -187,6 +191,7 @@ public static function openAPIFormats() 'src' => 'getSrc', 'trim' => 'getTrim', 'volume' => 'getVolume', + 'volume_effect' => 'getVolumeEffect', 'crop' => 'getCrop', 'text' => 'getText', 'style' => 'getStyle', @@ -243,6 +248,9 @@ public function getModelName() return self::$openAPIModelName; } + const VOLUME_EFFECT_FADE_IN = 'fadeIn'; + const VOLUME_EFFECT_FADE_OUT = 'fadeOut'; + const VOLUME_EFFECT_FADE_IN_FADE_OUT = 'fadeInFadeOut'; const STYLE_MINIMAL = 'minimal'; const STYLE_BLOCKBUSTER = 'blockbuster'; const STYLE_VOGUE = 'vogue'; @@ -273,6 +281,20 @@ public function getModelName() const EFFECT_FADE_OUT = 'fadeOut'; const EFFECT_FADE_IN_FADE_OUT = 'fadeInFadeOut'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getVolumeEffectAllowableValues() + { + return [ + self::VOLUME_EFFECT_FADE_IN, + self::VOLUME_EFFECT_FADE_OUT, + self::VOLUME_EFFECT_FADE_IN_FADE_OUT, + ]; + } + /** * Gets allowable values of the enum * @@ -365,6 +387,7 @@ public function __construct(array $data = null) $this->container['src'] = $data['src'] ?? null; $this->container['trim'] = $data['trim'] ?? null; $this->container['volume'] = $data['volume'] ?? null; + $this->container['volume_effect'] = $data['volume_effect'] ?? null; $this->container['crop'] = $data['crop'] ?? null; $this->container['text'] = $data['text'] ?? null; $this->container['style'] = $data['style'] ?? null; @@ -398,6 +421,15 @@ public function listInvalidProperties() if ($this->container['src'] === null) { $invalidProperties[] = "'src' can't be null"; } + $allowedValues = $this->getVolumeEffectAllowableValues(); + if (!is_null($this->container['volume_effect']) && !in_array($this->container['volume_effect'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'volume_effect', must be one of '%s'", + $this->container['volume_effect'], + implode("', '", $allowedValues) + ); + } + if ($this->container['text'] === null) { $invalidProperties[] = "'text' can't be null"; } @@ -551,6 +583,40 @@ public function setVolume($volume) return $this; } + /** + * Gets volume_effect + * + * @return string|null + */ + public function getVolumeEffect() + { + return $this->container['volume_effect']; + } + + /** + * Sets volume_effect + * + * @param string|null $volume_effect The volume effect to apply to the video asset + * + * @return self + */ + public function setVolumeEffect($volume_effect) + { + $allowedValues = $this->getVolumeEffectAllowableValues(); + if (!is_null($volume_effect) && !in_array($volume_effect, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'volume_effect', must be one of '%s'", + $volume_effect, + implode("', '", $allowedValues) + ) + ); + } + $this->container['volume_effect'] = $volume_effect; + + return $this; + } + /** * Gets crop * diff --git a/src/Model/Clip.php b/src/Model/Clip.php index 6c6f143..a9ef09f 100644 --- a/src/Model/Clip.php +++ b/src/Model/Clip.php @@ -232,11 +232,23 @@ public function getModelName() const POSITION_TOP_LEFT = 'topLeft'; const POSITION_CENTER = 'center'; const EFFECT_ZOOM_IN = 'zoomIn'; + const EFFECT_ZOOM_IN_SLOW = 'zoomInSlow'; + const EFFECT_ZOOM_IN_FAST = 'zoomInFast'; const EFFECT_ZOOM_OUT = 'zoomOut'; + const EFFECT_ZOOM_OUT_SLOW = 'zoomOutSlow'; + const EFFECT_ZOOM_OUT_FAST = 'zoomOutFast'; const EFFECT_SLIDE_LEFT = 'slideLeft'; + const EFFECT_SLIDE_LEFT_S_LOW = 'slideLeftSLow'; + const EFFECT_SLIDE_LEFT_FAST = 'slideLeftFast'; const EFFECT_SLIDE_RIGHT = 'slideRight'; + const EFFECT_SLIDE_RIGHT_SLOW = 'slideRightSlow'; + const EFFECT_SLIDE_RIGHT_FAST = 'slideRightFast'; const EFFECT_SLIDE_UP = 'slideUp'; + const EFFECT_SLIDE_UP_SLOW = 'slideUpSlow'; + const EFFECT_SLIDE_UP_FAST = 'slideUpFast'; const EFFECT_SLIDE_DOWN = 'slideDown'; + const EFFECT_SLIDE_DOWN_SLOW = 'slideDownSlow'; + const EFFECT_SLIDE_DOWN_FAST = 'slideDownFast'; const FILTER_BOOST = 'boost'; const FILTER_CONTRAST = 'contrast'; const FILTER_DARKEN = 'darken'; @@ -289,11 +301,23 @@ public function getEffectAllowableValues() { return [ self::EFFECT_ZOOM_IN, + self::EFFECT_ZOOM_IN_SLOW, + self::EFFECT_ZOOM_IN_FAST, self::EFFECT_ZOOM_OUT, + self::EFFECT_ZOOM_OUT_SLOW, + self::EFFECT_ZOOM_OUT_FAST, self::EFFECT_SLIDE_LEFT, + self::EFFECT_SLIDE_LEFT_S_LOW, + self::EFFECT_SLIDE_LEFT_FAST, self::EFFECT_SLIDE_RIGHT, + self::EFFECT_SLIDE_RIGHT_SLOW, + self::EFFECT_SLIDE_RIGHT_FAST, self::EFFECT_SLIDE_UP, + self::EFFECT_SLIDE_UP_SLOW, + self::EFFECT_SLIDE_UP_FAST, self::EFFECT_SLIDE_DOWN, + self::EFFECT_SLIDE_DOWN_SLOW, + self::EFFECT_SLIDE_DOWN_FAST, ]; } @@ -498,7 +522,7 @@ public function getFit() /** * Sets fit * - * @param string|null $fit Set how the asset should be scaled to fit the viewport using one of the following options: + * @param string|null $fit Set how the asset should be scaled to fit the viewport using one of the following options: * * @return self */ @@ -638,7 +662,7 @@ public function getEffect() /** * Sets effect * - * @param string|null $effect A motion effect to apply to the Clip. + * @param string|null $effect A motion effect to apply to the Clip. The motion effect speed can also be controlled by appending `Fast` or `Slow` to the effect, e.g. `zoomInFast` or `slideRightSlow`. * * @return self */ @@ -672,7 +696,7 @@ public function getFilter() /** * Sets filter * - * @param string|null $filter A filter effect to apply to the Clip. + * @param string|null $filter A filter effect to apply to the Clip. * * @return self */ diff --git a/src/Model/Destinations.php b/src/Model/Destinations.php index a05976e..43d6aac 100644 --- a/src/Model/Destinations.php +++ b/src/Model/Destinations.php @@ -35,7 +35,7 @@ * Destinations Class Doc Comment * * @category Class - * @description A destination is a location where output files can be sent to for serving or hosting. By default all rendered assets are automatically sent to the [Shotstack hosting destination](https://shotstack.io/docs/guide/serving-assets/hosting). You can add other destinations to send assets to. The following destinations are available: <ul> <li><a href=\"#tocs_shotstackdestination\">DestinationShotstack</a></li> <li><a href=\"#tocs_muxdestination\">DestinationMux</a></li> </ul> + * @description A destination is a location where output files can be sent to for serving or hosting. By default all rendered assets are automatically sent to the [Shotstack hosting destination](https://shotstack.io/docs/guide/serving-assets/hosting). You can add other destinations to send assets to. The following destinations are available: <ul> <li><a href=\"#tocs_shotstackdestination\">ShotstackDestination</a></li> <li><a href=\"#tocs_muxdestination\">MuxDestination</a></li> <li><a href=\"#tocs_s3destination\">S3Destination</a></li> </ul> * @package Shotstack\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -62,7 +62,7 @@ class Destinations implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'provider' => 'string', 'exclude' => 'bool', - 'options' => '\Shotstack\Client\Model\MuxDestinationOptions' + 'options' => '\Shotstack\Client\Model\S3DestinationOptions' ]; /** @@ -189,7 +189,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['provider'] = $data['provider'] ?? 'mux'; + $this->container['provider'] = $data['provider'] ?? 's3'; $this->container['exclude'] = $data['exclude'] ?? null; $this->container['options'] = $data['options'] ?? null; @@ -237,7 +237,7 @@ public function getProvider() /** * Sets provider * - * @param string $provider The destination to send rendered assets to - set to `mux` for Mux. + * @param string $provider The destination to send rendered assets to - set to `s3` for S3. * * @return self */ @@ -261,7 +261,7 @@ public function getExclude() /** * Sets exclude * - * @param bool|null $exclude Set to `true` to opt-out from the Shotstack hosting and CDN service. All files must be downloaded within 24 hours of rendering. + * @param bool|null $exclude Set to `true` to [opt-out](https://shotstack.io/docs/guide/serving-assets/self-host) from the Shotstack hosting and CDN service. All files must be downloaded within 24 hours of rendering. * * @return self */ @@ -275,7 +275,7 @@ public function setExclude($exclude) /** * Gets options * - * @return \Shotstack\Client\Model\MuxDestinationOptions|null + * @return \Shotstack\Client\Model\S3DestinationOptions|null */ public function getOptions() { @@ -285,7 +285,7 @@ public function getOptions() /** * Sets options * - * @param \Shotstack\Client\Model\MuxDestinationOptions|null $options options + * @param \Shotstack\Client\Model\S3DestinationOptions|null $options options * * @return self */ diff --git a/src/Model/Edit.php b/src/Model/Edit.php index 0b31bb6..7082a29 100644 --- a/src/Model/Edit.php +++ b/src/Model/Edit.php @@ -360,6 +360,7 @@ public function setCallback($callback) * Gets disk * * @return string|null + * @deprecated */ public function getDisk() { @@ -369,9 +370,10 @@ public function getDisk() /** * Sets disk * - * @param string|null $disk The disk type to use for storing footage and assets for each render. See [disk types](https://shotstack.io/docs/guide/architecting-an-application/disk-types) for more details. + * @param string|null $disk **Notice: This option is now deprecated and will be removed. Disk types are handled automatically. Setting a disk type has no effect.** The disk type to use for storing footage and assets for each render. See [disk types](https://shotstack.io/docs/guide/architecting-an-application/disk-types) for more details. * * @return self + * @deprecated */ public function setDisk($disk) { diff --git a/src/Model/MuxDestination.php b/src/Model/MuxDestination.php index f778311..d84ed7f 100644 --- a/src/Model/MuxDestination.php +++ b/src/Model/MuxDestination.php @@ -35,7 +35,7 @@ * MuxDestination Class Doc Comment * * @category Class - * @description Send rendered videos to the [Mux](https://www.mux.com/) video hosting and streaming service. Add the `mux` destination provider to send the output video to Mux. Mux credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/mux), not in the request. + * @description Send rendered videos to the [Mux](https://shotstack.io/docs/guide/serving-assets/destinations/mux) video hosting and streaming service. Mux credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/mux), not in the request. * @package Shotstack\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/src/Model/Offset.php b/src/Model/Offset.php index cc89328..84fce0e 100644 --- a/src/Model/Offset.php +++ b/src/Model/Offset.php @@ -197,20 +197,20 @@ public function listInvalidProperties() { $invalidProperties = []; - if (!is_null($this->container['x']) && ($this->container['x'] > 1)) { - $invalidProperties[] = "invalid value for 'x', must be smaller than or equal to 1."; + if (!is_null($this->container['x']) && ($this->container['x'] > 10)) { + $invalidProperties[] = "invalid value for 'x', must be smaller than or equal to 10."; } - if (!is_null($this->container['x']) && ($this->container['x'] < -1)) { - $invalidProperties[] = "invalid value for 'x', must be bigger than or equal to -1."; + if (!is_null($this->container['x']) && ($this->container['x'] < -10)) { + $invalidProperties[] = "invalid value for 'x', must be bigger than or equal to -10."; } - if (!is_null($this->container['y']) && ($this->container['y'] > 1)) { - $invalidProperties[] = "invalid value for 'y', must be smaller than or equal to 1."; + if (!is_null($this->container['y']) && ($this->container['y'] > 10)) { + $invalidProperties[] = "invalid value for 'y', must be smaller than or equal to 10."; } - if (!is_null($this->container['y']) && ($this->container['y'] < -1)) { - $invalidProperties[] = "invalid value for 'y', must be bigger than or equal to -1."; + if (!is_null($this->container['y']) && ($this->container['y'] < -10)) { + $invalidProperties[] = "invalid value for 'y', must be bigger than or equal to -10."; } return $invalidProperties; @@ -241,18 +241,18 @@ public function getX() /** * Sets x * - * @param float|null $x Offset an asset on the horizontal axis (left or right), range varies from -1 to 1. Positive numbers move the asset right, negative left. For all assets except titles the distance moved is relative to the width of the viewport - i.e. an X offset of 0.5 will move the asset half the screen width to the right. + * @param float|null $x Offset an asset on the horizontal axis (left or right), range varies from -10 to 10. Positive numbers move the asset right, negative left. For all assets except titles the distance moved is relative to the width of the viewport - i.e. an X offset of 0.5 will move the asset half the screen width to the right. * * @return self */ public function setX($x) { - if (!is_null($x) && ($x > 1)) { - throw new \InvalidArgumentException('invalid value for $x when calling Offset., must be smaller than or equal to 1.'); + if (!is_null($x) && ($x > 10)) { + throw new \InvalidArgumentException('invalid value for $x when calling Offset., must be smaller than or equal to 10.'); } - if (!is_null($x) && ($x < -1)) { - throw new \InvalidArgumentException('invalid value for $x when calling Offset., must be bigger than or equal to -1.'); + if (!is_null($x) && ($x < -10)) { + throw new \InvalidArgumentException('invalid value for $x when calling Offset., must be bigger than or equal to -10.'); } $this->container['x'] = $x; @@ -273,18 +273,18 @@ public function getY() /** * Sets y * - * @param float|null $y Offset an asset on the vertical axis (up or down), range varies from -1 to 1. Positive numbers move the asset up, negative down. For all assets except titles the distance moved is relative to the height of the viewport - i.e. an Y offset of 0.5 will move the asset up half the screen height. + * @param float|null $y Offset an asset on the vertical axis (up or down), range varies from -10 to 10. Positive numbers move the asset up, negative down. For all assets except titles the distance moved is relative to the height of the viewport - i.e. an Y offset of 0.5 will move the asset up half the screen height. * * @return self */ public function setY($y) { - if (!is_null($y) && ($y > 1)) { - throw new \InvalidArgumentException('invalid value for $y when calling Offset., must be smaller than or equal to 1.'); + if (!is_null($y) && ($y > 10)) { + throw new \InvalidArgumentException('invalid value for $y when calling Offset., must be smaller than or equal to 10.'); } - if (!is_null($y) && ($y < -1)) { - throw new \InvalidArgumentException('invalid value for $y when calling Offset., must be bigger than or equal to -1.'); + if (!is_null($y) && ($y < -10)) { + throw new \InvalidArgumentException('invalid value for $y when calling Offset., must be bigger than or equal to -10.'); } $this->container['y'] = $y; diff --git a/src/Model/Output.php b/src/Model/Output.php index f8f0bfc..a22f9ce 100644 --- a/src/Model/Output.php +++ b/src/Model/Output.php @@ -68,6 +68,7 @@ class Output implements ModelInterface, ArrayAccess, \JsonSerializable 'scale_to' => 'string', 'quality' => 'string', 'repeat' => 'bool', + 'mute' => 'bool', 'range' => '\Shotstack\Client\Model\Range', 'poster' => '\Shotstack\Client\Model\Poster', 'thumbnail' => '\Shotstack\Client\Model\Thumbnail', @@ -90,6 +91,7 @@ class Output implements ModelInterface, ArrayAccess, \JsonSerializable 'scale_to' => null, 'quality' => null, 'repeat' => null, + 'mute' => null, 'range' => null, 'poster' => null, 'thumbnail' => null, @@ -131,6 +133,7 @@ public static function openAPIFormats() 'scale_to' => 'scaleTo', 'quality' => 'quality', 'repeat' => 'repeat', + 'mute' => 'mute', 'range' => 'range', 'poster' => 'poster', 'thumbnail' => 'thumbnail', @@ -151,6 +154,7 @@ public static function openAPIFormats() 'scale_to' => 'setScaleTo', 'quality' => 'setQuality', 'repeat' => 'setRepeat', + 'mute' => 'setMute', 'range' => 'setRange', 'poster' => 'setPoster', 'thumbnail' => 'setThumbnail', @@ -171,6 +175,7 @@ public static function openAPIFormats() 'scale_to' => 'getScaleTo', 'quality' => 'getQuality', 'repeat' => 'getRepeat', + 'mute' => 'getMute', 'range' => 'getRange', 'poster' => 'getPoster', 'thumbnail' => 'getThumbnail', @@ -370,6 +375,7 @@ public function __construct(array $data = null) $this->container['scale_to'] = $data['scale_to'] ?? null; $this->container['quality'] = $data['quality'] ?? null; $this->container['repeat'] = $data['repeat'] ?? null; + $this->container['mute'] = $data['mute'] ?? null; $this->container['range'] = $data['range'] ?? null; $this->container['poster'] = $data['poster'] ?? null; $this->container['thumbnail'] = $data['thumbnail'] ?? null; @@ -709,6 +715,30 @@ public function setRepeat($repeat) return $this; } + /** + * Gets mute + * + * @return bool|null + */ + public function getMute() + { + return $this->container['mute']; + } + + /** + * Sets mute + * + * @param bool|null $mute Mute the audio track of the output video. Set to `true` to mute, `false` to un-mute. + * + * @return self + */ + public function setMute($mute) + { + $this->container['mute'] = $mute; + + return $this; + } + /** * Gets range * @@ -794,7 +824,7 @@ public function getDestinations() /** * Sets destinations * - * @param \Shotstack\Client\Model\Destinations[]|null $destinations destinations + * @param \Shotstack\Client\Model\Destinations[]|null $destinations Specify the storage locations and hosting services to send rendered videos to. * * @return self */ diff --git a/src/Model/S3Destination.php b/src/Model/S3Destination.php new file mode 100644 index 0000000..1f34d75 --- /dev/null +++ b/src/Model/S3Destination.php @@ -0,0 +1,354 @@ +https://api.shotstack.io/{version} The Serve API base URL is: https://api.shotstack.io/serve/{version} + * + * The version of the OpenAPI document: v1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 5.4.0 + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Shotstack\Client\Model; + +use \ArrayAccess; +use \Shotstack\Client\ObjectSerializer; + +/** + * S3Destination Class Doc Comment + * + * @category Class + * @description Send rendered videos to an [Amazon S3](https://shotstack.io/docs/guide/serving-assets/destinations/s3) bucket. Send files to any region with your own prefix and filename. AWS credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/s3), not in the request. + * @package Shotstack\Client + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class S3Destination implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'S3Destination'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'provider' => 'string', + 'options' => '\Shotstack\Client\Model\S3DestinationOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'provider' => null, + 'options' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'provider' => 'provider', + 'options' => 'options' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'provider' => 'setProvider', + 'options' => 'setOptions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'provider' => 'getProvider', + 'options' => 'getOptions' + ]; + + /** + * 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; + } + + + /** + * 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->container['provider'] = $data['provider'] ?? 's3'; + $this->container['options'] = $data['options'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' 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 provider + * + * @return string + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param string $provider The destination to send rendered assets to - set to `s3` for S3. + * + * @return self + */ + public function setProvider($provider) + { + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets options + * + * @return \Shotstack\Client\Model\S3DestinationOptions|null + */ + public function getOptions() + { + return $this->container['options']; + } + + /** + * Sets options + * + * @param \Shotstack\Client\Model\S3DestinationOptions|null $options options + * + * @return self + */ + public function setOptions($options) + { + $this->container['options'] = $options; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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. + */ + 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/S3DestinationOptions.php b/src/Model/S3DestinationOptions.php new file mode 100644 index 0000000..b47437a --- /dev/null +++ b/src/Model/S3DestinationOptions.php @@ -0,0 +1,447 @@ +https://api.shotstack.io/{version} The Serve API base URL is: https://api.shotstack.io/serve/{version} + * + * The version of the OpenAPI document: v1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 5.4.0 + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Shotstack\Client\Model; + +use \ArrayAccess; +use \Shotstack\Client\ObjectSerializer; + +/** + * S3DestinationOptions Class Doc Comment + * + * @category Class + * @description Pass additional options to control how files are stored in S3. + * @package Shotstack\Client + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class S3DestinationOptions implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'S3DestinationOptions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'region' => 'string', + 'bucket' => 'string', + 'prefix' => 'string', + 'filename' => 'string', + 'acl' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'region' => null, + 'bucket' => null, + 'prefix' => null, + 'filename' => null, + 'acl' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'region' => 'region', + 'bucket' => 'bucket', + 'prefix' => 'prefix', + 'filename' => 'filename', + 'acl' => 'acl' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'region' => 'setRegion', + 'bucket' => 'setBucket', + 'prefix' => 'setPrefix', + 'filename' => 'setFilename', + 'acl' => 'setAcl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'region' => 'getRegion', + 'bucket' => 'getBucket', + 'prefix' => 'getPrefix', + 'filename' => 'getFilename', + 'acl' => 'getAcl' + ]; + + /** + * 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; + } + + + /** + * 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->container['region'] = $data['region'] ?? null; + $this->container['bucket'] = $data['bucket'] ?? null; + $this->container['prefix'] = $data['prefix'] ?? null; + $this->container['filename'] = $data['filename'] ?? null; + $this->container['acl'] = $data['acl'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['region'] === null) { + $invalidProperties[] = "'region' can't be null"; + } + if ($this->container['bucket'] === null) { + $invalidProperties[] = "'bucket' 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 region + * + * @return string + */ + public function getRegion() + { + return $this->container['region']; + } + + /** + * Sets region + * + * @param string $region Choose the region to send the file to. Must be a valid [AWS region](https://docs.aws.amazon.com/general/latest/gr/s3.html#s3_region) string like `us-east-1` or `ap-southeast-2`. + * + * @return self + */ + public function setRegion($region) + { + $this->container['region'] = $region; + + return $this; + } + + /** + * Gets bucket + * + * @return string + */ + public function getBucket() + { + return $this->container['bucket']; + } + + /** + * Sets bucket + * + * @param string $bucket The bucket name to send files to. The bucket must exist in the AWS account before files can be sent. + * + * @return self + */ + public function setBucket($bucket) + { + $this->container['bucket'] = $bucket; + + return $this; + } + + /** + * Gets prefix + * + * @return string|null + */ + public function getPrefix() + { + return $this->container['prefix']; + } + + /** + * Sets prefix + * + * @param string|null $prefix A prefix for the file being sent. This is typically a folder name, i.e. `videos` or `customerId/videos`. + * + * @return self + */ + public function setPrefix($prefix) + { + $this->container['prefix'] = $prefix; + + return $this; + } + + /** + * Gets filename + * + * @return string|null + */ + public function getFilename() + { + return $this->container['filename']; + } + + /** + * Sets filename + * + * @param string|null $filename Use your own filename instead of the default render ID filename. Note: omit the file extension as this will be appended depending n the output format. Also `poster.jpg` and `-thumb.jpg` will be appended for poster and thumbnail images. + * + * @return self + */ + public function setFilename($filename) + { + $this->container['filename'] = $filename; + + return $this; + } + + /** + * Gets acl + * + * @return string|null + */ + public function getAcl() + { + return $this->container['acl']; + } + + /** + * Sets acl + * + * @param string|null $acl Sets the S3 Access Control List (acl) permissions. Default is `private`. Must use a valid S3 [Canned ACL](https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl). + * + * @return self + */ + public function setAcl($acl) + { + $this->container['acl'] = $acl; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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. + */ + 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/ShotstackDestination.php b/src/Model/ShotstackDestination.php index ffb25ab..87b6683 100644 --- a/src/Model/ShotstackDestination.php +++ b/src/Model/ShotstackDestination.php @@ -35,7 +35,7 @@ * ShotstackDestination Class Doc Comment * * @category Class - * @description Send rendered assets to the Shotstack hosting and CDN service. This destination is enabled by default. + * @description Send rendered assets to the [Shotstack hosting and CDN](https://shotstack.io/docs/guide/serving-assets/destinations/shotstack) service. This destination is enabled by default. * @package Shotstack\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -252,7 +252,7 @@ public function getExclude() /** * Sets exclude * - * @param bool|null $exclude Set to `true` to opt-out from the Shotstack hosting and CDN service. All files must be downloaded within 24 hours of rendering. + * @param bool|null $exclude Set to `true` to [opt-out](https://shotstack.io/docs/guide/serving-assets/self-host) from the Shotstack hosting and CDN service. All files must be downloaded within 24 hours of rendering. * * @return self */ diff --git a/src/Model/Size.php b/src/Model/Size.php index df9ffb8..74c0c45 100644 --- a/src/Model/Size.php +++ b/src/Model/Size.php @@ -35,7 +35,7 @@ * Size Class Doc Comment * * @category Class - * @description Set a custom size for a video or image. When using a custom size omit the `resolution` and `aspectRatio`. Custom sizes must be divisible by 2 based on the encoder specifications. + * @description Set a custom size for a video or image in pixels. When using a custom size omit the `resolution` and `aspectRatio`. Custom sizes must be divisible by 2 based on the encoder specifications. * @package Shotstack\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -241,7 +241,7 @@ public function getWidth() /** * Sets width * - * @param int|null $width Set a custom width for the video or image file. Value must be divisible by 2. Maximum video width is 1920px, maximum image width is 4096px. + * @param int|null $width Set a custom width for the video or image file in pixels. Value must be divisible by 2. Maximum video width is 1920px, maximum image width is 4096px. * * @return self */ @@ -273,7 +273,7 @@ public function getHeight() /** * Sets height * - * @param int|null $height Set a custom height for the video or image file. Value must be divisible by 2. Maximum video height is 1920px, maximum image height is 4096px. + * @param int|null $height Set a custom height for the video or image file in pixels. Value must be divisible by 2. Maximum video height is 1920px, maximum image height is 4096px. * * @return self */ diff --git a/src/Model/TemplateDataResponse.php b/src/Model/TemplateDataResponse.php index 4af21c1..fcf3444 100644 --- a/src/Model/TemplateDataResponse.php +++ b/src/Model/TemplateDataResponse.php @@ -35,7 +35,7 @@ * TemplateDataResponse Class Doc Comment * * @category Class - * @description The template data including the template name and Edit. + * @description The template data including the template name and [Edit](#tocs_edit). * @package Shotstack\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/src/Model/TemplateRender.php b/src/Model/TemplateRender.php index 861821d..5e6d0cf 100644 --- a/src/Model/TemplateRender.php +++ b/src/Model/TemplateRender.php @@ -35,7 +35,7 @@ * TemplateRender Class Doc Comment * * @category Class - * @description Render a template by it's id and optional merge fields. + * @description Configure the id and optional merge fields to render a template by id. * @package Shotstack\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/src/Model/TemplateResponse.php b/src/Model/TemplateResponse.php index 24459a0..a1ccbd4 100644 --- a/src/Model/TemplateResponse.php +++ b/src/Model/TemplateResponse.php @@ -35,7 +35,7 @@ * TemplateResponse Class Doc Comment * * @category Class - * @description The response received after a [template](#create-a-template) is submitted. The template is saved and a unique template id is returned. + * @description The response received after a [template](#create-template) is submitted. The template is saved and a unique template id is returned. * @package Shotstack\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/src/Model/TitleAsset.php b/src/Model/TitleAsset.php index 5440040..8b1b19f 100644 --- a/src/Model/TitleAsset.php +++ b/src/Model/TitleAsset.php @@ -35,7 +35,7 @@ * TitleAsset Class Doc Comment * * @category Class - * @description The TitleAsset clip type lets you create video titles from a text string and apply styling and positioning. + * @description **Notice: The title asset is deprecated, use the [HTML asset](#tocs_htmlasset) instead.** The TitleAsset clip type lets you create video titles from a text string and apply styling and positioning. * @package Shotstack\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/src/Model/VideoAsset.php b/src/Model/VideoAsset.php index f71fa1b..b5e1d64 100644 --- a/src/Model/VideoAsset.php +++ b/src/Model/VideoAsset.php @@ -64,6 +64,7 @@ class VideoAsset implements ModelInterface, ArrayAccess, \JsonSerializable 'src' => 'string', 'trim' => 'float', 'volume' => 'float', + 'volume_effect' => 'string', 'crop' => '\Shotstack\Client\Model\Crop' ]; @@ -79,6 +80,7 @@ class VideoAsset implements ModelInterface, ArrayAccess, \JsonSerializable 'src' => null, 'trim' => null, 'volume' => null, + 'volume_effect' => null, 'crop' => null ]; @@ -113,6 +115,7 @@ public static function openAPIFormats() 'src' => 'src', 'trim' => 'trim', 'volume' => 'volume', + 'volume_effect' => 'volumeEffect', 'crop' => 'crop' ]; @@ -126,6 +129,7 @@ public static function openAPIFormats() 'src' => 'setSrc', 'trim' => 'setTrim', 'volume' => 'setVolume', + 'volume_effect' => 'setVolumeEffect', 'crop' => 'setCrop' ]; @@ -139,6 +143,7 @@ public static function openAPIFormats() 'src' => 'getSrc', 'trim' => 'getTrim', 'volume' => 'getVolume', + 'volume_effect' => 'getVolumeEffect', 'crop' => 'getCrop' ]; @@ -183,6 +188,23 @@ public function getModelName() return self::$openAPIModelName; } + const VOLUME_EFFECT_FADE_IN = 'fadeIn'; + const VOLUME_EFFECT_FADE_OUT = 'fadeOut'; + const VOLUME_EFFECT_FADE_IN_FADE_OUT = 'fadeInFadeOut'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getVolumeEffectAllowableValues() + { + return [ + self::VOLUME_EFFECT_FADE_IN, + self::VOLUME_EFFECT_FADE_OUT, + self::VOLUME_EFFECT_FADE_IN_FADE_OUT, + ]; + } /** * Associative array for storing property values @@ -203,6 +225,7 @@ public function __construct(array $data = null) $this->container['src'] = $data['src'] ?? null; $this->container['trim'] = $data['trim'] ?? null; $this->container['volume'] = $data['volume'] ?? null; + $this->container['volume_effect'] = $data['volume_effect'] ?? null; $this->container['crop'] = $data['crop'] ?? null; } @@ -221,6 +244,15 @@ public function listInvalidProperties() if ($this->container['src'] === null) { $invalidProperties[] = "'src' can't be null"; } + $allowedValues = $this->getVolumeEffectAllowableValues(); + if (!is_null($this->container['volume_effect']) && !in_array($this->container['volume_effect'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'volume_effect', must be one of '%s'", + $this->container['volume_effect'], + implode("', '", $allowedValues) + ); + } + return $invalidProperties; } @@ -321,7 +353,7 @@ public function getVolume() /** * Sets volume * - * @param float|null $volume Set the volume for the video clip between 0 and 1 where 0 is muted and 1 is full volume (defaults to 0). + * @param float|null $volume Set the volume for the video clip between 0 and 1 where 0 is muted and 1 is full volume (defaults to 1). * * @return self */ @@ -332,6 +364,40 @@ public function setVolume($volume) return $this; } + /** + * Gets volume_effect + * + * @return string|null + */ + public function getVolumeEffect() + { + return $this->container['volume_effect']; + } + + /** + * Sets volume_effect + * + * @param string|null $volume_effect The volume effect to apply to the video asset
  • `fadeIn` - fade volume in only
  • `fadeOut` - fade volume out only
  • `fadeInFadeOut` - fade volume in and out
+ * + * @return self + */ + public function setVolumeEffect($volume_effect) + { + $allowedValues = $this->getVolumeEffectAllowableValues(); + if (!is_null($volume_effect) && !in_array($volume_effect, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'volume_effect', must be one of '%s'", + $volume_effect, + implode("', '", $allowedValues) + ) + ); + } + $this->container['volume_effect'] = $volume_effect; + + return $this; + } + /** * Gets crop *