diff --git a/types/google-cloud__storage/google-cloud__storage-tests.ts b/types/google-cloud__storage/google-cloud__storage-tests.ts index 590953fa6a..00f85ff3d0 100644 --- a/types/google-cloud__storage/google-cloud__storage-tests.ts +++ b/types/google-cloud__storage/google-cloud__storage-tests.ts @@ -19,6 +19,7 @@ import { FileMetadata, FilePrivateOptions, ReadStreamOptions, + ResumableUploadOptions, SignedPolicy, SignedPolicyOptions, SignedUrlConfig, @@ -247,6 +248,16 @@ export class TestFile { return this.file.copy(destination); } + /** + * Create a unique resumable upload session URI. This is the first step when performing a resumable upload. + * @method createResumableUpload + * @param {ResumableUploadOptions} options + * @return {Promise<[string]} + */ + createResumableUpload(options?: ResumableUploadOptions): Promise<[string]> { + return this.file.createResumableUpload(options); + } + /** * Create a readable stream to read the contents of the remote file. * It can be piped to a writable stream or listened to for 'data' events to read a file's contents. diff --git a/types/google-cloud__storage/index.d.ts b/types/google-cloud__storage/index.d.ts index bee7c5de87..1d6bde527a 100644 --- a/types/google-cloud__storage/index.d.ts +++ b/types/google-cloud__storage/index.d.ts @@ -121,6 +121,7 @@ declare namespace Storage { acl: Acl; copy(destination: string | Bucket | File): Promise<[File, ApiResponse]>; createReadStream(options?: ReadStreamOptions): ReadStream; + createResumableUpload(options?: ResumableUploadOptions): Promise<[string]>; createWriteStream(options?: WriteStreamOptions): WriteStream; delete(): Promise<[ApiResponse]>; download(options?: DownloadOptions): Promise<[Buffer]>; @@ -139,11 +140,19 @@ declare namespace Storage { metadata?: FileMetadata; } + /** + * User-defined metadata. + */ + interface CustomFileMetadata { + [key: string]: boolean | number | string | null; + } + /** * File metadata. */ interface FileMetadata { contentType?: string; + metadata?: CustomFileMetadata; } /** @@ -192,6 +201,17 @@ declare namespace Storage { responseType?: string; } + /** + * Options when obtaining a resumable upload URI. + */ + interface ResumableUploadOptions { + metadata?: FileMetadata; + origin?: string; + predefinedAcl?: string; + private?: boolean; + public?: boolean; + } + /** * Access control list for storage buckets and files. */