shotstack 0.2.1 → 0.2.6

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.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +9 -0
  3. data/README.md +387 -23
  4. data/Rakefile +10 -0
  5. data/lib/shotstack/api/create_api.rb +158 -0
  6. data/lib/shotstack/api/edit_api.rb +20 -20
  7. data/lib/shotstack/api/ingest_api.rb +338 -0
  8. data/lib/shotstack/api/serve_api.rb +76 -8
  9. data/lib/shotstack/api_client.rb +28 -24
  10. data/lib/shotstack/api_error.rb +3 -2
  11. data/lib/shotstack/configuration.rb +55 -9
  12. data/lib/shotstack/models/asset.rb +4 -4
  13. data/lib/shotstack/models/asset_render_response.rb +23 -20
  14. data/lib/shotstack/models/asset_response.rb +23 -20
  15. data/lib/shotstack/models/asset_response_attributes.rb +38 -21
  16. data/lib/shotstack/models/asset_response_data.rb +30 -20
  17. data/lib/shotstack/models/audio_asset.rb +57 -23
  18. data/lib/shotstack/models/audio_enhancement.rb +43 -0
  19. data/lib/shotstack/models/clip.rb +29 -33
  20. data/lib/shotstack/models/crop.rb +40 -28
  21. data/lib/shotstack/models/destinations.rb +78 -244
  22. data/lib/shotstack/models/did_generated_asset.rb +273 -0
  23. data/lib/shotstack/models/did_generated_asset_options.rb +54 -0
  24. data/lib/shotstack/models/did_text_to_avatar_options.rb +313 -0
  25. data/lib/shotstack/models/dolby_enhancement.rb +239 -0
  26. data/lib/shotstack/models/dolby_enhancement_options.rb +257 -0
  27. data/lib/shotstack/models/edit.rb +22 -24
  28. data/lib/shotstack/models/eleven_labs_generated_asset.rb +273 -0
  29. data/lib/shotstack/models/eleven_labs_generated_asset_options.rb +54 -0
  30. data/lib/shotstack/models/eleven_labs_text_to_speech_options.rb +303 -0
  31. data/lib/shotstack/models/enhancements.rb +215 -0
  32. data/lib/shotstack/models/flip_transformation.rb +16 -24
  33. data/lib/shotstack/models/font.rb +18 -20
  34. data/lib/shotstack/models/generated_asset.rb +48 -0
  35. data/lib/shotstack/models/generated_asset_error_response.rb +225 -0
  36. data/lib/shotstack/models/generated_asset_error_response_data.rb +257 -0
  37. data/lib/shotstack/models/generated_asset_response.rb +222 -0
  38. data/lib/shotstack/models/generated_asset_response_attributes.rb +376 -0
  39. data/lib/shotstack/models/generated_asset_response_data.rb +256 -0
  40. data/lib/shotstack/models/google_cloud_storage_destination.rb +232 -0
  41. data/lib/shotstack/models/google_cloud_storage_destination_options.rb +243 -0
  42. data/lib/shotstack/models/google_drive_destination.rb +239 -0
  43. data/lib/shotstack/models/google_drive_destination_options.rb +233 -0
  44. data/lib/shotstack/models/hey_gen_generated_asset.rb +273 -0
  45. data/lib/shotstack/models/hey_gen_generated_asset_options.rb +54 -0
  46. data/lib/shotstack/models/hey_gen_text_to_avatar_options.rb +396 -0
  47. data/lib/shotstack/models/html_asset.rb +20 -26
  48. data/lib/shotstack/models/image_asset.rb +18 -20
  49. data/lib/shotstack/models/ingest_error_response.rb +225 -0
  50. data/lib/shotstack/models/ingest_error_response_data.rb +257 -0
  51. data/lib/shotstack/models/luma_asset.rb +18 -20
  52. data/lib/shotstack/models/merge_field.rb +20 -20
  53. data/lib/shotstack/models/mux_destination.rb +18 -22
  54. data/lib/shotstack/models/mux_destination_options.rb +50 -25
  55. data/lib/shotstack/models/offset.rb +46 -46
  56. data/lib/shotstack/models/open_ai_generated_asset.rb +273 -0
  57. data/lib/shotstack/models/open_ai_generated_asset_options.rb +54 -0
  58. data/lib/shotstack/models/open_ai_text_generator_options.rb +313 -0
  59. data/lib/shotstack/models/output.rb +40 -35
  60. data/lib/shotstack/models/outputs.rb +227 -0
  61. data/lib/shotstack/models/outputs_response.rb +218 -0
  62. data/lib/shotstack/models/poster.rb +18 -20
  63. data/lib/shotstack/models/probe_response.rb +22 -20
  64. data/lib/shotstack/models/queued_response.rb +22 -20
  65. data/lib/shotstack/models/queued_response_data.rb +20 -20
  66. data/lib/shotstack/models/queued_source_response.rb +222 -0
  67. data/lib/shotstack/models/queued_source_response_data.rb +240 -0
  68. data/lib/shotstack/models/range.rb +26 -22
  69. data/lib/shotstack/models/render_response.rb +22 -20
  70. data/lib/shotstack/models/render_response_data.rb +24 -35
  71. data/lib/shotstack/models/rendition.rb +429 -0
  72. data/lib/shotstack/models/rendition_response_attributes.rb +336 -0
  73. data/lib/shotstack/models/rotate_transformation.rb +16 -22
  74. data/lib/shotstack/models/s3_destination.rb +232 -0
  75. data/lib/shotstack/models/s3_destination_options.rb +270 -0
  76. data/lib/shotstack/models/shotstack_destination.rb +19 -25
  77. data/lib/shotstack/models/shotstack_generated_asset.rb +273 -0
  78. data/lib/shotstack/models/shotstack_generated_asset_options.rb +60 -0
  79. data/lib/shotstack/models/shotstack_image_to_video_options.rb +298 -0
  80. data/lib/shotstack/models/shotstack_text_generator_options.rb +274 -0
  81. data/lib/shotstack/models/shotstack_text_to_image_options.rb +308 -0
  82. data/lib/shotstack/models/shotstack_text_to_speech_options.rb +339 -0
  83. data/lib/shotstack/models/size.rb +39 -35
  84. data/lib/shotstack/models/skew_transformation.rb +16 -24
  85. data/lib/shotstack/models/soundtrack.rb +18 -22
  86. data/lib/shotstack/models/source.rb +244 -0
  87. data/lib/shotstack/models/source_list_response.rb +225 -0
  88. data/lib/shotstack/models/source_response.rb +222 -0
  89. data/lib/shotstack/models/source_response_attributes.rb +373 -0
  90. data/lib/shotstack/models/source_response_data.rb +256 -0
  91. data/lib/shotstack/models/speed.rb +254 -0
  92. data/lib/shotstack/models/stability_ai_generated_asset.rb +273 -0
  93. data/lib/shotstack/models/stability_ai_generated_asset_options.rb +54 -0
  94. data/lib/shotstack/models/stability_ai_text_to_image_options.rb +390 -0
  95. data/lib/shotstack/models/template.rb +18 -20
  96. data/lib/shotstack/models/template_data_response.rb +24 -22
  97. data/lib/shotstack/models/template_data_response_data.rb +25 -22
  98. data/lib/shotstack/models/template_list_response.rb +24 -22
  99. data/lib/shotstack/models/template_list_response_data.rb +20 -20
  100. data/lib/shotstack/models/template_list_response_item.rb +20 -30
  101. data/lib/shotstack/models/template_render.rb +19 -21
  102. data/lib/shotstack/models/template_response.rb +23 -21
  103. data/lib/shotstack/models/template_response_data.rb +20 -20
  104. data/lib/shotstack/models/thumbnail.rb +20 -20
  105. data/lib/shotstack/models/timeline.rb +19 -25
  106. data/lib/shotstack/models/title_asset.rb +19 -27
  107. data/lib/shotstack/models/track.rb +18 -20
  108. data/lib/shotstack/models/transcription.rb +250 -0
  109. data/lib/shotstack/models/transfer.rb +259 -0
  110. data/lib/shotstack/models/transfer_response.rb +222 -0
  111. data/lib/shotstack/models/transfer_response_attributes.rb +280 -0
  112. data/lib/shotstack/models/transfer_response_data.rb +225 -0
  113. data/lib/shotstack/models/transformation.rb +16 -20
  114. data/lib/shotstack/models/transition.rb +16 -20
  115. data/lib/shotstack/models/upload_response.rb +222 -0
  116. data/lib/shotstack/models/upload_response_attributes.rb +257 -0
  117. data/lib/shotstack/models/upload_response_data.rb +256 -0
  118. data/lib/shotstack/models/video_asset.rb +102 -22
  119. data/lib/shotstack/version.rb +3 -3
  120. data/lib/shotstack.rb +63 -2
  121. data/shotstack.gemspec +8 -8
  122. metadata +80 -24
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #Shotstack
3
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.io/docs/guide/) 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>
4
+ # Official Ruby SDK for the Shotstack Cloud Video Editing API
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.4.0
9
+ Generator version: 7.4.0
10
10
 
