Skip to content

Commit 49ca430

Browse files
feat(api): manual updates
1 parent 5b013ab commit 49ca430

File tree

12 files changed

+183
-196
lines changed

12 files changed

+183
-196
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 42
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-0470196862abd722b09f1af798d6f2bcbdeba0f82d1162f57c287b1a43233531.yml
33
openapi_spec_hash: 043dd7c67d741d0034b86f2fc0bce072
4-
config_hash: 70f9408b8d1dfbcf262a20d6eed50e1c
4+
config_hash: da949a1217f48ac01676eab81ca9d1b1

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
```python
44
from imagekit.types import (
55
BaseOverlay,
6+
Extensions,
67
ImageOverlay,
78
Overlay,
89
OverlayPosition,

src/imagekit/resources/beta/v2/files.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, List, Mapping, Iterable, cast
5+
from typing import Dict, List, Mapping, cast
66
from typing_extensions import Literal
77

88
import httpx
@@ -19,6 +19,7 @@
1919
)
2020
from ...._base_client import make_request_options
2121
from ....types.beta.v2 import file_upload_params
22+
from ....types.shared_params.extensions import Extensions
2223
from ....types.beta.v2.file_upload_response import FileUploadResponse
2324

2425
__all__ = ["FilesResource", "AsyncFilesResource"]
@@ -54,7 +55,7 @@ def upload(
5455
custom_coordinates: str | NotGiven = NOT_GIVEN,
5556
custom_metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
5657
description: str | NotGiven = NOT_GIVEN,
57-
extensions: Iterable[file_upload_params.Extension] | NotGiven = NOT_GIVEN,
58+
extensions: Extensions | NotGiven = NOT_GIVEN,
5859
folder: str | NotGiven = NOT_GIVEN,
5960
is_private_file: bool | NotGiven = NOT_GIVEN,
6061
is_published: bool | NotGiven = NOT_GIVEN,
@@ -306,7 +307,7 @@ async def upload(
306307
custom_coordinates: str | NotGiven = NOT_GIVEN,
307308
custom_metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
308309
description: str | NotGiven = NOT_GIVEN,
309-
extensions: Iterable[file_upload_params.Extension] | NotGiven = NOT_GIVEN,
310+
extensions: Extensions | NotGiven = NOT_GIVEN,
310311
folder: str | NotGiven = NOT_GIVEN,
311312
is_private_file: bool | NotGiven = NOT_GIVEN,
312313
is_published: bool | NotGiven = NOT_GIVEN,

src/imagekit/resources/files/files.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, List, Mapping, Iterable, cast
5+
from typing import Dict, List, Mapping, cast
66
from typing_extensions import Literal
77

88
import httpx
@@ -15,7 +15,13 @@
1515
BulkResourceWithStreamingResponse,
1616
AsyncBulkResourceWithStreamingResponse,
1717
)
18-
from ...types import file_copy_params, file_move_params, file_rename_params, file_update_params, file_upload_params
18+
from ...types import (
19+
file_copy_params,
20+
file_move_params,
21+
file_rename_params,
22+
file_update_params,
23+
file_upload_params,
24+
)
1925
from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, FileTypes, SequenceNotStr
2026
from ..._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
2127
from .metadata import (
@@ -49,6 +55,7 @@
4955
from ...types.file_rename_response import FileRenameResponse
5056
from ...types.file_update_response import FileUpdateResponse
5157
from ...types.file_upload_response import FileUploadResponse
58+
from ...types.shared_params.extensions import Extensions
5259

5360
__all__ = ["FilesResource", "AsyncFilesResource"]
5461

@@ -376,7 +383,7 @@ def upload(
376383
custom_metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
377384
description: str | NotGiven = NOT_GIVEN,
378385
expire: int | NotGiven = NOT_GIVEN,
379-
extensions: Iterable[file_upload_params.Extension] | NotGiven = NOT_GIVEN,
386+
extensions: Extensions | NotGiven = NOT_GIVEN,
380387
folder: str | NotGiven = NOT_GIVEN,
381388
is_private_file: bool | NotGiven = NOT_GIVEN,
382389
is_published: bool | NotGiven = NOT_GIVEN,
@@ -947,7 +954,7 @@ async def upload(
947954
custom_metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
948955
description: str | NotGiven = NOT_GIVEN,
949956
expire: int | NotGiven = NOT_GIVEN,
950-
extensions: Iterable[file_upload_params.Extension] | NotGiven = NOT_GIVEN,
957+
extensions: Extensions | NotGiven = NOT_GIVEN,
951958
folder: str | NotGiven = NOT_GIVEN,
952959
is_private_file: bool | NotGiven = NOT_GIVEN,
953960
is_published: bool | NotGiven = NOT_GIVEN,

src/imagekit/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from .folder import Folder as Folder
99
from .shared import (
1010
Overlay as Overlay,
11+
Extensions as Extensions,
1112
SrcOptions as SrcOptions,
1213
BaseOverlay as BaseOverlay,
1314
TextOverlay as TextOverlay,

src/imagekit/types/beta/v2/file_upload_params.py

Lines changed: 2 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@
77

88
from ...._types import FileTypes, SequenceNotStr
99
from ...._utils import PropertyInfo
10+
from ...shared_params.extensions import Extensions
1011

1112
__all__ = [
1213
"FileUploadParams",
13-
"Extension",
14-
"ExtensionRemoveBg",
15-
"ExtensionRemoveBgOptions",
16-
"ExtensionAutoTaggingExtension",
17-
"ExtensionAIAutoDescription",
1814
"Transformation",
1915
"TransformationPost",
2016
"TransformationPostTransformation",
@@ -85,7 +81,7 @@ class FileUploadParams(TypedDict, total=False):
8581
description: str
8682
"""Optional text to describe the contents of the file."""
8783

88-
extensions: Iterable[Extension]
84+
extensions: Extensions
8985
"""Array of extensions to be applied to the asset.
9086
9187
Each extension can be configured with specific parameters based on the extension
@@ -198,61 +194,6 @@ class FileUploadParams(TypedDict, total=False):
198194
"""
199195

200196

201-
class ExtensionRemoveBgOptions(TypedDict, total=False):
202-
add_shadow: bool
203-
"""Whether to add an artificial shadow to the result.
204-
205-
Default is false. Note: Adding shadows is currently only supported for car
206-
photos.
207-
"""
208-
209-
bg_color: str
210-
"""
211-
Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or
212-
color name (e.g., "green"). If this parameter is set, `bg_image_url` must be
213-
empty.
214-
"""
215-
216-
bg_image_url: str
217-
"""Sets a background image from a URL.
218-
219-
If this parameter is set, `bg_color` must be empty.
220-
"""
221-
222-
semitransparency: bool
223-
"""Allows semi-transparent regions in the result.
224-
225-
Default is true. Note: Semitransparency is currently only supported for car
226-
windows.
227-
"""
228-
229-
230-
class ExtensionRemoveBg(TypedDict, total=False):
231-
name: Required[Literal["remove-bg"]]
232-
"""Specifies the background removal extension."""
233-
234-
options: ExtensionRemoveBgOptions
235-
236-
237-
class ExtensionAutoTaggingExtension(TypedDict, total=False):
238-
max_tags: Required[Annotated[int, PropertyInfo(alias="maxTags")]]
239-
"""Maximum number of tags to attach to the asset."""
240-
241-
min_confidence: Required[Annotated[int, PropertyInfo(alias="minConfidence")]]
242-
"""Minimum confidence level for tags to be considered valid."""
243-
244-
name: Required[Literal["google-auto-tagging", "aws-auto-tagging"]]
245-
"""Specifies the auto-tagging extension used."""
246-
247-
248-
class ExtensionAIAutoDescription(TypedDict, total=False):
249-
name: Required[Literal["ai-auto-description"]]
250-
"""Specifies the auto description extension."""
251-
252-
253-
Extension: TypeAlias = Union[ExtensionRemoveBg, ExtensionAutoTaggingExtension, ExtensionAIAutoDescription]
254-
255-
256197
class TransformationPostTransformation(TypedDict, total=False):
257198
type: Required[Literal["transformation"]]
258199
"""Transformation type."""

src/imagekit/types/file_update_params.py

Lines changed: 3 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,17 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Union, Iterable, Optional
5+
from typing import Dict, Union, Optional
66
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
77

88
from .._types import SequenceNotStr
99
from .._utils import PropertyInfo
10+
from .shared_params.extensions import Extensions
1011

1112
__all__ = [
1213
"FileUpdateParams",
1314
"Update",
1415
"UpdateUpdateFileDetails",
15-
"UpdateUpdateFileDetailsExtension",
16-
"UpdateUpdateFileDetailsExtensionRemoveBg",
17-
"UpdateUpdateFileDetailsExtensionRemoveBgOptions",
18-
"UpdateUpdateFileDetailsExtensionAutoTaggingExtension",
19-
"UpdateUpdateFileDetailsExtensionAIAutoDescription",
2016
"UpdateChangePublicationStatus",
2117
"UpdateChangePublicationStatusPublish",
2218
]
@@ -26,65 +22,6 @@ class FileUpdateParams(TypedDict, total=False):
2622
update: Update
2723

2824

29-
class UpdateUpdateFileDetailsExtensionRemoveBgOptions(TypedDict, total=False):
30-
add_shadow: bool
31-
"""Whether to add an artificial shadow to the result.
32-
33-
Default is false. Note: Adding shadows is currently only supported for car
34-
photos.
35-
"""
36-
37-
bg_color: str
38-
"""
39-
Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or
40-
color name (e.g., "green"). If this parameter is set, `bg_image_url` must be
41-
empty.
42-
"""
43-
44-
bg_image_url: str
45-
"""Sets a background image from a URL.
46-
47-
If this parameter is set, `bg_color` must be empty.
48-
"""
49-
50-
semitransparency: bool
51-
"""Allows semi-transparent regions in the result.
52-
53-
Default is true. Note: Semitransparency is currently only supported for car
54-
windows.
55-
"""
56-
57-
58-
class UpdateUpdateFileDetailsExtensionRemoveBg(TypedDict, total=False):
59-
name: Required[Literal["remove-bg"]]
60-
"""Specifies the background removal extension."""
61-
62-
options: UpdateUpdateFileDetailsExtensionRemoveBgOptions
63-
64-
65-
class UpdateUpdateFileDetailsExtensionAutoTaggingExtension(TypedDict, total=False):
66-
max_tags: Required[Annotated[int, PropertyInfo(alias="maxTags")]]
67-
"""Maximum number of tags to attach to the asset."""
68-
69-
min_confidence: Required[Annotated[int, PropertyInfo(alias="minConfidence")]]
70-
"""Minimum confidence level for tags to be considered valid."""
71-
72-
name: Required[Literal["google-auto-tagging", "aws-auto-tagging"]]
73-
"""Specifies the auto-tagging extension used."""
74-
75-
76-
class UpdateUpdateFileDetailsExtensionAIAutoDescription(TypedDict, total=False):
77-
name: Required[Literal["ai-auto-description"]]
78-
"""Specifies the auto description extension."""
79-
80-
81-
UpdateUpdateFileDetailsExtension: TypeAlias = Union[
82-
UpdateUpdateFileDetailsExtensionRemoveBg,
83-
UpdateUpdateFileDetailsExtensionAutoTaggingExtension,
84-
UpdateUpdateFileDetailsExtensionAIAutoDescription,
85-
]
86-
87-
8825
class UpdateUpdateFileDetails(TypedDict, total=False):
8926
custom_coordinates: Annotated[Optional[str], PropertyInfo(alias="customCoordinates")]
9027
"""Define an important area in the image in the format `x,y,width,height` e.g.
@@ -103,7 +40,7 @@ class UpdateUpdateFileDetails(TypedDict, total=False):
10340
description: str
10441
"""Optional text to describe the contents of the file."""
10542

106-
extensions: Iterable[UpdateUpdateFileDetailsExtension]
43+
extensions: Extensions
10744
"""Array of extensions to be applied to the asset.
10845
10946
Each extension can be configured with specific parameters based on the extension

src/imagekit/types/file_upload_params.py

Lines changed: 2 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@
77

88
from .._types import FileTypes, SequenceNotStr
99
from .._utils import PropertyInfo
10+
from .shared_params.extensions import Extensions
1011

1112
__all__ = [
1213
"FileUploadParams",
13-
"Extension",
14-
"ExtensionRemoveBg",
15-
"ExtensionRemoveBgOptions",
16-
"ExtensionAutoTaggingExtension",
17-
"ExtensionAIAutoDescription",
1814
"Transformation",
1915
"TransformationPost",
2016
"TransformationPostTransformation",
@@ -94,7 +90,7 @@ class FileUploadParams(TypedDict, total=False):
9490
authentication when uploading a file from the client side.
9591
"""
9692

97-
extensions: Iterable[Extension]
93+
extensions: Extensions
9894
"""Array of extensions to be applied to the asset.
9995
10096
Each extension can be configured with specific parameters based on the extension
@@ -230,61 +226,6 @@ class FileUploadParams(TypedDict, total=False):
230226
"""
231227

232228

233-
class ExtensionRemoveBgOptions(TypedDict, total=False):
234-
add_shadow: bool
235-
"""Whether to add an artificial shadow to the result.
236-
237-
Default is false. Note: Adding shadows is currently only supported for car
238-
photos.
239-
"""
240-
241-
bg_color: str
242-
"""
243-
Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or
244-
color name (e.g., "green"). If this parameter is set, `bg_image_url` must be
245-
empty.
246-
"""
247-
248-
bg_image_url: str
249-
"""Sets a background image from a URL.
250-
251-
If this parameter is set, `bg_color` must be empty.
252-
"""
253-
254-
semitransparency: bool
255-
"""Allows semi-transparent regions in the result.
256-
257-
Default is true. Note: Semitransparency is currently only supported for car
258-
windows.
259-
"""
260-
261-
262-
class ExtensionRemoveBg(TypedDict, total=False):
263-
name: Required[Literal["remove-bg"]]
264-
"""Specifies the background removal extension."""
265-
266-
options: ExtensionRemoveBgOptions
267-
268-
269-
class ExtensionAutoTaggingExtension(TypedDict, total=False):
270-
max_tags: Required[Annotated[int, PropertyInfo(alias="maxTags")]]
271-
"""Maximum number of tags to attach to the asset."""
272-
273-
min_confidence: Required[Annotated[int, PropertyInfo(alias="minConfidence")]]
274-
"""Minimum confidence level for tags to be considered valid."""
275-
276-
name: Required[Literal["google-auto-tagging", "aws-auto-tagging"]]
277-
"""Specifies the auto-tagging extension used."""
278-
279-
280-
class ExtensionAIAutoDescription(TypedDict, total=False):
281-
name: Required[Literal["ai-auto-description"]]
282-
"""Specifies the auto description extension."""
283-
284-
285-
Extension: TypeAlias = Union[ExtensionRemoveBg, ExtensionAutoTaggingExtension, ExtensionAIAutoDescription]
286-
287-
288229
class TransformationPostTransformation(TypedDict, total=False):
289230
type: Required[Literal["transformation"]]
290231
"""Transformation type."""

src/imagekit/types/shared/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from .overlay import Overlay as Overlay
4+
from .extensions import Extensions as Extensions
45
from .src_options import SrcOptions as SrcOptions
56
from .base_overlay import BaseOverlay as BaseOverlay
67
from .text_overlay import TextOverlay as TextOverlay

0 commit comments

Comments
 (0)