imagekitio 4.4.0 → 4.4.1

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.
@@ -0,0 +1,696 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Imagekitio
4
+ module Models
5
+ module ExtensionItem
6
+ extend Imagekitio::Internal::Type::Union
7
+
8
+ discriminator :name
9
+
10
+ variant :"remove-bg", -> { Imagekitio::ExtensionItem::RemoveBg }
11
+
12
+ variant :"ai-auto-description", -> { Imagekitio::ExtensionItem::AIAutoDescription }
13
+
14
+ variant :"ai-tasks", -> { Imagekitio::ExtensionItem::AITasks }
15
+
16
+ variant :"saved-extension", -> { Imagekitio::ExtensionItem::SavedExtension }
17
+
18
+ variant -> { Imagekitio::ExtensionItem::AutoTaggingExtension }
19
+
20
+ class RemoveBg < Imagekitio::Internal::Type::BaseModel
21
+ # @!attribute name
22
+ # Specifies the background removal extension.
23
+ #
24
+ # @return [Symbol, :"remove-bg"]
25
+ required :name, const: :"remove-bg"
26
+
27
+ # @!attribute options
28
+ #
29
+ # @return [Imagekitio::Models::ExtensionItem::RemoveBg::Options, nil]
30
+ optional :options, -> { Imagekitio::ExtensionItem::RemoveBg::Options }
31
+
32
+ # @!method initialize(options: nil, name: :"remove-bg")
33
+ # @param options [Imagekitio::Models::ExtensionItem::RemoveBg::Options]
34
+ #
35
+ # @param name [Symbol, :"remove-bg"] Specifies the background removal extension.
36
+
37
+ # @see Imagekitio::Models::ExtensionItem::RemoveBg#options
38
+ class Options < Imagekitio::Internal::Type::BaseModel
39
+ # @!attribute add_shadow
40
+ # Whether to add an artificial shadow to the result. Default is false. Note:
41
+ # Adding shadows is currently only supported for car photos.
42
+ #
43
+ # @return [Boolean, nil]
44
+ optional :add_shadow, Imagekitio::Internal::Type::Boolean
45
+
46
+ # @!attribute bg_color
47
+ # Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or
48
+ # color name (e.g., "green"). If this parameter is set, `bg_image_url` must be
49
+ # empty.
50
+ #
51
+ # @return [String, nil]
52
+ optional :bg_color, String
53
+
54
+ # @!attribute bg_image_url
55
+ # Sets a background image from a URL. If this parameter is set, `bg_color` must be
56
+ # empty.
57
+ #
58
+ # @return [String, nil]
59
+ optional :bg_image_url, String
60
+
61
+ # @!attribute semitransparency
62
+ # Allows semi-transparent regions in the result. Default is true. Note:
63
+ # Semitransparency is currently only supported for car windows.
64
+ #
65
+ # @return [Boolean, nil]
66
+ optional :semitransparency, Imagekitio::Internal::Type::Boolean
67
+
68
+ # @!method initialize(add_shadow: nil, bg_color: nil, bg_image_url: nil, semitransparency: nil)
69
+ # Some parameter documentations has been truncated, see
70
+ # {Imagekitio::Models::ExtensionItem::RemoveBg::Options} for more details.
71
+ #
72
+ # @param add_shadow [Boolean] Whether to add an artificial shadow to the result. Default is false. Note: Addin
73
+ #
74
+ # @param bg_color [String] Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or col
75
+ #
76
+ # @param bg_image_url [String] Sets a background image from a URL. If this parameter is set, `bg_color` must be
77
+ #
78
+ # @param semitransparency [Boolean] Allows semi-transparent regions in the result. Default is true. Note: Semitransp
79
+ end
80
+ end
81
+
82
+ class AutoTaggingExtension < Imagekitio::Internal::Type::BaseModel
83
+ # @!attribute max_tags
84
+ # Maximum number of tags to attach to the asset.
85
+ #
86
+ # @return [Integer]
87
+ required :max_tags, Integer, api_name: :maxTags
88
+
89
+ # @!attribute min_confidence
90
+ # Minimum confidence level for tags to be considered valid.
91
+ #
92
+ # @return [Integer]
93
+ required :min_confidence, Integer, api_name: :minConfidence
94
+
95
+ # @!attribute name
96
+ # Specifies the auto-tagging extension used.
97
+ #
98
+ # @return [Symbol, Imagekitio::Models::ExtensionItem::AutoTaggingExtension::Name]
99
+ required :name, enum: -> { Imagekitio::ExtensionItem::AutoTaggingExtension::Name }
100
+
101
+ # @!method initialize(max_tags:, min_confidence:, name:)
102
+ # @param max_tags [Integer] Maximum number of tags to attach to the asset.
103
+ #
104
+ # @param min_confidence [Integer] Minimum confidence level for tags to be considered valid.
105
+ #
106
+ # @param name [Symbol, Imagekitio::Models::ExtensionItem::AutoTaggingExtension::Name] Specifies the auto-tagging extension used.
107
+
108
+ # Specifies the auto-tagging extension used.
109
+ #
110
+ # @see Imagekitio::Models::ExtensionItem::AutoTaggingExtension#name
111
+ module Name
112
+ extend Imagekitio::Internal::Type::Enum
113
+
114
+ GOOGLE_AUTO_TAGGING = :"google-auto-tagging"
115
+ AWS_AUTO_TAGGING = :"aws-auto-tagging"
116
+
117
+ # @!method self.values
118
+ # @return [Array<Symbol>]
119
+ end
120
+ end
121
+
122
+ class AIAutoDescription < Imagekitio::Internal::Type::BaseModel
123
+ # @!attribute name
124
+ # Specifies the auto description extension.
125
+ #
126
+ # @return [Symbol, :"ai-auto-description"]
127
+ required :name, const: :"ai-auto-description"
128
+
129
+ # @!method initialize(name: :"ai-auto-description")
130
+ # @param name [Symbol, :"ai-auto-description"] Specifies the auto description extension.
131
+ end
132
+
133
+ class AITasks < Imagekitio::Internal::Type::BaseModel
134
+ # @!attribute name
135
+ # Specifies the AI tasks extension for automated image analysis using AI models.
136
+ #
137
+ # @return [Symbol, :"ai-tasks"]
138
+ required :name, const: :"ai-tasks"
139
+
140
+ # @!attribute tasks
141
+ # Array of task objects defining AI operations to perform on the asset.
142
+ #
143
+ # @return [Array<Imagekitio::Models::ExtensionItem::AITasks::Task::SelectTags, Imagekitio::Models::ExtensionItem::AITasks::Task::SelectMetadata, Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo>]
144
+ required :tasks,
145
+ -> { Imagekitio::Internal::Type::ArrayOf[union: Imagekitio::ExtensionItem::AITasks::Task] }
146
+
147
+ # @!method initialize(tasks:, name: :"ai-tasks")
148
+ # @param tasks [Array<Imagekitio::Models::ExtensionItem::AITasks::Task::SelectTags, Imagekitio::Models::ExtensionItem::AITasks::Task::SelectMetadata, Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo>] Array of task objects defining AI operations to perform on the asset.
149
+ #
150
+ # @param name [Symbol, :"ai-tasks"] Specifies the AI tasks extension for automated image analysis using AI models.
151
+
152
+ module Task
153
+ extend Imagekitio::Internal::Type::Union
154
+
155
+ discriminator :type
156
+
157
+ variant :select_tags, -> { Imagekitio::ExtensionItem::AITasks::Task::SelectTags }
158
+
159
+ variant :select_metadata, -> { Imagekitio::ExtensionItem::AITasks::Task::SelectMetadata }
160
+
161
+ variant :yes_no, -> { Imagekitio::ExtensionItem::AITasks::Task::YesNo }
162
+
163
+ class SelectTags < Imagekitio::Internal::Type::BaseModel
164
+ # @!attribute instruction
165
+ # The question or instruction for the AI to analyze the image.
166
+ #
167
+ # @return [String]
168
+ required :instruction, String
169
+
170
+ # @!attribute type
171
+ # Task type that analyzes the image and adds matching tags from a vocabulary.
172
+ #
173
+ # @return [Symbol, :select_tags]
174
+ required :type, const: :select_tags
175
+
176
+ # @!attribute max_selections
177
+ # Maximum number of tags to select from the vocabulary.
178
+ #
179
+ # @return [Integer, nil]
180
+ optional :max_selections, Integer
181
+
182
+ # @!attribute min_selections
183
+ # Minimum number of tags to select from the vocabulary.
184
+ #
185
+ # @return [Integer, nil]
186
+ optional :min_selections, Integer
187
+
188
+ # @!attribute vocabulary
189
+ # Array of possible tag values. The combined length of all strings must not exceed
190
+ # 500 characters, and values cannot include the `%` character. When providing
191
+ # large vocabularies (more than 30 items), the AI may not follow the list
192
+ # strictly.
193
+ #
194
+ # @return [Array<String>, nil]
195
+ optional :vocabulary, Imagekitio::Internal::Type::ArrayOf[String]
196
+
197
+ # @!method initialize(instruction:, max_selections: nil, min_selections: nil, vocabulary: nil, type: :select_tags)
198
+ # Some parameter documentations has been truncated, see
199
+ # {Imagekitio::Models::ExtensionItem::AITasks::Task::SelectTags} for more details.
200
+ #
201
+ # @param instruction [String] The question or instruction for the AI to analyze the image.
202
+ #
203
+ # @param max_selections [Integer] Maximum number of tags to select from the vocabulary.
204
+ #
205
+ # @param min_selections [Integer] Minimum number of tags to select from the vocabulary.
206
+ #
207
+ # @param vocabulary [Array<String>] Array of possible tag values. The combined length of all strings must not exceed
208
+ #
209
+ # @param type [Symbol, :select_tags] Task type that analyzes the image and adds matching tags from a vocabulary.
210
+ end
211
+
212
+ class SelectMetadata < Imagekitio::Internal::Type::BaseModel
213
+ # @!attribute field
214
+ # Name of the custom metadata field to set. The field must exist in your account.
215
+ #
216
+ # @return [String]
217
+ required :field, String
218
+
219
+ # @!attribute instruction
220
+ # The question or instruction for the AI to analyze the image.
221
+ #
222
+ # @return [String]
223
+ required :instruction, String
224
+
225
+ # @!attribute type
226
+ # Task type that analyzes the image and sets a custom metadata field value from a
227
+ # vocabulary.
228
+ #
229
+ # @return [Symbol, :select_metadata]
230
+ required :type, const: :select_metadata
231
+
232
+ # @!attribute max_selections
233
+ # Maximum number of values to select from the vocabulary.
234
+ #
235
+ # @return [Integer, nil]
236
+ optional :max_selections, Integer
237
+
238
+ # @!attribute min_selections
239
+ # Minimum number of values to select from the vocabulary.
240
+ #
241
+ # @return [Integer, nil]
242
+ optional :min_selections, Integer
243
+
244
+ # @!attribute vocabulary
245
+ # An array of possible values matching the custom metadata field type. If not
246
+ # provided for SingleSelect or MultiSelect field types, all values from the custom
247
+ # metadata field definition will be used. When providing large vocabularies (above
248
+ # 30 items), the AI may not strictly adhere to the list.
249
+ #
250
+ # @return [Array<String, Float, Boolean>, nil]
251
+ optional :vocabulary,
252
+ -> { Imagekitio::Internal::Type::ArrayOf[union: Imagekitio::ExtensionItem::AITasks::Task::SelectMetadata::Vocabulary] }
253
+
254
+ # @!method initialize(field:, instruction:, max_selections: nil, min_selections: nil, vocabulary: nil, type: :select_metadata)
255
+ # Some parameter documentations has been truncated, see
256
+ # {Imagekitio::Models::ExtensionItem::AITasks::Task::SelectMetadata} for more
257
+ # details.
258
+ #
259
+ # @param field [String] Name of the custom metadata field to set. The field must exist in your account.
260
+ #
261
+ # @param instruction [String] The question or instruction for the AI to analyze the image.
262
+ #
263
+ # @param max_selections [Integer] Maximum number of values to select from the vocabulary.
264
+ #
265
+ # @param min_selections [Integer] Minimum number of values to select from the vocabulary.
266
+ #
267
+ # @param vocabulary [Array<String, Float, Boolean>] An array of possible values matching the custom metadata field type. If not prov
268
+ #
269
+ # @param type [Symbol, :select_metadata] Task type that analyzes the image and sets a custom metadata field value from a
270
+
271
+ module Vocabulary
272
+ extend Imagekitio::Internal::Type::Union
273
+
274
+ variant String
275
+
276
+ variant Float
277
+
278
+ variant Imagekitio::Internal::Type::Boolean
279
+
280
+ # @!method self.variants
281
+ # @return [Array(String, Float, Boolean)]
282
+ end
283
+ end
284
+
285
+ class YesNo < Imagekitio::Internal::Type::BaseModel
286
+ # @!attribute instruction
287
+ # The yes/no question for the AI to answer about the image.
288
+ #
289
+ # @return [String]
290
+ required :instruction, String
291
+
292
+ # @!attribute type
293
+ # Task type that asks a yes/no question and executes actions based on the answer.
294
+ #
295
+ # @return [Symbol, :yes_no]
296
+ required :type, const: :yes_no
297
+
298
+ # @!attribute on_no
299
+ # Actions to execute if the AI answers no.
300
+ #
301
+ # @return [Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnNo, nil]
302
+ optional :on_no, -> { Imagekitio::ExtensionItem::AITasks::Task::YesNo::OnNo }
303
+
304
+ # @!attribute on_unknown
305
+ # Actions to execute if the AI cannot determine the answer.
306
+ #
307
+ # @return [Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnUnknown, nil]
308
+ optional :on_unknown, -> { Imagekitio::ExtensionItem::AITasks::Task::YesNo::OnUnknown }
309
+
310
+ # @!attribute on_yes
311
+ # Actions to execute if the AI answers yes.
312
+ #
313
+ # @return [Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnYes, nil]
314
+ optional :on_yes, -> { Imagekitio::ExtensionItem::AITasks::Task::YesNo::OnYes }
315
+
316
+ # @!method initialize(instruction:, on_no: nil, on_unknown: nil, on_yes: nil, type: :yes_no)
317
+ # @param instruction [String] The yes/no question for the AI to answer about the image.
318
+ #
319
+ # @param on_no [Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnNo] Actions to execute if the AI answers no.
320
+ #
321
+ # @param on_unknown [Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnUnknown] Actions to execute if the AI cannot determine the answer.
322
+ #
323
+ # @param on_yes [Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnYes] Actions to execute if the AI answers yes.
324
+ #
325
+ # @param type [Symbol, :yes_no] Task type that asks a yes/no question and executes actions based on the answer.
326
+
327
+ # @see Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo#on_no
328
+ class OnNo < Imagekitio::Internal::Type::BaseModel
329
+ # @!attribute add_tags
330
+ # Array of tag strings to add to the asset.
331
+ #
332
+ # @return [Array<String>, nil]
333
+ optional :add_tags, Imagekitio::Internal::Type::ArrayOf[String]
334
+
335
+ # @!attribute remove_tags
336
+ # Array of tag strings to remove from the asset.
337
+ #
338
+ # @return [Array<String>, nil]
339
+ optional :remove_tags, Imagekitio::Internal::Type::ArrayOf[String]
340
+
341
+ # @!attribute set_metadata
342
+ # Array of custom metadata field updates.
343
+ #
344
+ # @return [Array<Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnNo::SetMetadata>, nil]
345
+ optional :set_metadata,
346
+ -> { Imagekitio::Internal::Type::ArrayOf[Imagekitio::ExtensionItem::AITasks::Task::YesNo::OnNo::SetMetadata] }
347
+
348
+ # @!attribute unset_metadata
349
+ # Array of custom metadata fields to remove.
350
+ #
351
+ # @return [Array<Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnNo::UnsetMetadata>, nil]
352
+ optional :unset_metadata,
353
+ -> { Imagekitio::Internal::Type::ArrayOf[Imagekitio::ExtensionItem::AITasks::Task::YesNo::OnNo::UnsetMetadata] }
354
+
355
+ # @!method initialize(add_tags: nil, remove_tags: nil, set_metadata: nil, unset_metadata: nil)
356
+ # Actions to execute if the AI answers no.
357
+ #
358
+ # @param add_tags [Array<String>] Array of tag strings to add to the asset.
359
+ #
360
+ # @param remove_tags [Array<String>] Array of tag strings to remove from the asset.
361
+ #
362
+ # @param set_metadata [Array<Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnNo::SetMetadata>] Array of custom metadata field updates.
363
+ #
364
+ # @param unset_metadata [Array<Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnNo::UnsetMetadata>] Array of custom metadata fields to remove.
365
+
366
+ class SetMetadata < Imagekitio::Internal::Type::BaseModel
367
+ # @!attribute field
368
+ # Name of the custom metadata field to set.
369
+ #
370
+ # @return [String]
371
+ required :field, String
372
+
373
+ # @!attribute value
374
+ # Value to set for the custom metadata field. The value type should match the
375
+ # custom metadata field type.
376
+ #
377
+ # @return [String, Float, Boolean, Array<String, Float, Boolean>]
378
+ required :value, union: -> { Imagekitio::ExtensionItem::AITasks::Task::YesNo::OnNo::SetMetadata::Value }
379
+
380
+ # @!method initialize(field:, value:)
381
+ # Some parameter documentations has been truncated, see
382
+ # {Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnNo::SetMetadata} for
383
+ # more details.
384
+ #
385
+ # @param field [String] Name of the custom metadata field to set.
386
+ #
387
+ # @param value [String, Float, Boolean, Array<String, Float, Boolean>] Value to set for the custom metadata field. The value type should match the cust
388
+
389
+ # Value to set for the custom metadata field. The value type should match the
390
+ # custom metadata field type.
391
+ #
392
+ # @see Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnNo::SetMetadata#value
393
+ module Value
394
+ extend Imagekitio::Internal::Type::Union
395
+
396
+ variant String
397
+
398
+ variant Float
399
+
400
+ variant Imagekitio::Internal::Type::Boolean
401
+
402
+ variant -> { Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnNo::SetMetadata::Value::MixedArray }
403
+
404
+ module Mixed
405
+ extend Imagekitio::Internal::Type::Union
406
+
407
+ variant String
408
+
409
+ variant Float
410
+
411
+ variant Imagekitio::Internal::Type::Boolean
412
+
413
+ # @!method self.variants
414
+ # @return [Array(String, Float, Boolean)]
415
+ end
416
+
417
+ # @!method self.variants
418
+ # @return [Array(String, Float, Boolean, Array<String, Float, Boolean>)]
419
+
420
+ # @type [Imagekitio::Internal::Type::Converter]
421
+ MixedArray =
422
+ Imagekitio::Internal::Type::ArrayOf[union: -> {
423
+ Imagekitio::ExtensionItem::AITasks::Task::YesNo::OnNo::SetMetadata::Value::Mixed
424
+ }]
425
+ end
426
+ end
427
+
428
+ class UnsetMetadata < Imagekitio::Internal::Type::BaseModel
429
+ # @!attribute field
430
+ # Name of the custom metadata field to remove.
431
+ #
432
+ # @return [String]
433
+ required :field, String
434
+
435
+ # @!method initialize(field:)
436
+ # @param field [String] Name of the custom metadata field to remove.
437
+ end
438
+ end
439
+
440
+ # @see Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo#on_unknown
441
+ class OnUnknown < Imagekitio::Internal::Type::BaseModel
442
+ # @!attribute add_tags
443
+ # Array of tag strings to add to the asset.
444
+ #
445
+ # @return [Array<String>, nil]
446
+ optional :add_tags, Imagekitio::Internal::Type::ArrayOf[String]
447
+
448
+ # @!attribute remove_tags
449
+ # Array of tag strings to remove from the asset.
450
+ #
451
+ # @return [Array<String>, nil]
452
+ optional :remove_tags, Imagekitio::Internal::Type::ArrayOf[String]
453
+
454
+ # @!attribute set_metadata
455
+ # Array of custom metadata field updates.
456
+ #
457
+ # @return [Array<Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnUnknown::SetMetadata>, nil]
458
+ optional :set_metadata,
459
+ -> { Imagekitio::Internal::Type::ArrayOf[Imagekitio::ExtensionItem::AITasks::Task::YesNo::OnUnknown::SetMetadata] }
460
+
461
+ # @!attribute unset_metadata
462
+ # Array of custom metadata fields to remove.
463
+ #
464
+ # @return [Array<Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnUnknown::UnsetMetadata>, nil]
465
+ optional :unset_metadata,
466
+ -> { Imagekitio::Internal::Type::ArrayOf[Imagekitio::ExtensionItem::AITasks::Task::YesNo::OnUnknown::UnsetMetadata] }
467
+
468
+ # @!method initialize(add_tags: nil, remove_tags: nil, set_metadata: nil, unset_metadata: nil)
469
+ # Actions to execute if the AI cannot determine the answer.
470
+ #
471
+ # @param add_tags [Array<String>] Array of tag strings to add to the asset.
472
+ #
473
+ # @param remove_tags [Array<String>] Array of tag strings to remove from the asset.
474
+ #
475
+ # @param set_metadata [Array<Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnUnknown::SetMetadata>] Array of custom metadata field updates.
476
+ #
477
+ # @param unset_metadata [Array<Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnUnknown::UnsetMetadata>] Array of custom metadata fields to remove.
478
+
479
+ class SetMetadata < Imagekitio::Internal::Type::BaseModel
480
+ # @!attribute field
481
+ # Name of the custom metadata field to set.
482
+ #
483
+ # @return [String]
484
+ required :field, String
485
+
486
+ # @!attribute value
487
+ # Value to set for the custom metadata field. The value type should match the
488
+ # custom metadata field type.
489
+ #
490
+ # @return [String, Float, Boolean, Array<String, Float, Boolean>]
491
+ required :value,
492
+ union: -> { Imagekitio::ExtensionItem::AITasks::Task::YesNo::OnUnknown::SetMetadata::Value }
493
+
494
+ # @!method initialize(field:, value:)
495
+ # Some parameter documentations has been truncated, see
496
+ # {Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnUnknown::SetMetadata}
497
+ # for more details.
498
+ #
499
+ # @param field [String] Name of the custom metadata field to set.
500
+ #
501
+ # @param value [String, Float, Boolean, Array<String, Float, Boolean>] Value to set for the custom metadata field. The value type should match the cust
502
+
503
+ # Value to set for the custom metadata field. The value type should match the
504
+ # custom metadata field type.
505
+ #
506
+ # @see Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnUnknown::SetMetadata#value
507
+ module Value
508
+ extend Imagekitio::Internal::Type::Union
509
+
510
+ variant String
511
+
512
+ variant Float
513
+
514
+ variant Imagekitio::Internal::Type::Boolean
515
+
516
+ variant -> { Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnUnknown::SetMetadata::Value::MixedArray }
517
+
518
+ module Mixed
519
+ extend Imagekitio::Internal::Type::Union
520
+
521
+ variant String
522
+
523
+ variant Float
524
+
525
+ variant Imagekitio::Internal::Type::Boolean
526
+
527
+ # @!method self.variants
528
+ # @return [Array(String, Float, Boolean)]
529
+ end
530
+
531
+ # @!method self.variants
532
+ # @return [Array(String, Float, Boolean, Array<String, Float, Boolean>)]
533
+
534
+ # @type [Imagekitio::Internal::Type::Converter]
535
+ MixedArray =
536
+ Imagekitio::Internal::Type::ArrayOf[union: -> {
537
+ Imagekitio::ExtensionItem::AITasks::Task::YesNo::OnUnknown::SetMetadata::Value::Mixed
538
+ }]
539
+ end
540
+ end
541
+
542
+ class UnsetMetadata < Imagekitio::Internal::Type::BaseModel
543
+ # @!attribute field
544
+ # Name of the custom metadata field to remove.
545
+ #
546
+ # @return [String]
547
+ required :field, String
548
+
549
+ # @!method initialize(field:)
550
+ # @param field [String] Name of the custom metadata field to remove.
551
+ end
552
+ end
553
+
554
+ # @see Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo#on_yes
555
+ class OnYes < Imagekitio::Internal::Type::BaseModel
556
+ # @!attribute add_tags
557
+ # Array of tag strings to add to the asset.
558
+ #
559
+ # @return [Array<String>, nil]
560
+ optional :add_tags, Imagekitio::Internal::Type::ArrayOf[String]
561
+
562
+ # @!attribute remove_tags
563
+ # Array of tag strings to remove from the asset.
564
+ #
565
+ # @return [Array<String>, nil]
566
+ optional :remove_tags, Imagekitio::Internal::Type::ArrayOf[String]
567
+
568
+ # @!attribute set_metadata
569
+ # Array of custom metadata field updates.
570
+ #
571
+ # @return [Array<Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnYes::SetMetadata>, nil]
572
+ optional :set_metadata,
573
+ -> { Imagekitio::Internal::Type::ArrayOf[Imagekitio::ExtensionItem::AITasks::Task::YesNo::OnYes::SetMetadata] }
574
+
575
+ # @!attribute unset_metadata
576
+ # Array of custom metadata fields to remove.
577
+ #
578
+ # @return [Array<Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnYes::UnsetMetadata>, nil]
579
+ optional :unset_metadata,
580
+ -> { Imagekitio::Internal::Type::ArrayOf[Imagekitio::ExtensionItem::AITasks::Task::YesNo::OnYes::UnsetMetadata] }
581
+
582
+ # @!method initialize(add_tags: nil, remove_tags: nil, set_metadata: nil, unset_metadata: nil)
583
+ # Actions to execute if the AI answers yes.
584
+ #
585
+ # @param add_tags [Array<String>] Array of tag strings to add to the asset.
586
+ #
587
+ # @param remove_tags [Array<String>] Array of tag strings to remove from the asset.
588
+ #
589
+ # @param set_metadata [Array<Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnYes::SetMetadata>] Array of custom metadata field updates.
590
+ #
591
+ # @param unset_metadata [Array<Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnYes::UnsetMetadata>] Array of custom metadata fields to remove.
592
+
593
+ class SetMetadata < Imagekitio::Internal::Type::BaseModel
594
+ # @!attribute field
595
+ # Name of the custom metadata field to set.
596
+ #
597
+ # @return [String]
598
+ required :field, String
599
+
600
+ # @!attribute value
601
+ # Value to set for the custom metadata field. The value type should match the
602
+ # custom metadata field type.
603
+ #
604
+ # @return [String, Float, Boolean, Array<String, Float, Boolean>]
605
+ required :value, union: -> { Imagekitio::ExtensionItem::AITasks::Task::YesNo::OnYes::SetMetadata::Value }
606
+
607
+ # @!method initialize(field:, value:)
608
+ # Some parameter documentations has been truncated, see
609
+ # {Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnYes::SetMetadata}
610
+ # for more details.
611
+ #
612
+ # @param field [String] Name of the custom metadata field to set.
613
+ #
614
+ # @param value [String, Float, Boolean, Array<String, Float, Boolean>] Value to set for the custom metadata field. The value type should match the cust
615
+
616
+ # Value to set for the custom metadata field. The value type should match the
617
+ # custom metadata field type.
618
+ #
619
+ # @see Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnYes::SetMetadata#value
620
+ module Value
621
+ extend Imagekitio::Internal::Type::Union
622
+
623
+ variant String
624
+
625
+ variant Float
626
+
627
+ variant Imagekitio::Internal::Type::Boolean
628
+
629
+ variant -> { Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo::OnYes::SetMetadata::Value::MixedArray }
630
+
631
+ module Mixed
632
+ extend Imagekitio::Internal::Type::Union
633
+
634
+ variant String
635
+
636
+ variant Float
637
+
638
+ variant Imagekitio::Internal::Type::Boolean
639
+
640
+ # @!method self.variants
641
+ # @return [Array(String, Float, Boolean)]
642
+ end
643
+
644
+ # @!method self.variants
645
+ # @return [Array(String, Float, Boolean, Array<String, Float, Boolean>)]
646
+
647
+ # @type [Imagekitio::Internal::Type::Converter]
648
+ MixedArray =
649
+ Imagekitio::Internal::Type::ArrayOf[union: -> {
650
+ Imagekitio::ExtensionItem::AITasks::Task::YesNo::OnYes::SetMetadata::Value::Mixed
651
+ }]
652
+ end
653
+ end
654
+
655
+ class UnsetMetadata < Imagekitio::Internal::Type::BaseModel
656
+ # @!attribute field
657
+ # Name of the custom metadata field to remove.
658
+ #
659
+ # @return [String]
660
+ required :field, String
661
+
662
+ # @!method initialize(field:)
663
+ # @param field [String] Name of the custom metadata field to remove.
664
+ end
665
+ end
666
+ end
667
+
668
+ # @!method self.variants
669
+ # @return [Array(Imagekitio::Models::ExtensionItem::AITasks::Task::SelectTags, Imagekitio::Models::ExtensionItem::AITasks::Task::SelectMetadata, Imagekitio::Models::ExtensionItem::AITasks::Task::YesNo)]
670
+ end
671
+ end
672
+
673
+ class SavedExtension < Imagekitio::Internal::Type::BaseModel
674
+ # @!attribute id
675
+ # The unique ID of the saved extension to apply.
676
+ #
677
+ # @return [String]
678
+ required :id, String
679
+
680
+ # @!attribute name
681
+ # Indicates this is a reference to a saved extension.
682
+ #
683
+ # @return [Symbol, :"saved-extension"]
684
+ required :name, const: :"saved-extension"
685
+
686
+ # @!method initialize(id:, name: :"saved-extension")
687
+ # @param id [String] The unique ID of the saved extension to apply.
688
+ #
689
+ # @param name [Symbol, :"saved-extension"] Indicates this is a reference to a saved extension.
690
+ end
691
+
692
+ # @!method self.variants
693
+ # @return [Array(Imagekitio::Models::ExtensionItem::RemoveBg, Imagekitio::Models::ExtensionItem::AIAutoDescription, Imagekitio::Models::ExtensionItem::AITasks, Imagekitio::Models::ExtensionItem::SavedExtension, Imagekitio::Models::ExtensionItem::AutoTaggingExtension)]
694
+ end
695
+ end
696
+ end