Skip to content

Commit b24e025

Browse files
feat(api): add path policy related non-breaking changes
1 parent 9cf2e92 commit b24e025

13 files changed

+76
-6
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: 42
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d1a3e6dfc45ae832b6b14a0aef25878985c679fa9f48c1470df188b1578ba648.yml
3-
openapi_spec_hash: 1d382866fce3284f26d341f112988d9d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-1499148ce5fc81b4d8c8b3eaadf7adfaf54df5fa0b3a0452c3f5ef0dfe884a95.yml
3+
openapi_spec_hash: e91526b143d3e696bef2b4d0ea3aa2b4
44
config_hash: e42d7fc3a8c92c35099cc283f9a4467a

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ module ResponseField
262262
IS_PUBLISHED = :isPublished
263263
CUSTOM_METADATA = :customMetadata
264264
METADATA = :metadata
265+
SELECTED_FIELDS_SCHEMA = :selectedFieldsSchema
265266

266267
# @!method self.values
267268
# @return [Array<Symbol>]

lib/imagekit/models/custom_metadata_field_list_params.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,27 @@ class CustomMetadataFieldListParams < Imagekit::Internal::Type::BaseModel
77
extend Imagekit::Internal::Type::RequestParameters::Converter
88
include Imagekit::Internal::Type::RequestParameters
99

10+
# @!attribute folder_path
11+
# The folder path (e.g., `/path/to/folder`) for which to retrieve applicable
12+
# custom metadata fields.
13+
# Useful for determining path-specific field selections when the
14+
# [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use.
15+
#
16+
# @return [String, nil]
17+
optional :folder_path, String
18+
1019
# @!attribute include_deleted
1120
# Set it to `true` to include deleted field objects in the API response.
1221
#
1322
# @return [Boolean, nil]
1423
optional :include_deleted, Imagekit::Internal::Type::Boolean
1524

16-
# @!method initialize(include_deleted: nil, request_options: {})
25+
# @!method initialize(folder_path: nil, include_deleted: nil, request_options: {})
1726
# Some parameter documentations has been truncated, see
1827
# {Imagekit::Models::CustomMetadataFieldListParams} for more details.
1928
#
29+
# @param folder_path [String] The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custo
30+
#
2031
# @param include_deleted [Boolean] Set it to `true` to include deleted field objects in the API response.
2132
#
2233
# @param request_options [Imagekit::RequestOptions, Hash{Symbol=>Object}]

lib/imagekit/models/file_upload_params.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ module ResponseField
297297
IS_PUBLISHED = :isPublished
298298
CUSTOM_METADATA = :customMetadata
299299
METADATA = :metadata
300+
SELECTED_FIELDS_SCHEMA = :selectedFieldsSchema
300301

301302
# @!method self.values
302303
# @return [Array<Symbol>]

lib/imagekit/resources/custom_metadata_fields.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,14 @@ def update(id, params = {})
7171
# the API returns only non deleted field objects, but you can include deleted
7272
# fields in the API response.
7373
#
74-
# @overload list(include_deleted: nil, request_options: {})
74+
# You can also filter results by a specific folder path to retrieve custom
75+
# metadata fields applicable at that location. This path-specific filtering is
76+
# useful when using the **Path policy** feature to determine which custom metadata
77+
# fields are selected for a given path.
78+
#
79+
# @overload list(folder_path: nil, include_deleted: nil, request_options: {})
80+
#
81+
# @param folder_path [String] The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custo
7582
#
7683
# @param include_deleted [Boolean] Set it to `true` to include deleted field objects in the API response.
7784
#
@@ -85,7 +92,7 @@ def list(params = {})
8592
@client.request(
8693
method: :get,
8794
path: "v1/customMetadataFields",
88-
query: parsed.transform_keys(include_deleted: "includeDeleted"),
95+
query: parsed.transform_keys(folder_path: "folderPath", include_deleted: "includeDeleted"),
8996
model: Imagekit::Internal::Type::ArrayOf[Imagekit::CustomMetadataField],
9097
options: options
9198
)

