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
 
@@ -14,12 +14,12 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Shotstack
17
- # Send rendered assets to the [Shotstack hosting and CDN](https://shotstack.io/docs/guide/serving-assets/destinations/shotstack) service. This destination is enabled by default.
17
+ # Send videos and assets to the [Shotstack hosting and CDN](https://shotstack.io/docs/guide/serving-assets/destinations/shotstack/) service. This destination is enabled by default.
18
18
  class ShotstackDestination
19
- # The destination to send rendered assets to - set to `shotstack` for Shotstack hosting and CDN.
19
+ # The destination to send assets to - set to `shotstack` for Shotstack hosting and CDN.
20
20
  attr_accessor :provider
21
21
 
22
- # Set to `true` to [opt-out](https://shotstack.io/docs/guide/serving-assets/self-host) from the Shotstack hosting and CDN service. All files must be downloaded within 24 hours of rendering.
22
+ # Set to `true` to [opt-out](https://shotstack.io/docs/guide/serving-assets/self-host/) from the Shotstack hosting and CDN service. All files must be downloaded within 24 hours of rendering.
23
23
  attr_accessor :exclude
24
24
 
25
25
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -78,6 +78,7 @@ module Shotstack
78
78
  # Show invalid properties with the reasons. Usually used together with valid?
79
79
  # @return Array for valid properties with the reasons
80
80
  def list_invalid_properties
81
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
82
  invalid_properties = Array.new
82
83
  if @provider.nil?
83
84
  invalid_properties.push('invalid value for "provider", provider cannot be nil.')
@@ -89,6 +90,7 @@ module Shotstack
89
90
  # Check to see if the all the properties in the model are valid
90
91
  # @return true if the model is valid
91
92
  def valid?
93
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
94
  return false if @provider.nil?
93
95
  true
94
96
  end
@@ -118,36 +120,30 @@ module Shotstack
118
120
  # @param [Hash] attributes Model attributes in the form of hash
119
121
  # @return [Object] Returns the model itself
120
122
  def self.build_from_hash(attributes)
121
- new.build_from_hash(attributes)
122
- end
123
-
124
- # Builds the object from hash
125
- # @param [Hash] attributes Model attributes in the form of hash
126
- # @return [Object] Returns the model itself
127
- def build_from_hash(attributes)
128
123
  return nil unless attributes.is_a?(Hash)
129
- self.class.openapi_types.each_pair do |key, type|
130
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
131
- self.send("#{key}=", nil)
124
+ attributes = attributes.transform_keys(&:to_sym)
125
+ transformed_hash = {}
126
+ openapi_types.each_pair do |key, type|
127
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
128
+ transformed_hash["#{key}"] = nil
132
129
  elsif type =~ /\AArray<(.*)>/i
133
130
  # check to ensure the input is an array given that the attribute
134
131
  # is documented as an array but the input is not
135
- if attributes[self.class.attribute_map[key]].is_a?(Array)
136
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
132
+ if attributes[attribute_map[key]].is_a?(Array)
133
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
137
134
  end
138
- elsif !attributes[self.class.attribute_map[key]].nil?
139
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ elsif !attributes[attribute_map[key]].nil?
136
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
140
137
  end
141
138
  end
142
-
143
- self
139
+ new(transformed_hash)
144
140
  end
145
141
 
146
142
  # Deserializes the data based on type
147
143
  # @param string type Data type
148
144
  # @param string value Value to be deserialized
149
145
  # @return [Object] Deserialized data
150
- def _deserialize(type, value)
146
+ def self._deserialize(type, value)
151
147
  case type.to_sym
152
148
  when :Time
153
149
  Time.parse(value)
@@ -182,7 +178,7 @@ module Shotstack
182
178
  else # model
183
179
  # models (e.g. Pet) or oneOf
184
180
  klass = Shotstack.const_get(type)
185
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
181
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
186
182
  end
187
183
  end
188
184
 
