shotstack 0.1.1 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,22 +1,23 @@
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 check https://shotstack.io
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: 4.2.1
9
+ OpenAPI Generator version: 5.0.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
  require_relative 'asset'
15
16
 
16
17
  module Shotstack
17
18
  # 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.
18
19
  class LumaAsset < Asset
19
- # The type of asset - set to <b>luma</b> for luma mattes.
20
+ # The type of asset - set to `luma` for luma mattes.
20
21
  attr_accessor :type
21
22
 
22
23
  # The luma matte video source URL. The URL must be publicly accessible or include credentials.
@@ -34,6 +35,11 @@ module Shotstack
34
35
  }
35
36
  end
36
37
 
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ attribute_map.values
41
+ end
42
+
37
43
  # Attribute type mapping.
38
44
  def self.openapi_types
39
45
  {
@@ -137,7 +143,9 @@ module Shotstack
137
143
  def build_from_hash(attributes)
138
144
  return nil unless attributes.is_a?(Hash)
139
145
  self.class.openapi_types.each_pair do |key, type|
140
- if type =~ /\AArray<(.*)>/i
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
141
149
  # check to ensure the input is an array given that the attribute
142
150
  # is documented as an array but the input is not
143
151
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -145,7 +153,7 @@ module Shotstack
145
153
  end
146
154
  elsif !attributes[self.class.attribute_map[key]].nil?
147
155
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
148
- end # or else data not found in attributes(hash), not an issue as the data can be optional
156
+ end
149
157
  end
150
158
 
151
159
  self
@@ -157,8 +165,8 @@ module Shotstack
157
165
  # @return [Object] Deserialized data
158
166
  def _deserialize(type, value)
159
167
  case type.to_sym
160
- when :DateTime
161
- DateTime.parse(value)
168
+ when :Time
169
+ Time.parse(value)
162
170
  when :Date
163
171
  Date.parse(value)
164
172
  when :String
@@ -188,7 +196,9 @@ module Shotstack
188
196
  end
189
197
  end
190
198
  else # model
191
- Shotstack.const_get(type).build_from_hash(value)
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)
192
202
  end
193
203
  end
194
204
 
@@ -214,7 +224,7 @@ module Shotstack
214
224
  is_nullable = self.class.openapi_nullable.include?(attr)
215
225
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
216
226
  end
217
-
227
+
218
228
  hash[param] = _to_hash(value)
219
229
  end
220
230
  hash
@@ -237,5 +247,7 @@ module Shotstack
237
247
  value
238
248
  end
239
249
  end
250
+
240
251
  end
252
+
241
253
  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 check https://shotstack.io
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: 4.2.1
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
  # Offsets the position of an asset horizontally or vertically by a relative distance.
@@ -29,6 +30,11 @@ module Shotstack
29
30
  }
30
31
  end
31
32
 
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
32
38
  # Attribute type mapping.
33
39
  def self.openapi_types
