Skip to content

Commit 23047c1

Browse files
feat(api): manual updates
1 parent 83d811b commit 23047c1

12 files changed

+158
-137
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-667f7f4988b44bc587d6eb9960ff5c8326e9f7e9b072f3f724f9f54166eff8b1.yml
33
openapi_spec_hash: f2081864a4abee0480e5ff991b4c936a
4-
config_hash: 4e73c7e12a531edcd1366dab7eccc360
4+
config_hash: 08e12746cdca1c59c897cf2e50893c3c

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ Types:
238238

239239
```python
240240
from imagekit.types import (
241+
BaseWebhookEvent,
241242
UploadPostTransformErrorEvent,
242243
UploadPostTransformSuccessEvent,
243244
UploadPreTransformErrorEvent,

src/imagekit/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from .file_copy_params import FileCopyParams as FileCopyParams
2929
from .file_move_params import FileMoveParams as FileMoveParams
3030
from .asset_list_params import AssetListParams as AssetListParams
31+
from .base_webhook_event import BaseWebhookEvent as BaseWebhookEvent
3132
from .file_copy_response import FileCopyResponse as FileCopyResponse
3233
from .file_move_response import FileMoveResponse as FileMoveResponse
3334
from .file_rename_params import FileRenameParams as FileRenameParams
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .._models import BaseModel
4+
5+
__all__ = ["BaseWebhookEvent"]
6+
7+
8+
class BaseWebhookEvent(BaseModel):
9+
id: str
10+
"""Unique identifier for the event."""
11+
12+
type: str
13+
"""The type of webhook event."""

src/imagekit/types/upload_post_transform_error_event.py

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,28 @@
77
from pydantic import Field as FieldInfo
88

99
from .._models import BaseModel
10+
from .base_webhook_event import BaseWebhookEvent
1011

1112
__all__ = [
1213
"UploadPostTransformErrorEvent",
13-
"Data",
14-
"DataTransformation",
15-
"DataTransformationError",
16-
"Request",
17-
"RequestTransformation",
14+
"UploadPostTransformErrorEventData",
15+
"UploadPostTransformErrorEventDataTransformation",
16+
"UploadPostTransformErrorEventDataTransformationError",
17+
"UploadPostTransformErrorEventRequest",
18+
"UploadPostTransformErrorEventRequestTransformation",
1819
]
1920

2021

21-
class DataTransformationError(BaseModel):
22+
class UploadPostTransformErrorEventDataTransformationError(BaseModel):
2223
reason: str
2324
"""Reason for the post-transformation failure."""
2425

2526

26-
class DataTransformation(BaseModel):
27-
error: DataTransformationError
27+
class UploadPostTransformErrorEventDataTransformation(BaseModel):
28+
error: UploadPostTransformErrorEventDataTransformationError
2829

2930

30-
class Data(BaseModel):
31+
class UploadPostTransformErrorEventData(BaseModel):
3132
file_id: str = FieldInfo(alias="fileId")
3233
"""Unique identifier of the originally uploaded file."""
3334

@@ -37,13 +38,13 @@ class Data(BaseModel):
3738
path: str
3839
"""Path of the file."""
3940

40-
transformation: DataTransformation
41+
transformation: UploadPostTransformErrorEventDataTransformation
4142

4243
url: str
4344
"""URL of the attempted post-transformation."""
4445

4546

46-
class RequestTransformation(BaseModel):
47+
class UploadPostTransformErrorEventRequestTransformation(BaseModel):
4748
type: Literal["transformation", "abs", "gif-to-video", "thumbnail"]
4849
"""Type of the requested post-transformation."""
4950

@@ -54,22 +55,19 @@ class RequestTransformation(BaseModel):
5455
"""Value for the requested transformation type."""
5556

5657

57-
class Request(BaseModel):
58-
transformation: RequestTransformation
58+
class UploadPostTransformErrorEventRequest(BaseModel):
59+
transformation: UploadPostTransformErrorEventRequestTransformation
5960

6061
x_request_id: str
6162
"""Unique identifier for the originating request."""
6263

6364

64-
class UploadPostTransformErrorEvent(BaseModel):
65-
id: str
66-
"""Unique identifier for the event."""
67-
65+
class UploadPostTransformErrorEvent(BaseWebhookEvent):
6866
created_at: datetime
6967
"""Timestamp of when the event occurred in ISO8601 format."""
7068

71-
data: Data
69+
data: UploadPostTransformErrorEventData
7270

73-
request: Request
71+
request: UploadPostTransformErrorEventRequest
7472

75-
type: Literal["upload.post-transform.error"]
73+
type: Literal["upload.post-transform.error"] # type: ignore

src/imagekit/types/upload_post_transform_success_event.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,17 @@
77
from pydantic import Field as FieldInfo
88

99
from .._models import BaseModel
10+
from .base_webhook_event import BaseWebhookEvent
1011

11-
__all__ = ["UploadPostTransformSuccessEvent", "Data", "Request", "RequestTransformation"]
12+
__all__ = [
13+
"UploadPostTransformSuccessEvent",
14+
"UploadPostTransformSuccessEventData",
15+
"UploadPostTransformSuccessEventRequest",
16+
"UploadPostTransformSuccessEventRequestTransformation",
17+
]
1218

1319

14-
class Data(BaseModel):
20+
class UploadPostTransformSuccessEventData(BaseModel):
1521
file_id: str = FieldInfo(alias="fileId")
1622
"""Unique identifier of the originally uploaded file."""
1723

@@ -22,7 +28,7 @@ class Data(BaseModel):
2228
"""URL of the generated post-transformation."""
2329

2430

25-
class RequestTransformation(BaseModel):
31+
class UploadPostTransformSuccessEventRequestTransformation(BaseModel):
2632
type: Literal["transformation", "abs", "gif-to-video", "thumbnail"]
2733
"""Type of the requested post-transformation."""
2834

@@ -33,22 +39,19 @@ class RequestTransformation(BaseModel):
3339
"""Value for the requested transformation type."""
3440

3541

36-
class Request(BaseModel):
37-
transformation: RequestTransformation
42+
class UploadPostTransformSuccessEventRequest(BaseModel):
43+
transformation: UploadPostTransformSuccessEventRequestTransformation
3844

3945
x_request_id: str
4046
"""Unique identifier for the originating request."""
4147

4248

43-
class UploadPostTransformSuccessEvent(BaseModel):
44-
id: str
45-
"""Unique identifier for the event."""
46-
49+
class UploadPostTransformSuccessEvent(BaseWebhookEvent):
4750
created_at: datetime
4851
"""Timestamp of when the event occurred in ISO8601 format."""
4952

50-
data: Data
53+
data: UploadPostTransformSuccessEventData
5154

52-
request: Request
55+
request: UploadPostTransformSuccessEventRequest
5356

54-
type: Literal["upload.post-transform.success"]
57+
type: Literal["upload.post-transform.success"] # type: ignore

src/imagekit/types/upload_pre_transform_error_event.py

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,46 +4,50 @@
44
from typing_extensions import Literal
55

66
from .._models import BaseModel
7+
from .base_webhook_event import BaseWebhookEvent
78

8-
__all__ = ["UploadPreTransformErrorEvent", "Data", "DataTransformation", "DataTransformationError", "Request"]
9+
__all__ = [
10+
"UploadPreTransformErrorEvent",
11+
"UploadPreTransformErrorEventData",
12+
"UploadPreTransformErrorEventDataTransformation",
13+
"UploadPreTransformErrorEventDataTransformationError",
14+
"UploadPreTransformErrorEventRequest",
15+
]
916

1017

11-
class DataTransformationError(BaseModel):
18+
class UploadPreTransformErrorEventDataTransformationError(BaseModel):
1219
reason: str
1320
"""Reason for the pre-transformation failure."""
1421

1522

16-
class DataTransformation(BaseModel):
17-
error: DataTransformationError
23+
class UploadPreTransformErrorEventDataTransformation(BaseModel):
24+
error: UploadPreTransformErrorEventDataTransformationError
1825

1926

20-
class Data(BaseModel):
27+
class UploadPreTransformErrorEventData(BaseModel):
2128
name: str
2229
"""Name of the file."""
2330

2431
path: str
2532
"""Path of the file."""
2633

27-
transformation: DataTransformation
34+
transformation: UploadPreTransformErrorEventDataTransformation
2835

2936

30-
class Request(BaseModel):
37+
class UploadPreTransformErrorEventRequest(BaseModel):
3138
transformation: str
3239
"""The requested pre-transformation string."""
3340

3441
x_request_id: str
3542
"""Unique identifier for the originating request."""
3643

3744

38-
class UploadPreTransformErrorEvent(BaseModel):
39-
id: str
40-
"""Unique identifier for the event."""
41-
45+
class UploadPreTransformErrorEvent(BaseWebhookEvent):
4246
created_at: datetime
4347
"""Timestamp of when the event occurred in ISO8601 format."""
4448

45-
data: Data
49+
data: UploadPreTransformErrorEventData
4650

47-
request: Request
51+
request: UploadPreTransformErrorEventRequest
4852

49-
type: Literal["upload.pre-transform.error"]
53+
type: Literal["upload.pre-transform.error"] # type: ignore

src/imagekit/types/upload_pre_transform_success_event.py

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,19 @@
88

99
from .._models import BaseModel
1010
from .metadata import Metadata
11+
from .base_webhook_event import BaseWebhookEvent
1112

12-
__all__ = ["UploadPreTransformSuccessEvent", "Data", "DataAITag", "DataExtensionStatus", "DataVersionInfo", "Request"]
13+
__all__ = [
14+
"UploadPreTransformSuccessEvent",
15+
"UploadPreTransformSuccessEventData",
16+
"UploadPreTransformSuccessEventDataAITag",
17+
"UploadPreTransformSuccessEventDataExtensionStatus",
18+
"UploadPreTransformSuccessEventDataVersionInfo",
19+
"UploadPreTransformSuccessEventRequest",
20+
]
1321

1422

15-
class DataAITag(BaseModel):
23+
class UploadPreTransformSuccessEventDataAITag(BaseModel):
1624
confidence: Optional[float] = None
1725
"""Confidence score of the tag."""
1826

@@ -27,7 +35,7 @@ class DataAITag(BaseModel):
2735
"""
2836

2937

30-
class DataExtensionStatus(BaseModel):
38+
class UploadPreTransformSuccessEventDataExtensionStatus(BaseModel):
3139
ai_auto_description: Optional[Literal["success", "pending", "failed"]] = FieldInfo(
3240
alias="ai-auto-description", default=None
3341
)
@@ -43,16 +51,16 @@ class DataExtensionStatus(BaseModel):
4351
remove_bg: Optional[Literal["success", "pending", "failed"]] = FieldInfo(alias="remove-bg", default=None)
4452

4553

46-
class DataVersionInfo(BaseModel):
54+
class UploadPreTransformSuccessEventDataVersionInfo(BaseModel):
4755
id: Optional[str] = None
4856
"""Unique identifier of the file version."""
4957

5058
name: Optional[str] = None
5159
"""Name of the file version."""
5260

5361

54-
class Data(BaseModel):
55-
ai_tags: Optional[List[DataAITag]] = FieldInfo(alias="AITags", default=None)
62+
class UploadPreTransformSuccessEventData(BaseModel):
63+
ai_tags: Optional[List[UploadPreTransformSuccessEventDataAITag]] = FieldInfo(alias="AITags", default=None)
5664
"""An array of tags assigned to the uploaded file by auto tagging."""
5765

5866
audio_codec: Optional[str] = FieldInfo(alias="audioCodec", default=None)
@@ -95,7 +103,9 @@ class Data(BaseModel):
95103
response.
96104
"""
97105

98-
extension_status: Optional[DataExtensionStatus] = FieldInfo(alias="extensionStatus", default=None)
106+
extension_status: Optional[UploadPreTransformSuccessEventDataExtensionStatus] = FieldInfo(
107+
alias="extensionStatus", default=None
108+
)
99109
"""
100110
Extension names with their processing status at the time of completion of the
101111
request. It could have one of the following status values:
@@ -167,7 +177,7 @@ class Data(BaseModel):
167177
url: Optional[str] = None
168178
"""A publicly accessible URL of the file."""
169179

170-
version_info: Optional[DataVersionInfo] = FieldInfo(alias="versionInfo", default=None)
180+
version_info: Optional[UploadPreTransformSuccessEventDataVersionInfo] = FieldInfo(alias="versionInfo", default=None)
171181
"""An object containing the file or file version's `id` (versionId) and `name`."""
172182

173183
video_codec: Optional[str] = FieldInfo(alias="videoCodec", default=None)
@@ -177,24 +187,21 @@ class Data(BaseModel):
177187
"""Width of the image in pixels (Only for Images)"""
178188

179189

180-
class Request(BaseModel):
190+
class UploadPreTransformSuccessEventRequest(BaseModel):
181191
transformation: str
182192
"""The requested pre-transformation string."""
183193

184194
x_request_id: str
185195
"""Unique identifier for the originating request."""
186196

187197

188-
class UploadPreTransformSuccessEvent(BaseModel):
189-
id: str
190-
"""Unique identifier for the event."""
191-
198+
class UploadPreTransformSuccessEvent(BaseWebhookEvent):
192199
created_at: datetime
193200
"""Timestamp of when the event occurred in ISO8601 format."""
194201

195-
data: Data
202+
data: UploadPreTransformSuccessEventData
196203
"""Object containing details of a successful upload."""
197204

198-
request: Request
205+
request: UploadPreTransformSuccessEventRequest
199206

200-
type: Literal["upload.pre-transform.success"]
207+
type: Literal["upload.pre-transform.success"] # type: ignore

0 commit comments

Comments
 (0)