11
11
  =end
12
12
 
@@ -28,6 +28,9 @@ module Shotstack
28
28
  # Set the volume for the audio clip between 0 and 1 where 0 is muted and 1 is full volume (defaults to 1).
29
29
  attr_accessor :volume
30
30
 
31
+ # Adjust the playback speed of the audio clip between 0 (paused) and 10 (10x normal speed), where 1 is normal speed (defaults to 1). Adjusting the speed will also adjust the duration of the clip and may require you to adjust the Clip length. For example, if you set speed to 0.5, the clip will need to be 2x as long to play the entire audio (i.e. original length / 0.5). If you set speed to 2, the clip will need to be half as long to play the entire audio (i.e. original length / 2).
32
+ attr_accessor :speed
33
+
31
34
  # The effect to apply to the audio asset <ul> <li>`fadeIn` - fade volume in only</li> <li>`fadeOut` - fade volume out only</li> <li>`fadeInFadeOut` - fade volume in and out</li> </ul>
32
35
  attr_accessor :effect
33
36
 
@@ -60,6 +63,7 @@ module Shotstack
60
63
  :'src' => :'src',
61
64
  :'trim' => :'trim',
62
65
  :'volume' => :'volume',
66
+ :'speed' => :'speed',
63
67
  :'effect' => :'effect'
