shotstack 0.2.2 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +9 -0
  3. data/Rakefile +10 -0
  4. data/lib/shotstack/api/create_api.rb +158 -0
  5. data/lib/shotstack/api/edit_api.rb +20 -20
  6. data/lib/shotstack/api/ingest_api.rb +338 -0
  7. data/lib/shotstack/api/serve_api.rb +76 -8
  8. data/lib/shotstack/api_client.rb +28 -24
  9. data/lib/shotstack/api_error.rb +3 -2
  10. data/lib/shotstack/configuration.rb +55 -9
  11. data/lib/shotstack/models/asset.rb +3 -3
  12. data/lib/shotstack/models/asset_render_response.rb +18 -20
  13. data/lib/shotstack/models/asset_response.rb +18 -20
  14. data/lib/shotstack/models/asset_response_attributes.rb +23 -21
  15. data/lib/shotstack/models/asset_response_data.rb +20 -20
  16. data/lib/shotstack/models/audio_asset.rb +57 -21
  17. data/lib/shotstack/models/audio_enhancement.rb +43 -0
  18. data/lib/shotstack/models/clip.rb +27 -25
  19. data/lib/shotstack/models/crop.rb +40 -28
  20. data/lib/shotstack/models/destinations.rb +78 -243
  21. data/lib/shotstack/models/did_generated_asset.rb +273 -0
  22. data/lib/shotstack/models/did_generated_asset_options.rb +54 -0
  23. data/lib/shotstack/models/did_text_to_avatar_options.rb +313 -0
  24. data/lib/shotstack/models/dolby_enhancement.rb +239 -0
  25. data/lib/shotstack/models/dolby_enhancement_options.rb +257 -0
  26. data/lib/shotstack/models/edit.rb +22 -22
  27. data/lib/shotstack/models/eleven_labs_generated_asset.rb +273 -0
  28. data/lib/shotstack/models/eleven_labs_generated_asset_options.rb +54 -0
  29. data/lib/shotstack/models/eleven_labs_text_to_speech_options.rb +303 -0
  30. data/lib/shotstack/models/enhancements.rb +215 -0
  31. data/lib/shotstack/models/flip_transformation.rb +16 -20
  32. data/lib/shotstack/models/font.rb +18 -20
  33. data/lib/shotstack/models/generated_asset.rb +48 -0
  34. data/lib/shotstack/models/generated_asset_error_response.rb +225 -0
  35. data/lib/shotstack/models/generated_asset_error_response_data.rb +257 -0
  36. data/lib/shotstack/models/generated_asset_response.rb +222 -0
  37. data/lib/shotstack/models/generated_asset_response_attributes.rb +376 -0
  38. data/lib/shotstack/models/generated_asset_response_data.rb +256 -0
  39. data/lib/shotstack/models/google_cloud_storage_destination.rb +232 -0
  40. data/lib/shotstack/models/google_cloud_storage_destination_options.rb +243 -0
  41. data/lib/shotstack/models/google_drive_destination.rb +239 -0
  42. data/lib/shotstack/models/google_drive_destination_options.rb +233 -0
  43. data/lib/shotstack/models/hey_gen_generated_asset.rb +273 -0
  44. data/lib/shotstack/models/hey_gen_generated_asset_options.rb +54 -0
  45. data/lib/shotstack/models/hey_gen_text_to_avatar_options.rb +396 -0
  46. data/lib/shotstack/models/html_asset.rb +20 -22
  47. data/lib/shotstack/models/image_asset.rb +18 -20
  48. data/lib/shotstack/models/ingest_error_response.rb +225 -0
  49. data/lib/shotstack/models/ingest_error_response_data.rb +257 -0
  50. data/lib/shotstack/models/luma_asset.rb +18 -20
  51. data/lib/shotstack/models/merge_field.rb +20 -20
  52. data/lib/shotstack/models/mux_destination.rb +18 -22
  53. data/lib/shotstack/models/mux_destination_options.rb +50 -25
  54. data/lib/shotstack/models/offset.rb +28 -24
  55. data/lib/shotstack/models/open_ai_generated_asset.rb +273 -0
  56. data/lib/shotstack/models/open_ai_generated_asset_options.rb +54 -0
  57. data/lib/shotstack/models/open_ai_text_generator_options.rb +313 -0
  58. data/lib/shotstack/models/output.rb +27 -29
  59. data/lib/shotstack/models/outputs.rb +227 -0
  60. data/lib/shotstack/models/outputs_response.rb +218 -0
  61. data/lib/shotstack/models/poster.rb +18 -20
  62. data/lib/shotstack/models/probe_response.rb +22 -20
  63. data/lib/shotstack/models/queued_response.rb +22 -20
  64. data/lib/shotstack/models/queued_response_data.rb +20 -20
  65. data/lib/shotstack/models/queued_source_response.rb +222 -0
  66. data/lib/shotstack/models/queued_source_response_data.rb +240 -0
  67. data/lib/shotstack/models/range.rb +26 -22
  68. data/lib/shotstack/models/render_response.rb +22 -20
  69. data/lib/shotstack/models/render_response_data.rb +22 -20
  70. data/lib/shotstack/models/rendition.rb +429 -0
  71. data/lib/shotstack/models/rendition_response_attributes.rb +336 -0
  72. data/lib/shotstack/models/rotate_transformation.rb +16 -20
  73. data/lib/shotstack/models/s3_destination.rb +18 -22
  74. data/lib/shotstack/models/s3_destination_options.rb +21 -21
  75. data/lib/shotstack/models/shotstack_destination.rb +19 -23
  76. data/lib/shotstack/models/shotstack_generated_asset.rb +273 -0
  77. data/lib/shotstack/models/shotstack_generated_asset_options.rb +60 -0
  78. data/lib/shotstack/models/shotstack_image_to_video_options.rb +298 -0
  79. data/lib/shotstack/models/shotstack_text_generator_options.rb +274 -0
  80. data/lib/shotstack/models/shotstack_text_to_image_options.rb +308 -0
  81. data/lib/shotstack/models/shotstack_text_to_speech_options.rb +339 -0
  82. data/lib/shotstack/models/size.rb +36 -32
  83. data/lib/shotstack/models/skew_transformation.rb +16 -20
  84. data/lib/shotstack/models/soundtrack.rb +18 -20
  85. data/lib/shotstack/models/source.rb +244 -0
  86. data/lib/shotstack/models/source_list_response.rb +225 -0
  87. data/lib/shotstack/models/source_response.rb +222 -0
  88. data/lib/shotstack/models/source_response_attributes.rb +373 -0
  89. data/lib/shotstack/models/source_response_data.rb +256 -0
  90. data/lib/shotstack/models/speed.rb +254 -0
  91. data/lib/shotstack/models/stability_ai_generated_asset.rb +273 -0
  92. data/lib/shotstack/models/stability_ai_generated_asset_options.rb +54 -0
  93. data/lib/shotstack/models/stability_ai_text_to_image_options.rb +390 -0
  94. data/lib/shotstack/models/template.rb +18 -20
  95. data/lib/shotstack/models/template_data_response.rb +23 -21
  96. data/lib/shotstack/models/template_data_response_data.rb +24 -20
  97. data/lib/shotstack/models/template_list_response.rb +24 -22
  98. data/lib/shotstack/models/template_list_response_data.rb +20 -20
  99. data/lib/shotstack/models/template_list_response_item.rb +20 -20
  100. data/lib/shotstack/models/template_render.rb +18 -20
  101. data/lib/shotstack/models/template_response.rb +22 -20
  102. data/lib/shotstack/models/template_response_data.rb +20 -20
  103. data/lib/shotstack/models/thumbnail.rb +20 -20
  104. data/lib/shotstack/models/timeline.rb +19 -21
  105. data/lib/shotstack/models/title_asset.rb +18 -20
  106. data/lib/shotstack/models/track.rb +18 -20
  107. data/lib/shotstack/models/transcription.rb +250 -0
  108. data/lib/shotstack/models/transfer.rb +259 -0
  109. data/lib/shotstack/models/transfer_response.rb +222 -0
  110. data/lib/shotstack/models/transfer_response_attributes.rb +280 -0
  111. data/lib/shotstack/models/transfer_response_data.rb +225 -0
  112. data/lib/shotstack/models/transformation.rb +16 -20
  113. data/lib/shotstack/models/transition.rb +16 -20
  114. data/lib/shotstack/models/upload_response.rb +222 -0
  115. data/lib/shotstack/models/upload_response_attributes.rb +257 -0
  116. data/lib/shotstack/models/upload_response_data.rb +256 -0
  117. data/lib/shotstack/models/video_asset.rb +57 -21
  118. data/lib/shotstack/version.rb +3 -3
  119. data/lib/shotstack.rb +61 -2
  120. data/shotstack.gemspec +8 -8
  121. metadata +69 -16
