Skip to content

Commit 30d976b

Browse files
feat(api): extract UpdateFileDetailsRequest to model
1 parent c6a7e04 commit 30d976b

File tree

6 files changed

+90
-1
lines changed

6 files changed

+90
-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
@@ -42,6 +42,7 @@ Types:
4242
- <code><a href="./src/resources/files/files.ts">File</a></code>
4343
- <code><a href="./src/resources/files/files.ts">Folder</a></code>
4444
- <code><a href="./src/resources/files/files.ts">Metadata</a></code>
45+
- <code><a href="./src/resources/files/files.ts">UpdateFileDetailsRequest</a></code>
4546
- <code><a href="./src/resources/files/files.ts">FileUpdateResponse</a></code>
4647
- <code><a href="./src/resources/files/files.ts">FileCopyResponse</a></code>
4748
- <code><a href="./src/resources/files/files.ts">FileMoveResponse</a></code>

src/client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ import {
5757
Files,
5858
Folder,
5959
Metadata,
60+
UpdateFileDetailsRequest,
6061
} from './resources/files/files';
6162
import {
6263
FolderCopyParams,
@@ -856,6 +857,7 @@ export declare namespace ImageKit {
856857
type File as File,
857858
type Folder as Folder,
858859
type Metadata as Metadata,
860+
type UpdateFileDetailsRequest as UpdateFileDetailsRequest,
859861
type FileUpdateResponse as FileUpdateResponse,
860862
type FileCopyResponse as FileCopyResponse,
861863
type FileMoveResponse as FileMoveResponse,

src/resources/files/files.ts

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,89 @@ export namespace Metadata {
632632
}
633633
}
634634

635+
export type UpdateFileDetailsRequest =
636+
| UpdateFileDetailsRequest.UpdateFileDetails
637+
| UpdateFileDetailsRequest.ChangePublicationStatus;
638+
639+
export namespace UpdateFileDetailsRequest {
640+
export interface UpdateFileDetails {
641+
/**
642+
* Define an important area in the image in the format `x,y,width,height` e.g.
643+
* `10,10,100,100`. Send `null` to unset this value.
644+
*/
645+
customCoordinates?: string | null;
646+
647+
/**
648+
* A key-value data to be associated with the asset. To unset a key, send `null`
649+
* value for that key. Before setting any custom metadata on an asset you have to
650+
* create the field using custom metadata fields API.
651+
*/
652+
customMetadata?: { [key: string]: unknown };
653+
654+
/**
655+
* Optional text to describe the contents of the file.
656+
*/
657+
description?: string;
658+
659+
/**
660+
* Array of extensions to be applied to the asset. Each extension can be configured
661+
* with specific parameters based on the extension type.
662+
*/
663+
extensions?: Shared.Extensions;
664+
665+
/**
666+
* An array of AITags associated with the file that you want to remove, e.g.
667+
* `["car", "vehicle", "motorsports"]`.
668+
*
669+
* If you want to remove all AITags associated with the file, send a string -
670+
* "all".
671+
*
672+
* Note: The remove operation for `AITags` executes before any of the `extensions`
673+
* are processed.
674+
*/
675+
removeAITags?: Array<string> | 'all';
676+
677+
/**
678+
* An array of tags associated with the file, such as `["tag1", "tag2"]`. Send
679+
* `null` to unset all tags associated with the file.
680+
*/
681+
tags?: Array<string> | null;
682+
683+
/**
684+
* The final status of extensions after they have completed execution will be
685+
* delivered to this endpoint as a POST request.
686+
* [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure)
687+
* about the webhook payload structure.
688+
*/
689+
webhookUrl?: string;
690+
}
691+
692+
export interface ChangePublicationStatus {
693+
/**
694+
* Configure the publication status of a file and its versions.
695+
*/
696+
publish?: ChangePublicationStatus.Publish;
697+
}
698+
699+
export namespace ChangePublicationStatus {
700+
/**
701+
* Configure the publication status of a file and its versions.
702+
*/
703+
export interface Publish {
704+
/**
705+
* Set to `true` to publish the file. Set to `false` to unpublish the file.
706+
*/
707+
isPublished: boolean;
708+
709+
/**
710+
* Set to `true` to publish/unpublish all versions of the file. Set to `false` to
711+
* publish/unpublish only the current version of the file.
712+
*/
713+
includeFileVersions?: boolean;
714+
}
715+
}
716+
}
717+
635718
/**
636719
* Object containing details of a file or file version.
637720
*/
@@ -1331,6 +1414,7 @@ export declare namespace Files {
13311414
type File as File,
13321415
type Folder as Folder,
13331416
type Metadata as Metadata,
1417+
type UpdateFileDetailsRequest as UpdateFileDetailsRequest,
13341418
type FileUpdateResponse as FileUpdateResponse,
13351419
type FileCopyResponse as FileCopyResponse,
13361420
type FileMoveResponse as FileMoveResponse,

src/resources/files/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export {
1616
type File,
1717
type Folder,
1818
type Metadata,
19+
type UpdateFileDetailsRequest,
1920
type FileUpdateResponse,
2021
type FileCopyResponse,
2122
type FileMoveResponse,

src/resources/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export {
1919
type File,
2020
type Folder,
2121
type Metadata,
22+
type UpdateFileDetailsRequest,
2223
type FileUpdateResponse,
2324
type FileCopyResponse,
2425
type FileMoveResponse,

0 commit comments

Comments
 (0)