64
68
  }
65
69
  end
@@ -76,6 +80,7 @@ module Shotstack
76
80
  :'src' => :'String',
77
81
  :'trim' => :'Float',
78
82
  :'volume' => :'Float',
83
+ :'speed' => :'Float',
79
84
  :'effect' => :'String'
80
85
  }
81
86
  end
@@ -109,6 +114,8 @@ module Shotstack
109
114
 
110
115
  if attributes.key?(:'src')
111
116
  self.src = attributes[:'src']
117
+ else
118
+ self.src = nil
112
119
  end
113
120
 
114
121
  if attributes.key?(:'trim')
@@ -117,8 +124,10 @@ module Shotstack
117
124
 
118
125
  if attributes.key?(:'volume')
119
126
  self.volume = attributes[:'volume']
120
- else
121
- self.volume = 1
127
+ end
128
+
129
+ if attributes.key?(:'speed')
130
+ self.speed = attributes[:'speed']
122
131
  end
123
132
 
124
133
  if attributes.key?(:'effect')
@@ -129,6 +138,7 @@ module Shotstack
129
138
  # Show invalid properties with the reasons. Usually used together with valid?
130
139
  # @return Array for valid properties with the reasons
131
140
  def list_invalid_properties
141
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
132
142
  invalid_properties = Array.new
133
143
  if @type.nil?
134
144
  invalid_properties.push('invalid value for "type", type cannot be nil.')
@@ -138,19 +148,48 @@ module Shotstack
138
148
  invalid_properties.push('invalid value for "src", src cannot be nil.')
139
149
  end
140
150
 
151
+ if !@speed.nil? && @speed > 10
152
+ invalid_properties.push('invalid value for "speed", must be smaller than or equal to 10.')
153
+ end
154
+
155
+ if !@speed.nil? && @speed < 0
156
+ invalid_properties.push('invalid value for "speed", must be greater than or equal to 0.')
157
+ end
158
+
141
159
  invalid_properties
142
160
  end
143
161
 
144
162
  # Check to see if the all the properties in the model are valid
145
163
  # @return true if the model is valid
146
164
  def valid?
165
+ warn '[DEPRECATED] the `valid?` method is obsolete'
147
166
  return false if @type.nil?
148
167
  return false if @src.nil?
168
+ return false if !@speed.nil? && @speed > 10
169
+ return false if !@speed.nil? && @speed < 0
149
170
  effect_validator = EnumAttributeValidator.new('String', ["fadeIn", "fadeOut", "fadeInFadeOut"])
150
171
  return false unless effect_validator.valid?(@effect)
151
172
  true
152
173
  end
