google-cloud-storage 1.47.0 → 1.49.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 +4 -4
- data/CHANGELOG.md +18 -0
- data/lib/google/cloud/storage/bucket.rb +8 -3
- data/lib/google/cloud/storage/file/list.rb +3 -2
- data/lib/google/cloud/storage/project.rb +9 -0
- data/lib/google/cloud/storage/service.rb +15 -2
- data/lib/google/cloud/storage/version.rb +1 -1
- data/lib/google/cloud/storage.rb +11 -4
- data/lib/google-cloud-storage.rb +2 -2
- metadata +24 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8a2a526a042472efc68bca61aecd13daab3329949890543c73e499d19b1bf91
|
4
|
+
data.tar.gz: 152a633c29980d1c645e8d0c96100f60d245ea1d1844407bb12c8a689b231892
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8086edce323f96ad7826ab121e5b3fc12d94a4695838259e5c7f90f0607414c6f6516c63318888c2d8022a4b0440692d06d57e016081a35f06c27c6591a1269a
|
7
|
+
data.tar.gz: 286c58007dc3ef084ed5947e01a38aefa09aa01b7eb121f2a99eab34aef8d1577cd3c8c738d7b58d6ef51f5c1817a1618380b35c961bdb5ff5ac159c8d0f941e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
+
### 1.49.0 (2024-02-21)
|
4
|
+
|
5
|
+
#### Features
|
6
|
+
|
7
|
+
* Support of Managed Folders ([#24809](https://github.com/googleapis/google-cloud-ruby/issues/24809))
|
8
|
+
|
9
|
+
### 1.48.1 (2024-01-26)
|
10
|
+
|
11
|
+
#### Bug Fixes
|
12
|
+
|
13
|
+
* Raise an error on mismatching universe domain ([#24486](https://github.com/googleapis/google-cloud-ruby/issues/24486))
|
14
|
+
|
15
|
+
### 1.48.0 (2024-01-25)
|
16
|
+
|
17
|
+
#### Features
|
18
|
+
|
19
|
+
* Support for universe_domain ([#24449](https://github.com/googleapis/google-cloud-ruby/issues/24449))
|
20
|
+
|
3
21
|
### 1.47.0 (2024-01-09)
|
4
22
|
|
5
23
|
#### Features
|
@@ -1319,6 +1319,9 @@ module Google
|
|
1319
1319
|
# as distinct results. The default is `false`. For more information,
|
1320
1320
|
# see [Object Versioning
|
1321
1321
|
# ](https://cloud.google.com/storage/docs/object-versioning).
|
1322
|
+
# @param [Boolean] include_folders_as_prefixes If `true`, will also include
|
1323
|
+
# folders and managed folders, besides objects, in the returned prefixes.
|
1324
|
+
# Only applicable if delimiter is set to '/'.
|
1322
1325
|
#
|
1323
1326
|
# @return [Array<Google::Cloud::Storage::File>] (See
|
1324
1327
|
# {Google::Cloud::Storage::File::List})
|
@@ -1346,17 +1349,19 @@ module Google
|
|
1346
1349
|
# end
|
1347
1350
|
#
|
1348
1351
|
def files prefix: nil, delimiter: nil, token: nil, max: nil,
|
1349
|
-
versions: nil, match_glob: nil
|
1352
|
+
versions: nil, match_glob: nil, include_folders_as_prefixes: nil
|
1350
1353
|
ensure_service!
|
1351
1354
|
gapi = service.list_files name, prefix: prefix, delimiter: delimiter,
|
1352
1355
|
token: token, max: max,
|
1353
1356
|
versions: versions,
|
1354
1357
|
user_project: user_project,
|
1355
|
-
match_glob: match_glob
|
1358
|
+
match_glob: match_glob,
|
1359
|
+
include_folders_as_prefixes: include_folders_as_prefixes
|
1356
1360
|
File::List.from_gapi gapi, service, name, prefix, delimiter, max,
|
1357
1361
|
versions,
|
1358
1362
|
user_project: user_project,
|
1359
|
-
match_glob: match_glob
|
1363
|
+
match_glob: match_glob,
|
1364
|
+
include_folders_as_prefixes: include_folders_as_prefixes
|
1360
1365
|
end
|
1361
1366
|
alias find_files files
|
1362
1367
|
|
@@ -165,8 +165,8 @@ module Google
|
|
165
165
|
# Google::Apis::StorageV1::Objects object.
|
166
166
|
def self.from_gapi gapi_list, service, bucket = nil, prefix = nil,
|
167
167
|
delimiter = nil, max = nil, versions = nil,
|
168
|
-
user_project: nil,
|
169
|
-
|
168
|
+
user_project: nil, match_glob: nil,
|
169
|
+
include_folders_as_prefixes: nil
|
170
170
|
files = new(Array(gapi_list.items).map do |gapi_object|
|
171
171
|
File.from_gapi gapi_object, service, user_project: user_project
|
172
172
|
end)
|
@@ -180,6 +180,7 @@ module Google
|
|
180
180
|
files.instance_variable_set :@versions, versions
|
181
181
|
files.instance_variable_set :@user_project, user_project
|
182
182
|
files.instance_variable_set :@match_glob, match_glob
|
183
|
+
files.instance_variable_set :@include_folders_as_prefixes, include_folders_as_prefixes
|
183
184
|
files
|
184
185
|
end
|
185
186
|
|
@@ -62,6 +62,15 @@ module Google
|
|
62
62
|
@service = service
|
63
63
|
end
|
64
64
|
|
65
|
+
##
|
66
|
+
# The universe domain the client is connected to
|
67
|
+
#
|
68
|
+
# @return [String]
|
69
|
+
#
|
70
|
+
def universe_domain
|
71
|
+
service.universe_domain
|
72
|
+
end
|
73
|
+
|
65
74
|
##
|
66
75
|
# The Storage project connected to.
|
67
76
|
#
|
@@ -36,6 +36,11 @@ module Google
|
|
36
36
|
# @private
|
37
37
|
attr_accessor :credentials
|
38
38
|
|
39
|
+
# @private
|
40
|
+
def universe_domain
|
41
|
+
service.universe_domain
|
42
|
+
end
|
43
|
+
|
39
44
|
##
|
40
45
|
# Creates a new Service instance.
|
41
46
|
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
@@ -43,7 +48,7 @@ module Google
|
|
43
48
|
timeout: nil, open_timeout: nil, read_timeout: nil,
|
44
49
|
send_timeout: nil, host: nil, quota_project: nil,
|
45
50
|
max_elapsed_time: nil, base_interval: nil, max_interval: nil,
|
46
|
-
multiplier: nil, upload_chunk_size: nil
|
51
|
+
multiplier: nil, upload_chunk_size: nil, universe_domain: nil
|
47
52
|
@project = project
|
48
53
|
@credentials = credentials
|
49
54
|
@service = API::StorageService.new
|
@@ -68,6 +73,13 @@ module Google
|
|
68
73
|
@service.request_options.upload_chunk_size = upload_chunk_size if upload_chunk_size
|
69
74
|
@service.authorization = @credentials.client if @credentials
|
70
75
|
@service.root_url = host if host
|
76
|
+
@service.universe_domain = universe_domain
|
77
|
+
begin
|
78
|
+
@service.verify_universe_domain!
|
79
|
+
rescue Google::Apis::UniverseDomainError => e
|
80
|
+
# TODO: Create a Google::Cloud::Error subclass for this.
|
81
|
+
raise Google::Cloud::Error, e.message
|
82
|
+
end
|
71
83
|
end
|
72
84
|
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
73
85
|
|
@@ -351,7 +363,7 @@ module Google
|
|
351
363
|
# Retrieves a list of files matching the criteria.
|
352
364
|
def list_files bucket_name, delimiter: nil, max: nil, token: nil,
|
353
365
|
prefix: nil, versions: nil, user_project: nil,
|
354
|
-
match_glob: nil,
|
366
|
+
match_glob: nil, include_folders_as_prefixes: nil,
|
355
367
|
options: {}
|
356
368
|
execute do
|
357
369
|
service.list_objects \
|
@@ -360,6 +372,7 @@ module Google
|
|
360
372
|
versions: versions,
|
361
373
|
user_project: user_project(user_project),
|
362
374
|
match_glob: match_glob,
|
375
|
+
include_folders_as_prefixes: include_folders_as_prefixes,
|
363
376
|
options: options
|
364
377
|
end
|
365
378
|
end
|
data/lib/google/cloud/storage.rb
CHANGED
@@ -67,6 +67,8 @@ module Google
|
|
67
67
|
# @param [Integer] send_timeout How long, in seconds, before receiving response from server times out. Optional.
|
68
68
|
# @param [String] endpoint Override of the endpoint host name. Optional.
|
69
69
|
# If the param is nil, uses the default endpoint.
|
70
|
+
# @param universe_domain [String] Override of the universe domain. Optional.
|
71
|
+
# If unset or nil, uses the default unvierse domain
|
70
72
|
# @param [Integer] upload_chunk_size The chunk size of storage upload, in bytes.
|
71
73
|
# The default value is 100 MB, i.e. 104_857_600 bytes. To disable chunking and upload
|
72
74
|
# the complete file regardless of size, pass 0 as the chunk size.
|
@@ -92,7 +94,7 @@ module Google
|
|
92
94
|
timeout: nil, open_timeout: nil, read_timeout: nil,
|
93
95
|
send_timeout: nil, endpoint: nil, project: nil, keyfile: nil,
|
94
96
|
max_elapsed_time: nil, base_interval: nil, max_interval: nil,
|
95
|
-
multiplier: nil, upload_chunk_size: nil
|
97
|
+
multiplier: nil, upload_chunk_size: nil, universe_domain: nil
|
96
98
|
scope ||= configure.scope
|
97
99
|
retries ||= configure.retries
|
98
100
|
timeout ||= configure.timeout
|
@@ -106,6 +108,7 @@ module Google
|
|
106
108
|
max_interval ||= configure.max_interval
|
107
109
|
multiplier ||= configure.multiplier
|
108
110
|
upload_chunk_size ||= configure.upload_chunk_size
|
111
|
+
universe_domain ||= configure.universe_domain
|
109
112
|
|
110
113
|
unless credentials.is_a? Google::Auth::Credentials
|
111
114
|
credentials = Storage::Credentials.new credentials, scope: scope
|
@@ -121,7 +124,8 @@ module Google
|
|
121
124
|
read_timeout: read_timeout, send_timeout: send_timeout,
|
122
125
|
host: endpoint, quota_project: configure.quota_project,
|
123
126
|
max_elapsed_time: max_elapsed_time, base_interval: base_interval,
|
124
|
-
max_interval: max_interval, multiplier: multiplier, upload_chunk_size: upload_chunk_size
|
127
|
+
max_interval: max_interval, multiplier: multiplier, upload_chunk_size: upload_chunk_size,
|
128
|
+
universe_domain: universe_domain
|
125
129
|
)
|
126
130
|
)
|
127
131
|
end
|
@@ -145,6 +149,8 @@ module Google
|
|
145
149
|
# @param [Integer] send_timeout How long, in seconds, before receiving response from server times out. Optional.
|
146
150
|
# @param [String] endpoint Override of the endpoint host name. Optional.
|
147
151
|
# If the param is nil, uses the default endpoint.
|
152
|
+
# @param universe_domain [String] Override of the universe domain. Optional.
|
153
|
+
# If unset or nil, uses the default unvierse domain
|
148
154
|
# @param [Integer] upload_chunk_size The chunk size of storage upload, in bytes.
|
149
155
|
# The default value is 100 MB, i.e. 104_857_600 bytes. To disable chunking and upload
|
150
156
|
# the complete file regardless of size, pass 0 as the chunk size.
|
@@ -166,7 +172,7 @@ module Google
|
|
166
172
|
def self.anonymous retries: nil, timeout: nil, open_timeout: nil,
|
167
173
|
read_timeout: nil, send_timeout: nil, endpoint: nil,
|
168
174
|
max_elapsed_time: nil, base_interval: nil, max_interval: nil,
|
169
|
-
multiplier: nil, upload_chunk_size: nil
|
175
|
+
multiplier: nil, upload_chunk_size: nil, universe_domain: nil
|
170
176
|
open_timeout ||= timeout
|
171
177
|
read_timeout ||= timeout
|
172
178
|
send_timeout ||= timeout
|
@@ -175,7 +181,8 @@ module Google
|
|
175
181
|
nil, nil, retries: retries, timeout: timeout, open_timeout: open_timeout,
|
176
182
|
read_timeout: read_timeout, send_timeout: send_timeout, host: endpoint,
|
177
183
|
max_elapsed_time: max_elapsed_time, base_interval: base_interval,
|
178
|
-
max_interval: max_interval, multiplier: multiplier, upload_chunk_size: upload_chunk_size
|
184
|
+
max_interval: max_interval, multiplier: multiplier, upload_chunk_size: upload_chunk_size,
|
185
|
+
universe_domain: universe_domain
|
179
186
|
)
|
180
187
|
)
|
181
188
|
end
|
data/lib/google-cloud-storage.rb
CHANGED
@@ -192,7 +192,7 @@ Google::Cloud.configure.add_config! :storage do |config|
|
|
192
192
|
config.add_field! :read_timeout, nil, match: Integer
|
193
193
|
config.add_field! :send_timeout, nil, match: Integer
|
194
194
|
config.add_field! :upload_chunk_size, nil, match: Integer
|
195
|
-
|
196
|
-
config.add_field! :
|
195
|
+
config.add_field! :endpoint, nil, match: String, allow_nil: true
|
196
|
+
config.add_field! :universe_domain, nil, match: String, allow_nil: true
|
197
197
|
end
|
198
198
|
# rubocop:enable Metrics/BlockLength
|
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.
|
4
|
+
version: 1.49.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-
|
12
|
+
date: 2024-02-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-cloud-core
|
@@ -25,54 +25,62 @@ dependencies:
|
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '1.6'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: google-apis-core
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0.13'
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0.13'
|
28
42
|
- !ruby/object:Gem::Dependency
|
29
43
|
name: google-apis-iamcredentials_v1
|
30
44
|
requirement: !ruby/object:Gem::Requirement
|
31
45
|
requirements:
|
32
46
|
- - "~>"
|
33
47
|
- !ruby/object:Gem::Version
|
34
|
-
version: '0.
|
48
|
+
version: '0.18'
|
35
49
|
type: :runtime
|
36
50
|
prerelease: false
|
37
51
|
version_requirements: !ruby/object:Gem::Requirement
|
38
52
|
requirements:
|
39
53
|
- - "~>"
|
40
54
|
- !ruby/object:Gem::Version
|
41
|
-
version: '0.
|
55
|
+
version: '0.18'
|
42
56
|
- !ruby/object:Gem::Dependency
|
43
57
|
name: google-apis-storage_v1
|
44
58
|
requirement: !ruby/object:Gem::Requirement
|
45
59
|
requirements:
|
46
60
|
- - "~>"
|
47
61
|
- !ruby/object:Gem::Version
|
48
|
-
version: 0.
|
62
|
+
version: '0.33'
|
49
63
|
type: :runtime
|
50
64
|
prerelease: false
|
51
65
|
version_requirements: !ruby/object:Gem::Requirement
|
52
66
|
requirements:
|
53
67
|
- - "~>"
|
54
68
|
- !ruby/object:Gem::Version
|
55
|
-
version: 0.
|
69
|
+
version: '0.33'
|
56
70
|
- !ruby/object:Gem::Dependency
|
57
71
|
name: googleauth
|
58
72
|
requirement: !ruby/object:Gem::Requirement
|
59
73
|
requirements:
|
60
|
-
- - "
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: 0.16.2
|
63
|
-
- - "<"
|
74
|
+
- - "~>"
|
64
75
|
- !ruby/object:Gem::Version
|
65
|
-
version:
|
76
|
+
version: '1.9'
|
66
77
|
type: :runtime
|
67
78
|
prerelease: false
|
68
79
|
version_requirements: !ruby/object:Gem::Requirement
|
69
80
|
requirements:
|
70
|
-
- - "
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version: 0.16.2
|
73
|
-
- - "<"
|
81
|
+
- - "~>"
|
74
82
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
83
|
+
version: '1.9'
|
76
84
|
- !ruby/object:Gem::Dependency
|
77
85
|
name: digest-crc
|
78
86
|
requirement: !ruby/object:Gem::Requirement
|