Skip to content

Commit 5a87ef0

Browse files
feat(api): Introduce lxc, lyc, lap parameters in overlays.
1 parent 88f5590 commit 5a87ef0

File tree

8 files changed

+391
-41
lines changed

8 files changed

+391
-41
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 47
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-83a7f3659a437113f2a79e1e72794be19eff00ec232fd0206198c80364ccfebf.yml
3-
openapi_spec_hash: b327552548ab641eb4ea3b45e643dfce
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-63aff1629530786015da3c86131afa8a9b60545d488884b77641f1d4b89c6e9d.yml
3+
openapi_spec_hash: 586d357bd7e5217d240a99e0d83c6d1f
44
config_hash: 47cb702ee2cb52c58d803ae39ade9b44

lib/imagekitio/models/extension_config.rb

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,10 @@ class SelectTags < Imagekitio::Internal::Type::BaseModel
186186
optional :min_selections, Integer
187187

188188
# @!attribute vocabulary
189-
# Array of possible tag values. Combined length of all strings must not exceed 500
190-
# characters. Cannot contain the `%` character.
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.
191193
#
192194
# @return [Array<String>, nil]
193195
optional :vocabulary, Imagekitio::Internal::Type::ArrayOf[String]
@@ -203,7 +205,7 @@ class SelectTags < Imagekitio::Internal::Type::BaseModel
203205
#
204206
# @param min_selections [Integer] Minimum number of tags to select from the vocabulary.
205207
#
206-
# @param vocabulary [Array<String>] Array of possible tag values. Combined length of all strings must not exceed 500
208+
# @param vocabulary [Array<String>] Array of possible tag values. The combined length of all strings must not exceed
207209
#
208210
# @param type [Symbol, :select_tags] Task type that analyzes the image and adds matching tags from a vocabulary.
209211
end
@@ -241,7 +243,10 @@ class SelectMetadata < Imagekitio::Internal::Type::BaseModel
241243
optional :min_selections, Integer
242244

243245
# @!attribute vocabulary
244-
# Array of possible values matching the custom metadata field type.
246+
# An array of possible values matching the custom metadata field type. If not
247+
# provided for SingleSelect or MultiSelect field types, all values from the custom
248+
# metadata field definition will be used. When providing large vocabularies (above
249+
# 30 items), the AI may not strictly adhere to the list.
245250
#
246251
# @return [Array<String, Float, Boolean>, nil]
247252
optional :vocabulary,
@@ -260,7 +265,7 @@ class SelectMetadata < Imagekitio::Internal::Type::BaseModel
260265
#
261266
# @param min_selections [Integer] Minimum number of values to select from the vocabulary.
262267
#
263-
# @param vocabulary [Array<String, Float, Boolean>] Array of possible values matching the custom metadata field type.
268+
# @param vocabulary [Array<String, Float, Boolean>] An array of possible values matching the custom metadata field type. If not prov
264269
#
265270
# @param type [Symbol, :select_metadata] Task type that analyzes the image and sets a custom metadata field value from a
266271

lib/imagekitio/models/extensions.rb

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,10 @@ class SelectTags < Imagekitio::Internal::Type::BaseModel
186186
optional :min_selections, Integer
187187

188188
# @!attribute vocabulary
189-
# Array of possible tag values. Combined length of all strings must not exceed 500
190-
# characters. Cannot contain the `%` character.
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.
191193
#
192194
# @return [Array<String>, nil]
193195
optional :vocabulary, Imagekitio::Internal::Type::ArrayOf[String]
@@ -202,7 +204,7 @@ class SelectTags < Imagekitio::Internal::Type::BaseModel
202204
#
203205
# @param min_selections [Integer] Minimum number of tags to select from the vocabulary.
204206
#
205-
# @param vocabulary [Array<String>] Array of possible tag values. Combined length of all strings must not exceed 500
207+
# @param vocabulary [Array<String>] Array of possible tag values. The combined length of all strings must not exceed
206208
#
207209
# @param type [Symbol, :select_tags] Task type that analyzes the image and adds matching tags from a vocabulary.
208210
end
@@ -240,7 +242,10 @@ class SelectMetadata < Imagekitio::Internal::Type::BaseModel
240242
optional :min_selections, Integer
241243

