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.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +9 -0
  3. data/README.md +387 -23
  4. data/Rakefile +10 -0
  5. data/lib/shotstack/api/create_api.rb +158 -0
  6. data/lib/shotstack/api/edit_api.rb +20 -20
  7. data/lib/shotstack/api/ingest_api.rb +338 -0
  8. data/lib/shotstack/api/serve_api.rb +76 -8
  9. data/lib/shotstack/api_client.rb +28 -24
  10. data/lib/shotstack/api_error.rb +3 -2
  11. data/lib/shotstack/configuration.rb +55 -9
  12. data/lib/shotstack/models/asset.rb +4 -4
  13. data/lib/shotstack/models/asset_render_response.rb +23 -20
  14. data/lib/shotstack/models/asset_response.rb +23 -20
  15. data/lib/shotstack/models/asset_response_attributes.rb +38 -21
  16. data/lib/shotstack/models/asset_response_data.rb +30 -20
  17. data/lib/shotstack/models/audio_asset.rb +57 -23
  18. data/lib/shotstack/models/audio_enhancement.rb +43 -0
  19. data/lib/shotstack/models/clip.rb +29 -33
  20. data/lib/shotstack/models/crop.rb +40 -28
  21. data/lib/shotstack/models/destinations.rb +78 -244
  22. data/lib/shotstack/models/did_generated_asset.rb +273 -0
  23. data/lib/shotstack/models/did_generated_asset_options.rb +54 -0
  24. data/lib/shotstack/models/did_text_to_avatar_options.rb +313 -0
  25. data/lib/shotstack/models/dolby_enhancement.rb +239 -0
  26. data/lib/shotstack/models/dolby_enhancement_options.rb +257 -0
  27. data/lib/shotstack/models/edit.rb +22 -24
  28. data/lib/shotstack/models/eleven_labs_generated_asset.rb +273 -0
  29. data/lib/shotstack/models/eleven_labs_generated_asset_options.rb +54 -0
  30. data/lib/shotstack/models/eleven_labs_text_to_speech_options.rb +303 -0
  31. data/lib/shotstack/models/enhancements.rb +215 -0
  32. data/lib/shotstack/models/flip_transformation.rb +16 -24
  33. data/lib/shotstack/models/font.rb +18 -20
  34. data/lib/shotstack/models/generated_asset.rb +48 -0
  35. data/lib/shotstack/models/generated_asset_error_response.rb +225 -0
  36. data/lib/shotstack/models/generated_asset_error_response_data.rb +257 -0
  37. data/lib/shotstack/models/generated_asset_response.rb +222 -0
  38. data/lib/shotstack/models/generated_asset_response_attributes.rb +376 -0
  39. data/lib/shotstack/models/generated_asset_response_data.rb +256 -0
  40. data/lib/shotstack/models/google_cloud_storage_destination.rb +232 -0
  41. data/lib/shotstack/models/google_cloud_storage_destination_options.rb +243 -0
  42. data/lib/shotstack/models/google_drive_destination.rb +239 -0
  43. data/lib/shotstack/models/google_drive_destination_options.rb +233 -0
  44. data/lib/shotstack/models/hey_gen_generated_asset.rb +273 -0
  45. data/lib/shotstack/models/hey_gen_generated_asset_options.rb +54 -0
  46. data/lib/shotstack/models/hey_gen_text_to_avatar_options.rb +396 -0
  47. data/lib/shotstack/models/html_asset.rb +20 -26
  48. data/lib/shotstack/models/image_asset.rb +18 -20
  49. data/lib/shotstack/models/ingest_error_response.rb +225 -0
  50. data/lib/shotstack/models/ingest_error_response_data.rb +257 -0
  51. data/lib/shotstack/models/luma_asset.rb +18 -20
  52. data/lib/shotstack/models/merge_field.rb +20 -20
  53. data/lib/shotstack/models/mux_destination.rb +18 -22
  54. data/lib/shotstack/models/mux_destination_options.rb +50 -25
  55. data/lib/shotstack/models/offset.rb +46 -46
  56. data/lib/shotstack/models/open_ai_generated_asset.rb +273 -0
  57. data/lib/shotstack/models/open_ai_generated_asset_options.rb +54 -0
  58. data/lib/shotstack/models/open_ai_text_generator_options.rb +313 -0
  59. data/lib/shotstack/models/output.rb +40 -35
  60. data/lib/shotstack/models/outputs.rb +227 -0
  61. data/lib/shotstack/models/outputs_response.rb +218 -0
  62. data/lib/shotstack/models/poster.rb +18 -20
  63. data/lib/shotstack/models/probe_response.rb +22 -20
  64. data/lib/shotstack/models/queued_response.rb +22 -20
  65. data/lib/shotstack/models/queued_response_data.rb +20 -20
  66. data/lib/shotstack/models/queued_source_response.rb +222 -0
  67. data/lib/shotstack/models/queued_source_response_data.rb +240 -0
  68. data/lib/shotstack/models/range.rb +26 -22
  69. data/lib/shotstack/models/render_response.rb +22 -20
  70. data/lib/shotstack/models/render_response_data.rb +24 -35
  71. data/lib/shotstack/models/rendition.rb +429 -0
  72. data/lib/shotstack/models/rendition_response_attributes.rb +336 -0
  73. data/lib/shotstack/models/rotate_transformation.rb +16 -22
  74. data/lib/shotstack/models/s3_destination.rb +232 -0
  75. data/lib/shotstack/models/s3_destination_options.rb +270 -0
  76. data/lib/shotstack/models/shotstack_destination.rb +19 -25
  77. data/lib/shotstack/models/shotstack_generated_asset.rb +273 -0
  78. data/lib/shotstack/models/shotstack_generated_asset_options.rb +60 -0
  79. data/lib/shotstack/models/shotstack_image_to_video_options.rb +298 -0
  80. data/lib/shotstack/models/shotstack_text_generator_options.rb +274 -0
  81. data/lib/shotstack/models/shotstack_text_to_image_options.rb +308 -0
  82. data/lib/shotstack/models/shotstack_text_to_speech_options.rb +339 -0
  83. data/lib/shotstack/models/size.rb +39 -35
  84. data/lib/shotstack/models/skew_transformation.rb +16 -24
  85. data/lib/shotstack/models/soundtrack.rb +18 -22
  86. data/lib/shotstack/models/source.rb +244 -0
  87. data/lib/shotstack/models/source_list_response.rb +225 -0
  88. data/lib/shotstack/models/source_response.rb +222 -0
  89. data/lib/shotstack/models/source_response_attributes.rb +373 -0
  90. data/lib/shotstack/models/source_response_data.rb +256 -0
  91. data/lib/shotstack/models/speed.rb +254 -0
  92. data/lib/shotstack/models/stability_ai_generated_asset.rb +273 -0
  93. data/lib/shotstack/models/stability_ai_generated_asset_options.rb +54 -0
  94. data/lib/shotstack/models/stability_ai_text_to_image_options.rb +390 -0
  95. data/lib/shotstack/models/template.rb +18 -20
  96. data/lib/shotstack/models/template_data_response.rb +24 -22
  97. data/lib/shotstack/models/template_data_response_data.rb +25 -22
  98. data/lib/shotstack/models/template_list_response.rb +24 -22
  99. data/lib/shotstack/models/template_list_response_data.rb +20 -20
  100. data/lib/shotstack/models/template_list_response_item.rb +20 -30
  101. data/lib/shotstack/models/template_render.rb +19 -21
  102. data/lib/shotstack/models/template_response.rb +23 -21
  103. data/lib/shotstack/models/template_response_data.rb +20 -20
  104. data/lib/shotstack/models/thumbnail.rb +20 -20
  105. data/lib/shotstack/models/timeline.rb +19 -25
  106. data/lib/shotstack/models/title_asset.rb +19 -27
  107. data/lib/shotstack/models/track.rb +18 -20
  108. data/lib/shotstack/models/transcription.rb +250 -0
  109. data/lib/shotstack/models/transfer.rb +259 -0
  110. data/lib/shotstack/models/transfer_response.rb +222 -0
  111. data/lib/shotstack/models/transfer_response_attributes.rb +280 -0
  112. data/lib/shotstack/models/transfer_response_data.rb +225 -0
  113. data/lib/shotstack/models/transformation.rb +16 -20
  114. data/lib/shotstack/models/transition.rb +16 -20
  115. data/lib/shotstack/models/upload_response.rb +222 -0
  116. data/lib/shotstack/models/upload_response_attributes.rb +257 -0
  117. data/lib/shotstack/models/upload_response_data.rb +256 -0
  118. data/lib/shotstack/models/video_asset.rb +102 -22
  119. data/lib/shotstack/version.rb +3 -3
  120. data/lib/shotstack.rb +63 -2
  121. data/shotstack.gemspec +8 -8
  122. metadata +80 -24
