google-cloud-storage 1.50.0 → 1.52.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e0893d52c3f3ee58e75361a0b79d172a04d37f1bc95295124a2e494b1a17a7a
4
- data.tar.gz: e1ba0496153f4317461324fdfc2bc15de917616abf5eb844659e1fbc55c6c084
3
+ metadata.gz: 94e0030c8442262a0d7670a5ccc0090efe44f6cdad9170cc7eb800a6acffad9c
4
+ data.tar.gz: 7e4360bab08faa20b814df568f73f708ec8cdd31bb5d90f5fb56292b34636ae3
5
5
  SHA512:
6
- metadata.gz: ad283cf07a70951aeb8f9e842d7dd20d2f3ef716f3bb4df8fbade6f1ab3f08cf052897176b10cf1c72d6925fae86ae688c214368da44b434ab3e76dd1a4420c8
7
- data.tar.gz: 3067805b0d16ded711bd4cc2913cbefa290466b1d25bec4b7adb93f7d81a3d64db93b70cf165b8c1089de12460d772c112b61fd3e988b58d79278ed92bf053f4
6
+ metadata.gz: f7180d3b2fa31de1ba73eb811439540c4d12a0cc417500566d1d7316d50c5249e66704fef719bc18417682a757a7a538722628fd4bcf3b31f43aca5d083f23e2
7
+ data.tar.gz: b2a8b010890f3cffcced823aa66806bed2e2b61f4a547848a8c520d0d6d140280522869af668518ca608fcc6a1904541fc626090b5f110bf89f5109fac8a3ba7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Release History
2
2
 
