imagekitio 4.0.0 → 4.1.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +47 -0
- data/README.md +1 -1
- data/lib/imagekitio/client.rb +4 -0
- data/lib/imagekitio/helpers/helper.rb +4 -0
- data/lib/imagekitio/helpers/transformation_utils.rb +7 -0
- data/lib/imagekitio/internal/transport/base_client.rb +7 -1
- data/lib/imagekitio/internal/transport/pooled_net_requester.rb +17 -24
- data/lib/imagekitio/internal/type/base_model.rb +1 -0
- data/lib/imagekitio/internal/type/union.rb +20 -8
- data/lib/imagekitio/internal/util.rb +7 -2
- data/lib/imagekitio/models/base_overlay.rb +73 -3
- data/lib/imagekitio/models/beta/v2/file_upload_params.rb +2 -2
- data/lib/imagekitio/models/beta/v2/file_upload_response.rb +21 -1
- data/lib/imagekitio/models/extension_config.rb +674 -0
- data/lib/imagekitio/models/extensions.rb +559 -1
- data/lib/imagekitio/models/file_update_response.rb +21 -1
- data/lib/imagekitio/models/file_upload_params.rb +2 -2
- data/lib/imagekitio/models/file_upload_response.rb +21 -1
- data/lib/imagekitio/models/image_overlay.rb +12 -0
- data/lib/imagekitio/models/saved_extension.rb +62 -0
- data/lib/imagekitio/models/saved_extension_create_params.rb +42 -0
- data/lib/imagekitio/models/saved_extension_delete_params.rb +14 -0
- data/lib/imagekitio/models/saved_extension_get_params.rb +14 -0
- data/lib/imagekitio/models/saved_extension_list_params.rb +14 -0
- data/lib/imagekitio/models/saved_extension_list_response.rb +8 -0
- data/lib/imagekitio/models/saved_extension_update_params.rb +42 -0
- data/lib/imagekitio/models/solid_color_overlay_transformation.rb +24 -12
- data/lib/imagekitio/models/subtitle_overlay.rb +12 -0
- data/lib/imagekitio/models/subtitle_overlay_transformation.rb +4 -3
- data/lib/imagekitio/models/text_overlay.rb +6 -0
- data/lib/imagekitio/models/text_overlay_transformation.rb +35 -19
- data/lib/imagekitio/models/transformation.rb +62 -12
- data/lib/imagekitio/models/unsafe_unwrap_webhook_event.rb +2 -0
- data/lib/imagekitio/models/unwrap_webhook_event.rb +2 -0
- data/lib/imagekitio/models/update_file_request.rb +2 -2
- data/lib/imagekitio/models/upload_pre_transform_success_event.rb +21 -1
- data/lib/imagekitio/models/video_overlay.rb +12 -0
- data/lib/imagekitio/models.rb +14 -0
- data/lib/imagekitio/resources/beta/v2/files.rb +1 -1
- data/lib/imagekitio/resources/files/metadata.rb +1 -1
- data/lib/imagekitio/resources/files.rb +1 -1
- data/lib/imagekitio/resources/saved_extensions.rb +146 -0
- data/lib/imagekitio/version.rb +1 -1
- data/lib/imagekitio.rb +11 -1
- data/manifest.yaml +2 -0
- data/rbi/imagekitio/client.rbi +3 -0
- data/rbi/imagekitio/internal/transport/base_client.rbi +5 -0
- data/rbi/imagekitio/internal/transport/pooled_net_requester.rbi +6 -2
- data/rbi/imagekitio/internal/type/base_model.rbi +8 -4
- data/rbi/imagekitio/models/base_overlay.rbi +110 -1
- data/rbi/imagekitio/models/beta/v2/file_upload_params.rbi +8 -0
- data/rbi/imagekitio/models/beta/v2/file_upload_response.rbi +61 -0
- data/rbi/imagekitio/models/extension_config.rbi +1406 -0
- data/rbi/imagekitio/models/extensions.rbi +1162 -0
- data/rbi/imagekitio/models/file_update_response.rbi +61 -0
- data/rbi/imagekitio/models/file_upload_params.rbi +8 -0
- data/rbi/imagekitio/models/file_upload_response.rbi +61 -0
- data/rbi/imagekitio/models/image_overlay.rbi +18 -0
- data/rbi/imagekitio/models/saved_extension.rbi +114 -0
- data/rbi/imagekitio/models/saved_extension_create_params.rbi +85 -0
- data/rbi/imagekitio/models/saved_extension_delete_params.rbi +30 -0
- data/rbi/imagekitio/models/saved_extension_get_params.rbi +30 -0
- data/rbi/imagekitio/models/saved_extension_list_params.rbi +30 -0
- data/rbi/imagekitio/models/saved_extension_list_response.rbi +11 -0
- data/rbi/imagekitio/models/saved_extension_update_params.rbi +106 -0
- data/rbi/imagekitio/models/solid_color_overlay_transformation.rbi +33 -18
- data/rbi/imagekitio/models/subtitle_overlay.rbi +18 -0
- data/rbi/imagekitio/models/subtitle_overlay_transformation.rbi +6 -4
- data/rbi/imagekitio/models/text_overlay.rbi +9 -0
- data/rbi/imagekitio/models/text_overlay_transformation.rbi +47 -26
- data/rbi/imagekitio/models/transformation.rbi +99 -18
- data/rbi/imagekitio/models/update_file_request.rbi +8 -0
- data/rbi/imagekitio/models/upload_pre_transform_success_event.rbi +61 -0
- data/rbi/imagekitio/models/video_overlay.rbi +18 -0
- data/rbi/imagekitio/models.rbi +14 -0
- data/rbi/imagekitio/resources/beta/v2/files.rbi +2 -0
- data/rbi/imagekitio/resources/files.rbi +2 -0
- data/rbi/imagekitio/resources/saved_extensions.rbi +114 -0
- data/sig/imagekitio/client.rbs +2 -0
- data/sig/imagekitio/internal/transport/base_client.rbs +2 -0
- data/sig/imagekitio/internal/transport/pooled_net_requester.rbs +4 -1
- data/sig/imagekitio/models/base_overlay.rbs +22 -0
- data/sig/imagekitio/models/beta/v2/file_upload_response.rbs +21 -0
- data/sig/imagekitio/models/extension_config.rbs +606 -0
- data/sig/imagekitio/models/extensions.rbs +491 -0
- data/sig/imagekitio/models/file_update_response.rbs +21 -0
- data/sig/imagekitio/models/file_upload_response.rbs +21 -0
- data/sig/imagekitio/models/saved_extension.rbs +59 -0
- data/sig/imagekitio/models/saved_extension_create_params.rbs +36 -0
- data/sig/imagekitio/models/saved_extension_delete_params.rbs +15 -0
- data/sig/imagekitio/models/saved_extension_get_params.rbs +15 -0
- data/sig/imagekitio/models/saved_extension_list_params.rbs +15 -0
- data/sig/imagekitio/models/saved_extension_list_response.rbs +7 -0
- data/sig/imagekitio/models/saved_extension_update_params.rbs +44 -0
- data/sig/imagekitio/models/solid_color_overlay_transformation.rbs +1 -1
- data/sig/imagekitio/models/text_overlay_transformation.rbs +1 -1
- data/sig/imagekitio/models/transformation.rbs +15 -1
- data/sig/imagekitio/models/upload_pre_transform_success_event.rbs +21 -0
- data/sig/imagekitio/models.rbs +14 -0
- data/sig/imagekitio/resources/saved_extensions.rbs +33 -0
- metadata +43 -2
|
@@ -0,0 +1,674 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
# Configuration object for an extension (base extensions only, not saved extension
|
|
6
|
+
# references).
|
|
7
|
+
module ExtensionConfig
|
|
8
|
+
extend Imagekitio::Internal::Type::Union
|
|
9
|
+
|
|
10
|
+
discriminator :name
|
|
11
|
+
|
|
12
|
+
variant :"remove-bg", -> { Imagekitio::ExtensionConfig::RemoveBg }
|
|
13
|
+
|
|
14
|
+
variant :"ai-auto-description", -> { Imagekitio::ExtensionConfig::AIAutoDescription }
|
|
15
|
+
|
|
16
|
+
variant :"ai-tasks", -> { Imagekitio::ExtensionConfig::AITasks }
|
|
17
|
+
|
|
18
|
+
variant -> { Imagekitio::ExtensionConfig::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::ExtensionConfig::RemoveBg::Options, nil]
|
|
30
|
+
optional :options, -> { Imagekitio::ExtensionConfig::RemoveBg::Options }
|
|
31
|
+
|
|
32
|
+
# @!method initialize(options: nil, name: :"remove-bg")
|
|
33
|
+
# @param options [Imagekitio::Models::ExtensionConfig::RemoveBg::Options]
|
|
34
|
+
#
|
|
35
|
+
# @param name [Symbol, :"remove-bg"] Specifies the background removal extension.
|
|
36
|
+
|
|
37
|
+
# @see Imagekitio::Models::ExtensionConfig::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::ExtensionConfig::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::ExtensionConfig::AutoTaggingExtension::Name]
|
|
99
|
+
required :name, enum: -> { Imagekitio::ExtensionConfig::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::ExtensionConfig::AutoTaggingExtension::Name] Specifies the auto-tagging extension used.
|
|
107
|
+
|
|
108
|
+
# Specifies the auto-tagging extension used.
|
|
109
|
+
#
|
|
110
|
+
# @see Imagekitio::Models::ExtensionConfig::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::ExtensionConfig::AITasks::Task::SelectTags, Imagekitio::Models::ExtensionConfig::AITasks::Task::SelectMetadata, Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo>]
|
|
144
|
+
required :tasks,
|
|
145
|
+
-> { Imagekitio::Internal::Type::ArrayOf[union: Imagekitio::ExtensionConfig::AITasks::Task] }
|
|
146
|
+
|
|
147
|
+
# @!method initialize(tasks:, name: :"ai-tasks")
|
|
148
|
+
# @param tasks [Array<Imagekitio::Models::ExtensionConfig::AITasks::Task::SelectTags, Imagekitio::Models::ExtensionConfig::AITasks::Task::SelectMetadata, Imagekitio::Models::ExtensionConfig::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::ExtensionConfig::AITasks::Task::SelectTags }
|
|
158
|
+
|
|
159
|
+
variant :select_metadata, -> { Imagekitio::ExtensionConfig::AITasks::Task::SelectMetadata }
|
|
160
|
+
|
|
161
|
+
variant :yes_no, -> { Imagekitio::ExtensionConfig::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. Combined length of all strings must not exceed 500
|
|
190
|
+
# characters. Cannot contain the `%` character.
|
|
191
|
+
#
|
|
192
|
+
# @return [Array<String>, nil]
|
|
193
|
+
optional :vocabulary, Imagekitio::Internal::Type::ArrayOf[String]
|
|
194
|
+
|
|
195
|
+
# @!method initialize(instruction:, max_selections: nil, min_selections: nil, vocabulary: nil, type: :select_tags)
|
|
196
|
+
# Some parameter documentations has been truncated, see
|
|
197
|
+
# {Imagekitio::Models::ExtensionConfig::AITasks::Task::SelectTags} for more
|
|
198
|
+
# details.
|
|
199
|
+
#
|
|
200
|
+
# @param instruction [String] The question or instruction for the AI to analyze the image.
|
|
201
|
+
#
|
|
202
|
+
# @param max_selections [Integer] Maximum number of tags to select from the vocabulary.
|
|
203
|
+
#
|
|
204
|
+
# @param min_selections [Integer] Minimum number of tags to select from the vocabulary.
|
|
205
|
+
#
|
|
206
|
+
# @param vocabulary [Array<String>] Array of possible tag values. Combined length of all strings must not exceed 500
|
|
207
|
+
#
|
|
208
|
+
# @param type [Symbol, :select_tags] Task type that analyzes the image and adds matching tags from a vocabulary.
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
class SelectMetadata < Imagekitio::Internal::Type::BaseModel
|
|
212
|
+
# @!attribute field
|
|
213
|
+
# Name of the custom metadata field to set. The field must exist in your account.
|
|
214
|
+
#
|
|
215
|
+
# @return [String]
|
|
216
|
+
required :field, String
|
|
217
|
+
|
|
218
|
+
# @!attribute instruction
|
|
219
|
+
# The question or instruction for the AI to analyze the image.
|
|
220
|
+
#
|
|
221
|
+
# @return [String]
|
|
222
|
+
required :instruction, String
|
|
223
|
+
|
|
224
|
+
# @!attribute type
|
|
225
|
+
# Task type that analyzes the image and sets a custom metadata field value from a
|
|
226
|
+
# vocabulary.
|
|
227
|
+
#
|
|
228
|
+
# @return [Symbol, :select_metadata]
|
|
229
|
+
required :type, const: :select_metadata
|
|
230
|
+
|
|
231
|
+
# @!attribute max_selections
|
|
232
|
+
# Maximum number of values to select from the vocabulary.
|
|
233
|
+
#
|
|
234
|
+
# @return [Integer, nil]
|
|
235
|
+
optional :max_selections, Integer
|
|
236
|
+
|
|
237
|
+
# @!attribute min_selections
|
|
238
|
+
# Minimum number of values to select from the vocabulary.
|
|
239
|
+
#
|
|
240
|
+
# @return [Integer, nil]
|
|
241
|
+
optional :min_selections, Integer
|
|
242
|
+
|
|
243
|
+
# @!attribute vocabulary
|
|
244
|
+
# Array of possible values matching the custom metadata field type.
|
|
245
|
+
#
|
|
246
|
+
# @return [Array<String, Float, Boolean>, nil]
|
|
247
|
+
optional :vocabulary,
|
|
248
|
+
-> { Imagekitio::Internal::Type::ArrayOf[union: Imagekitio::ExtensionConfig::AITasks::Task::SelectMetadata::Vocabulary] }
|
|
249
|
+
|
|
250
|
+
# @!method initialize(field:, instruction:, max_selections: nil, min_selections: nil, vocabulary: nil, type: :select_metadata)
|
|
251
|
+
# Some parameter documentations has been truncated, see
|
|
252
|
+
# {Imagekitio::Models::ExtensionConfig::AITasks::Task::SelectMetadata} for more
|
|
253
|
+
# details.
|
|
254
|
+
#
|
|
255
|
+
# @param field [String] Name of the custom metadata field to set. The field must exist in your account.
|
|
256
|
+
#
|
|
257
|
+
# @param instruction [String] The question or instruction for the AI to analyze the image.
|
|
258
|
+
#
|
|
259
|
+
# @param max_selections [Integer] Maximum number of values to select from the vocabulary.
|
|
260
|
+
#
|
|
261
|
+
# @param min_selections [Integer] Minimum number of values to select from the vocabulary.
|
|
262
|
+
#
|
|
263
|
+
# @param vocabulary [Array<String, Float, Boolean>] Array of possible values matching the custom metadata field type.
|
|
264
|
+
#
|
|
265
|
+
# @param type [Symbol, :select_metadata] Task type that analyzes the image and sets a custom metadata field value from a
|
|
266
|
+
|
|
267
|
+
module Vocabulary
|
|
268
|
+
extend Imagekitio::Internal::Type::Union
|
|
269
|
+
|
|
270
|
+
variant String
|
|
271
|
+
|
|
272
|
+
variant Float
|
|
273
|
+
|
|
274
|
+
variant Imagekitio::Internal::Type::Boolean
|
|
275
|
+
|
|
276
|
+
# @!method self.variants
|
|
277
|
+
# @return [Array(String, Float, Boolean)]
|
|
278
|
+
end
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
class YesNo < Imagekitio::Internal::Type::BaseModel
|
|
282
|
+
# @!attribute instruction
|
|
283
|
+
# The yes/no question for the AI to answer about the image.
|
|
284
|
+
#
|
|
285
|
+
# @return [String]
|
|
286
|
+
required :instruction, String
|
|
287
|
+
|
|
288
|
+
# @!attribute type
|
|
289
|
+
# Task type that asks a yes/no question and executes actions based on the answer.
|
|
290
|
+
#
|
|
291
|
+
# @return [Symbol, :yes_no]
|
|
292
|
+
required :type, const: :yes_no
|
|
293
|
+
|
|
294
|
+
# @!attribute on_no
|
|
295
|
+
# Actions to execute if the AI answers no.
|
|
296
|
+
#
|
|
297
|
+
# @return [Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnNo, nil]
|
|
298
|
+
optional :on_no, -> { Imagekitio::ExtensionConfig::AITasks::Task::YesNo::OnNo }
|
|
299
|
+
|
|
300
|
+
# @!attribute on_unknown
|
|
301
|
+
# Actions to execute if the AI cannot determine the answer.
|
|
302
|
+
#
|
|
303
|
+
# @return [Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnUnknown, nil]
|
|
304
|
+
optional :on_unknown, -> { Imagekitio::ExtensionConfig::AITasks::Task::YesNo::OnUnknown }
|
|
305
|
+
|
|
306
|
+
# @!attribute on_yes
|
|
307
|
+
# Actions to execute if the AI answers yes.
|
|
308
|
+
#
|
|
309
|
+
# @return [Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnYes, nil]
|
|
310
|
+
optional :on_yes, -> { Imagekitio::ExtensionConfig::AITasks::Task::YesNo::OnYes }
|
|
311
|
+
|
|
312
|
+
# @!method initialize(instruction:, on_no: nil, on_unknown: nil, on_yes: nil, type: :yes_no)
|
|
313
|
+
# @param instruction [String] The yes/no question for the AI to answer about the image.
|
|
314
|
+
#
|
|
315
|
+
# @param on_no [Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnNo] Actions to execute if the AI answers no.
|
|
316
|
+
#
|
|
317
|
+
# @param on_unknown [Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnUnknown] Actions to execute if the AI cannot determine the answer.
|
|
318
|
+
#
|
|
319
|
+
# @param on_yes [Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnYes] Actions to execute if the AI answers yes.
|
|
320
|
+
#
|
|
321
|
+
# @param type [Symbol, :yes_no] Task type that asks a yes/no question and executes actions based on the answer.
|
|
322
|
+
|
|
323
|
+
# @see Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo#on_no
|
|
324
|
+
class OnNo < Imagekitio::Internal::Type::BaseModel
|
|
325
|
+
# @!attribute add_tags
|
|
326
|
+
# Array of tag strings to add to the asset.
|
|
327
|
+
#
|
|
328
|
+
# @return [Array<String>, nil]
|
|
329
|
+
optional :add_tags, Imagekitio::Internal::Type::ArrayOf[String]
|
|
330
|
+
|
|
331
|
+
# @!attribute remove_tags
|
|
332
|
+
# Array of tag strings to remove from the asset.
|
|
333
|
+
#
|
|
334
|
+
# @return [Array<String>, nil]
|
|
335
|
+
optional :remove_tags, Imagekitio::Internal::Type::ArrayOf[String]
|
|
336
|
+
|
|
337
|
+
# @!attribute set_metadata
|
|
338
|
+
# Array of custom metadata field updates.
|
|
339
|
+
#
|
|
340
|
+
# @return [Array<Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnNo::SetMetadata>, nil]
|
|
341
|
+
optional :set_metadata,
|
|
342
|
+
-> { Imagekitio::Internal::Type::ArrayOf[Imagekitio::ExtensionConfig::AITasks::Task::YesNo::OnNo::SetMetadata] }
|
|
343
|
+
|
|
344
|
+
# @!attribute unset_metadata
|
|
345
|
+
# Array of custom metadata fields to remove.
|
|
346
|
+
#
|
|
347
|
+
# @return [Array<Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnNo::UnsetMetadata>, nil]
|
|
348
|
+
optional :unset_metadata,
|
|
349
|
+
-> { Imagekitio::Internal::Type::ArrayOf[Imagekitio::ExtensionConfig::AITasks::Task::YesNo::OnNo::UnsetMetadata] }
|
|
350
|
+
|
|
351
|
+
# @!method initialize(add_tags: nil, remove_tags: nil, set_metadata: nil, unset_metadata: nil)
|
|
352
|
+
# Actions to execute if the AI answers no.
|
|
353
|
+
#
|
|
354
|
+
# @param add_tags [Array<String>] Array of tag strings to add to the asset.
|
|
355
|
+
#
|
|
356
|
+
# @param remove_tags [Array<String>] Array of tag strings to remove from the asset.
|
|
357
|
+
#
|
|
358
|
+
# @param set_metadata [Array<Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnNo::SetMetadata>] Array of custom metadata field updates.
|
|
359
|
+
#
|
|
360
|
+
# @param unset_metadata [Array<Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnNo::UnsetMetadata>] Array of custom metadata fields to remove.
|
|
361
|
+
|
|
362
|
+
class SetMetadata < Imagekitio::Internal::Type::BaseModel
|
|
363
|
+
# @!attribute field
|
|
364
|
+
# Name of the custom metadata field to set.
|
|
365
|
+
#
|
|
366
|
+
# @return [String]
|
|
367
|
+
required :field, String
|
|
368
|
+
|
|
369
|
+
# @!attribute value
|
|
370
|
+
# Value to set for the custom metadata field. The value type should match the
|
|
371
|
+
# custom metadata field type.
|
|
372
|
+
#
|
|
373
|
+
# @return [String, Float, Boolean, Array<String, Float, Boolean>]
|
|
374
|
+
required :value, union: -> { Imagekitio::ExtensionConfig::AITasks::Task::YesNo::OnNo::SetMetadata::Value }
|
|
375
|
+
|
|
376
|
+
# @!method initialize(field:, value:)
|
|
377
|
+
# Some parameter documentations has been truncated, see
|
|
378
|
+
# {Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnNo::SetMetadata}
|
|
379
|
+
# for more details.
|
|
380
|
+
#
|
|
381
|
+
# @param field [String] Name of the custom metadata field to set.
|
|
382
|
+
#
|
|
383
|
+
# @param value [String, Float, Boolean, Array<String, Float, Boolean>] Value to set for the custom metadata field. The value type should match the cust
|
|
384
|
+
|
|
385
|
+
# Value to set for the custom metadata field. The value type should match the
|
|
386
|
+
# custom metadata field type.
|
|
387
|
+
#
|
|
388
|
+
# @see Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnNo::SetMetadata#value
|
|
389
|
+
module Value
|
|
390
|
+
extend Imagekitio::Internal::Type::Union
|
|
391
|
+
|
|
392
|
+
variant String
|
|
393
|
+
|
|
394
|
+
variant Float
|
|
395
|
+
|
|
396
|
+
variant Imagekitio::Internal::Type::Boolean
|
|
397
|
+
|
|
398
|
+
variant -> { Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnNo::SetMetadata::Value::MixedArray }
|
|
399
|
+
|
|
400
|
+
module Mixed
|
|
401
|
+
extend Imagekitio::Internal::Type::Union
|
|
402
|
+
|
|
403
|
+
variant String
|
|
404
|
+
|
|
405
|
+
variant Float
|
|
406
|
+
|
|
407
|
+
variant Imagekitio::Internal::Type::Boolean
|
|
408
|
+
|
|
409
|
+
# @!method self.variants
|
|
410
|
+
# @return [Array(String, Float, Boolean)]
|
|
411
|
+
end
|
|
412
|
+
|
|
413
|
+
# @!method self.variants
|
|
414
|
+
# @return [Array(String, Float, Boolean, Array<String, Float, Boolean>)]
|
|
415
|
+
|
|
416
|
+
# @type [Imagekitio::Internal::Type::Converter]
|
|
417
|
+
MixedArray =
|
|
418
|
+
Imagekitio::Internal::Type::ArrayOf[union: -> {
|
|
419
|
+
Imagekitio::ExtensionConfig::AITasks::Task::YesNo::OnNo::SetMetadata::Value::Mixed
|
|
420
|
+
}]
|
|
421
|
+
end
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
class UnsetMetadata < Imagekitio::Internal::Type::BaseModel
|
|
425
|
+
# @!attribute field
|
|
426
|
+
# Name of the custom metadata field to remove.
|
|
427
|
+
#
|
|
428
|
+
# @return [String]
|
|
429
|
+
required :field, String
|
|
430
|
+
|
|
431
|
+
# @!method initialize(field:)
|
|
432
|
+
# @param field [String] Name of the custom metadata field to remove.
|
|
433
|
+
end
|
|
434
|
+
end
|
|
435
|
+
|
|
436
|
+
# @see Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo#on_unknown
|
|
437
|
+
class OnUnknown < Imagekitio::Internal::Type::BaseModel
|
|
438
|
+
# @!attribute add_tags
|
|
439
|
+
# Array of tag strings to add to the asset.
|
|
440
|
+
#
|
|
441
|
+
# @return [Array<String>, nil]
|
|
442
|
+
optional :add_tags, Imagekitio::Internal::Type::ArrayOf[String]
|
|
443
|
+
|
|
444
|
+
# @!attribute remove_tags
|
|
445
|
+
# Array of tag strings to remove from the asset.
|
|
446
|
+
#
|
|
447
|
+
# @return [Array<String>, nil]
|
|
448
|
+
optional :remove_tags, Imagekitio::Internal::Type::ArrayOf[String]
|
|
449
|
+
|
|
450
|
+
# @!attribute set_metadata
|
|
451
|
+
# Array of custom metadata field updates.
|
|
452
|
+
#
|
|
453
|
+
# @return [Array<Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnUnknown::SetMetadata>, nil]
|
|
454
|
+
optional :set_metadata,
|
|
455
|
+
-> { Imagekitio::Internal::Type::ArrayOf[Imagekitio::ExtensionConfig::AITasks::Task::YesNo::OnUnknown::SetMetadata] }
|
|
456
|
+
|
|
457
|
+
# @!attribute unset_metadata
|
|
458
|
+
# Array of custom metadata fields to remove.
|
|
459
|
+
#
|
|
460
|
+
# @return [Array<Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnUnknown::UnsetMetadata>, nil]
|
|
461
|
+
optional :unset_metadata,
|
|
462
|
+
-> { Imagekitio::Internal::Type::ArrayOf[Imagekitio::ExtensionConfig::AITasks::Task::YesNo::OnUnknown::UnsetMetadata] }
|
|
463
|
+
|
|
464
|
+
# @!method initialize(add_tags: nil, remove_tags: nil, set_metadata: nil, unset_metadata: nil)
|
|
465
|
+
# Actions to execute if the AI cannot determine the answer.
|
|
466
|
+
#
|
|
467
|
+
# @param add_tags [Array<String>] Array of tag strings to add to the asset.
|
|
468
|
+
#
|
|
469
|
+
# @param remove_tags [Array<String>] Array of tag strings to remove from the asset.
|
|
470
|
+
#
|
|
471
|
+
# @param set_metadata [Array<Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnUnknown::SetMetadata>] Array of custom metadata field updates.
|
|
472
|
+
#
|
|
473
|
+
# @param unset_metadata [Array<Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnUnknown::UnsetMetadata>] Array of custom metadata fields to remove.
|
|
474
|
+
|
|
475
|
+
class SetMetadata < Imagekitio::Internal::Type::BaseModel
|
|
476
|
+
# @!attribute field
|
|
477
|
+
# Name of the custom metadata field to set.
|
|
478
|
+
#
|
|
479
|
+
# @return [String]
|
|
480
|
+
required :field, String
|
|
481
|
+
|
|
482
|
+
# @!attribute value
|
|
483
|
+
# Value to set for the custom metadata field. The value type should match the
|
|
484
|
+
# custom metadata field type.
|
|
485
|
+
#
|
|
486
|
+
# @return [String, Float, Boolean, Array<String, Float, Boolean>]
|
|
487
|
+
required :value,
|
|
488
|
+
union: -> { Imagekitio::ExtensionConfig::AITasks::Task::YesNo::OnUnknown::SetMetadata::Value }
|
|
489
|
+
|
|
490
|
+
# @!method initialize(field:, value:)
|
|
491
|
+
# Some parameter documentations has been truncated, see
|
|
492
|
+
# {Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnUnknown::SetMetadata}
|
|
493
|
+
# for more details.
|
|
494
|
+
#
|
|
495
|
+
# @param field [String] Name of the custom metadata field to set.
|
|
496
|
+
#
|
|
497
|
+
# @param value [String, Float, Boolean, Array<String, Float, Boolean>] Value to set for the custom metadata field. The value type should match the cust
|
|
498
|
+
|
|
499
|
+
# Value to set for the custom metadata field. The value type should match the
|
|
500
|
+
# custom metadata field type.
|
|
501
|
+
#
|
|
502
|
+
# @see Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnUnknown::SetMetadata#value
|
|
503
|
+
module Value
|
|
504
|
+
extend Imagekitio::Internal::Type::Union
|
|
505
|
+
|
|
506
|
+
variant String
|
|
507
|
+
|
|
508
|
+
variant Float
|
|
509
|
+
|
|
510
|
+
variant Imagekitio::Internal::Type::Boolean
|
|
511
|
+
|
|
512
|
+
variant -> { Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnUnknown::SetMetadata::Value::MixedArray }
|
|
513
|
+
|
|
514
|
+
module Mixed
|
|
515
|
+
extend Imagekitio::Internal::Type::Union
|
|
516
|
+
|
|
517
|
+
variant String
|
|
518
|
+
|
|
519
|
+
variant Float
|
|
520
|
+
|
|
521
|
+
variant Imagekitio::Internal::Type::Boolean
|
|
522
|
+
|
|
523
|
+
# @!method self.variants
|
|
524
|
+
# @return [Array(String, Float, Boolean)]
|
|
525
|
+
end
|
|
526
|
+
|
|
527
|
+
# @!method self.variants
|
|
528
|
+
# @return [Array(String, Float, Boolean, Array<String, Float, Boolean>)]
|
|
529
|
+
|
|
530
|
+
# @type [Imagekitio::Internal::Type::Converter]
|
|
531
|
+
MixedArray =
|
|
532
|
+
Imagekitio::Internal::Type::ArrayOf[union: -> {
|
|
533
|
+
Imagekitio::ExtensionConfig::AITasks::Task::YesNo::OnUnknown::SetMetadata::Value::Mixed
|
|
534
|
+
}]
|
|
535
|
+
end
|
|
536
|
+
end
|
|
537
|
+
|
|
538
|
+
class UnsetMetadata < Imagekitio::Internal::Type::BaseModel
|
|
539
|
+
# @!attribute field
|
|
540
|
+
# Name of the custom metadata field to remove.
|
|
541
|
+
#
|
|
542
|
+
# @return [String]
|
|
543
|
+
required :field, String
|
|
544
|
+
|
|
545
|
+
# @!method initialize(field:)
|
|
546
|
+
# @param field [String] Name of the custom metadata field to remove.
|
|
547
|
+
end
|
|
548
|
+
end
|
|
549
|
+
|
|
550
|
+
# @see Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo#on_yes
|
|
551
|
+
class OnYes < Imagekitio::Internal::Type::BaseModel
|
|
552
|
+
# @!attribute add_tags
|
|
553
|
+
# Array of tag strings to add to the asset.
|
|
554
|
+
#
|
|
555
|
+
# @return [Array<String>, nil]
|
|
556
|
+
optional :add_tags, Imagekitio::Internal::Type::ArrayOf[String]
|
|
557
|
+
|
|
558
|
+
# @!attribute remove_tags
|
|
559
|
+
# Array of tag strings to remove from the asset.
|
|
560
|
+
#
|
|
561
|
+
# @return [Array<String>, nil]
|
|
562
|
+
optional :remove_tags, Imagekitio::Internal::Type::ArrayOf[String]
|
|
563
|
+
|
|
564
|
+
# @!attribute set_metadata
|
|
565
|
+
# Array of custom metadata field updates.
|
|
566
|
+
#
|
|
567
|
+
# @return [Array<Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnYes::SetMetadata>, nil]
|
|
568
|
+
optional :set_metadata,
|
|
569
|
+
-> { Imagekitio::Internal::Type::ArrayOf[Imagekitio::ExtensionConfig::AITasks::Task::YesNo::OnYes::SetMetadata] }
|
|
570
|
+
|
|
571
|
+
# @!attribute unset_metadata
|
|
572
|
+
# Array of custom metadata fields to remove.
|
|
573
|
+
#
|
|
574
|
+
# @return [Array<Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnYes::UnsetMetadata>, nil]
|
|
575
|
+
optional :unset_metadata,
|
|
576
|
+
-> { Imagekitio::Internal::Type::ArrayOf[Imagekitio::ExtensionConfig::AITasks::Task::YesNo::OnYes::UnsetMetadata] }
|
|
577
|
+
|
|
578
|
+
# @!method initialize(add_tags: nil, remove_tags: nil, set_metadata: nil, unset_metadata: nil)
|
|
579
|
+
# Actions to execute if the AI answers yes.
|
|
580
|
+
#
|
|
581
|
+
# @param add_tags [Array<String>] Array of tag strings to add to the asset.
|
|
582
|
+
#
|
|
583
|
+
# @param remove_tags [Array<String>] Array of tag strings to remove from the asset.
|
|
584
|
+
#
|
|
585
|
+
# @param set_metadata [Array<Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnYes::SetMetadata>] Array of custom metadata field updates.
|
|
586
|
+
#
|
|
587
|
+
# @param unset_metadata [Array<Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnYes::UnsetMetadata>] Array of custom metadata fields to remove.
|
|
588
|
+
|
|
589
|
+
class SetMetadata < Imagekitio::Internal::Type::BaseModel
|
|
590
|
+
# @!attribute field
|
|
591
|
+
# Name of the custom metadata field to set.
|
|
592
|
+
#
|
|
593
|
+
# @return [String]
|
|
594
|
+
required :field, String
|
|
595
|
+
|
|
596
|
+
# @!attribute value
|
|
597
|
+
# Value to set for the custom metadata field. The value type should match the
|
|
598
|
+
# custom metadata field type.
|
|
599
|
+
#
|
|
600
|
+
# @return [String, Float, Boolean, Array<String, Float, Boolean>]
|
|
601
|
+
required :value,
|
|
602
|
+
union: -> { Imagekitio::ExtensionConfig::AITasks::Task::YesNo::OnYes::SetMetadata::Value }
|
|
603
|
+
|
|
604
|
+
# @!method initialize(field:, value:)
|
|
605
|
+
# Some parameter documentations has been truncated, see
|
|
606
|
+
# {Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnYes::SetMetadata}
|
|
607
|
+
# for more details.
|
|
608
|
+
#
|
|
609
|
+
# @param field [String] Name of the custom metadata field to set.
|
|
610
|
+
#
|
|
611
|
+
# @param value [String, Float, Boolean, Array<String, Float, Boolean>] Value to set for the custom metadata field. The value type should match the cust
|
|
612
|
+
|
|
613
|
+
# Value to set for the custom metadata field. The value type should match the
|
|
614
|
+
# custom metadata field type.
|
|
615
|
+
#
|
|
616
|
+
# @see Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnYes::SetMetadata#value
|
|
617
|
+
module Value
|
|
618
|
+
extend Imagekitio::Internal::Type::Union
|
|
619
|
+
|
|
620
|
+
variant String
|
|
621
|
+
|
|
622
|
+
variant Float
|
|
623
|
+
|
|
624
|
+
variant Imagekitio::Internal::Type::Boolean
|
|
625
|
+
|
|
626
|
+
variant -> { Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo::OnYes::SetMetadata::Value::MixedArray }
|
|
627
|
+
|
|
628
|
+
module Mixed
|
|
629
|
+
extend Imagekitio::Internal::Type::Union
|
|
630
|
+
|
|
631
|
+
variant String
|
|
632
|
+
|
|
633
|
+
variant Float
|
|
634
|
+
|
|
635
|
+
variant Imagekitio::Internal::Type::Boolean
|
|
636
|
+
|
|
637
|
+
# @!method self.variants
|
|
638
|
+
# @return [Array(String, Float, Boolean)]
|
|
639
|
+
end
|
|
640
|
+
|
|
641
|
+
# @!method self.variants
|
|
642
|
+
# @return [Array(String, Float, Boolean, Array<String, Float, Boolean>)]
|
|
643
|
+
|
|
644
|
+
# @type [Imagekitio::Internal::Type::Converter]
|
|
645
|
+
MixedArray =
|
|
646
|
+
Imagekitio::Internal::Type::ArrayOf[union: -> {
|
|
647
|
+
Imagekitio::ExtensionConfig::AITasks::Task::YesNo::OnYes::SetMetadata::Value::Mixed
|
|
648
|
+
}]
|
|
649
|
+
end
|
|
650
|
+
end
|
|
651
|
+
|
|
652
|
+
class UnsetMetadata < Imagekitio::Internal::Type::BaseModel
|
|
653
|
+
# @!attribute field
|
|
654
|
+
# Name of the custom metadata field to remove.
|
|
655
|
+
#
|
|
656
|
+
# @return [String]
|
|
657
|
+
required :field, String
|
|
658
|
+
|
|
659
|
+
# @!method initialize(field:)
|
|
660
|
+
# @param field [String] Name of the custom metadata field to remove.
|
|
661
|
+
end
|
|
662
|
+
end
|
|
663
|
+
end
|
|
664
|
+
|
|
665
|
+
# @!method self.variants
|
|
666
|
+
# @return [Array(Imagekitio::Models::ExtensionConfig::AITasks::Task::SelectTags, Imagekitio::Models::ExtensionConfig::AITasks::Task::SelectMetadata, Imagekitio::Models::ExtensionConfig::AITasks::Task::YesNo)]
|
|
667
|
+
end
|
|
668
|
+
end
|
|
669
|
+
|
|
670
|
+
# @!method self.variants
|
|
671
|
+
# @return [Array(Imagekitio::Models::ExtensionConfig::RemoveBg, Imagekitio::Models::ExtensionConfig::AIAutoDescription, Imagekitio::Models::ExtensionConfig::AITasks, Imagekitio::Models::ExtensionConfig::AutoTaggingExtension)]
|
|
672
|
+
end
|
|
673
|
+
end
|
|
674
|
+
end
|