Skip to content

Commit 70bca6b

Browse files
author
stlc-bot
committed
feat: add description field in custom metadata field api
Stainless-Generated-From: cb87d7b
1 parent a9edae6 commit 70bca6b

17 files changed

Lines changed: 57 additions & 1203 deletions

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 54
1+
configured_endpoints: 49

api.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ from imagekitio.types import (
77
Extensions,
88
GetImageAttributesOptions,
99
ImageOverlay,
10-
NamedTransformation,
1110
Overlay,
1211
OverlayPosition,
1312
OverlayTiming,
@@ -132,22 +131,6 @@ Methods:
132131
- <code title="delete /v1/saved-extensions/{id}">client.saved_extensions.<a href="./src/imagekitio/resources/saved_extensions.py">delete</a>(id) -> None</code>
133132
- <code title="get /v1/saved-extensions/{id}">client.saved_extensions.<a href="./src/imagekitio/resources/saved_extensions.py">get</a>(id) -> <a href="./src/imagekitio/types/shared/saved_extension.py">SavedExtension</a></code>
134133

135-
# NamedTransformations
136-
137-
Types:
138-
139-
```python
140-
from imagekitio.types import NamedTransformationListResponse
141-
```
142-
143-
Methods:
144-
145-
- <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>
146-
- <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>
147-
- <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>
149-
- <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>
150-
151134
# Assets
152135

153136
Types:

src/imagekitio/_client.py

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
folders,
4747
accounts,
4848
saved_extensions,
49-
named_transformations,
5049
custom_metadata_fields,
5150
)
5251
from .lib.helper import HelperResource, AsyncHelperResource
@@ -59,7 +58,6 @@
5958
from .resources.folders.folders import FoldersResource, AsyncFoldersResource
6059
from .resources.saved_extensions import SavedExtensionsResource, AsyncSavedExtensionsResource
6160
from .resources.accounts.accounts import AccountsResource, AsyncAccountsResource
62-
from .resources.named_transformations import NamedTransformationsResource, AsyncNamedTransformationsResource
6361
from .resources.custom_metadata_fields import CustomMetadataFieldsResource, AsyncCustomMetadataFieldsResource
6462