@@ -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
 
@@ -25,7 +25,6 @@ module Shotstack
25
25
  # The owner id of the templates.
26
26
  attr_accessor :owner
27
27
 
28
- # The [Edit](#tocs_edit) template.
29
28
  attr_accessor :template
30
29
 
31
30
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -49,7 +48,7 @@ module Shotstack
49
48
  :'id' => :'String',
50
49
  :'name' => :'String',
51
50
  :'owner' => :'String',
52
- :'template' => :'String'
51
+ :'template' => :'Edit'
53
52
  }
54
53
  end
55
54
 
@@ -76,24 +75,33 @@ module Shotstack
76
75
 
77
76
  if attributes.key?(:'id')
78
77
  self.id = attributes[:'id']
78
+ else
79
+ self.id = nil
79
80
  end
80
81
 
81
82
  if attributes.key?(:'name')
82
83
  self.name = attributes[:'name']
84
+ else
85
+ self.name = nil
83
86
  end
84
87
 
85
88
  if attributes.key?(:'owner')
86
89
  self.owner = attributes[:'owner']
90
+ else
91
+ self.owner = nil
87
92
  end
88
93
 
89
94
  if attributes.key?(:'template')
90
95
  self.template = attributes[:'template']
96
+ else
97
+ self.template = nil
91
98
  end
