shotstack 0.1.4 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/shotstack.rb +12 -2
- data/lib/shotstack/api/edit_api.rb +155 -0
- data/lib/shotstack/api/endpoints_api.rb +10 -8
- data/lib/shotstack/api/serve_api.rb +224 -0
- data/lib/shotstack/api_client.rb +50 -46
- data/lib/shotstack/api_error.rb +2 -2
- data/lib/shotstack/configuration.rb +50 -9
- 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 +68 -12
- data/lib/shotstack/models/clip.rb +23 -11
- data/lib/shotstack/models/crop.rb +346 -0
- data/lib/shotstack/models/destinations.rb +17 -0
- data/lib/shotstack/models/edit.rb +72 -14
- data/lib/shotstack/models/font.rb +21 -9
- data/lib/shotstack/models/html_asset.rb +26 -14
- data/lib/shotstack/models/image_asset.rb +34 -13
- data/lib/shotstack/models/luma_asset.rb +24 -12
- data/lib/shotstack/models/offset.rb +20 -8
- data/lib/shotstack/models/output.rb +111 -26
- data/lib/shotstack/models/poster.rb +20 -8
- data/lib/shotstack/models/queued_response.rb +21 -8
- data/lib/shotstack/models/queued_response_data.rb +21 -8
- data/lib/shotstack/models/range.rb +260 -0
- data/lib/shotstack/models/render_response.rb +21 -8
- data/lib/shotstack/models/render_response_data.rb +25 -12
- data/lib/shotstack/models/shotstack_destination.rb +240 -0
- data/lib/shotstack/models/size.rb +278 -0
- data/lib/shotstack/models/soundtrack.rb +20 -8
- data/lib/shotstack/models/thumbnail.rb +21 -9
- data/lib/shotstack/models/timeline.rb +37 -13
- data/lib/shotstack/models/title_asset.rb +20 -8
- data/lib/shotstack/models/track.rb +20 -8
- data/lib/shotstack/models/transition.rb +26 -14
- data/lib/shotstack/models/video_asset.rb +33 -12
- data/lib/shotstack/version.rb +3 -3
- data/shotstack.gemspec +4 -5
- metadata +22 -27
|
@@ -1,18 +1,20 @@
|
|
|
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:
|
|
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
|
|
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.
|
|
16
18
|
class QueuedResponse
|
|
17
19
|
# `true` if successfully queued, else `false`.
|
|
18
20
|
attr_accessor :success
|
|
@@ -31,6 +33,11 @@ module Shotstack
|
|
|
31
33
|
}
|
|
32
34
|
end
|
|
33
35
|
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
|
37
|
+
def self.acceptable_attributes
|
|
38
|
+
attribute_map.values
|
|
39
|
+
end
|
|
40
|
+
|
|
34
41
|
# Attribute type mapping.
|
|
35
42
|
def self.openapi_types
|
|
36
43
|
{
|
|
@@ -137,7 +144,9 @@ module Shotstack
|
|
|
137
144
|
def build_from_hash(attributes)
|
|
138
145
|
return nil unless attributes.is_a?(Hash)
|
|
139
146
|
self.class.openapi_types.each_pair do |key, type|
|
|
140
|
-
if
|
|
147
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
148
|
+
self.send("#{key}=", nil)
|
|
149
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
141
150
|
# check to ensure the input is an array given that the attribute
|
|
142
151
|
# is documented as an array but the input is not
|
|
143
152
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
@@ -145,7 +154,7 @@ module Shotstack
|
|
|
145
154
|
end
|
|
146
155
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
147
156
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
148
|
-
end
|
|
157
|
+
end
|
|
149
158
|
end
|
|
150
159
|
|
|
151
160
|
self
|
|
@@ -157,8 +166,8 @@ module Shotstack
|
|
|
157
166
|
# @return [Object] Deserialized data
|
|
158
167
|
def _deserialize(type, value)
|
|
159
168
|
case type.to_sym
|
|
160
|
-
when :
|
|
161
|
-
|
|
169
|
+
when :Time
|
|
170
|
+
Time.parse(value)
|
|
162
171
|
when :Date
|
|
163
172
|
Date.parse(value)
|
|
164
173
|
when :String
|
|
@@ -188,7 +197,9 @@ module Shotstack
|
|
|
188
197
|
end
|
|
189
198
|
end
|
|
190
199
|
else # model
|
|
191
|
-
|
|
200
|
+
# models (e.g. Pet) or oneOf
|
|
201
|
+
klass = Shotstack.const_get(type)
|
|
202
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
192
203
|
end
|
|
193
204
|
end
|
|
194
205
|
|
|
@@ -214,7 +225,7 @@ module Shotstack
|
|
|
214
225
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
215
226
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
216
227
|
end
|
|
217
|
-
|
|
228
|
+
|
|
218
229
|
hash[param] = _to_hash(value)
|
|
219
230
|
end
|
|
220
231
|
hash
|
|
@@ -237,5 +248,7 @@ module Shotstack
|
|
|
237
248
|
value
|
|
238
249
|
end
|
|
239
250
|
end
|
|
251
|
+
|
|
240
252
|
end
|
|
253
|
+
|
|
241
254
|
end
|
|
@@ -1,18 +1,20 @@
|
|
|
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:
|
|
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
|
|
17
|
+
# The response data returned with the [QueuedResponse](#tocs_queuedresponse).
|
|
16
18
|
class QueuedResponseData
|
|
17
19
|
# Success response message or error details.
|
|
18
20
|
attr_accessor :message
|
|
@@ -28,6 +30,11 @@ module Shotstack
|
|
|
28
30
|
}
|
|
29
31
|
end
|
|
30
32
|
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
|
34
|
+
def self.acceptable_attributes
|
|
35
|
+
attribute_map.values
|
|
36
|
+
end
|
|
37
|
+
|
|
31
38
|
# Attribute type mapping.
|
|
32
39
|
def self.openapi_types
|
|
33
40
|
{
|
|
@@ -123,7 +130,9 @@ module Shotstack
|
|
|
123
130
|
def build_from_hash(attributes)
|
|
124
131
|
return nil unless attributes.is_a?(Hash)
|
|
125
132
|
self.class.openapi_types.each_pair do |key, type|
|
|
126
|
-
if
|
|
133
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
134
|
+
self.send("#{key}=", nil)
|
|
135
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
127
136
|
# check to ensure the input is an array given that the attribute
|
|
128
137
|
# is documented as an array but the input is not
|
|
129
138
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
@@ -131,7 +140,7 @@ module Shotstack
|
|
|
131
140
|
end
|
|
132
141
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
133
142
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
134
|
-
end
|
|
143
|
+
end
|
|
135
144
|
end
|
|
136
145
|
|
|
137
146
|
self
|
|
@@ -143,8 +152,8 @@ module Shotstack
|
|
|
143
152
|
# @return [Object] Deserialized data
|
|
144
153
|
def _deserialize(type, value)
|
|
145
154
|
case type.to_sym
|
|
146
|
-
when :
|
|
147
|
-
|
|
155
|
+
when :Time
|
|
156
|
+
Time.parse(value)
|
|
148
157
|
when :Date
|
|
149
158
|
Date.parse(value)
|
|
150
159
|
when :String
|
|
@@ -174,7 +183,9 @@ module Shotstack
|
|
|
174
183
|
end
|
|
175
184
|
end
|
|
176
185
|
else # model
|
|
177
|
-
|
|
186
|
+
# models (e.g. Pet) or oneOf
|
|
187
|
+
klass = Shotstack.const_get(type)
|
|
188
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
178
189
|
end
|
|
179
190
|
end
|
|
180
191
|
|
|
@@ -200,7 +211,7 @@ module Shotstack
|
|
|
200
211
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
201
212
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
202
213
|
end
|
|
203
|
-
|
|
214
|
+
|
|
204
215
|
hash[param] = _to_hash(value)
|
|
205
216
|
end
|
|
206
217
|
hash
|
|
@@ -223,5 +234,7 @@ module Shotstack
|
|
|
223
234
|
value
|
|
224
235
|
end
|
|
225
236
|
end
|
|
237
|
+
|
|
226
238
|
end
|
|
239
|
+
|
|
227
240
|
end
|
|
@@ -0,0 +1,260 @@
|
|
|
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.0.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
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. 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
|
+
class Range
|
|
19
|
+
# The point on the timeline, in seconds, to start the render from - i.e. start at second 3.
|
|
20
|
+
attr_accessor :start
|
|
21
|
+
|
|
22
|
+
# The length of the portion of the video or audio to render - i.e. render 6 seconds of the video.
|
|
23
|
+
attr_accessor :length
|
|
24
|
+
|
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
|
+
def self.attribute_map
|
|
27
|
+
{
|
|
28
|
+
:'start' => :'start',
|
|
29
|
+
:'length' => :'length'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
|
34
|
+
def self.acceptable_attributes
|
|
35
|
+
attribute_map.values
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Attribute type mapping.
|
|
39
|
+
def self.openapi_types
|
|
40
|
+
{
|
|
41
|
+
:'start' => :'Float',
|
|
42
|
+
:'length' => :'Float'
|
|
43
|
+
}
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# List of attributes with nullable: true
|
|
47
|
+
def self.openapi_nullable
|
|
48
|
+
Set.new([
|
|
49
|
+
])
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Initializes the object
|
|
53
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
54
|
+
def initialize(attributes = {})
|
|
55
|
+
if (!attributes.is_a?(Hash))
|
|
56
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Shotstack::Range` initialize method"
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Shotstack::Range`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
63
|
+
end
|
|
64
|
+
h[k.to_sym] = v
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if attributes.key?(:'start')
|
|
68
|
+
self.start = attributes[:'start']
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
if attributes.key?(:'length')
|
|
72
|
+
self.length = attributes[:'length']
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
77
|
+
# @return Array for valid properties with the reasons
|
|
78
|
+
def list_invalid_properties
|
|
79
|
+
invalid_properties = Array.new
|
|
80
|
+
if !@start.nil? && @start < 0
|
|
81
|
+
invalid_properties.push('invalid value for "start", must be greater than or equal to 0.')
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if !@length.nil? && @length < 0
|
|
85
|
+
invalid_properties.push('invalid value for "length", must be greater than or equal to 0.')
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
invalid_properties
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Check to see if the all the properties in the model are valid
|
|
92
|
+
# @return true if the model is valid
|
|
93
|
+
def valid?
|
|
94
|
+
return false if !@start.nil? && @start < 0
|
|
95
|
+
return false if !@length.nil? && @length < 0
|
|
96
|
+
true
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Custom attribute writer method with validation
|
|
100
|
+
# @param [Object] start Value to be assigned
|
|
101
|
+
def start=(start)
|
|
102
|
+
if !start.nil? && start < 0
|
|
103
|
+
fail ArgumentError, 'invalid value for "start", must be greater than or equal to 0.'
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
@start = start
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Custom attribute writer method with validation
|
|
110
|
+
# @param [Object] length Value to be assigned
|
|
111
|
+
def length=(length)
|
|
112
|
+
if !length.nil? && length < 0
|
|
113
|
+
fail ArgumentError, 'invalid value for "length", must be greater than or equal to 0.'
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
@length = length
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Checks equality by comparing each attribute.
|
|
120
|
+
# @param [Object] Object to be compared
|
|
121
|
+
def ==(o)
|
|
122
|
+
return true if self.equal?(o)
|
|
123
|
+
self.class == o.class &&
|
|
124
|
+
start == o.start &&
|
|
125
|
+
length == o.length
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# @see the `==` method
|
|
129
|
+
# @param [Object] Object to be compared
|
|
130
|
+
def eql?(o)
|
|
131
|
+
self == o
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Calculates hash code according to all attributes.
|
|
135
|
+
# @return [Integer] Hash code
|
|
136
|
+
def hash
|
|
137
|
+
[start, length].hash
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Builds the object from hash
|
|
141
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
142
|
+
# @return [Object] Returns the model itself
|
|
143
|
+
def self.build_from_hash(attributes)
|
|
144
|
+
new.build_from_hash(attributes)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Builds the object from hash
|
|
148
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
149
|
+
# @return [Object] Returns the model itself
|
|
150
|
+
def build_from_hash(attributes)
|
|
151
|
+
return nil unless attributes.is_a?(Hash)
|
|
152
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
153
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
154
|
+
self.send("#{key}=", nil)
|
|
155
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
156
|
+
# check to ensure the input is an array given that the attribute
|
|
157
|
+
# is documented as an array but the input is not
|
|
158
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
159
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
160
|
+
end
|
|
161
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
162
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
self
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Deserializes the data based on type
|
|
170
|
+
# @param string type Data type
|
|
171
|
+
# @param string value Value to be deserialized
|
|
172
|
+
# @return [Object] Deserialized data
|
|
173
|
+
def _deserialize(type, value)
|
|
174
|
+
case type.to_sym
|
|
175
|
+
when :Time
|
|
176
|
+
Time.parse(value)
|
|
177
|
+
when :Date
|
|
178
|
+
Date.parse(value)
|
|
179
|
+
when :String
|
|
180
|
+
value.to_s
|
|
181
|
+
when :Integer
|
|
182
|
+
value.to_i
|
|
183
|
+
when :Float
|
|
184
|
+
value.to_f
|
|
185
|
+
when :Boolean
|
|
186
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
187
|
+
true
|
|
188
|
+
else
|
|
189
|
+
false
|
|
190
|
+
end
|
|
191
|
+
when :Object
|
|
192
|
+
# generic object (usually a Hash), return directly
|
|
193
|
+
value
|
|
194
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
195
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
196
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
197
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
198
|
+
k_type = Regexp.last_match[:k_type]
|
|
199
|
+
v_type = Regexp.last_match[:v_type]
|
|
200
|
+
{}.tap do |hash|
|
|
201
|
+
value.each do |k, v|
|
|
202
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
else # model
|
|
206
|
+
# models (e.g. Pet) or oneOf
|
|
207
|
+
klass = Shotstack.const_get(type)
|
|
208
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Returns the string representation of the object
|
|
213
|
+
# @return [String] String presentation of the object
|
|
214
|
+
def to_s
|
|
215
|
+
to_hash.to_s
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
219
|
+
# @return [Hash] Returns the object in the form of hash
|
|
220
|
+
def to_body
|
|
221
|
+
to_hash
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# Returns the object in the form of hash
|
|
225
|
+
# @return [Hash] Returns the object in the form of hash
|
|
226
|
+
def to_hash
|
|
227
|
+
hash = {}
|
|
228
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
229
|
+
value = self.send(attr)
|
|
230
|
+
if value.nil?
|
|
231
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
232
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
hash[param] = _to_hash(value)
|
|
236
|
+
end
|
|
237
|
+
hash
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# Outputs non-array value in the form of hash
|
|
241
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
242
|
+
# @param [Object] value Any valid value
|
|
243
|
+
# @return [Hash] Returns the value in the form of hash
|
|
244
|
+
def _to_hash(value)
|
|
245
|
+
if value.is_a?(Array)
|
|
246
|
+
value.compact.map { |v| _to_hash(v) }
|
|
247
|
+
elsif value.is_a?(Hash)
|
|
248
|
+
{}.tap do |hash|
|
|
249
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
250
|
+
end
|
|
251
|
+
elsif value.respond_to? :to_hash
|
|
252
|
+
value.to_hash
|
|
253
|
+
else
|
|
254
|
+
value
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
end
|
|
@@ -1,18 +1,20 @@
|
|
|
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:
|
|
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
|
|
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.
|
|
16
18
|
class RenderResponse
|
|
17
19
|
# `true` if status available, else `false`.
|
|
18
20
|
attr_accessor :success
|
|
@@ -31,6 +33,11 @@ module Shotstack
|
|
|
31
33
|
}
|
|
32
34
|
end
|
|
33
35
|
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
|
37
|
+
def self.acceptable_attributes
|
|
38
|
+
attribute_map.values
|
|
39
|
+
end
|
|
40
|
+
|
|
34
41
|
# Attribute type mapping.
|
|
35
42
|
def self.openapi_types
|
|
36
43
|
{
|
|
@@ -137,7 +144,9 @@ module Shotstack
|
|
|
137
144
|
def build_from_hash(attributes)
|
|
138
145
|
return nil unless attributes.is_a?(Hash)
|
|
139
146
|
self.class.openapi_types.each_pair do |key, type|
|
|
140
|
-
if
|
|
147
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
148
|
+
self.send("#{key}=", nil)
|
|
149
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
141
150
|
# check to ensure the input is an array given that the attribute
|
|
142
151
|
# is documented as an array but the input is not
|
|
143
152
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
@@ -145,7 +154,7 @@ module Shotstack
|
|
|
145
154
|
end
|
|
146
155
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
147
156
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
148
|
-
end
|
|
157
|
+
end
|
|
149
158
|
end
|
|
150
159
|
|
|
151
160
|
self
|
|
@@ -157,8 +166,8 @@ module Shotstack
|
|
|
157
166
|
# @return [Object] Deserialized data
|
|
158
167
|
def _deserialize(type, value)
|
|
159
168
|
case type.to_sym
|
|
160
|
-
when :
|
|
161
|
-
|
|
169
|
+
when :Time
|
|
170
|
+
Time.parse(value)
|
|
162
171
|
when :Date
|
|
163
172
|
Date.parse(value)
|
|
164
173
|
when :String
|
|
@@ -188,7 +197,9 @@ module Shotstack
|
|
|
188
197
|
end
|
|
189
198
|
end
|
|
190
199
|
else # model
|
|
191
|
-
|
|
200
|
+
# models (e.g. Pet) or oneOf
|
|
201
|
+
klass = Shotstack.const_get(type)
|
|
202
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
192
203
|
end
|
|
193
204
|
end
|
|
194
205
|
|
|
@@ -214,7 +225,7 @@ module Shotstack
|
|
|
214
225
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
215
226
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
216
227
|
end
|
|
217
|
-
|
|
228
|
+
|
|
218
229
|
hash[param] = _to_hash(value)
|
|
219
230
|
end
|
|
220
231
|
hash
|
|
@@ -237,5 +248,7 @@ module Shotstack
|
|
|
237
248
|
value
|
|
238
249
|
end
|
|
239
250
|
end
|
|
251
|
+
|
|
240
252
|
end
|
|
253
|
+
|
|
241
254
|
end
|