@@ -44,35 +44,11 @@ export class Files extends APIResource {
4444 *
4545 * @example
4646 * ```ts
47- * const file = await client.files.update('fileId', {
48- * customCoordinates: '10,10,100,100',
49- * customMetadata: { brand: 'Nike', color: 'red' },
50- * extensions: [
51- * { name: 'remove-bg', options: { add_shadow: true } },
52- * {
53- * name: 'google-auto-tagging',
54- * minConfidence: 80,
55- * maxTags: 10,
56- * },
57- * {
58- * name: 'aws-auto-tagging',
59- * minConfidence: 80,
60- * maxTags: 10,
61- * },
62- * { name: 'ai-auto-description' },
63- * ],
64- * removeAITags: ['car', 'vehicle', 'motorsports'],
65- * tags: ['tag1', 'tag2'],
66- * webhookUrl:
67- * 'https://webhook.site/0d6b6c7a-8e5a-4b3a-8b7c-0d6b6c7a8e5a',
68- * });
47+ * const file = await client.files.update('fileId');
6948 * ```
7049 */
71- update (
72- fileID : string ,
73- body : FileUpdateParams | null | undefined = { } ,
74- options ?: RequestOptions ,
75- ) : APIPromise < FileUpdateResponse > {
50+ update ( fileID : string , params : FileUpdateParams , options ?: RequestOptions ) : APIPromise < FileUpdateResponse > {
51+ const body = 'body' in params ? params . body : params ;
7652 return this . _client . patch ( path `/v1/files/${ fileID } /details` , { body, ...options } ) ;
7753 }
7854
@@ -629,11 +605,12 @@ export namespace Metadata {
629605 }
630606}
631607
632- export type UpdateFileDetailsRequest =
633- | UpdateFileDetailsRequest . UpdateFileDetails
634- | UpdateFileDetailsRequest . ChangePublicationStatus ;
608+ /**
609+ * Schema for update file update request.
610+ */
611+ export type UpdateFileRequest = UpdateFileRequest . UpdateFileDetails | unknown ;
635612
636- export namespace UpdateFileDetailsRequest {
613+ export namespace UpdateFileRequest {
637614 export interface UpdateFileDetails {
638615 /**
639616 * Define an important area in the image in the format `x,y,width,height` e.g.
@@ -685,31 +662,6 @@ export namespace UpdateFileDetailsRequest {
685662 */
686663 webhookUrl ?: string ;
687664 }
688-
689- export interface ChangePublicationStatus {
690- /**
691- * Configure the publication status of a file and its versions.
692- */
693- publish ?: ChangePublicationStatus . Publish ;
694- }
695-
696- export namespace ChangePublicationStatus {
697- /**
698- * Configure the publication status of a file and its versions.
699- */
700- export interface Publish {
701- /**
702- * Set to `true` to publish the file. Set to `false` to unpublish the file.
703- */
704- isPublished : boolean ;
705-
706- /**
707- * Set to `true` to publish/unpublish all versions of the file. Set to `false` to
708- * publish/unpublish only the current version of the file.
709- */
710- includeFileVersions ?: boolean ;
711- }
712- }
713665}
714666
715667/**
@@ -1008,28 +960,7 @@ export declare namespace FileUpdateParams {
1008960 }
1009961
1010962 export interface ChangePublicationStatus {
1011- /**
1012- * Configure the publication status of a file and its versions.
1013- */
1014- publish ?: ChangePublicationStatus . Publish ;
1015- }
1016-
1017- export namespace ChangePublicationStatus {
1018- /**
1019- * Configure the publication status of a file and its versions.
1020- */
1021- export interface Publish {
1022- /**
1023- * Set to `true` to publish the file. Set to `false` to unpublish the file.
1024- */
1025- isPublished : boolean ;
1026-
1027- /**
1028- * Set to `true` to publish/unpublish all versions of the file. Set to `false` to
1029- * publish/unpublish only the current version of the file.
1030- */
1031- includeFileVersions ?: boolean ;
1032- }
963+ body : unknown ;
1033964 }
1034965}
1035966
@@ -1411,7 +1342,7 @@ export declare namespace Files {
14111342 type File as File ,
14121343 type Folder as Folder ,
14131344 type Metadata as Metadata ,
1414- type UpdateFileDetailsRequest as UpdateFileDetailsRequest ,
1345+ type UpdateFileRequest as UpdateFileRequest ,
14151346 type FileUpdateResponse as FileUpdateResponse ,
14161347 type FileCopyResponse as FileCopyResponse ,
14171348 type FileMoveResponse as FileMoveResponse ,
0 commit comments