@@ -0,0 +1,273 @@
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
+ # Generate assets using the native Shotstack provider. Shotstack provides a text-to-speech and a text-to-image service. The Shotstack provider works natively with your existing API key, no additional credentials are required.
18
+ class ShotstackGeneratedAsset
19
+ # The name of the provider - set to `shotstack` for Shotstack.
20
+ attr_accessor :provider
21
+
22
+ attr_accessor :options
23
+
24
+ class EnumAttributeValidator
25
+ attr_reader :datatype
26
+ attr_reader :allowable_values
27
+
28
+ def initialize(datatype, allowable_values)
29
+ @allowable_values = allowable_values.map do |value|
30
+ case datatype.to_s
31
+ when /Integer/i
32
+ value.to_i
33
+ when /Float/i
34
+ value.to_f
35
+ else
36
+ value
37
+ end
38
+ end
39
+ end
40
+
41
+ def valid?(value)
42
+ !value || allowable_values.include?(value)
43
+ end
44
+ end
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'provider' => :'provider',
50
+ :'options' => :'options'
51
+ }
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'provider' => :'String',
63
+ :'options' => :'ShotstackGeneratedAssetOptions'
64
+ }
65
+ end
66
+
67
+ # List of attributes with nullable: true
68
+ def self.openapi_nullable
69
+ Set.new([
70
+ ])
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ if (!attributes.is_a?(Hash))
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Shotstack::ShotstackGeneratedAsset` initialize method"
78
+ end
79
+
80
+ # check to see if the attribute exists and convert string to symbol for hash key
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!self.class.attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Shotstack::ShotstackGeneratedAsset`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'provider')
89
+ self.provider = attributes[:'provider']
90
+ else
91
+ self.provider = 'shotstack'
92
+ end
93
+
94
+ if attributes.key?(:'options')
95
+ self.options = attributes[:'options']
96
+ else
97
+ self.options = nil
98
+ end
99
+ end
100
+
101
+ # Show invalid properties with the reasons. Usually used together with valid?
102
+ # @return Array for valid properties with the reasons
103
+ def list_invalid_properties
104
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
105
+ invalid_properties = Array.new
106
+ if @provider.nil?
107
+ invalid_properties.push('invalid value for "provider", provider cannot be nil.')
108
+ end
109
+
110
+ if @options.nil?
111
+ invalid_properties.push('invalid value for "options", options cannot be nil.')
112
+ end
113
+
114
+ invalid_properties
115
+ end
116
+
117
+ # Check to see if the all the properties in the model are valid
118
+ # @return true if the model is valid
119
+ def valid?
120
+ warn '[DEPRECATED] the `valid?` method is obsolete'
121
+ return false if @provider.nil?
122
+ provider_validator = EnumAttributeValidator.new('String', ["shotstack"])
123
+ return false unless provider_validator.valid?(@provider)
124
+ return false if @options.nil?
125
+ true
126
+ end
127
+
128
+ # Custom attribute writer method checking allowed values (enum).
129
+ # @param [Object] provider Object to be assigned
130
+ def provider=(provider)
131
+ validator = EnumAttributeValidator.new('String', ["shotstack"])
132
+ unless validator.valid?(provider)
133
+ fail ArgumentError, "invalid value for \"provider\", must be one of #{validator.allowable_values}."
134
+ end
135
+ @provider = provider
136
+ end
137
+
138
+ # Checks equality by comparing each attribute.
139
+ # @param [Object] Object to be compared
140
+ def ==(o)
141
+ return true if self.equal?(o)
142
+ self.class == o.class &&
143
+ provider == o.provider &&
144
+ options == o.options
145
+ end
146
+
147
+ # @see the `==` method
148
+ # @param [Object] Object to be compared
149
+ def eql?(o)
150
+ self == o
151
+ end
152
+
153
+ # Calculates hash code according to all attributes.
154
+ # @return [Integer] Hash code
155
+ def hash
156
+ [provider, options].hash
157
+ end
158
+
159
+ # Builds the object from hash
160
+ # @param [Hash] attributes Model attributes in the form of hash
161
+ # @return [Object] Returns the model itself
162
+ def self.build_from_hash(attributes)
163
+ return nil unless attributes.is_a?(Hash)
164
+ attributes = attributes.transform_keys(&:to_sym)
165
+ transformed_hash = {}
166
+ openapi_types.each_pair do |key, type|
167
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
168
+ transformed_hash["#{key}"] = nil
169
+ elsif type =~ /\AArray<(.*)>/i
170
+ # check to ensure the input is an array given that the attribute
171
+ # is documented as an array but the input is not
172
+ if attributes[attribute_map[key]].is_a?(Array)
173
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
174
+ end
175
+ elsif !attributes[attribute_map[key]].nil?
176
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
177
+ end
178
+ end
179
+ new(transformed_hash)
180
+ end
181
+
182
+ # Deserializes the data based on type
183
+ # @param string type Data type
184
+ # @param string value Value to be deserialized
185
+ # @return [Object] Deserialized data
186
+ def self._deserialize(type, value)
187
+ case type.to_sym
188
+ when :Time
189
+ Time.parse(value)
190
+ when :Date
191
+ Date.parse(value)
192
+ when :String
193
+ value.to_s
194
+ when :Integer
195
+ value.to_i
196
+ when :Float
197
+ value.to_f
198
+ when :Boolean
199
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
200
+ true
201
+ else
202
+ false
203
+ end
204
+ when :Object
205
+ # generic object (usually a Hash), return directly
206
+ value
207
+ when /\AArray<(?<inner_type>.+)>\z/
208
+ inner_type = Regexp.last_match[:inner_type]
209
+ value.map { |v| _deserialize(inner_type, v) }
210
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
211
+ k_type = Regexp.last_match[:k_type]
212
+ v_type = Regexp.last_match[:v_type]
213
+ {}.tap do |hash|
214
+ value.each do |k, v|
215
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
216
+ end
217
+ end
218
+ else # model
219
+ # models (e.g. Pet) or oneOf
220
+ klass = Shotstack.const_get(type)
221
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
222
+ end
223
+ end
224
+
225
+ # Returns the string representation of the object
226
+ # @return [String] String presentation of the object
227
+ def to_s
228
+ to_hash.to_s
229
+ end
230
+
231
+ # to_body is an alias to to_hash (backward compatibility)
232
+ # @return [Hash] Returns the object in the form of hash
233
+ def to_body
234
+ to_hash
235
+ end
236
+
237
+ # Returns the object in the form of hash
238
+ # @return [Hash] Returns the object in the form of hash
239
+ def to_hash
240
+ hash = {}
241
+ self.class.attribute_map.each_pair do |attr, param|
242
+ value = self.send(attr)
243
+ if value.nil?
244
+ is_nullable = self.class.openapi_nullable.include?(attr)
245
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
246
+ end
247
+
248
+ hash[param] = _to_hash(value)
249
+ end
250
+ hash
251
+ end
252
+
253
+ # Outputs non-array value in the form of hash
254
+ # For object, use to_hash. Otherwise, just return the value
255
+ # @param [Object] value Any valid value
256
+ # @return [Hash] Returns the value in the form of hash
257
+ def _to_hash(value)
258
+ if value.is_a?(Array)
259
+ value.compact.map { |v| _to_hash(v) }
260
+ elsif value.is_a?(Hash)
261
+ {}.tap do |hash|
262
+ value.each { |k, v| hash[k] = _to_hash(v) }
263
+ end
264
+ elsif value.respond_to? :to_hash
265
+ value.to_hash
266
+ else
267
+ value
268
+ end
269
+ end
270
+
271
+ end
272
+
273
+ end
@@ -0,0 +1,60 @@
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
+ # Generate assets using the native Shotstack provider AI services. The following AI generation services are available: <ul> <li><a href=\"#tocs_shotstacktexttospeechoptions\">ShotstackTextToSpeechOptions</a></li> <li><a href=\"#tocs_shotstacktexttoimageoptions\">ShotstackTextToImageOptions</a></li> <li><a href=\"#tocs_shotstackimagetovideooptions\">ShotstackImageToVideoOptions</a></li> <li><a href=\"#tocs_shotstacktextgeneratoroptions\">ShotstackTextGeneratorOptions</a></li> </ul>
18
+ module ShotstackGeneratedAssetOptions
19
+ class << self
20
+ # List of class defined in oneOf (OpenAPI v3)
21
+ def openapi_one_of
22
+ [
23
+ :'ShotstackImageToVideoOptions',
24
+ :'ShotstackTextGeneratorOptions',
25
+ :'ShotstackTextToImageOptions',
26
+ :'ShotstackTextToSpeechOptions'
27
+ ]
28
+ end
29
+
30
+ # Discriminator's property name (OpenAPI v3)
31
+ def openapi_discriminator_name
32
+ :'type'
33
+ end
34
+
35
+ # Discriminator's mapping (OpenAPI v3)
36
+ def openapi_discriminator_mapping
37
+ {
38
+ :'image-to-video' => :'ShotstackImageToVideoOptions',
39
+ :'text-generator' => :'ShotstackTextToImageOptions',
40
+ :'text-to-image' => :'ShotstackTextToImageOptions',
41
+ :'text-to-speech' => :'ShotstackTextToSpeechOptions'
42
+ }
43
+ end
44
+
45
+ # Builds the object
46
+ # @param [Mixed] Data to be matched against the list of oneOf items
47
+ # @return [Object] Returns the model or the data itself
48
+ def build(data)
49
+ discriminator_value = data[openapi_discriminator_name]
50
+ return nil if discriminator_value.nil?
51
+
52
+ klass = openapi_discriminator_mapping[discriminator_value.to_s.to_sym]
53
+ return nil unless klass
54
+
55
+ Shotstack.const_get(klass).build_from_hash(data)
56
+ end
57
+ end
58
+ end
59
+
60
+ end