Skip to content

Commit 44f88d8

Browse files
author
stlc-bot
committed
Build SDK
Stainless-Generated-From: a63c852
1 parent 85d2edf commit 44f88d8

5 files changed

Lines changed: 56 additions & 2 deletions

File tree

src/imagekitio/resources/custom_metadata_fields.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def create(
5353
label: str,
5454
name: str,
5555
schema: custom_metadata_field_create_params.Schema,
56+
description: str | Omit = omit,
5657
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5758
# The extra values given here take precedence over values defined on the client or passed to this method.
5859
extra_headers: Headers | None = None,
@@ -76,6 +77,10 @@ def create(
7677
name: API name of the custom metadata field. This should be unique across all
7778
(including deleted) custom metadata fields.
7879
80+
description: Optional description for the custom metadata field. Can be up to 500 characters.
81+
This is shown as a hint to the users while setting the field's value on an asset
82+
in the media library UI.
83+
7984
extra_headers: Send extra headers
8085
8186
extra_query: Add additional query parameters to the request
@@ -91,6 +96,7 @@ def create(
9196
"label": label,
9297
"name": name,
9398
"schema": schema,
99+
"description": description,
94100
},
95101
custom_metadata_field_create_params.CustomMetadataFieldCreateParams,
96102
),
@@ -104,6 +110,7 @@ def update(
104110
self,
105111
id: str,
106112
*,
113+
description: str | Omit = omit,
107114
label: str | Omit = omit,
108115
schema: custom_metadata_field_update_params.Schema | Omit = omit,
109116
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -114,9 +121,15 @@ def update(
114121
timeout: float | httpx.Timeout | None | NotGiven = not_given,
115122
) -> CustomMetadataField:
116123
"""
117-
This API updates the label or schema of an existing custom metadata field.
124+
This API updates the label, description, or schema of an existing custom
125+
metadata field.
118126
119127
Args:
128+
description: Optional description for the custom metadata field. Can be up to 500 characters.
129+
Send an empty string to clear an existing description. This is shown as a hint
130+
to the users while setting the field's value on an asset in the media library
131+
UI.
132+
120133
label: Human readable name of the custom metadata field. This should be unique across
121134
all non deleted custom metadata fields. This name is displayed as form field
122135
label to the users while setting field value on an asset in the media library
@@ -141,6 +154,7 @@ def update(
141154
path_template("/v1/customMetadataFields/{id}", id=id),
142155
body=maybe_transform(
143156
{
157+
"description": description,
144158
"label": label,
145159
"schema": schema,
146160
},
@@ -271,6 +285,7 @@ async def create(
271285
label: str,
272286
name: str,
273287
schema: custom_metadata_field_create_params.Schema,
288+
description: str | Omit = omit,
274289
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
275290
# The extra values given here take precedence over values defined on the client or passed to this method.
276291
extra_headers: Headers | None = None,
@@ -294,6 +309,10 @@ async def create(
294309
name: API name of the custom metadata field. This should be unique across all
295310
(including deleted) custom metadata fields.
296311
312+
description: Optional description for the custom metadata field. Can be up to 500 characters.
313+
This is shown as a hint to the users while setting the field's value on an asset
314+
in the media library UI.
315+
297316
extra_headers: Send extra headers
298317
299318
extra_query: Add additional query parameters to the request
@@ -309,6 +328,7 @@ async def create(
309328
"label": label,
310329
"name": name,
311330
"schema": schema,
331+
"description": description,
312332
},
313333
custom_metadata_field_create_params.CustomMetadataFieldCreateParams,
314334
),
@@ -322,6 +342,7 @@ async def update(
322342
self,
323343
id: str,
324344
*,
345+
description: str | Omit = omit,
325346
label: str | Omit = omit,
326347
schema: custom_metadata_field_update_params.Schema | Omit = omit,
327348
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -332,9 +353,15 @@ async def update(
332353
timeout: float | httpx.Timeout | None | NotGiven = not_given,
333354
) -> CustomMetadataField:
334355
"""
335-
This API updates the label or schema of an existing custom metadata field.
356+
This API updates the label, description, or schema of an existing custom
357+
metadata field.
336358
337359
Args:
360+
description: Optional description for the custom metadata field. Can be up to 500 characters.
361+
Send an empty string to clear an existing description. This is shown as a hint
362+
to the users while setting the field's value on an asset in the media library
363+
UI.
364+
338365
label: Human readable name of the custom metadata field. This should be unique across
339366
all non deleted custom metadata fields. This name is displayed as form field
340367
label to the users while setting field value on an asset in the media library
@@ -359,6 +386,7 @@ async def update(
359386
path_template("/v1/customMetadataFields/{id}", id=id),
360387
body=await async_maybe_transform(
361388
{
389+
"description": description,
362390
"label": label,
363391
"schema": schema,
364392
},

src/imagekitio/types/custom_metadata_field.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,10 @@ class CustomMetadataField(BaseModel):
7575

7676
schema_: Schema = FieldInfo(alias="schema")
7777
"""An object that describes the rules for the custom metadata field value."""
78+
79+
description: Optional[str] = None
80+
"""Optional description of the custom metadata field.
81+
82+
Only present when a description has been set. Shown as a hint to the users while
83+
setting the field's value on an asset in the media library UI.
84+
"""

src/imagekitio/types/custom_metadata_field_create_params.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ class CustomMetadataFieldCreateParams(TypedDict, total=False):
2828

2929
schema: Required[Schema]
3030

31+
description: str
32+
"""Optional description for the custom metadata field.
33+
34+
Can be up to 500 characters. This is shown as a hint to the users while setting
35+
the field's value on an asset in the media library UI.
36+
"""
37+
3138

3239
class Schema(TypedDict, total=False):
3340
type: Required[Literal["Text", "Textarea", "Number", "Date", "Boolean", "SingleSelect", "MultiSelect"]]

src/imagekitio/types/custom_metadata_field_update_params.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212

1313

1414
class CustomMetadataFieldUpdateParams(TypedDict, total=False):
15+
description: str
16+
"""Optional description for the custom metadata field.
17+
18+
Can be up to 500 characters. Send an empty string to clear an existing
19+
description. This is shown as a hint to the users while setting the field's
20+
value on an asset in the media library UI.
21+
"""
22+
1523
label: str
1624
"""Human readable name of the custom metadata field.
1725

tests/api_resources/test_custom_metadata_fields.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def test_method_create_with_all_params(self, client: ImageKit) -> None:
4747
"min_value": 1000,
4848
"select_options": ["small", "medium", "large", 30, 40, True],
4949
},
50+
description="description",
5051
)
5152
assert_matches_type(CustomMetadataField, custom_metadata_field, path=["response"])
5253

@@ -93,6 +94,7 @@ def test_method_update(self, client: ImageKit) -> None:
9394
def test_method_update_with_all_params(self, client: ImageKit) -> None:
9495
custom_metadata_field = client.custom_metadata_fields.update(
9596
id="id",
97+
description="description",
9698
label="price",
9799
schema={
98100
"default_value": [True, 10, "Hello"],
@@ -251,6 +253,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncImageKit)
251253
"min_value": 1000,
252254
"select_options": ["small", "medium", "large", 30, 40, True],
253255
},
256+
description="description",
254257
)
255258
assert_matches_type(CustomMetadataField, custom_metadata_field, path=["response"])
256259

@@ -297,6 +300,7 @@ async def test_method_update(self, async_client: AsyncImageKit) -> None:
297300
async def test_method_update_with_all_params(self, async_client: AsyncImageKit) -> None:
298301
custom_metadata_field = await async_client.custom_metadata_fields.update(
299302
id="id",
303+
description="description",
300304
label="price",
301305
schema={
302306
"default_value": [True, 10, "Hello"],

0 commit comments

Comments
 (0)