rbi/imagekit/models/beta/v2/file_upload_params.rbi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,11 @@ module Imagekit
504504
:metadata,
505505
Imagekit::Beta::V2::FileUploadParams::ResponseField::TaggedSymbol
506506
)
507+
SELECTED_FIELDS_SCHEMA =
508+
T.let(
509+
:selectedFieldsSchema,
510+
Imagekit::Beta::V2::FileUploadParams::ResponseField::TaggedSymbol
511+
)
507512

508513
sig do
509514
override.returns(

rbi/imagekit/models/custom_metadata_field_list_params.rbi

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ module Imagekit
1414
)
1515
end
1616

17+
# The folder path (e.g., `/path/to/folder`) for which to retrieve applicable
18+
# custom metadata fields.
19+
# Useful for determining path-specific field selections when the
20+
# [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use.
21+
sig { returns(T.nilable(String)) }
22+
attr_reader :folder_path
23+
24+
sig { params(folder_path: String).void }
25+
attr_writer :folder_path
26+
1727
# Set it to `true` to include deleted field objects in the API response.
1828
sig { returns(T.nilable(T::Boolean)) }
1929
attr_reader :include_deleted
@@ -23,11 +33,17 @@ module Imagekit
2333

2434
sig do
2535
params(
36+
folder_path: String,
2637
include_deleted: T::Boolean,
2738
request_options: Imagekit::RequestOptions::OrHash
2839
).returns(T.attached_class)
2940
end
3041
def self.new(
42+
# The folder path (e.g., `/path/to/folder`) for which to retrieve applicable
43+
# custom metadata fields.
44+
# Useful for determining path-specific field selections when the
45+
# [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use.
46+
folder_path: nil,
3147
# Set it to `true` to include deleted field objects in the API response.
3248
include_deleted: nil,
3349
request_options: {}
@@ -37,6 +53,7 @@ module Imagekit
3753
sig do
3854
override.returns(
3955
{
56+
folder_path: String,
4057
include_deleted: T::Boolean,
4158
request_options: Imagekit::RequestOptions
4259
}

rbi/imagekit/models/file_upload_params.rbi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,11 @@ module Imagekit
541541
:metadata,
542542
Imagekit::FileUploadParams::ResponseField::TaggedSymbol
543543
)
544+
SELECTED_FIELDS_SCHEMA =
545+
T.let(
546+
:selectedFieldsSchema,
547+
Imagekit::FileUploadParams::ResponseField::TaggedSymbol
548+
)
544549

545550
sig do
546551
override.returns(

rbi/imagekit/resources/custom_metadata_fields.rbi

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,24 @@ module Imagekit
5858
# This API returns the array of created custom metadata field objects. By default
5959
# the API returns only non deleted field objects, but you can include deleted
6060
# fields in the API response.
61+
#
62+
# You can also filter results by a specific folder path to retrieve custom
63+
# metadata fields applicable at that location. This path-specific filtering is
64+
# useful when using the **Path policy** feature to determine which custom metadata
65+
# fields are selected for a given path.
6166
sig do
6267
params(
68+
folder_path: String,
6369
include_deleted: T::Boolean,
6470
request_options: Imagekit::RequestOptions::OrHash
6571
).returns(T::Array[Imagekit::CustomMetadataField])
6672
end
6773
def list(
74+
# The folder path (e.g., `/path/to/folder`) for which to retrieve applicable
75+
# custom metadata fields.
76+
# Useful for determining path-specific field selections when the
77+
# [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use.
78+
folder_path: nil,
6879
# Set it to `true` to include deleted field objects in the API response.
6980
include_deleted: nil,
7081
request_options: {}

sig/imagekit/models/beta/v2/file_upload_params.rbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ module Imagekit
169169
| :isPublished
170170
| :customMetadata
171171
| :metadata
172+
| :selectedFieldsSchema
172173

173174
module ResponseField
174175
extend Imagekit::Internal::Type::Enum
@@ -180,6 +181,7 @@ module Imagekit
180181
IS_PUBLISHED: :isPublished
181182
CUSTOM_METADATA: :customMetadata
182183
METADATA: :metadata
184+
SELECTED_FIELDS_SCHEMA: :selectedFieldsSchema
183185

184186
def self?.values: -> ::Array[Imagekit::Models::Beta::V2::FileUploadParams::response_field]
185187
end

0 commit comments

Comments
 (0)