153
174
 
175
+ # Custom attribute writer method with validation
176
+ # @param [Object] speed Value to be assigned
177
+ def speed=(speed)
178
+ if speed.nil?
179
+ fail ArgumentError, 'speed cannot be nil'
180
+ end
181
+
182
+ if speed > 10
183
+ fail ArgumentError, 'invalid value for "speed", must be smaller than or equal to 10.'
184
+ end
185
+
186
+ if speed < 0
187
+ fail ArgumentError, 'invalid value for "speed", must be greater than or equal to 0.'
188
+ end
189
+
190
+ @speed = speed
191
+ end
192
+
154
193
  # Custom attribute writer method checking allowed values (enum).
155
194
  # @param [Object] effect Object to be assigned
156
195
  def effect=(effect)
@@ -170,6 +209,7 @@ module Shotstack
170
209
  src == o.src &&
171
210
  trim == o.trim &&
172
211
  volume == o.volume &&
212
+ speed == o.speed &&
173
213
  effect == o.effect
174
214
  end
175
215
 
@@ -182,43 +222,37 @@ module Shotstack
182
222
  # Calculates hash code according to all attributes.
183
223
  # @return [Integer] Hash code
184
224
  def hash
185
- [type, src, trim, volume, effect].hash
225
+ [type, src, trim, volume, speed, effect].hash
186
226
  end
187
227
 
188
228
  # Builds the object from hash
189
229
  # @param [Hash] attributes Model attributes in the form of hash
190
230
  # @return [Object] Returns the model itself
191
231
  def self.build_from_hash(attributes)
192
- new.build_from_hash(attributes)
193
- end
194
-
195
- # Builds the object from hash
196
- # @param [Hash] attributes Model attributes in the form of hash
197
- # @return [Object] Returns the model itself
198
- def build_from_hash(attributes)
199
232
  return nil unless attributes.is_a?(Hash)
200
- self.class.openapi_types.each_pair do |key, type|
201
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
202
- self.send("#{key}=", nil)
233
+ attributes = attributes.transform_keys(&:to_sym)
234
+ transformed_hash = {}
235
+ openapi_types.each_pair do |key, type|
236
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
237
+ transformed_hash["#{key}"] = nil
203
238
  elsif type =~ /\AArray<(.*)>/i
204
239
  # check to ensure the input is an array given that the attribute
205
240
  # is documented as an array but the input is not
206
- if attributes[self.class.attribute_map[key]].is_a?(Array)
207
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
241
+ if attributes[attribute_map[key]].is_a?(Array)
242
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
208
243
  end
209
- elsif !attributes[self.class.attribute_map[key]].nil?
210
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
244
+ elsif !attributes[attribute_map[key]].nil?
245
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
211
246
  end
212
247
  end
213
-
214
- self
248
+ new(transformed_hash)
215
249
  end
216
250
 
217
251
  # Deserializes the data based on type
218
252
  # @param string type Data type
219
253
  # @param string value Value to be deserialized
220
254
  # @return [Object] Deserialized data
221
- def _deserialize(type, value)
255
+ def self._deserialize(type, value)
222
256
  case type.to_sym
223
257
  when :Time
224
258
  Time.parse(value)
@@ -253,7 +287,7 @@ module Shotstack
253
287
  else # model
254
288
  # models (e.g. Pet) or oneOf
255
289
  klass = Shotstack.const_get(type)
256
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
290
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
257
291
  end
258
292
  end
259
293
 
@@ -0,0 +1,43 @@
1
+ =begin
2
+ #Shotstack
3
+
4
+ # Official Ruby SDK for the Shotstack Cloud Video Editing API
5
+
6
+ The version of the OpenAPI document: v1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Shotstack
17
+ # An audio enhancement that can be applied to the audio content of a rendition. The following providers are available: <ul> <li><a href=\"#tocs_dolbyenhancement\">DolbyEnhancement</a></li> </ul>
18
+ module AudioEnhancement
19
+ class << self
20
+ # List of class defined in oneOf (OpenAPI v3)
21
+ def openapi_one_of
22
+ [
23
+ :'DolbyEnhancement'
24
+ ]
25
+ end
26
+
27
+ # Discriminator's property name (OpenAPI v3)
28
+ def openapi_discriminator_name
29
+ :'enhancement'
30
+ end
31
+
32
+ # Builds the object
33
+ # @param [Mixed] Data to be matched against the list of oneOf items
34
+ # @return [Object] Returns the model or the data itself
35
+ def build(data)
36
+ discriminator_value = data[openapi_discriminator_name]
37
+ return nil if discriminator_value.nil?
38
+ Shotstack.const_get(discriminator_value).build_from_hash(data)
39
+ end
40
+ end
41
+ end
42
+
43
+ end
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #Shotstack
3
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.io/docs/guide/) 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>
4
+ # Official Ruby SDK for the Shotstack Cloud Video Editing API
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.4.0
9
+ Generator version: 7.4.0
10
10
 