242244
# @!attribute vocabulary
243-
# Array of possible values matching the custom metadata field type.
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.
244249
#
245250
# @return [Array<String, Float, Boolean>, nil]
246251
optional :vocabulary,
@@ -259,7 +264,7 @@ class SelectMetadata < Imagekitio::Internal::Type::BaseModel
259264
#
260265
# @param min_selections [Integer] Minimum number of values to select from the vocabulary.
261266
#
262-
# @param vocabulary [Array<String, Float, Boolean>] Array of possible values matching the custom metadata field type.
267+
# @param vocabulary [Array<String, Float, Boolean>] An array of possible values matching the custom metadata field type. If not prov
263268
#
264269
# @param type [Symbol, :select_metadata] Task type that analyzes the image and sets a custom metadata field value from a
265270

lib/imagekitio/models/overlay_position.rb

Lines changed: 99 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,18 @@
33
module Imagekitio
44
module Models
55
class OverlayPosition < Imagekitio::Internal::Type::BaseModel
6+
# @!attribute anchor_point
7+
# Sets the anchor point on the base asset from which the overlay offset is
8+
# calculated. The default value is `top_left`. Maps to `lap` in the URL. Can only
9+
# be used with one or more of `x`, `y`, `xCenter`, or `yCenter`.
10+
#
11+
# @return [Symbol, Imagekitio::Models::OverlayPosition::AnchorPoint, nil]
12+
optional :anchor_point, enum: -> { Imagekitio::OverlayPosition::AnchorPoint }, api_name: :anchorPoint
13+
614
# @!attribute focus
7-
# Specifies the position of the overlay relative to the parent image or video.
8-
# Maps to `lfo` in the URL.
15+
# Specifies the position of the overlay relative to the parent image or video. If
16+
# one or more of `x`, `y`, `xCenter`, or `yCenter` parameters are specified, this
17+
# parameter is ignored. Maps to `lfo` in the URL.
918
#
1019
# @return [Symbol, Imagekitio::Models::OverlayPosition::Focus, nil]
1120
optional :focus, enum: -> { Imagekitio::OverlayPosition::Focus }
@@ -20,6 +29,16 @@ class OverlayPosition < Imagekitio::Internal::Type::BaseModel
2029
# @return [Float, String, nil]
2130
optional :x, union: -> { Imagekitio::OverlayPosition::X }
2231

32+
# @!attribute x_center
33+
# Specifies the x-coordinate on the base asset where the overlay's center will be
34+
# positioned. It also accepts arithmetic expressions such as `bw_mul_0.4` or
35+
# `bw_sub_cw`. Maps to `lxc` in the URL. Cannot be used together with `x`, but can
36+
# be used with `y`. Learn about
37+
# [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
38+
#
39+
# @return [Float, String, nil]
40+
optional :x_center, union: -> { Imagekitio::OverlayPosition::XCenter }, api_name: :xCenter
41+
2342
# @!attribute y_
2443
# Specifies the y-coordinate of the top-left corner of the base asset where the
2544
# overlay's top-left corner will be positioned. It also accepts arithmetic
@@ -30,18 +49,57 @@ class OverlayPosition < Imagekitio::Internal::Type::BaseModel
3049
# @return [Float, String, nil]
3150
optional :y_, union: -> { Imagekitio::OverlayPosition::Y }, api_name: :y
3251