34
40
  {
@@ -60,10 +66,14 @@ module Shotstack
60
66
 
61
67
  if attributes.key?(:'x')
62
68
  self.x = attributes[:'x']
69
+ else
70
+ self.x = 0
63
71
  end
64
72
 
65
73
  if attributes.key?(:'y')
66
74
  self.y = attributes[:'y']
75
+ else
76
+ self.y = 0
67
77
  end
68
78
  end
69
79
 
@@ -162,7 +172,9 @@ module Shotstack
162
172
  def build_from_hash(attributes)
163
173
  return nil unless attributes.is_a?(Hash)
164
174
  self.class.openapi_types.each_pair do |key, type|
165
- if type =~ /\AArray<(.*)>/i
175
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
176
+ self.send("#{key}=", nil)
177
+ elsif type =~ /\AArray<(.*)>/i
166
178
  # check to ensure the input is an array given that the attribute
167
179
  # is documented as an array but the input is not
168
180
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -170,7 +182,7 @@ module Shotstack
170
182
  end
171
183
  elsif !attributes[self.class.attribute_map[key]].nil?
172
184
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
173
- end # or else data not found in attributes(hash), not an issue as the data can be optional
185
+ end
174
186
  end
175
187
 
176
188
  self
@@ -182,8 +194,8 @@ module Shotstack
182
194
  # @return [Object] Deserialized data
183
195
  def _deserialize(type, value)
184
196
  case type.to_sym
185
- when :DateTime
186
- DateTime.parse(value)
197
+ when :Time
198
+ Time.parse(value)
187
199
  when :Date
188
200
  Date.parse(value)
189
201
  when :String
@@ -213,7 +225,9 @@ module Shotstack
213
225
  end
214
226
  end
215
227
  else # model
216
- Shotstack.const_get(type).build_from_hash(value)
228
+ # models (e.g. Pet) or oneOf
229
+ klass = Shotstack.const_get(type)
230
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
217
231
  end
218
232
  end
219
233
 
@@ -239,7 +253,7 @@ module Shotstack
239
253
  is_nullable = self.class.openapi_nullable.include?(attr)
240
254
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
241
255
  end
242
-
256
+
243
257
  hash[param] = _to_hash(value)
244
258
  end
245
259
  hash
@@ -262,5 +276,7 @@ module Shotstack
262
276
  value
263
277
  end
264
278
  end
279
+
265
280
  end
281
+
266
282
  end
@@ -1,32 +1,38 @@
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 check https://shotstack.io
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: 4.2.1
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
- # The video output format.
17
+ # The output format, render range and type of media to generate.
17
18
  class Output
18
- # `mp4`, `webm` video or animated `gif`
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 (no video)</li> </ul>
19
20
  attr_accessor :format
20
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
23
  attr_accessor :resolution
23
24
 
24
- # The aspect ratio (shape) of the video. Useful for social media sites. 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> </ul>
25
+ # The aspect ratio (shape) of the video. Useful for social media video. 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> </ul>
25
26
  attr_accessor :aspect_ratio
26
27
 
28
+ # 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>`25` - 25fps</li> <li>`30` - 30fps</li> </ul>
29
+ attr_accessor :fps
30
+
27
31
  # Override the resolution and scale the video to render at a different size. When using scaleTo the video should be edited at the resolution dimensions, i.e. use font sizes that look best at HD, then use scaleTo to output the video at SD and the text will be scaled to the correct size. This is useful if you want to create multiple video 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>
28
32
  attr_accessor :scale_to
29
33
 
34
+ attr_accessor :range
35
+
30
36
  attr_accessor :poster
31
37
 
32
38
  attr_accessor :thumbnail
@@ -59,19 +65,28 @@ module Shotstack
59
65
  :'format' => :'format',
60
66
  :'resolution' => :'resolution',
61
67
  :'aspect_ratio' => :'aspectRatio',
68
+ :'fps' => :'fps',
62
69
  :'scale_to' => :'scaleTo',
70
+ :'range' => :'range',
63
71
  :'poster' => :'poster',
64
72
  :'thumbnail' => :'thumbnail'
65
73
  }
66
74
  end
67
75
 
76
+ # Returns all the JSON keys this model knows about
77
+ def self.acceptable_attributes
78
+ attribute_map.values
79
+ end
80
+
68
81
  # Attribute type mapping.
69
82
  def self.openapi_types
70
83
  {
71
84
  :'format' => :'String',
72
85
  :'resolution' => :'String',
73
86
  :'aspect_ratio' => :'String',
87
+ :'fps' => :'Integer',
74
88
  :'scale_to' => :'String',
89
+ :'range' => :'Range',
75
90
  :'poster' => :'Poster',
76
91
  :'thumbnail' => :'Thumbnail'
77
92
  }
@@ -110,10 +125,20 @@ module Shotstack
110
125
  self.aspect_ratio = attributes[:'aspect_ratio']
111
126
  end
112
127
 
128
+ if attributes.key?(:'fps')
129
+ self.fps = attributes[:'fps']
130
+ else
131
+ self.fps = 25
132
+ end
133
+
113
134
  if attributes.key?(:'scale_to')
114
135
  self.scale_to = attributes[:'scale_to']
115
136
  end
116
137
 
138
+ if attributes.key?(:'range')
139
+ self.range = attributes[:'range']
140
+ end
141
+
117
142
  if attributes.key?(:'poster')
118
143
  self.poster = attributes[:'poster']
119
144
  end
@@ -142,13 +167,15 @@ module Shotstack
142
167
  # @return true if the model is valid
