Skip to content

Commit 8c970ed

Browse files
feat(api): manual updates
1 parent e33d6ed commit 8c970ed

File tree

23 files changed

+625
-1674
lines changed

23 files changed

+625
-1674
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 42
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-0470196862abd722b09f1af798d6f2bcbdeba0f82d1162f57c287b1a43233531.yml
33
openapi_spec_hash: 043dd7c67d741d0034b86f2fc0bce072
4-
config_hash: 70f9408b8d1dfbcf262a20d6eed50e1c
4+
config_hash: da949a1217f48ac01676eab81ca9d1b1

lib/imagekit.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
require_relative "imagekit/models/custom_metadata_field_list_params"
8787
require_relative "imagekit/models/custom_metadata_field_list_response"
8888
require_relative "imagekit/models/custom_metadata_field_update_params"
89+
require_relative "imagekit/models/extensions"
8990
require_relative "imagekit/models/file_copy_params"
9091
require_relative "imagekit/models/file_copy_response"
9192
require_relative "imagekit/models/file_delete_params"

lib/imagekit/models.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ module Imagekit
6161

6262
CustomMetadataFieldUpdateParams = Imagekit::Models::CustomMetadataFieldUpdateParams
6363

64+
ExtensionItem = Imagekit::Models::ExtensionItem
65+
66+
# @type [Imagekit::Internal::Type::Converter]
67+
Extensions = Imagekit::Models::Extensions
68+
6469
File = Imagekit::Models::File
6570

6671
FileCopyParams = Imagekit::Models::FileCopyParams

lib/imagekit/models/beta/v2/file_upload_params.rb

Lines changed: 3 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,8 @@ class FileUploadParams < Imagekit::Internal::Type::BaseModel
8787
# Array of extensions to be applied to the asset. Each extension can be configured
8888
# with specific parameters based on the extension type.
8989
#
90-
# @return [Array<Imagekit::Models::Beta::V2::FileUploadParams::Extension::RemoveBg, Imagekit::Models::Beta::V2::FileUploadParams::Extension::AIAutoDescription, Imagekit::Models::Beta::V2::FileUploadParams::Extension::AutoTaggingExtension>, nil]
91-
optional :extensions,
92-
-> { Imagekit::Internal::Type::ArrayOf[union: Imagekit::Beta::V2::FileUploadParams::Extension] }
90+
# @return [Array<Imagekit::Models::ExtensionItem::RemoveBg, Imagekit::Models::ExtensionItem::AIAutoDescription, Imagekit::Models::ExtensionItem::AutoTaggingExtension>, nil]
91+
optional :extensions, -> { Imagekit::Internal::Type::ArrayOf[union: Imagekit::ExtensionItem] }
9392

9493
# @!attribute folder
9594
# The folder path in which the image has to be uploaded. If the folder(s) didn't
@@ -225,7 +224,7 @@ class FileUploadParams < Imagekit::Internal::Type::BaseModel
225224
#
226225
# @param description [String] Optional text to describe the contents of the file.
227226
#
228-
# @param extensions [Array<Imagekit::Models::Beta::V2::FileUploadParams::Extension::RemoveBg, Imagekit::Models::Beta::V2::FileUploadParams::Extension::AIAutoDescription, Imagekit::Models::Beta::V2::FileUploadParams::Extension::AutoTaggingExtension>] Array of extensions to be applied to the asset. Each extension can be configured
227+
# @param extensions [Array<Imagekit::Models::ExtensionItem::RemoveBg, Imagekit::Models::ExtensionItem::AIAutoDescription, Imagekit::Models::ExtensionItem::AutoTaggingExtension>] Array of extensions to be applied to the asset. Each extension can be configured
229228
#
230229
# @param folder [String] The folder path in which the image has to be uploaded. If the folder(s) didn't e
231230
#
@@ -253,135 +252,6 @@ class FileUploadParams < Imagekit::Internal::Type::BaseModel
253252
#
254253
# @param request_options [Imagekit::RequestOptions, Hash{Symbol=>Object}]
255254

