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.
- checksums.yaml +4 -4
- data/Gemfile +9 -0
- data/README.md +387 -23
- data/Rakefile +10 -0
- data/lib/shotstack/api/create_api.rb +158 -0
- data/lib/shotstack/api/edit_api.rb +20 -20
- data/lib/shotstack/api/ingest_api.rb +338 -0
- data/lib/shotstack/api/serve_api.rb +76 -8
- data/lib/shotstack/api_client.rb +28 -24
- data/lib/shotstack/api_error.rb +3 -2
- data/lib/shotstack/configuration.rb +55 -9
- data/lib/shotstack/models/asset.rb +4 -4
- data/lib/shotstack/models/asset_render_response.rb +23 -20
- data/lib/shotstack/models/asset_response.rb +23 -20
- data/lib/shotstack/models/asset_response_attributes.rb +38 -21
- data/lib/shotstack/models/asset_response_data.rb +30 -20
- data/lib/shotstack/models/audio_asset.rb +57 -23
- data/lib/shotstack/models/audio_enhancement.rb +43 -0
- data/lib/shotstack/models/clip.rb +29 -33
- data/lib/shotstack/models/crop.rb +40 -28
- data/lib/shotstack/models/destinations.rb +78 -244
- data/lib/shotstack/models/did_generated_asset.rb +273 -0
- data/lib/shotstack/models/did_generated_asset_options.rb +54 -0
- data/lib/shotstack/models/did_text_to_avatar_options.rb +313 -0
- data/lib/shotstack/models/dolby_enhancement.rb +239 -0
- data/lib/shotstack/models/dolby_enhancement_options.rb +257 -0
- data/lib/shotstack/models/edit.rb +22 -24
- data/lib/shotstack/models/eleven_labs_generated_asset.rb +273 -0
- data/lib/shotstack/models/eleven_labs_generated_asset_options.rb +54 -0
- data/lib/shotstack/models/eleven_labs_text_to_speech_options.rb +303 -0
- data/lib/shotstack/models/enhancements.rb +215 -0
- data/lib/shotstack/models/flip_transformation.rb +16 -24
- data/lib/shotstack/models/font.rb +18 -20
- data/lib/shotstack/models/generated_asset.rb +48 -0
- data/lib/shotstack/models/generated_asset_error_response.rb +225 -0
- data/lib/shotstack/models/generated_asset_error_response_data.rb +257 -0
- data/lib/shotstack/models/generated_asset_response.rb +222 -0
- data/lib/shotstack/models/generated_asset_response_attributes.rb +376 -0
- data/lib/shotstack/models/generated_asset_response_data.rb +256 -0
- data/lib/shotstack/models/google_cloud_storage_destination.rb +232 -0
- data/lib/shotstack/models/google_cloud_storage_destination_options.rb +243 -0
- data/lib/shotstack/models/google_drive_destination.rb +239 -0
- data/lib/shotstack/models/google_drive_destination_options.rb +233 -0
- data/lib/shotstack/models/hey_gen_generated_asset.rb +273 -0
- data/lib/shotstack/models/hey_gen_generated_asset_options.rb +54 -0
- data/lib/shotstack/models/hey_gen_text_to_avatar_options.rb +396 -0
- data/lib/shotstack/models/html_asset.rb +20 -26
- data/lib/shotstack/models/image_asset.rb +18 -20
- data/lib/shotstack/models/ingest_error_response.rb +225 -0
- data/lib/shotstack/models/ingest_error_response_data.rb +257 -0
- data/lib/shotstack/models/luma_asset.rb +18 -20
- data/lib/shotstack/models/merge_field.rb +20 -20
- data/lib/shotstack/models/mux_destination.rb +18 -22
- data/lib/shotstack/models/mux_destination_options.rb +50 -25
- data/lib/shotstack/models/offset.rb +46 -46
- data/lib/shotstack/models/open_ai_generated_asset.rb +273 -0
- data/lib/shotstack/models/open_ai_generated_asset_options.rb +54 -0
- data/lib/shotstack/models/open_ai_text_generator_options.rb +313 -0
- data/lib/shotstack/models/output.rb +40 -35
- data/lib/shotstack/models/outputs.rb +227 -0
- data/lib/shotstack/models/outputs_response.rb +218 -0
- data/lib/shotstack/models/poster.rb +18 -20
- data/lib/shotstack/models/probe_response.rb +22 -20
- data/lib/shotstack/models/queued_response.rb +22 -20
- data/lib/shotstack/models/queued_response_data.rb +20 -20
- data/lib/shotstack/models/queued_source_response.rb +222 -0
- data/lib/shotstack/models/queued_source_response_data.rb +240 -0
- data/lib/shotstack/models/range.rb +26 -22
- data/lib/shotstack/models/render_response.rb +22 -20
- data/lib/shotstack/models/render_response_data.rb +24 -35
- data/lib/shotstack/models/rendition.rb +429 -0
- data/lib/shotstack/models/rendition_response_attributes.rb +336 -0
- data/lib/shotstack/models/rotate_transformation.rb +16 -22
- data/lib/shotstack/models/s3_destination.rb +232 -0
- data/lib/shotstack/models/s3_destination_options.rb +270 -0
- data/lib/shotstack/models/shotstack_destination.rb +19 -25
- data/lib/shotstack/models/shotstack_generated_asset.rb +273 -0
- data/lib/shotstack/models/shotstack_generated_asset_options.rb +60 -0
- data/lib/shotstack/models/shotstack_image_to_video_options.rb +298 -0
- data/lib/shotstack/models/shotstack_text_generator_options.rb +274 -0
- data/lib/shotstack/models/shotstack_text_to_image_options.rb +308 -0
- data/lib/shotstack/models/shotstack_text_to_speech_options.rb +339 -0
- data/lib/shotstack/models/size.rb +39 -35
- data/lib/shotstack/models/skew_transformation.rb +16 -24
- data/lib/shotstack/models/soundtrack.rb +18 -22
- data/lib/shotstack/models/source.rb +244 -0
- data/lib/shotstack/models/source_list_response.rb +225 -0
- data/lib/shotstack/models/source_response.rb +222 -0
- data/lib/shotstack/models/source_response_attributes.rb +373 -0
- data/lib/shotstack/models/source_response_data.rb +256 -0
- data/lib/shotstack/models/speed.rb +254 -0
- data/lib/shotstack/models/stability_ai_generated_asset.rb +273 -0
- data/lib/shotstack/models/stability_ai_generated_asset_options.rb +54 -0
- data/lib/shotstack/models/stability_ai_text_to_image_options.rb +390 -0
- data/lib/shotstack/models/template.rb +18 -20
- data/lib/shotstack/models/template_data_response.rb +24 -22
- data/lib/shotstack/models/template_data_response_data.rb +25 -22
- data/lib/shotstack/models/template_list_response.rb +24 -22
- data/lib/shotstack/models/template_list_response_data.rb +20 -20
- data/lib/shotstack/models/template_list_response_item.rb +20 -30
- data/lib/shotstack/models/template_render.rb +19 -21
- data/lib/shotstack/models/template_response.rb +23 -21
- data/lib/shotstack/models/template_response_data.rb +20 -20
- data/lib/shotstack/models/thumbnail.rb +20 -20
- data/lib/shotstack/models/timeline.rb +19 -25
- data/lib/shotstack/models/title_asset.rb +19 -27
- data/lib/shotstack/models/track.rb +18 -20
- data/lib/shotstack/models/transcription.rb +250 -0
- data/lib/shotstack/models/transfer.rb +259 -0
- data/lib/shotstack/models/transfer_response.rb +222 -0
- data/lib/shotstack/models/transfer_response_attributes.rb +280 -0
- data/lib/shotstack/models/transfer_response_data.rb +225 -0
- data/lib/shotstack/models/transformation.rb +16 -20
- data/lib/shotstack/models/transition.rb +16 -20
- data/lib/shotstack/models/upload_response.rb +222 -0
- data/lib/shotstack/models/upload_response_attributes.rb +257 -0
- data/lib/shotstack/models/upload_response_data.rb +256 -0
- data/lib/shotstack/models/video_asset.rb +102 -22
- data/lib/shotstack/version.rb +3 -3
- data/lib/shotstack.rb +63 -2
- data/shotstack.gemspec +8 -8
- metadata +80 -24
@@ -0,0 +1,240 @@
|
|
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
|
+
# The type of resource (a source) and the newly created source id. Returned with [QueuedSourceResponse](#tocs_queuedsourceresponse).
|
18
|
+
class QueuedSourceResponseData
|
19
|
+
# The type of resource, in this case it is a source.
|
20
|
+
attr_accessor :type
|
21
|
+
|
22
|
+
# The source id.
|
23
|
+
attr_accessor :id
|
24
|
+
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
+
def self.attribute_map
|
27
|
+
{
|
28
|
+
:'type' => :'type',
|
29
|
+
:'id' => :'id'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Returns all the JSON keys this model knows about
|
34
|
+
def self.acceptable_attributes
|
35
|
+
attribute_map.values
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.openapi_types
|
40
|
+
{
|
41
|
+
:'type' => :'String',
|
42
|
+
:'id' => :'String'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# List of attributes with nullable: true
|
47
|
+
def self.openapi_nullable
|
48
|
+
Set.new([
|
49
|
+
])
|
50
|
+
end
|
51
|
+
|
52
|
+
# Initializes the object
|
53
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
54
|
+
def initialize(attributes = {})
|
55
|
+
if (!attributes.is_a?(Hash))
|
56
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Shotstack::QueuedSourceResponseData` initialize method"
|
57
|
+
end
|
58
|
+
|
59
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
61
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Shotstack::QueuedSourceResponseData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
63
|
+
end
|
64
|
+
h[k.to_sym] = v
|
65
|
+
}
|
66
|
+
|
67
|
+
if attributes.key?(:'type')
|
68
|
+
self.type = attributes[:'type']
|
69
|
+
else
|
70
|
+
self.type = nil
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.key?(:'id')
|
74
|
+
self.id = attributes[:'id']
|
75
|
+
else
|
76
|
+
self.id = nil
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
81
|
+
# @return Array for valid properties with the reasons
|
82
|
+
def list_invalid_properties
|
83
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
84
|
+
invalid_properties = Array.new
|
85
|
+
if @type.nil?
|
86
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
87
|
+
end
|
88
|
+
|
89
|
+
if @id.nil?
|
90
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
91
|
+
end
|
92
|
+
|
93
|
+
invalid_properties
|
94
|
+
end
|
95
|
+
|
96
|
+
# Check to see if the all the properties in the model are valid
|
97
|
+
# @return true if the model is valid
|
98
|
+
def valid?
|
99
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
100
|
+
return false if @type.nil?
|
101
|
+
return false if @id.nil?
|
102
|
+
true
|
103
|
+
end
|
104
|
+
|
105
|
+
# Checks equality by comparing each attribute.
|
106
|
+
# @param [Object] Object to be compared
|
107
|
+
def ==(o)
|
108
|
+
return true if self.equal?(o)
|
109
|
+
self.class == o.class &&
|
110
|
+
type == o.type &&
|
111
|
+
id == o.id
|
112
|
+
end
|
113
|
+
|
114
|
+
# @see the `==` method
|
115
|
+
# @param [Object] Object to be compared
|
116
|
+
def eql?(o)
|
117
|
+
self == o
|
118
|
+
end
|
119
|
+
|
120
|
+
# Calculates hash code according to all attributes.
|
121
|
+
# @return [Integer] Hash code
|
122
|
+
def hash
|
123
|
+
[type, id].hash
|
124
|
+
end
|
125
|
+
|
126
|
+
# Builds the object from hash
|
127
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
128
|
+
# @return [Object] Returns the model itself
|
129
|
+
def self.build_from_hash(attributes)
|
130
|
+
return nil unless attributes.is_a?(Hash)
|
131
|
+
attributes = attributes.transform_keys(&:to_sym)
|
132
|
+
transformed_hash = {}
|
133
|
+
openapi_types.each_pair do |key, type|
|
134
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
135
|
+
transformed_hash["#{key}"] = nil
|
136
|
+
elsif type =~ /\AArray<(.*)>/i
|
137
|
+
# check to ensure the input is an array given that the attribute
|
138
|
+
# is documented as an array but the input is not
|
139
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
140
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
141
|
+
end
|
142
|
+
elsif !attributes[attribute_map[key]].nil?
|
143
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
144
|
+
end
|
145
|
+
end
|
146
|
+
new(transformed_hash)
|
147
|
+
end
|
148
|
+
|
149
|
+
# Deserializes the data based on type
|
150
|
+
# @param string type Data type
|
151
|
+
# @param string value Value to be deserialized
|
152
|
+
# @return [Object] Deserialized data
|
153
|
+
def self._deserialize(type, value)
|
154
|
+
case type.to_sym
|
155
|
+
when :Time
|
156
|
+
Time.parse(value)
|
157
|
+
when :Date
|
158
|
+
Date.parse(value)
|
159
|
+
when :String
|
160
|
+
value.to_s
|
161
|
+
when :Integer
|
162
|
+
value.to_i
|
163
|
+
when :Float
|
164
|
+
value.to_f
|
165
|
+
when :Boolean
|
166
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
167
|
+
true
|
168
|
+
else
|
169
|
+
false
|
170
|
+
end
|
171
|
+
when :Object
|
172
|
+
# generic object (usually a Hash), return directly
|
173
|
+
value
|
174
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
175
|
+
inner_type = Regexp.last_match[:inner_type]
|
176
|
+
value.map { |v| _deserialize(inner_type, v) }
|
177
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
178
|
+
k_type = Regexp.last_match[:k_type]
|
179
|
+
v_type = Regexp.last_match[:v_type]
|
180
|
+
{}.tap do |hash|
|
181
|
+
value.each do |k, v|
|
182
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
else # model
|
186
|
+
# models (e.g. Pet) or oneOf
|
187
|
+
klass = Shotstack.const_get(type)
|
188
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
# Returns the string representation of the object
|
193
|
+
# @return [String] String presentation of the object
|
194
|
+
def to_s
|
195
|
+
to_hash.to_s
|
196
|
+
end
|
197
|
+
|
198
|
+
# to_body is an alias to to_hash (backward compatibility)
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
200
|
+
def to_body
|
201
|
+
to_hash
|
202
|
+
end
|
203
|
+
|
204
|
+
# Returns the object in the form of hash
|
205
|
+
# @return [Hash] Returns the object in the form of hash
|
206
|
+
def to_hash
|
207
|
+
hash = {}
|
208
|
+
self.class.attribute_map.each_pair do |attr, param|
|
209
|
+
value = self.send(attr)
|
210
|
+
if value.nil?
|
211
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
212
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
213
|
+
end
|
214
|
+
|
215
|
+
hash[param] = _to_hash(value)
|
216
|
+
end
|
217
|
+
hash
|
218
|
+
end
|
219
|
+
|
220
|
+
# Outputs non-array value in the form of hash
|
221
|
+
# For object, use to_hash. Otherwise, just return the value
|
222
|
+
# @param [Object] value Any valid value
|
223
|
+
# @return [Hash] Returns the value in the form of hash
|
224
|
+
def _to_hash(value)
|
225
|
+
if value.is_a?(Array)
|
226
|
+
value.compact.map { |v| _to_hash(v) }
|
227
|
+
elsif value.is_a?(Hash)
|
228
|
+
{}.tap do |hash|
|
229
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
230
|
+
end
|
231
|
+
elsif value.respond_to? :to_hash
|
232
|
+
value.to_hash
|
233
|
+
else
|
234
|
+
value
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
end
|
239
|
+
|
240
|
+
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Shotstack
|
3
3
|
|
4
|
-
#
|
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
|
-
|
9
|
+
Generator version: 7.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -76,6 +76,7 @@ module Shotstack
|
|
76
76
|
# Show invalid properties with the reasons. Usually used together with valid?
|
77
77
|
# @return Array for valid properties with the reasons
|
78
78
|
def list_invalid_properties
|
79
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
79
80
|
invalid_properties = Array.new
|
80
81
|
if !@start.nil? && @start < 0
|
81
82
|
invalid_properties.push('invalid value for "start", must be greater than or equal to 0.')
|
@@ -91,6 +92,7 @@ module Shotstack
|
|
91
92
|
# Check to see if the all the properties in the model are valid
|
92
93
|
# @return true if the model is valid
|
93
94
|
def valid?
|
95
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
94
96
|
return false if !@start.nil? && @start < 0
|
95
97
|
return false if !@length.nil? && @length < 0
|
96
98
|
true
|
@@ -99,7 +101,11 @@ module Shotstack
|
|
99
101
|
# Custom attribute writer method with validation
|
100
102
|
# @param [Object] start Value to be assigned
|
101
103
|
def start=(start)
|
102
|
-
if
|
104
|
+
if start.nil?
|
105
|
+
fail ArgumentError, 'start cannot be nil'
|
106
|
+
end
|
107
|
+
|
108
|
+
if start < 0
|
103
109
|
fail ArgumentError, 'invalid value for "start", must be greater than or equal to 0.'
|
104
110
|
end
|
105
111
|
|
@@ -109,7 +115,11 @@ module Shotstack
|
|
109
115
|
# Custom attribute writer method with validation
|
110
116
|
# @param [Object] length Value to be assigned
|
111
117
|
def length=(length)
|
112
|
-
if
|
118
|
+
if length.nil?
|
119
|
+
fail ArgumentError, 'length cannot be nil'
|
120
|
+
end
|
121
|
+
|
122
|
+
if length < 0
|
113
123
|
fail ArgumentError, 'invalid value for "length", must be greater than or equal to 0.'
|
114
124
|
end
|
115
125
|
|
@@ -141,36 +151,30 @@ module Shotstack
|
|
141
151
|
# @param [Hash] attributes Model attributes in the form of hash
|
142
152
|
# @return [Object] Returns the model itself
|
143
153
|
def self.build_from_hash(attributes)
|
144
|
-
new.build_from_hash(attributes)
|
145
|
-
end
|
146
|
-
|
147
|
-
# Builds the object from hash
|
148
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
149
|
-
# @return [Object] Returns the model itself
|
150
|
-
def build_from_hash(attributes)
|
151
154
|
return nil unless attributes.is_a?(Hash)
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
+
attributes = attributes.transform_keys(&:to_sym)
|
156
|
+
transformed_hash = {}
|
157
|
+
openapi_types.each_pair do |key, type|
|
158
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
159
|
+
transformed_hash["#{key}"] = nil
|
155
160
|
elsif type =~ /\AArray<(.*)>/i
|
156
161
|
# check to ensure the input is an array given that the attribute
|
157
162
|
# is documented as an array but the input is not
|
158
|
-
if attributes[
|
159
|
-
|
163
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
164
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
160
165
|
end
|
161
|
-
elsif !attributes[
|
162
|
-
|
166
|
+
elsif !attributes[attribute_map[key]].nil?
|
167
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
163
168
|
end
|
164
169
|
end
|
165
|
-
|
166
|
-
self
|
170
|
+
new(transformed_hash)
|
167
171
|
end
|
168
172
|
|
169
173
|
# Deserializes the data based on type
|
170
174
|
# @param string type Data type
|
171
175
|
# @param string value Value to be deserialized
|
172
176
|
# @return [Object] Deserialized data
|
173
|
-
def _deserialize(type, value)
|
177
|
+
def self._deserialize(type, value)
|
174
178
|
case type.to_sym
|
175
179
|
when :Time
|
176
180
|
Time.parse(value)
|
@@ -205,7 +209,7 @@ module Shotstack
|
|
205
209
|
else # model
|
206
210
|
# models (e.g. Pet) or oneOf
|
207
211
|
klass = Shotstack.const_get(type)
|
208
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
212
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
209
213
|
end
|
210
214
|
end
|
211
215
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Shotstack
|
3
3
|
|
4
|
-
#
|
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
|
-
|
9
|
+
Generator version: 7.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -70,20 +70,27 @@ module Shotstack
|
|
70
70
|
|
71
71
|
if attributes.key?(:'success')
|
72
72
|
self.success = attributes[:'success']
|
73
|
+
else
|
74
|
+
self.success = nil
|
73
75
|
end
|
74
76
|
|
75
77
|
if attributes.key?(:'message')
|
76
78
|
self.message = attributes[:'message']
|
79
|
+
else
|
80
|
+
self.message = nil
|
77
81
|
end
|
78
82
|
|
79
83
|
if attributes.key?(:'response')
|
80
84
|
self.response = attributes[:'response']
|
85
|
+
else
|
86
|
+
self.response = nil
|
81
87
|
end
|
82
88
|
end
|
83
89
|
|
84
90
|
# Show invalid properties with the reasons. Usually used together with valid?
|
85
91
|
# @return Array for valid properties with the reasons
|
86
92
|
def list_invalid_properties
|
93
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
87
94
|
invalid_properties = Array.new
|
88
95
|
if @success.nil?
|
89
96
|
invalid_properties.push('invalid value for "success", success cannot be nil.')
|
@@ -103,6 +110,7 @@ module Shotstack
|
|
103
110
|
# Check to see if the all the properties in the model are valid
|
104
111
|
# @return true if the model is valid
|
105
112
|
def valid?
|
113
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
106
114
|
return false if @success.nil?
|
107
115
|
return false if @message.nil?
|
108
116
|
return false if @response.nil?
|
@@ -135,36 +143,30 @@ module Shotstack
|
|
135
143
|
# @param [Hash] attributes Model attributes in the form of hash
|
136
144
|
# @return [Object] Returns the model itself
|
137
145
|
def self.build_from_hash(attributes)
|
138
|
-
new.build_from_hash(attributes)
|
139
|
-
end
|
140
|
-
|
141
|
-
# Builds the object from hash
|
142
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
143
|
-
# @return [Object] Returns the model itself
|
144
|
-
def build_from_hash(attributes)
|
145
146
|
return nil unless attributes.is_a?(Hash)
|
146
|
-
|
147
|
-
|
148
|
-
|
147
|
+
attributes = attributes.transform_keys(&:to_sym)
|
148
|
+
transformed_hash = {}
|
149
|
+
openapi_types.each_pair do |key, type|
|
150
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
151
|
+
transformed_hash["#{key}"] = nil
|
149
152
|
elsif type =~ /\AArray<(.*)>/i
|
150
153
|
# check to ensure the input is an array given that the attribute
|
151
154
|
# is documented as an array but the input is not
|
152
|
-
if attributes[
|
153
|
-
|
155
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
156
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
154
157
|
end
|
155
|
-
elsif !attributes[
|
156
|
-
|
158
|
+
elsif !attributes[attribute_map[key]].nil?
|
159
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
157
160
|
end
|
158
161
|
end
|
159
|
-
|
160
|
-
self
|
162
|
+
new(transformed_hash)
|
161
163
|
end
|
162
164
|
|
163
165
|
# Deserializes the data based on type
|
164
166
|
# @param string type Data type
|
165
167
|
# @param string value Value to be deserialized
|
166
168
|
# @return [Object] Deserialized data
|
167
|
-
def _deserialize(type, value)
|
169
|
+
def self._deserialize(type, value)
|
168
170
|
case type.to_sym
|
169
171
|
when :Time
|
170
172
|
Time.parse(value)
|
@@ -199,7 +201,7 @@ module Shotstack
|
|
199
201
|
else # model
|
200
202
|
# models (e.g. Pet) or oneOf
|
201
203
|
klass = Shotstack.const_get(type)
|
202
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
204
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
203
205
|
end
|
204
206
|
end
|
205
207
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Shotstack
|
3
3
|
|
4
|
-
#
|
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
|
-
|
9
|
+
Generator version: 7.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -122,6 +122,8 @@ module Shotstack
|
|
122
122
|
# List of attributes with nullable: true
|
123
123
|
def self.openapi_nullable
|
124
124
|
Set.new([
|
125
|
+
:'poster',
|
126
|
+
:'thumbnail',
|
125
127
|
])
|
126
128
|
end
|
127
129
|
|
@@ -142,10 +144,14 @@ module Shotstack
|
|
142
144
|
|
143
145
|
if attributes.key?(:'id')
|
144
146
|
self.id = attributes[:'id']
|
147
|
+
else
|
148
|
+
self.id = nil
|
145
149
|
end
|
146
150
|
|
147
151
|
if attributes.key?(:'owner')
|
148
152
|
self.owner = attributes[:'owner']
|
153
|
+
else
|
154
|
+
self.owner = nil
|
149
155
|
end
|
150
156
|
|
151
157
|
if attributes.key?(:'plan')
|
@@ -154,6 +160,8 @@ module Shotstack
|
|
154
160
|
|
155
161
|
if attributes.key?(:'status')
|
156
162
|
self.status = attributes[:'status']
|
163
|
+
else
|
164
|
+
self.status = nil
|
157
165
|
end
|
158
166
|
|
159
167
|
if attributes.key?(:'error')
|
@@ -196,6 +204,7 @@ module Shotstack
|
|
196
204
|
# Show invalid properties with the reasons. Usually used together with valid?
|
197
205
|
# @return Array for valid properties with the reasons
|
198
206
|
def list_invalid_properties
|
207
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
199
208
|
invalid_properties = Array.new
|
200
209
|
if @id.nil?
|
201
210
|
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
@@ -209,32 +218,18 @@ module Shotstack
|
|
209
218
|
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
210
219
|
end
|
211
220
|
|
212
|
-
if @data.nil?
|
213
|
-
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
214
|
-
end
|
215
|
-
|
216
|
-
if @created.nil?
|
217
|
-
invalid_properties.push('invalid value for "created", created cannot be nil.')
|
218
|
-
end
|
219
|
-
|
220
|
-
if @updated.nil?
|
221
|
-
invalid_properties.push('invalid value for "updated", updated cannot be nil.')
|
222
|
-
end
|
223
|
-
|
224
221
|
invalid_properties
|
225
222
|
end
|
226
223
|
|
227
224
|
# Check to see if the all the properties in the model are valid
|
228
225
|
# @return true if the model is valid
|
229
226
|
def valid?
|
227
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
230
228
|
return false if @id.nil?
|
231
229
|
return false if @owner.nil?
|
232
230
|
return false if @status.nil?
|
233
231
|
status_validator = EnumAttributeValidator.new('String', ["queued", "fetching", "rendering", "saving", "done", "failed"])
|
234
232
|
return false unless status_validator.valid?(@status)
|
235
|
-
return false if @data.nil?
|
236
|
-
return false if @created.nil?
|
237
|
-
return false if @updated.nil?
|
238
233
|
true
|
239
234
|
end
|
240
235
|
|
@@ -284,36 +279,30 @@ module Shotstack
|
|
284
279
|
# @param [Hash] attributes Model attributes in the form of hash
|
285
280
|
# @return [Object] Returns the model itself
|
286
281
|
def self.build_from_hash(attributes)
|
287
|
-
new.build_from_hash(attributes)
|
288
|
-
end
|
289
|
-
|
290
|
-
# Builds the object from hash
|
291
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
292
|
-
# @return [Object] Returns the model itself
|
293
|
-
def build_from_hash(attributes)
|
294
282
|
return nil unless attributes.is_a?(Hash)
|
295
|
-
|
296
|
-
|
297
|
-
|
283
|
+
attributes = attributes.transform_keys(&:to_sym)
|
284
|
+
transformed_hash = {}
|
285
|
+
openapi_types.each_pair do |key, type|
|
286
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
287
|
+
transformed_hash["#{key}"] = nil
|
298
288
|
elsif type =~ /\AArray<(.*)>/i
|
299
289
|
# check to ensure the input is an array given that the attribute
|
300
290
|
# is documented as an array but the input is not
|
301
|
-
if attributes[
|
302
|
-
|
291
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
292
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
303
293
|
end
|
304
|
-
elsif !attributes[
|
305
|
-
|
294
|
+
elsif !attributes[attribute_map[key]].nil?
|
295
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
306
296
|
end
|
307
297
|
end
|
308
|
-
|
309
|
-
self
|
298
|
+
new(transformed_hash)
|
310
299
|
end
|
311
300
|
|
312
301
|
# Deserializes the data based on type
|
313
302
|
# @param string type Data type
|
314
303
|
# @param string value Value to be deserialized
|
315
304
|
# @return [Object] Deserialized data
|
316
|
-
def _deserialize(type, value)
|
305
|
+
def self._deserialize(type, value)
|
317
306
|
case type.to_sym
|
318
307
|
when :Time
|
319
308
|
Time.parse(value)
|
@@ -348,7 +337,7 @@ module Shotstack
|
|
348
337
|
else # model
|
349
338
|
# models (e.g. Pet) or oneOf
|
350
339
|
klass = Shotstack.const_get(type)
|
351
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
340
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
352
341
|
end
|
353
342
|
end
|
354
343
|
|