shotstack 0.1.7 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1099 -11
- data/lib/shotstack/api/edit_api.rb +227 -0
- data/lib/shotstack/api/serve_api.rb +224 -0
- data/lib/shotstack/api_client.rb +4 -4
- data/lib/shotstack/api_error.rb +2 -2
- data/lib/shotstack/configuration.rb +24 -7
- data/lib/shotstack/models/asset_render_response.rb +222 -0
- data/lib/shotstack/models/asset_response.rb +219 -0
- data/lib/shotstack/models/asset_response_attributes.rb +334 -0
- data/lib/shotstack/models/asset_response_data.rb +229 -0
- data/lib/shotstack/models/audio_asset.rb +2 -2
- data/lib/shotstack/models/clip.rb +16 -7
- data/lib/shotstack/models/crop.rb +2 -2
- data/lib/shotstack/models/destinations.rb +17 -0
- data/lib/shotstack/models/edit.rb +17 -5
- data/lib/shotstack/models/flip_transformation.rb +234 -0
- data/lib/shotstack/models/font.rb +2 -2
- data/lib/shotstack/models/html_asset.rb +2 -2
- data/lib/shotstack/models/image_asset.rb +3 -3
- data/lib/shotstack/models/luma_asset.rb +5 -5
- data/lib/shotstack/models/merge_field.rb +236 -0
- data/lib/shotstack/models/offset.rb +2 -2
- data/lib/shotstack/models/output.rb +74 -22
- data/lib/shotstack/models/poster.rb +2 -2
- data/lib/shotstack/models/probe_response.rb +255 -0
- data/lib/shotstack/models/queued_response.rb +3 -2
- data/lib/shotstack/models/queued_response_data.rb +3 -2
- data/lib/shotstack/models/range.rb +4 -4
- data/lib/shotstack/models/render_response.rb +3 -2
- data/lib/shotstack/models/render_response_data.rb +7 -6
- data/lib/shotstack/models/rotate_transformation.rb +222 -0
- data/lib/shotstack/models/shotstack_destination.rb +240 -0
- data/lib/shotstack/models/size.rb +278 -0
- data/lib/shotstack/models/skew_transformation.rb +234 -0
- data/lib/shotstack/models/soundtrack.rb +2 -2
- data/lib/shotstack/models/thumbnail.rb +3 -3
- data/lib/shotstack/models/timeline.rb +3 -3
- data/lib/shotstack/models/title_asset.rb +2 -2
- data/lib/shotstack/models/track.rb +2 -2
- data/lib/shotstack/models/transformation.rb +237 -0
- data/lib/shotstack/models/transition.rb +8 -8
- data/lib/shotstack/models/video_asset.rb +2 -2
- data/lib/shotstack/version.rb +3 -3
- data/lib/shotstack.rb +16 -2
- data/shotstack.gemspec +3 -3
- metadata +32 -15
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Shotstack
|
3
3
|
|
4
|
-
#
|
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.gitbook.io/docs/guides/getting-started) 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
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -16,27 +16,38 @@ require 'time'
|
|
16
16
|
module Shotstack
|
17
17
|
# The output format, render range and type of media to generate.
|
18
18
|
class Output
|
19
|
-
# The output format and type of media file to generate. <ul> <li>`mp4` - mp4 video file</li> <li>`gif` - animated gif</li> <li>`mp3` - mp3 audio file (
|
19
|
+
# The output format and type of media file to generate. <ul> <li>`mp4` - mp4 video file</li> <li>`gif` - animated gif</li> <li>`jpg` - jpg image file</li> <li>`png` - png image file</li> <li>`bmp` - bmp image file</li> <li>`mp3` - mp3 audio file (audio only)</li> </ul>
|
20
20
|
attr_accessor :format
|
21
21
|
|
22
|
-
# The output resolution of the video. <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>
|
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. Useful for social media
|
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 (default)</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
|
+
|
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>
|
29
31
|
attr_accessor :fps
|
30
32
|
|
31
|
-
# Override the resolution and scale the video to render at a different size. When using scaleTo the
|
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>
|
32
34
|
attr_accessor :scale_to
|
33
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>
|
37
|
+
attr_accessor :quality
|
38
|
+
|
39
|
+
# Loop settings for gif files. Set to `true` to loop, `false` to play only once.
|
40
|
+
attr_accessor :repeat
|
41
|
+
|
34
42
|
attr_accessor :range
|
35
43
|
|
36
44
|
attr_accessor :poster
|
37
45
|
|
38
46
|
attr_accessor :thumbnail
|
39
47
|
|
48
|
+
# 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. [DestinationShotstack](/#tocs_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.
|
49
|
+
attr_accessor :destinations
|
50
|
+
|
40
51
|
class EnumAttributeValidator
|
41
52
|
attr_reader :datatype
|
42
53
|
attr_reader :allowable_values
|
@@ -65,11 +76,15 @@ module Shotstack
|
|
65
76
|
:'format' => :'format',
|
66
77
|
:'resolution' => :'resolution',
|
67
78
|
:'aspect_ratio' => :'aspectRatio',
|
79
|
+
:'size' => :'size',
|
68
80
|
:'fps' => :'fps',
|
69
81
|
:'scale_to' => :'scaleTo',
|
82
|
+
:'quality' => :'quality',
|
83
|
+
:'repeat' => :'repeat',
|
70
84
|
:'range' => :'range',
|
71
85
|
:'poster' => :'poster',
|
72
|
-
:'thumbnail' => :'thumbnail'
|
86
|
+
:'thumbnail' => :'thumbnail',
|
87
|
+
:'destinations' => :'destinations'
|
73
88
|
}
|
74
89
|
end
|
75
90
|
|
@@ -84,11 +99,15 @@ module Shotstack
|
|
84
99
|
:'format' => :'String',
|
85
100
|
:'resolution' => :'String',
|
86
101
|
:'aspect_ratio' => :'String',
|
87
|
-
:'
|
102
|
+
:'size' => :'Size',
|
103
|
+
:'fps' => :'Float',
|
88
104
|
:'scale_to' => :'String',
|
105
|
+
:'quality' => :'String',
|
106
|
+
:'repeat' => :'Boolean',
|
89
107
|
:'range' => :'Range',
|
90
108
|
:'poster' => :'Poster',
|
91
|
-
:'thumbnail' => :'Thumbnail'
|
109
|
+
:'thumbnail' => :'Thumbnail',
|
110
|
+
:'destinations' => :'Array<Destinations>'
|
92
111
|
}
|
93
112
|
end
|
94
113
|
|
@@ -125,16 +144,32 @@ module Shotstack
|
|
125
144
|
self.aspect_ratio = attributes[:'aspect_ratio']
|
126
145
|
end
|
127
146
|
|
147
|
+
if attributes.key?(:'size')
|
148
|
+
self.size = attributes[:'size']
|
149
|
+
end
|
150
|
+
|
128
151
|
if attributes.key?(:'fps')
|
129
152
|
self.fps = attributes[:'fps']
|
130
153
|
else
|
131
|
-
self.fps =
|
154
|
+
self.fps = FPS::N25
|
132
155
|
end
|
133
156
|
|
134
157
|
if attributes.key?(:'scale_to')
|
135
158
|
self.scale_to = attributes[:'scale_to']
|
136
159
|
end
|
137
160
|
|
161
|
+
if attributes.key?(:'quality')
|
162
|
+
self.quality = attributes[:'quality']
|
163
|
+
else
|
164
|
+
self.quality = 'medium'
|
165
|
+
end
|
166
|
+
|
167
|
+
if attributes.key?(:'repeat')
|
168
|
+
self.repeat = attributes[:'repeat']
|
169
|
+
else
|
170
|
+
self.repeat = true
|
171
|
+
end
|
172
|
+
|
138
173
|
if attributes.key?(:'range')
|
139
174
|
self.range = attributes[:'range']
|
140
175
|
end
|
@@ -146,6 +181,12 @@ module Shotstack
|
|
146
181
|
if attributes.key?(:'thumbnail')
|
147
182
|
self.thumbnail = attributes[:'thumbnail']
|
148
183
|
end
|
184
|
+
|
185
|
+
if attributes.key?(:'destinations')
|
186
|
+
if (value = attributes[:'destinations']).is_a?(Array)
|
187
|
+
self.destinations = value
|
188
|
+
end
|
189
|
+
end
|
149
190
|
end
|
150
191
|
|
151
192
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -156,10 +197,6 @@ module Shotstack
|
|
156
197
|
invalid_properties.push('invalid value for "format", format cannot be nil.')
|
157
198
|
end
|
158
199
|
|
159
|
-
if @resolution.nil?
|
160
|
-
invalid_properties.push('invalid value for "resolution", resolution cannot be nil.')
|
161
|
-
end
|
162
|
-
|
163
200
|
invalid_properties
|
164
201
|
end
|
165
202
|
|
@@ -169,15 +206,16 @@ module Shotstack
|
|
169
206
|
return false if @format.nil?
|
170
207
|
format_validator = EnumAttributeValidator.new('String', ["mp4", "gif", "mp3", "jpg", "png", "bmp"])
|
171
208
|
return false unless format_validator.valid?(@format)
|
172
|
-
return false if @resolution.nil?
|
173
209
|
resolution_validator = EnumAttributeValidator.new('String', ["preview", "mobile", "sd", "hd", "1080"])
|
174
210
|
return false unless resolution_validator.valid?(@resolution)
|
175
|
-
aspect_ratio_validator = EnumAttributeValidator.new('String', ["16:9", "9:16", "1:1", "4:5"])
|
211
|
+
aspect_ratio_validator = EnumAttributeValidator.new('String', ["16:9", "9:16", "1:1", "4:5", "4:3"])
|
176
212
|
return false unless aspect_ratio_validator.valid?(@aspect_ratio)
|
177
|
-
fps_validator = EnumAttributeValidator.new('
|
213
|
+
fps_validator = EnumAttributeValidator.new('Float', [12, 15, 23.976, 24, 25, 29.97, 30])
|
178
214
|
return false unless fps_validator.valid?(@fps)
|
179
215
|
scale_to_validator = EnumAttributeValidator.new('String', ["preview", "mobile", "sd", "hd", "1080"])
|
180
216
|
return false unless scale_to_validator.valid?(@scale_to)
|
217
|
+
quality_validator = EnumAttributeValidator.new('String', ["low", "medium", "high"])
|
218
|
+
return false unless quality_validator.valid?(@quality)
|
181
219
|
true
|
182
220
|
end
|
183
221
|
|
@@ -204,7 +242,7 @@ module Shotstack
|
|
204
242
|
# Custom attribute writer method checking allowed values (enum).
|
205
243
|
# @param [Object] aspect_ratio Object to be assigned
|
206
244
|
def aspect_ratio=(aspect_ratio)
|
207
|
-
validator = EnumAttributeValidator.new('String', ["16:9", "9:16", "1:1", "4:5"])
|
245
|
+
validator = EnumAttributeValidator.new('String', ["16:9", "9:16", "1:1", "4:5", "4:3"])
|
208
246
|
unless validator.valid?(aspect_ratio)
|
209
247
|
fail ArgumentError, "invalid value for \"aspect_ratio\", must be one of #{validator.allowable_values}."
|
210
248
|
end
|
@@ -214,7 +252,7 @@ module Shotstack
|
|
214
252
|
# Custom attribute writer method checking allowed values (enum).
|
215
253
|
# @param [Object] fps Object to be assigned
|
216
254
|
def fps=(fps)
|
217
|
-
validator = EnumAttributeValidator.new('
|
255
|
+
validator = EnumAttributeValidator.new('Float', [12, 15, 23.976, 24, 25, 29.97, 30])
|
218
256
|
unless validator.valid?(fps)
|
219
257
|
fail ArgumentError, "invalid value for \"fps\", must be one of #{validator.allowable_values}."
|
220
258
|
end
|
@@ -231,6 +269,16 @@ module Shotstack
|
|
231
269
|
@scale_to = scale_to
|
232
270
|
end
|
233
271
|
|
272
|
+
# Custom attribute writer method checking allowed values (enum).
|
273
|
+
# @param [Object] quality Object to be assigned
|
274
|
+
def quality=(quality)
|
275
|
+
validator = EnumAttributeValidator.new('String', ["low", "medium", "high"])
|
276
|
+
unless validator.valid?(quality)
|
277
|
+
fail ArgumentError, "invalid value for \"quality\", must be one of #{validator.allowable_values}."
|
278
|
+
end
|
279
|
+
@quality = quality
|
280
|
+
end
|
281
|
+
|
234
282
|
# Checks equality by comparing each attribute.
|
235
283
|
# @param [Object] Object to be compared
|
236
284
|
def ==(o)
|
@@ -239,11 +287,15 @@ module Shotstack
|
|
239
287
|
format == o.format &&
|
240
288
|
resolution == o.resolution &&
|
241
289
|
aspect_ratio == o.aspect_ratio &&
|
290
|
+
size == o.size &&
|
242
291
|
fps == o.fps &&
|
243
292
|
scale_to == o.scale_to &&
|
293
|
+
quality == o.quality &&
|
294
|
+
repeat == o.repeat &&
|
244
295
|
range == o.range &&
|
245
296
|
poster == o.poster &&
|
246
|
-
thumbnail == o.thumbnail
|
297
|
+
thumbnail == o.thumbnail &&
|
298
|
+
destinations == o.destinations
|
247
299
|
end
|
248
300
|
|
249
301
|
# @see the `==` method
|
@@ -255,7 +307,7 @@ module Shotstack
|
|
255
307
|
# Calculates hash code according to all attributes.
|
256
308
|
# @return [Integer] Hash code
|
257
309
|
def hash
|
258
|
-
[format, resolution, aspect_ratio, fps, scale_to, range, poster, thumbnail].hash
|
310
|
+
[format, resolution, aspect_ratio, size, fps, scale_to, quality, repeat, range, poster, thumbnail, destinations].hash
|
259
311
|
end
|
260
312
|
|
261
313
|
# Builds the object from hash
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Shotstack
|
3
3
|
|
4
|
-
#
|
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.gitbook.io/docs/guides/getting-started) 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
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -0,0 +1,255 @@
|
|
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.gitbook.io/docs/guides/getting-started) 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
|
+
# The response received after a [probe request](#inspect-media) is submitted. The probe requests returns data from FFprobe formatted as JSON.
|
18
|
+
class ProbeResponse
|
19
|
+
# `true` if media successfully read, else `false`.
|
20
|
+
attr_accessor :success
|
21
|
+
|
22
|
+
# `Created`, `Bad Request` or an error message.
|
23
|
+
attr_accessor :message
|
24
|
+
|
25
|
+
# The response from FFprobe in JSON format
|
26
|
+
attr_accessor :response
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'success' => :'success',
|
32
|
+
:'message' => :'message',
|
33
|
+
:'response' => :'response'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Returns all the JSON keys this model knows about
|
38
|
+
def self.acceptable_attributes
|
39
|
+
attribute_map.values
|
40
|
+
end
|
41
|
+
|
42
|
+
# Attribute type mapping.
|
43
|
+
def self.openapi_types
|
44
|
+
{
|
45
|
+
:'success' => :'Boolean',
|
46
|
+
:'message' => :'String',
|
47
|
+
:'response' => :'Object'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# List of attributes with nullable: true
|
52
|
+
def self.openapi_nullable
|
53
|
+
Set.new([
|
54
|
+
])
|
55
|
+
end
|
56
|
+
|
57
|
+
# Initializes the object
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
59
|
+
def initialize(attributes = {})
|
60
|
+
if (!attributes.is_a?(Hash))
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Shotstack::ProbeResponse` initialize method"
|
62
|
+
end
|
63
|
+
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
66
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Shotstack::ProbeResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
68
|
+
end
|
69
|
+
h[k.to_sym] = v
|
70
|
+
}
|
71
|
+
|
72
|
+
if attributes.key?(:'success')
|
73
|
+
self.success = attributes[:'success']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.key?(:'message')
|
77
|
+
self.message = attributes[:'message']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'response')
|
81
|
+
self.response = attributes[:'response']
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
86
|
+
# @return Array for valid properties with the reasons
|
87
|
+
def list_invalid_properties
|
88
|
+
invalid_properties = Array.new
|
89
|
+
if @success.nil?
|
90
|
+
invalid_properties.push('invalid value for "success", success cannot be nil.')
|
91
|
+
end
|
92
|
+
|
93
|
+
if @message.nil?
|
94
|
+
invalid_properties.push('invalid value for "message", message cannot be nil.')
|
95
|
+
end
|
96
|
+
|
97
|
+
if @response.nil?
|
98
|
+
invalid_properties.push('invalid value for "response", response cannot be nil.')
|
99
|
+
end
|
100
|
+
|
101
|
+
invalid_properties
|
102
|
+
end
|
103
|
+
|
104
|
+
# Check to see if the all the properties in the model are valid
|
105
|
+
# @return true if the model is valid
|
106
|
+
def valid?
|
107
|
+
return false if @success.nil?
|
108
|
+
return false if @message.nil?
|
109
|
+
return false if @response.nil?
|
110
|
+
true
|
111
|
+
end
|
112
|
+
|
113
|
+
# Checks equality by comparing each attribute.
|
114
|
+
# @param [Object] Object to be compared
|
115
|
+
def ==(o)
|
116
|
+
return true if self.equal?(o)
|
117
|
+
self.class == o.class &&
|
118
|
+
success == o.success &&
|
119
|
+
message == o.message &&
|
120
|
+
response == o.response
|
121
|
+
end
|
122
|
+
|
123
|
+
# @see the `==` method
|
124
|
+
# @param [Object] Object to be compared
|
125
|
+
def eql?(o)
|
126
|
+
self == o
|
127
|
+
end
|
128
|
+
|
129
|
+
# Calculates hash code according to all attributes.
|
130
|
+
# @return [Integer] Hash code
|
131
|
+
def hash
|
132
|
+
[success, message, response].hash
|
133
|
+
end
|
134
|
+
|
135
|
+
# Builds the object from hash
|
136
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
137
|
+
# @return [Object] Returns the model itself
|
138
|
+
def self.build_from_hash(attributes)
|
139
|
+
new.build_from_hash(attributes)
|
140
|
+
end
|
141
|
+
|
142
|
+
# Builds the object from hash
|
143
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
144
|
+
# @return [Object] Returns the model itself
|
145
|
+
def build_from_hash(attributes)
|
146
|
+
return nil unless attributes.is_a?(Hash)
|
147
|
+
self.class.openapi_types.each_pair do |key, type|
|
148
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
149
|
+
self.send("#{key}=", nil)
|
150
|
+
elsif type =~ /\AArray<(.*)>/i
|
151
|
+
# check to ensure the input is an array given that the attribute
|
152
|
+
# is documented as an array but the input is not
|
153
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
154
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
155
|
+
end
|
156
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
157
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
self
|
162
|
+
end
|
163
|
+
|
164
|
+
# Deserializes the data based on type
|
165
|
+
# @param string type Data type
|
166
|
+
# @param string value Value to be deserialized
|
167
|
+
# @return [Object] Deserialized data
|
168
|
+
def _deserialize(type, value)
|
169
|
+
case type.to_sym
|
170
|
+
when :Time
|
171
|
+
Time.parse(value)
|
172
|
+
when :Date
|
173
|
+
Date.parse(value)
|
174
|
+
when :String
|
175
|
+
value.to_s
|
176
|
+
when :Integer
|
177
|
+
value.to_i
|
178
|
+
when :Float
|
179
|
+
value.to_f
|
180
|
+
when :Boolean
|
181
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
182
|
+
true
|
183
|
+
else
|
184
|
+
false
|
185
|
+
end
|
186
|
+
when :Object
|
187
|
+
# generic object (usually a Hash), return directly
|
188
|
+
value
|
189
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
190
|
+
inner_type = Regexp.last_match[:inner_type]
|
191
|
+
value.map { |v| _deserialize(inner_type, v) }
|
192
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
193
|
+
k_type = Regexp.last_match[:k_type]
|
194
|
+
v_type = Regexp.last_match[:v_type]
|
195
|
+
{}.tap do |hash|
|
196
|
+
value.each do |k, v|
|
197
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
198
|
+
end
|
199
|
+
end
|
200
|
+
else # model
|
201
|
+
# models (e.g. Pet) or oneOf
|
202
|
+
klass = Shotstack.const_get(type)
|
203
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
# Returns the string representation of the object
|
208
|
+
# @return [String] String presentation of the object
|
209
|
+
def to_s
|
210
|
+
to_hash.to_s
|
211
|
+
end
|
212
|
+
|
213
|
+
# to_body is an alias to to_hash (backward compatibility)
|
214
|
+
# @return [Hash] Returns the object in the form of hash
|
215
|
+
def to_body
|
216
|
+
to_hash
|
217
|
+
end
|
218
|
+
|
219
|
+
# Returns the object in the form of hash
|
220
|
+
# @return [Hash] Returns the object in the form of hash
|
221
|
+
def to_hash
|
222
|
+
hash = {}
|
223
|
+
self.class.attribute_map.each_pair do |attr, param|
|
224
|
+
value = self.send(attr)
|
225
|
+
if value.nil?
|
226
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
227
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
228
|
+
end
|
229
|
+
|
230
|
+
hash[param] = _to_hash(value)
|
231
|
+
end
|
232
|
+
hash
|
233
|
+
end
|
234
|
+
|
235
|
+
# Outputs non-array value in the form of hash
|
236
|
+
# For object, use to_hash. Otherwise, just return the value
|
237
|
+
# @param [Object] value Any valid value
|
238
|
+
# @return [Hash] Returns the value in the form of hash
|
239
|
+
def _to_hash(value)
|
240
|
+
if value.is_a?(Array)
|
241
|
+
value.compact.map { |v| _to_hash(v) }
|
242
|
+
elsif value.is_a?(Hash)
|
243
|
+
{}.tap do |hash|
|
244
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
245
|
+
end
|
246
|
+
elsif value.respond_to? :to_hash
|
247
|
+
value.to_hash
|
248
|
+
else
|
249
|
+
value
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
end
|
254
|
+
|
255
|
+
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Shotstack
|
3
3
|
|
4
|
-
#
|
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.gitbook.io/docs/guides/getting-started) 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
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -14,6 +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
18
|
class QueuedResponse
|
18
19
|
# `true` if successfully queued, else `false`.
|
19
20
|
attr_accessor :success
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Shotstack
|
3
3
|
|
4
|
-
#
|
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.gitbook.io/docs/guides/getting-started) 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
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -14,6 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Shotstack
|
17
|
+
# The response data returned with the [QueuedResponse](#tocs_queuedresponse).
|
17
18
|
class QueuedResponseData
|
18
19
|
# Success response message or error details.
|
19
20
|
attr_accessor :message
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Shotstack
|
3
3
|
|
4
|
-
#
|
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.gitbook.io/docs/guides/getting-started) 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
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -14,12 +14,12 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Shotstack
|
17
|
-
# 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.
|
17
|
+
# 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.
|
18
18
|
class Range
|
19
19
|
# The point on the timeline, in seconds, to start the render from - i.e. start at second 3.
|
20
20
|
attr_accessor :start
|
21
21
|
|
22
|
-
# The length of the portion of the video to render - i.e. render 6 seconds of the video.
|
22
|
+
# The length of the portion of the video or audio to render - i.e. render 6 seconds of the video.
|
23
23
|
attr_accessor :length
|
24
24
|
|
25
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Shotstack
|
3
3
|
|
4
|
-
#
|
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.gitbook.io/docs/guides/getting-started) 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
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -14,6 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Shotstack
|
17
|
+
# The response received after a [render status request](#get-render-status) is submitted. The response includes details about status of a render and the output URL.
|
17
18
|
class RenderResponse
|
18
19
|
# `true` if status available, else `false`.
|
19
20
|
attr_accessor :success
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Shotstack
|
3
3
|
|
4
|
-
#
|
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.gitbook.io/docs/guides/getting-started) 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
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -14,6 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Shotstack
|
17
|
+
# The response data returned with the [RenderResponse](#tocs_renderresponse) including status and URL.
|
17
18
|
class RenderResponseData
|
18
19
|
# The id of the render task in UUID format.
|
19
20
|
attr_accessor :id
|
@@ -24,19 +25,19 @@ module Shotstack
|
|
24
25
|
# The customer subscription plan.
|
25
26
|
attr_accessor :plan
|
26
27
|
|
27
|
-
# The status of the render task. <ul> <li>`queued` - render is queued waiting to be rendered</li> <li>`fetching` - assets are being fetched</li> <li>`rendering` - the
|
28
|
+
# The status of the render task. <ul> <li>`queued` - render is queued waiting to be rendered</li> <li>`fetching` - assets are being fetched</li> <li>`rendering` - the asset is being rendered</li> <li>`saving` - the final asset is being saved to storage</li> <li>`done` - the asset is ready to be downloaded</li> <li>`failed` - there was an error rendering the asset</li> </ul>
|
28
29
|
attr_accessor :status
|
29
30
|
|
30
31
|
# An error message, only displayed if an error occurred.
|
31
32
|
attr_accessor :error
|
32
33
|
|
33
|
-
# The output video length in seconds.
|
34
|
+
# The output video or audio length in seconds.
|
34
35
|
attr_accessor :duration
|
35
36
|
|
36
|
-
# The time taken to render the
|
37
|
+
# The time taken to render the asset in milliseconds.
|
37
38
|
attr_accessor :render_time
|
38
39
|
|
39
|
-
# The URL of the final
|
40
|
+
# The URL of the final asset. This will only be available if status is done. This is a temporary URL and will be deleted after 24 hours. By default all assets are copied to the Shotstack hosting and CDN destination.
|
40
41
|
attr_accessor :url
|
41
42
|
|
42
43
|
# The URL of the poster image if requested. This will only be available if status is done.
|