11
11
  =end
12
12
 
@@ -24,7 +24,7 @@ module Shotstack
24
24
  # The length, in seconds, the Clip should play for.
25
25
  attr_accessor :length
26
26
 
27
- # Set how the asset should be scaled to fit the viewport using one of the following options: <ul> <li>`cover` - stretch the asset to fill the viewport without maintaining the aspect ratio.</li> <li>`contain` - fit the entire asset within the viewport while maintaining the original aspect ratio.</li> <li>`crop` - scale the asset to fill the viewport while maintaining the aspect ratio. The asset will be cropped if it exceeds the bounds of the viewport.</li> <li>`none` - preserves the original asset dimensions and does not apply any scaling.</li> </ul>
27
+ # Set how the asset should be scaled to fit the viewport using one of the following options: <ul> <li>`crop` <b>(default)</b> - scale the asset to fill the viewport while maintaining the aspect ratio. The asset will be cropped if it exceeds the bounds of the viewport.</li> <li>`cover` - stretch the asset to fill the viewport without maintaining the aspect ratio.</li> <li>`contain` - fit the entire asset within the viewport while maintaining the original aspect ratio.</li> <li>`none` - preserves the original asset dimensions and does not apply any scaling.</li> </ul>
28
28
  attr_accessor :fit
29
29
 
30
30
  # Scale the asset to a fraction of the viewport size - i.e. setting the scale to 0.5 will scale asset to half the size of the viewport. This is useful for picture-in-picture video and scaling images such as logos and watermarks.
@@ -37,10 +37,10 @@ module Shotstack
37
37
 
38
38
  attr_accessor :transition
39
39
 
40
- # A motion effect to apply to the Clip. <ul> <li>`zoomIn` - slow zoom in</li> <li>`zoomOut` - slow zoom out</li> <li>`slideLeft` - slow slide (pan) left</li> <li>`slideRight` - slow slide (pan) right</li> <li>`slideUp` - slow slide (pan) up</li> <li>`slideDown` - slow slide (pan) down</li> </ul>
40
+ # A motion effect to apply to the Clip. <ul> <li>`zoomIn` - slow zoom in</li> <li>`zoomOut` - slow zoom out</li> <li>`slideLeft` - slow slide (pan) left</li> <li>`slideRight` - slow slide (pan) right</li> <li>`slideUp` - slow slide (pan) up</li> <li>`slideDown` - slow slide (pan) down</li> </ul> The motion effect speed can also be controlled by appending `Fast` or `Slow` to the effect, e.g. `zoomInFast` or `slideRightSlow`.
41
41
  attr_accessor :effect
42
42
 
43
- # A filter effect to apply to the Clip. <ul> <li>`boost` - boost contrast and saturation</li> <li>`contrast` - increase contrast</li> <li>`darken` - darken the scene</li> <li>`greyscale` - remove colour</li> <li>`lighten` - lighten the scene</li> <li>`muted` - reduce saturation and contrast</li> <li>`invert` - invert colors</li> </ul>
43
+ # A filter effect to apply to the Clip. <ul> <li>`blur` - blur the scene</li> <li>`boost` - boost contrast and saturation</li> <li>`contrast` - increase contrast</li> <li>`darken` - darken the scene</li> <li>`greyscale` - remove colour</li> <li>`lighten` - lighten the scene</li> <li>`muted` - reduce saturation and contrast</li> <li>`negative` - negative colors</li> </ul>
44
44
  attr_accessor :filter
45
45
 
46
46
  # Sets the opacity of the Clip where 1 is opaque and 0 is transparent.
@@ -134,20 +134,24 @@ module Shotstack
134
134
 
135
135
  if attributes.key?(:'asset')
136
136
  self.asset = attributes[:'asset']
137
+ else
138
+ self.asset = nil
137
139
  end
