shotstack 0.2.2 → 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.
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
 
@@ -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 `v1` for production usage without watermarks. Set to `stage` to use the development sandbox.",
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 `v1` for production usage. Set to `stage` to use the development sandbox.",
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
- #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
 
@@ -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 unless discriminator_value
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
- #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
 
@@ -63,12 +63,15 @@ 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
73
76
  if @data.nil?
74
77
  invalid_properties.push('invalid value for "data", data 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 @data.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
- self.class.openapi_types.each_pair do |key, type|
120
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
121
- self.send("#{key}=", nil)
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[self.class.attribute_map[key]].is_a?(Array)
126
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
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[self.class.attribute_map[key]].nil?
129
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
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
 
@@ -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
 
@@ -60,12 +60,15 @@ 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
70
73
  if @data.nil?
71
74
  invalid_properties.push('invalid value for "data", data cannot be nil.')
@@ -77,6 +80,7 @@ module Shotstack
77
80
  # Check to see if the all the properties in the model are valid
78
81
  # @return true if the model is valid
79
82
  def valid?
83
+ warn '[DEPRECATED] the `valid?` method is obsolete'
80
84
  return false if @data.nil?
81
85
  true
82
86
  end
@@ -105,36 +109,30 @@ module Shotstack
105
109
  # @param [Hash] attributes Model attributes in the form of hash
106
110
  # @return [Object] Returns the model itself
107
111
  def self.build_from_hash(attributes)
108
- new.build_from_hash(attributes)
109
- end
110
-
111
- # Builds the object from hash
112
- # @param [Hash] attributes Model attributes in the form of hash
113
- # @return [Object] Returns the model itself
114
- def build_from_hash(attributes)
115
112
  return nil unless attributes.is_a?(Hash)
116
- self.class.openapi_types.each_pair do |key, type|
117
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
118
- self.send("#{key}=", nil)
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
119
118
  elsif type =~ /\AArray<(.*)>/i
120
119
  # check to ensure the input is an array given that the attribute
121
120
  # is documented as an array but the input is not
122
- if attributes[self.class.attribute_map[key]].is_a?(Array)
123
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
121
+ if attributes[attribute_map[key]].is_a?(Array)
122
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
124
123
  end
125
- elsif !attributes[self.class.attribute_map[key]].nil?
126
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
124
+ elsif !attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
127
126
  end
128
127
  end
129
-
130
- self
128
+ new(transformed_hash)
131
129
  end
132
130
 
133
131
  # Deserializes the data based on type
134
132
  # @param string type Data type
135
133
  # @param string value Value to be deserialized
136
134
  # @return [Object] Deserialized data
137
- def _deserialize(type, value)
135
+ def self._deserialize(type, value)
138
136
  case type.to_sym
139
137
  when :Time
140
138
  Time.parse(value)
@@ -169,7 +167,7 @@ module Shotstack
169
167
  else # model
170
168
  # models (e.g. Pet) or oneOf
171
169
  klass = Shotstack.const_get(type)
172
- 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)
173
171
  end
174
172
  end
175
173
 
@@ -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
 
@@ -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 render task.
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,6 +176,7 @@ 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
174
181
  if @id.nil?
175
182
  invalid_properties.push('invalid value for "id", id cannot be nil.')
@@ -189,6 +196,7 @@ module Shotstack
189
196
  # Check to see if the all the properties in the model are valid
190
197
  # @return true if the model is valid
191
198
  def valid?
199
+ warn '[DEPRECATED] the `valid?` method is obsolete'
192
200
  return false if @id.nil?
193
201
  return false if @owner.nil?
194
202
  return false if @status.nil?
@@ -240,36 +248,30 @@ module Shotstack
240
248
  # @param [Hash] attributes Model attributes in the form of hash
241
249
  # @return [Object] Returns the model itself
242
250
  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
251
  return nil unless attributes.is_a?(Hash)
251
- self.class.openapi_types.each_pair do |key, type|
252
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
253
- self.send("#{key}=", nil)
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
254
257
  elsif type =~ /\AArray<(.*)>/i
255
258
  # check to ensure the input is an array given that the attribute
256
259
  # is documented as an array but the input is not
257
- if attributes[self.class.attribute_map[key]].is_a?(Array)
258
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
260
+ if attributes[attribute_map[key]].is_a?(Array)
261
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
259
262
  end
260
- elsif !attributes[self.class.attribute_map[key]].nil?
261
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
263
+ elsif !attributes[attribute_map[key]].nil?
264
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
262
265
  end
263
266
  end
264
-
265
- self
267
+ new(transformed_hash)
266
268
  end
267
269
 
268
270
  # Deserializes the data based on type
269
271
  # @param string type Data type
270
272
  # @param string value Value to be deserialized
271
273
  # @return [Object] Deserialized data
272
- def _deserialize(type, value)
274
+ def self._deserialize(type, value)
273
275
  case type.to_sym
274
276
  when :Time
275
277
  Time.parse(value)
@@ -304,7 +306,7 @@ module Shotstack
304
306
  else # model
305
307
  # models (e.g. Pet) or oneOf
306
308
  klass = Shotstack.const_get(type)
307
- 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)
308
310
  end
309
311
  end
310
312
 
@@ -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
 
@@ -65,16 +65,21 @@ 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
79
84
  if @type.nil?
80
85
  invalid_properties.push('invalid value for "type", type cannot be nil.')
@@ -90,6 +95,7 @@ module Shotstack
90
95
  # Check to see if the all the properties in the model are valid
91
96
  # @return true if the model is valid
92
97
  def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
99
  return false if @type.nil?
94
100
  return false if @attributes.nil?
95
101
  true
@@ -120,36 +126,30 @@ module Shotstack
120
126
  # @param [Hash] attributes Model attributes in the form of hash
121
127
  # @return [Object] Returns the model itself
122
128
  def self.build_from_hash(attributes)
123
- new.build_from_hash(attributes)
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 build_from_hash(attributes)
130
129
  return nil unless attributes.is_a?(Hash)
131
- self.class.openapi_types.each_pair do |key, type|
132
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
133
- self.send("#{key}=", nil)
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
134
135
  elsif type =~ /\AArray<(.*)>/i
135
136
  # check to ensure the input is an array given that the attribute
136
137
  # is documented as an array but the input is not
137
- if attributes[self.class.attribute_map[key]].is_a?(Array)
138
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
138
+ if attributes[attribute_map[key]].is_a?(Array)
139
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
140
  end
140
- elsif !attributes[self.class.attribute_map[key]].nil?
141
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
141
+ elsif !attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
143
  end
143
144
  end
144
-
145
- self
145
+ new(transformed_hash)
146
146
  end
147
147
 
148
148
  # Deserializes the data based on type
149
149
  # @param string type Data type
150
150
  # @param string value Value to be deserialized
151
151
  # @return [Object] Deserialized data
152
- def _deserialize(type, value)
152
+ def self._deserialize(type, value)
153
153
  case type.to_sym
154
154
  when :Time
155
155
  Time.parse(value)
@@ -184,7 +184,7 @@ module Shotstack
184
184
  else # model
185
185
  # models (e.g. Pet) or oneOf
186
186
  klass = Shotstack.const_get(type)
187
- 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)
188
188
  end
189
189
  end
190
190