@@ -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')
@@ -119,6 +126,10 @@ module Shotstack
119
126
  self.volume = attributes[:'volume']
120
127
  end
121
128
 
129
+ if attributes.key?(:'speed')
130
+ self.speed = attributes[:'speed']
131
+ end
132
+
122
133
  if attributes.key?(:'effect')
123
134
  self.effect = attributes[:'effect']
124
135
  end
@@ -127,6 +138,7 @@ module Shotstack
127
138
  # Show invalid properties with the reasons. Usually used together with valid?
128
139
  # @return Array for valid properties with the reasons
129
140
  def list_invalid_properties
141
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
130
142
  invalid_properties = Array.new
131
143
  if @type.nil?
132
144
  invalid_properties.push('invalid value for "type", type cannot be nil.')
@@ -136,19 +148,48 @@ module Shotstack
136
148
  invalid_properties.push('invalid value for "src", src cannot be nil.')
137
149
  end
138
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
+
139
159
  invalid_properties
140
160
  end
141
161
 
142
162
  # Check to see if the all the properties in the model are valid
143
163
  # @return true if the model is valid
144
164
  def valid?
165
+ warn '[DEPRECATED] the `valid?` method is obsolete'
145
166
  return false if @type.nil?
146
167
  return false if @src.nil?