33-
# @!method initialize(focus: nil, x: nil, y_: nil)
52+
# @!attribute y_center
53+
# Specifies the y-coordinate on the base asset where the overlay's center will be
54+
# positioned. It also accepts arithmetic expressions such as `bh_mul_0.4` or
55+
# `bh_sub_ch`. Maps to `lyc` in the URL. Cannot be used together with `y`, but can
56+
# be used with `x`. Learn about
57+
# [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
58+
#
59+
# @return [Float, String, nil]
60+
optional :y_center, union: -> { Imagekitio::OverlayPosition::YCenter }, api_name: :yCenter
61+
62+
# @!method initialize(anchor_point: nil, focus: nil, x: nil, x_center: nil, y_: nil, y_center: nil)
3463
# Some parameter documentations has been truncated, see
3564
# {Imagekitio::Models::OverlayPosition} for more details.
3665
#
66+
# @param anchor_point [Symbol, Imagekitio::Models::OverlayPosition::AnchorPoint] Sets the anchor point on the base asset from which the overlay offset is calcula
67+
#
3768
# @param focus [Symbol, Imagekitio::Models::OverlayPosition::Focus] Specifies the position of the overlay relative to the parent image or video.
3869
#
3970
# @param x [Float, String] Specifies the x-coordinate of the top-left corner of the base asset where the ov
4071
#
72+
# @param x_center [Float, String] Specifies the x-coordinate on the base asset where the overlay's center will be
73+
#
4174
# @param y_ [Float, String] Specifies the y-coordinate of the top-left corner of the base asset where the ov
75+
#
76+
# @param y_center [Float, String] Specifies the y-coordinate on the base asset where the overlay's center will be
77+
78+
# Sets the anchor point on the base asset from which the overlay offset is
79+
# calculated. The default value is `top_left`. Maps to `lap` in the URL. Can only
80+
# be used with one or more of `x`, `y`, `xCenter`, or `yCenter`.
81+
#
82+
# @see Imagekitio::Models::OverlayPosition#anchor_point
83+
module AnchorPoint
84+
extend Imagekitio::Internal::Type::Enum
85+
86+
TOP = :top
87+
LEFT = :left
88+
RIGHT = :right
89+
BOTTOM = :bottom
90+
TOP_LEFT = :top_left
91+
TOP_RIGHT = :top_right
92+
BOTTOM_LEFT = :bottom_left
93+
BOTTOM_RIGHT = :bottom_right
94+
CENTER = :center
95+
96+
# @!method self.values
97+
# @return [Array<Symbol>]
98+
end
4299

43-
# Specifies the position of the overlay relative to the parent image or video.
44-
# Maps to `lfo` in the URL.
100+
# Specifies the position of the overlay relative to the parent image or video. If
101+
# one or more of `x`, `y`, `xCenter`, or `yCenter` parameters are specified, this
102+
# parameter is ignored. Maps to `lfo` in the URL.
45103
#
46104
# @see Imagekitio::Models::OverlayPosition#focus
47105
module Focus
@@ -79,6 +137,24 @@ module X
79137
# @return [Array(Float, String)]
80138
end
81139

140+
# Specifies the x-coordinate on the base asset where the overlay's center will be
141+
# positioned. It also accepts arithmetic expressions such as `bw_mul_0.4` or
142+
# `bw_sub_cw`. Maps to `lxc` in the URL. Cannot be used together with `x`, but can
143+
# be used with `y`. Learn about
144+
# [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
145+
#
146+
# @see Imagekitio::Models::OverlayPosition#x_center
147+
module XCenter
148+
extend Imagekitio::Internal::Type::Union
149+
150+
variant Float
151+
152+
variant String
153+
154+
# @!method self.variants
155+
# @return [Array(Float, String)]
156+
end
157+
82158
# Specifies the y-coordinate of the top-left corner of the base asset where the
83159
# overlay's top-left corner will be positioned. It also accepts arithmetic
84160
# expressions such as `bh_mul_0.4` or `bh_sub_ch`. Maps to `ly` in the URL. Learn
@@ -96,6 +172,24 @@ module Y
96172
# @!method self.variants
97173
# @return [Array(Float, String)]
98174
end
175+
176+
# Specifies the y-coordinate on the base asset where the overlay's center will be
177+
# positioned. It also accepts arithmetic expressions such as `bh_mul_0.4` or
178+
# `bh_sub_ch`. Maps to `lyc` in the URL. Cannot be used together with `y`, but can
179+
# be used with `x`. Learn about
180+
# [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
181+
#
182+
# @see Imagekitio::Models::OverlayPosition#y_center
183+
module YCenter
184+
extend Imagekitio::Internal::Type::Union
185+
186+
variant Float
187+
188+
variant String
189+
190+
# @!method self.variants
191+
# @return [Array(Float, String)]
192+
end
99193
end
100194
end
101195
end

rbi/imagekitio/models/extension_config.rbi

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,10 @@ module Imagekitio
374374
sig { params(min_selections: Integer).void }
375375
attr_writer :min_selections
376376

377-
# Array of possible tag values. Combined length of all strings must not exceed 500
378-
# characters. Cannot contain the `%` character.
377+
# Array of possible tag values. The combined length of all strings must not exceed
378+
# 500 characters, and values cannot include the `%` character. When providing
379+
# large vocabularies (more than 30 items), the AI may not follow the list
380+
# strictly.
379381
sig { returns(T.nilable(T::Array[String])) }
380382
attr_reader :vocabulary
381383

