Skip to content

Commit

Permalink
feat!: Change RewriteObjectRequest to specify bucket name, object nam…
Browse files Browse the repository at this point in the history
…e and KMS key outside of Object resource

PiperOrigin-RevId: 424391425
  • Loading branch information
Google APIs authored and Copybara-Service committed Jan 26, 2022
1 parent 2060f89 commit 8479561
Showing 1 changed file with 46 additions and 29 deletions.
75 changes: 46 additions & 29 deletions google/storage/v2/storage.proto
Expand Up @@ -319,10 +319,10 @@ message CreateBucketRequest {
// the bucket resource.
Bucket bucket = 2 [(google.api.field_behavior) = REQUIRED];

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

// Apply a predefined set of access controls to this bucket.
PredefinedBucketAcl predefined_acl = 4;
Expand Down Expand Up @@ -511,9 +511,9 @@ message ComposeObjectRequest {
optional int64 if_generation_match = 1;
}

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

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

// Request message for RewriteObject.
message RewriteObjectRequest {
// Immutable. The name of the destination object. Nearly any sequence of unicode
// characters is valid. See
// [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
// Example: `test.txt`
// The `name` field by itself does not uniquely identify a Cloud Storage
// object. A Cloud Storage object is uniquely identified by the tuple of
// (bucket, object, generation).
string destination_name = 24 [(google.api.field_behavior) = IMMUTABLE];

// Immutable. The name of the bucket containing The name of the destination object.
string destination_bucket = 25 [
(google.api.field_behavior) = IMMUTABLE,
(google.api.resource_reference) = {
type: "storage.googleapis.com/Bucket"
}
];

// Metadata of customer-supplied encryption key for the destination object, if
// the object is to be encrypted by such a key.
CustomerEncryption destination_customer_encryption = 26;

// Properties of the destination, post-rewrite object.
// Includes bucket name, object name, KMS key.
// The `name`, `bucket`, and `customer_encryption` fields must not be
// populated (these values are specified in the `destination_name`,
// `destination_bucket`, and `destination_customer_encryption` fields).
// If `destination` is present it will be used to construct the destination
// object's metadata; otherwise the destination object's metadata will be
// copied from the source object.
Object destination = 1;

// List of fields to be updated in the destination object from `destination`.
// If the mask is not present, all fields from the source object will be
// copied excepting ACL. If the mask is present but specifies no fields, no
// fields will be copied.
// Non-ACL metadata not included in the mask will be copied from the source
// object.
// If not present, all fields from the destination will be set from
// `destination`.
google.protobuf.FieldMask rewrite_mask = 23;

// Required. Name of the bucket in which to find the source object.
string source_bucket = 2 [(google.api.field_behavior) = REQUIRED];

Expand Down Expand Up @@ -1442,8 +1458,8 @@ message Bucket {
message Rule {
// An action to take on an object.
message Action {
// Type of the action. Currently, only `Delete` and
// `SetStorageClass` are supported.
// Type of the action. Currently, only `Delete`, `SetStorageClass`, and
// `AbortIncompleteMultipartUpload` are supported.
string type = 1;

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

// Required. The resource name of this notification.
// Format:
// `projects/{project}/buckets/{bucket}/notificationConfigs/{notification` The
// `{project}` portion may be `_` for globally unique buckets.
// `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
// The `{project}` portion may be `_` for globally unique buckets.
string name = 1 [(google.api.field_behavior) = REQUIRED];

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

// Describes the customer-specified mechanism used to store an Object's data at
// rest.
message CustomerEncryption {
// The encryption algorithm.
string encryption_algorithm = 1;

// SHA256 hash value of the encryption key.
// In raw bytes format (not base64-encoded).
bytes key_sha256_bytes = 3;
}

// An object.
message Object {
// Describes the customer-specified mechanism used to store the data at rest.
message CustomerEncryption {
// The encryption algorithm.
string encryption_algorithm = 1;

// SHA256 hash value of the encryption key.
// In raw bytes format (not base64-encoded).
bytes key_sha256_bytes = 3;
}

// Immutable. The name of this object. Nearly any sequence of unicode characters is
// valid. See
// [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
Expand Down

0 comments on commit 8479561

Please sign in to comment.