168
+ return false if !@speed.nil? && @speed > 10
169
+ return false if !@speed.nil? && @speed < 0
147
170
  effect_validator = EnumAttributeValidator.new('String', ["fadeIn", "fadeOut", "fadeInFadeOut"])
148
171
  return false unless effect_validator.valid?(@effect)
149
172
  true
150
173
  end
151
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
+
152
193
  # Custom attribute writer method checking allowed values (enum).
153
194
  # @param [Object] effect Object to be assigned
154
195
  def effect=(effect)
@@ -168,6 +209,7 @@ module Shotstack
168
209
  src == o.src &&
169
210
  trim == o.trim &&
170
211
  volume == o.volume &&
212
+ speed == o.speed &&
171
213
  effect == o.effect
172
214
  end
173
215
 
@@ -180,43 +222,37 @@ module Shotstack
180
222
  # Calculates hash code according to all attributes.
181
223
  # @return [Integer] Hash code
182
224
  def hash
183
- [type, src, trim, volume, effect].hash
225
+ [type, src, trim, volume, speed, effect].hash
184
226
  end
185
227
 
186
228
  # Builds the object from hash
187
229
  # @param [Hash] attributes Model attributes in the form of hash
188
230
  # @return [Object] Returns the model itself
189
231
  def self.build_from_hash(attributes)
190
- new.build_from_hash(attributes)
191
- end
192
-
193
- # Builds the object from hash
194
- # @param [Hash] attributes Model attributes in the form of hash
195
- # @return [Object] Returns the model itself
196
- def build_from_hash(attributes)
197
232
  return nil unless attributes.is_a?(Hash)
198
- self.class.openapi_types.each_pair do |key, type|
199
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
200
- 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
201
238
  elsif type =~ /\AArray<(.*)>/i
202
239
  # check to ensure the input is an array given that the attribute
203
240
  # is documented as an array but the input is not
204
- if attributes[self.class.attribute_map[key]].is_a?(Array)
205
- 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) }
206
243
  end
207
- elsif !attributes[self.class.attribute_map[key]].nil?
208
- 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]])
209
246
  end
210
247
  end
211
-
212
- self
248
+ new(transformed_hash)
213
249
  end
214
250
 
215
251
  # Deserializes the data based on type
216
252
  # @param string type Data type
217
253
  # @param string value Value to be deserialized
218
254
  # @return [Object] Deserialized data
219
- def _deserialize(type, value)
255
+ def self._deserialize(type, value)
220
256
  case type.to_sym
221
257
  when :Time
222
258
  Time.parse(value)
@@ -251,7 +287,7 @@ module Shotstack
251
287
  else # model
252
288
  # models (e.g. Pet) or oneOf
253
289
  klass = Shotstack.const_get(type)
254
- 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)
255
291
  end
256
292
  end
257
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
 
@@ -40,7 +40,7 @@ module Shotstack
40
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>`negative` - negative 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,14 +134,20 @@ 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')
@@ -184,6 +190,7 @@ module Shotstack
184
190
  # Show invalid properties with the reasons. Usually used together with valid?
185
191
  # @return Array for valid properties with the reasons
186
192
  def list_invalid_properties
193
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
187
194
  invalid_properties = Array.new
188
195
  if @asset.nil?
189
196
  invalid_properties.push('invalid value for "asset", asset cannot be nil.')
@@ -203,6 +210,7 @@ module Shotstack
203
210
  # Check to see if the all the properties in the model are valid
204
211
  # @return true if the model is valid
205
212
  def valid?
213
+ warn '[DEPRECATED] the `valid?` method is obsolete'
206
214
  return false if @asset.nil?
207
215
  return false if @start.nil?
208
216
  return false if @length.nil?
@@ -210,9 +218,9 @@ module Shotstack
210
218
  return false unless fit_validator.valid?(@fit)
211
219
  position_validator = EnumAttributeValidator.new('String', ["top", "topRight", "right", "bottomRight", "bottom", "bottomLeft", "left", "topLeft", "center"])
212
220
  return false unless position_validator.valid?(@position)
213
- effect_validator = EnumAttributeValidator.new('String', ["zoomIn", "zoomInSlow", "zoomInFast", "zoomOut", "zoomOutSlow", "zoomOutFast", "slideLeft", "slideLeftSLow", "slideLeftFast", "slideRight", "slideRightSlow", "slideRightFast", "slideUp", "slideUpSlow", "slideUpFast", "slideDown", "slideDownSlow", "slideDownFast"])
221
+ effect_validator = EnumAttributeValidator.new('String', ["zoomIn", "zoomInSlow", "zoomInFast", "zoomOut", "zoomOutSlow", "zoomOutFast", "slideLeft", "slideLeftSlow", "slideLeftFast", "slideRight", "slideRightSlow", "slideRightFast", "slideUp", "slideUpSlow", "slideUpFast", "slideDown", "slideDownSlow", "slideDownFast"])
214
222
  return false unless effect_validator.valid?(@effect)
215
- 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"])
216
224
  return false unless filter_validator.valid?(@filter)
217
225
  true
218
226
  end
@@ -240,7 +248,7 @@ module Shotstack
240
248
  # Custom attribute writer method checking allowed values (enum).
241
249
  # @param [Object] effect Object to be assigned
242
250
  def effect=(effect)
243
- validator = EnumAttributeValidator.new('String', ["zoomIn", "zoomInSlow", "zoomInFast", "zoomOut", "zoomOutSlow", "zoomOutFast", "slideLeft", "slideLeftSLow", "slideLeftFast", "slideRight", "slideRightSlow", "slideRightFast", "slideUp", "slideUpSlow", "slideUpFast", "slideDown", "slideDownSlow", "slideDownFast"])
251
+ validator = EnumAttributeValidator.new('String', ["zoomIn", "zoomInSlow", "zoomInFast", "zoomOut", "zoomOutSlow", "zoomOutFast", "slideLeft", "slideLeftSlow", "slideLeftFast", "slideRight", "slideRightSlow", "slideRightFast", "slideUp", "slideUpSlow", "slideUpFast", "slideDown", "slideDownSlow", "slideDownFast"])
244
252
  unless validator.valid?(effect)
245
253
  fail ArgumentError, "invalid value for \"effect\", must be one of #{validator.allowable_values}."
246
254
  end
@@ -250,7 +258,7 @@ module Shotstack
250
258
  # Custom attribute writer method checking allowed values (enum).
251
259
  # @param [Object] filter Object to be assigned
252
260
  def filter=(filter)
253
- validator = EnumAttributeValidator.new('String', ["boost", "contrast", "darken", "greyscale", "lighten", "muted", "negative"])
261
+ validator = EnumAttributeValidator.new('String', ["blur", "boost", "contrast", "darken", "greyscale", "lighten", "muted", "negative"])
254
262
  unless validator.valid?(filter)
255
263
  fail ArgumentError, "invalid value for \"filter\", must be one of #{validator.allowable_values}."
256
264
  end
@@ -292,36 +300,30 @@ module Shotstack
292
300
  # @param [Hash] attributes Model attributes in the form of hash
293
301
  # @return [Object] Returns the model itself
294
302
  def self.build_from_hash(attributes)
295
- new.build_from_hash(attributes)
296
- end
297
-
298
- # Builds the object from hash
299
- # @param [Hash] attributes Model attributes in the form of hash
300
- # @return [Object] Returns the model itself
301
- def build_from_hash(attributes)
302
303
  return nil unless attributes.is_a?(Hash)
303
- self.class.openapi_types.each_pair do |key, type|
304
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
305
- 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
306
309
  elsif type =~ /\AArray<(.*)>/i
307
310
  # check to ensure the input is an array given that the attribute
308
311
  # is documented as an array but the input is not
309
- if attributes[self.class.attribute_map[key]].is_a?(Array)
310
- 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) }
311
314
  end
312
- elsif !attributes[self.class.attribute_map[key]].nil?
313
- 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]])
314
317
  end
315
318
  end
316
-
317
- self
319
+ new(transformed_hash)
318
320
  end
319
321
 
320
322
  # Deserializes the data based on type
321
323
  # @param string type Data type
322
324
  # @param string value Value to be deserialized
323
325
  # @return [Object] Deserialized data
324
- def _deserialize(type, value)
326
+ def self._deserialize(type, value)
325
327
  case type.to_sym
326
328
  when :Time
327
329
  Time.parse(value)
@@ -356,7 +358,7 @@ module Shotstack
356
358
  else # model
357
359
  # models (e.g. Pet) or oneOf
358
360
  klass = Shotstack.const_get(type)
359
- 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)
360
362
  end
361
363
  end
362
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