Skip to content

Commit 8479561

Browse files
Google APIscopybara-github
authored andcommitted
feat!: Change RewriteObjectRequest to specify bucket name, object name and KMS key outside of Object resource
PiperOrigin-RevId: 424391425
1 parent 2060f89 commit 8479561

1 file changed

Lines changed: 46 additions & 29 deletions

File tree

google/storage/v2/storage.proto

Lines changed: 46 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,10 @@ message CreateBucketRequest {
319319
// the bucket resource.
320320
Bucket bucket = 2 [(google.api.field_behavior) = REQUIRED];
321321

322-
// The ID to use for this bucket, which will become the final component of
322+
// Required. The ID to use for this bucket, which will become the final component of
323323
// the bucket's resource name. For example, the value `foo` might result in
324324
// a bucket with the name `projects/123456/buckets/foo`.
325-
string bucket_id = 3;
325+
string bucket_id = 3 [(google.api.field_behavior) = REQUIRED];
326326

327327
// Apply a predefined set of access controls to this bucket.
328328
PredefinedBucketAcl predefined_acl = 4;
@@ -511,9 +511,9 @@ message ComposeObjectRequest {
511511
optional int64 if_generation_match = 1;
512512
}
513513

514-
// The source object's name. All source objects must reside in the same
514+
// Required. The source object's name. All source objects must reside in the same
515515
// bucket.
516-
string name = 1;
516+
string name = 1 [(google.api.field_behavior) = REQUIRED];
517517

518518
// The generation of this object to use as the source.
519519
int64 generation = 2;
@@ -924,20 +924,36 @@ message QueryWriteStatusResponse {
924924

925925
// Request message for RewriteObject.
926926
message RewriteObjectRequest {
927+
// Immutable. The name of the destination object. Nearly any sequence of unicode
928+
// characters is valid. See
929+
// [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
930+
// Example: `test.txt`
931+
// The `name` field by itself does not uniquely identify a Cloud Storage
932+
// object. A Cloud Storage object is uniquely identified by the tuple of
933+
// (bucket, object, generation).
934+
string destination_name = 24 [(google.api.field_behavior) = IMMUTABLE];
935+
936+
// Immutable. The name of the bucket containing The name of the destination object.
937+
string destination_bucket = 25 [
938+
(google.api.field_behavior) = IMMUTABLE,
939+
(google.api.resource_reference) = {
940+
type: "storage.googleapis.com/Bucket"
941+
}
942+
];
943+
944+
// Metadata of customer-supplied encryption key for the destination object, if
945+
// the object is to be encrypted by such a key.
946+
CustomerEncryption destination_customer_encryption = 26;
947+
927948
// Properties of the destination, post-rewrite object.
928-
// Includes bucket name, object name, KMS key.
949+
// The `name`, `bucket`, and `customer_encryption` fields must not be
950+
// populated (these values are specified in the `destination_name`,
951+
// `destination_bucket`, and `destination_customer_encryption` fields).
952+
// If `destination` is present it will be used to construct the destination
953+
// object's metadata; otherwise the destination object's metadata will be
954+
// copied from the source object.
929955
Object destination = 1;
930956

931-
// List of fields to be updated in the destination object from `destination`.
932-
// If the mask is not present, all fields from the source object will be
933-
// copied excepting ACL. If the mask is present but specifies no fields, no
934-
// fields will be copied.
935-
// Non-ACL metadata not included in the mask will be copied from the source
936-
// object.
937-
// If not present, all fields from the destination will be set from
938-
// `destination`.
939-
google.protobuf.FieldMask rewrite_mask = 23;
940-
941957
// Required. Name of the bucket in which to find the source object.
942958
string source_bucket = 2 [(google.api.field_behavior) = REQUIRED];
943959

@@ -1442,8 +1458,8 @@ message Bucket {
14421458
message Rule {
14431459
// An action to take on an object.
14441460
message Action {
1445-
// Type of the action. Currently, only `Delete` and
1446-
// `SetStorageClass` are supported.
1461+
// Type of the action. Currently, only `Delete`, `SetStorageClass`, and
1462+
// `AbortIncompleteMultipartUpload` are supported.
14471463
string type = 1;
14481464

14491465
// Target storage class. Required iff the type of the action is
@@ -1812,8 +1828,8 @@ message Notification {
18121828

18131829
// Required. The resource name of this notification.
18141830
// Format:
1815-
// `projects/{project}/buckets/{bucket}/notificationConfigs/{notification` The
1816-
// `{project}` portion may be `_` for globally unique buckets.
1831+
// `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
1832+
// The `{project}` portion may be `_` for globally unique buckets.
18171833
string name = 1 [(google.api.field_behavior) = REQUIRED];
18181834

18191835
// Required. The Pub/Sub topic to which this subscription publishes. Formatted as:
@@ -1836,18 +1852,19 @@ message Notification {
18361852
string payload_format = 6 [(google.api.field_behavior) = REQUIRED];
18371853
}
18381854

1855+
// Describes the customer-specified mechanism used to store an Object's data at
1856+
// rest.
1857+
message CustomerEncryption {
1858+
// The encryption algorithm.
1859+
string encryption_algorithm = 1;
1860+
1861+
// SHA256 hash value of the encryption key.
1862+
// In raw bytes format (not base64-encoded).
1863+
bytes key_sha256_bytes = 3;
1864+
}
1865+
18391866
// An object.
18401867
message Object {
1841-
// Describes the customer-specified mechanism used to store the data at rest.
1842-
message CustomerEncryption {
1843-
// The encryption algorithm.
1844-
string encryption_algorithm = 1;
1845-
1846-
// SHA256 hash value of the encryption key.
1847-
// In raw bytes format (not base64-encoded).
1848-
bytes key_sha256_bytes = 3;
1849-
}
1850-
18511868
// Immutable. The name of this object. Nearly any sequence of unicode characters is
18521869
// valid. See
18531870
// [Guidelines](https://cloud.google.com/storage/docs/naming-objects).

0 commit comments

Comments
 (0)