Skip to content

Commit 6464b39

Browse files
committed
Add luma asset and mulitple tweaks
1 parent 772af69 commit 6464b39

File tree

6 files changed

+1204
-13
lines changed

6 files changed

+1204
-13
lines changed

src/Model/Clip.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ public function getModelName()
212212
const FIT_COVER = 'cover';
213213
const FIT_CONTAIN = 'contain';
214214
const FIT_CROP = 'crop';
215+
const FIT_NONE = 'none';
215216
const POSITION_TOP = 'top';
216217
const POSITION_TOP_RIGHT = 'topRight';
217218
const POSITION_RIGHT = 'right';
@@ -248,6 +249,7 @@ public function getFitAllowableValues()
248249
self::FIT_COVER,
249250
self::FIT_CONTAIN,
250251
self::FIT_CROP,
252+
self::FIT_NONE,
251253
];
252254
}
253255

@@ -485,7 +487,7 @@ public function getFit()
485487
/**
486488
* Sets fit
487489
*
488-
* @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` - 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> </ul>
490+
* @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` - 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>
489491
*
490492
* @return $this
491493
*/

src/Model/LumaAsset.php

Lines changed: 374 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,374 @@
1+
<?php
2+
/**
3+
* LumaAsset
4+
*
5+
* PHP version 5
6+
*
7+
* @category Class
8+
* @package Shotstack\Client
9+
* @author OpenAPI Generator team
10+
* @link https://openapi-generator.tech
11+
*/
12+
13+
/**
14+
* Shotstack
15+
*
16+
* The Shotstack API is a video editing service that allows for the automated creation of videos using JSON. You can configure an edit and POST it to the Shotstack API which will render your video and provide a file location when complete. For more details check https://shotstack.io
17+
*
18+
* The version of the OpenAPI document: v1
19+
*
20+
* Generated by: https://openapi-generator.tech
21+
* OpenAPI Generator version: 4.2.1
22+
*/
23+
24+
/**
25+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26+
* https://openapi-generator.tech
27+
* Do not edit the class manually.
28+
*/
29+
30+
namespace Shotstack\Client\Model;
31+
32+
use \ArrayAccess;
33+
use \Shotstack\Client\ObjectSerializer;
34+
35+
/**
36+
* LumaAsset Class Doc Comment
37+
*
38+
* @category Class
39+
* @description The LumaAsset is used to create luma matte transitions between other assets. A luma matte is a grey scale animated video where the black areas are transparent and the white areas solid. The luma matte animation should be provided as an mp4 video file. The src must be a publicly accessible URL to the file.
40+
* @package Shotstack\Client
41+
* @author OpenAPI Generator team
42+
* @link https://openapi-generator.tech
43+
*/
44+
class LumaAsset extends Asset implements ModelInterface, ArrayAccess
45+
{
46+
const DISCRIMINATOR = null;
47+
48+
/**
49+
* The original name of the model.
50+
*
51+
* @var string
52+
*/
53+
protected static $openAPIModelName = 'LumaAsset';
54+
55+
/**
56+
* Array of property to type mappings. Used for (de)serialization
57+
*
58+
* @var string[]
59+
*/
60+
protected static $openAPITypes = [
61+
'type' => 'string',
62+
'src' => 'string',
63+
'trim' => 'float'
64+
];
65+
66+
/**
67+
* Array of property to format mappings. Used for (de)serialization
68+
*
69+
* @var string[]
70+
*/
71+
protected static $openAPIFormats = [
72+
'type' => null,
73+
'src' => null,
74+
'trim' => null
75+
];
76+
77+
/**
78+
* Array of property to type mappings. Used for (de)serialization
79+
*
80+
* @return array
81+
*/
82+
public static function openAPITypes()
83+
{
84+
return self::$openAPITypes;
85+
}
86+
87+
/**
88+
* Array of property to format mappings. Used for (de)serialization
89+
*
90+
* @return array
91+
*/
92+
public static function openAPIFormats()
93+
{
94+
return self::$openAPIFormats;
95+
}
96+
97+
/**
98+
* Array of attributes where the key is the local name,
99+
* and the value is the original name
100+
*
101+
* @var string[]
102+
*/
103+
protected static $attributeMap = [
104+
'type' => 'type',
105+
'src' => 'src',
106+
'trim' => 'trim'
107+
];
108+
109+
/**
110+
* Array of attributes to setter functions (for deserialization of responses)
111+
*
112+
* @var string[]
113+
*/
114+
protected static $setters = [
115+
'type' => 'setType',
116+
'src' => 'setSrc',
117+
'trim' => 'setTrim'
118+
];
119+
120+
/**
121+
* Array of attributes to getter functions (for serialization of requests)
122+
*
123+
* @var string[]
124+
*/
125+
protected static $getters = [
126+
'type' => 'getType',
127+
'src' => 'getSrc',
128+
'trim' => 'getTrim'
129+
];
130+
131+
/**
132+
* Array of attributes where the key is the local name,
133+
* and the value is the original name
134+
*
135+
* @return array
136+
*/
137+
public static function attributeMap()
138+
{
139+
return self::$attributeMap;
140+
}
141+
142+
/**
143+
* Array of attributes to setter functions (for deserialization of responses)
144+
*
145+
* @return array
146+
*/
147+
public static function setters()
148+
{
149+
return self::$setters;
150+
}
151+
152+
/**
153+
* Array of attributes to getter functions (for serialization of requests)
154+
*
155+
* @return array
156+
*/
157+
public static function getters()
158+
{
159+
return self::$getters;
160+
}
161+
162+
/**
163+
* The original name of the model.
164+
*
165+
* @return string
166+
*/
167+
public function getModelName()
168+
{
169+
return self::$openAPIModelName;
170+
}
171+
172+
173+
174+
175+
176+
/**
177+
* Associative array for storing property values
178+
*
179+
* @var mixed[]
180+
*/
181+
protected $container = [];
182+
183+
/**
184+
* Constructor
185+
*
186+
* @param mixed[] $data Associated array of property values
187+
* initializing the model
188+
*/
189+
public function __construct(array $data = null)
190+
{
191+
$this->container['type'] = isset($data['type']) ? $data['type'] : 'luma';
192+
$this->container['src'] = isset($data['src']) ? $data['src'] : null;
193+
$this->container['trim'] = isset($data['trim']) ? $data['trim'] : null;
194+
}
195+
196+
/**
197+
* Show all the invalid properties with reasons.
198+
*
199+
* @return array invalid properties with reasons
200+
*/
201+
public function listInvalidProperties()
202+
{
203+
$invalidProperties = [];
204+
205+
if ($this->container['type'] === null) {
206+
$invalidProperties[] = "'type' can't be null";
207+
}
208+
if ($this->container['src'] === null) {
209+
$invalidProperties[] = "'src' can't be null";
210+
}
211+
return $invalidProperties;
212+
}
213+
214+
/**
215+
* Validate all the properties in the model
216+
* return true if all passed
217+
*
218+
* @return bool True if all properties are valid
219+
*/
220+
public function valid()
221+
{
222+
return count($this->listInvalidProperties()) === 0;
223+
}
224+
225+
226+
/**
227+
* Gets type
228+
*
229+
* @return string
230+
*/
231+
public function getType()
232+
{
233+
return $this->container['type'];
234+
}
235+
236+
/**
237+
* Sets type
238+
*
239+
* @param string $type The type of asset - set to <b>luma</b> for luma mattes.
240+
*
241+
* @return $this
242+
*/
243+
public function setType($type)
244+
{
245+
$this->container['type'] = $type;
246+
247+
return $this;
248+
}
249+
250+
/**
251+
* Gets src
252+
*
253+
* @return string
254+
*/
255+
public function getSrc()
256+
{
257+
return $this->container['src'];
258+
}
259+
260+
/**
261+
* Sets src
262+
*
263+
* @param string $src The luma matte video source URL. The URL must be publicly accessible or include credentials.
264+
*
265+
* @return $this
266+
*/
267+
public function setSrc($src)
268+
{
269+
$this->container['src'] = $src;
270+
271+
return $this;
272+
}
273+
274+
/**
275+
* Gets trim
276+
*
277+
* @return float|null
278+
*/
279+
public function getTrim()
280+
{
281+
return $this->container['trim'];
282+
}
283+
284+
/**
285+
* Sets trim
286+
*
287+
* @param float|null $trim The start trim point of the luma video clip, in seconds (defaults to 0). Videos will start from the in trim point. The luma matte video will play until the file ends or the Clip length is reached.
288+
*
289+
* @return $this
290+
*/
291+
public function setTrim($trim)
292+
{
293+
$this->container['trim'] = $trim;
294+
295+
return $this;
296+
}
297+
/**
298+
* Returns true if offset exists. False otherwise.
299+
*
300+
* @param integer $offset Offset
301+
*
302+
* @return boolean
303+
*/
304+
public function offsetExists($offset)
305+
{
306+
return isset($this->container[$offset]);
307+
}
308+
309+
/**
310+
* Gets offset.
311+
*
312+
* @param integer $offset Offset
313+
*
314+
* @return mixed
315+
*/
316+
public function offsetGet($offset)
317+
{
318+
return isset($this->container[$offset]) ? $this->container[$offset] : null;
319+
}
320+
321+
/**
322+
* Sets value based on offset.
323+
*
324+
* @param integer $offset Offset
325+
* @param mixed $value Value to be set
326+
*
327+
* @return void
328+
*/
329+
public function offsetSet($offset, $value)
330+
{
331+
if (is_null($offset)) {
332+
$this->container[] = $value;
333+
} else {
334+
$this->container[$offset] = $value;
335+
}
336+
}
337+
338+
/**
339+
* Unsets offset.
340+
*
341+
* @param integer $offset Offset
342+
*
343+
* @return void
344+
*/
345+
public function offsetUnset($offset)
346+
{
347+
unset($this->container[$offset]);
348+
}
349+
350+
/**
351+
* Gets the string presentation of the object
352+
*
353+
* @return string
354+
*/
355+
public function __toString()
356+
{
357+
return json_encode(
358+
ObjectSerializer::sanitizeForSerialization($this),
359+
JSON_PRETTY_PRINT
360+
);
361+
}
362+
363+
/**
364+
* Gets a header-safe presentation of the object
365+
*
366+
* @return string
367+
*/
368+
public function toHeaderValue()
369+
{
370+
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
371+
}
372+
}
373+
374+

0 commit comments

Comments
 (0)