imagekitio 4.3.0 → 4.4.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 (62) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +35 -0
  3. data/README.md +9 -2
  4. data/lib/imagekitio/internal/type/base_model.rb +5 -5
  5. data/lib/imagekitio/internal/util.rb +3 -1
  6. data/lib/imagekitio/models/ai_tag.rb +39 -0
  7. data/lib/imagekitio/models/beta/v2/file_upload_response.rb +9 -270
  8. data/lib/imagekitio/models/custom_metadata.rb +8 -0
  9. data/lib/imagekitio/models/embedded_metadata.rb +8 -0
  10. data/lib/imagekitio/models/file.rb +11 -275
  11. data/lib/imagekitio/models/file_create_event.rb +34 -0
  12. data/lib/imagekitio/models/file_delete_event.rb +44 -0
  13. data/lib/imagekitio/models/file_update_event.rb +34 -0
  14. data/lib/imagekitio/models/file_upload_response.rb +9 -267
  15. data/lib/imagekitio/models/file_version_create_event.rb +34 -0
  16. data/lib/imagekitio/models/file_version_delete_event.rb +52 -0
  17. data/lib/imagekitio/models/selected_fields_schema.rb +212 -0
  18. data/lib/imagekitio/models/unsafe_unwrap_webhook_event.rb +16 -1
  19. data/lib/imagekitio/models/unwrap_webhook_event.rb +16 -1
  20. data/lib/imagekitio/models/upload_pre_transform_success_event.rb +9 -285
  21. data/lib/imagekitio/models/version_info.rb +26 -0
  22. data/lib/imagekitio/models.rb +25 -0
  23. data/lib/imagekitio/resources/webhooks.rb +4 -3
  24. data/lib/imagekitio/version.rb +1 -1
  25. data/lib/imagekitio.rb +11 -1
  26. data/rbi/imagekitio/models/ai_tag.rbi +56 -0
  27. data/rbi/imagekitio/models/beta/v2/file_upload_response.rbi +11 -535
  28. data/rbi/imagekitio/models/custom_metadata.rbi +11 -0
  29. data/rbi/imagekitio/models/embedded_metadata.rbi +11 -0
  30. data/rbi/imagekitio/models/file.rbi +15 -475
  31. data/rbi/imagekitio/models/file_create_event.rbi +53 -0
  32. data/rbi/imagekitio/models/file_delete_event.rbi +80 -0
  33. data/rbi/imagekitio/models/file_update_event.rbi +53 -0
  34. data/rbi/imagekitio/models/file_upload_response.rbi +11 -520
  35. data/rbi/imagekitio/models/file_version_create_event.rbi +56 -0
  36. data/rbi/imagekitio/models/file_version_delete_event.rbi +93 -0
  37. data/rbi/imagekitio/models/selected_fields_schema.rbi +364 -0
  38. data/rbi/imagekitio/models/unsafe_unwrap_webhook_event.rbi +6 -1
  39. data/rbi/imagekitio/models/unwrap_webhook_event.rbi +6 -1
  40. data/rbi/imagekitio/models/upload_pre_transform_success_event.rbi +11 -533
  41. data/rbi/imagekitio/models/version_info.rbi +40 -0
  42. data/rbi/imagekitio/models.rbi +34 -0
  43. data/rbi/imagekitio/resources/webhooks.rbi +12 -2
  44. data/sig/imagekitio/models/ai_tag.rbs +27 -0
  45. data/sig/imagekitio/models/beta/v2/file_upload_response.rbs +30 -223
  46. data/sig/imagekitio/models/custom_metadata.rbs +7 -0
  47. data/sig/imagekitio/models/embedded_metadata.rbs +7 -0
  48. data/sig/imagekitio/models/file.rbs +29 -224
  49. data/sig/imagekitio/models/file_create_event.rbs +32 -0
  50. data/sig/imagekitio/models/file_delete_event.rbs +48 -0
  51. data/sig/imagekitio/models/file_update_event.rbs +32 -0
  52. data/sig/imagekitio/models/file_upload_response.rbs +29 -224
  53. data/sig/imagekitio/models/file_version_create_event.rbs +36 -0
  54. data/sig/imagekitio/models/file_version_delete_event.rbs +50 -0
  55. data/sig/imagekitio/models/selected_fields_schema.rbs +165 -0
  56. data/sig/imagekitio/models/unsafe_unwrap_webhook_event.rbs +5 -0
  57. data/sig/imagekitio/models/unwrap_webhook_event.rbs +5 -0
  58. data/sig/imagekitio/models/upload_pre_transform_success_event.rbs +29 -224
  59. data/sig/imagekitio/models/version_info.rbs +19 -0
  60. data/sig/imagekitio/models.rbs +22 -0
  61. data/sig/imagekitio/resources/webhooks.rbs +12 -2
  62. metadata +32 -2