92
99
  end
93
100
 
94
101
  # Show invalid properties with the reasons. Usually used together with valid?
95
102
  # @return Array for valid properties with the reasons
96
103
  def list_invalid_properties
104
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
105
  invalid_properties = Array.new
98
106
  if @id.nil?
99
107
  invalid_properties.push('invalid value for "id", id cannot be nil.')
@@ -117,6 +125,7 @@ module Shotstack
117
125
  # Check to see if the all the properties in the model are valid
118
126
  # @return true if the model is valid
119
127
  def valid?
128
+ warn '[DEPRECATED] the `valid?` method is obsolete'
120
129
  return false if @id.nil?
121
130
  return false if @name.nil?
122
131
  return false if @owner.nil?
@@ -151,36 +160,30 @@ module Shotstack
151
160
  # @param [Hash] attributes Model attributes in the form of hash
152
161
  # @return [Object] Returns the model itself
153
162
  def self.build_from_hash(attributes)
154
- new.build_from_hash(attributes)
155
- end
156
-
157
- # Builds the object from hash
158
- # @param [Hash] attributes Model attributes in the form of hash
159
- # @return [Object] Returns the model itself
160
- def build_from_hash(attributes)
161
163
  return nil unless attributes.is_a?(Hash)
162
- self.class.openapi_types.each_pair do |key, type|
163
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
164
- self.send("#{key}=", nil)
164
+ attributes = attributes.transform_keys(&:to_sym)
165
+ transformed_hash = {}
166
+ openapi_types.each_pair do |key, type|
167
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
168
+ transformed_hash["#{key}"] = nil
165
169
  elsif type =~ /\AArray<(.*)>/i
166
170
  # check to ensure the input is an array given that the attribute
167
171
  # is documented as an array but the input is not
168
- if attributes[self.class.attribute_map[key]].is_a?(Array)
169
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
172
+ if attributes[attribute_map[key]].is_a?(Array)
173
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
170
174
  end
171
- elsif !attributes[self.class.attribute_map[key]].nil?
172
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
175
+ elsif !attributes[attribute_map[key]].nil?
176
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
173
177
  end
174
178
  end
