Class: Google::Apis::StoragebatchoperationsV1::RewriteObject

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/storagebatchoperations_v1/classes.rb,
lib/google/apis/storagebatchoperations_v1/representations.rb,
lib/google/apis/storagebatchoperations_v1/representations.rb

Overview

Describes options for object rewrite.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ RewriteObject

Returns a new instance of RewriteObject.



1334
1335
1336
# File 'lib/google/apis/storagebatchoperations_v1/classes.rb', line 1334

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#kms_keyString

Optional. Resource name of the Cloud KMS key that is used to encrypt the object. The Cloud KMS key must be located in same location as the object. For details, see https://cloud.google.com/storage/docs/encryption/using-customer- managed-keys#add-object-key Format: projects/project_id/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. Corresponds to the JSON propertykmsKey`

Returns:

  • (String)


1324
1325
1326
# File 'lib/google/apis/storagebatchoperations_v1/classes.rb', line 1324

def kms_key
  @kms_key
end

#storage_classString

Optional. Rewrites the object to the specified storage class. Setting this field will perform a full byte copy of the object if the storage class is different from the object's current storage class. If Autoclass is enabled on the bucket, storage class changes are ignored by Cloud Storage. Corresponds to the JSON property storageClass

Returns:

  • (String)


1332
1333
1334
# File 'lib/google/apis/storagebatchoperations_v1/classes.rb', line 1332

def storage_class
  @storage_class
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1339
1340
1341
1342
# File 'lib/google/apis/storagebatchoperations_v1/classes.rb', line 1339

def update!(**args)
  @kms_key = args[:kms_key] if args.key?(:kms_key)
  @storage_class = args[:storage_class] if args.key?(:storage_class)
end