@@ -398,8 +400,10 @@ module Imagekitio
398400
max_selections: nil,
399401
# Minimum number of tags to select from the vocabulary.
400402
min_selections: nil,
401-
# Array of possible tag values. Combined length of all strings must not exceed 500
402-
# characters. Cannot contain the `%` character.
403+
# Array of possible tag values. The combined length of all strings must not exceed
404+
# 500 characters, and values cannot include the `%` character. When providing
405+
# large vocabularies (more than 30 items), the AI may not follow the list
406+
# strictly.
403407
vocabulary: nil,
404408
# Task type that analyzes the image and adds matching tags from a vocabulary.
405409
type: :select_tags
@@ -457,7 +461,10 @@ module Imagekitio
457461
sig { params(min_selections: Integer).void }
458462
attr_writer :min_selections
459463

460-
# Array of possible values matching the custom metadata field type.
464+
# An array of possible values matching the custom metadata field type. If not
465+
# provided for SingleSelect or MultiSelect field types, all values from the custom
466+
# metadata field definition will be used. When providing large vocabularies (above
467+
# 30 items), the AI may not strictly adhere to the list.
461468
sig do
462469
returns(
463470
T.nilable(
@@ -501,7 +508,10 @@ module Imagekitio
501508
max_selections: nil,
502509
# Minimum number of values to select from the vocabulary.
503510
min_selections: nil,
504-
# Array of possible values matching the custom metadata field type.
511+
# An array of possible values matching the custom metadata field type. If not
512+
# provided for SingleSelect or MultiSelect field types, all values from the custom
513+
# metadata field definition will be used. When providing large vocabularies (above
514+
# 30 items), the AI may not strictly adhere to the list.
505515
vocabulary: nil,
506516
# Task type that analyzes the image and sets a custom metadata field value from a
507517
# vocabulary.

rbi/imagekitio/models/extensions.rbi

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,10 @@ module Imagekitio
371371
sig { params(min_selections: Integer).void }
372372
attr_writer :min_selections
373373

374-
# Array of possible tag values. Combined length of all strings must not exceed 500
375-
# characters. Cannot contain the `%` character.
374+
# Array of possible tag values. The combined length of all strings must not exceed
375+
# 500 characters, and values cannot include the `%` character. When providing
376+
# large vocabularies (more than 30 items), the AI may not follow the list
377+
# strictly.
376378
sig { returns(T.nilable(T::Array[String])) }
377379
attr_reader :vocabulary
378380

@@ -395,8 +397,10 @@ module Imagekitio
395397
max_selections: nil,
396398
# Minimum number of tags to select from the vocabulary.
397399
min_selections: nil,
398-
# Array of possible tag values. Combined length of all strings must not exceed 500
399-
# characters. Cannot contain the `%` character.
400+
# Array of possible tag values. The combined length of all strings must not exceed
401+
# 500 characters, and values cannot include the `%` character. When providing
402+
# large vocabularies (more than 30 items), the AI may not follow the list
403+
# strictly.
400404
vocabulary: nil,
401405
# Task type that analyzes the image and adds matching tags from a vocabulary.
402406
type: :select_tags
@@ -454,7 +458,10 @@ module Imagekitio
454458
sig { params(min_selections: Integer).void }
455459
attr_writer :min_selections
456460

457-
# Array of possible values matching the custom metadata field type.
461+
# An array of possible values matching the custom metadata field type. If not
462+
# provided for SingleSelect or MultiSelect field types, all values from the custom
463+
# metadata field definition will be used. When providing large vocabularies (above
464+
# 30 items), the AI may not strictly adhere to the list.
458465
sig do
459466
returns(
460467
T.nilable(
@@ -498,7 +505,10 @@ module Imagekitio
498505
max_selections: nil,
499506
# Minimum number of values to select from the vocabulary.
500507
min_selections: nil,
501-
# Array of possible values matching the custom metadata field type.
508+
# An array of possible values matching the custom metadata field type. If not
509+
# provided for SingleSelect or MultiSelect field types, all values from the custom
510+
# metadata field definition will be used. When providing large vocabularies (above
511+
# 30 items), the AI may not strictly adhere to the list.
502512
vocabulary: nil,
503513
# Task type that analyzes the image and sets a custom metadata field value from a
504514
# vocabulary.

0 commit comments

Comments
 (0)