ilovevideoeditor-sdk 1.0.0

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 (120) hide show
  1. checksums.yaml +7 -0
  2. data/lib/generated/ilovevideoeditor-sdk/api/api_keys_api.rb +204 -0
  3. data/lib/generated/ilovevideoeditor-sdk/api/assets_api.rb +632 -0
  4. data/lib/generated/ilovevideoeditor-sdk/api/billing_api.rb +428 -0
  5. data/lib/generated/ilovevideoeditor-sdk/api/health_api.rb +134 -0
  6. data/lib/generated/ilovevideoeditor-sdk/api/integrations_api.rb +587 -0
  7. data/lib/generated/ilovevideoeditor-sdk/api/projects_api.rb +614 -0
  8. data/lib/generated/ilovevideoeditor-sdk/api/render_api.rb +656 -0
  9. data/lib/generated/ilovevideoeditor-sdk/api/renditions_api.rb +420 -0
  10. data/lib/generated/ilovevideoeditor-sdk/api/templates_api.rb +217 -0
  11. data/lib/generated/ilovevideoeditor-sdk/api/tools_api.rb +220 -0
  12. data/lib/generated/ilovevideoeditor-sdk/api/webhooks_api.rb +204 -0
  13. data/lib/generated/ilovevideoeditor-sdk/api/workflows_api.rb +854 -0
  14. data/lib/generated/ilovevideoeditor-sdk/api_client.rb +397 -0
  15. data/lib/generated/ilovevideoeditor-sdk/api_error.rb +58 -0
  16. data/lib/generated/ilovevideoeditor-sdk/api_model_base.rb +88 -0
  17. data/lib/generated/ilovevideoeditor-sdk/configuration.rb +316 -0
  18. data/lib/generated/ilovevideoeditor-sdk/models/api_key.rb +246 -0
  19. data/lib/generated/ilovevideoeditor-sdk/models/api_key_with_secret.rb +191 -0
  20. data/lib/generated/ilovevideoeditor-sdk/models/asset.rb +404 -0
  21. data/lib/generated/ilovevideoeditor-sdk/models/asset_create.rb +303 -0
  22. data/lib/generated/ilovevideoeditor-sdk/models/asset_upload_url_response.rb +295 -0
  23. data/lib/generated/ilovevideoeditor-sdk/models/batch_delete_projects_request.rb +184 -0
  24. data/lib/generated/ilovevideoeditor-sdk/models/batch_delete_result.rb +175 -0
  25. data/lib/generated/ilovevideoeditor-sdk/models/billing_prices.rb +158 -0
  26. data/lib/generated/ilovevideoeditor-sdk/models/billing_prices_tiers.rb +168 -0
  27. data/lib/generated/ilovevideoeditor-sdk/models/billing_subscription.rb +254 -0
  28. data/lib/generated/ilovevideoeditor-sdk/models/cancel_render200_response.rb +225 -0
  29. data/lib/generated/ilovevideoeditor-sdk/models/create_api_key_request.rb +147 -0
  30. data/lib/generated/ilovevideoeditor-sdk/models/create_asset201_response.rb +164 -0
  31. data/lib/generated/ilovevideoeditor-sdk/models/create_checkout_session200_response.rb +164 -0
  32. data/lib/generated/ilovevideoeditor-sdk/models/create_checkout_session_request.rb +220 -0
  33. data/lib/generated/ilovevideoeditor-sdk/models/create_integration201_response.rb +164 -0
  34. data/lib/generated/ilovevideoeditor-sdk/models/create_project200_response.rb +164 -0
  35. data/lib/generated/ilovevideoeditor-sdk/models/create_workflow201_response.rb +164 -0
  36. data/lib/generated/ilovevideoeditor-sdk/models/create_workflow_request.rb +208 -0
  37. data/lib/generated/ilovevideoeditor-sdk/models/credit_balance.rb +219 -0
  38. data/lib/generated/ilovevideoeditor-sdk/models/credit_balance_summary.rb +174 -0
  39. data/lib/generated/ilovevideoeditor-sdk/models/credit_balance_usage.rb +156 -0
  40. data/lib/generated/ilovevideoeditor-sdk/models/delete_project200_response.rb +190 -0
  41. data/lib/generated/ilovevideoeditor-sdk/models/destination.rb +331 -0
  42. data/lib/generated/ilovevideoeditor-sdk/models/destination_input.rb +304 -0
  43. data/lib/generated/ilovevideoeditor-sdk/models/error.rb +182 -0
  44. data/lib/generated/ilovevideoeditor-sdk/models/estimate_render_cost_request.rb +164 -0
  45. data/lib/generated/ilovevideoeditor-sdk/models/get_asset_signed_url200_response.rb +164 -0
  46. data/lib/generated/ilovevideoeditor-sdk/models/get_asset_upload_url_request.rb +214 -0
  47. data/lib/generated/ilovevideoeditor-sdk/models/get_destination200_response.rb +164 -0
  48. data/lib/generated/ilovevideoeditor-sdk/models/get_project200_response.rb +173 -0
  49. data/lib/generated/ilovevideoeditor-sdk/models/get_project_stats200_response.rb +164 -0
  50. data/lib/generated/ilovevideoeditor-sdk/models/get_render_download_url200_response.rb +190 -0
  51. data/lib/generated/ilovevideoeditor-sdk/models/get_rendition200_response.rb +164 -0
  52. data/lib/generated/ilovevideoeditor-sdk/models/get_subscription200_response.rb +164 -0
  53. data/lib/generated/ilovevideoeditor-sdk/models/get_template200_response.rb +164 -0
  54. data/lib/generated/ilovevideoeditor-sdk/models/get_usage200_response.rb +166 -0
  55. data/lib/generated/ilovevideoeditor-sdk/models/get_workflow200_response.rb +175 -0
  56. data/lib/generated/ilovevideoeditor-sdk/models/get_workflow_run200_response.rb +175 -0
  57. data/lib/generated/ilovevideoeditor-sdk/models/health_check200_response.rb +147 -0
  58. data/lib/generated/ilovevideoeditor-sdk/models/health_check_detailed200_response.rb +199 -0
  59. data/lib/generated/ilovevideoeditor-sdk/models/health_check_detailed200_response_services.rb +156 -0
  60. data/lib/generated/ilovevideoeditor-sdk/models/list_api_keys200_response.rb +166 -0
  61. data/lib/generated/ilovevideoeditor-sdk/models/list_assets200_response.rb +185 -0
  62. data/lib/generated/ilovevideoeditor-sdk/models/list_integrations200_response.rb +166 -0
  63. data/lib/generated/ilovevideoeditor-sdk/models/list_invoices200_response.rb +158 -0
  64. data/lib/generated/ilovevideoeditor-sdk/models/list_projects200_response.rb +185 -0
  65. data/lib/generated/ilovevideoeditor-sdk/models/list_renditions200_response.rb +185 -0
  66. data/lib/generated/ilovevideoeditor-sdk/models/list_templates200_response.rb +166 -0
  67. data/lib/generated/ilovevideoeditor-sdk/models/list_webhook_subscriptions200_response.rb +166 -0
  68. data/lib/generated/ilovevideoeditor-sdk/models/list_workflow_runs200_response.rb +185 -0
  69. data/lib/generated/ilovevideoeditor-sdk/models/list_workflow_step_types200_response.rb +166 -0
  70. data/lib/generated/ilovevideoeditor-sdk/models/list_workflows200_response.rb +185 -0
  71. data/lib/generated/ilovevideoeditor-sdk/models/project.rb +329 -0
  72. data/lib/generated/ilovevideoeditor-sdk/models/project_create.rb +218 -0
  73. data/lib/generated/ilovevideoeditor-sdk/models/project_update.rb +239 -0
  74. data/lib/generated/ilovevideoeditor-sdk/models/queue_render200_response.rb +199 -0
  75. data/lib/generated/ilovevideoeditor-sdk/models/queue_render_request.rb +182 -0
  76. data/lib/generated/ilovevideoeditor-sdk/models/refresh_render_url200_response.rb +190 -0
  77. data/lib/generated/ilovevideoeditor-sdk/models/render_cost_estimate.rb +254 -0
  78. data/lib/generated/ilovevideoeditor-sdk/models/render_cost_estimate_resolution.rb +165 -0
  79. data/lib/generated/ilovevideoeditor-sdk/models/render_cost_estimate_tier.rb +165 -0
  80. data/lib/generated/ilovevideoeditor-sdk/models/render_job.rb +271 -0
  81. data/lib/generated/ilovevideoeditor-sdk/models/render_job_progress.rb +165 -0
  82. data/lib/generated/ilovevideoeditor-sdk/models/render_list_item.rb +356 -0
  83. data/lib/generated/ilovevideoeditor-sdk/models/render_template_request.rb +167 -0
  84. data/lib/generated/ilovevideoeditor-sdk/models/render_webhook_payload.rb +357 -0
  85. data/lib/generated/ilovevideoeditor-sdk/models/rendition.rb +335 -0
  86. data/lib/generated/ilovevideoeditor-sdk/models/rendition_cancel_result.rb +236 -0
  87. data/lib/generated/ilovevideoeditor-sdk/models/rendition_output.rb +233 -0
  88. data/lib/generated/ilovevideoeditor-sdk/models/rendition_stats.rb +192 -0
  89. data/lib/generated/ilovevideoeditor-sdk/models/run_workflow202_response.rb +164 -0
  90. data/lib/generated/ilovevideoeditor-sdk/models/run_workflow_request.rb +149 -0
  91. data/lib/generated/ilovevideoeditor-sdk/models/service_health.rb +208 -0
  92. data/lib/generated/ilovevideoeditor-sdk/models/template.rb +324 -0
  93. data/lib/generated/ilovevideoeditor-sdk/models/template_summary.rb +322 -0
  94. data/lib/generated/ilovevideoeditor-sdk/models/test_integration200_response.rb +174 -0
  95. data/lib/generated/ilovevideoeditor-sdk/models/tier_info.rb +214 -0
  96. data/lib/generated/ilovevideoeditor-sdk/models/tier_info_credits.rb +165 -0
  97. data/lib/generated/ilovevideoeditor-sdk/models/tool_job_request.rb +242 -0
  98. data/lib/generated/ilovevideoeditor-sdk/models/tool_job_request_dimensions.rb +208 -0
  99. data/lib/generated/ilovevideoeditor-sdk/models/tool_job_status.rb +310 -0
  100. data/lib/generated/ilovevideoeditor-sdk/models/track_render_bandwidth200_response.rb +164 -0
  101. data/lib/generated/ilovevideoeditor-sdk/models/update_workflow_request.rb +174 -0
  102. data/lib/generated/ilovevideoeditor-sdk/models/upload_asset200_response.rb +164 -0
  103. data/lib/generated/ilovevideoeditor-sdk/models/usage_log.rb +302 -0
  104. data/lib/generated/ilovevideoeditor-sdk/models/video_json.rb +243 -0
  105. data/lib/generated/ilovevideoeditor-sdk/models/video_json_destination.rb +227 -0
  106. data/lib/generated/ilovevideoeditor-sdk/models/webhook_subscription.rb +283 -0
  107. data/lib/generated/ilovevideoeditor-sdk/models/webhook_subscription_create.rb +204 -0
  108. data/lib/generated/ilovevideoeditor-sdk/models/workflow.rb +356 -0
  109. data/lib/generated/ilovevideoeditor-sdk/models/workflow_definition.rb +262 -0
  110. data/lib/generated/ilovevideoeditor-sdk/models/workflow_run.rb +372 -0
  111. data/lib/generated/ilovevideoeditor-sdk/models/workflow_run_step.rb +409 -0
  112. data/lib/generated/ilovevideoeditor-sdk/models/workflow_step.rb +262 -0
  113. data/lib/generated/ilovevideoeditor-sdk/models/workflow_variable.rb +242 -0
  114. data/lib/generated/ilovevideoeditor-sdk/models/workspace_integration.rb +398 -0
  115. data/lib/generated/ilovevideoeditor-sdk/models/workspace_integration_input.rb +260 -0
  116. data/lib/generated/ilovevideoeditor-sdk/version.rb +15 -0
  117. data/lib/generated/ilovevideoeditor-sdk.rb +150 -0
  118. data/lib/ilovevideoeditor/client.rb +106 -0
  119. data/lib/ilovevideoeditor-sdk.rb +2 -0
  120. metadata +181 -0
