Skip to content

Commit 9dcc234

Browse files
fix(api): extract shared schemas to prevent Go webhook union breaking changes
1 parent bc9d18e commit 9dcc234

File tree

5 files changed

+41
-20
lines changed

5 files changed

+41
-20
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 48
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d73a37dc3426586109bd153f02c6a605036b6a7396bba5173d013468c5291ce6.yml
3-
openapi_spec_hash: c193c6e557ff477481ec8d5ac8a0c96e
4-
config_hash: 32b155378f65c234d3abeb18519fb3cd
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-7c4c23556be689ded6bcafd05e1645b82239521c9c841c0f7e76336e2eefcffa.yml
3+
openapi_spec_hash: eca5b039a0066c6536296248c3a80854
4+
config_hash: e3c2679d25f6235381dfb11962fbf3d9

src/imagekitio/types/beta/v2/file_upload_response.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ class AITag(BaseModel):
1919
"""Name of the tag."""
2020

2121
source: Optional[str] = None
22-
"""Array of `AITags` associated with the image.
22+
"""Source of the tag.
2323
24-
If no `AITags` are set, it will be null. These tags can be added using the
25-
`google-auto-tagging` or `aws-auto-tagging` extensions.
24+
Possible values are `google-auto-tagging` and `aws-auto-tagging`.
2625
"""
2726

2827

@@ -122,7 +121,11 @@ class FileUploadResponse(BaseModel):
122121
"""Object containing details of a successful upload."""
123122

124123
ai_tags: Optional[List[AITag]] = FieldInfo(alias="AITags", default=None)
125-
"""An array of tags assigned to the uploaded file by auto tagging."""
124+
"""Array of `AITags` associated with the image.
125+
126+
If no `AITags` are set, it will be null. These tags can be added using the
127+
`google-auto-tagging` or `aws-auto-tagging` extensions.
128+
"""
126129

127130
audio_codec: Optional[str] = FieldInfo(alias="audioCodec", default=None)
128131
"""The audio codec used in the video (only for video)."""

src/imagekitio/types/file.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class SelectedFieldsSchema(BaseModel):
8080

8181

8282
class VersionInfo(BaseModel):
83-
"""An object with details of the file version."""
83+
"""An object containing the file or file version's `id` (versionId) and `name`."""
8484

8585
id: Optional[str] = None
8686
"""Unique identifier of the file version."""
@@ -93,7 +93,11 @@ class File(BaseModel):
9393
"""Object containing details of a file or file version."""
9494

9595
ai_tags: Optional[List[AITag]] = FieldInfo(alias="AITags", default=None)
96-
"""An array of tags assigned to the file by auto tagging."""
96+
"""Array of `AITags` associated with the image.
97+
98+
If no `AITags` are set, it will be null. These tags can be added using the
99+
`google-auto-tagging` or `aws-auto-tagging` extensions.
100+
"""
97101

98102
audio_codec: Optional[str] = FieldInfo(alias="audioCodec", default=None)
99103
"""The audio codec used in the video (only for video/audio)."""
@@ -111,7 +115,13 @@ class File(BaseModel):
111115
"""An string with custom coordinates of the file."""
112116

113117
custom_metadata: Optional[Dict[str, object]] = FieldInfo(alias="customMetadata", default=None)
114-
"""An object with custom metadata for the file."""
118+
"""A key-value data associated with the asset.
119+
120+
Use `responseField` in API request to get `customMetadata` in the upload API
121+
response. Before setting any custom metadata on an asset, you have to create the
122+
field using custom metadata fields API. Send `customMetadata` in
123+
`responseFields` in API request to get the value of this field.
124+
"""
115125

116126
description: Optional[str] = None
117127
"""Optional text to describe the contents of the file.
@@ -125,7 +135,9 @@ class File(BaseModel):
125135
embedded_metadata: Optional[Dict[str, object]] = FieldInfo(alias="embeddedMetadata", default=None)
126136
"""Consolidated embedded metadata associated with the file.
127137
128-
It includes exif, iptc, and xmp data.
138+
It includes exif, iptc, and xmp data. Send `embeddedMetadata` in
139+
`responseFields` in API request to get embeddedMetadata in the upload API
140+
response.
129141
"""
130142

131143
file_id: Optional[str] = FieldInfo(alias="fileId", default=None)
@@ -201,7 +213,7 @@ class File(BaseModel):
201213
"""URL of the file."""
202214

203215
version_info: Optional[VersionInfo] = FieldInfo(alias="versionInfo", default=None)
204-
"""An object with details of the file version."""
216+
"""An object containing the file or file version's `id` (versionId) and `name`."""
205217

206218
video_codec: Optional[str] = FieldInfo(alias="videoCodec", default=None)
207219
"""The video codec used in the video (only for video)."""

src/imagekitio/types/file_upload_response.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ class AITag(BaseModel):
1919
"""Name of the tag."""
2020

2121
source: Optional[str] = None
22-
"""Array of `AITags` associated with the image.
22+
"""Source of the tag.
2323
24-
If no `AITags` are set, it will be null. These tags can be added using the
25-
`google-auto-tagging` or `aws-auto-tagging` extensions.
24+
Possible values are `google-auto-tagging` and `aws-auto-tagging`.
2625
"""
2726

2827

@@ -122,7 +121,11 @@ class FileUploadResponse(BaseModel):
122121
"""Object containing details of a successful upload."""
123122

124123
ai_tags: Optional[List[AITag]] = FieldInfo(alias="AITags", default=None)
125-
"""An array of tags assigned to the uploaded file by auto tagging."""
124+
"""Array of `AITags` associated with the image.
125+
126+
If no `AITags` are set, it will be null. These tags can be added using the
127+
`google-auto-tagging` or `aws-auto-tagging` extensions.
128+
"""
126129

127130
audio_codec: Optional[str] = FieldInfo(alias="audioCodec", default=None)
128131
"""The audio codec used in the video (only for video)."""

src/imagekitio/types/upload_pre_transform_success_event.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ class UploadPreTransformSuccessEventDataAITag(BaseModel):
2929
"""Name of the tag."""
3030

3131
source: Optional[str] = None
32-
"""Array of `AITags` associated with the image.
32+
"""Source of the tag.
3333
34-
If no `AITags` are set, it will be null. These tags can be added using the
35-
`google-auto-tagging` or `aws-auto-tagging` extensions.
34+
Possible values are `google-auto-tagging` and `aws-auto-tagging`.
3635
"""
3736

3837

@@ -132,7 +131,11 @@ class UploadPreTransformSuccessEventData(BaseModel):
132131
"""Object containing details of a successful upload."""
133132

134133
ai_tags: Optional[List[UploadPreTransformSuccessEventDataAITag]] = FieldInfo(alias="AITags", default=None)
135-
"""An array of tags assigned to the uploaded file by auto tagging."""
134+
"""Array of `AITags` associated with the image.
135+
136+
If no `AITags` are set, it will be null. These tags can be added using the
137+
`google-auto-tagging` or `aws-auto-tagging` extensions.
138+
"""
136139

137140
audio_codec: Optional[str] = FieldInfo(alias="audioCodec", default=None)
138141
"""The audio codec used in the video (only for video)."""

0 commit comments

Comments
 (0)