@@ -18,11 +18,6 @@ import com.imagekit.api.errors.ImageKitInvalidDataException
18
18
import java.util.Objects
19
19
import java.util.Optional
20
20
21
- /* *
22
- * Triggered when a new video transformation request is accepted for processing. This event confirms
23
- * that ImageKit has received and queued your transformation request. Use this for debugging and
24
- * tracking transformation lifecycle.
25
- */
26
21
@JsonDeserialize(using = UnsafeUnwrapWebhookEvent .Deserializer ::class )
27
22
@JsonSerialize(using = UnsafeUnwrapWebhookEvent .Serializer ::class )
28
23
class UnsafeUnwrapWebhookEvent
@@ -37,56 +32,24 @@ private constructor(
37
32
private val _json : JsonValue ? = null ,
38
33
) {
39
34
40
- /* *
41
- * Triggered when a new video transformation request is accepted for processing. This event
42
- * confirms that ImageKit has received and queued your transformation request. Use this for
43
- * debugging and tracking transformation lifecycle.
44
- */
45
35
fun videoTransformationAccepted (): Optional <VideoTransformationAcceptedEvent > =
46
36
Optional .ofNullable(videoTransformationAccepted)
47
37
48
- /* *
49
- * Triggered when video encoding is finished and the transformed resource is ready to be served.
50
- * This is the key event to listen for - update your database or CMS flags when you receive this
51
- * so your application can start showing the transformed video to users.
52
- */
53
38
fun videoTransformationReady (): Optional <VideoTransformationReadyEvent > =
54
39
Optional .ofNullable(videoTransformationReady)
55
40
56
- /* *
57
- * Triggered when an error occurs during video encoding. Listen to this webhook to log error
58
- * reasons and debug issues. Check your origin and URL endpoint settings if the reason is
59
- * related to download failure. For other errors, contact ImageKit support.
60
- */
61
41
fun videoTransformationError (): Optional <VideoTransformationErrorEvent > =
62
42
Optional .ofNullable(videoTransformationError)
63
43
64
- /* *
65
- * Triggered when a pre-transformation completes successfully. The file has been processed with
66
- * the requested transformation and is now available in the Media Library.
67
- */
68
44
fun uploadPreTransformSuccess (): Optional <UploadPreTransformSuccessEvent > =
69
45
Optional .ofNullable(uploadPreTransformSuccess)
70
46
71
- /* *
72
- * Triggered when a pre-transformation fails. The file upload may have been accepted, but the
73
- * requested transformation could not be applied.
74
- */
75
47
fun uploadPreTransformError (): Optional <UploadPreTransformErrorEvent > =
76
48
Optional .ofNullable(uploadPreTransformError)
77
49
78
- /* *
79
- * Triggered when a post-transformation completes successfully. The transformed version of the
80
- * file is now ready and can be accessed via the provided URL. Note that each
81
- * post-transformation generates a separate webhook event.
82
- */
83
50
fun uploadPostTransformSuccess (): Optional <UploadPostTransformSuccessEvent > =
84
51
Optional .ofNullable(uploadPostTransformSuccess)
85
52
86
- /* *
87
- * Triggered when a post-transformation fails. The original file remains available, but the
88
- * requested transformation could not be generated.
89
- */
90
53
fun uploadPostTransformError (): Optional <UploadPostTransformErrorEvent > =
91
54
Optional .ofNullable(uploadPostTransformError)
92
55
@@ -104,56 +67,24 @@ private constructor(
104
67
105
68
fun isUploadPostTransformError (): Boolean = uploadPostTransformError != null
106
69
107
- /* *
108
- * Triggered when a new video transformation request is accepted for processing. This event
109
- * confirms that ImageKit has received and queued your transformation request. Use this for
110
- * debugging and tracking transformation lifecycle.
111
- */
112
70
fun asVideoTransformationAccepted (): VideoTransformationAcceptedEvent =
113
71
videoTransformationAccepted.getOrThrow(" videoTransformationAccepted" )
114
72
115
- /* *
116
- * Triggered when video encoding is finished and the transformed resource is ready to be served.
117
- * This is the key event to listen for - update your database or CMS flags when you receive this
118
- * so your application can start showing the transformed video to users.
119
- */
120
73
fun asVideoTransformationReady (): VideoTransformationReadyEvent =
121
74
videoTransformationReady.getOrThrow(" videoTransformationReady" )
122
75
123
- /* *
124
- * Triggered when an error occurs during video encoding. Listen to this webhook to log error
125
- * reasons and debug issues. Check your origin and URL endpoint settings if the reason is
126
- * related to download failure. For other errors, contact ImageKit support.
127
- */
128
76
fun asVideoTransformationError (): VideoTransformationErrorEvent =
129
77
videoTransformationError.getOrThrow(" videoTransformationError" )
130
78
131
- /* *
132
- * Triggered when a pre-transformation completes successfully. The file has been processed with
133
- * the requested transformation and is now available in the Media Library.
134
- */
135
79
fun asUploadPreTransformSuccess (): UploadPreTransformSuccessEvent =
136
80
uploadPreTransformSuccess.getOrThrow(" uploadPreTransformSuccess" )
137
81
138
- /* *
139
- * Triggered when a pre-transformation fails. The file upload may have been accepted, but the
140
- * requested transformation could not be applied.
141
- */
142
82
fun asUploadPreTransformError (): UploadPreTransformErrorEvent =
143
83
uploadPreTransformError.getOrThrow(" uploadPreTransformError" )
144
84
145
- /* *
146
- * Triggered when a post-transformation completes successfully. The transformed version of the
147
- * file is now ready and can be accessed via the provided URL. Note that each
148
- * post-transformation generates a separate webhook event.
149
- */
150
85
fun asUploadPostTransformSuccess (): UploadPostTransformSuccessEvent =
151
86
uploadPostTransformSuccess.getOrThrow(" uploadPostTransformSuccess" )
152
87
153
- /* *
154
- * Triggered when a post-transformation fails. The original file remains available, but the
155
- * requested transformation could not be generated.
156
- */
157
88
fun asUploadPostTransformError (): UploadPostTransformErrorEvent =
158
89
uploadPostTransformError.getOrThrow(" uploadPostTransformError" )
159
90
@@ -330,64 +261,32 @@ private constructor(
330
261
331
262
companion object {
332
263
333
- /* *
334
- * Triggered when a new video transformation request is accepted for processing. This event
335
- * confirms that ImageKit has received and queued your transformation request. Use this for
336
- * debugging and tracking transformation lifecycle.
337
- */
338
264
@JvmStatic
339
265
fun ofVideoTransformationAccepted (
340
266
videoTransformationAccepted : VideoTransformationAcceptedEvent
341
267
) = UnsafeUnwrapWebhookEvent (videoTransformationAccepted = videoTransformationAccepted)
342
268
343
- /* *
344
- * Triggered when video encoding is finished and the transformed resource is ready to be
345
- * served. This is the key event to listen for - update your database or CMS flags when you
346
- * receive this so your application can start showing the transformed video to users.
347
- */
348
269
@JvmStatic
349
270
fun ofVideoTransformationReady (videoTransformationReady : VideoTransformationReadyEvent ) =
350
271
UnsafeUnwrapWebhookEvent (videoTransformationReady = videoTransformationReady)
351
272
352
- /* *
353
- * Triggered when an error occurs during video encoding. Listen to this webhook to log error
354
- * reasons and debug issues. Check your origin and URL endpoint settings if the reason is
355
- * related to download failure. For other errors, contact ImageKit support.
356
- */
357
273
@JvmStatic
358
274
fun ofVideoTransformationError (videoTransformationError : VideoTransformationErrorEvent ) =
359
275
UnsafeUnwrapWebhookEvent (videoTransformationError = videoTransformationError)
360
276
361
- /* *
362
- * Triggered when a pre-transformation completes successfully. The file has been processed
363
- * with the requested transformation and is now available in the Media Library.
364
- */
365
277
@JvmStatic
366
278
fun ofUploadPreTransformSuccess (uploadPreTransformSuccess : UploadPreTransformSuccessEvent ) =
367
279
UnsafeUnwrapWebhookEvent (uploadPreTransformSuccess = uploadPreTransformSuccess)
368
280
369
- /* *
370
- * Triggered when a pre-transformation fails. The file upload may have been accepted, but
371
- * the requested transformation could not be applied.
372
- */
373
281
@JvmStatic
374
282
fun ofUploadPreTransformError (uploadPreTransformError : UploadPreTransformErrorEvent ) =
375
283
UnsafeUnwrapWebhookEvent (uploadPreTransformError = uploadPreTransformError)
376
284
377
- /* *
378
- * Triggered when a post-transformation completes successfully. The transformed version of
379
- * the file is now ready and can be accessed via the provided URL. Note that each
380
- * post-transformation generates a separate webhook event.
381
- */
382
285
@JvmStatic
383
286
fun ofUploadPostTransformSuccess (
384
287
uploadPostTransformSuccess : UploadPostTransformSuccessEvent
385
288
) = UnsafeUnwrapWebhookEvent (uploadPostTransformSuccess = uploadPostTransformSuccess)
386
289
387
- /* *
388
- * Triggered when a post-transformation fails. The original file remains available, but the
389
- * requested transformation could not be generated.
390
- */
391
290
@JvmStatic
392
291
fun ofUploadPostTransformError (uploadPostTransformError : UploadPostTransformErrorEvent ) =
393
292
UnsafeUnwrapWebhookEvent (uploadPostTransformError = uploadPostTransformError)
@@ -399,60 +298,28 @@ private constructor(
399
298
*/
400
299
interface Visitor <out T > {
401
300
402
- /* *
403
- * Triggered when a new video transformation request is accepted for processing. This event
404
- * confirms that ImageKit has received and queued your transformation request. Use this for
405
- * debugging and tracking transformation lifecycle.
406
- */
407
301
fun visitVideoTransformationAccepted (
408
302
videoTransformationAccepted : VideoTransformationAcceptedEvent
409
303
): T
410
304
411
- /* *
412
- * Triggered when video encoding is finished and the transformed resource is ready to be
413
- * served. This is the key event to listen for - update your database or CMS flags when you
414
- * receive this so your application can start showing the transformed video to users.
415
- */
416
305
fun visitVideoTransformationReady (
417
306
videoTransformationReady : VideoTransformationReadyEvent
418
307
): T
419
308
420
- /* *
421
- * Triggered when an error occurs during video encoding. Listen to this webhook to log error
422
- * reasons and debug issues. Check your origin and URL endpoint settings if the reason is
423
- * related to download failure. For other errors, contact ImageKit support.
424
- */
425
309
fun visitVideoTransformationError (
426
310
videoTransformationError : VideoTransformationErrorEvent
427
311
): T
428
312
429
- /* *
430
- * Triggered when a pre-transformation completes successfully. The file has been processed
431
- * with the requested transformation and is now available in the Media Library.
432
- */
433
313
fun visitUploadPreTransformSuccess (
434
314
uploadPreTransformSuccess : UploadPreTransformSuccessEvent
435
315
): T
436
316
437
- /* *
438
- * Triggered when a pre-transformation fails. The file upload may have been accepted, but
439
- * the requested transformation could not be applied.
440
- */
441
317
fun visitUploadPreTransformError (uploadPreTransformError : UploadPreTransformErrorEvent ): T
442
318
443
- /* *
444
- * Triggered when a post-transformation completes successfully. The transformed version of
445
- * the file is now ready and can be accessed via the provided URL. Note that each
446
- * post-transformation generates a separate webhook event.
447
- */
448
319
fun visitUploadPostTransformSuccess (
449
320
uploadPostTransformSuccess : UploadPostTransformSuccessEvent
450
321
): T
451
322
452
- /* *
453
- * Triggered when a post-transformation fails. The original file remains available, but the
454
- * requested transformation could not be generated.
455
- */
456
323
fun visitUploadPostTransformError (
457
324
uploadPostTransformError : UploadPostTransformErrorEvent
458
325
): T
0 commit comments