@@ -5,11 +5,12 @@ module Imagekitio
5
5
  # @see Imagekitio::Resources::Files#get
6
6
  class File < Imagekitio::Internal::Type::BaseModel
7
7
  # @!attribute ai_tags
8
- # An array of tags assigned to the file by auto tagging.
8
+ # Array of AI-generated tags associated with the image. If no AITags are set, it
9
+ # will be null.
9
10
  #
10
- # @return [Array<Imagekitio::Models::File::AITag>, nil]
11
+ # @return [Array<Imagekitio::Models::AITag>, nil]
11
12
  optional :ai_tags,
12
- -> { Imagekitio::Internal::Type::ArrayOf[Imagekitio::File::AITag] },
13
+ -> { Imagekitio::Internal::Type::ArrayOf[Imagekitio::AITag] },
13
14
  api_name: :AITags,
14
15
  nil?: true
15
16
 
@@ -134,9 +135,9 @@ module Imagekitio
134
135
  # Keys are the names of the custom metadata fields; the value object has details
135
136
  # about the custom metadata schema.
136
137
  #
137
- # @return [Hash{Symbol=>Imagekitio::Models::File::SelectedFieldsSchema}, nil]
138
+ # @return [Hash{Symbol=>Imagekitio::Models::SelectedFieldsSchemaItem}, nil]
138
139
  optional :selected_fields_schema,
139
- -> { Imagekitio::Internal::Type::HashOf[Imagekitio::File::SelectedFieldsSchema] },
140
+ -> { Imagekitio::Internal::Type::HashOf[Imagekitio::SelectedFieldsSchemaItem] },
140
141
  api_name: :selectedFieldsSchema
141
142
 
142
143
  # @!attribute size
@@ -181,8 +182,8 @@ module Imagekitio
181
182
  # @!attribute version_info
182
183
  # An object with details of the file version.
183
184
  #
184
- # @return [Imagekitio::Models::File::VersionInfo, nil]
185
- optional :version_info, -> { Imagekitio::File::VersionInfo }, api_name: :versionInfo
185
+ # @return [Imagekitio::Models::VersionInfo, nil]
186
+ optional :version_info, -> { Imagekitio::VersionInfo }, api_name: :versionInfo
186
187
 
187
188
  # @!attribute video_codec
188
189
  # The video codec used in the video (only for video).
@@ -202,7 +203,7 @@ module Imagekitio
202
203
  #
203
204
  # Object containing details of a file or file version.
204
205
  #
205
- # @param ai_tags [Array<Imagekitio::Models::File::AITag>, nil] An array of tags assigned to the file by auto tagging.
206
+ # @param ai_tags [Array<Imagekitio::Models::AITag>, nil] Array of AI-generated tags associated with the image. If no AITags are set, it w
206
207
  #
207
208
  # @param audio_codec [String] The audio codec used in the video (only for video/audio).
208
209
  #
@@ -238,7 +239,7 @@ module Imagekitio
238
239
  #
