@@ -120,11 +120,61 @@ export interface ListResult {
120120 nextPageToken ?: string ;
121121}
122122
123+ /**
124+ * Object metadata that can be set at any time.
125+ * @public
126+ */
127+ export interface SettableMetadata {
128+ /**
129+ * Served as the 'Cache-Control' header on object download.
130+ */
131+ cacheControl ?: string | undefined ;
132+
133+ /**
134+ * Served as the 'Content-Disposition' header on object download.
135+ */
136+ contentDisposition ?: string | undefined ;
137+
138+ /**
139+ * Served as the 'Content-Encoding' header on object download.
140+ */
141+ contentEncoding ?: string | undefined ;
142+
143+ /**
144+ * Served as the 'Content-Language' header on object download.
145+ */
146+ contentLanguage ?: string | undefined ;
147+
148+ /**
149+ * Served as the 'Content-Type' header on object download.
150+ */
151+ contentType ?: string | undefined ;
152+
153+ /**
154+ * Additional user-defined custom metadata.
155+ */
156+ customMetadata ?:
157+ | {
158+ [ key : string ] : string ;
159+ }
160+ | undefined ;
161+ }
162+ /**
163+ * Object metadata that can be set at upload.
164+ * @public
165+ */
166+ export interface UploadMetadata extends SettableMetadata {
167+ /**
168+ * A Base64-encoded MD5 hash of the object being uploaded.
169+ */
170+ md5Hash ?: string | undefined ;
171+ }
172+
123173/**
124174 * The full set of object metadata, including read-only properties.
125175 * @public
126176 */
127- export interface Metadata {
177+ export interface FullMetadata extends UploadMetadata {
128178 /**
129179 * The bucket this object is contained in.
130180 */
@@ -168,55 +218,15 @@ export interface Metadata {
168218 */
169219 updated : string ;
170220
171- /**
172- * A Base64-encoded MD5 hash of the object being uploaded.
173- */
174- md5Hash : string | undefined ;
175-
176- /**
177- * Served as the 'Cache-Control' header on object download.
178- */
179- cacheControl : string | undefined ;
180-
181- /**
182- * Served as the 'Content-Disposition' header on object download.
183- */
184- contentDisposition : string | undefined ;
185-
186- /**
187- * Served as the 'Content-Encoding' header on object download.
188- */
189- contentEncoding : string | undefined ;
190-
191- /**
192- * Served as the 'Content-Language' header on object download.
193- */
194- contentLanguage : string | undefined ;
195-
196- /**
197- * Served as the 'Content-Type' header on object download.
198- */
199- contentType : string | undefined ;
200-
201221 /**
202222 * Tokens to allow access to the downloatd URL.
203223 */
204224 downloadTokens : string [ ] | undefined ;
205225
206- /**
207- * Additional user-defined custom metadata.
208- */
209- customMetadata :
210- | {
211- [ key : string ] : string ;
212- }
213- | undefined ;
214-
215226 /**
216227 * `StorageReference` associated with this upload.
217228 */
218- ref : StorageReference | undefined ;
219- [ prop : string ] : unknown ;
229+ ref ?: StorageReference | undefined ;
220230}
221231
222232/**
@@ -428,7 +438,7 @@ export interface UploadTaskSnapshot {
428438 * Before the upload completes, contains the metadata sent to the server.
429439 * After the upload completes, contains the metadata sent back from the server.
430440 */
431- metadata : Metadata ;
441+ metadata : FullMetadata ;
432442
433443 /**
434444 * The reference that spawned this snapshot's upload task.
@@ -459,7 +469,7 @@ export interface UploadResult {
459469 /**
460470 * Contains the metadata sent back from the server.
461471 */
462- readonly metadata : Metadata ;
472+ readonly metadata : FullMetadata ;
463473
464474 /**
465475 * The reference that spawned this upload.
0 commit comments