Skip to content

Commit 80d5f3b

Browse files
feat(api): extract UpdateFileDetailsRequest to model
1 parent 6a41ff5 commit 80d5f3b

File tree

4 files changed

+91
-1
lines changed

4 files changed

+91
-1
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-bc7c0d27962b30c19c778656988e154b54696819389289f34420a5e5fdfbd3b8.yml
33
openapi_spec_hash: 1bfde02a63416c036e9545927f727459
4-
config_hash: a652d68098d82eaf611a49507fb4b831
4+
config_hash: b415c06a3b29485af4601beb94ae1aeb

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ from imagekit.types import (
5050
File,
5151
Folder,
5252
Metadata,
53+
UpdateFileDetailsRequest,
5354
FileUpdateResponse,
5455
FileCopyResponse,
5556
FileMoveResponse,

src/imagekit/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
from .video_transformation_error_event import VideoTransformationErrorEvent as VideoTransformationErrorEvent
5757
from .video_transformation_ready_event import VideoTransformationReadyEvent as VideoTransformationReadyEvent
5858
from .custom_metadata_field_list_params import CustomMetadataFieldListParams as CustomMetadataFieldListParams
59+
from .update_file_details_request_param import UpdateFileDetailsRequestParam as UpdateFileDetailsRequestParam
5960
from .upload_post_transform_error_event import UploadPostTransformErrorEvent as UploadPostTransformErrorEvent
6061
from .upload_pre_transform_success_event import UploadPreTransformSuccessEvent as UploadPreTransformSuccessEvent
6162
from .custom_metadata_field_create_params import CustomMetadataFieldCreateParams as CustomMetadataFieldCreateParams
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Dict, Union, Optional
6+
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
7+
8+
from .._types import SequenceNotStr
9+
from .._utils import PropertyInfo
10+
from .shared_params.extensions import Extensions
11+
12+
__all__ = [
13+
"UpdateFileDetailsRequestParam",
14+
"UpdateFileDetails",
15+
"ChangePublicationStatus",
16+
"ChangePublicationStatusPublish",
17+
]
18+
19+
20+
class UpdateFileDetails(TypedDict, total=False):
21+
custom_coordinates: Annotated[Optional[str], PropertyInfo(alias="customCoordinates")]
22+
"""Define an important area in the image in the format `x,y,width,height` e.g.
23+
24+
`10,10,100,100`. Send `null` to unset this value.
25+
"""
26+
27+
custom_metadata: Annotated[Dict[str, object], PropertyInfo(alias="customMetadata")]
28+
"""A key-value data to be associated with the asset.
29+
30+
To unset a key, send `null` value for that key. Before setting any custom
31+
metadata on an asset you have to create the field using custom metadata fields
32+
API.
33+
"""
34+
35+
description: str
36+
"""Optional text to describe the contents of the file."""
37+
38+
extensions: Extensions
39+
"""Array of extensions to be applied to the asset.
40+
41+
Each extension can be configured with specific parameters based on the extension
42+
type.
43+
"""
44+
45+
remove_ai_tags: Annotated[Union[SequenceNotStr[str], Literal["all"]], PropertyInfo(alias="removeAITags")]
46+
"""An array of AITags associated with the file that you want to remove, e.g.
47+
48+
`["car", "vehicle", "motorsports"]`.
49+
50+
If you want to remove all AITags associated with the file, send a string -
51+
"all".
52+
53+
Note: The remove operation for `AITags` executes before any of the `extensions`
54+
are processed.
55+
"""
56+
57+
tags: Optional[SequenceNotStr[str]]
58+
"""An array of tags associated with the file, such as `["tag1", "tag2"]`.
59+
60+
Send `null` to unset all tags associated with the file.
61+
"""
62+
63+
webhook_url: Annotated[str, PropertyInfo(alias="webhookUrl")]
64+
"""
65+
The final status of extensions after they have completed execution will be
66+
delivered to this endpoint as a POST request.
67+
[Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure)
68+
about the webhook payload structure.
69+
"""
70+
71+
72+
class ChangePublicationStatusPublish(TypedDict, total=False):
73+
is_published: Required[Annotated[bool, PropertyInfo(alias="isPublished")]]
74+
"""Set to `true` to publish the file. Set to `false` to unpublish the file."""
75+
76+
include_file_versions: Annotated[bool, PropertyInfo(alias="includeFileVersions")]
77+
"""Set to `true` to publish/unpublish all versions of the file.
78+
79+
Set to `false` to publish/unpublish only the current version of the file.
80+
"""
81+
82+
83+
class ChangePublicationStatus(TypedDict, total=False):
84+
publish: ChangePublicationStatusPublish
85+
"""Configure the publication status of a file and its versions."""
86+
87+
88+
UpdateFileDetailsRequestParam: TypeAlias = Union[UpdateFileDetails, ChangePublicationStatus]

0 commit comments

Comments
 (0)