6563
__all__ = [
@@ -178,12 +176,6 @@ def saved_extensions(self) -> SavedExtensionsResource:
178176

179177
return SavedExtensionsResource(self)
180178

181-
@cached_property
182-
def named_transformations(self) -> NamedTransformationsResource:
183-
from .resources.named_transformations import NamedTransformationsResource
184-
185-
return NamedTransformationsResource(self)
186-
187179
@cached_property
188180
def assets(self) -> AssetsResource:
189181
from .resources.assets import AssetsResource
@@ -461,12 +453,6 @@ def saved_extensions(self) -> AsyncSavedExtensionsResource:
461453

462454
return AsyncSavedExtensionsResource(self)
463455

464-
@cached_property
465-
def named_transformations(self) -> AsyncNamedTransformationsResource:
466-
from .resources.named_transformations import AsyncNamedTransformationsResource
467-
468-
return AsyncNamedTransformationsResource(self)
469-
470456
@cached_property
471457
def assets(self) -> AsyncAssetsResource:
472458
from .resources.assets import AsyncAssetsResource
@@ -670,12 +656,6 @@ def saved_extensions(self) -> saved_extensions.SavedExtensionsResourceWithRawRes
670656

671657
return SavedExtensionsResourceWithRawResponse(self._client.saved_extensions)
672658

673-
@cached_property
674-
def named_transformations(self) -> named_transformations.NamedTransformationsResourceWithRawResponse:
675-
from .resources.named_transformations import NamedTransformationsResourceWithRawResponse
676-
677-
return NamedTransformationsResourceWithRawResponse(self._client.named_transformations)
678-
679659
@cached_property
680660
def assets(self) -> assets.AssetsResourceWithRawResponse:
681661
from .resources.assets import AssetsResourceWithRawResponse
@@ -737,12 +717,6 @@ def saved_extensions(self) -> saved_extensions.AsyncSavedExtensionsResourceWithR
737717

738718
return AsyncSavedExtensionsResourceWithRawResponse(self._client.saved_extensions)
739719

740-
@cached_property
741-
def named_transformations(self) -> named_transformations.AsyncNamedTransformationsResourceWithRawResponse:
742-
from .resources.named_transformations import AsyncNamedTransformationsResourceWithRawResponse
743-
744-
return AsyncNamedTransformationsResourceWithRawResponse(self._client.named_transformations)
745-
746720
@cached_property
747721
def assets(self) -> assets.AsyncAssetsResourceWithRawResponse:
748722
from .resources.assets import AsyncAssetsResourceWithRawResponse
@@ -804,12 +778,6 @@ def saved_extensions(self) -> saved_extensions.SavedExtensionsResourceWithStream
804778

805779
return SavedExtensionsResourceWithStreamingResponse(self._client.saved_extensions)
806780

807-
@cached_property
808-
def named_transformations(self) -> named_transformations.NamedTransformationsResourceWithStreamingResponse:
809-
from .resources.named_transformations import NamedTransformationsResourceWithStreamingResponse
810-
811-
return NamedTransformationsResourceWithStreamingResponse(self._client.named_transformations)
812-
813781
@cached_property
814782
def assets(self) -> assets.AssetsResourceWithStreamingResponse:
815783
from .resources.assets import AssetsResourceWithStreamingResponse
@@ -871,12 +839,6 @@ def saved_extensions(self) -> saved_extensions.AsyncSavedExtensionsResourceWithS
871839

872840
return AsyncSavedExtensionsResourceWithStreamingResponse(self._client.saved_extensions)
873841

874-
@cached_property
875-
def named_transformations(self) -> named_transformations.AsyncNamedTransformationsResourceWithStreamingResponse:
876-
from .resources.named_transformations import AsyncNamedTransformationsResourceWithStreamingResponse
877-
878-
return AsyncNamedTransformationsResourceWithStreamingResponse(self._client.named_transformations)
879-
880842
@cached_property
881843
def assets(self) -> assets.AsyncAssetsResourceWithStreamingResponse:
882844
from .resources.assets import AsyncAssetsResourceWithStreamingResponse

src/imagekitio/resources/__init__.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,6 @@
6969
SavedExtensionsResourceWithStreamingResponse,
7070
AsyncSavedExtensionsResourceWithStreamingResponse,
7171
)
72-
from .named_transformations import (
73-
NamedTransformationsResource,
74-
AsyncNamedTransformationsResource,
75-
NamedTransformationsResourceWithRawResponse,
76-
AsyncNamedTransformationsResourceWithRawResponse,
77-
NamedTransformationsResourceWithStreamingResponse,
78-
AsyncNamedTransformationsResourceWithStreamingResponse,
79-
)
8072
from .custom_metadata_fields import (
8173
CustomMetadataFieldsResource,
8274
AsyncCustomMetadataFieldsResource,
@@ -111,12 +103,6 @@
111103
"AsyncSavedExtensionsResourceWithRawResponse",
112104
"SavedExtensionsResourceWithStreamingResponse",
113105
"AsyncSavedExtensionsResourceWithStreamingResponse",
114-
"NamedTransformationsResource",
115-
"AsyncNamedTransformationsResource",
116-
"NamedTransformationsResourceWithRawResponse",
117-
"AsyncNamedTransformationsResourceWithRawResponse",
118-
"NamedTransformationsResourceWithStreamingResponse",
119-
"AsyncNamedTransformationsResourceWithStreamingResponse",
120106
"AssetsResource",
121107
"AsyncAssetsResource",
122108
"AssetsResourceWithRawResponse",

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
},

0 commit comments

Comments
 (0)