Skip to content

Commit 6d80006

Browse files
feat(api): manual updates
1 parent 9ec6627 commit 6d80006

File tree

2 files changed

+53
-6
lines changed

2 files changed

+53
-6
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 42
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-dd864816d7f4316ae89f57394da2fd1926166d4704db5a0bb5d23461d2d75e49.yml
3-
openapi_spec_hash: 7f7c416563a15bbaea98804ecdc1a8f9
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d1a3e6dfc45ae832b6b14a0aef25878985c679fa9f48c1470df188b1578ba648.yml
3+
openapi_spec_hash: 1d382866fce3284f26d341f112988d9d
44
config_hash: 54c05a157f2cc730fac9e1df5dc3ca29

src/resources/files/files.ts

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ export class Files extends APIResource {
4747
* const file = await client.files.update('fileId');
4848
* ```
4949
*/
50-
update(fileID: string, params: FileUpdateParams, options?: RequestOptions): APIPromise<FileUpdateResponse> {
51-
const body = 'body' in params ? params.body : params;
50+
update(fileID: string, body: FileUpdateParams, options?: RequestOptions): APIPromise<FileUpdateResponse> {
5251
return this._client.patch(path`/v1/files/${fileID}/details`, { body, ...options });
5352
}
5453

@@ -608,7 +607,9 @@ export namespace Metadata {
608607
/**
609608
* Schema for update file update request.
610609
*/
611-
export type UpdateFileRequest = UpdateFileRequest.UpdateFileDetails | unknown;
610+
export type UpdateFileRequest =
611+
| UpdateFileRequest.UpdateFileDetails
612+
| UpdateFileRequest.ChangePublicationStatus;
612613

613614
export namespace UpdateFileRequest {
614615
export interface UpdateFileDetails {
@@ -662,6 +663,31 @@ export namespace UpdateFileRequest {
662663
*/
663664
webhookUrl?: string;
664665
}
666+
667+
export interface ChangePublicationStatus {
668+
/**
669+
* Configure the publication status of a file and its versions.
670+
*/
671+
publish?: ChangePublicationStatus.Publish;
672+
}
673+
674+
export namespace ChangePublicationStatus {
675+
/**
676+
* Configure the publication status of a file and its versions.
677+
*/
678+
export interface Publish {
679+
/**
680+
* Set to `true` to publish the file. Set to `false` to unpublish the file.
681+
*/
682+
isPublished: boolean;
683+
684+
/**
685+
* Set to `true` to publish/unpublish all versions of the file. Set to `false` to
686+
* publish/unpublish only the current version of the file.
687+
*/
688+
includeFileVersions?: boolean;
689+
}
690+
}
665691
}
666692

667693
/**
@@ -960,7 +986,28 @@ export declare namespace FileUpdateParams {
960986
}
961987

962988
export interface ChangePublicationStatus {
963-
body: unknown;
989+
/**
990+
* Configure the publication status of a file and its versions.
991+
*/
992+
publish?: ChangePublicationStatus.Publish;
993+
}
994+
995+
export namespace ChangePublicationStatus {
996+
/**
997+
* Configure the publication status of a file and its versions.
998+
*/
999+
export interface Publish {
1000+
/**
1001+
* Set to `true` to publish the file. Set to `false` to unpublish the file.
1002+
*/
1003+
isPublished: boolean;
1004+
1005+
/**
1006+
* Set to `true` to publish/unpublish all versions of the file. Set to `false` to
1007+
* publish/unpublish only the current version of the file.
1008+
*/
1009+
includeFileVersions?: boolean;
1010+
}
9641011
}
9651012
}
9661013

0 commit comments

Comments
 (0)