Skip to content

Commit 652957a

Browse files
author
stlc-bot
committed
Build SDK
Stainless-Generated-From: 3eaa450
1 parent 8167f14 commit 652957a

13 files changed

Lines changed: 159 additions & 83 deletions

api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,15 @@ Methods:
137137
Types:
138138

139139
```python
140-
from imagekitio.types import NamedTransformationListResponse
140+
from imagekitio.types import NamedTransformationListResponse, NamedTransformationDeleteResponse
141141
```
142142

143143
Methods:
144144

145145
- <code title="post /v1/named-transformations">client.named_transformations.<a href="./src/imagekitio/resources/named_transformations.py">create</a>(\*\*<a href="src/imagekitio/types/named_transformation_create_params.py">params</a>) -> <a href="./src/imagekitio/types/shared/named_transformation.py">NamedTransformation</a></code>
146146
- <code title="patch /v1/named-transformations/{id}">client.named_transformations.<a href="./src/imagekitio/resources/named_transformations.py">update</a>(id, \*\*<a href="src/imagekitio/types/named_transformation_update_params.py">params</a>) -> <a href="./src/imagekitio/types/shared/named_transformation.py">NamedTransformation</a></code>
147147
- <code title="get /v1/named-transformations">client.named_transformations.<a href="./src/imagekitio/resources/named_transformations.py">list</a>() -> <a href="./src/imagekitio/types/named_transformation_list_response.py">NamedTransformationListResponse</a></code>
148-
- <code title="delete /v1/named-transformations/{id}">client.named_transformations.<a href="./src/imagekitio/resources/named_transformations.py">delete</a>(id) -> <a href="./src/imagekitio/types/shared/named_transformation.py">NamedTransformation</a></code>
148+
- <code title="delete /v1/named-transformations/{id}">client.named_transformations.<a href="./src/imagekitio/resources/named_transformations.py">delete</a>(id) -> <a href="./src/imagekitio/types/named_transformation_delete_response.py">NamedTransformationDeleteResponse</a></code>
149149
- <code title="get /v1/named-transformations/{id}">client.named_transformations.<a href="./src/imagekitio/resources/named_transformations.py">get</a>(id) -> <a href="./src/imagekitio/types/shared/named_transformation.py">NamedTransformation</a></code>
150150

151151
# Assets

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/resources/named_transformations.py

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from .._base_client import make_request_options
1919
from ..types.shared.named_transformation import NamedTransformation
2020
from ..types.named_transformation_list_response import NamedTransformationListResponse
21+
from ..types.named_transformation_delete_response import NamedTransformationDeleteResponse
2122

2223
__all__ = ["NamedTransformationsResource", "AsyncNamedTransformationsResource"]
2324