239
240
  # @param name [String] Name of the asset.
240
241
  #
241
- # @param selected_fields_schema [Hash{Symbol=>Imagekitio::Models::File::SelectedFieldsSchema}] This field is included in the response only if the Path policy feature is availa
242
+ # @param selected_fields_schema [Hash{Symbol=>Imagekitio::Models::SelectedFieldsSchemaItem}] This field is included in the response only if the Path policy feature is availa
242
243
  #
243
244
  # @param size [Float] Size of the file in bytes.
244
245
  #
@@ -252,255 +253,12 @@ module Imagekitio
252
253
  #
253
254
  # @param url [String] URL of the file.
254
255
  #
255
- # @param version_info [Imagekitio::Models::File::VersionInfo] An object with details of the file version.
256
+ # @param version_info [Imagekitio::Models::VersionInfo] An object with details of the file version.
256
257
  #
257
258
  # @param video_codec [String] The video codec used in the video (only for video).
258
259
  #
259
260
  # @param width [Float] Width of the file.
260
261
 
261
- class AITag < Imagekitio::Internal::Type::BaseModel
262
- # @!attribute confidence
263
- # Confidence score of the tag.
264
- #
265
- # @return [Float, nil]
266
- optional :confidence, Float
267
-
268
- # @!attribute name
269
- # Name of the tag.
270
- #
271
- # @return [String, nil]
272
- optional :name, String
273
-
274
- # @!attribute source
275
- # Source of the tag. Possible values are `google-auto-tagging` and
276
- # `aws-auto-tagging`.
277
- #
278
- # @return [String, nil]
279
- optional :source, String
280
-
281
- # @!method initialize(confidence: nil, name: nil, source: nil)
282
- # Some parameter documentations has been truncated, see
283
- # {Imagekitio::Models::File::AITag} for more details.
284
- #
285
- # @param confidence [Float] Confidence score of the tag.
286
- #
287
- # @param name [String] Name of the tag.
288
- #
289
- # @param source [String] Source of the tag. Possible values are `google-auto-tagging` and `aws-auto-taggi
290
- end
291
-
292
- class SelectedFieldsSchema < Imagekitio::Internal::Type::BaseModel
293
- # @!attribute type
294
- # Type of the custom metadata field.
295
- #
296
- # @return [Symbol, Imagekitio::Models::File::SelectedFieldsSchema::Type]
297
- required :type, enum: -> { Imagekitio::File::SelectedFieldsSchema::Type }
298
-
299
- # @!attribute default_value
300
- # The default value for this custom metadata field. The value should match the
301
- # `type` of custom metadata field.
302
- #
303
- # @return [String, Float, Boolean, Array<String, Float, Boolean>, nil]
304
- optional :default_value,
305
- union: -> { Imagekitio::File::SelectedFieldsSchema::DefaultValue },
306
- api_name: :defaultValue
307
-
308
- # @!attribute is_value_required
309
- # Specifies if the custom metadata field is required or not.
310
- #
311
- # @return [Boolean, nil]
312
- optional :is_value_required, Imagekitio::Internal::Type::Boolean, api_name: :isValueRequired
313
-
314
- # @!attribute max_length
315
- # Maximum length of string. Only set if `type` is set to `Text` or `Textarea`.
316
- #
317
- # @return [Float, nil]
318
- optional :max_length, Float, api_name: :maxLength
319
-
320
- # @!attribute max_value
321
- # Maximum value of the field. Only set if field type is `Date` or `Number`. For
322
- # `Date` type field, the value will be in ISO8601 string format. For `Number` type
323
- # field, it will be a numeric value.
324
- #
325
- # @return [String, Float, nil]
326
- optional :max_value,
327
- union: -> {
328
- Imagekitio::File::SelectedFieldsSchema::MaxValue
329
- },
330
- api_name: :maxValue
331
-
332
- # @!attribute min_length
333
- # Minimum length of string. Only set if `type` is set to `Text` or `Textarea`.
334
- #
335
- # @return [Float, nil]
336
- optional :min_length, Float, api_name: :minLength
337
-
338
- # @!attribute min_value
339
- # Minimum value of the field. Only set if field type is `Date` or `Number`. For
340
- # `Date` type field, the value will be in ISO8601 string format. For `Number` type
341
- # field, it will be a numeric value.
342
- #
343
- # @return [String, Float, nil]
344
- optional :min_value,
345
- union: -> {
346
- Imagekitio::File::SelectedFieldsSchema::MinValue
347
- },
348
- api_name: :minValue
349
-
350
- # @!attribute read_only
351
- # Indicates whether the custom metadata field is read only. A read only field
352
- # cannot be modified after being set. This field is configurable only via the
353
- # **Path policy** feature.
354
- #
355
- # @return [Boolean, nil]
356
- optional :read_only, Imagekitio::Internal::Type::Boolean, api_name: :readOnly
357
-
358
- # @!attribute select_options
359
- # An array of allowed values when field type is `SingleSelect` or `MultiSelect`.
360
- #
361
- # @return [Array<String, Float, Boolean>, nil]
362
- optional :select_options,
363
- -> {
364
- Imagekitio::Internal::Type::ArrayOf[union: Imagekitio::File::SelectedFieldsSchema::SelectOption]
365
- },
366
- api_name: :selectOptions
367
-
368
- # @!attribute select_options_truncated
369
- # Specifies if the selectOptions array is truncated. It is truncated when number
370
- # of options are > 100.
371
- #
372
- # @return [Boolean, nil]
373
- optional :select_options_truncated,
374
- Imagekitio::Internal::Type::Boolean,
375
- api_name: :selectOptionsTruncated
376
-
377
- # @!method initialize(type:, default_value: nil, is_value_required: nil, max_length: nil, max_value: nil, min_length: nil, min_value: nil, read_only: nil, select_options: nil, select_options_truncated: nil)
378
- # Some parameter documentations has been truncated, see
379
- # {Imagekitio::Models::File::SelectedFieldsSchema} for more details.
380
- #
381
- # @param type [Symbol, Imagekitio::Models::File::SelectedFieldsSchema::Type] Type of the custom metadata field.
382
- #
383
- # @param default_value [String, Float, Boolean, Array<String, Float, Boolean>] The default value for this custom metadata field. The value should match the `ty
384
- #
385
- # @param is_value_required [Boolean] Specifies if the custom metadata field is required or not.
386
- #
387
- # @param max_length [Float] Maximum length of string. Only set if `type` is set to `Text` or `Textarea`.
388
- #
389
- # @param max_value [String, Float] Maximum value of the field. Only set if field type is `Date` or `Number`. For `D
390
- #
391
- # @param min_length [Float] Minimum length of string. Only set if `type` is set to `Text` or `Textarea`.
392
- #
393
- # @param min_value [String, Float] Minimum value of the field. Only set if field type is `Date` or `Number`. For `D
394
- #
395
- # @param read_only [Boolean] Indicates whether the custom metadata field is read only. A read only field cann
396
- #
397
- # @param select_options [Array<String, Float, Boolean>] An array of allowed values when field type is `SingleSelect` or `MultiSelect`.
398
- #
399
- # @param select_options_truncated [Boolean] Specifies if the selectOptions array is truncated. It is truncated when number o
400
-
401
- # Type of the custom metadata field.
402
- #
403
- # @see Imagekitio::Models::File::SelectedFieldsSchema#type
404
- module Type
405
- extend Imagekitio::Internal::Type::Enum
406
-
407
- TEXT = :Text
408
- TEXTAREA = :Textarea
409
- NUMBER = :Number
410
- DATE = :Date
411
- BOOLEAN = :Boolean
412
- SINGLE_SELECT = :SingleSelect
413
- MULTI_SELECT = :MultiSelect
414
-
415
- # @!method self.values
416
- # @return [Array<Symbol>]
417
- end
418
-
419
- # The default value for this custom metadata field. The value should match the
420
- # `type` of custom metadata field.
421
- #
422
- # @see Imagekitio::Models::File::SelectedFieldsSchema#default_value
423
- module DefaultValue
424
- extend Imagekitio::Internal::Type::Union
425
-
426
- variant String
427
-
428
- variant Float
429
-
430
- variant Imagekitio::Internal::Type::Boolean
431
-
432
- # Default value should be of type array when custom metadata field type is set to `MultiSelect`.
433
- variant -> { Imagekitio::Models::File::SelectedFieldsSchema::DefaultValue::MixedArray }
434
-
435
- module Mixed
436
- extend Imagekitio::Internal::Type::Union
437
-
438
- variant String
439
-
440
- variant Float
441
-
442
- variant Imagekitio::Internal::Type::Boolean
443
-
444
- # @!method self.variants
445
- # @return [Array(String, Float, Boolean)]
446
- end
447
-
448
- # @!method self.variants
449
- # @return [Array(String, Float, Boolean, Array<String, Float, Boolean>)]
450
-
451
- # @type [Imagekitio::Internal::Type::Converter]
452
- MixedArray =
453
- Imagekitio::Internal::Type::ArrayOf[union: -> {
454
- Imagekitio::File::SelectedFieldsSchema::DefaultValue::Mixed
455
- }]
456
- end
457
-
458
- # Maximum value of the field. Only set if field type is `Date` or `Number`. For
459
- # `Date` type field, the value will be in ISO8601 string format. For `Number` type
460
- # field, it will be a numeric value.
461
- #
462
- # @see Imagekitio::Models::File::SelectedFieldsSchema#max_value
463
- module MaxValue
464
- extend Imagekitio::Internal::Type::Union
465
-
466
- variant String
467
-
468
- variant Float
469
-
470
- # @!method self.variants
471
- # @return [Array(String, Float)]
472
- end
473
-
474
- # Minimum value of the field. Only set if field type is `Date` or `Number`. For
475
- # `Date` type field, the value will be in ISO8601 string format. For `Number` type
476
- # field, it will be a numeric value.
477
- #
478
- # @see Imagekitio::Models::File::SelectedFieldsSchema#min_value
479
- module MinValue
480
- extend Imagekitio::Internal::Type::Union
481
-
482
- variant String
483
-
484
- variant Float
485
-
486
- # @!method self.variants
487
- # @return [Array(String, Float)]
488
- end
489
-
490
- module SelectOption
491
- extend Imagekitio::Internal::Type::Union
492
-
493
- variant String
494
-
495
- variant Float
496
-
497
- variant Imagekitio::Internal::Type::Boolean
498
-
499
- # @!method self.variants
500
- # @return [Array(String, Float, Boolean)]
501
- end
502
- end
503
-
504
262
  # Type of the asset.
