@google-cloud/storage-control 0.6.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +7 -0
  2. package/build/protos/google/storage/v2/storage.proto +3166 -0
  3. package/build/protos/protos.d.ts +11304 -40
  4. package/build/protos/protos.js +30882 -22
  5. package/build/protos/protos.json +4507 -28
  6. package/build/src/index.d.ts +2 -3
  7. package/build/src/index.js +3 -3
  8. package/build/src/index.js.map +1 -1
  9. package/build/src/storage_control_client.d.ts +2035 -0
  10. package/build/src/storage_control_client.js +2440 -0
  11. package/build/src/storage_control_client.js.map +1 -0
  12. package/build/src/util/ast_utils.d.ts +22 -0
  13. package/build/src/util/ast_utils.js +356 -0
  14. package/build/src/util/ast_utils.js.map +1 -0
  15. package/build/src/util/index_fix_utils.d.ts +15 -0
  16. package/build/src/util/index_fix_utils.js +86 -0
  17. package/build/src/util/index_fix_utils.js.map +1 -0
  18. package/build/src/util/proto_utils.d.ts +13 -0
  19. package/build/src/util/proto_utils.js +53 -0
  20. package/build/src/util/proto_utils.js.map +1 -0
  21. package/build/src/util/storage_control_utils.d.ts +1 -0
  22. package/build/src/util/storage_control_utils.js +31 -0
  23. package/build/src/util/storage_control_utils.js.map +1 -0
  24. package/build/src/util/uber_client_builder.d.ts +12 -0
  25. package/build/src/util/uber_client_builder.js +187 -0
  26. package/build/src/util/uber_client_builder.js.map +1 -0
  27. package/build/src/v2/index.d.ts +1 -0
  28. package/build/src/v2/index.js +4 -2
  29. package/build/src/v2/index.js.map +1 -1
  30. package/build/src/v2/storage_client.d.ts +614 -0
  31. package/build/src/v2/storage_client.js +911 -0
  32. package/build/src/v2/storage_client.js.map +1 -0
  33. package/build/src/v2/storage_client_config.json +65 -0
  34. package/build/src/v2/storage_control_client.d.ts +138 -138
  35. package/build/src/v2/storage_control_client.js +486 -232
  36. package/build/src/v2/storage_control_client.js.map +1 -1
  37. package/build/src/v2/storage_proto_list.json +3 -0
  38. package/package.json +4 -2
