shotstack 0.2.2 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +9 -0
- 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 +3 -3
- data/lib/shotstack/models/asset_render_response.rb +18 -20
- data/lib/shotstack/models/asset_response.rb +18 -20
- data/lib/shotstack/models/asset_response_attributes.rb +23 -21
- data/lib/shotstack/models/asset_response_data.rb +20 -20
- data/lib/shotstack/models/audio_asset.rb +57 -21
- data/lib/shotstack/models/audio_enhancement.rb +43 -0
- data/lib/shotstack/models/clip.rb +27 -25
- data/lib/shotstack/models/crop.rb +40 -28
- data/lib/shotstack/models/destinations.rb +78 -243
- 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 -22
- 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 -20
- 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 -22
- 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 +28 -24
- 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 +27 -29
- 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 +22 -20
- 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 -20
- data/lib/shotstack/models/s3_destination.rb +18 -22
- data/lib/shotstack/models/s3_destination_options.rb +21 -21
- data/lib/shotstack/models/shotstack_destination.rb +19 -23
- 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 +36 -32
- data/lib/shotstack/models/skew_transformation.rb +16 -20
- data/lib/shotstack/models/soundtrack.rb +18 -20
- 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 +23 -21
- data/lib/shotstack/models/template_data_response_data.rb +24 -20
- 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 -20
- data/lib/shotstack/models/template_render.rb +18 -20
- data/lib/shotstack/models/template_response.rb +22 -20
- 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 -21
- data/lib/shotstack/models/title_asset.rb +18 -20
- 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 +57 -21
- data/lib/shotstack/version.rb +3 -3
- data/lib/shotstack.rb +61 -2
- data/shotstack.gemspec +8 -8
- metadata +69 -16
@@ -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
|
|
@@ -66,16 +66,21 @@ module Shotstack
|
|
66
66
|
|
67
67
|
if attributes.key?(:'message')
|
68
68
|
self.message = attributes[:'message']
|
69
|
+
else
|
70
|
+
self.message = nil
|
69
71
|
end
|
70
72
|
|
71
73
|
if attributes.key?(:'id')
|
72
74
|
self.id = attributes[:'id']
|
75
|
+
else
|
76
|
+
self.id = nil
|
73
77
|
end
|
74
78
|
end
|
75
79
|
|
76
80
|
# Show invalid properties with the reasons. Usually used together with valid?
|
77
81
|
# @return Array for valid properties with the reasons
|
78
82
|
def list_invalid_properties
|
83
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
79
84
|
invalid_properties = Array.new
|
80
85
|
if @message.nil?
|
81
86
|
invalid_properties.push('invalid value for "message", message cannot be nil.')
|
@@ -91,6 +96,7 @@ module Shotstack
|
|
91
96
|
# Check to see if the all the properties in the model are valid
|
92
97
|
# @return true if the model is valid
|
93
98
|
def valid?
|
99
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
94
100
|
return false if @message.nil?
|
95
101
|
return false if @id.nil?
|
96
102
|
true
|
@@ -121,36 +127,30 @@ module Shotstack
|
|
121
127
|
# @param [Hash] attributes Model attributes in the form of hash
|
122
128
|
# @return [Object] Returns the model itself
|
123
129
|
def self.build_from_hash(attributes)
|
124
|
-
new.build_from_hash(attributes)
|
125
|
-
end
|
126
|
-
|
127
|
-
# Builds the object from hash
|
128
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
129
|
-
# @return [Object] Returns the model itself
|
130
|
-
def build_from_hash(attributes)
|
131
130
|
return nil unless attributes.is_a?(Hash)
|
132
|
-
|
133
|
-
|
134
|
-
|
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
|
135
136
|
elsif type =~ /\AArray<(.*)>/i
|
136
137
|
# check to ensure the input is an array given that the attribute
|
137
138
|
# is documented as an array but the input is not
|
138
|
-
if attributes[
|
139
|
-
|
139
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
140
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
140
141
|
end
|
141
|
-
elsif !attributes[
|
142
|
-
|
142
|
+
elsif !attributes[attribute_map[key]].nil?
|
143
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
143
144
|
end
|
144
145
|
end
|
145
|
-
|
146
|
-
self
|
146
|
+
new(transformed_hash)
|
147
147
|
end
|
148
148
|
|
149
149
|
# Deserializes the data based on type
|
150
150
|
# @param string type Data type
|
151
151
|
# @param string value Value to be deserialized
|
152
152
|
# @return [Object] Deserialized data
|
153
|
-
def _deserialize(type, value)
|
153
|
+
def self._deserialize(type, value)
|
154
154
|
case type.to_sym
|
155
155
|
when :Time
|
156
156
|
Time.parse(value)
|
@@ -185,7 +185,7 @@ module Shotstack
|
|
185
185
|
else # model
|
186
186
|
# models (e.g. Pet) or oneOf
|
187
187
|
klass = Shotstack.const_get(type)
|
188
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
188
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
@@ -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
|
|
@@ -66,16 +66,21 @@ module Shotstack
|
|
66
66
|
|
67
67
|
if attributes.key?(:'capture')
|
68
68
|
self.capture = attributes[:'capture']
|
69
|
+
else
|
70
|
+
self.capture = nil
|
69
71
|
end
|
70
72
|
|
71
73
|
if attributes.key?(:'scale')
|
72
74
|
self.scale = attributes[:'scale']
|
75
|
+
else
|
76
|
+
self.scale = nil
|
73
77
|
end
|
74
78
|
end
|
75
79
|
|
76
80
|
# Show invalid properties with the reasons. Usually used together with valid?
|
77
81
|
# @return Array for valid properties with the reasons
|
78
82
|
def list_invalid_properties
|
83
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
79
84
|
invalid_properties = Array.new
|
80
85
|
if @capture.nil?
|
81
86
|
invalid_properties.push('invalid value for "capture", capture cannot be nil.')
|
@@ -91,6 +96,7 @@ module Shotstack
|
|
91
96
|
# Check to see if the all the properties in the model are valid
|
92
97
|
# @return true if the model is valid
|
93
98
|
def valid?
|
99
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
94
100
|
return false if @capture.nil?
|
95
101
|
return false if @scale.nil?
|
96
102
|
true
|
@@ -121,36 +127,30 @@ module Shotstack
|
|
121
127
|
# @param [Hash] attributes Model attributes in the form of hash
|
122
128
|
# @return [Object] Returns the model itself
|
123
129
|
def self.build_from_hash(attributes)
|
124
|
-
new.build_from_hash(attributes)
|
125
|
-
end
|
126
|
-
|
127
|
-
# Builds the object from hash
|
128
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
129
|
-
# @return [Object] Returns the model itself
|
130
|
-
def build_from_hash(attributes)
|
131
130
|
return nil unless attributes.is_a?(Hash)
|
132
|
-
|
133
|
-
|
134
|
-
|
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
|
135
136
|
elsif type =~ /\AArray<(.*)>/i
|
136
137
|
# check to ensure the input is an array given that the attribute
|
137
138
|
# is documented as an array but the input is not
|
138
|
-
if attributes[
|
139
|
-
|
139
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
140
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
140
141
|
end
|
141
|
-
elsif !attributes[
|
142
|
-
|
142
|
+
elsif !attributes[attribute_map[key]].nil?
|
143
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
143
144
|
end
|
144
145
|
end
|
145
|
-
|
146
|
-
self
|
146
|
+
new(transformed_hash)
|
147
147
|
end
|
148
148
|
|
149
149
|
# Deserializes the data based on type
|
150
150
|
# @param string type Data type
|
151
151
|
# @param string value Value to be deserialized
|
152
152
|
# @return [Object] Deserialized data
|
153
|
-
def _deserialize(type, value)
|
153
|
+
def self._deserialize(type, value)
|
154
154
|
case type.to_sym
|
155
155
|
when :Time
|
156
156
|
Time.parse(value)
|
@@ -185,7 +185,7 @@ module Shotstack
|
|
185
185
|
else # model
|
186
186
|
# models (e.g. Pet) or oneOf
|
187
187
|
klass = Shotstack.const_get(type)
|
188
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
188
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
@@ -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
|
|
@@ -27,7 +27,7 @@ module Shotstack
|
|
27
27
|
# A timeline consists of an array of tracks, each track containing clips. Tracks are layered on top of each other in the same order they are added to the array with the top most track layered over the top of those below it. Ensure that a track containing titles is the top most track so that it is displayed above videos and images.
|
28
28
|
attr_accessor :tracks
|
29
29
|
|
30
|
-
# Disable the caching of ingested source footage and assets. See [caching](https://shotstack.io/docs/guide/architecting-an-application/caching) for more details.
|
30
|
+
# Disable the caching of ingested source footage and assets. See [caching](https://shotstack.io/docs/guide/architecting-an-application/caching/) for more details.
|
31
31
|
attr_accessor :cache
|
32
32
|
|
33
33
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -96,6 +96,8 @@ module Shotstack
|
|
96
96
|
if (value = attributes[:'tracks']).is_a?(Array)
|
97
97
|
self.tracks = value
|
98
98
|
end
|
99
|
+
else
|
100
|
+
self.tracks = nil
|
99
101
|
end
|
100
102
|
|
101
103
|
if attributes.key?(:'cache')
|
@@ -106,6 +108,7 @@ module Shotstack
|
|
106
108
|
# Show invalid properties with the reasons. Usually used together with valid?
|
107
109
|
# @return Array for valid properties with the reasons
|
108
110
|
def list_invalid_properties
|
111
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
109
112
|
invalid_properties = Array.new
|
110
113
|
if @tracks.nil?
|
111
114
|
invalid_properties.push('invalid value for "tracks", tracks cannot be nil.')
|
@@ -117,6 +120,7 @@ module Shotstack
|
|
117
120
|
# Check to see if the all the properties in the model are valid
|
118
121
|
# @return true if the model is valid
|
119
122
|
def valid?
|
123
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
120
124
|
return false if @tracks.nil?
|
121
125
|
true
|
122
126
|
end
|
@@ -149,36 +153,30 @@ module Shotstack
|
|
149
153
|
# @param [Hash] attributes Model attributes in the form of hash
|
150
154
|
# @return [Object] Returns the model itself
|
151
155
|
def self.build_from_hash(attributes)
|
152
|
-
new.build_from_hash(attributes)
|
153
|
-
end
|
154
|
-
|
155
|
-
# Builds the object from hash
|
156
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
157
|
-
# @return [Object] Returns the model itself
|
158
|
-
def build_from_hash(attributes)
|
159
156
|
return nil unless attributes.is_a?(Hash)
|
160
|
-
|
161
|
-
|
162
|
-
|
157
|
+
attributes = attributes.transform_keys(&:to_sym)
|
158
|
+
transformed_hash = {}
|
159
|
+
openapi_types.each_pair do |key, type|
|
160
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
161
|
+
transformed_hash["#{key}"] = nil
|
163
162
|
elsif type =~ /\AArray<(.*)>/i
|
164
163
|
# check to ensure the input is an array given that the attribute
|
165
164
|
# is documented as an array but the input is not
|
166
|
-
if attributes[
|
167
|
-
|
165
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
166
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
168
167
|
end
|
169
|
-
elsif !attributes[
|
170
|
-
|
168
|
+
elsif !attributes[attribute_map[key]].nil?
|
169
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
171
170
|
end
|
172
171
|
end
|
173
|
-
|
174
|
-
self
|
172
|
+
new(transformed_hash)
|
175
173
|
end
|
176
174
|
|
177
175
|
# Deserializes the data based on type
|
178
176
|
# @param string type Data type
|
179
177
|
# @param string value Value to be deserialized
|
180
178
|
# @return [Object] Deserialized data
|
181
|
-
def _deserialize(type, value)
|
179
|
+
def self._deserialize(type, value)
|
182
180
|
case type.to_sym
|
183
181
|
when :Time
|
184
182
|
Time.parse(value)
|
@@ -213,7 +211,7 @@ module Shotstack
|
|
213
211
|
else # model
|
214
212
|
# models (e.g. Pet) or oneOf
|
215
213
|
klass = Shotstack.const_get(type)
|
216
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
214
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
217
215
|
end
|
218
216
|
end
|
219
217
|
|
@@ -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
|
|
@@ -123,6 +123,8 @@ module Shotstack
|
|
123
123
|
|
124
124
|
if attributes.key?(:'text')
|
125
125
|
self.text = attributes[:'text']
|
126
|
+
else
|
127
|
+
self.text = nil
|
126
128
|
end
|
127
129
|
|
128
130
|
if attributes.key?(:'style')
|
@@ -153,6 +155,7 @@ module Shotstack
|
|
153
155
|
# Show invalid properties with the reasons. Usually used together with valid?
|
154
156
|
# @return Array for valid properties with the reasons
|
155
157
|
def list_invalid_properties
|
158
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
156
159
|
invalid_properties = Array.new
|
157
160
|
if @type.nil?
|
158
161
|
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
@@ -168,6 +171,7 @@ module Shotstack
|
|
168
171
|
# Check to see if the all the properties in the model are valid
|
169
172
|
# @return true if the model is valid
|
170
173
|
def valid?
|
174
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
171
175
|
return false if @type.nil?
|
172
176
|
return false if @text.nil?
|
173
177
|
style_validator = EnumAttributeValidator.new('String', ["minimal", "blockbuster", "vogue", "sketchy", "skinny", "chunk", "chunkLight", "marker", "future", "subtitle"])
|
@@ -240,36 +244,30 @@ module Shotstack
|
|
240
244
|
# @param [Hash] attributes Model attributes in the form of hash
|
241
245
|
# @return [Object] Returns the model itself
|
242
246
|
def self.build_from_hash(attributes)
|
243
|
-
new.build_from_hash(attributes)
|
244
|
-
end
|
245
|
-
|
246
|
-
# Builds the object from hash
|
247
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
248
|
-
# @return [Object] Returns the model itself
|
249
|
-
def build_from_hash(attributes)
|
250
247
|
return nil unless attributes.is_a?(Hash)
|
251
|
-
|
252
|
-
|
253
|
-
|
248
|
+
attributes = attributes.transform_keys(&:to_sym)
|
249
|
+
transformed_hash = {}
|
250
|
+
openapi_types.each_pair do |key, type|
|
251
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
252
|
+
transformed_hash["#{key}"] = nil
|
254
253
|
elsif type =~ /\AArray<(.*)>/i
|
255
254
|
# check to ensure the input is an array given that the attribute
|
256
255
|
# is documented as an array but the input is not
|
257
|
-
if attributes[
|
258
|
-
|
256
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
257
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
259
258
|
end
|
260
|
-
elsif !attributes[
|
261
|
-
|
259
|
+
elsif !attributes[attribute_map[key]].nil?
|
260
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
262
261
|
end
|
263
262
|
end
|
264
|
-
|
265
|
-
self
|
263
|
+
new(transformed_hash)
|
266
264
|
end
|
267
265
|
|
268
266
|
# Deserializes the data based on type
|
269
267
|
# @param string type Data type
|
270
268
|
# @param string value Value to be deserialized
|
271
269
|
# @return [Object] Deserialized data
|
272
|
-
def _deserialize(type, value)
|
270
|
+
def self._deserialize(type, value)
|
273
271
|
case type.to_sym
|
274
272
|
when :Time
|
275
273
|
Time.parse(value)
|
@@ -304,7 +302,7 @@ module Shotstack
|
|
304
302
|
else # model
|
305
303
|
# models (e.g. Pet) or oneOf
|
306
304
|
klass = Shotstack.const_get(type)
|
307
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
305
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
308
306
|
end
|
309
307
|
end
|
310
308
|
|
@@ -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
|
|
@@ -63,12 +63,15 @@ module Shotstack
|
|
63
63
|
if (value = attributes[:'clips']).is_a?(Array)
|
64
64
|
self.clips = value
|
65
65
|
end
|
66
|
+
else
|
67
|
+
self.clips = nil
|
66
68
|
end
|
67
69
|
end
|
68
70
|
|
69
71
|
# Show invalid properties with the reasons. Usually used together with valid?
|
70
72
|
# @return Array for valid properties with the reasons
|
71
73
|
def list_invalid_properties
|
74
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
72
75
|
invalid_properties = Array.new
|
73
76
|
if @clips.nil?
|
74
77
|
invalid_properties.push('invalid value for "clips", clips cannot be nil.')
|
@@ -80,6 +83,7 @@ module Shotstack
|
|
80
83
|
# Check to see if the all the properties in the model are valid
|
81
84
|
# @return true if the model is valid
|
82
85
|
def valid?
|
86
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
83
87
|
return false if @clips.nil?
|
84
88
|
true
|
85
89
|
end
|
@@ -108,36 +112,30 @@ module Shotstack
|
|
108
112
|
# @param [Hash] attributes Model attributes in the form of hash
|
109
113
|
# @return [Object] Returns the model itself
|
110
114
|
def self.build_from_hash(attributes)
|
111
|
-
new.build_from_hash(attributes)
|
112
|
-
end
|
113
|
-
|
114
|
-
# Builds the object from hash
|
115
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
116
|
-
# @return [Object] Returns the model itself
|
117
|
-
def build_from_hash(attributes)
|
118
115
|
return nil unless attributes.is_a?(Hash)
|
119
|
-
|
120
|
-
|
121
|
-
|
116
|
+
attributes = attributes.transform_keys(&:to_sym)
|
117
|
+
transformed_hash = {}
|
118
|
+
openapi_types.each_pair do |key, type|
|
119
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
120
|
+
transformed_hash["#{key}"] = nil
|
122
121
|
elsif type =~ /\AArray<(.*)>/i
|
123
122
|
# check to ensure the input is an array given that the attribute
|
124
123
|
# is documented as an array but the input is not
|
125
|
-
if attributes[
|
126
|
-
|
124
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
125
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
127
126
|
end
|
128
|
-
elsif !attributes[
|
129
|
-
|
127
|
+
elsif !attributes[attribute_map[key]].nil?
|
128
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
130
129
|
end
|
131
130
|
end
|
132
|
-
|
133
|
-
self
|
131
|
+
new(transformed_hash)
|
134
132
|
end
|
135
133
|
|
136
134
|
# Deserializes the data based on type
|
137
135
|
# @param string type Data type
|
138
136
|
# @param string value Value to be deserialized
|
139
137
|
# @return [Object] Deserialized data
|
140
|
-
def _deserialize(type, value)
|
138
|
+
def self._deserialize(type, value)
|
141
139
|
case type.to_sym
|
142
140
|
when :Time
|
143
141
|
Time.parse(value)
|
@@ -172,7 +170,7 @@ module Shotstack
|
|
172
170
|
else # model
|
173
171
|
# models (e.g. Pet) or oneOf
|
174
172
|
klass = Shotstack.const_get(type)
|
175
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
173
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
176
174
|
end
|
177
175
|
end
|
178
176
|
|