shotstack 0.1.1 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -12
- data/lib/shotstack.rb +4 -2
- data/lib/shotstack/api/endpoints_api.rb +21 -12
- data/lib/shotstack/api_client.rb +50 -46
- data/lib/shotstack/api_error.rb +2 -2
- data/lib/shotstack/configuration.rb +36 -9
- data/lib/shotstack/models/audio_asset.rb +71 -13
- data/lib/shotstack/models/clip.rb +25 -11
- data/lib/shotstack/models/crop.rb +346 -0
- data/lib/shotstack/models/edit.rb +71 -13
- data/lib/shotstack/models/font.rb +21 -9
- data/lib/shotstack/models/html_asset.rb +28 -16
- data/lib/shotstack/models/image_asset.rb +35 -14
- data/lib/shotstack/models/luma_asset.rb +21 -9
- data/lib/shotstack/models/offset.rb +24 -8
- data/lib/shotstack/models/output.rb +61 -16
- data/lib/shotstack/models/poster.rb +20 -8
- data/lib/shotstack/models/queued_response.rb +22 -8
- data/lib/shotstack/models/queued_response_data.rb +22 -10
- data/lib/shotstack/models/range.rb +260 -0
- data/lib/shotstack/models/render_response.rb +22 -8
- data/lib/shotstack/models/render_response_data.rb +101 -29
- data/lib/shotstack/models/soundtrack.rb +23 -9
- data/lib/shotstack/models/thumbnail.rb +20 -8
- data/lib/shotstack/models/timeline.rb +36 -12
- data/lib/shotstack/models/title_asset.rb +25 -13
- data/lib/shotstack/models/track.rb +20 -8
- data/lib/shotstack/models/transition.rb +26 -14
- data/lib/shotstack/models/video_asset.rb +34 -13
- data/lib/shotstack/version.rb +3 -3
- data/shotstack.gemspec +8 -9
- metadata +11 -30
- data/shotstack-0.0.11.gem +0 -0
- data/shotstack-0.1.0.gem +0 -0
@@ -1,21 +1,24 @@
|
|
1
1
|
=begin
|
2
2
|
#Shotstack
|
3
3
|
|
4
|
-
#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
|
4
|
+
#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 visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.gitbook.io/docs/guides/getting-started) documentation.
|
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:
|
9
|
+
OpenAPI Generator version: 5.0.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module Shotstack
|
16
17
|
class RenderResponse
|
18
|
+
# `true` if status available, else `false`.
|
17
19
|
attr_accessor :success
|
18
20
|
|
21
|
+
# `OK` or an error message.
|
19
22
|
attr_accessor :message
|
20
23
|
|
21
24
|
attr_accessor :response
|
@@ -29,6 +32,11 @@ module Shotstack
|
|
29
32
|
}
|
30
33
|
end
|
31
34
|
|
35
|
+
# Returns all the JSON keys this model knows about
|
36
|
+
def self.acceptable_attributes
|
37
|
+
attribute_map.values
|
38
|
+
end
|
39
|
+
|
32
40
|
# Attribute type mapping.
|
33
41
|
def self.openapi_types
|
34
42
|
{
|
@@ -135,7 +143,9 @@ module Shotstack
|
|
135
143
|
def build_from_hash(attributes)
|
136
144
|
return nil unless attributes.is_a?(Hash)
|
137
145
|
self.class.openapi_types.each_pair do |key, type|
|
138
|
-
if
|
146
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
147
|
+
self.send("#{key}=", nil)
|
148
|
+
elsif type =~ /\AArray<(.*)>/i
|
139
149
|
# check to ensure the input is an array given that the attribute
|
140
150
|
# is documented as an array but the input is not
|
141
151
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -143,7 +153,7 @@ module Shotstack
|
|
143
153
|
end
|
144
154
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
145
155
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
146
|
-
end
|
156
|
+
end
|
147
157
|
end
|
148
158
|
|
149
159
|
self
|
@@ -155,8 +165,8 @@ module Shotstack
|
|
155
165
|
# @return [Object] Deserialized data
|
156
166
|
def _deserialize(type, value)
|
157
167
|
case type.to_sym
|
158
|
-
when :
|
159
|
-
|
168
|
+
when :Time
|
169
|
+
Time.parse(value)
|
160
170
|
when :Date
|
161
171
|
Date.parse(value)
|
162
172
|
when :String
|
@@ -186,7 +196,9 @@ module Shotstack
|
|
186
196
|
end
|
187
197
|
end
|
188
198
|
else # model
|
189
|
-
|
199
|
+
# models (e.g. Pet) or oneOf
|
200
|
+
klass = Shotstack.const_get(type)
|
201
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
190
202
|
end
|
191
203
|
end
|
192
204
|
|
@@ -212,7 +224,7 @@ module Shotstack
|
|
212
224
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
213
225
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
214
226
|
end
|
215
|
-
|
227
|
+
|
216
228
|
hash[param] = _to_hash(value)
|
217
229
|
end
|
218
230
|
hash
|
@@ -235,5 +247,7 @@ module Shotstack
|
|
235
247
|
value
|
236
248
|
end
|
237
249
|
end
|
250
|
+
|
238
251
|
end
|
252
|
+
|
239
253
|
end
|
@@ -1,37 +1,56 @@
|
|
1
1
|
=begin
|
2
2
|
#Shotstack
|
3
3
|
|
4
|
-
#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
|
4
|
+
#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 visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.gitbook.io/docs/guides/getting-started) documentation.
|
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:
|
9
|
+
OpenAPI Generator version: 5.0.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module Shotstack
|
16
17
|
class RenderResponseData
|
17
|
-
# The
|
18
|
-
attr_accessor :status
|
19
|
-
|
20
|
-
# The id of the render task in UUID format
|
18
|
+
# The id of the render task in UUID format.
|
21
19
|
attr_accessor :id
|
22
20
|
|
23
|
-
# The owner id of the render task
|
21
|
+
# The owner id of the render task.
|
24
22
|
attr_accessor :owner
|
25
23
|
|
24
|
+
# The customer subscription plan.
|
25
|
+
attr_accessor :plan
|
26
|
+
|
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 video is being rendered</li> <li>`saving` - the final video is being saved to storage</li> <li>`done` - the video is ready to be downloaded</li> <li>`failed` - there was an error rendering the video</li> </ul>
|
28
|
+
attr_accessor :status
|
29
|
+
|
30
|
+
# An error message, only displayed if an error occurred.
|
31
|
+
attr_accessor :error
|
32
|
+
|
33
|
+
# The output video length in seconds.
|
34
|
+
attr_accessor :duration
|
35
|
+
|
36
|
+
# The time taken to render the video in milliseconds.
|
37
|
+
attr_accessor :render_time
|
38
|
+
|
26
39
|
# The URL of the final video. This will only be available if status is done.
|
27
40
|
attr_accessor :url
|
28
41
|
|
42
|
+
# The URL of the poster image if requested. This will only be available if status is done.
|
43
|
+
attr_accessor :poster
|
44
|
+
|
45
|
+
# The URL of the thumbnail image if requested. This will only be available if status is done.
|
46
|
+
attr_accessor :thumbnail
|
47
|
+
|
29
48
|
attr_accessor :data
|
30
49
|
|
31
|
-
# The time the render task was initially queued
|
50
|
+
# The time the render task was initially queued.
|
32
51
|
attr_accessor :created
|
33
52
|
|
34
|
-
# The time the render status was last updated
|
53
|
+
# The time the render status was last updated.
|
35
54
|
attr_accessor :updated
|
36
55
|
|
37
56
|
class EnumAttributeValidator
|
@@ -59,23 +78,40 @@ module Shotstack
|
|
59
78
|
# Attribute mapping from ruby-style variable name to JSON key.
|
60
79
|
def self.attribute_map
|
61
80
|
{
|
62
|
-
:'status' => :'status',
|
63
81
|
:'id' => :'id',
|
64
82
|
:'owner' => :'owner',
|
83
|
+
:'plan' => :'plan',
|
84
|
+
:'status' => :'status',
|
85
|
+
:'error' => :'error',
|
86
|
+
:'duration' => :'duration',
|
87
|
+
:'render_time' => :'renderTime',
|
65
88
|
:'url' => :'url',
|
89
|
+
:'poster' => :'poster',
|
90
|
+
:'thumbnail' => :'thumbnail',
|
66
91
|
:'data' => :'data',
|
67
92
|
:'created' => :'created',
|
68
93
|
:'updated' => :'updated'
|
69
94
|
}
|
70
95
|
end
|
71
96
|
|
97
|
+
# Returns all the JSON keys this model knows about
|
98
|
+
def self.acceptable_attributes
|
99
|
+
attribute_map.values
|
100
|
+
end
|
101
|
+
|
72
102
|
# Attribute type mapping.
|
73
103
|
def self.openapi_types
|
74
104
|
{
|
75
|
-
:'status' => :'String',
|
76
105
|
:'id' => :'String',
|
77
106
|
:'owner' => :'String',
|
107
|
+
:'plan' => :'String',
|
108
|
+
:'status' => :'String',
|
109
|
+
:'error' => :'String',
|
110
|
+
:'duration' => :'Float',
|
111
|
+
:'render_time' => :'Float',
|
78
112
|
:'url' => :'String',
|
113
|
+
:'poster' => :'String',
|
114
|
+
:'thumbnail' => :'String',
|
79
115
|
:'data' => :'Edit',
|
80
116
|
:'created' => :'String',
|
81
117
|
:'updated' => :'String'
|
@@ -103,10 +139,6 @@ module Shotstack
|
|
103
139
|
h[k.to_sym] = v
|
104
140
|
}
|
105
141
|
|
106
|
-
if attributes.key?(:'status')
|
107
|
-
self.status = attributes[:'status']
|
108
|
-
end
|
109
|
-
|
110
142
|
if attributes.key?(:'id')
|
111
143
|
self.id = attributes[:'id']
|
112
144
|
end
|
@@ -115,10 +147,38 @@ module Shotstack
|
|
115
147
|
self.owner = attributes[:'owner']
|
116
148
|
end
|
117
149
|
|
150
|
+
if attributes.key?(:'plan')
|
151
|
+
self.plan = attributes[:'plan']
|
152
|
+
end
|
153
|
+
|
154
|
+
if attributes.key?(:'status')
|
155
|
+
self.status = attributes[:'status']
|
156
|
+
end
|
157
|
+
|
158
|
+
if attributes.key?(:'error')
|
159
|
+
self.error = attributes[:'error']
|
160
|
+
end
|
161
|
+
|
162
|
+
if attributes.key?(:'duration')
|
163
|
+
self.duration = attributes[:'duration']
|
164
|
+
end
|
165
|
+
|
166
|
+
if attributes.key?(:'render_time')
|
167
|
+
self.render_time = attributes[:'render_time']
|
168
|
+
end
|
169
|
+
|
118
170
|
if attributes.key?(:'url')
|
119
171
|
self.url = attributes[:'url']
|
120
172
|
end
|
121
173
|
|
174
|
+
if attributes.key?(:'poster')
|
175
|
+
self.poster = attributes[:'poster']
|
176
|
+
end
|
177
|
+
|
178
|
+
if attributes.key?(:'thumbnail')
|
179
|
+
self.thumbnail = attributes[:'thumbnail']
|
180
|
+
end
|
181
|
+
|
122
182
|
if attributes.key?(:'data')
|
123
183
|
self.data = attributes[:'data']
|
124
184
|
end
|
@@ -136,10 +196,6 @@ module Shotstack
|
|
136
196
|
# @return Array for valid properties with the reasons
|
137
197
|
def list_invalid_properties
|
138
198
|
invalid_properties = Array.new
|
139
|
-
if @status.nil?
|
140
|
-
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
141
|
-
end
|
142
|
-
|
143
199
|
if @id.nil?
|
144
200
|
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
145
201
|
end
|
@@ -148,6 +204,10 @@ module Shotstack
|
|
148
204
|
invalid_properties.push('invalid value for "owner", owner cannot be nil.')
|
149
205
|
end
|
150
206
|
|
207
|
+
if @status.nil?
|
208
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
209
|
+
end
|
210
|
+
|
151
211
|
if @data.nil?
|
152
212
|
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
153
213
|
end
|
@@ -166,11 +226,11 @@ module Shotstack
|
|
166
226
|
# Check to see if the all the properties in the model are valid
|
167
227
|
# @return true if the model is valid
|
168
228
|
def valid?
|
229
|
+
return false if @id.nil?
|
230
|
+
return false if @owner.nil?
|
169
231
|
return false if @status.nil?
|
170
232
|
status_validator = EnumAttributeValidator.new('String', ["queued", "fetching", "rendering", "saving", "done", "failed"])
|
171
233
|
return false unless status_validator.valid?(@status)
|
172
|
-
return false if @id.nil?
|
173
|
-
return false if @owner.nil?
|
174
234
|
return false if @data.nil?
|
175
235
|
return false if @created.nil?
|
176
236
|
return false if @updated.nil?
|
@@ -192,10 +252,16 @@ module Shotstack
|
|
192
252
|
def ==(o)
|
193
253
|
return true if self.equal?(o)
|
194
254
|
self.class == o.class &&
|
195
|
-
status == o.status &&
|
196
255
|
id == o.id &&
|
197
256
|
owner == o.owner &&
|
257
|
+
plan == o.plan &&
|
258
|
+
status == o.status &&
|
259
|
+
error == o.error &&
|
260
|
+
duration == o.duration &&
|
261
|
+
render_time == o.render_time &&
|
198
262
|
url == o.url &&
|
263
|
+
poster == o.poster &&
|
264
|
+
thumbnail == o.thumbnail &&
|
199
265
|
data == o.data &&
|
200
266
|
created == o.created &&
|
201
267
|
updated == o.updated
|
@@ -210,7 +276,7 @@ module Shotstack
|
|
210
276
|
# Calculates hash code according to all attributes.
|
211
277
|
# @return [Integer] Hash code
|
212
278
|
def hash
|
213
|
-
[status,
|
279
|
+
[id, owner, plan, status, error, duration, render_time, url, poster, thumbnail, data, created, updated].hash
|
214
280
|
end
|
215
281
|
|
216
282
|
# Builds the object from hash
|
@@ -226,7 +292,9 @@ module Shotstack
|
|
226
292
|
def build_from_hash(attributes)
|
227
293
|
return nil unless attributes.is_a?(Hash)
|
228
294
|
self.class.openapi_types.each_pair do |key, type|
|
229
|
-
if
|
295
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
296
|
+
self.send("#{key}=", nil)
|
297
|
+
elsif type =~ /\AArray<(.*)>/i
|
230
298
|
# check to ensure the input is an array given that the attribute
|
231
299
|
# is documented as an array but the input is not
|
232
300
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -234,7 +302,7 @@ module Shotstack
|
|
234
302
|
end
|
235
303
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
236
304
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
237
|
-
end
|
305
|
+
end
|
238
306
|
end
|
239
307
|
|
240
308
|
self
|
@@ -246,8 +314,8 @@ module Shotstack
|
|
246
314
|
# @return [Object] Deserialized data
|
247
315
|
def _deserialize(type, value)
|
248
316
|
case type.to_sym
|
249
|
-
when :
|
250
|
-
|
317
|
+
when :Time
|
318
|
+
Time.parse(value)
|
251
319
|
when :Date
|
252
320
|
Date.parse(value)
|
253
321
|
when :String
|
@@ -277,7 +345,9 @@ module Shotstack
|
|
277
345
|
end
|
278
346
|
end
|
279
347
|
else # model
|
280
|
-
|
348
|
+
# models (e.g. Pet) or oneOf
|
349
|
+
klass = Shotstack.const_get(type)
|
350
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
281
351
|
end
|
282
352
|
end
|
283
353
|
|
@@ -303,7 +373,7 @@ module Shotstack
|
|
303
373
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
304
374
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
305
375
|
end
|
306
|
-
|
376
|
+
|
307
377
|
hash[param] = _to_hash(value)
|
308
378
|
end
|
309
379
|
hash
|
@@ -326,5 +396,7 @@ module Shotstack
|
|
326
396
|
value
|
327
397
|
end
|
328
398
|
end
|
399
|
+
|
329
400
|
end
|
401
|
+
|
330
402
|
end
|
@@ -1,16 +1,17 @@
|
|
1
1
|
=begin
|
2
2
|
#Shotstack
|
3
3
|
|
4
|
-
#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
|
4
|
+
#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 visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.gitbook.io/docs/guides/getting-started) documentation.
|
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:
|
9
|
+
OpenAPI Generator version: 5.0.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module Shotstack
|
16
17
|
# A music or audio file in mp3 format that plays for the duration of the rendered video or the length of the audio file, which ever is shortest.
|
@@ -18,7 +19,7 @@ module Shotstack
|
|
18
19
|
# The URL of the mp3 audio file. The URL must be publicly accessible or include credentials.
|
19
20
|
attr_accessor :src
|
20
21
|
|
21
|
-
# The effect to apply to the audio file
|
22
|
+
# The effect to apply to the audio file <ul> <li>`fadeIn` - fade volume in only</li> <li>`fadeOut` - fade volume out only</li> <li>`fadeInFadeOut` - fade volume in and out</li> </ul>
|
22
23
|
attr_accessor :effect
|
23
24
|
|
24
25
|
# Set the volume for the soundtrack between 0 and 1 where 0 is muted and 1 is full volume (defaults to 1).
|
@@ -55,6 +56,11 @@ module Shotstack
|
|
55
56
|
}
|
56
57
|
end
|
57
58
|
|
59
|
+
# Returns all the JSON keys this model knows about
|
60
|
+
def self.acceptable_attributes
|
61
|
+
attribute_map.values
|
62
|
+
end
|
63
|
+
|
58
64
|
# Attribute type mapping.
|
59
65
|
def self.openapi_types
|
60
66
|
{
|
@@ -95,6 +101,8 @@ module Shotstack
|
|
95
101
|
|
96
102
|
if attributes.key?(:'volume')
|
97
103
|
self.volume = attributes[:'volume']
|
104
|
+
else
|
105
|
+
self.volume = 1
|
98
106
|
end
|
99
107
|
end
|
100
108
|
|
@@ -163,7 +171,9 @@ module Shotstack
|
|
163
171
|
def build_from_hash(attributes)
|
164
172
|
return nil unless attributes.is_a?(Hash)
|
165
173
|
self.class.openapi_types.each_pair do |key, type|
|
166
|
-
if
|
174
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
175
|
+
self.send("#{key}=", nil)
|
176
|
+
elsif type =~ /\AArray<(.*)>/i
|
167
177
|
# check to ensure the input is an array given that the attribute
|
168
178
|
# is documented as an array but the input is not
|
169
179
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -171,7 +181,7 @@ module Shotstack
|
|
171
181
|
end
|
172
182
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
173
183
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
174
|
-
end
|
184
|
+
end
|
175
185
|
end
|
176
186
|
|
177
187
|
self
|
@@ -183,8 +193,8 @@ module Shotstack
|
|
183
193
|
# @return [Object] Deserialized data
|
184
194
|
def _deserialize(type, value)
|
185
195
|
case type.to_sym
|
186
|
-
when :
|
187
|
-
|
196
|
+
when :Time
|
197
|
+
Time.parse(value)
|
188
198
|
when :Date
|
189
199
|
Date.parse(value)
|
190
200
|
when :String
|
@@ -214,7 +224,9 @@ module Shotstack
|
|
214
224
|
end
|
215
225
|
end
|
216
226
|
else # model
|
217
|
-
|
227
|
+
# models (e.g. Pet) or oneOf
|
228
|
+
klass = Shotstack.const_get(type)
|
229
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
218
230
|
end
|
219
231
|
end
|
220
232
|
|
@@ -240,7 +252,7 @@ module Shotstack
|
|
240
252
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
241
253
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
242
254
|
end
|
243
|
-
|
255
|
+
|
244
256
|
hash[param] = _to_hash(value)
|
245
257
|
end
|
246
258
|
hash
|
@@ -263,5 +275,7 @@ module Shotstack
|
|
263
275
|
value
|
264
276
|
end
|
265
277
|
end
|
278
|
+
|
266
279
|
end
|
280
|
+
|
267
281
|
end
|