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
@@ -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
|
|
@@ -62,6 +62,16 @@ module Shotstack
|
|
62
62
|
# Defines the access token (Bearer) used with OAuth2.
|
63
63
|
attr_accessor :access_token
|
64
64
|
|
65
|
+
# Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2.
|
66
|
+
# Overrides the access_token if set
|
67
|
+
# @return [Proc]
|
68
|
+
attr_accessor :access_token_getter
|
69
|
+
|
70
|
+
# Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
|
71
|
+
# HTTP responses with return type `File` will be returned as a stream of binary data.
|
72
|
+
# Default to false.
|
73
|
+
attr_accessor :return_binary_data
|
74
|
+
|
65
75
|
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
66
76
|
# details will be logged with `logger.debug` (see the `logger` attribute).
|
67
77
|
# Default to false.
|
@@ -133,6 +143,7 @@ module Shotstack
|
|
133
143
|
# https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
|
134
144
|
attr_accessor :params_encoding
|
135
145
|
|
146
|
+
|
136
147
|
attr_accessor :inject_format
|
137
148
|
|
138
149
|
attr_accessor :force_ending_format
|
@@ -140,7 +151,7 @@ module Shotstack
|
|
140
151
|
def initialize
|
141
152
|
@scheme = 'https'
|
142
153
|
@host = 'api.shotstack.io'
|
143
|
-
@base_path = '/v1'
|
154
|
+
@base_path = '/edit/v1'
|
144
155
|
@server_index = 0
|
145
156
|
@server_operation_index = {}
|
146
157
|
@server_variables = {}
|
@@ -150,10 +161,10 @@ module Shotstack
|
|
150
161
|
@client_side_validation = true
|
151
162
|
@verify_ssl = true
|
152
163
|
@verify_ssl_host = true
|
153
|
-
@params_encoding = nil
|
154
164
|
@cert_file = nil
|
155
165
|
@key_file = nil
|
156
166
|
@timeout = 0
|
167
|
+
@params_encoding = nil
|
157
168
|
@debugging = false
|
158
169
|
@inject_format = false
|
159
170
|
@force_ending_format = false
|
@@ -207,6 +218,12 @@ module Shotstack
|
|
207
218
|
end
|
208
219
|
end
|
209
220
|
|
221
|
+
# Gets access_token using access_token_getter or uses the static access_token
|
222
|
+
def access_token_with_refresh
|
223
|
+
return access_token if access_token_getter.nil?
|
224
|
+
access_token_getter.call
|
225
|
+
end
|
226
|
+
|
210
227
|
# Gets Basic Auth token string
|
211
228
|
def basic_auth_token
|
212
229
|
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
|
@@ -229,11 +246,11 @@ module Shotstack
|
|
229
246
|
def server_settings
|
230
247
|
[
|
231
248
|
{
|
232
|
-
url: "https://api.shotstack.io/{version}",
|
249
|
+
url: "https://api.shotstack.io/edit/{version}",
|
233
250
|
description: "No description provided",
|
234
251
|
variables: {
|
235
252
|
version: {
|
236
|
-
description: "Set the stage to
|
253
|
+
description: "Set the stage to **v1** for production usage without watermarks. Set to **stage** to use the development sandbox.",
|
237
254
|
default_value: "v1",
|
238
255
|
enum_values: [
|
239
256
|
"v1",
|
@@ -247,7 +264,35 @@ module Shotstack
|
|
247
264
|
description: "No description provided",
|
248
265
|
variables: {
|
249
266
|
version: {
|
250
|
-
description: "Set the stage to
|
267
|
+
description: "Set the stage to **v1** for production usage. Set to **stage** to use the development sandbox.",
|
268
|
+
default_value: "v1",
|
269
|
+
enum_values: [
|
270
|
+
"v1",
|
271
|
+
"stage"
|
272
|
+
]
|
273
|
+
}
|
274
|
+
}
|
275
|
+
},
|
276
|
+
{
|
277
|
+
url: "https://api.shotstack.io/ingest/{version}",
|
278
|
+
description: "No description provided",
|
279
|
+
variables: {
|
280
|
+
version: {
|
281
|
+
description: "Set the stage to **v1** for production usage. Set to **stage** to use the development sandbox.",
|
282
|
+
default_value: "v1",
|
283
|
+
enum_values: [
|
284
|
+
"v1",
|
285
|
+
"stage"
|
286
|
+
]
|
287
|
+
}
|
288
|
+
}
|
289
|
+
},
|
290
|
+
{
|
291
|
+
url: "https://api.shotstack.io/create/{version}",
|
292
|
+
description: "No description provided",
|
293
|
+
variables: {
|
294
|
+
version: {
|
295
|
+
description: "Set the stage to **v1** for production usage. Set to **stage** to use the development sandbox.",
|
251
296
|
default_value: "v1",
|
252
297
|
enum_values: [
|
253
298
|
"v1",
|
@@ -272,8 +317,8 @@ module Shotstack
|
|
272
317
|
servers = server_settings if servers == nil
|
273
318
|
|
274
319
|
# check array index out of bound
|
275
|
-
if (index < 0 || index >= servers.size)
|
276
|
-
fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
|
320
|
+
if (index.nil? || index < 0 || index >= servers.size)
|
321
|
+
fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}"
|
277
322
|
end
|
278
323
|
|
279
324
|
server = servers[index]
|
@@ -298,5 +343,6 @@ module Shotstack
|
|
298
343
|
url
|
299
344
|
end
|
300
345
|
|
346
|
+
|
301
347
|
end
|
302
348
|
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
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Shotstack
|
17
|
-
# The type of asset to display for the duration of
|
17
|
+
# The type of asset to display for the duration of the Clip. Value must be one of: <ul> <li><a href=\"#tocs_videoasset\">VideoAsset</a></li> <li><a href=\"#tocs_imageasset\">ImageAsset</a></li> <li><a href=\"#tocs_titleasset\">TitleAsset</a></li> <li><a href=\"#tocs_htmlasset\">HtmlAsset</a></li> <li><a href=\"#tocs_audioasset\">AudioAsset</a></li> <li><a href=\"#tocs_lumaasset\">LumaAsset</a></li> </ul>
|
18
18
|
module Asset
|
19
19
|
class << self
|
20
20
|
# List of class defined in oneOf (OpenAPI v3)
|
@@ -39,7 +39,7 @@ module Shotstack
|
|
39
39
|
# @return [Object] Returns the model or the data itself
|
40
40
|
def build(data)
|
41
41
|
discriminator_value = data[openapi_discriminator_name]
|
42
|
-
return nil
|
42
|
+
return nil if discriminator_value.nil?
|
43
43
|
Shotstack.const_get(discriminator_value).build_from_hash(data)
|
44
44
|
end
|
45
45
|
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
|
|
@@ -63,19 +63,28 @@ module Shotstack
|
|
63
63
|
if (value = attributes[:'data']).is_a?(Array)
|
64
64
|
self.data = value
|
65
65
|
end
|
66
|
+
else
|
67
|
+
self.data = 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
|
76
|
+
if @data.nil?
|
77
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
78
|
+
end
|
79
|
+
|
73
80
|
invalid_properties
|
74
81
|
end
|
75
82
|
|
76
83
|
# Check to see if the all the properties in the model are valid
|
77
84
|
# @return true if the model is valid
|
78
85
|
def valid?
|
86
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
87
|
+
return false if @data.nil?
|
79
88
|
true
|
80
89
|
end
|
81
90
|
|
@@ -103,36 +112,30 @@ module Shotstack
|
|
103
112
|
# @param [Hash] attributes Model attributes in the form of hash
|
104
113
|
# @return [Object] Returns the model itself
|
105
114
|
def self.build_from_hash(attributes)
|
106
|
-
new.build_from_hash(attributes)
|
107
|
-
end
|
108
|
-
|
109
|
-
# Builds the object from hash
|
110
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
-
# @return [Object] Returns the model itself
|
112
|
-
def build_from_hash(attributes)
|
113
115
|
return nil unless attributes.is_a?(Hash)
|
114
|
-
|
115
|
-
|
116
|
-
|
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
|
117
121
|
elsif type =~ /\AArray<(.*)>/i
|
118
122
|
# check to ensure the input is an array given that the attribute
|
119
123
|
# is documented as an array but the input is not
|
120
|
-
if attributes[
|
121
|
-
|
124
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
125
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
122
126
|
end
|
123
|
-
elsif !attributes[
|
124
|
-
|
127
|
+
elsif !attributes[attribute_map[key]].nil?
|
128
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
125
129
|
end
|
126
130
|
end
|
127
|
-
|
128
|
-
self
|
131
|
+
new(transformed_hash)
|
129
132
|
end
|
130
133
|
|
131
134
|
# Deserializes the data based on type
|
132
135
|
# @param string type Data type
|
133
136
|
# @param string value Value to be deserialized
|
134
137
|
# @return [Object] Deserialized data
|
135
|
-
def _deserialize(type, value)
|
138
|
+
def self._deserialize(type, value)
|
136
139
|
case type.to_sym
|
137
140
|
when :Time
|
138
141
|
Time.parse(value)
|
@@ -167,7 +170,7 @@ module Shotstack
|
|
167
170
|
else # model
|
168
171
|
# models (e.g. Pet) or oneOf
|
169
172
|
klass = Shotstack.const_get(type)
|
170
|
-
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)
|
171
174
|
end
|
172
175
|
end
|
173
176
|
|
@@ -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
|
|
@@ -60,19 +60,28 @@ module Shotstack
|
|
60
60
|
|
61
61
|
if attributes.key?(:'data')
|
62
62
|
self.data = attributes[:'data']
|
63
|
+
else
|
64
|
+
self.data = nil
|
63
65
|
end
|
64
66
|
end
|
65
67
|
|
66
68
|
# Show invalid properties with the reasons. Usually used together with valid?
|
67
69
|
# @return Array for valid properties with the reasons
|
68
70
|
def list_invalid_properties
|
71
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
69
72
|
invalid_properties = Array.new
|
73
|
+
if @data.nil?
|
74
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
75
|
+
end
|
76
|
+
|
70
77
|
invalid_properties
|
71
78
|
end
|
72
79
|
|
73
80
|
# Check to see if the all the properties in the model are valid
|
74
81
|
# @return true if the model is valid
|
75
82
|
def valid?
|
83
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
84
|
+
return false if @data.nil?
|
76
85
|
true
|
77
86
|
end
|
78
87
|
|
@@ -100,36 +109,30 @@ module Shotstack
|
|
100
109
|
# @param [Hash] attributes Model attributes in the form of hash
|
101
110
|
# @return [Object] Returns the model itself
|
102
111
|
def self.build_from_hash(attributes)
|
103
|
-
new.build_from_hash(attributes)
|
104
|
-
end
|
105
|
-
|
106
|
-
# Builds the object from hash
|
107
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
108
|
-
# @return [Object] Returns the model itself
|
109
|
-
def build_from_hash(attributes)
|
110
112
|
return nil unless attributes.is_a?(Hash)
|
111
|
-
|
112
|
-
|
113
|
-
|
113
|
+
attributes = attributes.transform_keys(&:to_sym)
|
114
|
+
transformed_hash = {}
|
115
|
+
openapi_types.each_pair do |key, type|
|
116
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
117
|
+
transformed_hash["#{key}"] = nil
|
114
118
|
elsif type =~ /\AArray<(.*)>/i
|
115
119
|
# check to ensure the input is an array given that the attribute
|
116
120
|
# is documented as an array but the input is not
|
117
|
-
if attributes[
|
118
|
-
|
121
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
122
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
119
123
|
end
|
120
|
-
elsif !attributes[
|
121
|
-
|
124
|
+
elsif !attributes[attribute_map[key]].nil?
|
125
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
122
126
|
end
|
123
127
|
end
|
124
|
-
|
125
|
-
self
|
128
|
+
new(transformed_hash)
|
126
129
|
end
|
127
130
|
|
128
131
|
# Deserializes the data based on type
|
129
132
|
# @param string type Data type
|
130
133
|
# @param string value Value to be deserialized
|
131
134
|
# @return [Object] Deserialized data
|
132
|
-
def _deserialize(type, value)
|
135
|
+
def self._deserialize(type, value)
|
133
136
|
case type.to_sym
|
134
137
|
when :Time
|
135
138
|
Time.parse(value)
|
@@ -164,7 +167,7 @@ module Shotstack
|
|
164
167
|
else # model
|
165
168
|
# models (e.g. Pet) or oneOf
|
166
169
|
klass = Shotstack.const_get(type)
|
167
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
170
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
168
171
|
end
|
169
172
|
end
|
170
173
|
|
@@ -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
|
|
@@ -19,7 +19,7 @@ module Shotstack
|
|
19
19
|
# The unique id of the hosted asset in UUID format.
|
20
20
|
attr_accessor :id
|
21
21
|
|
22
|
-
# The owner id of the
|
22
|
+
# The owner id of the asset.
|
23
23
|
attr_accessor :owner
|
24
24
|
|
25
25
|
# The region the asset is hosted, currently only `au` (Australia).
|
@@ -128,10 +128,14 @@ module Shotstack
|
|
128
128
|
|
129
129
|
if attributes.key?(:'id')
|
130
130
|
self.id = attributes[:'id']
|
131
|
+
else
|
132
|
+
self.id = nil
|
131
133
|
end
|
132
134
|
|
133
135
|
if attributes.key?(:'owner')
|
134
136
|
self.owner = attributes[:'owner']
|
137
|
+
else
|
138
|
+
self.owner = nil
|
135
139
|
end
|
136
140
|
|
137
141
|
if attributes.key?(:'region')
|
@@ -156,6 +160,8 @@ module Shotstack
|
|
156
160
|
|
157
161
|
if attributes.key?(:'status')
|
158
162
|
self.status = attributes[:'status']
|
163
|
+
else
|
164
|
+
self.status = nil
|
159
165
|
end
|
160
166
|
|
161
167
|
if attributes.key?(:'created')
|
@@ -170,13 +176,30 @@ module Shotstack
|
|
170
176
|
# Show invalid properties with the reasons. Usually used together with valid?
|
171
177
|
# @return Array for valid properties with the reasons
|
172
178
|
def list_invalid_properties
|
179
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
173
180
|
invalid_properties = Array.new
|
181
|
+
if @id.nil?
|
182
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
183
|
+
end
|
184
|
+
|
185
|
+
if @owner.nil?
|
186
|
+
invalid_properties.push('invalid value for "owner", owner cannot be nil.')
|
187
|
+
end
|
188
|
+
|
189
|
+
if @status.nil?
|
190
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
191
|
+
end
|
192
|
+
|
174
193
|
invalid_properties
|
175
194
|
end
|
176
195
|
|
177
196
|
# Check to see if the all the properties in the model are valid
|
178
197
|
# @return true if the model is valid
|
179
198
|
def valid?
|
199
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
200
|
+
return false if @id.nil?
|
201
|
+
return false if @owner.nil?
|
202
|
+
return false if @status.nil?
|
180
203
|
status_validator = EnumAttributeValidator.new('String', ["importing", "ready", "failed", "deleted"])
|
181
204
|
return false unless status_validator.valid?(@status)
|
182
205
|
true
|
@@ -225,36 +248,30 @@ module Shotstack
|
|
225
248
|
# @param [Hash] attributes Model attributes in the form of hash
|
226
249
|
# @return [Object] Returns the model itself
|
227
250
|
def self.build_from_hash(attributes)
|
228
|
-
new.build_from_hash(attributes)
|
229
|
-
end
|
230
|
-
|
231
|
-
# Builds the object from hash
|
232
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
233
|
-
# @return [Object] Returns the model itself
|
234
|
-
def build_from_hash(attributes)
|
235
251
|
return nil unless attributes.is_a?(Hash)
|
236
|
-
|
237
|
-
|
238
|
-
|
252
|
+
attributes = attributes.transform_keys(&:to_sym)
|
253
|
+
transformed_hash = {}
|
254
|
+
openapi_types.each_pair do |key, type|
|
255
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
256
|
+
transformed_hash["#{key}"] = nil
|
239
257
|
elsif type =~ /\AArray<(.*)>/i
|
240
258
|
# check to ensure the input is an array given that the attribute
|
241
259
|
# is documented as an array but the input is not
|
242
|
-
if attributes[
|
243
|
-
|
260
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
261
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
244
262
|
end
|
245
|
-
elsif !attributes[
|
246
|
-
|
263
|
+
elsif !attributes[attribute_map[key]].nil?
|
264
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
247
265
|
end
|
248
266
|
end
|
249
|
-
|
250
|
-
self
|
267
|
+
new(transformed_hash)
|
251
268
|
end
|
252
269
|
|
253
270
|
# Deserializes the data based on type
|
254
271
|
# @param string type Data type
|
255
272
|
# @param string value Value to be deserialized
|
256
273
|
# @return [Object] Deserialized data
|
257
|
-
def _deserialize(type, value)
|
274
|
+
def self._deserialize(type, value)
|
258
275
|
case type.to_sym
|
259
276
|
when :Time
|
260
277
|
Time.parse(value)
|
@@ -289,7 +306,7 @@ module Shotstack
|
|
289
306
|
else # model
|
290
307
|
# models (e.g. Pet) or oneOf
|
291
308
|
klass = Shotstack.const_get(type)
|
292
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
309
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
293
310
|
end
|
294
311
|
end
|
295
312
|
|
@@ -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
|
|
@@ -65,23 +65,39 @@ module Shotstack
|
|
65
65
|
|
66
66
|
if attributes.key?(:'type')
|
67
67
|
self.type = attributes[:'type']
|
68
|
+
else
|
69
|
+
self.type = nil
|
68
70
|
end
|
69
71
|
|
70
72
|
if attributes.key?(:'attributes')
|
71
73
|
self.attributes = attributes[:'attributes']
|
74
|
+
else
|
75
|
+
self.attributes = nil
|
72
76
|
end
|
73
77
|
end
|
74
78
|
|
75
79
|
# Show invalid properties with the reasons. Usually used together with valid?
|
76
80
|
# @return Array for valid properties with the reasons
|
77
81
|
def list_invalid_properties
|
82
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
78
83
|
invalid_properties = Array.new
|
84
|
+
if @type.nil?
|
85
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
86
|
+
end
|
87
|
+
|
88
|
+
if @attributes.nil?
|
89
|
+
invalid_properties.push('invalid value for "attributes", attributes cannot be nil.')
|
90
|
+
end
|
91
|
+
|
79
92
|
invalid_properties
|
80
93
|
end
|
81
94
|
|
82
95
|
# Check to see if the all the properties in the model are valid
|
83
96
|
# @return true if the model is valid
|
84
97
|
def valid?
|
98
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
99
|
+
return false if @type.nil?
|
100
|
+
return false if @attributes.nil?
|
85
101
|
true
|
86
102
|
end
|
87
103
|
|
@@ -110,36 +126,30 @@ module Shotstack
|
|
110
126
|
# @param [Hash] attributes Model attributes in the form of hash
|
111
127
|
# @return [Object] Returns the model itself
|
112
128
|
def self.build_from_hash(attributes)
|
113
|
-
new.build_from_hash(attributes)
|
114
|
-
end
|
115
|
-
|
116
|
-
# Builds the object from hash
|
117
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
118
|
-
# @return [Object] Returns the model itself
|
119
|
-
def build_from_hash(attributes)
|
120
129
|
return nil unless attributes.is_a?(Hash)
|
121
|
-
|
122
|
-
|
123
|
-
|
130
|
+
attributes = attributes.transform_keys(&:to_sym)
|
131
|
+
transformed_hash = {}
|
132
|
+
openapi_types.each_pair do |key, type|
|
133
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
134
|
+
transformed_hash["#{key}"] = nil
|
124
135
|
elsif type =~ /\AArray<(.*)>/i
|
125
136
|
# check to ensure the input is an array given that the attribute
|
126
137
|
# is documented as an array but the input is not
|
127
|
-
if attributes[
|
128
|
-
|
138
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
139
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
129
140
|
end
|
130
|
-
elsif !attributes[
|
131
|
-
|
141
|
+
elsif !attributes[attribute_map[key]].nil?
|
142
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
132
143
|
end
|
133
144
|
end
|
134
|
-
|
135
|
-
self
|
145
|
+
new(transformed_hash)
|
136
146
|
end
|
137
147
|
|
138
148
|
# Deserializes the data based on type
|
139
149
|
# @param string type Data type
|
140
150
|
# @param string value Value to be deserialized
|
141
151
|
# @return [Object] Deserialized data
|
142
|
-
def _deserialize(type, value)
|
152
|
+
def self._deserialize(type, value)
|
143
153
|
case type.to_sym
|
144
154
|
when :Time
|
145
155
|
Time.parse(value)
|
@@ -174,7 +184,7 @@ module Shotstack
|
|
174
184
|
else # model
|
175
185
|
# models (e.g. Pet) or oneOf
|
176
186
|
klass = Shotstack.const_get(type)
|
177
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
187
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
178
188
|
end
|
179
189
|
end
|
180
190
|
|