@@ -120,11 +120,61 @@ export interface ListResult {
120
120
nextPageToken ?: string ;
121
121
}
122
122
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
+
123
173
/**
124
174
* The full set of object metadata, including read-only properties.
125
175
* @public
126
176
*/
127
- export interface Metadata {
177
+ export interface FullMetadata extends UploadMetadata {
128
178
/**
129
179
* The bucket this object is contained in.
130
180
*/
@@ -168,55 +218,15 @@ export interface Metadata {
168
218
*/
169
219
updated : string ;
170
220
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
-
201
221
/**
202
222
* Tokens to allow access to the downloatd URL.
203
223
*/
204
224
downloadTokens : string [ ] | undefined ;
205
225
206
- /**
207
- * Additional user-defined custom metadata.
208
- */
209
- customMetadata :
210
- | {
211
- [ key : string ] : string ;
212
- }
213
- | undefined ;
214
-
215
226
/**
216
227
* `StorageReference` associated with this upload.
217
228
*/
218
- ref : StorageReference | undefined ;
219
- [ prop : string ] : unknown ;
229
+ ref ?: StorageReference | undefined ;
220
230
}
221
231
222
232
/**
@@ -428,7 +438,7 @@ export interface UploadTaskSnapshot {
428
438
* Before the upload completes, contains the metadata sent to the server.
429
439
* After the upload completes, contains the metadata sent back from the server.
430
440
*/
431
- metadata : Metadata ;
441
+ metadata : FullMetadata ;
432
442
433
443
/**
434
444
* The reference that spawned this snapshot's upload task.
@@ -459,7 +469,7 @@ export interface UploadResult {
459
469
/**
460
470
* Contains the metadata sent back from the server.
461
471
*/
462
- readonly metadata : Metadata ;
472
+ readonly metadata : FullMetadata ;
463
473
464
474
/**
465
475
* The reference that spawned this upload.
0 commit comments