143
168
  def valid?
144
169
  return false if @format.nil?
145
- format_validator = EnumAttributeValidator.new('String', ["mp4", "webm", "gif"])
170
+ format_validator = EnumAttributeValidator.new('String', ["mp4", "gif", "mp3"])
146
171
  return false unless format_validator.valid?(@format)
147
172
  return false if @resolution.nil?
148
173
  resolution_validator = EnumAttributeValidator.new('String', ["preview", "mobile", "sd", "hd", "1080"])
149
174
  return false unless resolution_validator.valid?(@resolution)
150
- aspect_ratio_validator = EnumAttributeValidator.new('String', ["16:9", "9:16", "1:1"])
175
+ aspect_ratio_validator = EnumAttributeValidator.new('String', ["16:9", "9:16", "1:1", "4:5"])
151
176
  return false unless aspect_ratio_validator.valid?(@aspect_ratio)
177
+ fps_validator = EnumAttributeValidator.new('Integer', [12, 15, 24, 25, 30])
178
+ return false unless fps_validator.valid?(@fps)
152
179
  scale_to_validator = EnumAttributeValidator.new('String', ["preview", "mobile", "sd", "hd", "1080"])
153
180
  return false unless scale_to_validator.valid?(@scale_to)
154
181
  true
@@ -157,7 +184,7 @@ module Shotstack
157
184
  # Custom attribute writer method checking allowed values (enum).
158
185
  # @param [Object] format Object to be assigned
159
186
  def format=(format)
160
- validator = EnumAttributeValidator.new('String', ["mp4", "webm", "gif"])
187
+ validator = EnumAttributeValidator.new('String', ["mp4", "gif", "mp3"])
161
188
  unless validator.valid?(format)
162
189
  fail ArgumentError, "invalid value for \"format\", must be one of #{validator.allowable_values}."
163
190
  end
@@ -177,13 +204,23 @@ module Shotstack
177
204
  # Custom attribute writer method checking allowed values (enum).
178
205
  # @param [Object] aspect_ratio Object to be assigned
179
206
  def aspect_ratio=(aspect_ratio)
180
- validator = EnumAttributeValidator.new('String', ["16:9", "9:16", "1:1"])
207
+ validator = EnumAttributeValidator.new('String', ["16:9", "9:16", "1:1", "4:5"])
181
208
  unless validator.valid?(aspect_ratio)
182
209
  fail ArgumentError, "invalid value for \"aspect_ratio\", must be one of #{validator.allowable_values}."
183
210
  end
184
211
  @aspect_ratio = aspect_ratio
185
212
  end
186
213
 
214
+ # Custom attribute writer method checking allowed values (enum).
215
+ # @param [Object] fps Object to be assigned
216
+ def fps=(fps)
217
+ validator = EnumAttributeValidator.new('Integer', [12, 15, 24, 25, 30])
218
+ unless validator.valid?(fps)
219
+ fail ArgumentError, "invalid value for \"fps\", must be one of #{validator.allowable_values}."
220
+ end
221
+ @fps = fps
222
+ end
223
+
187
224
  # Custom attribute writer method checking allowed values (enum).
188
225
  # @param [Object] scale_to Object to be assigned
189
226
  def scale_to=(scale_to)
@@ -202,7 +239,9 @@ module Shotstack
202
239
  format == o.format &&
203
240
  resolution == o.resolution &&
204
241
  aspect_ratio == o.aspect_ratio &&
242
+ fps == o.fps &&
205
243
  scale_to == o.scale_to &&
244
+ range == o.range &&
206
245
  poster == o.poster &&
207
246
  thumbnail == o.thumbnail
208
247
  end
@@ -216,7 +255,7 @@ module Shotstack
216
255
  # Calculates hash code according to all attributes.
217
256
  # @return [Integer] Hash code
218
257
  def hash
219
- [format, resolution, aspect_ratio, scale_to, poster, thumbnail].hash
258
+ [format, resolution, aspect_ratio, fps, scale_to, range, poster, thumbnail].hash
220
259
  end
221
260
 
222
261
  # Builds the object from hash
@@ -232,7 +271,9 @@ module Shotstack
232
271
  def build_from_hash(attributes)