@@ -71,15 +72,14 @@ def create(
7172
account. Name matching is case-sensitive.
7273
7374
transformation: The transformation string this name refers to, for example
74-
`w-150,h-150,fo-center,cm-resize`. The `tr:` prefix is optional — it's added
75-
automatically if missing, and validated if present. The string must be a valid
76-
ImageKit transformation and cannot itself reference another named transformation
77-
(no nesting). Learn more about the
75+
`w-150,h-150,fo-center,cm-resize`. The `tr:` prefix is optional; if present, it
76+
is validated. The string must be a valid ImageKit transformation and cannot
77+
itself reference another named transformation (no nesting). Learn more about the
7878
[transformation syntax](https://imagekit.io/docs/transformations).
7979
80-
enabled: Whether the named transformation is enabled. Set to `false` to disable it
81-
without deleting it; requests using a disabled named transformation fail at
82-
delivery time.
80+
enabled: Whether the named transformation is currently enabled. When this is set to
81+
`false`, requests using such disabled named transformations fail at delivery
82+
time.
8383
8484
extra_headers: Send extra headers
8585
@@ -130,6 +130,8 @@ def update(
130130
references in your own application code or in previously generated URLs.
131131
132132
Args:
133+
id: Unique identifier for a named transformation.
134+
133135
enabled: Whether the named transformation is enabled. Omit to leave the current value
134136
unchanged.
135137
@@ -138,10 +140,9 @@ def update(
138140
account. Name matching is case-sensitive.
139141
140142
transformation: The transformation string this name refers to, for example
141-
`w-150,h-150,fo-center,cm-resize`. The `tr:` prefix is optional — it's added
142-
automatically if missing, and validated if present. The string must be a valid
143-
ImageKit transformation and cannot itself reference another named transformation
144-
(no nesting). Learn more about the
143+
`w-150,h-150,fo-center,cm-resize`. The `tr:` prefix is optional; if present, it
144+
is validated. The string must be a valid ImageKit transformation and cannot
145+
itself reference another named transformation (no nesting). Learn more about the
145146
[transformation syntax](https://imagekit.io/docs/transformations).
146147
147148
extra_headers: Send extra headers
@@ -199,17 +200,18 @@ def delete(
199200
extra_query: Query | None = None,
200201
extra_body: Body | None = None,
201202
timeout: float | httpx.Timeout | None | NotGiven = not_given,
202-
) -> NamedTransformation:
203+
) -> NamedTransformationDeleteResponse:
203204
"""
204-
Permanently deletes the named transformation identified by `id` and returns the
205-
deleted object.
205+
Permanently deletes the named transformation identified by `id`.
206206
207207
Deletion fails with a `409` error if the named transformation is still
208208
referenced (via the `n-<name>` token) by an upload pre-transformation or
209209
post-transformation setting. This check is best-effort and can't detect
210210
references in your own application code or in previously generated URLs.
211211
212212
Args:
213+
id: Unique identifier for a named transformation.
214+
213215
extra_headers: Send extra headers
214216
215217
extra_query: Add additional query parameters to the request
@@ -225,7 +227,7 @@ def delete(
225227
options=make_request_options(
226228
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
227229
),
228-
cast_to=NamedTransformation,
230+
cast_to=NamedTransformationDeleteResponse,
229231
)
230232

231233
def get(
@@ -243,6 +245,8 @@ def get(
243245
Retrieves the named transformation identified by `id`.
244246
245247
Args:
248+
id: Unique identifier for a named transformation.
249+
246250
extra_headers: Send extra headers
247251
248252
extra_query: Add additional query parameters to the request
@@ -311,15 +315,14 @@ async def create(
311315
account. Name matching is case-sensitive.
312316
313317
transformation: The transformation string this name refers to, for example
314-
`w-150,h-150,fo-center,cm-resize`. The `tr:` prefix is optional — it's added
315-
automatically if missing, and validated if present. The string must be a valid
316-
ImageKit transformation and cannot itself reference another named transformation
317-
(no nesting). Learn more about the
318+
`w-150,h-150,fo-center,cm-resize`. The `tr:` prefix is optional; if present, it
319+
is validated. The string must be a valid ImageKit transformation and cannot
320+
itself reference another named transformation (no nesting). Learn more about the
318321
[transformation syntax](https://imagekit.io/docs/transformations).
319322
320-
enabled: Whether the named transformation is enabled. Set to `false` to disable it
321-
without deleting it; requests using a disabled named transformation fail at
322-
delivery time.
323+
enabled: Whether the named transformation is currently enabled. When this is set to
324+
`false`, requests using such disabled named transformations fail at delivery
325+
time.
323326
324327
extra_headers: Send extra headers
325328
@@ -370,6 +373,8 @@ async def update(
370373
references in your own application code or in previously generated URLs.
371374
372375
Args:
376+
id: Unique identifier for a named transformation.
377+
373378
enabled: Whether the named transformation is enabled. Omit to leave the current value
374379
unchanged.
375380
@@ -378,10 +383,9 @@ async def update(
378383
account. Name matching is case-sensitive.
379384
380385
transformation: The transformation string this name refers to, for example
381-
`w-150,h-150,fo-center,cm-resize`. The `tr:` prefix is optional — it's added
382-
automatically if missing, and validated if present. The string must be a valid
383-
ImageKit transformation and cannot itself reference another named transformation
384-
(no nesting). Learn more about the
386+
`w-150,h-150,fo-center,cm-resize`. The `tr:` prefix is optional; if present, it
387+
is validated. The string must be a valid ImageKit transformation and cannot
388+
itself reference another named transformation (no nesting). Learn more about the
385389
[transformation syntax](https://imagekit.io/docs/transformations).
386390
387391
extra_headers: Send extra headers
@@ -439,17 +443,18 @@ async def delete(
439443
extra_query: Query | None = None,
440444
extra_body: Body | None = None,
441445
timeout: float | httpx.Timeout | None | NotGiven = not_given,
442-
) -> NamedTransformation:
446+
) -> NamedTransformationDeleteResponse:
443447
"""
444-
Permanently deletes the named transformation identified by `id` and returns the
445-
deleted object.
448+
Permanently deletes the named transformation identified by `id`.
446449
447450
Deletion fails with a `409` error if the named transformation is still
448451
referenced (via the `n-<name>` token) by an upload pre-transformation or
449452
post-transformation setting. This check is best-effort and can't detect
450453
references in your own application code or in previously generated URLs.
451454
452455
Args:
456+
id: Unique identifier for a named transformation.
457+
453458
extra_headers: Send extra headers
454459
455460
extra_query: Add additional query parameters to the request
@@ -465,7 +470,7 @@ async def delete(
465470
options=make_request_options(
466471
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
467472
),
468-
cast_to=NamedTransformation,
473+
cast_to=NamedTransformationDeleteResponse,
469474
)
470475

471476
async def get(
@@ -483,6 +488,8 @@ async def get(
483488
Retrieves the named transformation identified by `id`.
484489
485490
Args:
491+
id: Unique identifier for a named transformation.
492+
486493
extra_headers: Send extra headers
487494
488495
extra_query: Add additional query parameters to the request

src/imagekitio/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
from .custom_metadata_field_update_params import CustomMetadataFieldUpdateParams as CustomMetadataFieldUpdateParams
8282
from .upload_post_transform_success_event import UploadPostTransformSuccessEvent as UploadPostTransformSuccessEvent
8383
from .video_transformation_accepted_event import VideoTransformationAcceptedEvent as VideoTransformationAcceptedEvent
84+
from .named_transformation_delete_response import NamedTransformationDeleteResponse as NamedTransformationDeleteResponse
8485
from .custom_metadata_field_delete_response import (
8586
CustomMetadataFieldDeleteResponse as CustomMetadataFieldDeleteResponse,
8687
)

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

src/imagekitio/types/named_transformation_create_params.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,15 @@ class NamedTransformationCreateParams(TypedDict, total=False):
1818
transformation: Required[str]
1919
"""
2020
The transformation string this name refers to, for example
21-
`w-150,h-150,fo-center,cm-resize`. The `tr:` prefix is optional — it's added
22-
automatically if missing, and validated if present. The string must be a valid
23-
ImageKit transformation and cannot itself reference another named transformation
24-
(no nesting). Learn more about the
21+
`w-150,h-150,fo-center,cm-resize`. The `tr:` prefix is optional; if present, it
22+
is validated. The string must be a valid ImageKit transformation and cannot
23+
itself reference another named transformation (no nesting). Learn more about the
2524
[transformation syntax](https://imagekit.io/docs/transformations).
2625
"""
2726

2827
enabled: bool
29-
"""Whether the named transformation is enabled.
28+
"""Whether the named transformation is currently enabled.
3029
31-
Set to `false` to disable it without deleting it; requests using a disabled
32-
named transformation fail at delivery time.
30+
When this is set to `false`, requests using such disabled named transformations
31+
fail at delivery time.
3332
"""
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .._models import BaseModel
4+
5+
__all__ = ["NamedTransformationDeleteResponse"]
6+
7+
8+
class NamedTransformationDeleteResponse(BaseModel):
9+
pass

0 commit comments

Comments
 (0)