shotstack 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +387 -23
- data/lib/shotstack/api/edit_api.rb +413 -7
- data/lib/shotstack/api/serve_api.rb +7 -7
- data/lib/shotstack/api_client.rb +1 -1
- data/lib/shotstack/api_error.rb +1 -1
- data/lib/shotstack/configuration.rb +1 -1
- data/lib/shotstack/models/asset.rb +2 -2
- data/lib/shotstack/models/asset_render_response.rb +6 -1
- data/lib/shotstack/models/asset_response.rb +6 -1
- data/lib/shotstack/models/asset_response_attributes.rb +27 -2
- data/lib/shotstack/models/asset_response_data.rb +11 -1
- data/lib/shotstack/models/audio_asset.rb +1 -3
- data/lib/shotstack/models/clip.rb +6 -12
- data/lib/shotstack/models/crop.rb +1 -1
- data/lib/shotstack/models/destinations.rb +7 -8
- data/lib/shotstack/models/edit.rb +2 -4
- data/lib/shotstack/models/flip_transformation.rb +1 -5
- data/lib/shotstack/models/font.rb +1 -1
- data/lib/shotstack/models/html_asset.rb +1 -5
- data/lib/shotstack/models/image_asset.rb +1 -1
- data/lib/shotstack/models/luma_asset.rb +1 -1
- data/lib/shotstack/models/merge_field.rb +1 -1
- data/lib/shotstack/models/mux_destination.rb +2 -2
- data/lib/shotstack/models/mux_destination_options.rb +1 -1
- data/lib/shotstack/models/offset.rb +23 -27
- data/lib/shotstack/models/output.rb +16 -9
- data/lib/shotstack/models/poster.rb +1 -1
- data/lib/shotstack/models/probe_response.rb +2 -2
- data/lib/shotstack/models/queued_response.rb +2 -2
- data/lib/shotstack/models/queued_response_data.rb +1 -1
- data/lib/shotstack/models/range.rb +1 -1
- data/lib/shotstack/models/render_response.rb +1 -1
- data/lib/shotstack/models/render_response_data.rb +3 -16
- data/lib/shotstack/models/rotate_transformation.rb +1 -3
- data/lib/shotstack/models/s3_destination.rb +236 -0
- data/lib/shotstack/models/s3_destination_options.rb +270 -0
- data/lib/shotstack/models/shotstack_destination.rb +3 -5
- data/lib/shotstack/models/size.rb +4 -4
- data/lib/shotstack/models/skew_transformation.rb +1 -5
- data/lib/shotstack/models/soundtrack.rb +1 -3
- data/lib/shotstack/models/template.rb +234 -0
- data/lib/shotstack/models/template_data_response.rb +254 -0
- data/lib/shotstack/models/template_data_response_data.rb +269 -0
- data/lib/shotstack/models/template_list_response.rb +254 -0
- data/lib/shotstack/models/template_list_response_data.rb +242 -0
- data/lib/shotstack/models/template_list_response_item.rb +260 -0
- data/lib/shotstack/models/template_render.rb +237 -0
- data/lib/shotstack/models/template_response.rb +254 -0
- data/lib/shotstack/models/template_response_data.rb +240 -0
- data/lib/shotstack/models/thumbnail.rb +1 -1
- data/lib/shotstack/models/timeline.rb +1 -5
- data/lib/shotstack/models/title_asset.rb +2 -8
- data/lib/shotstack/models/track.rb +1 -1
- data/lib/shotstack/models/transformation.rb +1 -1
- data/lib/shotstack/models/transition.rb +1 -1
- data/lib/shotstack/models/video_asset.rb +47 -3
- data/lib/shotstack/version.rb +2 -2
- data/lib/shotstack.rb +12 -1
- metadata +24 -12
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Shotstack
|
|
3
3
|
|
|
4
|
-
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation.
|
|
4
|
+
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation. There are two main API's, one for editing and generating assets (Edit API) and one for managing hosted assets (Serve API). The Edit API base URL is: <b>https://api.shotstack.io/{version}</b> The Serve API base URL is: <b>https://api.shotstack.io/serve/{version}</b>
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v1
|
|
7
7
|
|
|
@@ -22,29 +22,33 @@ module Shotstack
|
|
|
22
22
|
# The output resolution of the video or image. <ul> <li>`preview` - 512px x 288px @ 15fps</li> <li>`mobile` - 640px x 360px @ 25fps</li> <li>`sd` - 1024px x 576px @ 25fps</li> <li>`hd` - 1280px x 720px @ 25fps</li> <li>`1080` - 1920px x 1080px @ 25fps</li> </ul>
|
|
23
23
|
attr_accessor :resolution
|
|
24
24
|
|
|
25
|
-
# The aspect ratio (shape) of the video or image. Useful for social media output formats. Options are: <ul> <li>`16:9` - regular landscape/horizontal aspect ratio
|
|
25
|
+
# The aspect ratio (shape) of the video or image. Useful for social media output formats. Options are: <ul> <li>`16:9` (default) - regular landscape/horizontal aspect ratio</li> <li>`9:16` - vertical/portrait aspect ratio</li> <li>`1:1` - square aspect ratio</li> <li>`4:5` - short vertical/portrait aspect ratio</li> <li>`4:3` - legacy TV aspect ratio</li> </ul>
|
|
26
26
|
attr_accessor :aspect_ratio
|
|
27
27
|
|
|
28
28
|
attr_accessor :size
|
|
29
29
|
|
|
30
|
-
# Override the default frames per second. Useful for when the source footage is recorded at 30fps, i.e. on mobile devices. Lower frame rates can be used to add cinematic quality (24fps) or to create smaller file size/faster render times or animated gifs (12 or 15fps). Default is 25fps. <ul> <li>`12` - 12fps</li> <li>`15` - 15fps</li> <li>`24` - 24fps</li> <li>`23.976` - 23.976fps</li> <li>`25` - 25fps</li> <li>`29.97` - 29.97fps</li> <li>`30` - 30fps</li> </ul>
|
|
30
|
+
# Override the default frames per second. Useful for when the source footage is recorded at 30fps, i.e. on mobile devices. Lower frame rates can be used to add cinematic quality (24fps) or to create smaller file size/faster render times or animated gifs (12 or 15fps). Default is 25fps. <ul> <li>`12` - 12fps</li> <li>`15` - 15fps</li> <li>`24` - 24fps</li> <li>`23.976` - 23.976fps</li> <li>`25` (default) - 25fps</li> <li>`29.97` - 29.97fps</li> <li>`30` - 30fps</li> </ul>
|
|
31
31
|
attr_accessor :fps
|
|
32
32
|
|
|
33
33
|
# 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. <ul> <li>`preview` - 512px x 288px @ 15fps</li> <li>`mobile` - 640px x 360px @ 25fps</li> <li>`sd` - 1024px x 576px @25fps</li> <li>`hd` - 1280px x 720px @25fps</li> <li>`1080` - 1920px x 1080px @25fps</li> </ul>
|
|
34
34
|
attr_accessor :scale_to
|
|
35
35
|
|
|
36
|
-
# 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. <ul> <li>`low` - slightly reduced quality, smaller file size</li> <li>`medium` - optimized quality, render speeds and file size</li> <li>`high` - slightly increased quality, larger file size</li> </ul>
|
|
36
|
+
# 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. <ul> <li>`low` - slightly reduced quality, smaller file size</li> <li>`medium` (default) - optimized quality, render speeds and file size</li> <li>`high` - slightly increased quality, larger file size</li> </ul>
|
|
37
37
|
attr_accessor :quality
|
|
38
38
|
|
|
39
39
|
# Loop settings for gif files. Set to `true` to loop, `false` to play only once.
|
|
40
40
|
attr_accessor :repeat
|
|
41
41
|
|
|
42
|
+
# Mute the audio track of the output video. Set to `true` to mute, `false` to un-mute.
|
|
43
|
+
attr_accessor :mute
|
|
44
|
+
|
|
42
45
|
attr_accessor :range
|
|
43
46
|
|
|
44
47
|
attr_accessor :poster
|
|
45
48
|
|
|
46
49
|
attr_accessor :thumbnail
|
|
47
50
|
|
|
51
|
+
# Specify the storage locations and hosting services to send rendered videos to.
|
|
48
52
|
attr_accessor :destinations
|
|
49
53
|
|
|
50
54
|
class EnumAttributeValidator
|
|
@@ -80,6 +84,7 @@ module Shotstack
|
|
|
80
84
|
:'scale_to' => :'scaleTo',
|
|
81
85
|
:'quality' => :'quality',
|
|
82
86
|
:'repeat' => :'repeat',
|
|
87
|
+
:'mute' => :'mute',
|
|
83
88
|
:'range' => :'range',
|
|
84
89
|
:'poster' => :'poster',
|
|
85
90
|
:'thumbnail' => :'thumbnail',
|
|
@@ -103,6 +108,7 @@ module Shotstack
|
|
|
103
108
|
:'scale_to' => :'String',
|
|
104
109
|
:'quality' => :'String',
|
|
105
110
|
:'repeat' => :'Boolean',
|
|
111
|
+
:'mute' => :'Boolean',
|
|
106
112
|
:'range' => :'Range',
|
|
107
113
|
:'poster' => :'Poster',
|
|
108
114
|
:'thumbnail' => :'Thumbnail',
|
|
@@ -157,14 +163,14 @@ module Shotstack
|
|
|
157
163
|
|
|
158
164
|
if attributes.key?(:'quality')
|
|
159
165
|
self.quality = attributes[:'quality']
|
|
160
|
-
else
|
|
161
|
-
self.quality = 'medium'
|
|
162
166
|
end
|
|
163
167
|
|
|
164
168
|
if attributes.key?(:'repeat')
|
|
165
169
|
self.repeat = attributes[:'repeat']
|
|
166
|
-
|
|
167
|
-
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if attributes.key?(:'mute')
|
|
173
|
+
self.mute = attributes[:'mute']
|
|
168
174
|
end
|
|
169
175
|
|
|
170
176
|
if attributes.key?(:'range')
|
|
@@ -289,6 +295,7 @@ module Shotstack
|
|
|
289
295
|
scale_to == o.scale_to &&
|
|
290
296
|
quality == o.quality &&
|
|
291
297
|
repeat == o.repeat &&
|
|
298
|
+
mute == o.mute &&
|
|
292
299
|
range == o.range &&
|
|
293
300
|
poster == o.poster &&
|
|
294
301
|
thumbnail == o.thumbnail &&
|
|
@@ -304,7 +311,7 @@ module Shotstack
|
|
|
304
311
|
# Calculates hash code according to all attributes.
|
|
305
312
|
# @return [Integer] Hash code
|
|
306
313
|
def hash
|
|
307
|
-
[format, resolution, aspect_ratio, size, fps, scale_to, quality, repeat, range, poster, thumbnail, destinations].hash
|
|
314
|
+
[format, resolution, aspect_ratio, size, fps, scale_to, quality, repeat, mute, range, poster, thumbnail, destinations].hash
|
|
308
315
|
end
|
|
309
316
|
|
|
310
317
|
# Builds the object from hash
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Shotstack
|
|
3
3
|
|
|
4
|
-
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation.
|
|
4
|
+
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation. There are two main API's, one for editing and generating assets (Edit API) and one for managing hosted assets (Serve API). The Edit API base URL is: <b>https://api.shotstack.io/{version}</b> The Serve API base URL is: <b>https://api.shotstack.io/serve/{version}</b>
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v1
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Shotstack
|
|
3
3
|
|
|
4
|
-
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation.
|
|
4
|
+
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation. There are two main API's, one for editing and generating assets (Edit API) and one for managing hosted assets (Serve API). The Edit API base URL is: <b>https://api.shotstack.io/{version}</b> The Serve API base URL is: <b>https://api.shotstack.io/serve/{version}</b>
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v1
|
|
7
7
|
|
|
@@ -22,7 +22,7 @@ module Shotstack
|
|
|
22
22
|
# `Created`, `Bad Request` or an error message.
|
|
23
23
|
attr_accessor :message
|
|
24
24
|
|
|
25
|
-
# The response from FFprobe in JSON format
|
|
25
|
+
# The response from FFprobe in JSON format.
|
|
26
26
|
attr_accessor :response
|
|
27
27
|
|
|
28
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Shotstack
|
|
3
3
|
|
|
4
|
-
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation.
|
|
4
|
+
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation. There are two main API's, one for editing and generating assets (Edit API) and one for managing hosted assets (Serve API). The Edit API base URL is: <b>https://api.shotstack.io/{version}</b> The Serve API base URL is: <b>https://api.shotstack.io/serve/{version}</b>
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v1
|
|
7
7
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Shotstack
|
|
17
|
-
# The response received after a [render request](#render-asset) is submitted. The render task is queued for rendering and a unique render id is returned.
|
|
17
|
+
# The response received after a [render request](#render-asset) or [template render](#render-template) is submitted. The render task is queued for rendering and a unique render id is returned.
|
|
18
18
|
class QueuedResponse
|
|
19
19
|
# `true` if successfully queued, else `false`.
|
|
20
20
|
attr_accessor :success
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Shotstack
|
|
3
3
|
|
|
4
|
-
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation.
|
|
4
|
+
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation. There are two main API's, one for editing and generating assets (Edit API) and one for managing hosted assets (Serve API). The Edit API base URL is: <b>https://api.shotstack.io/{version}</b> The Serve API base URL is: <b>https://api.shotstack.io/serve/{version}</b>
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v1
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Shotstack
|
|
3
3
|
|
|
4
|
-
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation.
|
|
4
|
+
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation. There are two main API's, one for editing and generating assets (Edit API) and one for managing hosted assets (Serve API). The Edit API base URL is: <b>https://api.shotstack.io/{version}</b> The Serve API base URL is: <b>https://api.shotstack.io/serve/{version}</b>
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v1
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Shotstack
|
|
3
3
|
|
|
4
|
-
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation.
|
|
4
|
+
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation. There are two main API's, one for editing and generating assets (Edit API) and one for managing hosted assets (Serve API). The Edit API base URL is: <b>https://api.shotstack.io/{version}</b> The Serve API base URL is: <b>https://api.shotstack.io/serve/{version}</b>
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v1
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Shotstack
|
|
3
3
|
|
|
4
|
-
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation.
|
|
4
|
+
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation. There are two main API's, one for editing and generating assets (Edit API) and one for managing hosted assets (Serve API). The Edit API base URL is: <b>https://api.shotstack.io/{version}</b> The Serve API base URL is: <b>https://api.shotstack.io/serve/{version}</b>
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v1
|
|
7
7
|
|
|
@@ -122,6 +122,8 @@ module Shotstack
|
|
|
122
122
|
# List of attributes with nullable: true
|
|
123
123
|
def self.openapi_nullable
|
|
124
124
|
Set.new([
|
|
125
|
+
:'poster',
|
|
126
|
+
:'thumbnail',
|
|
125
127
|
])
|
|
126
128
|
end
|
|
127
129
|
|
|
@@ -209,18 +211,6 @@ module Shotstack
|
|
|
209
211
|
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
210
212
|
end
|
|
211
213
|
|
|
212
|
-
if @data.nil?
|
|
213
|
-
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
214
|
-
end
|
|
215
|
-
|
|
216
|
-
if @created.nil?
|
|
217
|
-
invalid_properties.push('invalid value for "created", created cannot be nil.')
|
|
218
|
-
end
|
|
219
|
-
|
|
220
|
-
if @updated.nil?
|
|
221
|
-
invalid_properties.push('invalid value for "updated", updated cannot be nil.')
|
|
222
|
-
end
|
|
223
|
-
|
|
224
214
|
invalid_properties
|
|
225
215
|
end
|
|
226
216
|
|
|
@@ -232,9 +222,6 @@ module Shotstack
|
|
|
232
222
|
return false if @status.nil?
|
|
233
223
|
status_validator = EnumAttributeValidator.new('String', ["queued", "fetching", "rendering", "saving", "done", "failed"])
|
|
234
224
|
return false unless status_validator.valid?(@status)
|
|
235
|
-
return false if @data.nil?
|
|
236
|
-
return false if @created.nil?
|
|
237
|
-
return false if @updated.nil?
|
|
238
225
|
true
|
|
239
226
|
end
|
|
240
227
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Shotstack
|
|
3
3
|
|
|
4
|
-
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation.
|
|
4
|
+
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation. There are two main API's, one for editing and generating assets (Edit API) and one for managing hosted assets (Serve API). The Edit API base URL is: <b>https://api.shotstack.io/{version}</b> The Serve API base URL is: <b>https://api.shotstack.io/serve/{version}</b>
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v1
|
|
7
7
|
|
|
@@ -61,8 +61,6 @@ module Shotstack
|
|
|
61
61
|
|
|
62
62
|
if attributes.key?(:'angle')
|
|
63
63
|
self.angle = attributes[:'angle']
|
|
64
|
-
else
|
|
65
|
-
self.angle = 0
|
|
66
64
|
end
|
|
67
65
|
end
|
|
68
66
|
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Shotstack
|
|
3
|
+
|
|
4
|
+
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation. There are two main API's, one for editing and generating assets (Edit API) and one for managing hosted assets (Serve API). The Edit API base URL is: <b>https://api.shotstack.io/{version}</b> The Serve API base URL is: <b>https://api.shotstack.io/serve/{version}</b>
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v1
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 5.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Shotstack
|
|
17
|
+
# 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.
|
|
18
|
+
class S3Destination
|
|
19
|
+
# The destination to send rendered assets to - set to `s3` for S3.
|
|
20
|
+
attr_accessor :provider
|
|
21
|
+
|
|
22
|
+
attr_accessor :options
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'provider' => :'provider',
|
|
28
|
+
:'options' => :'options'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns all the JSON keys this model knows about
|
|
33
|
+
def self.acceptable_attributes
|
|
34
|
+
attribute_map.values
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Attribute type mapping.
|
|
38
|
+
def self.openapi_types
|
|
39
|
+
{
|
|
40
|
+
:'provider' => :'String',
|
|
41
|
+
:'options' => :'S3DestinationOptions'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# List of attributes with nullable: true
|
|
46
|
+
def self.openapi_nullable
|
|
47
|
+
Set.new([
|
|
48
|
+
])
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Initializes the object
|
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
53
|
+
def initialize(attributes = {})
|
|
54
|
+
if (!attributes.is_a?(Hash))
|
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Shotstack::S3Destination` initialize method"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Shotstack::S3Destination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
62
|
+
end
|
|
63
|
+
h[k.to_sym] = v
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:'provider')
|
|
67
|
+
self.provider = attributes[:'provider']
|
|
68
|
+
else
|
|
69
|
+
self.provider = 's3'
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'options')
|
|
73
|
+
self.options = attributes[:'options']
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
78
|
+
# @return Array for valid properties with the reasons
|
|
79
|
+
def list_invalid_properties
|
|
80
|
+
invalid_properties = Array.new
|
|
81
|
+
if @provider.nil?
|
|
82
|
+
invalid_properties.push('invalid value for "provider", provider cannot be nil.')
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
invalid_properties
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Check to see if the all the properties in the model are valid
|
|
89
|
+
# @return true if the model is valid
|
|
90
|
+
def valid?
|
|
91
|
+
return false if @provider.nil?
|
|
92
|
+
true
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Checks equality by comparing each attribute.
|
|
96
|
+
# @param [Object] Object to be compared
|
|
97
|
+
def ==(o)
|
|
98
|
+
return true if self.equal?(o)
|
|
99
|
+
self.class == o.class &&
|
|
100
|
+
provider == o.provider &&
|
|
101
|
+
options == o.options
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# @see the `==` method
|
|
105
|
+
# @param [Object] Object to be compared
|
|
106
|
+
def eql?(o)
|
|
107
|
+
self == o
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Calculates hash code according to all attributes.
|
|
111
|
+
# @return [Integer] Hash code
|
|
112
|
+
def hash
|
|
113
|
+
[provider, options].hash
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Builds the object from hash
|
|
117
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
118
|
+
# @return [Object] Returns the model itself
|
|
119
|
+
def self.build_from_hash(attributes)
|
|
120
|
+
new.build_from_hash(attributes)
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Builds the object from hash
|
|
124
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
125
|
+
# @return [Object] Returns the model itself
|
|
126
|
+
def build_from_hash(attributes)
|
|
127
|
+
return nil unless attributes.is_a?(Hash)
|
|
128
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
129
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
130
|
+
self.send("#{key}=", nil)
|
|
131
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
132
|
+
# check to ensure the input is an array given that the attribute
|
|
133
|
+
# is documented as an array but the input is not
|
|
134
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
135
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
136
|
+
end
|
|
137
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
138
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
self
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Deserializes the data based on type
|
|
146
|
+
# @param string type Data type
|
|
147
|
+
# @param string value Value to be deserialized
|
|
148
|
+
# @return [Object] Deserialized data
|
|
149
|
+
def _deserialize(type, value)
|
|
150
|
+
case type.to_sym
|
|
151
|
+
when :Time
|
|
152
|
+
Time.parse(value)
|
|
153
|
+
when :Date
|
|
154
|
+
Date.parse(value)
|
|
155
|
+
when :String
|
|
156
|
+
value.to_s
|
|
157
|
+
when :Integer
|
|
158
|
+
value.to_i
|
|
159
|
+
when :Float
|
|
160
|
+
value.to_f
|
|
161
|
+
when :Boolean
|
|
162
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
163
|
+
true
|
|
164
|
+
else
|
|
165
|
+
false
|
|
166
|
+
end
|
|
167
|
+
when :Object
|
|
168
|
+
# generic object (usually a Hash), return directly
|
|
169
|
+
value
|
|
170
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
171
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
172
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
173
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
174
|
+
k_type = Regexp.last_match[:k_type]
|
|
175
|
+
v_type = Regexp.last_match[:v_type]
|
|
176
|
+
{}.tap do |hash|
|
|
177
|
+
value.each do |k, v|
|
|
178
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
else # model
|
|
182
|
+
# models (e.g. Pet) or oneOf
|
|
183
|
+
klass = Shotstack.const_get(type)
|
|
184
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Returns the string representation of the object
|
|
189
|
+
# @return [String] String presentation of the object
|
|
190
|
+
def to_s
|
|
191
|
+
to_hash.to_s
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
195
|
+
# @return [Hash] Returns the object in the form of hash
|
|
196
|
+
def to_body
|
|
197
|
+
to_hash
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Returns the object in the form of hash
|
|
201
|
+
# @return [Hash] Returns the object in the form of hash
|
|
202
|
+
def to_hash
|
|
203
|
+
hash = {}
|
|
204
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
205
|
+
value = self.send(attr)
|
|
206
|
+
if value.nil?
|
|
207
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
208
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
hash[param] = _to_hash(value)
|
|
212
|
+
end
|
|
213
|
+
hash
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Outputs non-array value in the form of hash
|
|
217
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
218
|
+
# @param [Object] value Any valid value
|
|
219
|
+
# @return [Hash] Returns the value in the form of hash
|
|
220
|
+
def _to_hash(value)
|
|
221
|
+
if value.is_a?(Array)
|
|
222
|
+
value.compact.map { |v| _to_hash(v) }
|
|
223
|
+
elsif value.is_a?(Hash)
|
|
224
|
+
{}.tap do |hash|
|
|
225
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
226
|
+
end
|
|
227
|
+
elsif value.respond_to? :to_hash
|
|
228
|
+
value.to_hash
|
|
229
|
+
else
|
|
230
|
+
value
|
|
231
|
+
end
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
end
|