Class: Google::Cloud::Storage::Bucket::Updater
- Inherits:
-
Google::Cloud::Storage::Bucket
- Object
- Google::Cloud::Storage::Bucket
- Google::Cloud::Storage::Bucket::Updater
- Defined in:
- lib/google/cloud/storage/bucket.rb
Overview
Yielded to a block to accumulate changes for a patch request.
Instance Attribute Summary collapse
-
#updates ⇒ Object
readonly
Returns the value of attribute updates.
Attributes inherited from Google::Cloud::Storage::Bucket
Instance Method Summary collapse
- #cors {|@cors_builder| ... } ⇒ Object
-
#initialize(gapi) ⇒ Updater
constructor
Create an Updater object.
-
#labels ⇒ Hash(String => String)
A hash of user-provided labels.
-
#labels=(labels) ⇒ Object
Updates the hash of user-provided labels.
- #lifecycle {|@lifecycle_builder| ... } ⇒ Object
Methods inherited from Google::Cloud::Storage::Bucket
#acl, #api_url, #autoclass, #autoclass_enabled, #autoclass_enabled=, #autoclass_terminal_storage_class, #autoclass_terminal_storage_class_update_time, #autoclass_toggle_time, #compose, #create_file, #create_notification, #created_at, #data_locations, #default_acl, #default_event_based_hold=, #default_event_based_hold?, #default_kms_key, #default_kms_key=, #delete, #exists?, #file, #files, #generate_signed_post_policy_v4, #id, #kind, #location, #location_type, #lock_retention_policy!, #logging_bucket, #logging_bucket=, #logging_prefix, #logging_prefix=, #metageneration, #name, #notification, #notifications, #policy, #policy_only=, #policy_only?, #policy_only_locked_at, #post_object, #public_access_prevention, #public_access_prevention=, #public_access_prevention_enforced?, #public_access_prevention_inherited?, #reload!, #requester_pays, #requester_pays=, #retention_effective_at, #retention_period, #retention_period=, #retention_policy_locked?, #rpo, #rpo=, #signed_url, #storage_class, #storage_class=, #test_permissions, #uniform_bucket_level_access=, #uniform_bucket_level_access?, #uniform_bucket_level_access_locked_at, #update, #update_autoclass, #update_policy, #versioning=, #versioning?, #website_404, #website_404=, #website_main, #website_main=
Constructor Details
#initialize(gapi) ⇒ Updater
Create an Updater object.
3041 3042 3043 3044 3045 3046 3047 3048 |
# File 'lib/google/cloud/storage/bucket.rb', line 3041 def initialize gapi super() @updates = [] @gapi = gapi @labels = @gapi.labels.to_h.dup @cors_builder = nil @lifecycle_builder = nil end |
Instance Attribute Details
#updates ⇒ Object (readonly)
Returns the value of attribute updates.
3037 3038 3039 |
# File 'lib/google/cloud/storage/bucket.rb', line 3037 def updates @updates end |
Instance Method Details
#cors {|@cors_builder| ... } ⇒ Object
3078 3079 3080 3081 3082 3083 |
# File 'lib/google/cloud/storage/bucket.rb', line 3078 def cors # Same as Bucket#cors, but not frozen @cors_builder ||= Bucket::Cors.from_gapi @gapi.cors_configurations yield @cors_builder if block_given? @cors_builder end |
#labels ⇒ Hash(String => String)
A hash of user-provided labels. Changes are allowed.
3055 3056 3057 |
# File 'lib/google/cloud/storage/bucket.rb', line 3055 def labels @labels end |
#labels=(labels) ⇒ Object
Updates the hash of user-provided labels.
3064 3065 3066 3067 3068 |
# File 'lib/google/cloud/storage/bucket.rb', line 3064 def labels= labels @labels = labels @gapi.labels = @labels patch_gapi! :labels end |
#lifecycle {|@lifecycle_builder| ... } ⇒ Object
3094 3095 3096 3097 3098 3099 |
# File 'lib/google/cloud/storage/bucket.rb', line 3094 def lifecycle # Same as Bucket#lifecycle, but not frozen @lifecycle_builder ||= Bucket::Lifecycle.from_gapi @gapi.lifecycle yield @lifecycle_builder if block_given? @lifecycle_builder end |