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,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
|
# An edit defines the content of the video in a timeline and the output format.
|
@@ -19,24 +20,56 @@ module Shotstack
|
|
19
20
|
|
20
21
|
attr_accessor :output
|
21
22
|
|
22
|
-
# An optional webhook callback URL used to receive status notifications when a render completes or fails.
|
23
|
+
# An optional webhook callback URL used to receive status notifications when a render completes or fails. See [webhooks](https://shotstack.gitbook.io/docs/guides/architecting-an-application/webhooks) for more details.
|
23
24
|
attr_accessor :callback
|
24
25
|
|
26
|
+
# The disk type to use for storing footage and assets for each render. See [disk types](https://shotstack.gitbook.io/docs/guides/architecting-an-application/disk-types) for more details. <ul> <li>`local` - optimised for high speed rendering with up to 512MB storage</li> <li>`mount` - optimised for larger file sizes and longer videos with 5GB for source footage and 512MB for output render</li> </ul>
|
27
|
+
attr_accessor :disk
|
28
|
+
|
29
|
+
class EnumAttributeValidator
|
30
|
+
attr_reader :datatype
|
31
|
+
attr_reader :allowable_values
|
32
|
+
|
33
|
+
def initialize(datatype, allowable_values)
|
34
|
+
@allowable_values = allowable_values.map do |value|
|
35
|
+
case datatype.to_s
|
36
|
+
when /Integer/i
|
37
|
+
value.to_i
|
38
|
+
when /Float/i
|
39
|
+
value.to_f
|
40
|
+
else
|
41
|
+
value
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def valid?(value)
|
47
|
+
!value || allowable_values.include?(value)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
25
51
|
# Attribute mapping from ruby-style variable name to JSON key.
|
26
52
|
def self.attribute_map
|
27
53
|
{
|
28
54
|
:'timeline' => :'timeline',
|
29
55
|
:'output' => :'output',
|
30
|
-
:'callback' => :'callback'
|
56
|
+
:'callback' => :'callback',
|
57
|
+
:'disk' => :'disk'
|
31
58
|
}
|
32
59
|
end
|
33
60
|
|
61
|
+
# Returns all the JSON keys this model knows about
|
62
|
+
def self.acceptable_attributes
|
63
|
+
attribute_map.values
|
64
|
+
end
|
65
|
+
|
34
66
|
# Attribute type mapping.
|
35
67
|
def self.openapi_types
|
36
68
|
{
|
37
69
|
:'timeline' => :'Timeline',
|
38
70
|
:'output' => :'Output',
|
39
|
-
:'callback' => :'String'
|
71
|
+
:'callback' => :'String',
|
72
|
+
:'disk' => :'String'
|
40
73
|
}
|
41
74
|
end
|
42
75
|
|
@@ -72,6 +105,12 @@ module Shotstack
|
|
72
105
|
if attributes.key?(:'callback')
|
73
106
|
self.callback = attributes[:'callback']
|
74
107
|
end
|
108
|
+
|
109
|
+
if attributes.key?(:'disk')
|
110
|
+
self.disk = attributes[:'disk']
|
111
|
+
else
|
112
|
+
self.disk = 'local'
|
113
|
+
end
|
75
114
|
end
|
76
115
|
|
77
116
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -94,9 +133,21 @@ module Shotstack
|
|
94
133
|
def valid?
|
95
134
|
return false if @timeline.nil?
|
96
135
|
return false if @output.nil?
|
136
|
+
disk_validator = EnumAttributeValidator.new('String', ["local", "mount"])
|
137
|
+
return false unless disk_validator.valid?(@disk)
|
97
138
|
true
|
98
139
|
end
|
99
140
|
|
141
|
+
# Custom attribute writer method checking allowed values (enum).
|
142
|
+
# @param [Object] disk Object to be assigned
|
143
|
+
def disk=(disk)
|
144
|
+
validator = EnumAttributeValidator.new('String', ["local", "mount"])
|
145
|
+
unless validator.valid?(disk)
|
146
|
+
fail ArgumentError, "invalid value for \"disk\", must be one of #{validator.allowable_values}."
|
147
|
+
end
|
148
|
+
@disk = disk
|
149
|
+
end
|
150
|
+
|
100
151
|
# Checks equality by comparing each attribute.
|
101
152
|
# @param [Object] Object to be compared
|
102
153
|
def ==(o)
|
@@ -104,7 +155,8 @@ module Shotstack
|
|
104
155
|
self.class == o.class &&
|
105
156
|
timeline == o.timeline &&
|
106
157
|
output == o.output &&
|
107
|
-
callback == o.callback
|
158
|
+
callback == o.callback &&
|
159
|
+
disk == o.disk
|
108
160
|
end
|
109
161
|
|
110
162
|
# @see the `==` method
|
@@ -116,7 +168,7 @@ module Shotstack
|
|
116
168
|
# Calculates hash code according to all attributes.
|
117
169
|
# @return [Integer] Hash code
|
118
170
|
def hash
|
119
|
-
[timeline, output, callback].hash
|
171
|
+
[timeline, output, callback, disk].hash
|
120
172
|
end
|
121
173
|
|
122
174
|
# Builds the object from hash
|
@@ -132,7 +184,9 @@ module Shotstack
|
|
132
184
|
def build_from_hash(attributes)
|
133
185
|
return nil unless attributes.is_a?(Hash)
|
134
186
|
self.class.openapi_types.each_pair do |key, type|
|
135
|
-
if
|
187
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
188
|
+
self.send("#{key}=", nil)
|
189
|
+
elsif type =~ /\AArray<(.*)>/i
|
136
190
|
# check to ensure the input is an array given that the attribute
|
137
191
|
# is documented as an array but the input is not
|
138
192
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -140,7 +194,7 @@ module Shotstack
|
|
140
194
|
end
|
141
195
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
142
196
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
143
|
-
end
|
197
|
+
end
|
144
198
|
end
|
145
199
|
|
146
200
|
self
|
@@ -152,8 +206,8 @@ module Shotstack
|
|
152
206
|
# @return [Object] Deserialized data
|
153
207
|
def _deserialize(type, value)
|
154
208
|
case type.to_sym
|
155
|
-
when :
|
156
|
-
|
209
|
+
when :Time
|
210
|
+
Time.parse(value)
|
157
211
|
when :Date
|
158
212
|
Date.parse(value)
|
159
213
|
when :String
|
@@ -183,7 +237,9 @@ module Shotstack
|
|
183
237
|
end
|
184
238
|
end
|
185
239
|
else # model
|
186
|
-
|
240
|
+
# models (e.g. Pet) or oneOf
|
241
|
+
klass = Shotstack.const_get(type)
|
242
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
187
243
|
end
|
188
244
|
end
|
189
245
|
|
@@ -209,7 +265,7 @@ module Shotstack
|
|
209
265
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
210
266
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
211
267
|
end
|
212
|
-
|
268
|
+
|
213
269
|
hash[param] = _to_hash(value)
|
214
270
|
end
|
215
271
|
hash
|
@@ -232,5 +288,7 @@ module Shotstack
|
|
232
288
|
value
|
233
289
|
end
|
234
290
|
end
|
291
|
+
|
235
292
|
end
|
293
|
+
|
236
294
|
end
|
@@ -1,19 +1,20 @@
|
|
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
|
-
# Download a custom font to use with the HTML asset type, using the font name in the CSS or font tag.
|
17
|
+
# Download a custom font to use with the HTML asset type, using the font name in the CSS or font tag. See our [custom fonts](https://shotstack.io/learn/html-custom-fonts/) getting started guide for more details.
|
17
18
|
class Font
|
18
19
|
# The URL of the font file. The URL must be publicly accessible or include credentials.
|
19
20
|
attr_accessor :src
|
@@ -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
|
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
|
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 :
|
133
|
-
|
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
|
-
|
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
|
@@ -1,40 +1,41 @@
|
|
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
|
require_relative 'asset'
|
15
16
|
|
16
17
|
module Shotstack
|
17
18
|
# The HtmlAsset clip type lets you create text based layout and formatting using HTML and CSS. You can also set the height and width of a bounding box for the HTML content to sit within. Text and elements will wrap within the bounding box.
|
18
19
|
class HtmlAsset < Asset
|
19
|
-
# The type of asset - set to
|
20
|
+
# The type of asset - set to `html` for HTML.
|
20
21
|
attr_accessor :type
|
21
22
|
|
22
|
-
# The HTML text string.
|
23
|
+
# The HTML text string. See list of [supported HTML tags](https://shotstack.gitbook.io/docs/guides/architecting-an-application/html-support#supported-html-tags).
|
23
24
|
attr_accessor :html
|
24
25
|
|
25
|
-
# The CSS text string to apply styling to the HTML.
|
26
|
+
# The CSS text string to apply styling to the HTML. See list of [support CSS properties](https://shotstack.gitbook.io/docs/guides/architecting-an-application/html-support#supported-html-tags).
|
26
27
|
attr_accessor :css
|
27
28
|
|
28
|
-
# Set the width of the HTML asset bounding box. Text will wrap to fill the bounding box.
|
29
|
+
# Set the width of the HTML asset bounding box in pixels. Text will wrap to fill the bounding box.
|
29
30
|
attr_accessor :width
|
30
31
|
|
31
|
-
# Set the width of the HTML asset bounding box. Text and elements will be masked if they exceed the height of the bounding box.
|
32
|
+
# Set the width of the HTML asset bounding box in pixels. Text and elements will be masked if they exceed the height of the bounding box.
|
32
33
|
attr_accessor :height
|
33
34
|
|
34
35
|
# Apply a background color behind the HTML bounding box using. Set the text color using hexadecimal color notation. Transparency is supported by setting the first two characters of the hex string (opposite to HTML), i.e. #80ffffff will be white with 50% transparency.
|
35
36
|
attr_accessor :background
|
36
37
|
|
37
|
-
# Place the HTML in one of nine predefined positions within the HTML area.
|
38
|
+
# Place the HTML in one of nine predefined positions within the HTML area. <ul> <li>`top` - top (center)</li> <li>`topRight` - top right</li> <li>`right` - right (center)</li> <li>`bottomRight` - bottom right</li> <li>`bottom` - bottom (center)</li> <li>`bottomLeft` - bottom left</li> <li>`left` - left (center)</li> <li>`topLeft` - top left</li> <li>`center` - center</li> </ul>
|
38
39
|
attr_accessor :position
|
39
40
|
|
40
41
|
class EnumAttributeValidator
|
@@ -72,14 +73,19 @@ module Shotstack
|
|
72
73
|
}
|
73
74
|
end
|
74
75
|
|
76
|
+
# Returns all the JSON keys this model knows about
|
77
|
+
def self.acceptable_attributes
|
78
|
+
attribute_map.values
|
79
|
+
end
|
80
|
+
|
75
81
|
# Attribute type mapping.
|
76
82
|
def self.openapi_types
|
77
83
|
{
|
78
84
|
:'type' => :'String',
|
79
85
|
:'html' => :'String',
|
80
86
|
:'css' => :'String',
|
81
|
-
:'width' => :'
|
82
|
-
:'height' => :'
|
87
|
+
:'width' => :'Integer',
|
88
|
+
:'height' => :'Integer',
|
83
89
|
:'background' => :'String',
|
84
90
|
:'position' => :'String'
|
85
91
|
}
|
@@ -215,7 +221,9 @@ module Shotstack
|
|
215
221
|
def build_from_hash(attributes)
|
216
222
|
return nil unless attributes.is_a?(Hash)
|
217
223
|
self.class.openapi_types.each_pair do |key, type|
|
218
|
-
if
|
224
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
225
|
+
self.send("#{key}=", nil)
|
226
|
+
elsif type =~ /\AArray<(.*)>/i
|
219
227
|
# check to ensure the input is an array given that the attribute
|
220
228
|
# is documented as an array but the input is not
|
221
229
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -223,7 +231,7 @@ module Shotstack
|
|
223
231
|
end
|
224
232
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
225
233
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
226
|
-
end
|
234
|
+
end
|
227
235
|
end
|
228
236
|
|
229
237
|
self
|
@@ -235,8 +243,8 @@ module Shotstack
|
|
235
243
|
# @return [Object] Deserialized data
|
236
244
|
def _deserialize(type, value)
|
237
245
|
case type.to_sym
|
238
|
-
when :
|
239
|
-
|
246
|
+
when :Time
|
247
|
+
Time.parse(value)
|
240
248
|
when :Date
|
241
249
|
Date.parse(value)
|
242
250
|
when :String
|
@@ -266,7 +274,9 @@ module Shotstack
|
|
266
274
|
end
|
267
275
|
end
|
268
276
|
else # model
|
269
|
-
|
277
|
+
# models (e.g. Pet) or oneOf
|
278
|
+
klass = Shotstack.const_get(type)
|
279
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
270
280
|
end
|
271
281
|
end
|
272
282
|
|
@@ -292,7 +302,7 @@ module Shotstack
|
|
292
302
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
293
303
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
294
304
|
end
|
295
|
-
|
305
|
+
|
296
306
|
hash[param] = _to_hash(value)
|
297
307
|
end
|
298
308
|
hash
|
@@ -315,5 +325,7 @@ module Shotstack
|
|
315
325
|
value
|
316
326
|
end
|
317
327
|
end
|
328
|
+
|
318
329
|
end
|
330
|
+
|
319
331
|
end
|
@@ -1,40 +1,50 @@
|
|
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
|
require_relative 'asset'
|
15
16
|
|
16
17
|
module Shotstack
|
17
18
|
# The ImageAsset is used to create video from images. The src must be a publicly accessible URL to an image resource such as a jpg or png file.
|
18
19
|
class ImageAsset < Asset
|
19
|
-
# The type of asset - set to
|
20
|
+
# The type of asset - set to `image` for images.
|
20
21
|
attr_accessor :type
|
21
22
|
|
22
|
-
# The image source URL. The URL must be publicly accessible or include credentials.
|
23
|
+
# The image source URL. The URL must be publicly accessible or include credentials.
|
23
24
|
attr_accessor :src
|
24
25
|
|
26
|
+
attr_accessor :crop
|
27
|
+
|
25
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
26
29
|
def self.attribute_map
|
27
30
|
{
|
28
31
|
:'type' => :'type',
|
29
|
-
:'src' => :'src'
|
32
|
+
:'src' => :'src',
|
33
|
+
:'crop' => :'crop'
|
30
34
|
}
|
31
35
|
end
|
32
36
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
38
|
+
def self.acceptable_attributes
|
39
|
+
attribute_map.values
|
40
|
+
end
|
41
|
+
|
33
42
|
# Attribute type mapping.
|
34
43
|
def self.openapi_types
|
35
44
|
{
|
36
45
|
:'type' => :'String',
|
37
|
-
:'src' => :'String'
|
46
|
+
:'src' => :'String',
|
47
|
+
:'crop' => :'Crop'
|
38
48
|
}
|
39
49
|
end
|
40
50
|
|
@@ -68,6 +78,10 @@ module Shotstack
|
|
68
78
|
if attributes.key?(:'src')
|
69
79
|
self.src = attributes[:'src']
|
70
80
|
end
|
81
|
+
|
82
|
+
if attributes.key?(:'crop')
|
83
|
+
self.crop = attributes[:'crop']
|
84
|
+
end
|
71
85
|
end
|
72
86
|
|
73
87
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -99,7 +113,8 @@ module Shotstack
|
|
99
113
|
return true if self.equal?(o)
|
100
114
|
self.class == o.class &&
|
101
115
|
type == o.type &&
|
102
|
-
src == o.src
|
116
|
+
src == o.src &&
|
117
|
+
crop == o.crop
|
103
118
|
end
|
104
119
|
|
105
120
|
# @see the `==` method
|
@@ -111,7 +126,7 @@ module Shotstack
|
|
111
126
|
# Calculates hash code according to all attributes.
|
112
127
|
# @return [Integer] Hash code
|
113
128
|
def hash
|
114
|
-
[type, src].hash
|
129
|
+
[type, src, crop].hash
|
115
130
|
end
|
116
131
|
|
117
132
|
# Builds the object from hash
|
@@ -127,7 +142,9 @@ module Shotstack
|
|
127
142
|
def build_from_hash(attributes)
|
128
143
|
return nil unless attributes.is_a?(Hash)
|
129
144
|
self.class.openapi_types.each_pair do |key, type|
|
130
|
-
if
|
145
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
146
|
+
self.send("#{key}=", nil)
|
147
|
+
elsif type =~ /\AArray<(.*)>/i
|
131
148
|
# check to ensure the input is an array given that the attribute
|
132
149
|
# is documented as an array but the input is not
|
133
150
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -135,7 +152,7 @@ module Shotstack
|
|
135
152
|
end
|
136
153
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
137
154
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
138
|
-
end
|
155
|
+
end
|
139
156
|
end
|
140
157
|
|
141
158
|
self
|
@@ -147,8 +164,8 @@ module Shotstack
|
|
147
164
|
# @return [Object] Deserialized data
|
148
165
|
def _deserialize(type, value)
|
149
166
|
case type.to_sym
|
150
|
-
when :
|
151
|
-
|
167
|
+
when :Time
|
168
|
+
Time.parse(value)
|
152
169
|
when :Date
|
153
170
|
Date.parse(value)
|
154
171
|
when :String
|
@@ -178,7 +195,9 @@ module Shotstack
|
|
178
195
|
end
|
179
196
|
end
|
180
197
|
else # model
|
181
|
-
|
198
|
+
# models (e.g. Pet) or oneOf
|
199
|
+
klass = Shotstack.const_get(type)
|
200
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
182
201
|
end
|
183
202
|
end
|
184
203
|
|
@@ -204,7 +223,7 @@ module Shotstack
|
|
204
223
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
205
224
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
206
225
|
end
|
207
|
-
|
226
|
+
|
208
227
|
hash[param] = _to_hash(value)
|
209
228
|
end
|
210
229
|
hash
|
@@ -227,5 +246,7 @@ module Shotstack
|
|
227
246
|
value
|
228
247
|
end
|
229
248
|
end
|
249
|
+
|
230
250
|
end
|
251
|
+
|
231
252
|
end
|