138
140
 
139
141
  if attributes.key?(:'start')
140
142
  self.start = attributes[:'start']
143
+ else
144
+ self.start = nil
141
145
  end
142
146
 
143
147
  if attributes.key?(:'length')
144
148
  self.length = attributes[:'length']
149
+ else
150
+ self.length = nil
145
151
  end
146
152
 
147
153
  if attributes.key?(:'fit')
148
154
  self.fit = attributes[:'fit']
149
- else
150
- self.fit = 'crop'
151
155
  end
152
156
 
153
157
  if attributes.key?(:'scale')
@@ -156,8 +160,6 @@ module Shotstack
156
160
 
157
161
  if attributes.key?(:'position')
158
162
  self.position = attributes[:'position']
159
- else
160
- self.position = 'center'
161
163
  end
162
164
 
163
165
  if attributes.key?(:'offset')
@@ -178,8 +180,6 @@ module Shotstack
178
180
 
179
181
  if attributes.key?(:'opacity')
180
182
  self.opacity = attributes[:'opacity']
181
- else
182
- self.opacity = 1
183
183
  end
184
184
 
185
185
  if attributes.key?(:'transform')
@@ -190,6 +190,7 @@ module Shotstack
190
190
  # Show invalid properties with the reasons. Usually used together with valid?
191
191
  # @return Array for valid properties with the reasons
192
192
  def list_invalid_properties
193
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
193
194
  invalid_properties = Array.new
194
195
  if @asset.nil?
195
196
  invalid_properties.push('invalid value for "asset", asset cannot be nil.')
@@ -209,6 +210,7 @@ module Shotstack
209
210
  # Check to see if the all the properties in the model are valid
210
211
  # @return true if the model is valid
211
212
  def valid?
213
+ warn '[DEPRECATED] the `valid?` method is obsolete'
212
214
  return false if @asset.nil?
213
215
  return false if @start.nil?
214
216
  return false if @length.nil?
@@ -216,9 +218,9 @@ module Shotstack
216
218
  return false unless fit_validator.valid?(@fit)
217
219
  position_validator = EnumAttributeValidator.new('String', ["top", "topRight", "right", "bottomRight", "bottom", "bottomLeft", "left", "topLeft", "center"])
218
220
  return false unless position_validator.valid?(@position)
219
- effect_validator = EnumAttributeValidator.new('String', ["zoomIn", "zoomOut", "slideLeft", "slideRight", "slideUp", "slideDown"])
221
+ effect_validator = EnumAttributeValidator.new('String', ["zoomIn", "zoomInSlow", "zoomInFast", "zoomOut", "zoomOutSlow", "zoomOutFast", "slideLeft", "slideLeftSlow", "slideLeftFast", "slideRight", "slideRightSlow", "slideRightFast", "slideUp", "slideUpSlow", "slideUpFast", "slideDown", "slideDownSlow", "slideDownFast"])
220
222
  return false unless effect_validator.valid?(@effect)
221
- filter_validator = EnumAttributeValidator.new('String', ["boost", "contrast", "darken", "greyscale", "lighten", "muted", "negative"])
223
+ filter_validator = EnumAttributeValidator.new('String', ["blur", "boost", "contrast", "darken", "greyscale", "lighten", "muted", "negative"])
222
224
  return false unless filter_validator.valid?(@filter)
223
225
  true
224
226
  end
@@ -246,7 +248,7 @@ module Shotstack
246
248
  # Custom attribute writer method checking allowed values (enum).
247
249
  # @param [Object] effect Object to be assigned
248
250
  def effect=(effect)
249
- validator = EnumAttributeValidator.new('String', ["zoomIn", "zoomOut", "slideLeft", "slideRight", "slideUp", "slideDown"])
251
+ validator = EnumAttributeValidator.new('String', ["zoomIn", "zoomInSlow", "zoomInFast", "zoomOut", "zoomOutSlow", "zoomOutFast", "slideLeft", "slideLeftSlow", "slideLeftFast", "slideRight", "slideRightSlow", "slideRightFast", "slideUp", "slideUpSlow", "slideUpFast", "slideDown", "slideDownSlow", "slideDownFast"])
250
252
  unless validator.valid?(effect)
251
253
  fail ArgumentError, "invalid value for \"effect\", must be one of #{validator.allowable_values}."
252
254
  end