233
272
  return nil unless attributes.is_a?(Hash)
234
273
  self.class.openapi_types.each_pair do |key, type|
235
- if type =~ /\AArray<(.*)>/i
274
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
275
+ self.send("#{key}=", nil)
276
+ elsif type =~ /\AArray<(.*)>/i
236
277
  # check to ensure the input is an array given that the attribute
237
278
  # is documented as an array but the input is not
238
279
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -240,7 +281,7 @@ module Shotstack
240
281
  end
241
282
  elsif !attributes[self.class.attribute_map[key]].nil?
242
283
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
243
- end # or else data not found in attributes(hash), not an issue as the data can be optional
284
+ end
244
285
  end
245
286
 
246
287
  self
@@ -252,8 +293,8 @@ module Shotstack
252
293
  # @return [Object] Deserialized data
253
294
  def _deserialize(type, value)
254
295
  case type.to_sym
255
- when :DateTime
256
- DateTime.parse(value)
296
+ when :Time
297
+ Time.parse(value)
257
298
  when :Date
258
299
  Date.parse(value)
259
300
  when :String
@@ -283,7 +324,9 @@ module Shotstack
283
324
  end
284
325
  end
285
326
  else # model
286
- Shotstack.const_get(type).build_from_hash(value)
327
+ # models (e.g. Pet) or oneOf
328
+ klass = Shotstack.const_get(type)
329
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
287
330
  end
288
331
  end
289
332
 
@@ -309,7 +352,7 @@ module Shotstack
309
352
  is_nullable = self.class.openapi_nullable.include?(attr)
310
353
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
311
354
  end
312
-
355
+
313
356
  hash[param] = _to_hash(value)
314
357
  end
315
358
  hash
@@ -332,5 +375,7 @@ module Shotstack
332
375
  value
333
376
  end
334
377
  end
378
+
335
379
  end
380
+
336
381
  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 check https://shotstack.io
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: 4.2.1
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
  # Generate a poster image for the video at a specific point from the timeline. The poster image size will match the size of the output video.
@@ -25,6 +26,11 @@ module Shotstack
25
26
  }
26
27
  end
27
28
 
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
28
34
  # Attribute type mapping.
29
35
  def self.openapi_types
30
36
  {
@@ -109,7 +115,9 @@ module Shotstack
109
115
  def build_from_hash(attributes)
110
116
  return nil unless attributes.is_a?(Hash)
111
117
  self.class.openapi_types.each_pair do |key, type|
112
- if type =~ /\AArray<(.*)>/i
118
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
119
+ self.send("#{key}=", nil)
120
+ elsif type =~ /\AArray<(.*)>/i
113
121
  # check to ensure the input is an array given that the attribute
114
122
  # is documented as an array but the input is not
115
123
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -117,7 +125,7 @@ module Shotstack
117
125
  end
118
126
  elsif !attributes[self.class.attribute_map[key]].nil?
119
127
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
120
- end # or else data not found in attributes(hash), not an issue as the data can be optional
128
+ end
121
129
  end
122
130
 
123
131
  self
@@ -129,8 +137,8 @@ module Shotstack
129
137
  # @return [Object] Deserialized data
130
138
  def _deserialize(type, value)
131
139
  case type.to_sym
132
- when :DateTime
133
- DateTime.parse(value)
140
+ when :Time
141
+ Time.parse(value)
134
142
  when :Date
135
143
  Date.parse(value)
136
144
  when :String
@@ -160,7 +168,9 @@ module Shotstack
160
168
  end
161
169
  end
162
170
  else # model
163
- Shotstack.const_get(type).build_from_hash(value)
171
+ # models (e.g. Pet) or oneOf
172
+ klass = Shotstack.const_get(type)
173
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
164
174
  end
165
175
  end
166
176
 
@@ -186,7 +196,7 @@ module Shotstack
186
196
  is_nullable = self.class.openapi_nullable.include?(attr)
187
197
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
188
198
  end
189
-
199
+
190
200
  hash[param] = _to_hash(value)
191
201
  end
192
202
  hash
@@ -209,5 +219,7 @@ module Shotstack
209
219
  value
210
220
  end
211
221
  end
222
+
212
223
  end
224
+
213
225
  end