256-
module Extension
257-
extend Imagekit::Internal::Type::Union
258-
259-
discriminator :name
260-
261-
variant :"remove-bg", -> { Imagekit::Beta::V2::FileUploadParams::Extension::RemoveBg }
262-
263-
variant :"ai-auto-description", -> { Imagekit::Beta::V2::FileUploadParams::Extension::AIAutoDescription }
264-
265-
variant -> { Imagekit::Beta::V2::FileUploadParams::Extension::AutoTaggingExtension }
266-
267-
class RemoveBg < Imagekit::Internal::Type::BaseModel
268-
# @!attribute name
269-
# Specifies the background removal extension.
270-
#
271-
# @return [Symbol, :"remove-bg"]
272-
required :name, const: :"remove-bg"
273-
274-
# @!attribute options
275-
#
276-
# @return [Imagekit::Models::Beta::V2::FileUploadParams::Extension::RemoveBg::Options, nil]
277-
optional :options, -> { Imagekit::Beta::V2::FileUploadParams::Extension::RemoveBg::Options }
278-
279-
# @!method initialize(options: nil, name: :"remove-bg")
280-
# @param options [Imagekit::Models::Beta::V2::FileUploadParams::Extension::RemoveBg::Options]
281-
#
282-
# @param name [Symbol, :"remove-bg"] Specifies the background removal extension.
283-
284-
# @see Imagekit::Models::Beta::V2::FileUploadParams::Extension::RemoveBg#options
285-
class Options < Imagekit::Internal::Type::BaseModel
286-
# @!attribute add_shadow
287-
# Whether to add an artificial shadow to the result. Default is false. Note:
288-
# Adding shadows is currently only supported for car photos.
289-
#
290-
# @return [Boolean, nil]
291-
optional :add_shadow, Imagekit::Internal::Type::Boolean
292-
293-
# @!attribute bg_color
294-
# Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or
295-
# color name (e.g., "green"). If this parameter is set, `bg_image_url` must be
296-
# empty.
297-
#
298-
# @return [String, nil]
299-
optional :bg_color, String
300-
301-
# @!attribute bg_image_url
302-
# Sets a background image from a URL. If this parameter is set, `bg_color` must be
303-
# empty.
304-
#
305-
# @return [String, nil]
306-
optional :bg_image_url, String
307-
308-
# @!attribute semitransparency
309-
# Allows semi-transparent regions in the result. Default is true. Note:
310-
# Semitransparency is currently only supported for car windows.
311-
#
312-
# @return [Boolean, nil]
313-
optional :semitransparency, Imagekit::Internal::Type::Boolean
314-
315-
# @!method initialize(add_shadow: nil, bg_color: nil, bg_image_url: nil, semitransparency: nil)
316-
# Some parameter documentations has been truncated, see
317-
# {Imagekit::Models::Beta::V2::FileUploadParams::Extension::RemoveBg::Options} for
318-
# more details.
319-
#
320-
# @param add_shadow [Boolean] Whether to add an artificial shadow to the result. Default is false. Note: Addin
321-
#
322-
# @param bg_color [String] Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or col
323-
#
324-
# @param bg_image_url [String] Sets a background image from a URL. If this parameter is set, `bg_color` must be
325-
#
326-
# @param semitransparency [Boolean] Allows semi-transparent regions in the result. Default is true. Note: Semitransp
327-
end
328-
end
329-
330-
class AutoTaggingExtension < Imagekit::Internal::Type::BaseModel
331-
# @!attribute max_tags
332-
# Maximum number of tags to attach to the asset.
333-
#
334-
# @return [Integer]
335-
required :max_tags, Integer, api_name: :maxTags
336-
337-
# @!attribute min_confidence
338-
# Minimum confidence level for tags to be considered valid.
339-
#
340-
# @return [Integer]
341-
required :min_confidence, Integer, api_name: :minConfidence
342-
343-
# @!attribute name
344-
# Specifies the auto-tagging extension used.
345-
#
346-
# @return [Symbol, Imagekit::Models::Beta::V2::FileUploadParams::Extension::AutoTaggingExtension::Name]
347-
required :name, enum: -> { Imagekit::Beta::V2::FileUploadParams::Extension::AutoTaggingExtension::Name }
348-
349-
# @!method initialize(max_tags:, min_confidence:, name:)
350-
# @param max_tags [Integer] Maximum number of tags to attach to the asset.
351-
#
352-
# @param min_confidence [Integer] Minimum confidence level for tags to be considered valid.
353-
#
354-
# @param name [Symbol, Imagekit::Models::Beta::V2::FileUploadParams::Extension::AutoTaggingExtension::Name] Specifies the auto-tagging extension used.
355-
356-
# Specifies the auto-tagging extension used.
357-
#
358-
# @see Imagekit::Models::Beta::V2::FileUploadParams::Extension::AutoTaggingExtension#name
359-
module Name
360-
extend Imagekit::Internal::Type::Enum
361-
362-
GOOGLE_AUTO_TAGGING = :"google-auto-tagging"
363-
AWS_AUTO_TAGGING = :"aws-auto-tagging"
364-
365-
# @!method self.values
366-
# @return [Array<Symbol>]
367-
end
368-
end
369-
370-
class AIAutoDescription < Imagekit::Internal::Type::BaseModel
371-
# @!attribute name
372-
# Specifies the auto description extension.
373-
#
374-
# @return [Symbol, :"ai-auto-description"]
375-
required :name, const: :"ai-auto-description"
376-
377-
# @!method initialize(name: :"ai-auto-description")
378-
# @param name [Symbol, :"ai-auto-description"] Specifies the auto description extension.
379-
end
380-
381-
# @!method self.variants
382-
# @return [Array(Imagekit::Models::Beta::V2::FileUploadParams::Extension::RemoveBg, Imagekit::Models::Beta::V2::FileUploadParams::Extension::AIAutoDescription, Imagekit::Models::Beta::V2::FileUploadParams::Extension::AutoTaggingExtension)]
383-
end
384-
385255
module ResponseField
386256
extend Imagekit::Internal::Type::Enum
387257