@@ -0,0 +1,357 @@
1
+ =begin
2
+ #iLoveVideoEditor API
3
+
4
+ #Cloud video rendering API for iLoveVideoEditor. Submit a `VideoJSON` payload, queue a render job, and download the resulting MP4. **Authentication** - **API Key** (`x-api-key` header) — accepted by render pipeline and tool endpoints. - **Bearer Token** (`Authorization: Bearer <jwt>`) — required for user-scoped project, asset, billing, and webhook endpoints. - Many endpoints accept either form of authentication. **SDKs** Official typed SDKs are available for JavaScript/TypeScript, PHP, Python, Ruby, and Go. See https://ilovevideoeditor.com/docs/sdks **Outbound Webhooks** Render lifecycle events (`render.completed`, `render.failed`) are delivered to your endpoints as signed HTTP POST requests. See the `Webhooks` tag and the root-level `x-webhook-docs` extension for the payload format (`RenderWebhookPayload`), signature headers, HMAC verification, and the retry policy.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module ILoveVideoEditor
17
+ # JSON body POSTed to webhook targets on terminal render states.
18
+ class RenderWebhookPayload < ApiModelBase
19
+ attr_accessor :event
20
+
21
+ # Render job ID.
22
+ attr_accessor :id
23
+
24
+ attr_accessor :status
25
+
26
+ attr_accessor :stage
27
+
28
+ attr_accessor :progress
29
+
30
+ attr_accessor :url
31
+
32
+ attr_accessor :outputs
33
+
34
+ attr_accessor :duration
35
+
36
+ attr_accessor :width
37
+
38
+ attr_accessor :height
39
+
40
+ attr_accessor :template_id
41
+
42
+ attr_accessor :cost
43
+
44
+ attr_accessor :error
45
+
46
+ attr_accessor :created_at
47
+
48
+ attr_accessor :completed_at
49
+
50
+ class EnumAttributeValidator
51
+ attr_reader :datatype
52
+ attr_reader :allowable_values
53
+
54
+ def initialize(datatype, allowable_values)
55
+ @allowable_values = allowable_values.map do |value|
56
+ case datatype.to_s
57
+ when /Integer/i
58
+ value.to_i
59
+ when /Float/i
60
+ value.to_f
61
+ else
62
+ value
63
+ end
64
+ end
65
+ end
66
+
67
+ def valid?(value)
68
+ !value || allowable_values.include?(value)
69
+ end
70
+ end
71
+
72
+ # Attribute mapping from ruby-style variable name to JSON key.
73
+ def self.attribute_map
74
+ {
75
+ :'event' => :'event',
76
+ :'id' => :'id',
77
+ :'status' => :'status',
78
+ :'stage' => :'stage',
79
+ :'progress' => :'progress',
80
+ :'url' => :'url',
81
+ :'outputs' => :'outputs',
82
+ :'duration' => :'duration',
83
+ :'width' => :'width',
84
+ :'height' => :'height',
85
+ :'template_id' => :'templateId',
86
+ :'cost' => :'cost',
87
+ :'error' => :'error',
88
+ :'created_at' => :'createdAt',
89
+ :'completed_at' => :'completedAt'
90
+ }
91
+ end
92
+
93
+ # Returns attribute mapping this model knows about
94
+ def self.acceptable_attribute_map
95
+ attribute_map
96
+ end
97
+
98
+ # Returns all the JSON keys this model knows about
99
+ def self.acceptable_attributes
100
+ acceptable_attribute_map.values
101
+ end
102
+
103
+ # Attribute type mapping.
104
+ def self.openapi_types
105
+ {
106
+ :'event' => :'String',
107
+ :'id' => :'String',
108
+ :'status' => :'String',
109
+ :'stage' => :'String',
110
+ :'progress' => :'Integer',
111
+ :'url' => :'String',
112
+ :'outputs' => :'Array<Hash<String, Object>>',
113
+ :'duration' => :'Float',
114
+ :'width' => :'Integer',
115
+ :'height' => :'Integer',
116
+ :'template_id' => :'String',
117
+ :'cost' => :'Float',
118
+ :'error' => :'String',
119
+ :'created_at' => :'Time',
120
+ :'completed_at' => :'Time'
121
+ }
122
+ end
123
+
124
+ # List of attributes with nullable: true
125
+ def self.openapi_nullable
126
+ Set.new([
127
+ :'url',
128
+ :'error',
129
+ :'completed_at'
130
+ ])
131
+ end
132
+
133
+ # Initializes the object
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ def initialize(attributes = {})
136
+ if (!attributes.is_a?(Hash))
137
+ fail ArgumentError, "The input argument (attributes) must be a hash in `ILoveVideoEditor::RenderWebhookPayload` initialize method"
138
+ end
139
+
140
+ # check to see if the attribute exists and convert string to symbol for hash key
141
+ acceptable_attribute_map = self.class.acceptable_attribute_map
142
+ attributes = attributes.each_with_object({}) { |(k, v), h|
143
+ if (!acceptable_attribute_map.key?(k.to_sym))
144
+ fail ArgumentError, "`#{k}` is not a valid attribute in `ILoveVideoEditor::RenderWebhookPayload`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
145
+ end
146
+ h[k.to_sym] = v
147
+ }
148
+
149
+ if attributes.key?(:'event')
150
+ self.event = attributes[:'event']
151
+ else
152
+ self.event = nil
153
+ end
154
+
155
+ if attributes.key?(:'id')
156
+ self.id = attributes[:'id']
157
+ else
158
+ self.id = nil
159
+ end
160
+
161
+ if attributes.key?(:'status')
162
+ self.status = attributes[:'status']
163
+ else
164
+ self.status = nil
165
+ end
166
+
167
+ if attributes.key?(:'stage')
168
+ self.stage = attributes[:'stage']
169
+ end
170
+
171
+ if attributes.key?(:'progress')
172
+ self.progress = attributes[:'progress']
173
+ end
174
+
175
+ if attributes.key?(:'url')
176
+ self.url = attributes[:'url']
177
+ end
178
+
179
+ if attributes.key?(:'outputs')
180
+ if (value = attributes[:'outputs']).is_a?(Array)
181
+ self.outputs = value
182
+ end
183
+ end
184
+
185
+ if attributes.key?(:'duration')
186
+ self.duration = attributes[:'duration']
187
+ end
188
+
189
+ if attributes.key?(:'width')
190
+ self.width = attributes[:'width']
191
+ end
192
+
193
+ if attributes.key?(:'height')
194
+ self.height = attributes[:'height']
195
+ end
196
+
197
+ if attributes.key?(:'template_id')
198
+ self.template_id = attributes[:'template_id']
199
+ end
200
+
201
+ if attributes.key?(:'cost')
202
+ self.cost = attributes[:'cost']
203
+ end
204
+
205
+ if attributes.key?(:'error')
206
+ self.error = attributes[:'error']
207
+ end
208
+
209
+ if attributes.key?(:'created_at')
210
+ self.created_at = attributes[:'created_at']
211
+ end
212
+
213
+ if attributes.key?(:'completed_at')
214
+ self.completed_at = attributes[:'completed_at']
215
+ end
216
+ end
217
+
218
+ # Show invalid properties with the reasons. Usually used together with valid?
219
+ # @return Array for valid properties with the reasons
220
+ def list_invalid_properties
221
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
222
+ invalid_properties = Array.new
223
+ if @event.nil?
224
+ invalid_properties.push('invalid value for "event", event cannot be nil.')
225
+ end
226
+
227
+ if @id.nil?
228
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
229
+ end
230
+
231
+ if @status.nil?
232
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
233
+ end
234
+
235
+ invalid_properties
236
+ end
237
+
238
+ # Check to see if the all the properties in the model are valid
239
+ # @return true if the model is valid
240
+ def valid?
241
+ warn '[DEPRECATED] the `valid?` method is obsolete'
242
+ return false if @event.nil?
243
+ event_validator = EnumAttributeValidator.new('String', ["render.completed", "render.failed"])
244
+ return false unless event_validator.valid?(@event)
245
+ return false if @id.nil?
246
+ return false if @status.nil?
247
+ status_validator = EnumAttributeValidator.new('String', ["completed", "failed"])
248
+ return false unless status_validator.valid?(@status)
249
+ true
250
+ end
251
+
252
+ # Custom attribute writer method checking allowed values (enum).
253
+ # @param [Object] event Object to be assigned
254
+ def event=(event)
255
+ validator = EnumAttributeValidator.new('String', ["render.completed", "render.failed"])
256
+ unless validator.valid?(event)
257
+ fail ArgumentError, "invalid value for \"event\", must be one of #{validator.allowable_values}."
258
+ end
259
+ @event = event
260
+ end
261
+
262
+ # Custom attribute writer method with validation
263
+ # @param [Object] id Value to be assigned
264
+ def id=(id)
265
+ if id.nil?
266
+ fail ArgumentError, 'id cannot be nil'
267
+ end
268
+
269
+ @id = id
270
+ end
271
+
272
+ # Custom attribute writer method checking allowed values (enum).
273
+ # @param [Object] status Object to be assigned
274
+ def status=(status)
275
+ validator = EnumAttributeValidator.new('String', ["completed", "failed"])
276
+ unless validator.valid?(status)
277
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
278
+ end
279
+ @status = status
280
+ end
281
+
282
+ # Checks equality by comparing each attribute.
283
+ # @param [Object] Object to be compared
284
+ def ==(o)
285
+ return true if self.equal?(o)
286
+ self.class == o.class &&
287
+ event == o.event &&
288
+ id == o.id &&
289
+ status == o.status &&
290
+ stage == o.stage &&
291
+ progress == o.progress &&
292
+ url == o.url &&
293
+ outputs == o.outputs &&
294
+ duration == o.duration &&
295
+ width == o.width &&
296
+ height == o.height &&
297
+ template_id == o.template_id &&
298
+ cost == o.cost &&
299
+ error == o.error &&
300
+ created_at == o.created_at &&
301
+ completed_at == o.completed_at
302
+ end
303
+
304
+ # @see the `==` method
305
+ # @param [Object] Object to be compared
306
+ def eql?(o)
307
+ self == o
308
+ end
309
+
310
+ # Calculates hash code according to all attributes.
311
+ # @return [Integer] Hash code
312
+ def hash
313
+ [event, id, status, stage, progress, url, outputs, duration, width, height, template_id, cost, error, created_at, completed_at].hash
314
+ end
315
+
316
+ # Builds the object from hash
317
+ # @param [Hash] attributes Model attributes in the form of hash
318
+ # @return [Object] Returns the model itself
319
+ def self.build_from_hash(attributes)
320
+ return nil unless attributes.is_a?(Hash)
321
+ attributes = attributes.transform_keys(&:to_sym)
322
+ transformed_hash = {}
323
+ openapi_types.each_pair do |key, type|
324
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
325
+ transformed_hash["#{key}"] = nil
326
+ elsif type =~ /\AArray<(.*)>/i
327
+ # check to ensure the input is an array given that the attribute
328
+ # is documented as an array but the input is not
329
+ if attributes[attribute_map[key]].is_a?(Array)
330
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
331
+ end
332
+ elsif !attributes[attribute_map[key]].nil?
333
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
334
+ end
335
+ end
336
+ new(transformed_hash)
337
+ end
338
+
339
+ # Returns the object in the form of hash
340
+ # @return [Hash] Returns the object in the form of hash
341
+ def to_hash
342
+ hash = {}
343
+ self.class.attribute_map.each_pair do |attr, param|
344
+ value = self.send(attr)
345
+ if value.nil?
346
+ is_nullable = self.class.openapi_nullable.include?(attr)
347
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
348
+ end
349
+
350
+ hash[param] = _to_hash(value)
351
+ end
352
+ hash
353
+ end
354
+
355
+ end
356
+
357
+ end
@@ -0,0 +1,335 @@
1
+ =begin
2
+ #iLoveVideoEditor API
3
+
4
+ #Cloud video rendering API for iLoveVideoEditor. Submit a `VideoJSON` payload, queue a render job, and download the resulting MP4. **Authentication** - **API Key** (`x-api-key` header) — accepted by render pipeline and tool endpoints. - **Bearer Token** (`Authorization: Bearer <jwt>`) — required for user-scoped project, asset, billing, and webhook endpoints. - Many endpoints accept either form of authentication. **SDKs** Official typed SDKs are available for JavaScript/TypeScript, PHP, Python, Ruby, and Go. See https://ilovevideoeditor.com/docs/sdks **Outbound Webhooks** Render lifecycle events (`render.completed`, `render.failed`) are delivered to your endpoints as signed HTTP POST requests. See the `Webhooks` tag and the root-level `x-webhook-docs` extension for the payload format (`RenderWebhookPayload`), signature headers, HMAC verification, and the retry policy.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module ILoveVideoEditor
17
+ class Rendition < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :job_id
21
+
22
+ attr_accessor :project_id
23
+
24
+ attr_accessor :status
25
+
26
+ attr_accessor :stage
27
+
28
+ attr_accessor :cost
29
+
30
+ attr_accessor :duration
31
+
32
+ attr_accessor :width
33
+
34
+ attr_accessor :height
35
+
36
+ attr_accessor :fps
37
+
38
+ attr_accessor :output_url
39
+
40
+ attr_accessor :output_size_bytes
41
+
42
+ attr_accessor :error
43
+
44
+ attr_accessor :progress_percent
45
+
46
+ attr_accessor :sprite_url
47
+
48
+ attr_accessor :video_json
49
+
50
+ attr_accessor :outputs
51
+
52
+ attr_accessor :projects
53
+
54
+ attr_accessor :created_at
55
+
56
+ attr_accessor :completed_at
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'id' => :'id',
62
+ :'job_id' => :'job_id',
63
+ :'project_id' => :'project_id',
64
+ :'status' => :'status',
65
+ :'stage' => :'stage',
66
+ :'cost' => :'cost',
67
+ :'duration' => :'duration',
68
+ :'width' => :'width',
69
+ :'height' => :'height',
70
+ :'fps' => :'fps',
71
+ :'output_url' => :'output_url',
72
+ :'output_size_bytes' => :'output_size_bytes',
73
+ :'error' => :'error',
74
+ :'progress_percent' => :'progress_percent',
75
+ :'sprite_url' => :'sprite_url',
76
+ :'video_json' => :'video_json',
77
+ :'outputs' => :'outputs',
78
+ :'projects' => :'projects',
79
+ :'created_at' => :'created_at',
80
+ :'completed_at' => :'completed_at'
81
+ }
82
+ end
83
+
84
+ # Returns attribute mapping this model knows about
85
+ def self.acceptable_attribute_map
86
+ attribute_map
87
+ end
88
+
89
+ # Returns all the JSON keys this model knows about
90
+ def self.acceptable_attributes
91
+ acceptable_attribute_map.values
92
+ end
93
+
94
+ # Attribute type mapping.
95
+ def self.openapi_types
96
+ {
97
+ :'id' => :'String',
98
+ :'job_id' => :'String',
99
+ :'project_id' => :'String',
100
+ :'status' => :'String',
101
+ :'stage' => :'String',
102
+ :'cost' => :'Float',
103
+ :'duration' => :'Float',
104
+ :'width' => :'Integer',
105
+ :'height' => :'Integer',
106
+ :'fps' => :'Integer',
107
+ :'output_url' => :'String',
108
+ :'output_size_bytes' => :'Integer',
109
+ :'error' => :'String',
110
+ :'progress_percent' => :'Integer',
111
+ :'sprite_url' => :'String',
112
+ :'video_json' => :'Object',
113
+ :'outputs' => :'Array<RenditionOutput>',
114
+ :'projects' => :'Object',
115
+ :'created_at' => :'Time',
116
+ :'completed_at' => :'Time'
117
+ }
118
+ end
119
+
120
+ # List of attributes with nullable: true
121
+ def self.openapi_nullable
122
+ Set.new([
123
+ :'job_id',
124
+ :'project_id',
125
+ :'cost',
126
+ :'duration',
127
+ :'width',
128
+ :'height',
129
+ :'fps',
130
+ :'output_url',
131
+ :'output_size_bytes',
132
+ :'error',
133
+ :'progress_percent',
134
+ :'sprite_url',
135
+ :'video_json',
136
+ :'projects',
137
+ :'completed_at'
138
+ ])
139
+ end
140
+
141
+ # Initializes the object
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ def initialize(attributes = {})
144
+ if (!attributes.is_a?(Hash))
145
+ fail ArgumentError, "The input argument (attributes) must be a hash in `ILoveVideoEditor::Rendition` initialize method"
146
+ end
147
+
148
+ # check to see if the attribute exists and convert string to symbol for hash key
149
+ acceptable_attribute_map = self.class.acceptable_attribute_map
150
+ attributes = attributes.each_with_object({}) { |(k, v), h|
151
+ if (!acceptable_attribute_map.key?(k.to_sym))
152
+ fail ArgumentError, "`#{k}` is not a valid attribute in `ILoveVideoEditor::Rendition`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
153
+ end
154
+ h[k.to_sym] = v
155
+ }
156
+
157
+ if attributes.key?(:'id')
158
+ self.id = attributes[:'id']
159
+ end
160
+
161
+ if attributes.key?(:'job_id')
162
+ self.job_id = attributes[:'job_id']
163
+ end
164
+
165
+ if attributes.key?(:'project_id')
166
+ self.project_id = attributes[:'project_id']
167
+ end
168
+
169
+ if attributes.key?(:'status')
170
+ self.status = attributes[:'status']
171
+ end
172
+
173
+ if attributes.key?(:'stage')
174
+ self.stage = attributes[:'stage']
175
+ end
176
+
177
+ if attributes.key?(:'cost')
178
+ self.cost = attributes[:'cost']
179
+ end
180
+
181
+ if attributes.key?(:'duration')
182
+ self.duration = attributes[:'duration']
183
+ end
184
+
185
+ if attributes.key?(:'width')
186
+ self.width = attributes[:'width']
187
+ end
188
+
189
+ if attributes.key?(:'height')
190
+ self.height = attributes[:'height']
191
+ end
192
+
193
+ if attributes.key?(:'fps')
194
+ self.fps = attributes[:'fps']
195
+ end
196
+
197
+ if attributes.key?(:'output_url')
198
+ self.output_url = attributes[:'output_url']
199
+ end
200
+
201
+ if attributes.key?(:'output_size_bytes')
202
+ self.output_size_bytes = attributes[:'output_size_bytes']
203
+ end
204
+
205
+ if attributes.key?(:'error')
206
+ self.error = attributes[:'error']
207
+ end
208
+
209
+ if attributes.key?(:'progress_percent')
210
+ self.progress_percent = attributes[:'progress_percent']
211
+ end
212
+
213
+ if attributes.key?(:'sprite_url')
214
+ self.sprite_url = attributes[:'sprite_url']
215
+ end
216
+
217
+ if attributes.key?(:'video_json')
218
+ self.video_json = attributes[:'video_json']
219
+ end
220
+
221
+ if attributes.key?(:'outputs')
222
+ if (value = attributes[:'outputs']).is_a?(Array)
223
+ self.outputs = value
224
+ end
225
+ end
226
+
227
+ if attributes.key?(:'projects')
228
+ self.projects = attributes[:'projects']
229
+ end
230
+
231
+ if attributes.key?(:'created_at')
232
+ self.created_at = attributes[:'created_at']
233
+ end
234
+
235
+ if attributes.key?(:'completed_at')
236
+ self.completed_at = attributes[:'completed_at']
237
+ end
238
+ end
239
+
240
+ # Show invalid properties with the reasons. Usually used together with valid?
241
+ # @return Array for valid properties with the reasons
242
+ def list_invalid_properties
243
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
244
+ invalid_properties = Array.new
245
+ invalid_properties
246
+ end
247
+
248
+ # Check to see if the all the properties in the model are valid
249
+ # @return true if the model is valid
250
+ def valid?
251
+ warn '[DEPRECATED] the `valid?` method is obsolete'
252
+ true
253
+ end
254
+
255
+ # Checks equality by comparing each attribute.
256
+ # @param [Object] Object to be compared
257
+ def ==(o)
258
+ return true if self.equal?(o)
259
+ self.class == o.class &&
260
+ id == o.id &&
261
+ job_id == o.job_id &&
262
+ project_id == o.project_id &&
263
+ status == o.status &&
264
+ stage == o.stage &&
265
+ cost == o.cost &&
266
+ duration == o.duration &&
267
+ width == o.width &&
268
+ height == o.height &&
269
+ fps == o.fps &&
270
+ output_url == o.output_url &&
271
+ output_size_bytes == o.output_size_bytes &&
272
+ error == o.error &&
273
+ progress_percent == o.progress_percent &&
274
+ sprite_url == o.sprite_url &&
275
+ video_json == o.video_json &&
276
+ outputs == o.outputs &&
277
+ projects == o.projects &&
278
+ created_at == o.created_at &&
279
+ completed_at == o.completed_at
280
+ end
281
+
282
+ # @see the `==` method
283
+ # @param [Object] Object to be compared
284
+ def eql?(o)
285
+ self == o
286
+ end
287
+
288
+ # Calculates hash code according to all attributes.
289
+ # @return [Integer] Hash code
290
+ def hash
291
+ [id, job_id, project_id, status, stage, cost, duration, width, height, fps, output_url, output_size_bytes, error, progress_percent, sprite_url, video_json, outputs, projects, created_at, completed_at].hash
292
+ end
293
+
294
+ # Builds the object from hash
295
+ # @param [Hash] attributes Model attributes in the form of hash
296
+ # @return [Object] Returns the model itself
297
+ def self.build_from_hash(attributes)
298
+ return nil unless attributes.is_a?(Hash)
299
+ attributes = attributes.transform_keys(&:to_sym)
300
+ transformed_hash = {}
301
+ openapi_types.each_pair do |key, type|
302
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
303
+ transformed_hash["#{key}"] = nil
304
+ elsif type =~ /\AArray<(.*)>/i
305
+ # check to ensure the input is an array given that the attribute
306
+ # is documented as an array but the input is not
307
+ if attributes[attribute_map[key]].is_a?(Array)
308
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
309
+ end
310
+ elsif !attributes[attribute_map[key]].nil?
311
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
312
+ end
313
+ end
314
+ new(transformed_hash)
315
+ end
316
+
317
+ # Returns the object in the form of hash
318
+ # @return [Hash] Returns the object in the form of hash
319
+ def to_hash
320
+ hash = {}
321
+ self.class.attribute_map.each_pair do |attr, param|
322
+ value = self.send(attr)
323
+ if value.nil?
324
+ is_nullable = self.class.openapi_nullable.include?(attr)
325
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
326
+ end
327
+
328
+ hash[param] = _to_hash(value)
329
+ end
330
+ hash
331
+ end
332
+
333
+ end
334
+
335
+ end