175
-
176
- self
179
+ new(transformed_hash)
177
180
  end
178
181
 
179
182
  # Deserializes the data based on type
180
183
  # @param string type Data type
181
184
  # @param string value Value to be deserialized
182
185
  # @return [Object] Deserialized data
183
- def _deserialize(type, value)
186
+ def self._deserialize(type, value)
184
187
  case type.to_sym
185
188
  when :Time
186
189
  Time.parse(value)
@@ -215,7 +218,7 @@ module Shotstack
215
218
  else # model
216
219
  # models (e.g. Pet) or oneOf
217
220
  klass = Shotstack.const_get(type)
218
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
221
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
219
222
  end
220
223
  end
221
224
 
@@ -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
 
@@ -16,10 +16,10 @@ require 'time'
16
16
  module Shotstack
17
17
  # A list of previously saved templates.
18
18
  class TemplateListResponse
19
- # `true` if successfully created, else `false`.
19
+ # `true` if successfully returned, else `false`.
20
20
  attr_accessor :success
21
21
 
22
- # `Created`, `Bad Request` or an error message.
22
+ # `OK`, `Bad Request` or an error message.
23
23
  attr_accessor :message
24
24
 
25
25
  attr_accessor :response
@@ -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
- self.class.openapi_types.each_pair do |key, type|
147
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
148
- self.send("#{key}=", nil)
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[self.class.attribute_map[key]].is_a?(Array)
153
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
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[self.class.attribute_map[key]].nil?
156
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
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
- #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
 
@@ -66,18 +66,23 @@ module Shotstack
66
66
 
67
67
  if attributes.key?(:'owner')
68
68
  self.owner = attributes[:'owner']
69
+ else
70
+ self.owner = nil
69
71
  end
70
72
 
71
73
  if attributes.key?(:'templates')
72
74
  if (value = attributes[:'templates']).is_a?(Array)
73
75
  self.templates = value
74
76
  end
77
+ else
78
+ self.templates = nil
75
79
  end
76
80
  end
77
81
 
78
82
  # Show invalid properties with the reasons. Usually used together with valid?
79
83
  # @return Array for valid properties with the reasons
80
84
  def list_invalid_properties
85
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
86
  invalid_properties = Array.new
82
87
  if @owner.nil?
83
88
  invalid_properties.push('invalid value for "owner", owner cannot be nil.')
@@ -93,6 +98,7 @@ module Shotstack
93
98
  # Check to see if the all the properties in the model are valid
94
99
  # @return true if the model is valid
95
100
  def valid?
101
+ warn '[DEPRECATED] the `valid?` method is obsolete'
96
102
  return false if @owner.nil?
97
103
  return false if @templates.nil?
98
104
  true
@@ -123,36 +129,30 @@ module Shotstack
123
129
  # @param [Hash] attributes Model attributes in the form of hash
124
130
  # @return [Object] Returns the model itself
125
131
  def self.build_from_hash(attributes)
126
- new.build_from_hash(attributes)
127
- end
128
-
129
- # Builds the object from hash
130
- # @param [Hash] attributes Model attributes in the form of hash
131
- # @return [Object] Returns the model itself
132
- def build_from_hash(attributes)
133
132
  return nil unless attributes.is_a?(Hash)
134
- self.class.openapi_types.each_pair do |key, type|
135
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
136
- self.send("#{key}=", nil)
133
+ attributes = attributes.transform_keys(&:to_sym)
134
+ transformed_hash = {}
135
+ openapi_types.each_pair do |key, type|
136
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
137
+ transformed_hash["#{key}"] = nil
137
138
  elsif type =~ /\AArray<(.*)>/i
138
139
  # check to ensure the input is an array given that the attribute
139
140
  # is documented as an array but the input is not
140
- if attributes[self.class.attribute_map[key]].is_a?(Array)
141
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
141
+ if attributes[attribute_map[key]].is_a?(Array)
142
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
142
143
  end
143
- elsif !attributes[self.class.attribute_map[key]].nil?
144
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
144
+ elsif !attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
145
146
  end
146
147
  end
147
-
148
- self
148
+ new(transformed_hash)
149
149
  end
150
150
 