@@ -0,0 +1,3166 @@
1
+ // Copyright 2025 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package google.storage.v2;
18
+
19
+ import "google/api/client.proto";
20
+ import "google/api/field_behavior.proto";
21
+ import "google/api/resource.proto";
22
+ import "google/api/routing.proto";
23
+ import "google/iam/v1/iam_policy.proto";
24
+ import "google/iam/v1/policy.proto";
25
+ import "google/protobuf/duration.proto";
26
+ import "google/protobuf/empty.proto";
27
+ import "google/protobuf/field_mask.proto";
28
+ import "google/protobuf/timestamp.proto";
29
+ import "google/rpc/status.proto";
30
+ import "google/type/date.proto";
31
+
32
+ option go_package = "cloud.google.com/go/storage/internal/apiv2/storagepb;storagepb";
33
+ option java_multiple_files = true;
34
+ option java_outer_classname = "StorageProto";
35
+ option java_package = "com.google.storage.v2";
36
+ option (google.api.resource_definition) = {
37
+ type: "cloudkms.googleapis.com/CryptoKey"
38
+ pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"
39
+ };
40
+
41
+ // ## API Overview and Naming Syntax
42
+ //
43
+ // The Cloud Storage gRPC API allows applications to read and write data through
44
+ // the abstractions of buckets and objects. For a description of these
45
+ // abstractions please see [Cloud Storage
46
+ // documentation](https://cloud.google.com/storage/docs).
47
+ //
48
+ // Resources are named as follows:
49
+ //
50
+ // - Projects are referred to as they are defined by the Resource Manager API,
51
+ // using strings like `projects/123456` or `projects/my-string-id`.
52
+ // - Buckets are named using string names of the form:
53
+ // `projects/{project}/buckets/{bucket}`.
54
+ // For globally unique buckets, `_` might be substituted for the project.
55
+ // - Objects are uniquely identified by their name along with the name of the
56
+ // bucket they belong to, as separate strings in this API. For example:
57
+ //
58
+ // ```
59
+ // ReadObjectRequest {
60
+ // bucket: 'projects/_/buckets/my-bucket'
61
+ // object: 'my-object'
62
+ // }
63
+ // ```
64
+ //
65
+ // Note that object names can contain `/` characters, which are treated as
66
+ // any other character (no special directory semantics).
67
+ service Storage {
68
+ option (google.api.default_host) = "storage.googleapis.com";
69
+ option (google.api.oauth_scopes) =
70
+ "https://www.googleapis.com/auth/cloud-platform,"
71
+ "https://www.googleapis.com/auth/cloud-platform.read-only,"
72
+ "https://www.googleapis.com/auth/devstorage.full_control,"
73
+ "https://www.googleapis.com/auth/devstorage.read_only,"
74
+ "https://www.googleapis.com/auth/devstorage.read_write";
75
+
76
+ // Permanently deletes an empty bucket.
77
+ // The request fails if there are any live or
78
+ // noncurrent objects in the bucket, but the request succeeds if the
79
+ // bucket only contains soft-deleted objects or incomplete uploads, such
80
+ // as ongoing XML API multipart uploads. Does not permanently delete
81
+ // soft-deleted objects.
82
+ //
83
+ // When this API is used to delete a bucket containing an object that has a
84
+ // soft delete policy
85
+ // enabled, the object becomes soft deleted, and the
86
+ // `softDeleteTime` and `hardDeleteTime` properties are set on the
87
+ // object.
88
+ //
89
+ // Objects and multipart uploads that were in the bucket at the time of
90
+ // deletion are also retained for the specified retention duration. When
91
+ // a soft-deleted bucket reaches the end of its retention duration, it
92
+ // is permanently deleted. The `hardDeleteTime` of the bucket always
93
+ // equals
94
+ // or exceeds the expiration time of the last soft-deleted object in the
95
+ // bucket.
96
+ //
97
+ // **IAM Permissions**:
98
+ //
99
+ // Requires `storage.buckets.delete` IAM permission on the bucket.
100
+ rpc DeleteBucket(DeleteBucketRequest) returns (google.protobuf.Empty) {
101
+ option (google.api.routing) = {
102
+ routing_parameters { field: "name" path_template: "{bucket=**}" }
103
+ };
104
+ option (google.api.method_signature) = "name";
105
+ }
106
+
107
+ // Returns metadata for the specified bucket.
108
+ //
109
+ // **IAM Permissions**:
110
+ //
111
+ // Requires `storage.buckets.get`
112
+ // IAM permission on
113
+ // the bucket. Additionally, to return specific bucket metadata, the
114
+ // authenticated user must have the following permissions:
115
+ //
116
+ // - To return the IAM policies: `storage.buckets.getIamPolicy`
117
+ // - To return the bucket IP filtering rules: `storage.buckets.getIpFilter`
118
+ rpc GetBucket(GetBucketRequest) returns (Bucket) {
119
+ option (google.api.routing) = {
120
+ routing_parameters { field: "name" path_template: "{bucket=**}" }
121
+ };
122
+ option (google.api.method_signature) = "name";
123
+ }
124
+
125
+ // Creates a new bucket.
126
+ //
127
+ // **IAM Permissions**:
128
+ //
129
+ // Requires `storage.buckets.create` IAM permission on the bucket.
130
+ // Additionally, to enable specific bucket features, the authenticated user
131
+ // must have the following permissions:
132
+ //
133
+ // - To enable object retention using the `enableObjectRetention` query
134
+ // parameter: `storage.buckets.enableObjectRetention`
135
+ // - To set the bucket IP filtering rules: `storage.buckets.setIpFilter`
136
+ rpc CreateBucket(CreateBucketRequest) returns (Bucket) {
137
+ option (google.api.routing) = {
138
+ routing_parameters { field: "parent" path_template: "{project=**}" }
139
+ routing_parameters {
140
+ field: "bucket.project"
141
+ path_template: "{project=**}"
142
+ }
143
+ };
144
+ option (google.api.method_signature) = "parent,bucket,bucket_id";
145
+ }
146
+
147
+ // Retrieves a list of buckets for a given project, ordered
148
+ // lexicographically by name.
149
+ //
150
+ // **IAM Permissions**:
151
+ //
152
+ // Requires `storage.buckets.list` IAM permission on the bucket.
153
+ // Additionally, to enable specific bucket features, the authenticated
154
+ // user must have the following permissions:
155
+ //
156
+ // - To list the IAM policies: `storage.buckets.getIamPolicy`
157
+ // - To list the bucket IP filtering rules: `storage.buckets.getIpFilter`
158
+ rpc ListBuckets(ListBucketsRequest) returns (ListBucketsResponse) {
159
+ option (google.api.routing) = {
160
+ routing_parameters { field: "parent" path_template: "{project=**}" }
161
+ };
162
+ option (google.api.method_signature) = "parent";
163
+ }
164
+
165
+ // Permanently locks the retention
166
+ // policy that is
167
+ // currently applied to the specified bucket.
168
+ //
169
+ // Caution: Locking a bucket is an
170
+ // irreversible action. Once you lock a bucket:
171
+ //
172
+ // - You cannot remove the retention policy from the bucket.
173
+ // - You cannot decrease the retention period for the policy.
174
+ //
175
+ // Once locked, you must delete the entire bucket in order to remove the
176
+ // bucket's retention policy. However, before you can delete the bucket, you
177
+ // must delete all the objects in the bucket, which is only
178
+ // possible if all the objects have reached the retention period set by the
179
+ // retention policy.
180
+ //
181
+ // **IAM Permissions**:
182
+ //
183
+ // Requires `storage.buckets.update` IAM permission on the bucket.
184
+ rpc LockBucketRetentionPolicy(LockBucketRetentionPolicyRequest)
185
+ returns (Bucket) {
186
+ option (google.api.routing) = {
187
+ routing_parameters { field: "bucket" path_template: "{bucket=**}" }
188
+ };
189
+ option (google.api.method_signature) = "bucket";
190
+ }
191
+
192
+ // Gets the IAM policy for a specified bucket or managed folder.
193
+ // The `resource` field in the request should be
194
+ // `projects/_/buckets/{bucket}` for a bucket, or
195
+ // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}`
196
+ // for a managed folder.
197
+ //
198
+ // **IAM Permissions**:
199
+ //
200
+ // Requires `storage.buckets.getIamPolicy` on the bucket or
201
+ // `storage.managedFolders.getIamPolicy` IAM permission on the
202
+ // managed folder.
203
+ rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest)
204
+ returns (google.iam.v1.Policy) {
205
+ option (google.api.routing) = {
206
+ routing_parameters { field: "resource" path_template: "{bucket=**}" }
207
+ routing_parameters {
208
+ field: "resource"
209
+ path_template: "{bucket=projects/*/buckets/*}/**"
210
+ }
211
+ };
212
+ option (google.api.method_signature) = "resource";
213
+ }
214
+
215
+ // Updates an IAM policy for the specified bucket or managed folder.
216
+ // The `resource` field in the request should be
217
+ // `projects/_/buckets/{bucket}` for a bucket, or
218
+ // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}`
219
+ // for a managed folder.
220
+ rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest)
221
+ returns (google.iam.v1.Policy) {
222
+ option (google.api.routing) = {
223
+ routing_parameters { field: "resource" path_template: "{bucket=**}" }
224
+ routing_parameters {
225
+ field: "resource"
226
+ path_template: "{bucket=projects/*/buckets/*}/**"
227
+ }
228
+ };
229
+ option (google.api.method_signature) = "resource,policy";
230
+ }
231
+
232
+ // Tests a set of permissions on the given bucket, object, or managed folder
233
+ // to see which, if any, are held by the caller. The `resource` field in the
234
+ // request should be `projects/_/buckets/{bucket}` for a bucket,
235
+ // `projects/_/buckets/{bucket}/objects/{object}` for an object, or
236
+ // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}`
237
+ // for a managed folder.
238
+ rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest)
239
+ returns (google.iam.v1.TestIamPermissionsResponse) {
240
+ option (google.api.routing) = {
241
+ routing_parameters { field: "resource" path_template: "{bucket=**}" }
242
+ routing_parameters {
243
+ field: "resource"
244
+ path_template: "{bucket=projects/*/buckets/*}/objects/**"
245
+ }
246
+ routing_parameters {
247
+ field: "resource"
248
+ path_template: "{bucket=projects/*/buckets/*}/managedFolders/**"
249
+ }
250
+ };
251
+ option (google.api.method_signature) = "resource,permissions";
252
+ }
253
+
254
+ // Updates a bucket. Changes to the bucket are readable immediately after
255
+ // writing, but configuration changes might take time to propagate. This
256
+ // method supports `patch` semantics.
257
+ //
258
+ // **IAM Permissions**:
259
+ //
260
+ // Requires `storage.buckets.update` IAM permission on the bucket.
261
+ // Additionally, to enable specific bucket features, the authenticated user
262
+ // must have the following permissions:
263
+ //
264
+ // - To set bucket IP filtering rules: `storage.buckets.setIpFilter`
265
+ // - To update public access prevention policies or access control lists
266
+ // (ACLs): `storage.buckets.setIamPolicy`
267
+ rpc UpdateBucket(UpdateBucketRequest) returns (Bucket) {
268
+ option (google.api.routing) = {
269
+ routing_parameters { field: "bucket.name" path_template: "{bucket=**}" }
270
+ };
271
+ option (google.api.method_signature) = "bucket,update_mask";
272
+ }
273
+
274
+ // Concatenates a list of existing objects into a new object in the same
275
+ // bucket. The existing source objects are unaffected by this operation.
276
+ //
277
+ // **IAM Permissions**:
278
+ //
279
+ // Requires the `storage.objects.create` and `storage.objects.get` IAM
280
+ // permissions to use this method. If the new composite object
281
+ // overwrites an existing object, the authenticated user must also have
282
+ // the `storage.objects.delete` permission. If the request body includes
283
+ // the retention property, the authenticated user must also have the
284
+ // `storage.objects.setRetention` IAM permission.
285
+ rpc ComposeObject(ComposeObjectRequest) returns (StorageObject) {
286
+ option (google.api.routing) = {
287
+ routing_parameters {
288
+ field: "destination.bucket"
289
+ path_template: "{bucket=**}"
290
+ }
291
+ };
292
+ }
293
+
294
+ // Deletes an object and its metadata. Deletions are permanent if versioning
295
+ // is not enabled for the bucket, or if the generation parameter is used, or
296
+ // if soft delete is not
297
+ // enabled for the bucket.
298
+ // When this API is used to delete an object from a bucket that has soft
299
+ // delete policy enabled, the object becomes soft deleted, and the
300
+ // `softDeleteTime` and `hardDeleteTime` properties are set on the object.
301
+ // This API cannot be used to permanently delete soft-deleted objects.
302
+ // Soft-deleted objects are permanently deleted according to their
303
+ // `hardDeleteTime`.
304
+ //
305
+ // You can use the [`RestoreObject`][google.storage.v2.Storage.RestoreObject]
306
+ // API to restore soft-deleted objects until the soft delete retention period
307
+ // has passed.
308
+ //
309
+ // **IAM Permissions**:
310
+ //
311
+ // Requires `storage.objects.delete` IAM permission on the bucket.
312
+ rpc DeleteObject(DeleteObjectRequest) returns (google.protobuf.Empty) {
313
+ option (google.api.routing) = {
314
+ routing_parameters { field: "bucket" path_template: "{bucket=**}" }
315
+ };
316
+ option (google.api.method_signature) = "bucket,object";
317
+ option (google.api.method_signature) = "bucket,object,generation";
318
+ }
319
+
320
+ // Restores a
321
+ // soft-deleted object.
322
+ // When a soft-deleted object is restored, a new copy of that object is
323
+ // created in the same bucket and inherits the same metadata as the
324
+ // soft-deleted object. The inherited metadata is the metadata that existed
325
+ // when the original object became soft deleted, with the following
326
+ // exceptions:
327
+ //
328
+ // - The `createTime` of the new object is set to the time at which the
329
+ // soft-deleted object was restored.
330
+ // - The `softDeleteTime` and `hardDeleteTime` values are cleared.
331
+ // - A new generation is assigned and the metageneration is reset to 1.
332
+ // - If the soft-deleted object was in a bucket that had Autoclass enabled,
333
+ // the new object is
334
+ // restored to Standard storage.
335
+ // - The restored object inherits the bucket's default object ACL, unless
336
+ // `copySourceAcl` is `true`.
337
+ //
338
+ // If a live object using the same name already exists in the bucket and
339
+ // becomes overwritten, the live object becomes a noncurrent object if StorageObject
340
+ // Versioning is enabled on the bucket. If StorageObject Versioning is not enabled,
341
+ // the live object becomes soft deleted.
342
+ //
343
+ // **IAM Permissions**:
344
+ //
345
+ // Requires the following IAM permissions to use this method:
346
+ //
347
+ // - `storage.objects.restore`
348
+ // - `storage.objects.create`
349
+ // - `storage.objects.delete` (only required if overwriting an existing
350
+ // object)
351
+ // - `storage.objects.getIamPolicy` (only required if `projection` is `full`
352
+ // and the relevant bucket
353
+ // has uniform bucket-level access disabled)
354
+ // - `storage.objects.setIamPolicy` (only required if `copySourceAcl` is
355
+ // `true` and the relevant
356
+ // bucket has uniform bucket-level access disabled)
357
+ rpc RestoreObject(RestoreObjectRequest) returns (StorageObject) {
358
+ option (google.api.routing) = {
359
+ routing_parameters { field: "bucket" path_template: "{bucket=**}" }
360
+ };
361
+ option (google.api.method_signature) = "bucket,object,generation";
362
+ }
363
+
364
+ // Cancels an in-progress resumable upload.
365
+ //
366
+ // Any attempts to write to the resumable upload after cancelling the upload
367
+ // fail.
368
+ //
369
+ // The behavior for any in-progress write operations is not guaranteed;
370
+ // they could either complete before the cancellation or fail if the
371
+ // cancellation completes first.
372
+ rpc CancelResumableWrite(CancelResumableWriteRequest)
373
+ returns (CancelResumableWriteResponse) {
374
+ option (google.api.routing) = {
375
+ routing_parameters {
376
+ field: "upload_id"
377
+ path_template: "{bucket=projects/*/buckets/*}/**"
378
+ }
379
+ };
380
+ option (google.api.method_signature) = "upload_id";
381
+ }
382
+
383
+ // Retrieves object metadata.
384
+ //
385
+ // **IAM Permissions**:
386
+ //
387
+ // Requires `storage.objects.get` IAM permission on the bucket.
388
+ // To return object ACLs, the authenticated user must also have
389
+ // the `storage.objects.getIamPolicy` permission.
390
+ rpc GetObject(GetObjectRequest) returns (StorageObject) {
391
+ option (google.api.routing) = {
392
+ routing_parameters { field: "bucket" path_template: "{bucket=**}" }
393
+ };
394
+ option (google.api.method_signature) = "bucket,object";
395
+ option (google.api.method_signature) = "bucket,object,generation";
396
+ }
397
+
398
+ // Retrieves object data.
399
+ //
400
+ // **IAM Permissions**:
401
+ //
402
+ // Requires `storage.objects.get` IAM permission on the bucket.
403
+ rpc ReadObject(ReadObjectRequest) returns (stream ReadObjectResponse) {
404
+ option (google.api.routing) = {
405
+ routing_parameters { field: "bucket" path_template: "{bucket=**}" }
406
+ };
407
+ option (google.api.method_signature) = "bucket,object";
408
+ option (google.api.method_signature) = "bucket,object,generation";
409
+ }
410
+
411
+ // Reads an object's data.
412
+ //
413
+ // This bi-directional API reads data from an object, allowing you to request
414
+ // multiple data ranges within a single stream, even across several messages.
415
+ // If an error occurs with any request, the stream closes with a relevant
416
+ // error code. Since you can have multiple outstanding requests, the error
417
+ // response includes a `BidiReadObjectError` proto in its `details` field,
418
+ // reporting the specific error, if any, for each pending `read_id`.
419
+ //
420
+ // **IAM Permissions**:
421
+ //
422
+ // Requires `storage.objects.get` IAM permission on the bucket.
423
+ //
424
+ rpc BidiReadObject(stream BidiReadObjectRequest)
425
+ returns (stream BidiReadObjectResponse) {
426
+ option (google.api.routing) = {
427
+ routing_parameters {
428
+ field: "read_object_spec.bucket"
429
+ path_template: "{bucket=**}"
430
+ }
431
+ };
432
+ }
433
+
434
+ // Updates an object's metadata.
435
+ // Equivalent to JSON API's `storage.objects.patch` method.
436
+ //
437
+ // **IAM Permissions**:
438
+ //
439
+ // Requires `storage.objects.update` IAM permission on the bucket.
440
+ rpc UpdateObject(UpdateObjectRequest) returns (StorageObject) {
441
+ option (google.api.routing) = {
442
+ routing_parameters { field: "object.bucket" path_template: "{bucket=**}" }
443
+ };
444
+ option (google.api.method_signature) = "object,update_mask";
445
+ }
446
+
447
+ // Stores a new object and metadata.
448
+ //
449
+ // An object can be written either in a single message stream or in a
450
+ // resumable sequence of message streams. To write using a single stream,
451
+ // the client should include in the first message of the stream an
452
+ // `WriteObjectSpec` describing the destination bucket, object, and any
453
+ // preconditions. Additionally, the final message must set 'finish_write' to
454
+ // true, or else it is an error.
455
+ //
456
+ // For a resumable write, the client should instead call
457
+ // `StartResumableWrite()`, populating a `WriteObjectSpec` into that request.
458
+ // They should then attach the returned `upload_id` to the first message of
459
+ // each following call to `WriteObject`. If the stream is closed before
460
+ // finishing the upload (either explicitly by the client or due to a network
461
+ // error or an error response from the server), the client should do as
462
+ // follows:
463
+ //
464
+ // - Check the result Status of the stream, to determine if writing can be
465
+ // resumed on this stream or must be restarted from scratch (by calling
466
+ // `StartResumableWrite()`). The resumable errors are `DEADLINE_EXCEEDED`,
467
+ // `INTERNAL`, and `UNAVAILABLE`. For each case, the client should use
468
+ // binary exponential backoff before retrying. Additionally, writes can
469
+ // be resumed after `RESOURCE_EXHAUSTED` errors, but only after taking
470
+ // appropriate measures, which might include reducing aggregate send rate
471
+ // across clients and/or requesting a quota increase for your project.
472
+ // - If the call to `WriteObject` returns `ABORTED`, that indicates
473
+ // concurrent attempts to update the resumable write, caused either by
474
+ // multiple racing clients or by a single client where the previous
475
+ // request was timed out on the client side but nonetheless reached the
476
+ // server. In this case the client should take steps to prevent further
477
+ // concurrent writes. For example, increase the timeouts and stop using
478
+ // more than one process to perform the upload. Follow the steps below for
479
+ // resuming the upload.
480
+ // - For resumable errors, the client should call `QueryWriteStatus()` and
481
+ // then continue writing from the returned `persisted_size`. This might be
482
+ // less than the amount of data the client previously sent. Note also that
483
+ // it is acceptable to send data starting at an offset earlier than the
484
+ // returned `persisted_size`; in this case, the service skips data at
485
+ // offsets that were already persisted (without checking that it matches
486
+ // the previously written data), and write only the data starting from the
487
+ // persisted offset. Even though the data isn't written, it might still
488
+ // incur a performance cost over resuming at the correct write offset.
489
+ // This behavior can make client-side handling simpler in some cases.
490
+ // - Clients must only send data that is a multiple of 256 KiB per message,
491
+ // unless the object is being finished with `finish_write` set to `true`.
492
+ //
493
+ // The service does not view the object as complete until the client has
494
+ // sent a `WriteObjectRequest` with `finish_write` set to `true`. Sending any
495
+ // requests on a stream after sending a request with `finish_write` set to
496
+ // `true` causes an error. The client must check the response it
497
+ // receives to determine how much data the service is able to commit and
498
+ // whether the service views the object as complete.
499
+ //
500
+ // Attempting to resume an already finalized object results in an `OK`
501
+ // status, with a `WriteObjectResponse` containing the finalized object's
502
+ // metadata.
503
+ //
504
+ // Alternatively, you can use the `BidiWriteObject` operation to write an
505
+ // object with controls over flushing and the ability to fetch the ability to
506
+ // determine the current persisted size.
507
+ //
508
+ // **IAM Permissions**:
509
+ //
510
+ // Requires `storage.objects.create`
511
+ // IAM permission on
512
+ // the bucket.
513
+ rpc WriteObject(stream WriteObjectRequest) returns (WriteObjectResponse) {}
514
+
515
+ // Stores a new object and metadata.
516
+ //
517
+ // This is similar to the `WriteObject` call with the added support for
518
+ // manual flushing of persisted state, and the ability to determine current
519
+ // persisted size without closing the stream.
520
+ //
521
+ // The client might specify one or both of the `state_lookup` and `flush`
522
+ // fields in each `BidiWriteObjectRequest`. If `flush` is specified, the data
523
+ // written so far is persisted to storage. If `state_lookup` is specified, the
524
+ // service responds with a `BidiWriteObjectResponse` that contains the
525
+ // persisted size. If both `flush` and `state_lookup` are specified, the flush
526
+ // always occurs before a `state_lookup`, so that both might be set in the
527
+ // same request and the returned state is the state of the object
528
+ // post-flush. When the stream is closed, a `BidiWriteObjectResponse`
529
+ // is always sent to the client, regardless of the value of `state_lookup`.
530
+ rpc BidiWriteObject(stream BidiWriteObjectRequest)
531
+ returns (stream BidiWriteObjectResponse) {}
532
+
533
+ // Retrieves a list of objects matching the criteria.
534
+ //
535
+ // **IAM Permissions**:
536
+ //
537
+ // The authenticated user requires `storage.objects.list`
538
+ // IAM permission to use this method. To return object ACLs, the
539
+ // authenticated user must also
540
+ // have the `storage.objects.getIamPolicy` permission.
541
+ rpc ListObjects(ListObjectsRequest) returns (ListObjectsResponse) {
542
+ option (google.api.routing) = {
543
+ routing_parameters { field: "parent" path_template: "{bucket=**}" }
544
+ };
545
+ option (google.api.method_signature) = "parent";
546
+ }
547
+
548
+ // Rewrites a source object to a destination object. Optionally overrides
549
+ // metadata.
550
+ rpc RewriteObject(RewriteObjectRequest) returns (RewriteResponse) {
551
+ option (google.api.routing) = {
552
+ routing_parameters { field: "source_bucket" }
553
+ routing_parameters {
554
+ field: "destination_bucket"
555
+ path_template: "{bucket=**}"
556
+ }
557
+ };
558
+ }
559
+
560
+ // Starts a resumable write operation. This
561
+ // method is part of the Resumable
562
+ // upload feature.
563
+ // This allows you to upload large objects in multiple chunks, which is more
564
+ // resilient to network interruptions than a single upload. The validity
565
+ // duration of the write operation, and the consequences of it becoming
566
+ // invalid, are service-dependent.
567
+ //
568
+ // **IAM Permissions**:
569
+ //
570
+ // Requires `storage.objects.create` IAM permission on the bucket.
571
+ rpc StartResumableWrite(StartResumableWriteRequest)
572
+ returns (StartResumableWriteResponse) {
573
+ option (google.api.routing) = {
574
+ routing_parameters {
575
+ field: "write_object_spec.resource.bucket"
576
+ path_template: "{bucket=**}"
577
+ }
578
+ };
579
+ }
580
+
581
+ // Determines the `persisted_size` of an object that is being written. This
582
+ // method is part of the resumable
583
+ // upload feature.
584
+ // The returned value is the size of the object that has been persisted so
585
+ // far. The value can be used as the `write_offset` for the next `Write()`
586
+ // call.
587
+ //
588
+ // If the object does not exist, meaning if it was deleted, or the
589
+ // first `Write()` has not yet reached the service, this method returns the
590
+ // error `NOT_FOUND`.
591
+ //
592
+ // This method is useful for clients that buffer data and need to know which
593
+ // data can be safely evicted. The client can call `QueryWriteStatus()` at any
594
+ // time to determine how much data has been logged for this object.
595
+ // For any sequence of `QueryWriteStatus()` calls for a given
596
+ // object name, the sequence of returned `persisted_size` values are
597
+ // non-decreasing.
598
+ rpc QueryWriteStatus(QueryWriteStatusRequest)
599
+ returns (QueryWriteStatusResponse) {
600
+ option (google.api.routing) = {
601
+ routing_parameters {
602
+ field: "upload_id"
603
+ path_template: "{bucket=projects/*/buckets/*}/**"
604
+ }
605
+ };
606
+ option (google.api.method_signature) = "upload_id";
607
+ }
608
+
609
+ // Moves the source object to the destination object in the same bucket.
610
+ // This operation moves a source object to a destination object in the
611
+ // same bucket by renaming the object. The move itself is an atomic
612
+ // transaction, ensuring all steps either complete successfully or no
613
+ // changes are made.
614
+ //
615
+ // **IAM Permissions**:
616
+ //
617
+ // Requires the following IAM permissions to use this method:
618
+ //
619
+ // - `storage.objects.move`
620
+ // - `storage.objects.create`
621
+ // - `storage.objects.delete` (only required if overwriting an existing
622
+ // object)
623
+ rpc MoveObject(MoveObjectRequest) returns (StorageObject) {
624
+ option (google.api.routing) = {
625
+ routing_parameters { field: "bucket" path_template: "{bucket=**}" }
626
+ };
627
+ option (google.api.method_signature) =
628
+ "bucket,source_object,destination_object";
629
+ }
630
+ }
631
+
632
+ // Request message for [DeleteBucket][google.storage.v2.Storage.DeleteBucket].
633
+ message DeleteBucketRequest {
634
+ // Required. Name of a bucket to delete.
635
+ string name = 1 [
636
+ (google.api.field_behavior) = REQUIRED,
637
+ (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" }
638
+ ];
639
+
640
+ // If set, only deletes the bucket if its metageneration matches this value.
641
+ optional int64 if_metageneration_match = 2;
642
+
643
+ // If set, only deletes the bucket if its metageneration does not match this
644
+ // value.
645
+ optional int64 if_metageneration_not_match = 3;
646
+ }
647
+
648
+ // Request message for [GetBucket][google.storage.v2.Storage.GetBucket].
649
+ message GetBucketRequest {
650
+ // Required. Name of a bucket.
651
+ string name = 1 [
652
+ (google.api.field_behavior) = REQUIRED,
653
+ (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" }
654
+ ];
655
+
656
+ // If set, only gets the bucket metadata if its metageneration matches this
657
+ // value.
658
+ optional int64 if_metageneration_match = 2;
659
+
660
+ // If set, and if the bucket's current metageneration matches the specified
661
+ // value, the request returns an error.
662
+ optional int64 if_metageneration_not_match = 3;
663
+
664
+ // Mask specifying which fields to read.
665
+ // A `*` field might be used to indicate all fields.
666
+ // If no mask is specified, it defaults to all fields.
667
+ optional google.protobuf.FieldMask read_mask = 5;
668
+ }
669
+
670
+ // Request message for [CreateBucket][google.storage.v2.Storage.CreateBucket].
671
+ message CreateBucketRequest {
672
+ // Required. The project to which this bucket belongs. This field must either
673
+ // be empty or `projects/_`. The project ID that owns this bucket should be
674
+ // specified in the `bucket.project` field.
675
+ string parent = 1 [
676
+ (google.api.field_behavior) = REQUIRED,
677
+ (google.api.resource_reference) = {
678
+ child_type: "storage.googleapis.com/Bucket"
679
+ }
680
+ ];
681
+
682
+ // Optional. Properties of the new bucket being inserted.
683
+ // The name of the bucket is specified in the `bucket_id` field. Populating
684
+ // `bucket.name` field results in an error.
685
+ // The project of the bucket must be specified in the `bucket.project` field.
686
+ // This field must be in `projects/{projectIdentifier}` format,
687
+ // {projectIdentifier} can be the project ID or project number. The `parent`
688
+ // field must be either empty or `projects/_`.
689
+ Bucket bucket = 2 [(google.api.field_behavior) = OPTIONAL];
690
+
691
+ // Required. The ID to use for this bucket, which becomes the final component
692
+ // of the bucket's resource name. For example, the value `foo` might result in
693
+ // a bucket with the name `projects/123456/buckets/foo`.
694
+ string bucket_id = 3 [(google.api.field_behavior) = REQUIRED];
695
+
696
+ // Optional. Apply a predefined set of access controls to this bucket.
697
+ // Valid values are `authenticatedRead`, `private`, `projectPrivate`,
698
+ // `publicRead`, or `publicReadWrite`.
699
+ string predefined_acl = 6 [(google.api.field_behavior) = OPTIONAL];
700
+
701
+ // Optional. Apply a predefined set of default object access controls to this
702
+ // bucket. Valid values are `authenticatedRead`, `bucketOwnerFullControl`,
703
+ // `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`.
704
+ string predefined_default_object_acl = 7
705
+ [(google.api.field_behavior) = OPTIONAL];
706
+
707
+ // Optional. If true, enable object retention on the bucket.
708
+ bool enable_object_retention = 9 [(google.api.field_behavior) = OPTIONAL];
709
+ }
710
+
711
+ // Request message for [ListBuckets][google.storage.v2.Storage.ListBuckets].
712
+ message ListBucketsRequest {
713
+ // Required. The project whose buckets we are listing.
714
+ string parent = 1 [
715
+ (google.api.field_behavior) = REQUIRED,
716
+ (google.api.resource_reference) = {
717
+ child_type: "storage.googleapis.com/Bucket"
718
+ }
719
+ ];
720
+
721
+ // Optional. Maximum number of buckets to return in a single response. The
722
+ // service uses this parameter or `1,000` items, whichever is smaller. If
723
+ // `acl` is present in the `read_mask`, the service uses this parameter of
724
+ // `200` items, whichever is smaller.
725
+ int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
726
+
727
+ // Optional. A previously-returned page token representing part of the larger
728
+ // set of results to view.
729
+ string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
730
+
731
+ // Optional. Filter results to buckets whose names begin with this prefix.
732
+ string prefix = 4 [(google.api.field_behavior) = OPTIONAL];
733
+
734
+ // Mask specifying which fields to read from each result.
735
+ // If no mask is specified, it defaults to all fields except `items.
736
+ // owner`, `items.acl`, and `items.default_object_acl`.
737
+ // `*` might be used to mean "all fields".
738
+ optional google.protobuf.FieldMask read_mask = 5;
739
+
740
+ // Optional. Allows listing of buckets, even if there are buckets that are
741
+ // unreachable.
742
+ bool return_partial_success = 9 [(google.api.field_behavior) = OPTIONAL];
743
+ }
744
+
745
+ // Response message for [ListBuckets][google.storage.v2.Storage.ListBuckets].
746
+ message ListBucketsResponse {
747
+ // The list of items.
748
+ repeated Bucket buckets = 1;
749
+
750
+ // The continuation token, used to page through large result sets. Provide
751
+ // this value in a subsequent request to return the next page of results.
752
+ string next_page_token = 2;
753
+
754
+ // Unreachable resources.
755
+ // This field can only be present if the caller specified
756
+ // return_partial_success to be true in the request to receive indications
757
+ // of temporarily missing resources.
758
+ // unreachable might be:
759
+ // unreachable = [
760
+ // "projects/_/buckets/bucket1",
761
+ // "projects/_/buckets/bucket2",
762
+ // "projects/_/buckets/bucket3",
763
+ // ]
764
+ repeated string unreachable = 3;
765
+ }
766
+
767
+ // Request message for
768
+ // [LockBucketRetentionPolicy][google.storage.v2.Storage.LockBucketRetentionPolicy].
769
+ message LockBucketRetentionPolicyRequest {
770
+ // Required. Name of a bucket.
771
+ string bucket = 1 [
772
+ (google.api.field_behavior) = REQUIRED,
773
+ (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" }
774
+ ];
775
+
776
+ // Required. Makes the operation conditional on whether bucket's current
777
+ // metageneration matches the given value. Must be positive.
778
+ int64 if_metageneration_match = 2 [(google.api.field_behavior) = REQUIRED];
779
+ }
780
+
781
+ // Request for [UpdateBucket][google.storage.v2.Storage.UpdateBucket] method.
782
+ message UpdateBucketRequest {
783
+ // Required. The bucket to update.
784
+ // The bucket's `name` field is used to identify the bucket.
785
+ Bucket bucket = 1 [(google.api.field_behavior) = REQUIRED];
786
+
787
+ // If set, the request modifies the bucket if its metageneration matches this
788
+ // value.
789
+ optional int64 if_metageneration_match = 2;
790
+
791
+ // If set, the request modifies the bucket if its metageneration doesn't
792
+ // match this value.
793
+ optional int64 if_metageneration_not_match = 3;
794
+
795
+ // Optional. Apply a predefined set of access controls to this bucket.
796
+ // Valid values are `authenticatedRead`, `private`, `projectPrivate`,
797
+ // `publicRead`, or `publicReadWrite`.
798
+ string predefined_acl = 8 [(google.api.field_behavior) = OPTIONAL];
799
+
800
+ // Optional. Apply a predefined set of default object access controls to this
801
+ // bucket. Valid values are `authenticatedRead`, `bucketOwnerFullControl`,
802
+ // `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`.
803
+ string predefined_default_object_acl = 9
804
+ [(google.api.field_behavior) = OPTIONAL];
805
+
806
+ // Required. List of fields to be updated.
807
+ //
808
+ // To specify ALL fields, equivalent to the JSON API's "update" function,
809
+ // specify a single field with the value `*`. Note: not recommended. If a new
810
+ // field is introduced at a later time, an older client updating with the `*`
811
+ // might accidentally reset the new field's value.
812
+ //
813
+ // Not specifying any fields is an error.
814
+ google.protobuf.FieldMask update_mask = 6
815
+ [(google.api.field_behavior) = REQUIRED];
816
+ }
817
+
818
+ // Request message for [ComposeObject][google.storage.v2.Storage.ComposeObject].
819
+ message ComposeObjectRequest {
820
+ // Description of a source object for a composition request.
821
+ message SourceObject {
822
+ // Preconditions for a source object of a composition request.
823
+ message ObjectPreconditions {
824
+ // Only perform the composition if the generation of the source object
825
+ // that would be used matches this value. If this value and a generation
826
+ // are both specified, they must be the same value or the call fails.
827
+ optional int64 if_generation_match = 1;
828
+ }
829
+
830
+ // Required. The source object's name. All source objects must reside in the
831
+ // same bucket.
832
+ string name = 1 [(google.api.field_behavior) = REQUIRED];
833
+
834
+ // Optional. The generation of this object to use as the source.
835
+ int64 generation = 2 [(google.api.field_behavior) = OPTIONAL];
836
+
837
+ // Optional. Conditions that must be met for this operation to execute.
838
+ ObjectPreconditions object_preconditions = 3
839
+ [(google.api.field_behavior) = OPTIONAL];
840
+ }
841
+
842
+ // Required. Properties of the resulting object.
843
+ StorageObject destination = 1 [(google.api.field_behavior) = REQUIRED];
844
+
845
+ // Optional. The list of source objects that is concatenated into a single
846
+ // object.
847
+ repeated SourceObject source_objects = 2
848
+ [(google.api.field_behavior) = OPTIONAL];
849
+
850
+ // Optional. Apply a predefined set of access controls to the destination
851
+ // object. Valid values are `authenticatedRead`, `bucketOwnerFullControl`,
852
+ // `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`.
853
+ string destination_predefined_acl = 9
854
+ [(google.api.field_behavior) = OPTIONAL];
855
+
856
+ // Makes the operation conditional on whether the object's current generation
857
+ // matches the given value. Setting to 0 makes the operation succeed only if
858
+ // there are no live versions of the object.
859
+ optional int64 if_generation_match = 4;
860
+
861
+ // Makes the operation conditional on whether the object's current
862
+ // metageneration matches the given value.
863
+ optional int64 if_metageneration_match = 5;
864
+
865
+ // Optional. Resource name of the Cloud KMS key, of the form
866
+ // `projects/my-project/locations/my-location/keyRings/my-kr/cryptoKeys/my-key`,
867
+ // that is used to encrypt the object. Overrides the object
868
+ // metadata's `kms_key_name` value, if any.
869
+ string kms_key = 6 [
870
+ (google.api.field_behavior) = OPTIONAL,
871
+ (google.api.resource_reference) = {
872
+ type: "cloudkms.googleapis.com/CryptoKey"
873
+ }
874
+ ];
875
+
876
+ // Optional. A set of parameters common to Storage API requests concerning an
877
+ // object.
878
+ CommonObjectRequestParams common_object_request_params = 7
879
+ [(google.api.field_behavior) = OPTIONAL];
880
+
881
+ // Optional. The checksums of the complete object. This is validated against
882
+ // the combined checksums of the component objects.
883
+ ObjectChecksums object_checksums = 10
884
+ [(google.api.field_behavior) = OPTIONAL];
885
+
886
+ // Whether the source objects should be deleted in the compose request.
887
+ optional bool delete_source_objects = 11;
888
+ }
889
+
890
+ // Request message for deleting an object.
891
+ message DeleteObjectRequest {
892
+ // Required. Name of the bucket in which the object resides.
893
+ string bucket = 1 [
894
+ (google.api.field_behavior) = REQUIRED,
895
+ (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" }
896
+ ];
897
+
898
+ // Required. The name of the finalized object to delete.
899
+ // Note: If you want to delete an unfinalized resumable upload please use
900
+ // `CancelResumableWrite`.
901
+ string object = 2 [(google.api.field_behavior) = REQUIRED];
902
+
903
+ // Optional. If present, permanently deletes a specific revision of this
904
+ // object (as opposed to the latest version, the default).
905
+ int64 generation = 4 [(google.api.field_behavior) = OPTIONAL];
906
+
907
+ // Makes the operation conditional on whether the object's current generation
908
+ // matches the given value. Setting to 0 makes the operation succeed only if
909
+ // there are no live versions of the object.
910
+ optional int64 if_generation_match = 5;
911
+
912
+ // Makes the operation conditional on whether the object's live generation
913
+ // does not match the given value. If no live object exists, the precondition
914
+ // fails. Setting to 0 makes the operation succeed only if there is a live
915
+ // version of the object.
916
+ optional int64 if_generation_not_match = 6;
917
+
918
+ // Makes the operation conditional on whether the object's current
919
+ // metageneration matches the given value.
920
+ optional int64 if_metageneration_match = 7;
921
+
922
+ // Makes the operation conditional on whether the object's current
923
+ // metageneration does not match the given value.
924
+ optional int64 if_metageneration_not_match = 8;
925
+
926
+ // Optional. A set of parameters common to Storage API requests concerning an
927
+ // object.
928
+ CommonObjectRequestParams common_object_request_params = 10
929
+ [(google.api.field_behavior) = OPTIONAL];
930
+ }
931
+
932
+ // Request message for
933
+ // [RestoreObject][google.storage.v2.Storage.RestoreObject].
934
+ // `bucket`, `object`, and `generation` **must** be set.
935
+ message RestoreObjectRequest {
936
+ // Required. Name of the bucket in which the object resides.
937
+ string bucket = 1 [
938
+ (google.api.field_behavior) = REQUIRED,
939
+ (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" }
940
+ ];
941
+
942
+ // Required. The name of the object to restore.
943
+ string object = 2 [(google.api.field_behavior) = REQUIRED];
944
+
945
+ // Required. The specific revision of the object to restore.
946
+ int64 generation = 3 [(google.api.field_behavior) = REQUIRED];
947
+
948
+ // Optional. Restore token used to differentiate soft-deleted objects with the
949
+ // same name and generation. Only applicable for hierarchical namespace
950
+ // buckets. This parameter is optional, and is only required in the rare case
951
+ // when there are multiple soft-deleted objects with the same name and
952
+ // generation.
953
+ string restore_token = 11 [(google.api.field_behavior) = OPTIONAL];
954
+
955
+ // Makes the operation conditional on whether the object's current generation
956
+ // matches the given value. Setting to 0 makes the operation succeed only if
957
+ // there are no live versions of the object.
958
+ optional int64 if_generation_match = 4;
959
+
960
+ // Makes the operation conditional on whether the object's live generation
961
+ // does not match the given value. If no live object exists, the precondition
962
+ // fails. Setting to 0 makes the operation succeed only if there is a live
963
+ // version of the object.
964
+ optional int64 if_generation_not_match = 5;
965
+
966
+ // Makes the operation conditional on whether the object's current
967
+ // metageneration matches the given value.
968
+ optional int64 if_metageneration_match = 6;
969
+
970
+ // Makes the operation conditional on whether the object's current
971
+ // metageneration does not match the given value.
972
+ optional int64 if_metageneration_not_match = 7;
973
+
974
+ // If false or unset, the bucket's default object ACL is used.
975
+ // If true, copy the source object's access controls.
976
+ // Return an error if bucket has UBLA enabled.
977
+ optional bool copy_source_acl = 9;
978
+
979
+ // Optional. A set of parameters common to Storage API requests concerning an
980
+ // object.
981
+ CommonObjectRequestParams common_object_request_params = 8
982
+ [(google.api.field_behavior) = OPTIONAL];
983
+ }
984
+
985
+ // Request message for
986
+ // [CancelResumableWrite][google.storage.v2.Storage.CancelResumableWrite].
987
+ message CancelResumableWriteRequest {
988
+ // Required. The upload_id of the resumable upload to cancel. This should be
989
+ // copied from the `upload_id` field of `StartResumableWriteResponse`.
990
+ string upload_id = 1 [(google.api.field_behavior) = REQUIRED];
991
+ }
992
+
993
+ // Empty response message for canceling an in-progress resumable upload, is
994
+ // extended as needed.
995
+ message CancelResumableWriteResponse {}
996
+
997
+ // Request message for [ReadObject][google.storage.v2.Storage.ReadObject].
998
+ message ReadObjectRequest {
999
+ // Required. The name of the bucket containing the object to read.
1000
+ string bucket = 1 [
1001
+ (google.api.field_behavior) = REQUIRED,
1002
+ (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" }
1003
+ ];
1004
+
1005
+ // Required. The name of the object to read.
1006
+ string object = 2 [(google.api.field_behavior) = REQUIRED];
1007
+
1008
+ // Optional. If present, selects a specific revision of this object (as
1009
+ // opposed to the latest version, the default).
1010
+ int64 generation = 3 [(google.api.field_behavior) = OPTIONAL];
1011
+
1012
+ // Optional. The offset for the first byte to return in the read, relative to
1013
+ // the start of the object.
1014
+ //
1015
+ // A negative `read_offset` value is interpreted as the number of bytes
1016
+ // back from the end of the object to be returned. For example, if an object's
1017
+ // length is `15` bytes, a `ReadObjectRequest` with `read_offset` = `-5` and
1018
+ // `read_limit` = `3` would return bytes `10` through `12` of the object.
1019
+ // Requesting a negative offset with magnitude larger than the size of the
1020
+ // object returns the entire object.
1021
+ int64 read_offset = 4 [(google.api.field_behavior) = OPTIONAL];
1022
+
1023
+ // Optional. The maximum number of `data` bytes the server is allowed to
1024
+ // return in the sum of all `StorageObject` messages. A `read_limit` of zero
1025
+ // indicates that there is no limit, and a negative `read_limit` causes an
1026
+ // error.
1027
+ //
1028
+ // If the stream returns fewer bytes than allowed by the `read_limit` and no
1029
+ // error occurred, the stream includes all data from the `read_offset` to the
1030
+ // end of the resource.
1031
+ int64 read_limit = 5 [(google.api.field_behavior) = OPTIONAL];
1032
+
1033
+ // Makes the operation conditional on whether the object's current generation
1034
+ // matches the given value. Setting to 0 makes the operation succeed only if
1035
+ // there are no live versions of the object.
1036
+ optional int64 if_generation_match = 6;
1037
+
1038
+ // Makes the operation conditional on whether the object's live generation
1039
+ // does not match the given value. If no live object exists, the precondition
1040
+ // fails. Setting to 0 makes the operation succeed only if there is a live
1041
+ // version of the object.
1042
+ optional int64 if_generation_not_match = 7;
1043
+
1044
+ // Makes the operation conditional on whether the object's current
1045
+ // metageneration matches the given value.
1046
+ optional int64 if_metageneration_match = 8;
1047
+
1048
+ // Makes the operation conditional on whether the object's current
1049
+ // metageneration does not match the given value.
1050
+ optional int64 if_metageneration_not_match = 9;
1051
+
1052
+ // Optional. A set of parameters common to Storage API requests concerning an
1053
+ // object.
1054
+ CommonObjectRequestParams common_object_request_params = 10
1055
+ [(google.api.field_behavior) = OPTIONAL];
1056
+
1057
+ // Mask specifying which fields to read.
1058
+ // The `checksummed_data` field and its children are always present.
1059
+ // If no mask is specified, it defaults to all fields except `metadata.
1060
+ // owner` and `metadata.acl`.
1061
+ // `*` might be used to mean "all fields".
1062
+ optional google.protobuf.FieldMask read_mask = 12;
1063
+ }
1064
+
1065
+ // Request message for [GetObject][google.storage.v2.Storage.GetObject].
1066
+ message GetObjectRequest {
1067
+ // Required. Name of the bucket in which the object resides.
1068
+ string bucket = 1 [
1069
+ (google.api.field_behavior) = REQUIRED,
1070
+ (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" }
1071
+ ];
1072
+
1073
+ // Required. Name of the object.
1074
+ string object = 2 [(google.api.field_behavior) = REQUIRED];
1075
+
1076
+ // Optional. If present, selects a specific revision of this object (as
1077
+ // opposed to the latest version, the default).
1078
+ int64 generation = 3 [(google.api.field_behavior) = OPTIONAL];
1079
+
1080
+ // If true, return the soft-deleted version of this object.
1081
+ optional bool soft_deleted = 11;
1082
+
1083
+ // Makes the operation conditional on whether the object's current generation
1084
+ // matches the given value. Setting to 0 makes the operation succeed only if
1085
+ // there are no live versions of the object.
1086
+ optional int64 if_generation_match = 4;
1087
+
1088
+ // Makes the operation conditional on whether the object's live generation
1089
+ // does not match the given value. If no live object exists, the precondition
1090
+ // fails. Setting to 0 makes the operation succeed only if there is a live
1091
+ // version of the object.
1092
+ optional int64 if_generation_not_match = 5;
1093
+
1094
+ // Makes the operation conditional on whether the object's current
1095
+ // metageneration matches the given value.
1096
+ optional int64 if_metageneration_match = 6;
1097
+
1098
+ // Makes the operation conditional on whether the object's current
1099
+ // metageneration does not match the given value.
1100
+ optional int64 if_metageneration_not_match = 7;
1101
+
1102
+ // Optional. A set of parameters common to Storage API requests concerning an
1103
+ // object.
1104
+ CommonObjectRequestParams common_object_request_params = 8
1105
+ [(google.api.field_behavior) = OPTIONAL];
1106
+
1107
+ // Mask specifying which fields to read.
1108
+ // If no mask is specified, it defaults to all fields except `metadata.
1109
+ // acl` and `metadata.owner`.
1110
+ // `*` might be used to mean "all fields".
1111
+ optional google.protobuf.FieldMask read_mask = 10;
1112
+
1113
+ // Optional. Restore token used to differentiate soft-deleted objects with the
1114
+ // same name and generation. Only applicable for hierarchical namespace
1115
+ // buckets and if `soft_deleted` is set to `true`. This parameter is optional,
1116
+ // and is only required in the rare case when there are multiple soft-deleted
1117
+ // objects with the same `name` and `generation`.
1118
+ string restore_token = 12 [(google.api.field_behavior) = OPTIONAL];
1119
+ }
1120
+
1121
+ // Response message for [ReadObject][google.storage.v2.Storage.ReadObject].
1122
+ message ReadObjectResponse {
1123
+ // A portion of the data for the object. The service might leave `data`
1124
+ // empty for any given `ReadResponse`. This enables the service to inform the
1125
+ // client that the request is still live while it is running an operation to
1126
+ // generate more data.
1127
+ ChecksummedData checksummed_data = 1;
1128
+
1129
+ // The checksums of the complete object. If the object is downloaded in full,
1130
+ // the client should compute one of these checksums over the downloaded object
1131
+ // and compare it against the value provided here.
1132
+ ObjectChecksums object_checksums = 2;
1133
+
1134
+ // If `read_offset` and or `read_limit` is specified on the
1135
+ // `ReadObjectRequest`, `ContentRange` is populated on the first
1136
+ // `ReadObjectResponse` message of the read stream.
1137
+ ContentRange content_range = 3;
1138
+
1139
+ // Metadata of the object whose media is being returned.
1140
+ // Only populated in the first response in the stream.
1141
+ StorageObject metadata = 4;
1142
+ }
1143
+
1144
+ // Describes the object to read in a BidiReadObject request.
1145
+ message BidiReadObjectSpec {
1146
+ // Required. The name of the bucket containing the object to read.
1147
+ string bucket = 1 [
1148
+ (google.api.field_behavior) = REQUIRED,
1149
+ (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" }
1150
+ ];
1151
+
1152
+ // Required. The name of the object to read.
1153
+ string object = 2 [(google.api.field_behavior) = REQUIRED];
1154
+
1155
+ // Optional. If present, selects a specific revision of this object (as
1156
+ // opposed to the latest version, the default).
1157
+ int64 generation = 3 [(google.api.field_behavior) = OPTIONAL];
1158
+
1159
+ // Makes the operation conditional on whether the object's current generation
1160
+ // matches the given value. Setting to 0 makes the operation succeed only if
1161
+ // there are no live versions of the object.
1162
+ optional int64 if_generation_match = 4;
1163
+
1164
+ // Makes the operation conditional on whether the object's live generation
1165
+ // does not match the given value. If no live object exists, the precondition
1166
+ // fails. Setting to 0 makes the operation succeed only if there is a live
1167
+ // version of the object.
1168
+ optional int64 if_generation_not_match = 5;
1169
+
1170
+ // Makes the operation conditional on whether the object's current
1171
+ // metageneration matches the given value.
1172
+ optional int64 if_metageneration_match = 6;
1173
+
1174
+ // Makes the operation conditional on whether the object's current
1175
+ // metageneration does not match the given value.
1176
+ optional int64 if_metageneration_not_match = 7;
1177
+
1178
+ // Optional. A set of parameters common to Storage API requests concerning an
1179
+ // object.
1180
+ CommonObjectRequestParams common_object_request_params = 8
1181
+ [(google.api.field_behavior) = OPTIONAL];
1182
+
1183
+ // Mask specifying which fields to read.
1184
+ // The `checksummed_data` field and its children are always present.
1185
+ // If no mask is specified, it defaults to all fields except `metadata.
1186
+ // owner` and `metadata.acl`.
1187
+ // `*` might be used to mean "all fields".
1188
+ // As per https://google.aip.dev/161, this field is deprecated.
1189
+ // As an alternative, `grpc metadata` can be used:
1190
+ optional google.protobuf.FieldMask read_mask = 12 [deprecated = true];
1191
+
1192
+ // The client can optionally set this field. The read handle is an optimized
1193
+ // way of creating new streams. Read handles are generated and periodically
1194
+ // refreshed from prior reads.
1195
+ optional BidiReadHandle read_handle = 13;
1196
+
1197
+ // The routing token that influences request routing for the stream. Must be
1198
+ // provided if a BidiReadObjectRedirectedError is returned.
1199
+ optional string routing_token = 14;
1200
+ }
1201
+
1202
+ // Request message for
1203
+ // [BidiReadObject][google.storage.v2.Storage.BidiReadObject].
1204
+ message BidiReadObjectRequest {
1205
+ // Optional. The first message of each stream should set this field. If this
1206
+ // is not the first message, an error is returned. Describes the object to
1207
+ // read.
1208
+ BidiReadObjectSpec read_object_spec = 1
1209
+ [(google.api.field_behavior) = OPTIONAL];
1210
+
1211
+ // Optional. Provides a list of 0 or more (up to 100) ranges to read. If a
1212
+ // single range is large enough to require multiple responses, they are
1213
+ // delivered in increasing offset order. There are no ordering guarantees
1214
+ // across ranges. When no ranges are provided, the response message
1215
+ // doesn't include `ObjectRangeData`. For full object downloads, the
1216
+ // offset and size can be set to `0`.
1217
+ repeated ReadRange read_ranges = 8 [(google.api.field_behavior) = OPTIONAL];
1218
+ }
1219
+
1220
+ // Response message for
1221
+ // [BidiReadObject][google.storage.v2.Storage.BidiReadObject].
1222
+ message BidiReadObjectResponse {
1223
+ // A portion of the object's data. The service might leave data
1224
+ // empty for any given `ReadResponse`. This enables the service to inform the
1225
+ // client that the request is still live while it is running an operation to
1226
+ // generate more data.
1227
+ // The service might pipeline multiple responses belonging to different read
1228
+ // requests. Each `ObjectRangeData` entry has a `read_id` that is set
1229
+ // to the same value as the corresponding source read request.
1230
+ repeated ObjectRangeData object_data_ranges = 6;
1231
+
1232
+ // Metadata of the object whose media is being returned.
1233
+ // Only populated in the first response in the stream and not populated when
1234
+ // the stream is opened with a read handle.
1235
+ StorageObject metadata = 4;
1236
+
1237
+ // This field is periodically refreshed, however it might not be set in
1238
+ // every response. It allows the client to more efficiently open subsequent
1239
+ // bidirectional streams to the same object.
1240
+ BidiReadHandle read_handle = 7;
1241
+ }
1242
+
1243
+ // Error proto containing details for a redirected read. This error might be
1244
+ // attached as details for an ABORTED response to BidiReadObject.
1245
+ message BidiReadObjectRedirectedError {
1246
+ // The read handle for the redirected read. If set, the client might use this
1247
+ // in the BidiReadObjectSpec when retrying the read stream.
1248
+ BidiReadHandle read_handle = 1;
1249
+
1250
+ // The routing token the client must use when retrying the read stream.
1251
+ // This value must be provided in the header `x-goog-request-params`, with key
1252
+ // `routing_token` and this string verbatim as the value.
1253
+ optional string routing_token = 2;
1254
+ }
1255
+
1256
+ // Error proto containing details for a redirected write. This error might be
1257
+ // attached as details for an ABORTED response to BidiWriteObject.
1258
+ message BidiWriteObjectRedirectedError {
1259
+ // The routing token the client must use when retrying the write stream.
1260
+ // This value must be provided in the header `x-goog-request-params`, with key
1261
+ // `routing_token` and this string verbatim as the value.
1262
+ optional string routing_token = 1;
1263
+
1264
+ // Opaque value describing a previous write. If set, the client must use this
1265
+ // in an AppendObjectSpec first_message when retrying the write stream. If not
1266
+ // set, clients might retry the original request.
1267
+ optional BidiWriteHandle write_handle = 2;
1268
+
1269
+ // The generation of the object that triggered the redirect. This is set
1270
+ // iff `write_handle` is set. If set, the client must use this in an
1271
+ // `AppendObjectSpec` first_message when retrying the write stream.
1272
+ optional int64 generation = 3;
1273
+ }
1274
+
1275
+ // Error extension proto containing details for all outstanding reads on the
1276
+ // failed stream
1277
+ message BidiReadObjectError {
1278
+ // The error code for each outstanding read_range
1279
+ repeated ReadRangeError read_range_errors = 1;
1280
+ }
1281
+
1282
+ // Error extension proto containing details for a single range read
1283
+ message ReadRangeError {
1284
+ // The id of the corresponding read_range
1285
+ int64 read_id = 1;
1286
+
1287
+ // The status which should be an enum value of [google.rpc.Code].
1288
+ google.rpc.Status status = 2;
1289
+ }
1290
+
1291
+ // Describes a range of bytes to read in a `BidiReadObjectRanges` request.
1292
+ message ReadRange {
1293
+ // Required. The offset for the first byte to return in the read, relative to
1294
+ // the start of the object.
1295
+ //
1296
+ // A negative read_offset value is interpreted as the number of bytes
1297
+ // back from the end of the object to be returned. For example, if an object's
1298
+ // length is 15 bytes, a `ReadObjectRequest` with `read_offset` = -5 and
1299
+ // `read_length` = 3 would return bytes 10 through 12 of the object.
1300
+ // Requesting a negative offset with magnitude larger than the size of the
1301
+ // object is equivalent to `read_offset` = 0. A `read_offset` larger than the
1302
+ // size of the object results in an `OutOfRange` error.
1303
+ int64 read_offset = 1 [(google.api.field_behavior) = REQUIRED];
1304
+
1305
+ // Optional. The maximum number of data bytes the server is allowed to return
1306
+ // across all response messages with the same `read_id`. A `read_length` of
1307
+ // zero indicates to read until the resource end, and a negative `read_length`
1308
+ // causes an `OutOfRange` error. If the stream returns fewer bytes than
1309
+ // allowed by the `read_length` and no error occurred, the stream includes all
1310
+ // data from the `read_offset` to the resource end.
1311
+ int64 read_length = 2 [(google.api.field_behavior) = OPTIONAL];
1312
+
1313
+ // Required. Read identifier provided by the client. When the client issues
1314
+ // more than one outstanding `ReadRange` on the same stream, responses can be
1315
+ // mapped back to their corresponding requests using this value. Clients must
1316
+ // ensure that all outstanding requests have different read_id values. The
1317
+ // server might close the stream with an error if this condition is not met.
1318
+ int64 read_id = 3 [(google.api.field_behavior) = REQUIRED];
1319
+ }
1320
+
1321
+ // Contains data and metadata for a range of an object.
1322
+ message ObjectRangeData {
1323
+ // A portion of the data for the object.
1324
+ ChecksummedData checksummed_data = 1;
1325
+
1326
+ // The `ReadRange` describes the content being returned with `read_id` set to
1327
+ // the corresponding `ReadObjectRequest` in the stream. Multiple
1328
+ // `ObjectRangeData` messages might have the same read_id but increasing
1329
+ // offsets. `ReadObjectResponse` messages with the same `read_id` are
1330
+ // guaranteed to be delivered in increasing offset order.
1331
+ ReadRange read_range = 2;
1332
+
1333
+ // If set, indicates there are no more bytes to read for the given ReadRange.
1334
+ bool range_end = 3;
1335
+ }
1336
+
1337
+ // `BidiReadHandle` contains a handle from a previous `BiDiReadObject`
1338
+ // invocation. The client can use this instead of `BidiReadObjectSpec` as an
1339
+ // optimized way of opening subsequent bidirectional streams to the same object.
1340
+ message BidiReadHandle {
1341
+ // Required. Opaque value describing a previous read.
1342
+ bytes handle = 1 [(google.api.field_behavior) = REQUIRED];
1343
+ }
1344
+
1345
+ // `BidiWriteHandle` contains a handle from a previous `BidiWriteObject`
1346
+ // invocation. The client can use this instead of `BidiReadObjectSpec` as an
1347
+ // optimized way of opening subsequent bidirectional streams to the same object.
1348
+ message BidiWriteHandle {
1349
+ // Required. Opaque value describing a previous write.
1350
+ bytes handle = 1 [(google.api.field_behavior) = REQUIRED];
1351
+ }
1352
+
1353
+ // Describes an attempt to insert an object, possibly over multiple requests.
1354
+ message WriteObjectSpec {
1355
+ // Required. Destination object, including its name and its metadata.
1356
+ StorageObject resource = 1 [(google.api.field_behavior) = REQUIRED];
1357
+
1358
+ // Optional. Apply a predefined set of access controls to this object.
1359
+ // Valid values are `authenticatedRead`, `bucketOwnerFullControl`,
1360
+ // `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`.
1361
+ string predefined_acl = 7 [(google.api.field_behavior) = OPTIONAL];
1362
+
1363
+ // Makes the operation conditional on whether the object's current
1364
+ // generation matches the given value. Setting to `0` makes the operation
1365
+ // succeed only if there are no live versions of the object.
1366
+ optional int64 if_generation_match = 3;
1367
+
1368
+ // Makes the operation conditional on whether the object's live
1369
+ // generation does not match the given value. If no live object exists, the
1370
+ // precondition fails. Setting to `0` makes the operation succeed only if
1371
+ // there is a live version of the object.
1372
+ optional int64 if_generation_not_match = 4;
1373
+
1374
+ // Makes the operation conditional on whether the object's current
1375
+ // metageneration matches the given value.
1376
+ optional int64 if_metageneration_match = 5;
1377
+
1378
+ // Makes the operation conditional on whether the object's current
1379
+ // metageneration does not match the given value.
1380
+ optional int64 if_metageneration_not_match = 6;
1381
+
1382
+ // The expected final object size being uploaded.
1383
+ // If this value is set, closing the stream after writing fewer or more than
1384
+ // `object_size` bytes results in an `OUT_OF_RANGE` error.
1385
+ //
1386
+ // This situation is considered a client error, and if such an error occurs
1387
+ // you must start the upload over from scratch, this time sending the correct
1388
+ // number of bytes.
1389
+ optional int64 object_size = 8;
1390
+
1391
+ // If `true`, the object is created in appendable mode.
1392
+ // This field might only be set when using `BidiWriteObject`.
1393
+ optional bool appendable = 9;
1394
+ }
1395
+
1396
+ // Request message for [WriteObject][google.storage.v2.Storage.WriteObject].
1397
+ message WriteObjectRequest {
1398
+ // The first message of each stream should set one of the following.
1399
+ oneof first_message {
1400
+ // For resumable uploads. This should be the `upload_id` returned from a
1401
+ // call to `StartResumableWriteResponse`.
1402
+ string upload_id = 1;
1403
+
1404
+ // For non-resumable uploads. Describes the overall upload, including the
1405
+ // destination bucket and object name, preconditions, etc.
1406
+ WriteObjectSpec write_object_spec = 2;
1407
+ }
1408
+
1409
+ // Required. The offset from the beginning of the object at which the data
1410
+ // should be written.
1411
+ //
1412
+ // In the first `WriteObjectRequest` of a `WriteObject()` action, it
1413
+ // indicates the initial offset for the `Write()` call. The value **must** be
1414
+ // equal to the `persisted_size` that a call to `QueryWriteStatus()` would
1415
+ // return (0 if this is the first write to the object).
1416
+ //
1417
+ // On subsequent calls, this value **must** be no larger than the sum of the
1418
+ // first `write_offset` and the sizes of all `data` chunks sent previously on
1419
+ // this stream.
1420
+ //
1421
+ // An incorrect value causes an error.
1422
+ int64 write_offset = 3 [(google.api.field_behavior) = REQUIRED];
1423
+
1424
+ // A portion of the data for the object.
1425
+ oneof data {
1426
+ // The data to insert. If a crc32c checksum is provided that doesn't match
1427
+ // the checksum computed by the service, the request fails.
1428
+ ChecksummedData checksummed_data = 4;
1429
+ }
1430
+
1431
+ // Optional. Checksums for the complete object. If the checksums computed by
1432
+ // the service don't match the specified checksums the call fails. This field
1433
+ // might only be provided in the first or last request (either with
1434
+ // `first_message`, or `finish_write` set).
1435
+ ObjectChecksums object_checksums = 6 [(google.api.field_behavior) = OPTIONAL];
1436
+
1437
+ // Optional. If `true`, this indicates that the write is complete. Sending any
1438
+ // `WriteObjectRequest`s subsequent to one in which `finish_write` is `true`
1439
+ // causes an error.
1440
+ // For a non-resumable write (where the `upload_id` was not set in the first
1441
+ // message), it is an error not to set this field in the final message of the
1442
+ // stream.
1443
+ bool finish_write = 7 [(google.api.field_behavior) = OPTIONAL];
1444
+
1445
+ // Optional. A set of parameters common to Cloud Storage API requests
1446
+ // concerning an object.
1447
+ CommonObjectRequestParams common_object_request_params = 8
1448
+ [(google.api.field_behavior) = OPTIONAL];
1449
+ }
1450
+
1451
+ // Response message for
1452
+ // [WriteObject][google.storage.v2.Storage.WriteObject].
1453
+ message WriteObjectResponse {
1454
+ // The response sets one of the following.
1455
+ oneof write_status {
1456
+ // The total number of bytes that have been processed for the given object
1457
+ // from all `WriteObject` calls. Only set if the upload has not finalized.
1458
+ int64 persisted_size = 1;
1459
+
1460
+ // A resource containing the metadata for the uploaded object. Only set if
1461
+ // the upload has finalized.
1462
+ StorageObject resource = 2;
1463
+ }
1464
+ }
1465
+
1466
+ // Describes an attempt to append to an object, possibly over multiple requests.
1467
+ message AppendObjectSpec {
1468
+ // Required. The name of the bucket containing the object to write.
1469
+ string bucket = 1 [
1470
+ (google.api.field_behavior) = REQUIRED,
1471
+ (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" }
1472
+ ];
1473
+
1474
+ // Required. The name of the object to open for writing.
1475
+ string object = 2 [(google.api.field_behavior) = REQUIRED];
1476
+
1477
+ // Required. The generation number of the object to open for writing.
1478
+ int64 generation = 3 [(google.api.field_behavior) = REQUIRED];
1479
+
1480
+ // Makes the operation conditional on whether the object's current
1481
+ // metageneration matches the given value.
1482
+ //
1483
+ // Note that metageneration preconditions are only checked if `write_handle`
1484
+ // is empty.
1485
+ optional int64 if_metageneration_match = 4;
1486
+
1487
+ // Makes the operation conditional on whether the object's current
1488
+ // metageneration does not match the given value.
1489
+ //
1490
+ // Note that metageneration preconditions are only checked if `write_handle`
1491
+ // is empty.
1492
+ optional int64 if_metageneration_not_match = 5;
1493
+
1494
+ // An optional routing token that influences request routing for the stream.
1495
+ // Must be provided if a `BidiWriteObjectRedirectedError` is returned.
1496
+ optional string routing_token = 6;
1497
+
1498
+ // An optional write handle returned from a previous BidiWriteObjectResponse
1499
+ // message or a BidiWriteObjectRedirectedError error.
1500
+ //
1501
+ // Note that metageneration preconditions are only checked if `write_handle`
1502
+ // is empty.
1503
+ optional BidiWriteHandle write_handle = 7;
1504
+ }
1505
+
1506
+ // Request message for
1507
+ // [BidiWriteObject][google.storage.v2.Storage.BidiWriteObject].
1508
+ message BidiWriteObjectRequest {
1509
+ // The first message of each stream should set one of the following.
1510
+ oneof first_message {
1511
+ // For resumable uploads. This should be the `upload_id` returned from a
1512
+ // call to `StartResumableWriteResponse`.
1513
+ string upload_id = 1;
1514
+
1515
+ // For non-resumable uploads. Describes the overall upload, including the
1516
+ // destination bucket and object name, preconditions, etc.
1517
+ WriteObjectSpec write_object_spec = 2;
1518
+
1519
+ // For appendable uploads. Describes the object to append to.
1520
+ AppendObjectSpec append_object_spec = 11;
1521
+ }
1522
+
1523
+ // Required. The offset from the beginning of the object at which the data
1524
+ // should be written.
1525
+ //
1526
+ // In the first `WriteObjectRequest` of a `WriteObject()` action, it
1527
+ // indicates the initial offset for the `Write()` call. The value must be
1528
+ // equal to the `persisted_size` that a call to `QueryWriteStatus()` would
1529
+ // return (0 if this is the first write to the object).
1530
+ //
1531
+ // On subsequent calls, this value must be no larger than the sum of the
1532
+ // first `write_offset` and the sizes of all `data` chunks sent previously on
1533
+ // this stream.
1534
+ //
1535
+ // An invalid value causes an error.
1536
+ int64 write_offset = 3 [(google.api.field_behavior) = REQUIRED];
1537
+
1538
+ // A portion of the data for the object.
1539
+ oneof data {
1540
+ // The data to insert. If a crc32c checksum is provided that doesn't match
1541
+ // the checksum computed by the service, the request fails.
1542
+ ChecksummedData checksummed_data = 4;
1543
+ }
1544
+
1545
+ // Optional. Checksums for the complete object. If the checksums computed by
1546
+ // the service don't match the specified checksums the call fails. Might only
1547
+ // be provided in the first request or the last request (with finish_write
1548
+ // set).
1549
+ ObjectChecksums object_checksums = 6 [(google.api.field_behavior) = OPTIONAL];
1550
+
1551
+ // Optional. For each `BidiWriteObjectRequest` where `state_lookup` is `true`
1552
+ // or the client closes the stream, the service sends a
1553
+ // `BidiWriteObjectResponse` containing the current persisted size. The
1554
+ // persisted size sent in responses covers all the bytes the server has
1555
+ // persisted thus far and can be used to decide what data is safe for the
1556
+ // client to drop. Note that the object's current size reported by the
1557
+ // `BidiWriteObjectResponse` might lag behind the number of bytes written by
1558
+ // the client. This field is ignored if `finish_write` is set to true.
1559
+ bool state_lookup = 7 [(google.api.field_behavior) = OPTIONAL];
1560
+
1561
+ // Optional. Persists data written on the stream, up to and including the
1562
+ // current message, to permanent storage. This option should be used sparingly
1563
+ // as it might reduce performance. Ongoing writes are periodically persisted
1564
+ // on the server even when `flush` is not set. This field is ignored if
1565
+ // `finish_write` is set to true since there's no need to checkpoint or flush
1566
+ // if this message completes the write.
1567
+ bool flush = 8 [(google.api.field_behavior) = OPTIONAL];
1568
+
1569
+ // Optional. If `true`, this indicates that the write is complete. Sending any
1570
+ // `WriteObjectRequest`s subsequent to one in which `finish_write` is `true`
1571
+ // causes an error.
1572
+ // For a non-resumable write (where the `upload_id` was not set in the first
1573
+ // message), it is an error not to set this field in the final message of the
1574
+ // stream.
1575
+ bool finish_write = 9 [(google.api.field_behavior) = OPTIONAL];
1576
+
1577
+ // Optional. A set of parameters common to Storage API requests concerning an
1578
+ // object.
1579
+ CommonObjectRequestParams common_object_request_params = 10
1580
+ [(google.api.field_behavior) = OPTIONAL];
1581
+ }
1582
+
1583
+ // Response message for BidiWriteObject.
1584
+ message BidiWriteObjectResponse {
1585
+ // The response sets one of the following.
1586
+ oneof write_status {
1587
+ // The total number of bytes that have been processed for the given object
1588
+ // from all `WriteObject` calls. Only set if the upload has not finalized.
1589
+ int64 persisted_size = 1;
1590
+
1591
+ // A resource containing the metadata for the uploaded object. Only set if
1592
+ // the upload has finalized.
1593
+ StorageObject resource = 2;
1594
+ }
1595
+
1596
+ // An optional write handle that is returned periodically in response
1597
+ // messages. Clients should save it for later use in establishing a new stream
1598
+ // if a connection is interrupted.
1599
+ optional BidiWriteHandle write_handle = 3;
1600
+ }
1601
+
1602
+ // Request message for [ListObjects][google.storage.v2.Storage.ListObjects].
1603
+ message ListObjectsRequest {
1604
+ // Required. Name of the bucket in which to look for objects.
1605
+ string parent = 1 [
1606
+ (google.api.field_behavior) = REQUIRED,
1607
+ (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" }
1608
+ ];
1609
+
1610
+ // Optional. Maximum number of `items` plus `prefixes` to return
1611
+ // in a single page of responses. As duplicate `prefixes` are
1612
+ // omitted, fewer total results might be returned than requested. The service
1613
+ // uses this parameter or 1,000 items, whichever is smaller.
1614
+ int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
1615
+
1616
+ // Optional. A previously-returned page token representing part of the larger
1617
+ // set of results to view.
1618
+ string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
1619
+
1620
+ // Optional. If set, returns results in a directory-like mode. `items`
1621
+ // contains only objects whose names, aside from the `prefix`, do not contain
1622
+ // `delimiter`. Objects whose names, aside from the `prefix`, contain
1623
+ // `delimiter` has their name, truncated after the `delimiter`, returned in
1624
+ // `prefixes`. Duplicate `prefixes` are omitted.
1625
+ string delimiter = 4 [(google.api.field_behavior) = OPTIONAL];
1626
+
1627
+ // Optional. If true, objects that end in exactly one instance of `delimiter`
1628
+ // has their metadata included in `items` in addition to
1629
+ // `prefixes`.
1630
+ bool include_trailing_delimiter = 5 [(google.api.field_behavior) = OPTIONAL];
1631
+
1632
+ // Optional. Filter results to objects whose names begin with this prefix.
1633
+ string prefix = 6 [(google.api.field_behavior) = OPTIONAL];
1634
+
1635
+ // Optional. If `true`, lists all versions of an object as distinct results.
1636
+ bool versions = 7 [(google.api.field_behavior) = OPTIONAL];
1637
+
1638
+ // Mask specifying which fields to read from each result.
1639
+ // If no mask is specified, defaults to all fields except `items.acl` and
1640
+ // `items.owner`.
1641
+ // `*` might be used to mean all fields.
1642
+ optional google.protobuf.FieldMask read_mask = 8;
1643
+
1644
+ // Optional. Filter results to objects whose names are lexicographically equal
1645
+ // to or after `lexicographic_start`. If `lexicographic_end` is also set, the
1646
+ // objects listed have names between `lexicographic_start` (inclusive) and
1647
+ // `lexicographic_end` (exclusive).
1648
+ string lexicographic_start = 10 [(google.api.field_behavior) = OPTIONAL];
1649
+
1650
+ // Optional. Filter results to objects whose names are lexicographically
1651
+ // before `lexicographic_end`. If `lexicographic_start` is also set, the
1652
+ // objects listed have names between `lexicographic_start` (inclusive) and
1653
+ // `lexicographic_end` (exclusive).
1654
+ string lexicographic_end = 11 [(google.api.field_behavior) = OPTIONAL];
1655
+
1656
+ // Optional. If true, only list all soft-deleted versions of the object.
1657
+ // Soft delete policy is required to set this option.
1658
+ bool soft_deleted = 12 [(google.api.field_behavior) = OPTIONAL];
1659
+
1660
+ // Optional. If true, includes folders and managed folders (besides objects)
1661
+ // in the returned `prefixes`. Requires `delimiter` to be set to '/'.
1662
+ bool include_folders_as_prefixes = 13
1663
+ [(google.api.field_behavior) = OPTIONAL];
1664
+
1665
+ // Optional. Filter results to objects and prefixes that match this glob
1666
+ // pattern. See [List objects using
1667
+ // glob](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob)
1668
+ // for the full syntax.
1669
+ string match_glob = 14 [(google.api.field_behavior) = OPTIONAL];
1670
+
1671
+ // Optional. An expression used to filter the returned objects by the
1672
+ // `context` field. For the full syntax, see [Filter objects by contexts
1673
+ // syntax](https://cloud.google.com/storage/docs/listing-objects#filter-by-object-contexts-syntax).
1674
+ // If a `delimiter` is set, the returned `prefixes` are exempt from this
1675
+ // filter.
1676
+ string filter = 15 [(google.api.field_behavior) = OPTIONAL];
1677
+ }
1678
+
1679
+ // Request object for
1680
+ // [QueryWriteStatus][google.storage.v2.Storage.QueryWriteStatus].
1681
+ message QueryWriteStatusRequest {
1682
+ // Required. The name of the resume token for the object whose write status is
1683
+ // being requested.
1684
+ string upload_id = 1 [(google.api.field_behavior) = REQUIRED];
1685
+
1686
+ // Optional. A set of parameters common to Storage API requests concerning an
1687
+ // object.
1688
+ CommonObjectRequestParams common_object_request_params = 2
1689
+ [(google.api.field_behavior) = OPTIONAL];
1690
+ }
1691
+
1692
+ // Response object for
1693
+ // [QueryWriteStatus][google.storage.v2.Storage.QueryWriteStatus].
1694
+ message QueryWriteStatusResponse {
1695
+ // The response sets one of the following.
1696
+ oneof write_status {
1697
+ // The total number of bytes that have been processed for the given object
1698
+ // from all `WriteObject` calls. This is the correct value for the
1699
+ // 'write_offset' field to use when resuming the `WriteObject` operation.
1700
+ // Only set if the upload has not finalized.
1701
+ int64 persisted_size = 1;
1702
+
1703
+ // A resource containing the metadata for the uploaded object. Only set if
1704
+ // the upload has finalized.
1705
+ StorageObject resource = 2;
1706
+ }
1707
+ }
1708
+
1709
+ // Request message for [RewriteObject][google.storage.v2.Storage.RewriteObject].
1710
+ // If the source object is encrypted using a Customer-Supplied Encryption Key
1711
+ // the key information must be provided in the
1712
+ // `copy_source_encryption_algorithm`, `copy_source_encryption_key_bytes`, and
1713
+ // `copy_source_encryption_key_sha256_bytes` fields. If the destination object
1714
+ // should be encrypted the keying information should be provided in the
1715
+ // `encryption_algorithm`, `encryption_key_bytes`, and
1716
+ // `encryption_key_sha256_bytes` fields of the
1717
+ // `common_object_request_params.customer_encryption` field.
1718
+ message RewriteObjectRequest {
1719
+ // Required. Immutable. The name of the destination object.
1720
+ // See the
1721
+ // [Naming Guidelines](https://cloud.google.com/storage/docs/objects#naming).
1722
+ // Example: `test.txt`
1723
+ // The `name` field by itself does not uniquely identify a Cloud Storage
1724
+ // object. A Cloud Storage object is uniquely identified by the tuple of
1725
+ // (bucket, object, generation).
1726
+ string destination_name = 24 [
1727
+ (google.api.field_behavior) = REQUIRED,
1728
+ (google.api.field_behavior) = IMMUTABLE
1729
+ ];
1730
+
1731
+ // Required. Immutable. The name of the bucket containing the destination
1732
+ // object.
1733
+ string destination_bucket = 25 [
1734
+ (google.api.field_behavior) = REQUIRED,
1735
+ (google.api.field_behavior) = IMMUTABLE,
1736
+ (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" }
1737
+ ];
1738
+
1739
+ // Optional. The name of the Cloud KMS key that is used to encrypt the
1740
+ // destination object. The Cloud KMS key must be located in same location as
1741
+ // the object. If the parameter is not specified, the request uses the
1742
+ // destination bucket's default encryption key, if any, or else the
1743
+ // Google-managed encryption key.
1744
+ string destination_kms_key = 27 [
1745
+ (google.api.field_behavior) = OPTIONAL,
1746
+ (google.api.resource_reference) = {
1747
+ type: "cloudkms.googleapis.com/CryptoKey"
1748
+ }
1749
+ ];
1750
+
1751
+ // Optional. Properties of the destination, post-rewrite object.
1752
+ // The `name`, `bucket` and `kms_key` fields must not be populated (these
1753
+ // values are specified in the `destination_name`, `destination_bucket`, and
1754
+ // `destination_kms_key` fields).
1755
+ // If `destination` is present it is used to construct the destination
1756
+ // object's metadata; otherwise the destination object's metadata is
1757
+ // copied from the source object.
1758
+ StorageObject destination = 1 [(google.api.field_behavior) = OPTIONAL];
1759
+
1760
+ // Required. Name of the bucket in which to find the source object.
1761
+ string source_bucket = 2 [
1762
+ (google.api.field_behavior) = REQUIRED,
1763
+ (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" }
1764
+ ];
1765
+
1766
+ // Required. Name of the source object.
1767
+ string source_object = 3 [(google.api.field_behavior) = REQUIRED];
1768
+
1769
+ // Optional. If present, selects a specific revision of the source object (as
1770
+ // opposed to the latest version, the default).
1771
+ int64 source_generation = 4 [(google.api.field_behavior) = OPTIONAL];
1772
+
1773
+ // Optional. Include this field (from the previous rewrite response) on each
1774
+ // rewrite request after the first one, until the rewrite response 'done' flag
1775
+ // is true. Calls that provide a rewriteToken can omit all other request
1776
+ // fields, but if included those fields must match the values provided in the
1777
+ // first rewrite request.
1778
+ string rewrite_token = 5 [(google.api.field_behavior) = OPTIONAL];
1779
+
1780
+ // Optional. Apply a predefined set of access controls to the destination
1781
+ // object. Valid values are `authenticatedRead`, `bucketOwnerFullControl`,
1782
+ // `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`.
1783
+ string destination_predefined_acl = 28
1784
+ [(google.api.field_behavior) = OPTIONAL];
1785
+
1786
+ // Makes the operation conditional on whether the object's current generation
1787
+ // matches the given value. Setting to 0 makes the operation succeed only if
1788
+ // there are no live versions of the object.
1789
+ optional int64 if_generation_match = 7;
1790
+
1791
+ // Makes the operation conditional on whether the object's live generation
1792
+ // does not match the given value. If no live object exists, the precondition
1793
+ // fails. Setting to 0 makes the operation succeed only if there is a live
1794
+ // version of the object.
1795
+ optional int64 if_generation_not_match = 8;
1796
+
1797
+ // Makes the operation conditional on whether the destination object's current
1798
+ // metageneration matches the given value.
1799
+ optional int64 if_metageneration_match = 9;
1800
+
1801
+ // Makes the operation conditional on whether the destination object's current
1802
+ // metageneration does not match the given value.
1803
+ optional int64 if_metageneration_not_match = 10;
1804
+
1805
+ // Makes the operation conditional on whether the source object's live
1806
+ // generation matches the given value.
1807
+ optional int64 if_source_generation_match = 11;
1808
+
1809
+ // Makes the operation conditional on whether the source object's live
1810
+ // generation does not match the given value.
1811
+ optional int64 if_source_generation_not_match = 12;
1812
+
1813
+ // Makes the operation conditional on whether the source object's current
1814
+ // metageneration matches the given value.
1815
+ optional int64 if_source_metageneration_match = 13;
1816
+
1817
+ // Makes the operation conditional on whether the source object's current
1818
+ // metageneration does not match the given value.
1819
+ optional int64 if_source_metageneration_not_match = 14;
1820
+
1821
+ // Optional. The maximum number of bytes that are rewritten per rewrite
1822
+ // request. Most callers shouldn't need to specify this parameter - it is
1823
+ // primarily in place to support testing. If specified the value must be an
1824
+ // integral multiple of 1 MiB (1048576). Also, this only applies to requests
1825
+ // where the source and destination span locations and/or storage classes.
1826
+ // Finally, this value must not change across rewrite calls else you'll get an
1827
+ // error that the `rewriteToken` is invalid.
1828
+ int64 max_bytes_rewritten_per_call = 15
1829
+ [(google.api.field_behavior) = OPTIONAL];
1830
+
1831
+ // Optional. The algorithm used to encrypt the source object, if any. Used if
1832
+ // the source object was encrypted with a Customer-Supplied Encryption Key.
1833
+ string copy_source_encryption_algorithm = 16
1834
+ [(google.api.field_behavior) = OPTIONAL];
1835
+
1836
+ // Optional. The raw bytes (not base64-encoded) AES-256 encryption key used to
1837
+ // encrypt the source object, if it was encrypted with a Customer-Supplied
1838
+ // Encryption Key.
1839
+ bytes copy_source_encryption_key_bytes = 21
1840
+ [(google.api.field_behavior) = OPTIONAL];
1841
+
1842
+ // Optional. The raw bytes (not base64-encoded) SHA256 hash of the encryption
1843
+ // key used to encrypt the source object, if it was encrypted with a
1844
+ // Customer-Supplied Encryption Key.
1845
+ bytes copy_source_encryption_key_sha256_bytes = 22
1846
+ [(google.api.field_behavior) = OPTIONAL];
1847
+
1848
+ // Optional. A set of parameters common to Storage API requests concerning an
1849
+ // object.
1850
+ CommonObjectRequestParams common_object_request_params = 19
1851
+ [(google.api.field_behavior) = OPTIONAL];
1852
+
1853
+ // Optional. The checksums of the complete object. This is used to validate
1854
+ // the destination object after rewriting.
1855
+ ObjectChecksums object_checksums = 29
1856
+ [(google.api.field_behavior) = OPTIONAL];
1857
+ }
1858
+
1859
+ // A rewrite response.
1860
+ message RewriteResponse {
1861
+ // The total bytes written so far, which can be used to provide a waiting user
1862
+ // with a progress indicator. This property is always present in the response.
1863
+ int64 total_bytes_rewritten = 1;
1864
+
1865
+ // The total size of the object being copied in bytes. This property is always
1866
+ // present in the response.
1867
+ int64 object_size = 2;
1868
+
1869
+ // `true` if the copy is finished; otherwise, `false` if
1870
+ // the copy is in progress. This property is always present in the response.
1871
+ bool done = 3;
1872
+
1873
+ // A token to use in subsequent requests to continue copying data. This token
1874
+ // is present in the response only when there is more data to copy.
1875
+ string rewrite_token = 4;
1876
+
1877
+ // A resource containing the metadata for the copied-to object. This property
1878
+ // is present in the response only when copying completes.
1879
+ StorageObject resource = 5;
1880
+ }
1881
+
1882
+ // Request message for [MoveObject][google.storage.v2.Storage.MoveObject].
1883
+ message MoveObjectRequest {
1884
+ // Required. Name of the bucket in which the object resides.
1885
+ string bucket = 1 [
1886
+ (google.api.field_behavior) = REQUIRED,
1887
+ (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" }
1888
+ ];
1889
+
1890
+ // Required. Name of the source object.
1891
+ string source_object = 2 [(google.api.field_behavior) = REQUIRED];
1892
+
1893
+ // Required. Name of the destination object.
1894
+ string destination_object = 3 [(google.api.field_behavior) = REQUIRED];
1895
+
1896
+ // Optional. Makes the operation conditional on whether the source object's
1897
+ // current generation matches the given value. `if_source_generation_match`
1898
+ // and `if_source_generation_not_match` conditions are mutually exclusive:
1899
+ // it's an error for both of them to be set in the request.
1900
+ optional int64 if_source_generation_match = 4
1901
+ [(google.api.field_behavior) = OPTIONAL];
1902
+
1903
+ // Optional. Makes the operation conditional on whether the source object's
1904
+ // current generation does not match the given value.
1905
+ // `if_source_generation_match` and `if_source_generation_not_match`
1906
+ // conditions are mutually exclusive: it's an error for both of them to be set
1907
+ // in the request.
1908
+ optional int64 if_source_generation_not_match = 5
1909
+ [(google.api.field_behavior) = OPTIONAL];
1910
+
1911
+ // Optional. Makes the operation conditional on whether the source object's
1912
+ // current metageneration matches the given value.
1913
+ // `if_source_metageneration_match` and `if_source_metageneration_not_match`
1914
+ // conditions are mutually exclusive: it's an error for both of them to be set
1915
+ // in the request.
1916
+ optional int64 if_source_metageneration_match = 6
1917
+ [(google.api.field_behavior) = OPTIONAL];
1918
+
1919
+ // Optional. Makes the operation conditional on whether the source object's
1920
+ // current metageneration does not match the given value.
1921
+ // `if_source_metageneration_match` and `if_source_metageneration_not_match`
1922
+ // conditions are mutually exclusive: it's an error for both of them to be set
1923
+ // in the request.
1924
+ optional int64 if_source_metageneration_not_match = 7
1925
+ [(google.api.field_behavior) = OPTIONAL];
1926
+
1927
+ // Optional. Makes the operation conditional on whether the destination
1928
+ // object's current generation matches the given value. Setting to 0 makes the
1929
+ // operation succeed only if there are no live versions of the object.
1930
+ // `if_generation_match` and `if_generation_not_match` conditions are mutually
1931
+ // exclusive: it's an error for both of them to be set in the request.
1932
+ optional int64 if_generation_match = 8
1933
+ [(google.api.field_behavior) = OPTIONAL];
1934
+
1935
+ // Optional. Makes the operation conditional on whether the destination
1936
+ // object's current generation does not match the given value. If no live
1937
+ // object exists, the precondition fails. Setting to 0 makes the operation
1938
+ // succeed only if there is a live version of the object.
1939
+ // `if_generation_match` and `if_generation_not_match` conditions are mutually
1940
+ // exclusive: it's an error for both of them to be set in the request.
1941
+ optional int64 if_generation_not_match = 9
1942
+ [(google.api.field_behavior) = OPTIONAL];
1943
+
1944
+ // Optional. Makes the operation conditional on whether the destination
1945
+ // object's current metageneration matches the given value.
1946
+ // `if_metageneration_match` and `if_metageneration_not_match` conditions are
1947
+ // mutually exclusive: it's an error for both of them to be set in the
1948
+ // request.
1949
+ optional int64 if_metageneration_match = 10
1950
+ [(google.api.field_behavior) = OPTIONAL];
1951
+
1952
+ // Optional. Makes the operation conditional on whether the destination
1953
+ // object's current metageneration does not match the given value.
1954
+ // `if_metageneration_match` and `if_metageneration_not_match` conditions are
1955
+ // mutually exclusive: it's an error for both of them to be set in the
1956
+ // request.
1957
+ optional int64 if_metageneration_not_match = 11
1958
+ [(google.api.field_behavior) = OPTIONAL];
1959
+ }
1960
+
1961
+ // Request message for
1962
+ // [StartResumableWrite][google.storage.v2.Storage.StartResumableWrite].
1963
+ message StartResumableWriteRequest {
1964
+ // Required. Contains the information necessary to start a resumable write.
1965
+ WriteObjectSpec write_object_spec = 1
1966
+ [(google.api.field_behavior) = REQUIRED];
1967
+
1968
+ // Optional. A set of parameters common to Storage API requests related to an
1969
+ // object.
1970
+ CommonObjectRequestParams common_object_request_params = 3
1971
+ [(google.api.field_behavior) = OPTIONAL];
1972
+
1973
+ // Optional. The checksums of the complete object. This is used to validate
1974
+ // the uploaded object. For each upload, `object_checksums` can be provided
1975
+ // when initiating a resumable upload with`StartResumableWriteRequest` or when
1976
+ // completing a write with `WriteObjectRequest` with
1977
+ // `finish_write` set to `true`.
1978
+ ObjectChecksums object_checksums = 5 [(google.api.field_behavior) = OPTIONAL];
1979
+ }
1980
+
1981
+ // Response object for
1982
+ // [StartResumableWrite][google.storage.v2.Storage.StartResumableWrite].
1983
+ message StartResumableWriteResponse {
1984
+ // A unique identifier for the initiated resumable write operation.
1985
+ // As the ID grants write access, you should keep it confidential during
1986
+ // the upload to prevent unauthorized access and data tampering during your
1987
+ // upload. This ID should be included in subsequent `WriteObject` requests to
1988
+ // upload the object data.
1989
+ string upload_id = 1;
1990
+ }
1991
+
1992
+ // Request message for [UpdateObject][google.storage.v2.Storage.UpdateObject].
1993
+ message UpdateObjectRequest {
1994
+ // Required. The object to update.
1995
+ // The object's bucket and name fields are used to identify the object to
1996
+ // update. If present, the object's generation field selects a specific
1997
+ // revision of this object whose metadata should be updated. Otherwise,
1998
+ // assumes the live version of the object.
1999
+ StorageObject object = 1 [(google.api.field_behavior) = REQUIRED];
2000
+
2001
+ // Makes the operation conditional on whether the object's current generation
2002
+ // matches the given value. Setting to 0 makes the operation succeed only if
2003
+ // there are no live versions of the object.
2004
+ optional int64 if_generation_match = 2;
2005
+
2006
+ // Makes the operation conditional on whether the object's live generation
2007
+ // does not match the given value. If no live object exists, the precondition
2008
+ // fails. Setting to 0 makes the operation succeed only if there is a live
2009
+ // version of the object.
2010
+ optional int64 if_generation_not_match = 3;
2011
+
2012
+ // Makes the operation conditional on whether the object's current
2013
+ // metageneration matches the given value.
2014
+ optional int64 if_metageneration_match = 4;
2015
+
2016
+ // Makes the operation conditional on whether the object's current
2017
+ // metageneration does not match the given value.
2018
+ optional int64 if_metageneration_not_match = 5;
2019
+
2020
+ // Optional. Apply a predefined set of access controls to this object.
2021
+ // Valid values are "authenticatedRead", "bucketOwnerFullControl",
2022
+ // "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
2023
+ string predefined_acl = 10 [(google.api.field_behavior) = OPTIONAL];
2024
+
2025
+ // Required. List of fields to be updated.
2026
+ //
2027
+ // To specify ALL fields, equivalent to the JSON API's "update" function,
2028
+ // specify a single field with the value `*`. Note: not recommended. If a new
2029
+ // field is introduced at a later time, an older client updating with the `*`
2030
+ // might accidentally reset the new field's value.
2031
+ //
2032
+ // Not specifying any fields is an error.
2033
+ google.protobuf.FieldMask update_mask = 7
2034
+ [(google.api.field_behavior) = REQUIRED];
2035
+
2036
+ // Optional. A set of parameters common to Storage API requests concerning an
2037
+ // object.
2038
+ CommonObjectRequestParams common_object_request_params = 8
2039
+ [(google.api.field_behavior) = OPTIONAL];
2040
+
2041
+ // Optional. Overrides the unlocked retention config on the object.
2042
+ bool override_unlocked_retention = 11
2043
+ [(google.api.field_behavior) = OPTIONAL];
2044
+ }
2045
+
2046
+ // Parameters that can be passed to any object request.
2047
+ message CommonObjectRequestParams {
2048
+ // Optional. Encryption algorithm used with the Customer-Supplied Encryption
2049
+ // Keys feature.
2050
+ string encryption_algorithm = 1 [(google.api.field_behavior) = OPTIONAL];
2051
+
2052
+ // Optional. Encryption key used with the Customer-Supplied Encryption Keys
2053
+ // feature. In raw bytes format (not base64-encoded).
2054
+ bytes encryption_key_bytes = 4 [(google.api.field_behavior) = OPTIONAL];
2055
+
2056
+ // Optional. SHA256 hash of encryption key used with the Customer-supplied
2057
+ // encryption keys feature.
2058
+ bytes encryption_key_sha256_bytes = 5
2059
+ [(google.api.field_behavior) = OPTIONAL];
2060
+ }
2061
+
2062
+ // Shared constants.
2063
+ message ServiceConstants {
2064
+ // A collection of constant values meaningful to the Storage API.
2065
+ enum Values {
2066
+ option allow_alias = true;
2067
+
2068
+ // Unused. Proto3 requires first enum to be 0.
2069
+ VALUES_UNSPECIFIED = 0;
2070
+
2071
+ // The maximum size chunk that can be returned in a single
2072
+ // `ReadRequest`.
2073
+ // 2 MiB.
2074
+ MAX_READ_CHUNK_BYTES = 2097152;
2075
+
2076
+ // The maximum size chunk that can be sent in a single WriteObjectRequest.
2077
+ // 2 MiB.
2078
+ MAX_WRITE_CHUNK_BYTES = 2097152;
2079
+
2080
+ // The maximum size of an object in MB - whether written in a single stream
2081
+ // or composed from multiple other objects.
2082
+ // 5 TiB.
2083
+ MAX_OBJECT_SIZE_MB = 5242880;
2084
+
2085
+ // The maximum length field name that can be sent in a single
2086
+ // custom metadata field.
2087
+ // 1 KiB.
2088
+ MAX_CUSTOM_METADATA_FIELD_NAME_BYTES = 1024;
2089
+
2090
+ // The maximum length field value that can be sent in a single
2091
+ // custom_metadata field.
2092
+ // 4 KiB.
2093
+ MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES = 4096;
2094
+
2095
+ // The maximum total bytes that can be populated into all field names and
2096
+ // values of the custom_metadata for one object.
2097
+ // 8 KiB.
2098
+ MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES = 8192;
2099
+
2100
+ // The maximum total bytes that can be populated into all bucket metadata
2101
+ // fields.
2102
+ // 20 KiB.
2103
+ MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES = 20480;
2104
+
2105
+ // The maximum number of NotificationConfigs that can be registered
2106
+ // for a given bucket.
2107
+ MAX_NOTIFICATION_CONFIGS_PER_BUCKET = 100;
2108
+
2109
+ // The maximum number of LifecycleRules that can be registered for a given
2110
+ // bucket.
2111
+ MAX_LIFECYCLE_RULES_PER_BUCKET = 100;
2112
+
2113
+ // The maximum number of custom attributes per NotificationConfigs.
2114
+ MAX_NOTIFICATION_CUSTOM_ATTRIBUTES = 5;
2115
+
2116
+ // The maximum length of a custom attribute key included in
2117
+ // NotificationConfig.
2118
+ MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH = 256;
2119
+
2120
+ // The maximum length of a custom attribute value included in a
2121
+ // NotificationConfig.
2122
+ MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH = 1024;
2123
+
2124
+ // The maximum number of key/value entries per bucket label.
2125
+ MAX_LABELS_ENTRIES_COUNT = 64;
2126
+
2127
+ // The maximum character length of the key or value in a bucket
2128
+ // label map.
2129
+ MAX_LABELS_KEY_VALUE_LENGTH = 63;
2130
+
2131
+ // The maximum byte size of the key or value in a bucket label
2132
+ // map.
2133
+ MAX_LABELS_KEY_VALUE_BYTES = 128;
2134
+
2135
+ // The maximum number of object IDs that can be included in a
2136
+ // DeleteObjectsRequest.
2137
+ MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST = 1000;
2138
+
2139
+ // The maximum number of days for which a token returned by the
2140
+ // GetListObjectsSplitPoints RPC is valid.
2141
+ SPLIT_TOKEN_MAX_VALID_DAYS = 14;
2142
+ }
2143
+ }
2144
+
2145
+ // A bucket.
2146
+ message Bucket {
2147
+ option (google.api.resource) = {
2148
+ type: "storage.googleapis.com/Bucket"
2149
+ pattern: "projects/{project}/buckets/{bucket}"
2150
+ plural: "buckets"
2151
+ singular: "bucket"
2152
+ };
2153
+
2154
+ // Billing properties of a bucket.
2155
+ message Billing {
2156
+ // Optional. When set to true, Requester Pays is enabled for this bucket.
2157
+ bool requester_pays = 1 [(google.api.field_behavior) = OPTIONAL];
2158
+ }
2159
+
2160
+ // Cross-Origin Response sharing (CORS) properties for a bucket.
2161
+ // For more on Cloud Storage and CORS, see
2162
+ // https://cloud.google.com/storage/docs/cross-origin.
2163
+ // For more on CORS in general, see https://tools.ietf.org/html/rfc6454.
2164
+ message Cors {
2165
+ // Optional. The list of origins eligible to receive CORS response headers.
2166
+ // For more information about origins, see [RFC
2167
+ // 6454](https://tools.ietf.org/html/rfc6454). Note: `*` is permitted in the
2168
+ // list of origins, and means `any origin`.
2169
+ repeated string origin = 1 [(google.api.field_behavior) = OPTIONAL];
2170
+
2171
+ // Optional. The list of HTTP methods on which to include CORS response
2172
+ // headers,
2173
+ // (`GET`, `OPTIONS`, `POST`, etc) Note: `*` is permitted in the list of
2174
+ // methods, and means "any method".
2175
+ repeated string method = 2 [(google.api.field_behavior) = OPTIONAL];
2176
+
2177
+ // Optional. The list of HTTP headers other than the [simple response
2178
+ // headers](https://www.w3.org/TR/cors/#simple-response-headers) to give
2179
+ // permission for the user-agent to share across domains.
2180
+ repeated string response_header = 3
2181
+ [(google.api.field_behavior) = OPTIONAL];
2182
+
2183
+ // Optional. The value, in seconds, to return in the [Access-Control-Max-Age
2184
+ // header](https://www.w3.org/TR/cors/#access-control-max-age-response-header)
2185
+ // used in preflight responses.
2186
+ int32 max_age_seconds = 4 [(google.api.field_behavior) = OPTIONAL];
2187
+ }
2188
+
2189
+ // Encryption properties of a bucket.
2190
+ message Encryption {
2191
+ // Google Managed Encryption (GMEK) enforcement config of a bucket.
2192
+ message GoogleManagedEncryptionEnforcementConfig {
2193
+ // Restriction mode for google-managed encryption for new objects within
2194
+ // the bucket. Valid values are: `NotRestricted` and `FullyRestricted`.
2195
+ // If `NotRestricted` or unset, creation of new objects with
2196
+ // google-managed encryption is allowed.
2197
+ // If `FullyRestricted`, new objects can't be created using google-managed
2198
+ // encryption.
2199
+ optional string restriction_mode = 3;
2200
+
2201
+ // Time from which the config was effective. This is service-provided.
2202
+ optional google.protobuf.Timestamp effective_time = 2;
2203
+ }
2204
+
2205
+ // Customer Managed Encryption (CMEK) enforcement config of a bucket.
2206
+ message CustomerManagedEncryptionEnforcementConfig {
2207
+ // Restriction mode for customer-managed encryption for new objects within
2208
+ // the bucket. Valid values are: `NotRestricted` and `FullyRestricted`.
2209
+ // If `NotRestricted` or unset, creation of new objects with
2210
+ // customer-managed encryption is allowed.
2211
+ // If `FullyRestricted`, new objects can't be created using
2212
+ // customer-managed encryption.
2213
+ optional string restriction_mode = 3;
2214
+
2215
+ // Time from which the config was effective. This is service-provided.
2216
+ optional google.protobuf.Timestamp effective_time = 2;
2217
+ }
2218
+
2219
+ // Customer Supplied Encryption (CSEK) enforcement config of a bucket.
2220
+ message CustomerSuppliedEncryptionEnforcementConfig {
2221
+ // Restriction mode for customer-supplied encryption for new objects
2222
+ // within the bucket. Valid values are: `NotRestricted` and
2223
+ // `FullyRestricted`.
2224
+ // If `NotRestricted` or unset, creation of new objects with
2225
+ // customer-supplied encryption is allowed.
2226
+ // If `FullyRestricted`, new objects can't be created using
2227
+ // customer-supplied encryption.
2228
+ optional string restriction_mode = 3;
2229
+
2230
+ // Time from which the config was effective. This is service-provided.
2231
+ optional google.protobuf.Timestamp effective_time = 2;
2232
+ }
2233
+
2234
+ // Optional. The name of the Cloud KMS key that is used to encrypt objects
2235
+ // inserted into this bucket, if no encryption method is specified.
2236
+ string default_kms_key = 1 [
2237
+ (google.api.field_behavior) = OPTIONAL,
2238
+ (google.api.resource_reference) = {
2239
+ type: "cloudkms.googleapis.com/CryptoKey"
2240
+ }
2241
+ ];
2242
+
2243
+ // Optional. If omitted, then new objects with GMEK encryption-type is
2244
+ // allowed. If set, then new objects created in this bucket must comply with
2245
+ // enforcement config. Changing this has no effect on existing objects; it
2246
+ // applies to new objects only.
2247
+ optional GoogleManagedEncryptionEnforcementConfig
2248
+ google_managed_encryption_enforcement_config = 2
2249
+ [(google.api.field_behavior) = OPTIONAL];
2250
+
2251
+ // Optional. If omitted, then new objects with CMEK encryption-type is
2252
+ // allowed. If set, then new objects created in this bucket must comply with
2253
+ // enforcement config. Changing this has no effect on existing objects; it
2254
+ // applies to new objects only.
2255
+ optional CustomerManagedEncryptionEnforcementConfig
2256
+ customer_managed_encryption_enforcement_config = 3
2257
+ [(google.api.field_behavior) = OPTIONAL];
2258
+
2259
+ // Optional. If omitted, then new objects with CSEK encryption-type is
2260
+ // allowed. If set, then new objects created in this bucket must comply with
2261
+ // enforcement config. Changing this has no effect on existing objects; it
2262
+ // applies to new objects only.
2263
+ optional CustomerSuppliedEncryptionEnforcementConfig
2264
+ customer_supplied_encryption_enforcement_config = 4
2265
+ [(google.api.field_behavior) = OPTIONAL];
2266
+ }
2267
+
2268
+ // Bucket restriction options.
2269
+ message IamConfig {
2270
+ // Settings for Uniform Bucket level access.
2271
+ // See https://cloud.google.com/storage/docs/uniform-bucket-level-access.
2272
+ message UniformBucketLevelAccess {
2273
+ // Optional. If set, access checks only use bucket-level IAM policies or
2274
+ // above.
2275
+ bool enabled = 1 [(google.api.field_behavior) = OPTIONAL];
2276
+
2277
+ // Optional. The deadline time for changing
2278
+ // `iam_config.uniform_bucket_level_access.enabled` from `true` to
2279
+ // `false`. Mutable until the specified deadline is reached, but not
2280
+ // afterward.
2281
+ google.protobuf.Timestamp lock_time = 2
2282
+ [(google.api.field_behavior) = OPTIONAL];
2283
+ }
2284
+
2285
+ // Optional. Bucket restriction options currently enforced on the bucket.
2286
+ UniformBucketLevelAccess uniform_bucket_level_access = 1
2287
+ [(google.api.field_behavior) = OPTIONAL];
2288
+
2289
+ // Optional. Whether IAM enforces public access prevention. Valid values are
2290
+ // `enforced` or `inherited`.
2291
+ string public_access_prevention = 3
2292
+ [(google.api.field_behavior) = OPTIONAL];
2293
+ }
2294
+
2295
+ // Lifecycle properties of a bucket.
2296
+ // For more information, see [StorageObject Lifecycle
2297
+ // Management](https://cloud.google.com/storage/docs/lifecycle).
2298
+ message Lifecycle {
2299
+ // A lifecycle Rule, combining an action to take on an object and a
2300
+ // condition which triggers that action.
2301
+ message Rule {
2302
+ // An action to take on an object.
2303
+ message Action {
2304
+ // Optional. Type of the action. Currently, only `Delete`,
2305
+ // `SetStorageClass`, and `AbortIncompleteMultipartUpload` are
2306
+ // supported.
2307
+ string type = 1 [(google.api.field_behavior) = OPTIONAL];
2308
+
2309
+ // Optional. Target storage class. Required iff the type of the action
2310
+ // is SetStorageClass.
2311
+ string storage_class = 2 [(google.api.field_behavior) = OPTIONAL];
2312
+ }
2313
+
2314
+ // A condition of an object which triggers some action.
2315
+ message Condition {
2316
+ // Age of an object (in days). This condition is satisfied when an
2317
+ // object reaches the specified age.
2318
+ // A value of 0 indicates that all objects immediately match this
2319
+ // condition.
2320
+ optional int32 age_days = 1;
2321
+
2322
+ // Optional. This condition is satisfied when an object is created
2323
+ // before midnight of the specified date in UTC.
2324
+ google.type.Date created_before = 2
2325
+ [(google.api.field_behavior) = OPTIONAL];
2326
+
2327
+ // Relevant only for versioned objects. If the value is
2328
+ // `true`, this condition matches live objects; if the value
2329
+ // is `false`, it matches archived objects.
2330
+ optional bool is_live = 3;
2331
+
2332
+ // Relevant only for versioned objects. If the value is N, this
2333
+ // condition is satisfied when there are at least N versions (including
2334
+ // the live version) newer than this version of the object.
2335
+ optional int32 num_newer_versions = 4;
2336
+
2337
+ // Optional. Objects having any of the storage classes specified by this
2338
+ // condition are matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
2339
+ // `NEARLINE`, `COLDLINE`, `STANDARD`, and
2340
+ // `DURABLE_REDUCED_AVAILABILITY`.
2341
+ repeated string matches_storage_class = 5
2342
+ [(google.api.field_behavior) = OPTIONAL];
2343
+
2344
+ // Number of days that have elapsed since the custom timestamp set on an
2345
+ // object.
2346
+ // The value of the field must be a nonnegative integer.
2347
+ optional int32 days_since_custom_time = 7;
2348
+
2349
+ // Optional. An object matches this condition if the custom timestamp
2350
+ // set on the object is before the specified date in UTC.
2351
+ google.type.Date custom_time_before = 8
2352
+ [(google.api.field_behavior) = OPTIONAL];
2353
+
2354
+ // This condition is relevant only for versioned objects. An object
2355
+ // version satisfies this condition only if these many days have been
2356
+ // passed since it became noncurrent. The value of the field must be a
2357
+ // nonnegative integer. If it's zero, the object version becomes
2358
+ // eligible for Lifecycle action as soon as it becomes noncurrent.
2359
+ optional int32 days_since_noncurrent_time = 9;
2360
+
2361
+ // Optional. This condition is relevant only for versioned objects. An
2362
+ // object version satisfies this condition only if it became noncurrent
2363
+ // before the specified date in UTC.
2364
+ google.type.Date noncurrent_time_before = 10
2365
+ [(google.api.field_behavior) = OPTIONAL];
2366
+
2367
+ // Optional. List of object name prefixes. If any prefix exactly matches
2368
+ // the beginning of the object name, the condition evaluates to true.
2369
+ repeated string matches_prefix = 11
2370
+ [(google.api.field_behavior) = OPTIONAL];
2371
+
2372
+ // Optional. List of object name suffixes. If any suffix exactly matches
2373
+ // the end of the object name, the condition evaluates to true.
2374
+ repeated string matches_suffix = 12
2375
+ [(google.api.field_behavior) = OPTIONAL];
2376
+ }
2377
+
2378
+ // Optional. The action to take.
2379
+ Action action = 1 [(google.api.field_behavior) = OPTIONAL];
2380
+
2381
+ // Optional. The condition under which the action is taken.
2382
+ Condition condition = 2 [(google.api.field_behavior) = OPTIONAL];
2383
+ }
2384
+
2385
+ // Optional. A lifecycle management rule, which is made of an action to take
2386
+ // and the condition under which the action is taken.
2387
+ repeated Rule rule = 1 [(google.api.field_behavior) = OPTIONAL];
2388
+ }
2389
+
2390
+ // Logging-related properties of a bucket.
2391
+ message Logging {
2392
+ // Optional. The destination bucket where the current bucket's logs should
2393
+ // be placed, using path format (like `projects/123456/buckets/foo`).
2394
+ string log_bucket = 1 [(google.api.field_behavior) = OPTIONAL];
2395
+
2396
+ // Optional. A prefix for log object names.
2397
+ string log_object_prefix = 2 [(google.api.field_behavior) = OPTIONAL];
2398
+ }
2399
+
2400
+ // StorageObject Retention related properties of a bucket.
2401
+ message ObjectRetention {
2402
+ // Optional. Output only. If true, object retention is enabled for the
2403
+ // bucket.
2404
+ bool enabled = 1 [
2405
+ (google.api.field_behavior) = OPTIONAL,
2406
+ (google.api.field_behavior) = OUTPUT_ONLY
2407
+ ];
2408
+ }
2409
+
2410
+ // Retention policy properties of a bucket.
2411
+ message RetentionPolicy {
2412
+ // Optional. Server-determined value that indicates the time from which
2413
+ // policy was enforced and effective.
2414
+ google.protobuf.Timestamp effective_time = 1
2415
+ [(google.api.field_behavior) = OPTIONAL];
2416
+
2417
+ // Optional. Once locked, an object retention policy cannot be modified.
2418
+ bool is_locked = 2 [(google.api.field_behavior) = OPTIONAL];
2419
+
2420
+ // Optional. The duration that objects need to be retained. Retention
2421
+ // duration must be greater than zero and less than 100 years. Note that
2422
+ // enforcement of retention periods less than a day is not guaranteed. Such
2423
+ // periods should only be used for testing purposes. Any `nanos` value
2424
+ // specified is rounded down to the nearest second.
2425
+ google.protobuf.Duration retention_duration = 4
2426
+ [(google.api.field_behavior) = OPTIONAL];
2427
+ }
2428
+
2429
+ // Soft delete policy properties of a bucket.
2430
+ message SoftDeletePolicy {
2431
+ // The period of time that soft-deleted objects in the bucket must be
2432
+ // retained and cannot be permanently deleted. The duration must be greater
2433
+ // than or equal to 7 days and less than 1 year.
2434
+ optional google.protobuf.Duration retention_duration = 1;
2435
+
2436
+ // Time from which the policy was effective. This is service-provided.
2437
+ optional google.protobuf.Timestamp effective_time = 2;
2438
+ }
2439
+
2440
+ // Properties of a bucket related to versioning.
2441
+ // For more information about Cloud Storage versioning, see [StorageObject
2442
+ // versioning](https://cloud.google.com/storage/docs/object-versioning).
2443
+ message Versioning {
2444
+ // Optional. While set to true, versioning is fully enabled for this bucket.
2445
+ bool enabled = 1 [(google.api.field_behavior) = OPTIONAL];
2446
+ }
2447
+
2448
+ // Properties of a bucket related to accessing the contents as a static
2449
+ // website. For details, see [hosting a static website using Cloud
2450
+ // Storage](https://cloud.google.com/storage/docs/hosting-static-website).
2451
+ message Website {
2452
+ // Optional. If the requested object path is missing, the service ensures
2453
+ // the path has a trailing '/', append this suffix, and attempt to retrieve
2454
+ // the resulting object. This allows the creation of `index.html` objects to
2455
+ // represent directory pages.
2456
+ string main_page_suffix = 1 [(google.api.field_behavior) = OPTIONAL];
2457
+
2458
+ // Optional. If the requested object path is missing, and any
2459
+ // `mainPageSuffix` object is missing, if applicable, the service
2460
+ // returns the named object from this bucket as the content for a
2461
+ // [404 Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)
2462
+ // result.
2463
+ string not_found_page = 2 [(google.api.field_behavior) = OPTIONAL];
2464
+ }
2465
+
2466
+ // Configuration for [configurable dual-
2467
+ // regions](https://cloud.google.com/storage/docs/locations#configurable). It
2468
+ // should specify precisely two eligible regions within the same multi-region.
2469
+ // For details, see
2470
+ // [locations](https://cloud.google.com/storage/docs/locations).
2471
+ message CustomPlacementConfig {
2472
+ // Optional. List of locations to use for data placement.
2473
+ repeated string data_locations = 1 [(google.api.field_behavior) = OPTIONAL];
2474
+ }
2475
+
2476
+ // Configuration for a bucket's Autoclass feature.
2477
+ message Autoclass {
2478
+ // Optional. Enables Autoclass.
2479
+ bool enabled = 1 [(google.api.field_behavior) = OPTIONAL];
2480
+
2481
+ // Output only. Latest instant at which the `enabled` field was set to true
2482
+ // after being disabled/unconfigured or set to false after being enabled. If
2483
+ // Autoclass is enabled when the bucket is created, the value of the
2484
+ // `toggle_time` field is set to the bucket `create_time`.
2485
+ google.protobuf.Timestamp toggle_time = 2
2486
+ [(google.api.field_behavior) = OUTPUT_ONLY];
2487
+
2488
+ // An object in an Autoclass bucket eventually cools down to the
2489
+ // terminal storage class if there is no access to the object.
2490
+ // The only valid values are NEARLINE and ARCHIVE.
2491
+ optional string terminal_storage_class = 3;
2492
+
2493
+ // Output only. Latest instant at which the autoclass terminal storage class
2494
+ // was updated.
2495
+ optional google.protobuf.Timestamp terminal_storage_class_update_time = 4
2496
+ [(google.api.field_behavior) = OUTPUT_ONLY];
2497
+ }
2498
+
2499
+ // The [bucket IP
2500
+ // filtering](https://cloud.google.com/storage/docs/ip-filtering-overview)
2501
+ // configuration. Specifies the network sources that can access the bucket, as
2502
+ // well as its underlying objects.
2503
+ message IpFilter {
2504
+ // The public network IP address ranges that can access the bucket and its
2505
+ // data.
2506
+ message PublicNetworkSource {
2507
+ // Optional. The list of IPv4 and IPv6 cidr blocks that are allowed to
2508
+ // operate or access the bucket and its underlying objects.
2509
+ repeated string allowed_ip_cidr_ranges = 1
2510
+ [(google.api.field_behavior) = OPTIONAL];
2511
+ }
2512
+
2513
+ // The list of VPC networks that can access the bucket.
2514
+ message VpcNetworkSource {
2515
+ // Name of the network.
2516
+ //
2517
+ // Format: `projects/PROJECT_ID/global/networks/NETWORK_NAME`
2518
+ optional string network = 1;
2519
+
2520
+ // Optional. The list of public or private IPv4 and IPv6 CIDR ranges that
2521
+ // can access the bucket. In the CIDR IP address block, the specified IP
2522
+ // address must be properly truncated, meaning all the host bits must be
2523
+ // zero or else the input is considered malformed. For example,
2524
+ // `192.0.2.0/24` is accepted but `192.0.2.1/24` is not. Similarly, for
2525
+ // IPv6, `2001:db8::/32` is accepted whereas `2001:db8::1/32` is not.
2526
+ repeated string allowed_ip_cidr_ranges = 2
2527
+ [(google.api.field_behavior) = OPTIONAL];
2528
+ }
2529
+
2530
+ // The state of the IP filter configuration. Valid values are `Enabled` and
2531
+ // `Disabled`. When set to `Enabled`, IP filtering rules are applied to a
2532
+ // bucket and all incoming requests to the bucket are evaluated against
2533
+ // these rules. When set to `Disabled`, IP filtering rules are not applied
2534
+ // to a bucket.
2535
+ optional string mode = 1;
2536
+
2537
+ // Public IPs allowed to operate or access the bucket.
2538
+ optional PublicNetworkSource public_network_source = 2;
2539
+
2540
+ // Optional. The list of network sources that are allowed to access
2541
+ // operations on the bucket or the underlying objects.
2542
+ repeated VpcNetworkSource vpc_network_sources = 3
2543
+ [(google.api.field_behavior) = OPTIONAL];
2544
+
2545
+ // Optional. Whether or not to allow VPCs from orgs different than the
2546
+ // bucket's parent org to access the bucket. When set to true, validations
2547
+ // on the existence of the VPCs won't be performed. If set to false, each
2548
+ // VPC network source is checked to belong to the same org as the bucket as
2549
+ // well as validated for existence.
2550
+ bool allow_cross_org_vpcs = 4 [(google.api.field_behavior) = OPTIONAL];
2551
+
2552
+ // Whether or not to allow all P4SA access to the bucket. When set to true,
2553
+ // IP filter config validation doesn't apply.
2554
+ optional bool allow_all_service_agent_access = 5;
2555
+ }
2556
+
2557
+ // Configuration for a bucket's hierarchical namespace feature.
2558
+ message HierarchicalNamespace {
2559
+ // Optional. Enables the hierarchical namespace feature.
2560
+ bool enabled = 1 [(google.api.field_behavior) = OPTIONAL];
2561
+ }
2562
+
2563
+ // Identifier. The name of the bucket.
2564
+ // Format: `projects/{project}/buckets/{bucket}`
2565
+ string name = 1 [(google.api.field_behavior) = IDENTIFIER];
2566
+
2567
+ // Output only. The user-chosen part of the bucket name. The `{bucket}`
2568
+ // portion of the `name` field. For globally unique buckets, this is equal to
2569
+ // the `bucket name` of other Cloud Storage APIs. Example: `pub`.
2570
+ string bucket_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
2571
+
2572
+ // The etag of the bucket.
2573
+ // If included in the metadata of an `UpdateBucketRequest`, the operation is
2574
+ // only performed if the `etag` matches that of the bucket.
2575
+ string etag = 29;
2576
+
2577
+ // Immutable. The project which owns this bucket, in the format of
2578
+ // `projects/{projectIdentifier}`.
2579
+ // `{projectIdentifier}` can be the project ID or project number.
2580
+ // Output values are always in the project number format.
2581
+ string project = 3 [
2582
+ (google.api.field_behavior) = IMMUTABLE,
2583
+ (google.api.resource_reference) = {
2584
+ type: "cloudresourcemanager.googleapis.com/Project"
2585
+ }
2586
+ ];
2587
+
2588
+ // Output only. The metadata generation of this bucket.
2589
+ int64 metageneration = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
2590
+
2591
+ // Immutable. The location of the bucket. StorageObject data for objects in the
2592
+ // bucket resides in physical storage within this region. Defaults to `US`.
2593
+ // Attempting to update this field after the bucket is created results in an
2594
+ // error.
2595
+ string location = 5 [(google.api.field_behavior) = IMMUTABLE];
2596
+
2597
+ // Output only. The location type of the bucket (region, dual-region,
2598
+ // multi-region, etc).
2599
+ string location_type = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
2600
+
2601
+ // Optional. The bucket's default storage class, used whenever no storageClass
2602
+ // is specified for a newly-created object. This defines how objects in the
2603
+ // bucket are stored and determines the SLA and the cost of storage.
2604
+ // If this value is not specified when the bucket is created, it defaults
2605
+ // to `STANDARD`. For more information, see [Storage
2606
+ // classes](https://developers.google.com/storage/docs/storage-classes).
2607
+ string storage_class = 7 [(google.api.field_behavior) = OPTIONAL];
2608
+
2609
+ // Optional. The recovery point objective for cross-region replication of the
2610
+ // bucket. Applicable only for dual- and multi-region buckets. `DEFAULT` uses
2611
+ // default replication. `ASYNC_TURBO` enables turbo replication, valid for
2612
+ // dual-region buckets only. If rpo is not specified when the bucket is
2613
+ // created, it defaults to `DEFAULT`. For more information, see [Turbo
2614
+ // replication](https://cloud.google.com/storage/docs/availability-durability#turbo-replication).
2615
+ string rpo = 27 [(google.api.field_behavior) = OPTIONAL];
2616
+
2617
+ // Optional. Access controls on the bucket.
2618
+ // If `iam_config.uniform_bucket_level_access` is enabled on this bucket,
2619
+ // requests to set, read, or modify acl is an error.
2620
+ repeated BucketAccessControl acl = 8 [(google.api.field_behavior) = OPTIONAL];
2621
+
2622
+ // Optional. Default access controls to apply to new objects when no ACL is
2623
+ // provided. If `iam_config.uniform_bucket_level_access` is enabled on this
2624
+ // bucket, requests to set, read, or modify acl is an error.
2625
+ repeated ObjectAccessControl default_object_acl = 9
2626
+ [(google.api.field_behavior) = OPTIONAL];
2627
+
2628
+ // Optional. The bucket's lifecycle configuration. See [Lifecycle
2629
+ // Management](https://developers.google.com/storage/docs/lifecycle) for more
2630
+ // information.
2631
+ Lifecycle lifecycle = 10 [(google.api.field_behavior) = OPTIONAL];
2632
+
2633
+ // Output only. The creation time of the bucket.
2634
+ google.protobuf.Timestamp create_time = 11
2635
+ [(google.api.field_behavior) = OUTPUT_ONLY];
2636
+
2637
+ // Optional. The bucket's [CORS](https://www.w3.org/TR/cors/)
2638
+ // configuration.
2639
+ repeated Cors cors = 12 [(google.api.field_behavior) = OPTIONAL];
2640
+
2641
+ // Output only. The modification time of the bucket.
2642
+ google.protobuf.Timestamp update_time = 13
2643
+ [(google.api.field_behavior) = OUTPUT_ONLY];
2644
+
2645
+ // Optional. The default value for event-based hold on newly created objects
2646
+ // in this bucket. Event-based hold is a way to retain objects indefinitely
2647
+ // until an event occurs, signified by the hold's release. After being
2648
+ // released, such objects are subject to bucket-level retention (if any). One
2649
+ // sample use case of this flag is for banks to hold loan documents for at
2650
+ // least 3 years after loan is paid in full. Here, bucket-level retention is 3
2651
+ // years and the event is loan being paid in full. In this example, these
2652
+ // objects are held intact for any number of years until the event has
2653
+ // occurred (event-based hold on the object is released) and then 3 more years
2654
+ // after that. That means retention duration of the objects begins from the
2655
+ // moment event-based hold transitioned from true to false. Objects under
2656
+ // event-based hold cannot be deleted, overwritten or archived until the hold
2657
+ // is removed.
2658
+ bool default_event_based_hold = 14 [(google.api.field_behavior) = OPTIONAL];
2659
+
2660
+ // Optional. User-provided labels, in key/value pairs.
2661
+ map<string, string> labels = 15 [(google.api.field_behavior) = OPTIONAL];
2662
+
2663
+ // Optional. The bucket's website config, controlling how the service behaves
2664
+ // when accessing bucket contents as a web site. See the [Static website
2665
+ // examples](https://cloud.google.com/storage/docs/static-website) for more
2666
+ // information.
2667
+ Website website = 16 [(google.api.field_behavior) = OPTIONAL];
2668
+
2669
+ // Optional. The bucket's versioning configuration.
2670
+ Versioning versioning = 17 [(google.api.field_behavior) = OPTIONAL];
2671
+
2672
+ // Optional. The bucket's logging config, which defines the destination bucket
2673
+ // and name prefix (if any) for the current bucket's logs.
2674
+ Logging logging = 18 [(google.api.field_behavior) = OPTIONAL];
2675
+
2676
+ // Output only. The owner of the bucket. This is always the project team's
2677
+ // owner group.
2678
+ Owner owner = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
2679
+
2680
+ // Optional. Encryption config for a bucket.
2681
+ Encryption encryption = 20 [(google.api.field_behavior) = OPTIONAL];
2682
+
2683
+ // Optional. The bucket's billing configuration.
2684
+ Billing billing = 21 [(google.api.field_behavior) = OPTIONAL];
2685
+
2686
+ // Optional. The bucket's retention policy. The retention policy enforces a
2687
+ // minimum retention time for all objects contained in the bucket, based on
2688
+ // their creation time. Any attempt to overwrite or delete objects younger
2689
+ // than the retention period results in a `PERMISSION_DENIED` error. An
2690
+ // unlocked retention policy can be modified or removed from the bucket via a
2691
+ // storage.buckets.update operation. A locked retention policy cannot be
2692
+ // removed or shortened in duration for the lifetime of the bucket.
2693
+ // Attempting to remove or decrease period of a locked retention policy
2694
+ // results in a `PERMISSION_DENIED` error.
2695
+ RetentionPolicy retention_policy = 22
2696
+ [(google.api.field_behavior) = OPTIONAL];
2697
+
2698
+ // Optional. The bucket's IAM configuration.
2699
+ IamConfig iam_config = 23 [(google.api.field_behavior) = OPTIONAL];
2700
+
2701
+ // Optional. Reserved for future use.
2702
+ bool satisfies_pzs = 25 [(google.api.field_behavior) = OPTIONAL];
2703
+
2704
+ // Optional. Configuration that, if present, specifies the data placement for
2705
+ // a [configurable
2706
+ // dual-region](https://cloud.google.com/storage/docs/locations#location-dr).
2707
+ CustomPlacementConfig custom_placement_config = 26
2708
+ [(google.api.field_behavior) = OPTIONAL];
2709
+
2710
+ // Optional. The bucket's Autoclass configuration. If there is no
2711
+ // configuration, the Autoclass feature is disabled and has no effect on the
2712
+ // bucket.
2713
+ Autoclass autoclass = 28 [(google.api.field_behavior) = OPTIONAL];
2714
+
2715
+ // Optional. The bucket's hierarchical namespace configuration. If there is no
2716
+ // configuration, the hierarchical namespace feature is disabled and has
2717
+ // no effect on the bucket.
2718
+ HierarchicalNamespace hierarchical_namespace = 32
2719
+ [(google.api.field_behavior) = OPTIONAL];
2720
+
2721
+ // Optional. The bucket's soft delete policy. The soft delete policy prevents
2722
+ // soft-deleted objects from being permanently deleted.
2723
+ SoftDeletePolicy soft_delete_policy = 31
2724
+ [(google.api.field_behavior) = OPTIONAL];
2725
+
2726
+ // Optional. The bucket's object retention configuration. Must be enabled
2727
+ // before objects in the bucket might have retention configured.
2728
+ ObjectRetention object_retention = 33
2729
+ [(google.api.field_behavior) = OPTIONAL];
2730
+
2731
+ // Optional. The bucket's IP filter configuration.
2732
+ optional IpFilter ip_filter = 38 [(google.api.field_behavior) = OPTIONAL];
2733
+ }
2734
+
2735
+ // An access-control entry.
2736
+ message BucketAccessControl {
2737
+ // Optional. The access permission for the entity.
2738
+ string role = 1 [(google.api.field_behavior) = OPTIONAL];
2739
+
2740
+ // Optional. The ID of the access-control entry.
2741
+ string id = 2 [(google.api.field_behavior) = OPTIONAL];
2742
+
2743
+ // Optional. The entity holding the permission, in one of the following forms:
2744
+ // * `user-{userid}`
2745
+ // * `user-{email}`
2746
+ // * `group-{groupid}`
2747
+ // * `group-{email}`
2748
+ // * `domain-{domain}`
2749
+ // * `project-{team}-{projectnumber}`
2750
+ // * `project-{team}-{projectid}`
2751
+ // * `allUsers`
2752
+ // * `allAuthenticatedUsers`
2753
+ // Examples:
2754
+ // * The user `liz@example.com` would be `user-liz@example.com`.
2755
+ // * The group `example@googlegroups.com` would be
2756
+ // `group-example@googlegroups.com`
2757
+ // * All members of the Google Apps for Business domain `example.com` would be
2758
+ // `domain-example.com`
2759
+ // For project entities, `project-{team}-{projectnumber}` format is
2760
+ // returned on response.
2761
+ string entity = 3 [(google.api.field_behavior) = OPTIONAL];
2762
+
2763
+ // Output only. The alternative entity format, if exists. For project
2764
+ // entities, `project-{team}-{projectid}` format is returned in the response.
2765
+ string entity_alt = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
2766
+
2767
+ // Optional. The ID for the entity, if any.
2768
+ string entity_id = 4 [(google.api.field_behavior) = OPTIONAL];
2769
+
2770
+ // Optional. The `etag` of the `BucketAccessControl`.
2771
+ // If included in the metadata of an update or delete request message, the
2772
+ // operation operation is only performed if the etag matches that of the
2773
+ // bucket's `BucketAccessControl`.
2774
+ string etag = 8 [(google.api.field_behavior) = OPTIONAL];
2775
+
2776
+ // Optional. The email address associated with the entity, if any.
2777
+ string email = 5 [(google.api.field_behavior) = OPTIONAL];
2778
+
2779
+ // Optional. The domain associated with the entity, if any.
2780
+ string domain = 6 [(google.api.field_behavior) = OPTIONAL];
2781
+
2782
+ // Optional. The project team associated with the entity, if any.
2783
+ ProjectTeam project_team = 7 [(google.api.field_behavior) = OPTIONAL];
2784
+ }
2785
+
2786
+ // Message used to convey content being read or written, along with an optional
2787
+ // checksum.
2788
+ message ChecksummedData {
2789
+ // Optional. The data.
2790
+ bytes content = 1 [ctype = CORD, (google.api.field_behavior) = OPTIONAL];
2791
+
2792
+ // If set, the CRC32C digest of the content field.
2793
+ optional fixed32 crc32c = 2;
2794
+ }
2795
+
2796
+ // Message used for storing full (not subrange) object checksums.
2797
+ message ObjectChecksums {
2798
+ // CRC32C digest of the object data. Computed by the Cloud Storage service for
2799
+ // all written objects.
2800
+ // If set in a WriteObjectRequest, service validates that the stored
2801
+ // object matches this checksum.
2802
+ optional fixed32 crc32c = 1;
2803
+
2804
+ // Optional. 128 bit MD5 hash of the object data. For more information about
2805
+ // using the MD5 hash, see [Data validation and change
2806
+ // detection](https://cloud.google.com/storage/docs/data-validation). Not all
2807
+ // objects provide an MD5 hash. For example, composite objects provide only
2808
+ // crc32c hashes. This value is equivalent to running `cat object.txt |
2809
+ // openssl md5 -binary`
2810
+ bytes md5_hash = 2 [(google.api.field_behavior) = OPTIONAL];
2811
+ }
2812
+
2813
+ // The payload of a single user-defined object context.
2814
+ message ObjectCustomContextPayload {
2815
+ // Required. The value of the object context.
2816
+ string value = 1 [(google.api.field_behavior) = REQUIRED];
2817
+
2818
+ // Output only. The time at which the object context was created.
2819
+ google.protobuf.Timestamp create_time = 2
2820
+ [(google.api.field_behavior) = OUTPUT_ONLY];
2821
+
2822
+ // Output only. The time at which the object context was last updated.
2823
+ google.protobuf.Timestamp update_time = 3
2824
+ [(google.api.field_behavior) = OUTPUT_ONLY];
2825
+ }
2826
+
2827
+ // All contexts of an object grouped by type.
2828
+ message ObjectContexts {
2829
+ // Optional. User-defined object contexts.
2830
+ // The maximum key or value size is `256` characters.
2831
+ // The maximum number of entries is `50`.
2832
+ // The maximum total serialized size of all entries is `25KiB`.
2833
+ map<string, ObjectCustomContextPayload> custom = 1
2834
+ [(google.api.field_behavior) = OPTIONAL];
2835
+ }
2836
+
2837
+ // Describes the customer-supplied encryption key mechanism used to store an
2838
+ // object's data at rest.
2839
+ message CustomerEncryption {
2840
+ // Optional. The encryption algorithm.
2841
+ string encryption_algorithm = 1 [(google.api.field_behavior) = OPTIONAL];
2842
+
2843
+ // Optional. SHA256 hash value of the encryption key.
2844
+ // In raw bytes format (not base64-encoded).
2845
+ bytes key_sha256_bytes = 3 [(google.api.field_behavior) = OPTIONAL];
2846
+ }
2847
+
2848
+ // An object.
2849
+ message StorageObject {
2850
+ // Specifies retention parameters of the object. Objects under retention
2851
+ // cannot be deleted or overwritten until their retention expires.
2852
+ message Retention {
2853
+ // Retention mode values.
2854
+ enum Mode {
2855
+ // No specified mode. StorageObject is not under retention.
2856
+ MODE_UNSPECIFIED = 0;
2857
+
2858
+ // Retention period might be decreased or increased.
2859
+ // The Retention configuration might be removed.
2860
+ // The mode might be changed to locked.
2861
+ UNLOCKED = 1;
2862
+
2863
+ // Retention period might be increased.
2864
+ // The Retention configuration cannot be removed.
2865
+ // The mode cannot be changed.
2866
+ LOCKED = 2;
2867
+ }
2868
+
2869
+ // Optional. The mode of the Retention.
2870
+ Mode mode = 1 [(google.api.field_behavior) = OPTIONAL];
2871
+
2872
+ // Optional. The timestamp that the object needs to be retained until.
2873
+ // Value cannot be set in the past or more than 100 years in the future.
2874
+ google.protobuf.Timestamp retain_until_time = 2
2875
+ [(google.api.field_behavior) = OPTIONAL];
2876
+ }
2877
+
2878
+ // Immutable. The name of this object. Nearly any sequence of unicode
2879
+ // characters is valid. See
2880
+ // [Guidelines](https://cloud.google.com/storage/docs/objects#naming).
2881
+ // Example: `test.txt`
2882
+ // The `name` field by itself does not uniquely identify a Cloud Storage
2883
+ // object. A Cloud Storage object is uniquely identified by the tuple of
2884
+ // (bucket, object, generation).
2885
+ string name = 1 [(google.api.field_behavior) = IMMUTABLE];
2886
+
2887
+ // Immutable. The name of the bucket containing this object.
2888
+ string bucket = 2 [
2889
+ (google.api.field_behavior) = IMMUTABLE,
2890
+ (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" }
2891
+ ];
2892
+
2893
+ // Optional. The `etag` of an object.
2894
+ // If included in the metadata of an update or delete request message, the
2895
+ // operation is only performed if the etag matches that of the live
2896
+ // object.
2897
+ string etag = 27 [(google.api.field_behavior) = OPTIONAL];
2898
+
2899
+ // Immutable. The content generation of this object. Used for object
2900
+ // versioning.
2901
+ int64 generation = 3 [(google.api.field_behavior) = IMMUTABLE];
2902
+
2903
+ // Output only. Restore token used to differentiate deleted objects with the
2904
+ // same name and generation. This field is output only, and only set for
2905
+ // deleted objects in HNS buckets.
2906
+ optional string restore_token = 35
2907
+ [(google.api.field_behavior) = OUTPUT_ONLY];
2908
+
2909
+ // Output only. The version of the metadata for this generation of this
2910
+ // object. Used for preconditions and for detecting changes in metadata. A
2911
+ // metageneration number is only meaningful in the context of a particular
2912
+ // generation of a particular object.
2913
+ int64 metageneration = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
2914
+
2915
+ // Optional. Storage class of the object.
2916
+ string storage_class = 5 [(google.api.field_behavior) = OPTIONAL];
2917
+
2918
+ // Output only. Content-Length of the object data in bytes, matching
2919
+ // [RFC 7230 §3.3.2](https://tools.ietf.org/html/rfc7230#section-3.3.2]).
2920
+ int64 size = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
2921
+
2922
+ // Optional. Content-Encoding of the object data, matching
2923
+ // [RFC 7231 §3.1.2.2](https://tools.ietf.org/html/rfc7231#section-3.1.2.2)
2924
+ string content_encoding = 7 [(google.api.field_behavior) = OPTIONAL];
2925
+
2926
+ // Optional. Content-Disposition of the object data, matching
2927
+ // [RFC 6266](https://tools.ietf.org/html/rfc6266).
2928
+ string content_disposition = 8 [(google.api.field_behavior) = OPTIONAL];
2929
+
2930
+ // Optional. Cache-Control directive for the object data, matching
2931
+ // [RFC 7234 §5.2](https://tools.ietf.org/html/rfc7234#section-5.2).
2932
+ // If omitted, and the object is accessible to all anonymous users, the
2933
+ // default is `public, max-age=3600`.
2934
+ string cache_control = 9 [(google.api.field_behavior) = OPTIONAL];
2935
+
2936
+ // Optional. Access controls on the object.
2937
+ // If `iam_config.uniform_bucket_level_access` is enabled on the parent
2938
+ // bucket, requests to set, read, or modify acl is an error.
2939
+ repeated ObjectAccessControl acl = 10
2940
+ [(google.api.field_behavior) = OPTIONAL];
2941
+
2942
+ // Optional. Content-Language of the object data, matching
2943
+ // [RFC 7231 §3.1.3.2](https://tools.ietf.org/html/rfc7231#section-3.1.3.2).
2944
+ string content_language = 11 [(google.api.field_behavior) = OPTIONAL];
2945
+
2946
+ // Output only. If this object is noncurrent, this is the time when the object
2947
+ // became noncurrent.
2948
+ google.protobuf.Timestamp delete_time = 12
2949
+ [(google.api.field_behavior) = OUTPUT_ONLY];
2950
+
2951
+ // Output only. The time when the object was finalized.
2952
+ google.protobuf.Timestamp finalize_time = 36
2953
+ [(google.api.field_behavior) = OUTPUT_ONLY];
2954
+
2955
+ // Optional. Content-Type of the object data, matching
2956
+ // [RFC 7231 §3.1.1.5](https://tools.ietf.org/html/rfc7231#section-3.1.1.5).
2957
+ // If an object is stored without a Content-Type, it is served as
2958
+ // `application/octet-stream`.
2959
+ string content_type = 13 [(google.api.field_behavior) = OPTIONAL];
2960
+
2961
+ // Output only. The creation time of the object.
2962
+ google.protobuf.Timestamp create_time = 14
2963
+ [(google.api.field_behavior) = OUTPUT_ONLY];
2964
+
2965
+ // Output only. Number of underlying components that make up this object.
2966
+ // Components are accumulated by compose operations.
2967
+ int32 component_count = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
2968
+
2969
+ // Output only. Hashes for the data part of this object. This field is used
2970
+ // for output only and is silently ignored if provided in requests. The
2971
+ // checksums of the complete object regardless of data range. If the object is
2972
+ // downloaded in full, the client should compute one of these checksums over
2973
+ // the downloaded object and compare it against the value provided here.
2974
+ ObjectChecksums checksums = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
2975
+
2976
+ // Output only. The modification time of the object metadata.
2977
+ // Set initially to object creation time and then updated whenever any
2978
+ // metadata of the object changes. This includes changes made by a requester,
2979
+ // such as modifying custom metadata, as well as changes made by Cloud Storage
2980
+ // on behalf of a requester, such as changing the storage class based on an
2981
+ // StorageObject Lifecycle Configuration.
2982
+ google.protobuf.Timestamp update_time = 17
2983
+ [(google.api.field_behavior) = OUTPUT_ONLY];
2984
+
2985
+ // Optional. Cloud KMS Key used to encrypt this object, if the object is
2986
+ // encrypted by such a key.
2987
+ string kms_key = 18 [
2988
+ (google.api.field_behavior) = OPTIONAL,
2989
+ (google.api.resource_reference) = {
2990
+ type: "cloudkms.googleapis.com/CryptoKey"
2991
+ }
2992
+ ];
2993
+
2994
+ // Output only. The time at which the object's storage class was last changed.
2995
+ // When the object is initially created, it is set to `time_created`.
2996
+ google.protobuf.Timestamp update_storage_class_time = 19
2997
+ [(google.api.field_behavior) = OUTPUT_ONLY];
2998
+
2999
+ // Optional. Whether an object is under temporary hold. While this flag is set
3000
+ // to true, the object is protected against deletion and overwrites. A common
3001
+ // use case of this flag is regulatory investigations where objects need to be
3002
+ // retained while the investigation is ongoing. Note that unlike event-based
3003
+ // hold, temporary hold does not impact retention expiration time of an
3004
+ // object.
3005
+ bool temporary_hold = 20 [(google.api.field_behavior) = OPTIONAL];
3006
+
3007
+ // Optional. A server-determined value that specifies the earliest time that
3008
+ // the object's retention period expires. Note 1: This field is not provided
3009
+ // for objects with an active event-based hold, since retention expiration is
3010
+ // unknown until the hold is removed. Note 2: This value can be provided even
3011
+ // when temporary hold is set (so that the user can reason about policy
3012
+ // without having to first unset the temporary hold).
3013
+ google.protobuf.Timestamp retention_expire_time = 21
3014
+ [(google.api.field_behavior) = OPTIONAL];
3015
+
3016
+ // Optional. User-provided metadata, in key/value pairs.
3017
+ map<string, string> metadata = 22 [(google.api.field_behavior) = OPTIONAL];
3018
+
3019
+ // Optional. User-defined or system-defined object contexts. Each object
3020
+ // context is a key-payload pair, where the key provides the identification
3021
+ // and the payload holds the associated value and additional metadata.
3022
+ ObjectContexts contexts = 38 [(google.api.field_behavior) = OPTIONAL];
3023
+
3024
+ // Whether an object is under event-based hold.
3025
+ // An event-based hold is a way to force the retention of an object until
3026
+ // after some event occurs. Once the hold is released by explicitly setting
3027
+ // this field to `false`, the object becomes subject to any bucket-level
3028
+ // retention policy, except that the retention duration is calculated
3029
+ // from the time the event based hold was lifted, rather than the time the
3030
+ // object was created.
3031
+ //
3032
+ // In a `WriteObject` request, not setting this field implies that the value
3033
+ // should be taken from the parent bucket's `default_event_based_hold` field.
3034
+ // In a response, this field is always set to `true` or `false`.
3035
+ optional bool event_based_hold = 23;
3036
+
3037
+ // Output only. The owner of the object. This is always the uploader of the
3038
+ // object.
3039
+ Owner owner = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
3040
+
3041
+ // Optional. Metadata of customer-supplied encryption key, if the object is
3042
+ // encrypted by such a key.
3043
+ CustomerEncryption customer_encryption = 25
3044
+ [(google.api.field_behavior) = OPTIONAL];
3045
+
3046
+ // Optional. A user-specified timestamp set on an object.
3047
+ google.protobuf.Timestamp custom_time = 26
3048
+ [(google.api.field_behavior) = OPTIONAL];
3049
+
3050
+ // Output only. This is the time when the object became soft-deleted.
3051
+ //
3052
+ // Soft-deleted objects are only accessible if a soft_delete_policy is
3053
+ // enabled. Also see `hard_delete_time`.
3054
+ optional google.protobuf.Timestamp soft_delete_time = 28
3055
+ [(google.api.field_behavior) = OUTPUT_ONLY];
3056
+
3057
+ // Output only. The time when the object is permanently deleted.
3058
+ //
3059
+ // Only set when an object becomes soft-deleted with a `soft_delete_policy`.
3060
+ // Otherwise, the object is not accessible.
3061
+ optional google.protobuf.Timestamp hard_delete_time = 29
3062
+ [(google.api.field_behavior) = OUTPUT_ONLY];
3063
+
3064
+ // Optional. Retention configuration of this object.
3065
+ // Might only be configured if the bucket has object retention enabled.
3066
+ Retention retention = 30 [(google.api.field_behavior) = OPTIONAL];
3067
+ }
3068
+
3069
+ // An access-control entry.
3070
+ message ObjectAccessControl {
3071
+ // Optional. The access permission for the entity. One of the following
3072
+ // values:
3073
+ // * `READER`
3074
+ // * `WRITER`
3075
+ // * `OWNER`
3076
+ string role = 1 [(google.api.field_behavior) = OPTIONAL];
3077
+
3078
+ // Optional. The ID of the access-control entry.
3079
+ string id = 2 [(google.api.field_behavior) = OPTIONAL];
3080
+
3081
+ // Optional. The entity holding the permission, in one of the following forms:
3082
+ // * `user-{userid}`
3083
+ // * `user-{email}`
3084
+ // * `group-{groupid}`
3085
+ // * `group-{email}`
3086
+ // * `domain-{domain}`
3087
+ // * `project-{team}-{projectnumber}`
3088
+ // * `project-{team}-{projectid}`
3089
+ // * `allUsers`
3090
+ // * `allAuthenticatedUsers`
3091
+ // Examples:
3092
+ // * The user `liz@example.com` would be `user-liz@example.com`.
3093
+ // * The group `example@googlegroups.com` would be
3094
+ // `group-example@googlegroups.com`.
3095
+ // * All members of the Google Apps for Business domain `example.com` would be
3096
+ // `domain-example.com`.
3097
+ // For project entities, `project-{team}-{projectnumber}` format is
3098
+ // returned in the response.
3099
+ string entity = 3 [(google.api.field_behavior) = OPTIONAL];
3100
+
3101
+ // Output only. The alternative entity format, if exists. For project
3102
+ // entities, `project-{team}-{projectid}` format is returned in the response.
3103
+ string entity_alt = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
3104
+
3105
+ // Optional. The ID for the entity, if any.
3106
+ string entity_id = 4 [(google.api.field_behavior) = OPTIONAL];
3107
+
3108
+ // Optional. The etag of the ObjectAccessControl.
3109
+ // If included in the metadata of an update or delete request message, the
3110
+ // operation is only performed if the etag matches that of the live
3111
+ // object's ObjectAccessControl.
3112
+ string etag = 8 [(google.api.field_behavior) = OPTIONAL];
3113
+
3114
+ // Optional. The email address associated with the entity, if any.
3115
+ string email = 5 [(google.api.field_behavior) = OPTIONAL];
3116
+
3117
+ // Optional. The domain associated with the entity, if any.
3118
+ string domain = 6 [(google.api.field_behavior) = OPTIONAL];
3119
+
3120
+ // Optional. The project team associated with the entity, if any.
3121
+ ProjectTeam project_team = 7 [(google.api.field_behavior) = OPTIONAL];
3122
+ }
3123
+
3124
+ // The result of a call to Objects.ListObjects
3125
+ message ListObjectsResponse {
3126
+ // The list of items.
3127
+ repeated StorageObject objects = 1;
3128
+
3129
+ // The list of prefixes of objects matching-but-not-listed up to and including
3130
+ // the requested delimiter.
3131
+ repeated string prefixes = 2;
3132
+
3133
+ // The continuation token, used to page through large result sets. Provide
3134
+ // this value in a subsequent request to return the next page of results.
3135
+ string next_page_token = 3;
3136
+ }
3137
+
3138
+ // Represents the Viewers, Editors, or Owners of a given project.
3139
+ message ProjectTeam {
3140
+ // Optional. The project number.
3141
+ string project_number = 1 [(google.api.field_behavior) = OPTIONAL];
3142
+
3143
+ // Optional. The team.
3144
+ string team = 2 [(google.api.field_behavior) = OPTIONAL];
3145
+ }
3146
+
3147
+ // The owner of a specific resource.
3148
+ message Owner {
3149
+ // Optional. The entity, in the form `user-`*userId*.
3150
+ string entity = 1 [(google.api.field_behavior) = OPTIONAL];
3151
+
3152
+ // Optional. The ID for the entity.
3153
+ string entity_id = 2 [(google.api.field_behavior) = OPTIONAL];
3154
+ }
3155
+
3156
+ // Specifies a requested range of bytes to download.
3157
+ message ContentRange {
3158
+ // The starting offset of the object data. This value is inclusive.
3159
+ int64 start = 1;
3160
+
3161
+ // The ending offset of the object data. This value is exclusive.
3162
+ int64 end = 2;
3163
+
3164
+ // The complete length of the object data.
3165
+ int64 complete_length = 3;
3166
+ }