google-cloud-storage 1.57.1 → 1.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86a7f1131dc71cb9b5db56afce6c3b9e25a9a21544500367cdcd39ac8eb8ef46
4
- data.tar.gz: 070b6c33b09fb8af9eb8a59f5d074b3b5929fd6d61233f1cf738ac4b6c0809a2
3
+ metadata.gz: d5702660db1aed635fecb508a9f704e9f42fab5aa79db322097e775fbe0c60eb
4
+ data.tar.gz: e4ce8ea28ef05a416e3f1f751365f7fef62b2599be2d5b22dcd91d5a735b0cd4
5
5
  SHA512:
6
- metadata.gz: 9c6370f20e62e933a41fbab067870c29c4e28bde041c97e53edb7a9e0280d1a029bf8d6ce238877cf14114b202535e7c9d0407192dbbfb4af8d071d9a3c3f575
7
- data.tar.gz: 7da8c7b4afed6c3b0504c33c14bac1ce04a43e3740119af18c7c30c4eca540287da4e59798f6358f4e15098ab1476c09dcd9377c988ed063f47ff5846689eb84
6
+ metadata.gz: e981b3eddd57eb932728eeb6f3e19d4442e4d88f190aba854e764d95b901e4756b164142b835088407e3993c7f989ccfd24aac17432f02aff87fe8c3b4ccf921
7
+ data.tar.gz: dbe8ece884a8bbb25416806c236098e279eadd3b8d3e223a3134de71f76f40fc307a1a54dcedcf45512ae1e0e925eec3adc90ba3831b5a436fd7a531e55c190d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 1.58.0 (2026-01-08)
4
+
5
+ #### Features
6
+
7
+ * Adding support for partial success bucket list ([#32173](https://github.com/googleapis/google-cloud-ruby/issues/32173))
8
+
3
9
  ### 1.57.1 (2025-11-04)
4
10
 
5
11
  #### Documentation
@@ -27,6 +27,14 @@ module Google
27
27
  # that match the request and this value should be passed to
28
28
  # the next {Google::Cloud::Storage::Project#buckets} to continue.
29
29
  attr_accessor :token
30
+ ##
31
+ # Provides a list of bucket names that are unreachable.
32
+ #
33
+ # This is only populated when `return_partial_success` is set to `true`
34
+ # in the call to {Google::Cloud::Storage::Project#buckets}.
35
+ #
36
+ # @return [Array<String>]
37
+ attr_reader :unreachable
30
38
 
31
39
  ##
32
40
  # @private Create a new Bucket::List with an array of values.
@@ -147,7 +155,7 @@ module Google
147
155
  # @private New Bucket::List from a Google API Client
148
156
  # Google::Apis::StorageV1::Buckets object.
149
157
  def self.from_gapi gapi_list, service, prefix = nil, max = nil,
150
- user_project: nil, soft_deleted: nil
158
+ user_project: nil, soft_deleted: nil, return_partial_success: nil
151
159
  buckets = new(Array(gapi_list.items).map do |gapi_object|
152
160
  Bucket.from_gapi gapi_object, service, user_project: user_project
153
161
  end)
@@ -157,6 +165,7 @@ module Google
157
165
  buckets.instance_variable_set :@max, max
158
166
  buckets.instance_variable_set :@user_project, user_project
159
167
  buckets.instance_variable_set :@soft_deleted, soft_deleted
168
+ buckets.instance_variable_set :@unreachable, Array(gapi_list.unreachable) if return_partial_success
160
169
  buckets
161
170
  end
162
171
 
@@ -158,6 +158,9 @@ module Google
158
158
  # bucket instances and their files.
159
159
  #
160
160
  # See also {Bucket#requester_pays=} and {Bucket#requester_pays}.
161
+ # @param [Boolean] return_partial_success
162
+ # If true, the response will contain a list of unreachable buckets.
163
+ # If false, ListBuckets will throw an error if there are any unreachable buckets.
161
164
  #
162
165
  # @return [Array<Google::Cloud::Storage::Bucket>] (See
163
166
  # {Google::Cloud::Storage::Bucket::List})
@@ -201,11 +204,22 @@ module Google
201
204
  # soft_deleted_buckets.each do |bucket|
202
205
  # puts bucket.name
203
206
  # end
204
- def buckets prefix: nil, token: nil, max: nil, user_project: nil, soft_deleted: nil
207
+ # @example Retrieve list of unreachable buckets
208
+ # require "google/cloud/storage"
209
+ #
210
+ # storage = Google::Cloud::Storage.new
211
+ #
212
+ # buckets = storage.buckets return_partial_success: true
213
+ # buckets.unreachable.each do |unreachable_bucket_name|
214
+ # puts unreachable_bucket_name
215
+ # end
216
+ #
217
+ def buckets prefix: nil, token: nil, max: nil, user_project: nil, soft_deleted: nil, return_partial_success: nil
205
218
  gapi = service.list_buckets \
206
- prefix: prefix, token: token, max: max, user_project: user_project, soft_deleted: soft_deleted
219
+ prefix: prefix, token: token, max: max, user_project: user_project, soft_deleted: soft_deleted, return_partial_success: return_partial_success
207
220
  Bucket::List.from_gapi \
208
- gapi, service, prefix, max, user_project: user_project, soft_deleted: soft_deleted
221
+ gapi, service, prefix, max, user_project: user_project, soft_deleted: soft_deleted, return_partial_success: return_partial_success
222
+
209
223
  end
210
224
  alias find_buckets buckets
211
225
 
@@ -96,12 +96,14 @@ module Google
96
96
 
97
97
  ##
98
98
  # Retrieves a list of buckets for the given project.
99
- def list_buckets prefix: nil, token: nil, max: nil, user_project: nil, soft_deleted: nil, options: {}
99
+ def list_buckets prefix: nil, token: nil, max: nil, user_project: nil, soft_deleted: nil, return_partial_success: nil, options: {}
100
100
  execute do
101
101
  service.list_buckets \
102
102
  @project, prefix: prefix, page_token: token, max_results: max,
103
103
  user_project: user_project(user_project),
104
- soft_deleted: soft_deleted, options: options
104
+ soft_deleted: soft_deleted,
105
+ return_partial_success: return_partial_success,
106
+ options: options
105
107
  end
106
108
  end
107
109
 
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Storage
19
- VERSION = "1.57.1".freeze
19
+ VERSION = "1.58.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.57.1
4
+ version: 1.58.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore