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
@@ -0,0 +1,334 @@
|
|
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 list of asset attributes and their values.
|
18
|
+
class AssetResponseAttributes
|
19
|
+
# The unique id of the hosted asset in UUID format.
|
20
|
+
attr_accessor :id
|
21
|
+
|
22
|
+
# The owner id of the render task.
|
23
|
+
attr_accessor :owner
|
24
|
+
|
25
|
+
# The region the asset is hosted, currently only `au` (Australia).
|
26
|
+
attr_accessor :region
|
27
|
+
|
28
|
+
# The original render id that created the asset in UUID format. Multiple assets can share the same render id.
|
29
|
+
attr_accessor :render_id
|
30
|
+
|
31
|
+
# The asset file name.
|
32
|
+
attr_accessor :filename
|
33
|
+
|
34
|
+
# The asset file name.
|
35
|
+
attr_accessor :url
|
36
|
+
|
37
|
+
# The status of the asset. <ul> <li>`importing` - the asset is being copied to the hosting service</li> <li>`ready` - the asset is ready to be served to users</li> <li>`failed` - the asset failed to copy or delete</li> <li>`deleted` - the asset has been deleted</li> </ul>
|
38
|
+
attr_accessor :status
|
39
|
+
|
40
|
+
# The time the asset was created.
|
41
|
+
attr_accessor :created
|
42
|
+
|
43
|
+
# The time the asset status was last updated.
|
44
|
+
attr_accessor :updated
|
45
|
+
|
46
|
+
class EnumAttributeValidator
|
47
|
+
attr_reader :datatype
|
48
|
+
attr_reader :allowable_values
|
49
|
+
|
50
|
+
def initialize(datatype, allowable_values)
|
51
|
+
@allowable_values = allowable_values.map do |value|
|
52
|
+
case datatype.to_s
|
53
|
+
when /Integer/i
|
54
|
+
value.to_i
|
55
|
+
when /Float/i
|
56
|
+
value.to_f
|
57
|
+
else
|
58
|
+
value
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def valid?(value)
|
64
|
+
!value || allowable_values.include?(value)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
69
|
+
def self.attribute_map
|
70
|
+
{
|
71
|
+
:'id' => :'id',
|
72
|
+
:'owner' => :'owner',
|
73
|
+
:'region' => :'region',
|
74
|
+
:'render_id' => :'renderId',
|
75
|
+
:'filename' => :'filename',
|
76
|
+
:'url' => :'url',
|
77
|
+
:'status' => :'status',
|
78
|
+
:'created' => :'created',
|
79
|
+
:'updated' => :'updated'
|
80
|
+
}
|
81
|
+
end
|
82
|
+
|
83
|
+
# Returns all the JSON keys this model knows about
|
84
|
+
def self.acceptable_attributes
|
85
|
+
attribute_map.values
|
86
|
+
end
|
87
|
+
|
88
|
+
# Attribute type mapping.
|
89
|
+
def self.openapi_types
|
90
|
+
{
|
91
|
+
:'id' => :'String',
|
92
|
+
:'owner' => :'String',
|
93
|
+
:'region' => :'String',
|
94
|
+
:'render_id' => :'String',
|
95
|
+
:'filename' => :'String',
|
96
|
+
:'url' => :'String',
|
97
|
+
:'status' => :'String',
|
98
|
+
:'created' => :'String',
|
99
|
+
:'updated' => :'String'
|
100
|
+
}
|
101
|
+
end
|
102
|
+
|
103
|
+
# List of attributes with nullable: true
|
104
|
+
def self.openapi_nullable
|
105
|
+
Set.new([
|
106
|
+
])
|
107
|
+
end
|
108
|
+
|
109
|
+
# Initializes the object
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
+
def initialize(attributes = {})
|
112
|
+
if (!attributes.is_a?(Hash))
|
113
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Shotstack::AssetResponseAttributes` initialize method"
|
114
|
+
end
|
115
|
+
|
116
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
117
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
118
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
119
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Shotstack::AssetResponseAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
120
|
+
end
|
121
|
+
h[k.to_sym] = v
|
122
|
+
}
|
123
|
+
|
124
|
+
if attributes.key?(:'id')
|
125
|
+
self.id = attributes[:'id']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'owner')
|
129
|
+
self.owner = attributes[:'owner']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.key?(:'region')
|
133
|
+
self.region = attributes[:'region']
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.key?(:'render_id')
|
137
|
+
self.render_id = attributes[:'render_id']
|
138
|
+
end
|
139
|
+
|
140
|
+
if attributes.key?(:'filename')
|
141
|
+
self.filename = attributes[:'filename']
|
142
|
+
end
|
143
|
+
|
144
|
+
if attributes.key?(:'url')
|
145
|
+
self.url = attributes[:'url']
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.key?(:'status')
|
149
|
+
self.status = attributes[:'status']
|
150
|
+
end
|
151
|
+
|
152
|
+
if attributes.key?(:'created')
|
153
|
+
self.created = attributes[:'created']
|
154
|
+
end
|
155
|
+
|
156
|
+
if attributes.key?(:'updated')
|
157
|
+
self.updated = attributes[:'updated']
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
162
|
+
# @return Array for valid properties with the reasons
|
163
|
+
def list_invalid_properties
|
164
|
+
invalid_properties = Array.new
|
165
|
+
invalid_properties
|
166
|
+
end
|
167
|
+
|
168
|
+
# Check to see if the all the properties in the model are valid
|
169
|
+
# @return true if the model is valid
|
170
|
+
def valid?
|
171
|
+
status_validator = EnumAttributeValidator.new('String', ["importing", "ready", "failed", "deleted"])
|
172
|
+
return false unless status_validator.valid?(@status)
|
173
|
+
true
|
174
|
+
end
|
175
|
+
|
176
|
+
# Custom attribute writer method checking allowed values (enum).
|
177
|
+
# @param [Object] status Object to be assigned
|
178
|
+
def status=(status)
|
179
|
+
validator = EnumAttributeValidator.new('String', ["importing", "ready", "failed", "deleted"])
|
180
|
+
unless validator.valid?(status)
|
181
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
182
|
+
end
|
183
|
+
@status = status
|
184
|
+
end
|
185
|
+
|
186
|
+
# Checks equality by comparing each attribute.
|
187
|
+
# @param [Object] Object to be compared
|
188
|
+
def ==(o)
|
189
|
+
return true if self.equal?(o)
|
190
|
+
self.class == o.class &&
|
191
|
+
id == o.id &&
|
192
|
+
owner == o.owner &&
|
193
|
+
region == o.region &&
|
194
|
+
render_id == o.render_id &&
|
195
|
+
filename == o.filename &&
|
196
|
+
url == o.url &&
|
197
|
+
status == o.status &&
|
198
|
+
created == o.created &&
|
199
|
+
updated == o.updated
|
200
|
+
end
|
201
|
+
|
202
|
+
# @see the `==` method
|
203
|
+
# @param [Object] Object to be compared
|
204
|
+
def eql?(o)
|
205
|
+
self == o
|
206
|
+
end
|
207
|
+
|
208
|
+
# Calculates hash code according to all attributes.
|
209
|
+
# @return [Integer] Hash code
|
210
|
+
def hash
|
211
|
+
[id, owner, region, render_id, filename, url, status, created, updated].hash
|
212
|
+
end
|
213
|
+
|
214
|
+
# Builds the object from hash
|
215
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
216
|
+
# @return [Object] Returns the model itself
|
217
|
+
def self.build_from_hash(attributes)
|
218
|
+
new.build_from_hash(attributes)
|
219
|
+
end
|
220
|
+
|
221
|
+
# Builds the object from hash
|
222
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
223
|
+
# @return [Object] Returns the model itself
|
224
|
+
def build_from_hash(attributes)
|
225
|
+
return nil unless attributes.is_a?(Hash)
|
226
|
+
self.class.openapi_types.each_pair do |key, type|
|
227
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
228
|
+
self.send("#{key}=", nil)
|
229
|
+
elsif type =~ /\AArray<(.*)>/i
|
230
|
+
# check to ensure the input is an array given that the attribute
|
231
|
+
# is documented as an array but the input is not
|
232
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
233
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
234
|
+
end
|
235
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
236
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
self
|
241
|
+
end
|
242
|
+
|
243
|
+
# Deserializes the data based on type
|
244
|
+
# @param string type Data type
|
245
|
+
# @param string value Value to be deserialized
|
246
|
+
# @return [Object] Deserialized data
|
247
|
+
def _deserialize(type, value)
|
248
|
+
case type.to_sym
|
249
|
+
when :Time
|
250
|
+
Time.parse(value)
|
251
|
+
when :Date
|
252
|
+
Date.parse(value)
|
253
|
+
when :String
|
254
|
+
value.to_s
|
255
|
+
when :Integer
|
256
|
+
value.to_i
|
257
|
+
when :Float
|
258
|
+
value.to_f
|
259
|
+
when :Boolean
|
260
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
261
|
+
true
|
262
|
+
else
|
263
|
+
false
|
264
|
+
end
|
265
|
+
when :Object
|
266
|
+
# generic object (usually a Hash), return directly
|
267
|
+
value
|
268
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
269
|
+
inner_type = Regexp.last_match[:inner_type]
|
270
|
+
value.map { |v| _deserialize(inner_type, v) }
|
271
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
272
|
+
k_type = Regexp.last_match[:k_type]
|
273
|
+
v_type = Regexp.last_match[:v_type]
|
274
|
+
{}.tap do |hash|
|
275
|
+
value.each do |k, v|
|
276
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
277
|
+
end
|
278
|
+
end
|
279
|
+
else # model
|
280
|
+
# models (e.g. Pet) or oneOf
|
281
|
+
klass = Shotstack.const_get(type)
|
282
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
283
|
+
end
|
284
|
+
end
|
285
|
+
|
286
|
+
# Returns the string representation of the object
|
287
|
+
# @return [String] String presentation of the object
|
288
|
+
def to_s
|
289
|
+
to_hash.to_s
|
290
|
+
end
|
291
|
+
|
292
|
+
# to_body is an alias to to_hash (backward compatibility)
|
293
|
+
# @return [Hash] Returns the object in the form of hash
|
294
|
+
def to_body
|
295
|
+
to_hash
|
296
|
+
end
|
297
|
+
|
298
|
+
# Returns the object in the form of hash
|
299
|
+
# @return [Hash] Returns the object in the form of hash
|
300
|
+
def to_hash
|
301
|
+
hash = {}
|
302
|
+
self.class.attribute_map.each_pair do |attr, param|
|
303
|
+
value = self.send(attr)
|
304
|
+
if value.nil?
|
305
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
306
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
307
|
+
end
|
308
|
+
|
309
|
+
hash[param] = _to_hash(value)
|
310
|
+
end
|
311
|
+
hash
|
312
|
+
end
|
313
|
+
|
314
|
+
# Outputs non-array value in the form of hash
|
315
|
+
# For object, use to_hash. Otherwise, just return the value
|
316
|
+
# @param [Object] value Any valid value
|
317
|
+
# @return [Hash] Returns the value in the form of hash
|
318
|
+
def _to_hash(value)
|
319
|
+
if value.is_a?(Array)
|
320
|
+
value.compact.map { |v| _to_hash(v) }
|
321
|
+
elsif value.is_a?(Hash)
|
322
|
+
{}.tap do |hash|
|
323
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
324
|
+
end
|
325
|
+
elsif value.respond_to? :to_hash
|
326
|
+
value.to_hash
|
327
|
+
else
|
328
|
+
value
|
329
|
+
end
|
330
|
+
end
|
331
|
+
|
332
|
+
end
|
333
|
+
|
334
|
+
end
|
@@ -0,0 +1,229 @@
|
|
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 type of resource (an asset) and attributes of the asset.
|
18
|
+
class AssetResponseData
|
19
|
+
# The type of resource, in this case it is an assets.
|
20
|
+
attr_accessor :type
|
21
|
+
|
22
|
+
attr_accessor :attributes
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'type' => :'type',
|
28
|
+
:'attributes' => :'attributes'
|
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
|
+
:'type' => :'String',
|
41
|
+
:'attributes' => :'AssetResponseAttributes'
|
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::AssetResponseData` 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::AssetResponseData`. 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?(:'type')
|
67
|
+
self.type = attributes[:'type']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'attributes')
|
71
|
+
self.attributes = attributes[:'attributes']
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
76
|
+
# @return Array for valid properties with the reasons
|
77
|
+
def list_invalid_properties
|
78
|
+
invalid_properties = Array.new
|
79
|
+
invalid_properties
|
80
|
+
end
|
81
|
+
|
82
|
+
# Check to see if the all the properties in the model are valid
|
83
|
+
# @return true if the model is valid
|
84
|
+
def valid?
|
85
|
+
true
|
86
|
+
end
|
87
|
+
|
88
|
+
# Checks equality by comparing each attribute.
|
89
|
+
# @param [Object] Object to be compared
|
90
|
+
def ==(o)
|
91
|
+
return true if self.equal?(o)
|
92
|
+
self.class == o.class &&
|
93
|
+
type == o.type &&
|
94
|
+
attributes == o.attributes
|
95
|
+
end
|
96
|
+
|
97
|
+
# @see the `==` method
|
98
|
+
# @param [Object] Object to be compared
|
99
|
+
def eql?(o)
|
100
|
+
self == o
|
101
|
+
end
|
102
|
+
|
103
|
+
# Calculates hash code according to all attributes.
|
104
|
+
# @return [Integer] Hash code
|
105
|
+
def hash
|
106
|
+
[type, attributes].hash
|
107
|
+
end
|
108
|
+
|
109
|
+
# Builds the object from hash
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
+
# @return [Object] Returns the model itself
|
112
|
+
def self.build_from_hash(attributes)
|
113
|
+
new.build_from_hash(attributes)
|
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 build_from_hash(attributes)
|
120
|
+
return nil unless attributes.is_a?(Hash)
|
121
|
+
self.class.openapi_types.each_pair do |key, type|
|
122
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
123
|
+
self.send("#{key}=", nil)
|
124
|
+
elsif type =~ /\AArray<(.*)>/i
|
125
|
+
# check to ensure the input is an array given that the attribute
|
126
|
+
# is documented as an array but the input is not
|
127
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
128
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
129
|
+
end
|
130
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
131
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
self
|
136
|
+
end
|
137
|
+
|
138
|
+
# Deserializes the data based on type
|
139
|
+
# @param string type Data type
|
140
|
+
# @param string value Value to be deserialized
|
141
|
+
# @return [Object] Deserialized data
|
142
|
+
def _deserialize(type, value)
|
143
|
+
case type.to_sym
|
144
|
+
when :Time
|
145
|
+
Time.parse(value)
|
146
|
+
when :Date
|
147
|
+
Date.parse(value)
|
148
|
+
when :String
|
149
|
+
value.to_s
|
150
|
+
when :Integer
|
151
|
+
value.to_i
|
152
|
+
when :Float
|
153
|
+
value.to_f
|
154
|
+
when :Boolean
|
155
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
156
|
+
true
|
157
|
+
else
|
158
|
+
false
|
159
|
+
end
|
160
|
+
when :Object
|
161
|
+
# generic object (usually a Hash), return directly
|
162
|
+
value
|
163
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
164
|
+
inner_type = Regexp.last_match[:inner_type]
|
165
|
+
value.map { |v| _deserialize(inner_type, v) }
|
166
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
167
|
+
k_type = Regexp.last_match[:k_type]
|
168
|
+
v_type = Regexp.last_match[:v_type]
|
169
|
+
{}.tap do |hash|
|
170
|
+
value.each do |k, v|
|
171
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
else # model
|
175
|
+
# models (e.g. Pet) or oneOf
|
176
|
+
klass = Shotstack.const_get(type)
|
177
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
# Returns the string representation of the object
|
182
|
+
# @return [String] String presentation of the object
|
183
|
+
def to_s
|
184
|
+
to_hash.to_s
|
185
|
+
end
|
186
|
+
|
187
|
+
# to_body is an alias to to_hash (backward compatibility)
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
189
|
+
def to_body
|
190
|
+
to_hash
|
191
|
+
end
|
192
|
+
|
193
|
+
# Returns the object in the form of hash
|
194
|
+
# @return [Hash] Returns the object in the form of hash
|
195
|
+
def to_hash
|
196
|
+
hash = {}
|
197
|
+
self.class.attribute_map.each_pair do |attr, param|
|
198
|
+
value = self.send(attr)
|
199
|
+
if value.nil?
|
200
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
201
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
202
|
+
end
|
203
|
+
|
204
|
+
hash[param] = _to_hash(value)
|
205
|
+
end
|
206
|
+
hash
|
207
|
+
end
|
208
|
+
|
209
|
+
# Outputs non-array value in the form of hash
|
210
|
+
# For object, use to_hash. Otherwise, just return the value
|
211
|
+
# @param [Object] value Any valid value
|
212
|
+
# @return [Hash] Returns the value in the form of hash
|
213
|
+
def _to_hash(value)
|
214
|
+
if value.is_a?(Array)
|
215
|
+
value.compact.map { |v| _to_hash(v) }
|
216
|
+
elsif value.is_a?(Hash)
|
217
|
+
{}.tap do |hash|
|
218
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
219
|
+
end
|
220
|
+
elsif value.respond_to? :to_hash
|
221
|
+
value.to_hash
|
222
|
+
else
|
223
|
+
value
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
end
|
228
|
+
|
229
|
+
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
|
|
@@ -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,7 +16,7 @@ require 'time'
|
|
16
16
|
module Shotstack
|
17
17
|
# A clip is a container for a specific type of asset, i.e. a title, image, video, audio or html. You use a Clip to define when an asset will display on the timeline, how long it will play for and transitions, filters and effects to apply to it.
|
18
18
|
class Clip
|
19
|
-
# The type of asset to display for the duration of this Clip. Value must be one of
|
19
|
+
# The type of asset to display for the duration of this Clip. Value must be one of: <ul> <li><a href=\"#tocs_videoasset\">VideoAsset</a></li> <li><a href=\"#tocs_imageasset\">ImageAsset</a></li> <li><a href=\"#tocs_titleasset\">TitleAsset</a></li> <li><a href=\"#tocs_htmlasset\">HtmlAsset</a></li> <li><a href=\"#tocs_audioasset\">AudioAsset</a></li> <li><a href=\"#tocs_lumaasset\">LumaAsset</a></li> </ul>
|
20
20
|
attr_accessor :asset
|
21
21
|
|
22
22
|
# The start position of the Clip on the timeline, in seconds.
|
@@ -47,6 +47,8 @@ module Shotstack
|
|
47
47
|
# Sets the opacity of the Clip where 1 is opaque and 0 is transparent.
|
48
48
|
attr_accessor :opacity
|
49
49
|
|
50
|
+
attr_accessor :transform
|
51
|
+
|
50
52
|
class EnumAttributeValidator
|
51
53
|
attr_reader :datatype
|
52
54
|
attr_reader :allowable_values
|
@@ -82,7 +84,8 @@ module Shotstack
|
|
82
84
|
:'transition' => :'transition',
|
83
85
|
:'effect' => :'effect',
|
84
86
|
:'filter' => :'filter',
|
85
|
-
:'opacity' => :'opacity'
|
87
|
+
:'opacity' => :'opacity',
|
88
|
+
:'transform' => :'transform'
|
86
89
|
}
|
87
90
|
end
|
88
91
|
|
@@ -104,7 +107,8 @@ module Shotstack
|
|
104
107
|
:'transition' => :'Transition',
|
105
108
|
:'effect' => :'String',
|
106
109
|
:'filter' => :'String',
|
107
|
-
:'opacity' => :'Float'
|
110
|
+
:'opacity' => :'Float',
|
111
|
+
:'transform' => :'Transformation'
|
108
112
|
}
|
109
113
|
end
|
110
114
|
|
@@ -178,6 +182,10 @@ module Shotstack
|
|
178
182
|
else
|
179
183
|
self.opacity = 1
|
180
184
|
end
|
185
|
+
|
186
|
+
if attributes.key?(:'transform')
|
187
|
+
self.transform = attributes[:'transform']
|
188
|
+
end
|
181
189
|
end
|
182
190
|
|
183
191
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -271,7 +279,8 @@ module Shotstack
|
|
271
279
|
transition == o.transition &&
|
272
280
|
effect == o.effect &&
|
273
281
|
filter == o.filter &&
|
274
|
-
opacity == o.opacity
|
282
|
+
opacity == o.opacity &&
|
283
|
+
transform == o.transform
|
275
284
|
end
|
276
285
|
|
277
286
|
# @see the `==` method
|
@@ -283,7 +292,7 @@ module Shotstack
|
|
283
292
|
# Calculates hash code according to all attributes.
|
284
293
|
# @return [Integer] Hash code
|
285
294
|
def hash
|
286
|
-
[asset, start, length, fit, scale, position, offset, transition, effect, filter, opacity].hash
|
295
|
+
[asset, start, length, fit, scale, position, offset, transition, effect, filter, opacity, transform].hash
|
287
296
|
end
|
288
297
|
|
289
298
|
# 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,17 @@
|
|
1
|
+
module Shotstack
|
2
|
+
class Destinations
|
3
|
+
# Builds the object from hash
|
4
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
5
|
+
# @return [Object] Returns the model itself
|
6
|
+
def self.build_from_hash(attributes)
|
7
|
+
new.build_from_hash(attributes)
|
8
|
+
end
|
9
|
+
|
10
|
+
# Builds the object from hash
|
11
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
12
|
+
# @return [Object] Returns the model itself
|
13
|
+
def build_from_hash(attributes)
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|