@@ -256,7 +258,7 @@ module Shotstack
256
258
  # Custom attribute writer method checking allowed values (enum).
257
259
  # @param [Object] filter Object to be assigned
258
260
  def filter=(filter)
259
- validator = EnumAttributeValidator.new('String', ["boost", "contrast", "darken", "greyscale", "lighten", "muted", "negative"])
261
+ validator = EnumAttributeValidator.new('String', ["blur", "boost", "contrast", "darken", "greyscale", "lighten", "muted", "negative"])
260
262
  unless validator.valid?(filter)
261
263
  fail ArgumentError, "invalid value for \"filter\", must be one of #{validator.allowable_values}."
262
264
  end
@@ -298,36 +300,30 @@ module Shotstack
298
300
  # @param [Hash] attributes Model attributes in the form of hash
299
301
  # @return [Object] Returns the model itself
300
302
  def self.build_from_hash(attributes)
301
- new.build_from_hash(attributes)
302
- end
303
-
304
- # Builds the object from hash
305
- # @param [Hash] attributes Model attributes in the form of hash
306
- # @return [Object] Returns the model itself
307
- def build_from_hash(attributes)
308
303
  return nil unless attributes.is_a?(Hash)
309
- self.class.openapi_types.each_pair do |key, type|
310
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
311
- self.send("#{key}=", nil)
304
+ attributes = attributes.transform_keys(&:to_sym)
305
+ transformed_hash = {}
306
+ openapi_types.each_pair do |key, type|
307
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
308
+ transformed_hash["#{key}"] = nil
312
309
  elsif type =~ /\AArray<(.*)>/i
313
310
  # check to ensure the input is an array given that the attribute
314
311
  # is documented as an array but the input is not
315
- if attributes[self.class.attribute_map[key]].is_a?(Array)
316
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
312
+ if attributes[attribute_map[key]].is_a?(Array)
313
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
317
314
  end
318
- elsif !attributes[self.class.attribute_map[key]].nil?
319
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
315
+ elsif !attributes[attribute_map[key]].nil?
316
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
320
317
  end
321
318
  end
322
-
323
- self
319
+ new(transformed_hash)
324
320
  end
325
321
 
326
322
  # Deserializes the data based on type
327
323
  # @param string type Data type
328
324
  # @param string value Value to be deserialized
329
325
  # @return [Object] Deserialized data
330
- def _deserialize(type, value)
326
+ def self._deserialize(type, value)
331
327
  case type.to_sym
332
328
  when :Time
333
329
  Time.parse(value)
@@ -362,7 +358,7 @@ module Shotstack
362
358
  else # model
363
359
  # models (e.g. Pet) or oneOf
364
360
  klass = Shotstack.const_get(type)
365
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
361
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
366
362
  end
367
363
  end
368
364
 
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #Shotstack
3
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.io/docs/guide/) 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>
4
+ # Official Ruby SDK for the Shotstack Cloud Video Editing API
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.4.0
9
+ Generator version: 7.4.0
10
10
 
11
11
  =end
12
12
 
@@ -94,6 +94,7 @@ module Shotstack
94
94
  # Show invalid properties with the reasons. Usually used together with valid?
95
95
  # @return Array for valid properties with the reasons
96
96
  def list_invalid_properties
97
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
98
  invalid_properties = Array.new
98
99
  if !@top.nil? && @top > 1
99
100
  invalid_properties.push('invalid value for "top", must be smaller than or equal to 1.')
@@ -133,6 +134,7 @@ module Shotstack
133
134
  # Check to see if the all the properties in the model are valid
134
135
  # @return true if the model is valid
135
136
  def valid?
137
+ warn '[DEPRECATED] the `valid?` method is obsolete'
136
138
  return false if !@top.nil? && @top > 1
137
139
  return false if !@top.nil? && @top < 0
138
140
  return false if !@bottom.nil? && @bottom > 1
@@ -147,11 +149,15 @@ module Shotstack
147
149
  # Custom attribute writer method with validation
148
150
  # @param [Object] top Value to be assigned
149
151
  def top=(top)
150
- if !top.nil? && top > 1
152
+ if top.nil?
153
+ fail ArgumentError, 'top cannot be nil'
154
+ end
155
+
156
+ if top > 1
151
157
  fail ArgumentError, 'invalid value for "top", must be smaller than or equal to 1.'
152
158
  end
153
159
 