151
151
  # Deserializes the data based on type
152
152
  # @param string type Data type
153
153
  # @param string value Value to be deserialized
154
154
  # @return [Object] Deserialized data
155
- def _deserialize(type, value)
155
+ def self._deserialize(type, value)
156
156
  case type.to_sym
157
157
  when :Time
158
158
  Time.parse(value)
@@ -187,7 +187,7 @@ module Shotstack
187
187
  else # model
188
188
  # models (e.g. Pet) or oneOf
189
189
  klass = Shotstack.const_get(type)
190
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
190
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
191
191
  end
192
192
  end
193
193
 
@@ -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
 
@@ -76,10 +76,14 @@ module Shotstack
76
76
 
77
77
  if attributes.key?(:'id')
78
78
  self.id = attributes[:'id']
79
+ else
80
+ self.id = nil
79
81
  end
80
82
 
81
83
  if attributes.key?(:'name')
82
84
  self.name = attributes[:'name']
85
+ else
86
+ self.name = nil
83
87
  end
84
88
 
85
89
  if attributes.key?(:'created')
@@ -94,6 +98,7 @@ module Shotstack
94
98
  # Show invalid properties with the reasons. Usually used together with valid?
95
99
  # @return Array for valid properties with the reasons
96
100
  def list_invalid_properties
101
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
102
  invalid_properties = Array.new
98
103
  if @id.nil?
99
104
  invalid_properties.push('invalid value for "id", id cannot be nil.')
@@ -103,24 +108,15 @@ module Shotstack
103
108
  invalid_properties.push('invalid value for "name", name cannot be nil.')
104
109
  end
105
110
 
106
- if @created.nil?
107
- invalid_properties.push('invalid value for "created", created cannot be nil.')
108
- end
109
-
110
- if @updated.nil?
111
- invalid_properties.push('invalid value for "updated", updated cannot be nil.')
112
- end
113
-
114
111
  invalid_properties
115
112
  end
116
113
 
117
114
  # Check to see if the all the properties in the model are valid
118
115
  # @return true if the model is valid
119
116
  def valid?
117
+ warn '[DEPRECATED] the `valid?` method is obsolete'
120
118
  return false if @id.nil?
121
119
  return false if @name.nil?
122
- return false if @created.nil?
123
- return false if @updated.nil?
124
120
  true
125
121
  end
126
122
 
@@ -151,36 +147,30 @@ module Shotstack
151
147
  # @param [Hash] attributes Model attributes in the form of hash
152
148
  # @return [Object] Returns the model itself
153
149
  def self.build_from_hash(attributes)
154
- new.build_from_hash(attributes)
155
- end
156
-
157
- # Builds the object from hash
158
- # @param [Hash] attributes Model attributes in the form of hash
159
- # @return [Object] Returns the model itself
160
- def build_from_hash(attributes)
161
150
  return nil unless attributes.is_a?(Hash)
162
- self.class.openapi_types.each_pair do |key, type|
163
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
164
- self.send("#{key}=", nil)
151
+ attributes = attributes.transform_keys(&:to_sym)
152
+ transformed_hash = {}
153
+ openapi_types.each_pair do |key, type|
154
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
155
+ transformed_hash["#{key}"] = nil
165
156
  elsif type =~ /\AArray<(.*)>/i
166
157
  # check to ensure the input is an array given that the attribute
167
158
  # is documented as an array but the input is not
168
- if attributes[self.class.attribute_map[key]].is_a?(Array)
169
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
159
+ if attributes[attribute_map[key]].is_a?(Array)
160
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
170
161
  end
171
- elsif !attributes[self.class.attribute_map[key]].nil?
172
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
162
+ elsif !attributes[attribute_map[key]].nil?
163
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
173
164
  end
174
165
  end
175
-
176
- self
166
+ new(transformed_hash)
177
167
  end
178
168
 
179
169
  # Deserializes the data based on type
180
170
  # @param string type Data type
181
171
  # @param string value Value to be deserialized
182
172
  # @return [Object] Deserialized data
183
- def _deserialize(type, value)
173
+ def self._deserialize(type, value)
184
174
  case type.to_sym
