Skip to content

Commit af5fd2f

Browse files
feat(api): manual updates
1 parent 2ac7656 commit af5fd2f

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
@@ -48,8 +48,7 @@ export class Files extends APIResource {
4848
* const file = await client.files.update('fileId');
4949
* ```
5050
*/
51-
update(fileID: string, params: FileUpdateParams, options?: RequestOptions): APIPromise<FileUpdateResponse> {
52-
const body = 'body' in params ? params.body : params;
51+
update(fileID: string, body: FileUpdateParams, options?: RequestOptions): APIPromise<FileUpdateResponse> {
5352
return this._client.patch(path`/v1/files/${fileID}/details`, { body, ...options });
5453
}
5554

@@ -611,7 +610,9 @@ export namespace Metadata {
611610
/**
612611
* Schema for update file update request.
613612
*/
614-
export type UpdateFileRequest = UpdateFileRequest.UpdateFileDetails | unknown;
613+
export type UpdateFileRequest =
614+
| UpdateFileRequest.UpdateFileDetails
615+
| UpdateFileRequest.ChangePublicationStatus;
615616

616617
export namespace UpdateFileRequest {
617618
export interface UpdateFileDetails {
@@ -665,6 +666,31 @@ export namespace UpdateFileRequest {
665666
*/
666667
webhookUrl?: string;
667668
}
669+
670+
export interface ChangePublicationStatus {
671+
/**
672+
* Configure the publication status of a file and its versions.
673+
*/
674+
publish?: ChangePublicationStatus.Publish;
675+
}
676+
677+
export namespace ChangePublicationStatus {
678+
/**
679+
* Configure the publication status of a file and its versions.
680+
*/
681+
export interface Publish {
682+
/**
683+
* Set to `true` to publish the file. Set to `false` to unpublish the file.
684+
*/
685+
isPublished: boolean;
686+
687+
/**
688+
* Set to `true` to publish/unpublish all versions of the file. Set to `false` to
689+
* publish/unpublish only the current version of the file.
690+
*/
691+
includeFileVersions?: boolean;
692+
}
693+
}
668694
}
669695

670696
/**
@@ -963,7 +989,28 @@ export declare namespace FileUpdateParams {
963989
}
964990

965991
export interface ChangePublicationStatus {
966-
body: unknown;
992+
/**
993+
* Configure the publication status of a file and its versions.
994+
*/
995+
publish?: ChangePublicationStatus.Publish;
996+
}
997+
998+
export namespace ChangePublicationStatus {
999+
/**
1000+
* Configure the publication status of a file and its versions.
1001+
*/
1002+
export interface Publish {
1003+
/**
1004+
* Set to `true` to publish the file. Set to `false` to unpublish the file.
1005+
*/
1006+
isPublished: boolean;
1007+
1008+
/**
1009+
* Set to `true` to publish/unpublish all versions of the file. Set to `false` to
1010+
* publish/unpublish only the current version of the file.
1011+
*/
1012+
includeFileVersions?: boolean;
1013+
}
9671014
}
9681015
}
9691016

0 commit comments

Comments
 (0)