154
- if !top.nil? && top < 0
160
+ if top < 0
155
161
  fail ArgumentError, 'invalid value for "top", must be greater than or equal to 0.'
156
162
  end
157
163
 
@@ -161,11 +167,15 @@ module Shotstack
161
167
  # Custom attribute writer method with validation
162
168
  # @param [Object] bottom Value to be assigned
163
169
  def bottom=(bottom)
164
- if !bottom.nil? && bottom > 1
170
+ if bottom.nil?
171
+ fail ArgumentError, 'bottom cannot be nil'
172
+ end
173
+
174
+ if bottom > 1
165
175
  fail ArgumentError, 'invalid value for "bottom", must be smaller than or equal to 1.'
166
176
  end
167
177
 
168
- if !bottom.nil? && bottom < 0
178
+ if bottom < 0
169
179
  fail ArgumentError, 'invalid value for "bottom", must be greater than or equal to 0.'
170
180
  end
171
181
 
@@ -175,11 +185,15 @@ module Shotstack
175
185
  # Custom attribute writer method with validation
176
186
  # @param [Object] left Value to be assigned
177
187
  def left=(left)
178
- if !left.nil? && left > 1
188
+ if left.nil?
189
+ fail ArgumentError, 'left cannot be nil'
190
+ end
191
+
192
+ if left > 1
179
193
  fail ArgumentError, 'invalid value for "left", must be smaller than or equal to 1.'
180
194
  end
181
195
 
182
- if !left.nil? && left < 0
196
+ if left < 0
183
197
  fail ArgumentError, 'invalid value for "left", must be greater than or equal to 0.'
184
198
  end
185
199
 
@@ -189,11 +203,15 @@ module Shotstack
189
203
  # Custom attribute writer method with validation
190
204
  # @param [Object] right Value to be assigned
191
205
  def right=(right)
192
- if !right.nil? && right > 1
206
+ if right.nil?
207
+ fail ArgumentError, 'right cannot be nil'
208
+ end
209
+
210
+ if right > 1
193
211
  fail ArgumentError, 'invalid value for "right", must be smaller than or equal to 1.'
194
212
  end
195
213
 
196
- if !right.nil? && right < 0
214
+ if right < 0
197
215
  fail ArgumentError, 'invalid value for "right", must be greater than or equal to 0.'
198
216
  end
199
217
 
@@ -227,36 +245,30 @@ module Shotstack
227
245
  # @param [Hash] attributes Model attributes in the form of hash
228
246
  # @return [Object] Returns the model itself
229
247
  def self.build_from_hash(attributes)
230
- new.build_from_hash(attributes)
231
- end
232
-
233
- # Builds the object from hash
234
- # @param [Hash] attributes Model attributes in the form of hash
235
- # @return [Object] Returns the model itself
236
- def build_from_hash(attributes)
237
248
  return nil unless attributes.is_a?(Hash)
238
- self.class.openapi_types.each_pair do |key, type|
239
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
240
- self.send("#{key}=", nil)
249
+ attributes = attributes.transform_keys(&:to_sym)
250
+ transformed_hash = {}
251
+ openapi_types.each_pair do |key, type|
252
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
253
+ transformed_hash["#{key}"] = nil
241
254
  elsif type =~ /\AArray<(.*)>/i
242
255
  # check to ensure the input is an array given that the attribute
243
256
  # is documented as an array but the input is not
244
- if attributes[self.class.attribute_map[key]].is_a?(Array)
245
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
257
+ if attributes[attribute_map[key]].is_a?(Array)
258
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
246
259
  end
247
- elsif !attributes[self.class.attribute_map[key]].nil?
248
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
260
+ elsif !attributes[attribute_map[key]].nil?
261
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
249
262
  end
250
263
  end
251
-
252
- self
264
+ new(transformed_hash)
253
265
  end
254
266
 
255
267
  # Deserializes the data based on type
256
268
  # @param string type Data type
257
269
  # @param string value Value to be deserialized
258
270
  # @return [Object] Deserialized data
259
- def _deserialize(type, value)
271
+ def self._deserialize(type, value)
260
272
  case type.to_sym
261
273
  when :Time
262
274
  Time.parse(value)
@@ -291,7 +303,7 @@ module Shotstack
291
303
  else # model
292
304
  # models (e.g. Pet) or oneOf
293
305
  klass = Shotstack.const_get(type)
294
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
306
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
295
307
  end
296
308
  end
297
309