3
+ ### 1.52.0 (2024-05-31)
4
+
5
+ #### Features
6
+
7
+ * support for hierarchical namespace (folders) ([#25967](https://github.com/googleapis/google-cloud-ruby/issues/25967))
8
+
9
+ ### 1.51.0 (2024-04-25)
10
+
11
+ #### Features
12
+
13
+ * Respect custom endpoint for signed_url ([#25469](https://github.com/googleapis/google-cloud-ruby/issues/25469))
14
+
3
15
  ### 1.50.0 (2024-04-19)
4
16
 
5
17
  #### Features
@@ -1253,6 +1253,62 @@ module Google
1253
1253
  patch_gapi! :soft_delete_policy
1254
1254
  end
1255
1255
 
1256
+ ##
1257
+ # The bucket's hierarchical namespace (Folders) configuration.
1258
+ # This value can be modified by calling {#hierarchical_namespace=}.
1259
+ #
1260
+ # @return [Google::Apis::StorageV1::Bucket::HierarchicalNamespace]
1261
+ #
1262
+ # @example
1263
+ # require "google/cloud/storage"
1264
+ #
1265
+ # storage = Google::Cloud::Storage.new
1266
+ #
1267
+ # bucket = storage.bucket "my-bucket"
1268
+ #
1269
+ # bucket.hierarchical_namespace
1270
+ #
1271
+ def hierarchical_namespace
1272
+ @gapi.hierarchical_namespace
1273
+ end
1274
+
1275
+ ##
1276
+ # Sets the value of Hierarchical Namespace (Folders) for the bucket.
1277
+ # This can only be enabled at bucket create time. If this is enabled,
1278
+ # Uniform Bucket-Level Access must also be enabled.
1279
+ # This value can be queried by calling {#hierarchical_namespace}.
1280
+ #
1281
+ # @param [Google::Apis::StorageV1::Bucket::HierarchicalNamespace,
1282
+ # Hash(String => String)] new_hierarchical_namespace The
1283
+ # bucket's new Hierarchical Namespace Configuration.
1284
+ #
1285
+ # @example Enabled Hierarchical Namespace using HierarchicalNamespace class:
1286
+ # require "google/cloud/storage"
1287
+ #
1288
+ # storage = Google::Cloud::Storage.new
1289
+ #
1290
+ # bucket = storage.bucket "my-bucket"
1291
+ #
1292
+ # hierarchical_namespace = Google::Apis::StorageV1::Bucket::HierarchicalNamespace.new
1293
+ # hierarchical_namespace.enabled = true
1294
+ #
1295
+ # bucket.hierarchical_namespace = hierarchical_namespace
1296
+ #
1297
+ # @example Disable Hierarchical Namespace using Hash:
1298
+ # require "google/cloud/storage"
1299
+ #
1300
+ # storage = Google::Cloud::Storage.new
1301
+ #
1302
+ # bucket = storage.bucket "my-bucket"
1303
+ #
1304
+ # hierarchical_namespace = { enabled: false }
1305
+ # bucket.hierarchical_namespace = hierarchical_namespace
1306
+ #
1307
+ def hierarchical_namespace= new_hierarchical_namespace
1308
+ @gapi.hierarchical_namespace = new_hierarchical_namespace || {}
1309
+ patch_gapi! :hierarchical_namespace
1310
+ end
1311
+
1256
1312
  ##
1257
1313
  # Updates the bucket with changes made in the given block in a single
1258
1314
  # PATCH request. The following attributes may be set: {#cors},
@@ -60,7 +60,8 @@ module Google
60
60
  ##
61
61
  # The external url to the file.
62
62
  def ext_url
63
- "#{GOOGLEAPIS_URL}#{ext_path}"
63
+ root_url = @service.service.root_url.chomp "/"
64
+ "#{root_url}#{ext_path}"
64
65
  end
65
66
 
66
67
  def apply_option_defaults options
@@ -301,7 +301,7 @@ module Google
301
301
  ##
302
302
  # The external url to the file.
303
303
  def ext_url scheme, virtual_hosted_style, bucket_bound_hostname
304
- url = GOOGLEAPIS_URL.dup
304
+ url = @service.service.root_url.chomp "/"
305
305
  if virtual_hosted_style
306
306
  parts = url.split "//"
307
307
  parts[1] = "#{@bucket_name}.#{parts[1]}"
@@ -421,6 +421,7 @@ module Google
421
421
  # b.lifecycle.add_set_storage_class_rule "COLDLINE", age: 10
422
422
  # end
423
423
  #
424
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
424
425
  def create_bucket bucket_name,
425
426
  acl: nil,
426
427
  default_acl: nil,
@@ -435,11 +436,13 @@ module Google
435
436
  requester_pays: nil,
436
437
  user_project: nil,
437
438
  autoclass_enabled: false,
438
- enable_object_retention: nil
439
+ enable_object_retention: nil,
440
+ hierarchical_namespace: nil
439
441
  params = {
440
442
  name: bucket_name,
441
443
  location: location,
442
- custom_placement_config: custom_placement_config
444
+ custom_placement_config: custom_placement_config,
445
+ hierarchical_namespace: hierarchical_namespace
443
446
  }.delete_if { |_, v| v.nil? }
444
447
  new_bucket = Google::Apis::StorageV1::Bucket.new(**params)
445
448
  storage_class = storage_class_for storage_class
@@ -452,6 +455,7 @@ module Google
452
455
  b.website_404 = website_404 unless website_404.nil?
453
456
  b.versioning = versioning unless versioning.nil?
454
457
  b.requester_pays = requester_pays unless requester_pays.nil?
458
+ b.hierarchical_namespace = hierarchical_namespace unless hierarchical_namespace.nil?
455
459
  end
456
460
  yield updater if block_given?
457
461
  updater.check_for_changed_labels!
@@ -463,6 +467,7 @@ module Google
463
467
  enable_object_retention: enable_object_retention
464
468
  Bucket.from_gapi gapi, service, user_project: user_project
465
469
  end
470
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
466
471
 
467
472
  ##
468
473
  # Creates a new HMAC key.
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Storage
19
- VERSION = "1.50.0".freeze
19
+ VERSION = "1.52.0".freeze
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-storage
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.50.0
4
+ version: 1.52.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-04-19 00:00:00.000000000 Z
12
+ date: 2024-05-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-cloud-core
@@ -59,14 +59,14 @@ dependencies:
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: '0.37'
62
+ version: '0.38'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '0.37'
69
+ version: '0.38'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: googleauth
72
72
  requirement: !ruby/object:Gem::Requirement