Skip to content

Commit

Permalink
Merge pull request #27 from shotstack/s3-volume-effects
Browse files Browse the repository at this point in the history
SDK uopdates and readme sync
  • Loading branch information
jeffski authored Dec 5, 2022
2 parents 320fdc6 + 0259f46 commit 6924f47
Show file tree
Hide file tree
Showing 17 changed files with 1,416 additions and 49 deletions.
392 changes: 385 additions & 7 deletions README.md

Large diffs are not rendered by default.

68 changes: 67 additions & 1 deletion src/Model/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -137,6 +139,7 @@ public static function openAPIFormats()
'src' => 'src',
'trim' => 'trim',
'volume' => 'volume',
'volume_effect' => 'volumeEffect',
'crop' => 'crop',
'text' => 'text',
'style' => 'style',
Expand All @@ -162,6 +165,7 @@ public static function openAPIFormats()
'src' => 'setSrc',
'trim' => 'setTrim',
'volume' => 'setVolume',
'volume_effect' => 'setVolumeEffect',
'crop' => 'setCrop',
'text' => 'setText',
'style' => 'setStyle',
Expand All @@ -187,6 +191,7 @@ public static function openAPIFormats()
'src' => 'getSrc',
'trim' => 'getTrim',
'volume' => 'getVolume',
'volume_effect' => 'getVolumeEffect',
'crop' => 'getCrop',
'text' => 'getText',
'style' => 'getStyle',
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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";
}
Expand Down Expand Up @@ -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 <ul> <li>`fadeIn` - fade volume in only</li> <li>`fadeOut` - fade volume out only</li> <li>`fadeInFadeOut` - fade volume in and out</li> </ul>
*
* @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
*
Expand Down
30 changes: 27 additions & 3 deletions src/Model/Clip.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
];
}

Expand Down Expand Up @@ -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: <ul> <li>`cover` - stretch the asset to fill the viewport without maintaining the aspect ratio.</li> <li>`contain` - fit the entire asset within the viewport while maintaining the original aspect ratio.</li> <li>`crop` (default) - scale the asset to fill the viewport while maintaining the aspect ratio. The asset will be cropped if it exceeds the bounds of the viewport.</li> <li>`none` - preserves the original asset dimensions and does not apply any scaling.</li> </ul>
* @param string|null $fit Set how the asset should be scaled to fit the viewport using one of the following options: <ul> <li>`crop` <b>(default)</b> - scale the asset to fill the viewport while maintaining the aspect ratio. The asset will be cropped if it exceeds the bounds of the viewport.</li> <li>`cover` - stretch the asset to fill the viewport without maintaining the aspect ratio.</li> <li>`contain` - fit the entire asset within the viewport while maintaining the original aspect ratio.</li> <li>`none` - preserves the original asset dimensions and does not apply any scaling.</li> </ul>
*
* @return self
*/
Expand Down Expand Up @@ -638,7 +662,7 @@ public function getEffect()
/**
* Sets effect
*
* @param string|null $effect A motion effect to apply to the Clip. <ul> <li>`zoomIn` - slow zoom in</li> <li>`zoomOut` - slow zoom out</li> <li>`slideLeft` - slow slide (pan) left</li> <li>`slideRight` - slow slide (pan) right</li> <li>`slideUp` - slow slide (pan) up</li> <li>`slideDown` - slow slide (pan) down</li> </ul>
* @param string|null $effect A motion effect to apply to the Clip. <ul> <li>`zoomIn` - slow zoom in</li> <li>`zoomOut` - slow zoom out</li> <li>`slideLeft` - slow slide (pan) left</li> <li>`slideRight` - slow slide (pan) right</li> <li>`slideUp` - slow slide (pan) up</li> <li>`slideDown` - slow slide (pan) down</li> </ul> The motion effect speed can also be controlled by appending `Fast` or `Slow` to the effect, e.g. `zoomInFast` or `slideRightSlow`.
*
* @return self
*/
Expand Down Expand Up @@ -672,7 +696,7 @@ public function getFilter()
/**
* Sets filter
*
* @param string|null $filter A filter effect to apply to the Clip. <ul> <li>`boost` - boost contrast and saturation</li> <li>`contrast` - increase contrast</li> <li>`darken` - darken the scene</li> <li>`greyscale` - remove colour</li> <li>`lighten` - lighten the scene</li> <li>`muted` - reduce saturation and contrast</li> <li>`invert` - invert colors</li> </ul>
* @param string|null $filter A filter effect to apply to the Clip. <ul> <li>`boost` - boost contrast and saturation</li> <li>`contrast` - increase contrast</li> <li>`darken` - darken the scene</li> <li>`greyscale` - remove colour</li> <li>`lighten` - lighten the scene</li> <li>`muted` - reduce saturation and contrast</li> <li>`negative` - negative colors</li> </ul>
*
* @return self
*/
Expand Down
14 changes: 7 additions & 7 deletions src/Model/Destinations.php
Original file line number Diff line number Diff line change
Expand Up @@ -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: &lt;ul&gt; &lt;li&gt;&lt;a href&#x3D;\&quot;#tocs_shotstackdestination\&quot;&gt;DestinationShotstack&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href&#x3D;\&quot;#tocs_muxdestination\&quot;&gt;DestinationMux&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;
* @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: &lt;ul&gt; &lt;li&gt;&lt;a href&#x3D;\&quot;#tocs_shotstackdestination\&quot;&gt;ShotstackDestination&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href&#x3D;\&quot;#tocs_muxdestination\&quot;&gt;MuxDestination&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href&#x3D;\&quot;#tocs_s3destination\&quot;&gt;S3Destination&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;
* @package Shotstack\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
Expand All @@ -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'
];

/**
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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
*/
Expand All @@ -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
*/
Expand All @@ -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()
{
Expand All @@ -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
*/
Expand Down
4 changes: 3 additions & 1 deletion src/Model/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ public function setCallback($callback)
* Gets disk
*
* @return string|null
* @deprecated
*/
public function getDisk()
{
Expand All @@ -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. <ul> <li>`local` - optimized for high speed rendering with up to 512MB storage</li> <li>`mount` - optimized for larger file sizes and longer videos with 5GB for source footage and 512MB for output render</li> </ul>
* @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. <ul> <li>`local` - optimized for high speed rendering with up to 512MB storage</li> <li>`mount` - optimized for larger file sizes and longer videos with 5GB for source footage and 512MB for output render</li> </ul>
*
* @return self
* @deprecated
*/
public function setDisk($disk)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Model/MuxDestination.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 &#x60;mux&#x60; 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
Expand Down
Loading

0 comments on commit 6924f47

Please sign in to comment.