185
175
  when :Time
186
176
  Time.parse(value)
@@ -215,7 +205,7 @@ module Shotstack
215
205
  else # model
216
206
  # models (e.g. Pet) or oneOf
217
207
  klass = Shotstack.const_get(type)
218
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
208
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
219
209
  end
220
210
  end
221
211
 
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #Shotstack
3
3
 
4
- #Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation. There are two main API's, one for editing and generating assets (Edit API) and one for managing hosted assets (Serve API). The Edit API base URL is: <b>https://api.shotstack.io/{version}</b> The Serve API base URL is: <b>https://api.shotstack.io/serve/{version}</b>
4
+ # Official Ruby SDK for the Shotstack Cloud Video Editing API
5
5
 
6
6
  The version of the OpenAPI document: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.4.0
9
+ Generator version: 7.4.0
10
10
 
11
11
  =end
12
12
 
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Shotstack
17
- # Render a template by it's id and optional merge fields.
17
+ # Configure the id and optional merge fields to render a template by id.
18
18
  class TemplateRender
19
19
  # The id of the template to render in UUID format.
20
20
  attr_accessor :id
@@ -66,6 +66,8 @@ module Shotstack
66
66
 
67
67
  if attributes.key?(:'id')
68
68
  self.id = attributes[:'id']
69
+ else
70
+ self.id = nil
69
71
  end
70
72
 
71
73
  if attributes.key?(:'merge')
@@ -78,6 +80,7 @@ module Shotstack
78
80
  # Show invalid properties with the reasons. Usually used together with valid?
79
81
  # @return Array for valid properties with the reasons
80
82
  def list_invalid_properties
83
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
84
  invalid_properties = Array.new
82
85
  if @id.nil?
83
86
  invalid_properties.push('invalid value for "id", id cannot be nil.')
@@ -89,6 +92,7 @@ module Shotstack
89
92
  # Check to see if the all the properties in the model are valid
90
93
  # @return true if the model is valid
91
94
  def valid?
95
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
96
  return false if @id.nil?
93
97
  true
94
98
  end
@@ -118,36 +122,30 @@ module Shotstack
118
122
  # @param [Hash] attributes Model attributes in the form of hash
119
123
  # @return [Object] Returns the model itself
120
124
  def self.build_from_hash(attributes)
121
- new.build_from_hash(attributes)
122
- end
123
-
124
- # Builds the object from hash
125
- # @param [Hash] attributes Model attributes in the form of hash
126
- # @return [Object] Returns the model itself
127
- def build_from_hash(attributes)
128
125
  return nil unless attributes.is_a?(Hash)
129
- self.class.openapi_types.each_pair do |key, type|
130
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
131
- self.send("#{key}=", nil)
126
+ attributes = attributes.transform_keys(&:to_sym)
127
+ transformed_hash = {}
128
+ openapi_types.each_pair do |key, type|
129
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
130
+ transformed_hash["#{key}"] = nil
132
131
  elsif type =~ /\AArray<(.*)>/i
133
132
  # check to ensure the input is an array given that the attribute
134
133
  # is documented as an array but the input is not
135
- if attributes[self.class.attribute_map[key]].is_a?(Array)
136
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
134
+ if attributes[attribute_map[key]].is_a?(Array)
135
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
137
136
  end
138
- elsif !attributes[self.class.attribute_map[key]].nil?
139
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
137
+ elsif !attributes[attribute_map[key]].nil?
138
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
140
139
  end
141
140
  end
142
-
143
- self
141
+ new(transformed_hash)
144
142
  end
145
143
 
146
144
  # Deserializes the data based on type
147
145
  # @param string type Data type
148
146
  # @param string value Value to be deserialized
149
147
  # @return [Object] Deserialized data
150
- def _deserialize(type, value)
148
+ def self._deserialize(type, value)
151
149
  case type.to_sym
152
150
  when :Time
153
151
  Time.parse(value)
@@ -182,7 +180,7 @@ module Shotstack
182
180
  else # model
183
181
  # models (e.g. Pet) or oneOf
184
182
  klass = Shotstack.const_get(type)
185
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
183
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
186
184
  end
187
185
  end
188
186