505
263
  #
506
264
  # @see Imagekitio::Models::File#type
@@ -513,28 +271,6 @@ module Imagekitio
513
271
  # @!method self.values
514
272
  # @return [Array<Symbol>]
515
273
  end
516
-
517
- # @see Imagekitio::Models::File#version_info
518
- class VersionInfo < Imagekitio::Internal::Type::BaseModel
519
- # @!attribute id
520
- # Unique identifier of the file version.
521
- #
522
- # @return [String, nil]
523
- optional :id, String
524
-
525
- # @!attribute name
526
- # Name of the file version.
527
- #
528
- # @return [String, nil]
529
- optional :name, String
530
-
531
- # @!method initialize(id: nil, name: nil)
532
- # An object with details of the file version.
533
- #
534
- # @param id [String] Unique identifier of the file version.
535
- #
536
- # @param name [String] Name of the file version.
537
- end
538
274
  end
539
275
  end
540
276
  end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Imagekitio
4
+ module Models
5
+ class FileCreateEvent < Imagekitio::Models::BaseWebhookEvent
6
+ # @!attribute created_at
7
+ # Timestamp of when the event occurred in ISO8601 format.
8
+ #
9
+ # @return [Time]
10
+ required :created_at, Time
11
+
12
+ # @!attribute data
13
+ # Object containing details of a file or file version.
14
+ #
15
+ # @return [Imagekitio::Models::File]
16
+ required :data, -> { Imagekitio::File }
17
+
18
+ # @!attribute type
19
+ # Type of the webhook event.
20
+ #
21
+ # @return [Symbol, :"file.created"]
22
+ required :type, const: :"file.created"
23
+
24
+ # @!method initialize(created_at:, data:, type: :"file.created")
25
+ # Triggered when a file is created.
26
+ #
27
+ # @param created_at [Time] Timestamp of when the event occurred in ISO8601 format.
28
+ #
29
+ # @param data [Imagekitio::Models::File] Object containing details of a file or file version.
30
+ #
31
+ # @param type [Symbol, :"file.created"] Type of the webhook event.
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Imagekitio
4
+ module Models
5
+ class FileDeleteEvent < Imagekitio::Models::BaseWebhookEvent
6
+ # @!attribute created_at
7
+ # Timestamp of when the event occurred in ISO8601 format.
8
+ #
9
+ # @return [Time]
10
+ required :created_at, Time
11
+
12
+ # @!attribute data
13
+ #
14
+ # @return [Imagekitio::Models::FileDeleteEvent::Data]
15
+ required :data, -> { Imagekitio::FileDeleteEvent::Data }
16
+
17
+ # @!attribute type
18
+ # Type of the webhook event.
19
+ #
20
+ # @return [Symbol, :"file.deleted"]
21
+ required :type, const: :"file.deleted"
22
+
23
+ # @!method initialize(created_at:, data:, type: :"file.deleted")
24
+ # Triggered when a file is deleted.
25
+ #
26
+ # @param created_at [Time] Timestamp of when the event occurred in ISO8601 format.
27
+ #
28
+ # @param data [Imagekitio::Models::FileDeleteEvent::Data]
29
+ #
30
+ # @param type [Symbol, :"file.deleted"] Type of the webhook event.
31
+
32
+ class Data < Imagekitio::Internal::Type::BaseModel
33
+ # @!attribute file_id
34
+ # The unique `fileId` of the deleted file.
35
+ #
36
+ # @return [String]
37
+ required :file_id, String, api_name: :fileId
38
+
39
+ # @!method initialize(file_id:)
40
+ # @param file_id [String] The unique `fileId` of the deleted file.
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Imagekitio
4
+ module Models
5
+ class FileUpdateEvent < Imagekitio::Models::BaseWebhookEvent
6
+ # @!attribute created_at
7
+ # Timestamp of when the event occurred in ISO8601 format.
8
+ #
9
+ # @return [Time]
10
+ required :created_at, Time
11
+
12
+ # @!attribute data
13
+ # Object containing details of a file or file version.
14
+ #
15
+ # @return [Imagekitio::Models::File]
16
+ required :data, -> { Imagekitio::File }
17
+
18
+ # @!attribute type
19
+ # Type of the webhook event.
20
+ #
21
+ # @return [Symbol, :"file.updated"]
22
+ required :type, const: :"file.updated"
23
+
24
+ # @!method initialize(created_at:, data:, type: :"file.updated")
25
+ # Triggered when a file is updated.
26
+ #
27
+ # @param created_at [Time] Timestamp of when the event occurred in ISO8601 format.
28
+ #
29
+ # @param data [Imagekitio::Models::File] Object containing details of a file or file version.
30
+ #
31
+ # @param type [Symbol, :"file.updated"] Type of the webhook event.
32
+ end
33
+ end
34
+ end