Reference documentation and code samples for the Google Cloud Storage Batch Operations V1 Client class RewriteObject.
Describes options for object rewrite.
Generated from protobuf message google.cloud.storagebatchoperations.v1.RewriteObject
Namespace
Google \ Cloud \ StorageBatchOperations \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ kms_key
string
Required. Resource name of the Cloud KMS key that will be used to encrypt the object. The Cloud KMS key must be located in same location as the object. Refer to https://cloud.google.com/storage/docs/encryption/using-customer-managed-keys#add-object-key for additional documentation. Format: projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key} For example: "projects/123456/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key". The object will be rewritten and set with the specified KMS key.
getKmsKey
Required. Resource name of the Cloud KMS key that will be used to encrypt
the object. The Cloud KMS key must be located in same location as the
object. Refer to
https://cloud.google.com/storage/docs/encryption/using-customer-managed-keys#add-object-key
for additional documentation. Format:
projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}
For example:
"projects/123456/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key".
The object will be rewritten and set with the specified KMS key.
Returns
Type
Description
string
hasKmsKey
clearKmsKey
setKmsKey
Required. Resource name of the Cloud KMS key that will be used to encrypt
the object. The Cloud KMS key must be located in same location as the
object. Refer to
https://cloud.google.com/storage/docs/encryption/using-customer-managed-keys#add-object-key
for additional documentation. Format:
projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}
For example:
"projects/123456/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key".
The object will be rewritten and set with the specified KMS key.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Google Cloud Storage Batch Operations V1 Client - Class RewriteObject (0.1.2)\n\nVersion latestkeyboard_arrow_down\n\n- [0.1.2 (latest)](/php/docs/reference/cloud-storagebatchoperations/latest/V1.RewriteObject)\n- [0.1.1](/php/docs/reference/cloud-storagebatchoperations/0.1.1/V1.RewriteObject) \nReference documentation and code samples for the Google Cloud Storage Batch Operations V1 Client class RewriteObject.\n\nDescribes options for object rewrite.\n\nGenerated from protobuf message `google.cloud.storagebatchoperations.v1.RewriteObject`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ StorageBatchOperations \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getKmsKey\n\nRequired. Resource name of the Cloud KMS key that will be used to encrypt\nthe object. The Cloud KMS key must be located in same location as the\nobject. Refer to\n\u003chttps://cloud.google.com/storage/docs/encryption/using-customer-managed-keys#add-object-key\u003e\nfor additional documentation. Format:\nprojects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}\nFor example:\n\"projects/123456/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key\".\n\nThe object will be rewritten and set with the specified KMS key.\n\n### hasKmsKey\n\n### clearKmsKey\n\n### setKmsKey\n\nRequired. Resource name of the Cloud KMS key that will be used to encrypt\nthe object. The Cloud KMS key must be located in same location as the\nobject. Refer to\n\u003chttps://cloud.google.com/storage/docs/encryption/using-customer-managed-keys#add-object-key\u003e\nfor additional documentation. Format:\nprojects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}\nFor example:\n\"projects/123456/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key\".\n\nThe object will be rewritten and set with the specified KMS key."]]