lib/imagekit/models/extensions.rb

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# frozen_string_literal: true
2+
3+
module Imagekit
4+
module Models
5+
module ExtensionItem
6+
extend Imagekit::Internal::Type::Union
7+
8+
discriminator :name
9+
10+
variant :"remove-bg", -> { Imagekit::ExtensionItem::RemoveBg }
11+
12+
variant :"ai-auto-description", -> { Imagekit::ExtensionItem::AIAutoDescription }
13+
14+
variant -> { Imagekit::ExtensionItem::AutoTaggingExtension }
15+
16+
class RemoveBg < Imagekit::Internal::Type::BaseModel
17+
# @!attribute name
18+
# Specifies the background removal extension.
19+
#
20+
# @return [Symbol, :"remove-bg"]
21+
required :name, const: :"remove-bg"
22+
23+
# @!attribute options
24+
#
25+
# @return [Imagekit::Models::ExtensionItem::RemoveBg::Options, nil]
26+
optional :options, -> { Imagekit::ExtensionItem::RemoveBg::Options }
27+
28+
# @!method initialize(options: nil, name: :"remove-bg")
29+
# @param options [Imagekit::Models::ExtensionItem::RemoveBg::Options]
30+
#
31+
# @param name [Symbol, :"remove-bg"] Specifies the background removal extension.
32+
33+
# @see Imagekit::Models::ExtensionItem::RemoveBg#options
34+
class Options < Imagekit::Internal::Type::BaseModel
35+
# @!attribute add_shadow
36+
# Whether to add an artificial shadow to the result. Default is false. Note:
37+
# Adding shadows is currently only supported for car photos.
38+
#
39+
# @return [Boolean, nil]
40+
optional :add_shadow, Imagekit::Internal::Type::Boolean
41+
42+
# @!attribute bg_color
43+
# Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or
44+
# color name (e.g., "green"). If this parameter is set, `bg_image_url` must be
45+
# empty.
46+
#
47+
# @return [String, nil]
48+
optional :bg_color, String
49+
50+
# @!attribute bg_image_url
51+
# Sets a background image from a URL. If this parameter is set, `bg_color` must be
52+
# empty.
53+
#
54+
# @return [String, nil]
55+
optional :bg_image_url, String
56+
57+
# @!attribute semitransparency
58+
# Allows semi-transparent regions in the result. Default is true. Note:
59+
# Semitransparency is currently only supported for car windows.
60+
#
61+
# @return [Boolean, nil]
62+
optional :semitransparency, Imagekit::Internal::Type::Boolean
63+
64+
# @!method initialize(add_shadow: nil, bg_color: nil, bg_image_url: nil, semitransparency: nil)
65+
# Some parameter documentations has been truncated, see
66+
# {Imagekit::Models::ExtensionItem::RemoveBg::Options} for more details.
67+
#
68+
# @param add_shadow [Boolean] Whether to add an artificial shadow to the result. Default is false. Note: Addin
69+
#
70+
# @param bg_color [String] Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or col
71+
#
72+
# @param bg_image_url [String] Sets a background image from a URL. If this parameter is set, `bg_color` must be
73+
#
74+
# @param semitransparency [Boolean] Allows semi-transparent regions in the result. Default is true. Note: Semitransp
75+
end
76+
end
77+
78+
class AutoTaggingExtension < Imagekit::Internal::Type::BaseModel
79+
# @!attribute max_tags
80+
# Maximum number of tags to attach to the asset.
81+
#
82+
# @return [Integer]
83+
required :max_tags, Integer, api_name: :maxTags
84+
85+
# @!attribute min_confidence
86+
# Minimum confidence level for tags to be considered valid.
87+
#
88+
# @return [Integer]
89+
required :min_confidence, Integer, api_name: :minConfidence
90+
91+
# @!attribute name
92+
# Specifies the auto-tagging extension used.
93+
#
94+
# @return [Symbol, Imagekit::Models::ExtensionItem::AutoTaggingExtension::Name]
95+
required :name, enum: -> { Imagekit::ExtensionItem::AutoTaggingExtension::Name }
96+
97+
# @!method initialize(max_tags:, min_confidence:, name:)
98+
# @param max_tags [Integer] Maximum number of tags to attach to the asset.
99+
#
100+
# @param min_confidence [Integer] Minimum confidence level for tags to be considered valid.
101+
#
102+
# @param name [Symbol, Imagekit::Models::ExtensionItem::AutoTaggingExtension::Name] Specifies the auto-tagging extension used.
103+
104+
# Specifies the auto-tagging extension used.
105+
#
106+
# @see Imagekit::Models::ExtensionItem::AutoTaggingExtension#name
107+
module Name
108+
extend Imagekit::Internal::Type::Enum
109+
110+
GOOGLE_AUTO_TAGGING = :"google-auto-tagging"
111+
AWS_AUTO_TAGGING = :"aws-auto-tagging"
112+
113+
# @!method self.values
114+
# @return [Array<Symbol>]
115+
end
116+
end
117+
118+
class AIAutoDescription < Imagekit::Internal::Type::BaseModel
119+
# @!attribute name
120+
# Specifies the auto description extension.
121+
#
122+
# @return [Symbol, :"ai-auto-description"]
123+
required :name, const: :"ai-auto-description"
124+
125+
# @!method initialize(name: :"ai-auto-description")
126+
# @param name [Symbol, :"ai-auto-description"] Specifies the auto description extension.
127+
end
128+
129+
# @!method self.variants
130+
# @return [Array(Imagekit::Models::ExtensionItem::RemoveBg, Imagekit::Models::ExtensionItem::AIAutoDescription, Imagekit::Models::ExtensionItem::AutoTaggingExtension)]
131+
end
132+
133+
# @type [Imagekit::Internal::Type::Converter]
134+
Extensions = Imagekit::Internal::Type::ArrayOf[union: -> { Imagekit::ExtensionItem }]
135+
end
136+
end

0 commit comments

Comments
 (0)