google-apis-core 0.9.0 → 0.15.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: 39e8c0ee69956045fad35dd99b60187bee9a559e66c31141784f69c938b828da
4
- data.tar.gz: 2bc2f65430050943360436b018b2149f876bdb190d8d637e42d1ac5c908aee41
3
+ metadata.gz: ce67af03cec391ae12f32828eb7c0df504eb7d04e0b92694aac6adf98d4f31d8
4
+ data.tar.gz: fd5227cea10440d966385242ab7330f4e686c4c0bb74f6d98a99e815286b04f4
5
5
  SHA512:
6
- metadata.gz: 26a81d876d54cd42e9e84a4c057297ccd77a1cfebe481de646504f8e30d08496b72141581532dfeae03d3dcb9ff955330b7e94c81bc9bb555130e501fc2879f2
7
- data.tar.gz: 2c1242fd64e8e66e82b04aa2a4f4c0fb0979e7a0a53f8162836a90a58242f1d46d4b8660101a15c9e82b6b6e48819cdffe5053f90894a9cf1dd5040de2c21db0
6
+ metadata.gz: 647712dad491d16745a70a63e2dc808c43f98f63853a58ef8d46b7f620f73f0b3116668f43a79b1f4819bab988e83c64e33952b877b396bf8c600fbe88a6983a
7
+ data.tar.gz: 670c0199907867b49f6db7bd8b25a7d6cc2760cab4d57038314adf13e51119513a3968e78394e15ad9f09ed69fbfa3a5fb2633a44f802eac9da4e842f2a37065
data/CHANGELOG.md CHANGED
@@ -1,5 +1,100 @@
1
1
  # Release History
2
2
 
3
+ ### 0.15.0 (2024-05-13)
4
+
5
+ #### Features
6
+
7
+ * Introduce api_version to discovery clients ([#18969](https://github.com/googleapis/google-api-ruby-client/issues/18969))
8
+
9
+ ### 0.14.1 (2024-03-13)
10
+
11
+ #### Bug Fixes
12
+
13
+ * fixes uninitialized Pathname issue ([#18480](https://github.com/googleapis/google-api-ruby-client/issues/18480))
14
+
15
+ ### 0.14.0 (2024-02-23)
16
+
17
+ #### Features
18
+
19
+ * Update minimum Ruby version to 2.7 ([#17896](https://github.com/googleapis/google-api-ruby-client/issues/17896))
20
+ #### Bug Fixes
21
+
22
+ * allow BaseService#root_url to be an Addressable::URI ([#17895](https://github.com/googleapis/google-api-ruby-client/issues/17895))
23
+
24
+ ### 0.13.0 (2024-01-26)
25
+
26
+ #### Features
27
+
28
+ * Verify credential universe domain against configured universe domain ([#17569](https://github.com/googleapis/google-api-ruby-client/issues/17569))
29
+
30
+ ### 0.12.0 (2024-01-22)
31
+
32
+ #### Features
33
+
34
+ * Support for universe_domain ([#17131](https://github.com/googleapis/google-api-ruby-client/issues/17131))
35
+
36
+ ### 0.11.3 (2024-01-17)
37
+
38
+ #### Bug Fixes
39
+
40
+ * download with destination as pathname ([#17120](https://github.com/googleapis/google-api-ruby-client/issues/17120))
41
+
42
+ ### 0.11.2 (2023-10-27)
43
+
44
+ #### Bug Fixes
45
+
46
+ * update ssl_config to point to system default root CA path ([#16446](https://github.com/googleapis/google-api-ruby-client/issues/16446))
47
+
48
+ ### 0.11.1 (2023-07-20)
49
+
50
+ #### Documentation
51
+
52
+ * Document send_timeout_sec and fix up some types ([#14907](https://github.com/googleapis/google-api-ruby-client/issues/14907))
53
+
54
+ ### 0.11.0 (2023-02-08)
55
+
56
+ #### Features
57
+
58
+ * Optimize memory usage when upload chunk size is set to 0
59
+
60
+ ### 0.10.0 (2023-01-26)
61
+
62
+ #### Features
63
+
64
+ * Allow chunk size zero for storage resumable upload ([#13283](https://github.com/googleapis/google-api-ruby-client/issues/13283))
65
+ * Make chunk size configurable ([#13216](https://github.com/googleapis/google-api-ruby-client/issues/13216))
66
+
67
+ ### 0.9.5 (2023-01-12)
68
+
69
+ #### Bug Fixes
70
+
71
+ * Improve upload performance for Cloud Storage ([#13213](https://github.com/googleapis/google-api-ruby-client/issues/13213))
72
+
73
+ ### 0.9.4 (2023-01-07)
74
+
75
+ #### Bug Fixes
76
+
77
+ * Recursively redact unsafe payloads from logs ([#13189](https://github.com/googleapis/google-api-ruby-client/issues/13189))
78
+
79
+ ### 0.9.3 (2023-01-04)
80
+
81
+ #### Bug Fixes
82
+
83
+ * Removed some dead code ([#13099](https://github.com/googleapis/google-api-ruby-client/issues/13099))
84
+ * Replace `File.exists?` with `File.exist?` for compatibility with Ruby 3.2 ([#13161](https://github.com/googleapis/google-api-ruby-client/issues/13161))
85
+
86
+ ### 0.9.2 (2022-12-13)
87
+
88
+ #### Bug Fixes
89
+
90
+ * Update UNSAFE_CLASS_NAMES ([#13030](https://github.com/googleapis/google-api-ruby-client/issues/13030))
91
+
92
+ ### 0.9.1 (2022-10-18)
93
+
94
+ #### Bug Fixes
95
+
96
+ * Storage upload to handle empty string/file cases ([#12306](https://github.com/googleapis/google-api-ruby-client/issues/12306))
97
+
3
98
  ### 0.9.0 (2022-09-18)
4
99
 
5
100
  #### Features
@@ -61,7 +61,7 @@ module Google
61
61
  end
62
62
  while filename == nil
63
63
  search_path ||= File.expand_path('.')
64
- if File.exists?(File.join(search_path, 'client_secrets.json'))
64
+ if File.exist?(File.join(search_path, 'client_secrets.json'))
65
65
  filename = File.join(search_path, 'client_secrets.json')
66
66
  elsif search_path == File.expand_path('..', search_path)
67
67
  raise ArgumentError,
@@ -93,11 +93,49 @@ module Google
93
93
  # Base service for all APIs. Not to be used directly.
94
94
  #
95
95
  class BaseService
96
+ ##
97
+ # A substitution string for the universe domain in an endpoint template
98
+ # @return [String]
99
+ #
100
+ ENDPOINT_SUBSTITUTION = "$UNIVERSE_DOMAIN$".freeze
101
+
96
102
  include Logging
97
103
 
104
+ # Universe domain
105
+ # @return [String]
106
+ attr_reader :universe_domain
107
+
108
+ # Set the universe domain.
109
+ # If the root URL was set with a universe domain substitution, it is
110
+ # updated to reflect the new universe domain.
111
+ #
112
+ # @param new_ud [String,nil] The new universe domain, or nil to use the Google Default Universe
113
+ def universe_domain= new_ud
114
+ new_ud ||= ENV["GOOGLE_CLOUD_UNIVERSE_DOMAIN"] || "googleapis.com"
115
+ if @root_url_template
116
+ @root_url = @root_url_template.gsub ENDPOINT_SUBSTITUTION, new_ud
117
+ end
118
+ @universe_domain = new_ud
119
+ end
120
+
98
121
  # Root URL (host/port) for the API
99
- # @return [Addressable::URI]
100
- attr_accessor :root_url
122
+ # @return [Addressable::URI, String]
123
+ attr_reader :root_url
124
+
125
+ # Set the root URL.
126
+ # If the given url includes a universe domain substitution, it is
127
+ # resolved in the current universe domain
128
+ #
129
+ # @param url_or_template [Addressable::URI, String] The URL, which can include a universe domain substitution
130
+ def root_url= url_or_template
131
+ if url_or_template.is_a?(String) && url_or_template.include?(ENDPOINT_SUBSTITUTION)
132
+ @root_url_template = url_or_template
133
+ @root_url = url_or_template.gsub ENDPOINT_SUBSTITUTION, universe_domain
134
+ else
135
+ @root_url_template = nil
136
+ @root_url = url_or_template
137
+ end
138
+ end
101
139
 
102
140
  # Additional path prefix for all API methods
103
141
  # @return [Addressable::URI]
@@ -136,7 +174,9 @@ module Google
136
174
  # @param [String,Addressable::URI] base_path
137
175
  # Additional path prefix for all API methods
138
176
  # @api private
139
- def initialize(root_url, base_path, client_name: nil, client_version: nil)
177
+ def initialize(root_url, base_path, client_name: nil, client_version: nil, universe_domain: nil)
178
+ @root_url_template = nil
179
+ self.universe_domain = universe_domain
140
180
  self.root_url = root_url
141
181
  self.base_path = base_path
142
182
  self.client_name = client_name || 'google-api-ruby-client'
@@ -279,7 +319,7 @@ module Google
279
319
  # Name of the field in the result containing the items. Defaults to :items
280
320
  # @param [Boolean] cache
281
321
  # True (default) if results should be cached so multiple iterations can be used.
282
- # @return [Enumerble]
322
+ # @return [Enumerable]
283
323
  # @yield [token, service]
284
324
  # Current page token & service instance
285
325
  # @yieldparam [String] token
@@ -296,6 +336,20 @@ module Google
296
336
  return PagedResults.new(self, max: max, items: items, cache: cache, response_page_token: response_page_token, &block)
297
337
  end
298
338
 
339
+ # Verify that the universe domain setting matches the universe domain
340
+ # in the credentials, if present.
341
+ #
342
+ # @raise [Google::Apis::UniverseDomainError] if there is a mismatch
343
+ def verify_universe_domain!
344
+ auth = authorization
345
+ auth_universe_domain = auth.universe_domain if auth.respond_to? :universe_domain
346
+ if auth_universe_domain && auth_universe_domain != universe_domain
347
+ raise UniverseDomainError,
348
+ "Universe domain is #{universe_domain} but credentials are in #{auth_universe_domain}"
349
+ end
350
+ true
351
+ end
352
+
299
353
  protected
300
354
 
301
355
  # Create a new upload command.
@@ -308,6 +362,7 @@ module Google
308
362
  # Request-specific options
309
363
  # @return [Google::Apis::Core::UploadCommand]
310
364
  def make_upload_command(method, path, options)
365
+ verify_universe_domain!
311
366
  template = Addressable::Template.new(root_url + upload_path + path)
312
367
  if batch?
313
368
  command = MultipartUploadCommand.new(method, template, client_version: client_version)
@@ -332,6 +387,7 @@ module Google
332
387
  # Request-specific options
333
388
  # @return [Google::Apis::Core::StorageUploadCommand]
334
389
  def make_storage_upload_command(method, path, options)
390
+ verify_universe_domain!
335
391
  template = Addressable::Template.new(root_url + upload_path + path)
336
392
  command = StorageUploadCommand.new(method, template, client_version: client_version)
337
393
  command.options = request_options.merge(options)
@@ -349,6 +405,7 @@ module Google
349
405
  # Request-specific options
350
406
  # @return [Google::Apis::Core::DownloadCommand]
351
407
  def make_download_command(method, path, options)
408
+ verify_universe_domain!
352
409
  template = Addressable::Template.new(root_url + base_path + path)
353
410
  command = DownloadCommand.new(method, template, client_version: client_version)
354
411
  command.options = request_options.merge(options)
@@ -368,6 +425,7 @@ module Google
368
425
  # Request-specific options
369
426
  # @return [Google::Apis::Core::StorageDownloadCommand]
370
427
  def make_storage_download_command(method, path, options)
428
+ verify_universe_domain!
371
429
  template = Addressable::Template.new(root_url + base_path + path)
372
430
  command = StorageDownloadCommand.new(method, template, client_version: client_version)
373
431
  command.options = request_options.merge(options)
@@ -386,6 +444,7 @@ module Google
386
444
  # Request-specific options
387
445
  # @return [Google::Apis::Core::DownloadCommand]
388
446
  def make_simple_command(method, path, options)
447
+ verify_universe_domain!
389
448
  full_path =
390
449
  if path.start_with? "/"
391
450
  path[1..-1]
@@ -480,6 +539,11 @@ module Google
480
539
  client.default_header = { 'User-Agent' => user_agent }
481
540
 
482
541
  client.debug_dev = logger if client_options.log_http_requests
542
+
543
+ # Make HttpClient use system default root CA path
544
+ # https://github.com/nahi/httpclient/issues/445
545
+ client.ssl_config.clear_cert_store
546
+ client.ssl_config.cert_store.set_default_paths
483
547
  client
484
548
  end
485
549
 
@@ -169,7 +169,6 @@ module Google
169
169
  parts = []
170
170
  parts << build_head(call)
171
171
  parts << build_body(call) unless call.body.nil?
172
- length = parts.inject(0) { |a, e| a + e.length }
173
172
  Google::Apis::Core::CompositeIO.new(*parts)
174
173
  end
175
174
 
@@ -15,6 +15,7 @@
15
15
  require 'google/apis/core/api_command'
16
16
  require 'google/apis/errors'
17
17
  require 'addressable/uri'
18
+ require 'pathname'
18
19
 
19
20
  module Google
20
21
  module Apis
@@ -35,7 +36,10 @@ module Google
35
36
  @state = :start
36
37
  @download_url = nil
37
38
  @offset = 0
38
- if download_dest.respond_to?(:write)
39
+ if @download_dest.is_a?(Pathname)
40
+ @download_io = File.open(download_dest, 'wb')
41
+ @close_io_on_finish = true
42
+ elsif download_dest.respond_to?(:write)
39
43
  @download_io = download_dest
40
44
  @close_io_on_finish = false
41
45
  elsif download_dest.is_a?(String)
@@ -87,6 +87,11 @@ module Google
87
87
  self.query = {}
88
88
  self.params = {}
89
89
  @opencensus_span = nil
90
+ if OPENCENSUS_AVAILABLE
91
+ logger.warn 'OpenCensus support is now deprecated. ' +
92
+ 'Please refer https://github.com/googleapis/google-api-ruby-client#tracing for migrating to use OpenTelemetry.'
93
+
94
+ end
90
95
  end
91
96
 
92
97
  # Execute the command, retrying as necessary
@@ -264,7 +269,7 @@ module Google
264
269
  # @return [Object] result if no block given
265
270
  # @yield [result, nil] if block given
266
271
  def success(result, &block)
267
- logger.debug { sprintf('Success - %s', safe_object_representation(result)) }
272
+ logger.debug { sprintf('Success - %s', safe_pretty_representation(result)) }
268
273
  block.call(result, nil) if block_given?
269
274
  result
270
275
  end
@@ -317,7 +322,7 @@ module Google
317
322
  header: request_header,
318
323
  follow_redirect: true)
319
324
  logger.debug { @http_res.status }
320
- logger.debug { safe_response_representation @http_res }
325
+ logger.debug { safe_single_line_representation @http_res }
321
326
  response = process_response(@http_res.status.to_i, @http_res.header, @http_res.body)
322
327
  success(response)
323
328
  rescue => e
@@ -343,27 +348,51 @@ module Google
343
348
  [:post, :put].include?(method) && body.nil?
344
349
  end
345
350
 
351
+ # Set the API version header for the service if not empty.
352
+ # @return [void]
353
+ def set_api_version_header api_version
354
+ self.header['X-Goog-Api-Version'] = api_version unless api_version.empty?
355
+ end
356
+
346
357
  private
347
358
 
348
359
  UNSAFE_CLASS_NAMES = [
349
- "Google::Apis::CloudkmsV1::DecryptResponse"
360
+ "Google::Apis::CloudkmsV1::DecryptResponse",
361
+ "Google::Apis::SecretmanagerV1::SecretPayload",
362
+ "Google::Apis::SecretmanagerV1beta1::SecretPayload"
350
363
  ]
351
364
 
352
- def safe_object_representation obj
353
- name = obj.class.name
354
- if UNSAFE_CLASS_NAMES.include? name
355
- "#<#{name} (fields redacted)>"
356
- else
357
- PP.pp(obj, "")
365
+ module RedactingPPMethods
366
+ def pp_object obj
367
+ return super unless UNSAFE_CLASS_NAMES.include? obj.class.name
368
+ object_address_group obj do
369
+ text "(fields redacted)"
370
+ end
358
371
  end
359
372
  end
360
373
 
361
- def safe_response_representation http_res
362
- if respond_to?(:response_class) && response_class.is_a?(Class) &&
363
- UNSAFE_CLASS_NAMES.include?(response_class.name)
364
- return "#<#{http_res.class.name} (fields redacted)>"
365
- end
366
- http_res.inspect
374
+ class RedactingPP < PP
375
+ include RedactingPPMethods
376
+ end
377
+
378
+ class RedactingSingleLine < PP::SingleLine
379
+ include RedactingPPMethods
380
+ end
381
+
382
+ def safe_pretty_representation obj
383
+ out = ""
384
+ printer = RedactingPP.new out, 79
385
+ printer.guard_inspect_key { printer.pp obj }
386
+ printer.flush
387
+ out << "\n"
388
+ end
389
+
390
+ def safe_single_line_representation obj
391
+ out = ""
392
+ printer = RedactingSingleLine.new out
393
+ printer.guard_inspect_key { printer.pp obj }
394
+ printer.flush
395
+ out
367
396
  end
368
397
 
369
398
  def opencensus_begin_span
@@ -25,7 +25,7 @@ module Google
25
25
 
26
26
  # Execute the upload request once. Overrides the default implementation to handle streaming/chunking
27
27
  # of file content.
28
- # Note: This method is overriden from DownloadCommand in order to respond back with
28
+ # Note: This method is overridden from DownloadCommand in order to respond back with
29
29
  # http header. All changes made to `execute_once` of DownloadCommand, should be made
30
30
  # here too.
31
31
  #
@@ -15,6 +15,7 @@
15
15
  require 'google/apis/core/http_command'
16
16
  require 'google/apis/core/api_command'
17
17
  require 'google/apis/errors'
18
+ require 'stringio'
18
19
  require 'tempfile'
19
20
  require 'mini_mime'
20
21
 
@@ -31,7 +32,6 @@ module Google
31
32
  CONTENT_RANGE_HEADER = "Content-Range"
32
33
  RESUMABLE = "resumable"
33
34
  OK_STATUS = 200
34
- CHUNK_SIZE = 8 * 1024 * 1024 # 8 MB
35
35
 
36
36
  # File name or IO containing the content to upload
37
37
  # @return [String, File, #read]
@@ -45,6 +45,10 @@ module Google
45
45
  # @return [Google::Apis::Core::UploadIO]
46
46
  attr_accessor :upload_io
47
47
 
48
+ # Upload chunk size
49
+ # @return [Integer]
50
+ attr_accessor :upload_chunk_size
51
+
48
52
  # Ensure the content is readable and wrapped in an IO instance.
49
53
  #
50
54
  # @return [void]
@@ -91,6 +95,7 @@ module Google
91
95
  def execute(client)
92
96
  prepare!
93
97
  opencensus_begin_span
98
+ @upload_chunk_size = options.upload_chunk_size
94
99
 
95
100
  do_retry :initiate_resumable_upload, client
96
101
  while @upload_incomplete
@@ -136,12 +141,17 @@ module Google
136
141
  logger.debug { sprintf('Sending upload command to %s', @upload_url) }
137
142
 
138
143
  remaining_content_size = upload_io.size - @offset
139
- current_chunk_size = remaining_content_size < CHUNK_SIZE ? remaining_content_size : CHUNK_SIZE
144
+ current_chunk_size = get_current_chunk_size remaining_content_size
140
145
 
141
146
  request_header = header.dup
142
- request_header[CONTENT_RANGE_HEADER] = sprintf('bytes %d-%d/%d', @offset, @offset+current_chunk_size-1, upload_io.size)
147
+ request_header[CONTENT_RANGE_HEADER] = get_content_range_header current_chunk_size
143
148
  request_header[CONTENT_LENGTH_HEADER] = current_chunk_size
144
- chunk_body = upload_io.read(current_chunk_size)
149
+ chunk_body =
150
+ if @upload_chunk_size == 0
151
+ upload_io
152
+ else
153
+ StringIO.new(upload_io.read(current_chunk_size))
154
+ end
145
155
 
146
156
  response = client.put(@upload_url, body: chunk_body, header: request_header, follow_redirect: true)
147
157
 
@@ -175,6 +185,24 @@ module Google
175
185
  def streamable?(upload_source)
176
186
  upload_source.is_a?(IO) || upload_source.is_a?(StringIO) || upload_source.is_a?(Tempfile)
177
187
  end
188
+
189
+ def get_current_chunk_size remaining_content_size
190
+ # Disable chunking if the chunk size is set to zero.
191
+ if @upload_chunk_size == 0
192
+ remaining_content_size
193
+ else
194
+ remaining_content_size < @upload_chunk_size ? remaining_content_size : @upload_chunk_size
195
+ end
196
+ end
197
+
198
+ def get_content_range_header current_chunk_size
199
+ if upload_io.size == 0
200
+ numerator = "*"
201
+ else
202
+ numerator = sprintf("%d-%d", @offset, @offset+current_chunk_size-1)
203
+ end
204
+ sprintf('bytes %s/%d', numerator, upload_io.size)
205
+ end
178
206
  end
179
207
  end
180
208
  end
@@ -16,7 +16,7 @@ module Google
16
16
  module Apis
17
17
  module Core
18
18
  # Core version
19
- VERSION = "0.9.0".freeze
19
+ VERSION = "0.15.0".freeze
20
20
  end
21
21
  end
22
22
  end
@@ -89,5 +89,9 @@ module Google
89
89
  # Error class for problems in batch requests.
90
90
  class BatchError < Error
91
91
  end
92
+
93
+ # Error class for universe domain issues
94
+ class UniverseDomainError < Error
95
+ end
92
96
  end
93
97
  end
@@ -40,7 +40,8 @@ module Google
40
40
  :use_opencensus,
41
41
  :quota_project,
42
42
  :query,
43
- :add_invocation_id_header)
43
+ :add_invocation_id_header,
44
+ :upload_chunk_size)
44
45
 
45
46
  # General client options
46
47
  class ClientOptions
@@ -53,9 +54,11 @@ module Google
53
54
  # @!attribute [rw] log_http_requests
54
55
  # @return [Boolean] True if raw HTTP requests should be logged
55
56
  # @!attribute [rw] open_timeout_sec
56
- # @return [Fixnum] How long, in seconds, before failed connections time out
57
+ # @return [Integer] How long, in seconds, before failed connections time out
58
+ # @!attribute [rw] send_timeout_sec
59
+ # @return [Integer] How long, in seconds, before sending data times out
57
60
  # @!attribute [rw] read_timeout_sec
58
- # @return [Fixnum] How long, in seconds, before requests time out
61
+ # @return [Integer] How long, in seconds, before receiving data times out
59
62
  # @!attribute [rw] transparent_gzip_decompression
60
63
  # @return [Boolean] True if gzip compression needs to be enabled
61
64
  # Get the default options
@@ -70,15 +73,15 @@ module Google
70
73
  # @!attribute [rw] authorization
71
74
  # @return [Signet::OAuth2::Client, #apply(Hash)] OAuth2 credentials.
72
75
  # @!attribute [rw] retries
73
- # @return [Fixnum] Number of times to retry requests on server error.
76
+ # @return [Integer] Number of times to retry requests on server error.
74
77
  # @!attribute [rw] max_elapsed_time
75
- # @return [Fixnum] Total time in seconds that requests are allowed to keep being retried.
78
+ # @return [Integer] Total time in seconds that requests are allowed to keep being retried.
76
79
  # @!attribute [rw] base_interval
77
80
  # @return [Float] The initial interval in seconds between tries.
78
81
  # @!attribute [rw] max_interval
79
- # @return [Fixnum] The maximum interval in seconds that any individual retry can reach.
82
+ # @return [Integer] The maximum interval in seconds that any individual retry can reach.
80
83
  # @!attribute [rw] multiplier
81
- # @return [rw] Each successive interval grows by this factor. A multipler of 1.5 means the next interval
84
+ # @return [Numeric] Each successive interval grows by this factor. A multipler of 1.5 means the next interval
82
85
  # will be 1.5x the current interval.
83
86
  # @!attribute [rw] header
84
87
  # @return [Hash<String,String>] Additional HTTP headers to include in requests.
@@ -89,7 +92,7 @@ module Google
89
92
  # @!attribute [rw] skip_deserialization
90
93
  # @return [Boolean] True if response should be returned in raw form instead of deserialized.
91
94
  # @!attribute [rw] api_format_version
92
- # @return [Fixnum] Version of the error format to request/expect.
95
+ # @return [Integer] Version of the error format to request/expect.
93
96
  # @!attribute [rw] use_opencensus
94
97
  # @return [Boolean] Whether OpenCensus spans should be generated for requests. Default is true.
95
98
  # @!attribute [rw] quota_project
@@ -98,6 +101,8 @@ module Google
98
101
  # @return [Hash<String,String>] Additional HTTP URL query parameters to include in requests.
99
102
  # @!attribute [rw] add_invocation_id_header
100
103
  # @return [Boolean] True if the header gccl-invocation-id need to be set
104
+ # @!attribute [rw] upload_chunk_size
105
+ # @return [Integer] The chunk size of storage upload. The default value is 100 MB.
101
106
 
102
107
  # Get the default options
103
108
  # @return [Google::Apis::RequestOptions]
@@ -133,5 +138,6 @@ module Google
133
138
  RequestOptions.default.use_opencensus = true
134
139
  RequestOptions.default.quota_project = nil
135
140
  RequestOptions.default.add_invocation_id_header = false
141
+ RequestOptions.default.upload_chunk_size = 100 * 1024 * 1024 # 100 MB
136
142
  end
137
143
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-apis-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-19 00:00:00.000000000 Z
11
+ date: 2024-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: representable
@@ -82,22 +82,16 @@ dependencies:
82
82
  name: googleauth
83
83
  requirement: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - ">="
86
- - !ruby/object:Gem::Version
87
- version: 0.16.2
88
- - - "<"
85
+ - - "~>"
89
86
  - !ruby/object:Gem::Version
90
- version: 2.a
87
+ version: '1.9'
91
88
  type: :runtime
92
89
  prerelease: false
93
90
  version_requirements: !ruby/object:Gem::Requirement
94
91
  requirements:
95
- - - ">="
96
- - !ruby/object:Gem::Version
97
- version: 0.16.2
98
- - - "<"
92
+ - - "~>"
99
93
  - !ruby/object:Gem::Version
100
- version: 2.a
94
+ version: '1.9'
101
95
  - !ruby/object:Gem::Dependency
102
96
  name: httpclient
103
97
  requirement: !ruby/object:Gem::Requirement
@@ -132,20 +126,6 @@ dependencies:
132
126
  - - ">="
133
127
  - !ruby/object:Gem::Version
134
128
  version: '0'
135
- - !ruby/object:Gem::Dependency
136
- name: webrick
137
- requirement: !ruby/object:Gem::Requirement
138
- requirements:
139
- - - ">="
140
- - !ruby/object:Gem::Version
141
- version: '0'
142
- type: :runtime
143
- prerelease: false
144
- version_requirements: !ruby/object:Gem::Requirement
145
- requirements:
146
- - - ">="
147
- - !ruby/object:Gem::Version
148
- version: '0'
149
129
  description:
150
130
  email: googleapis-packages@google.com
151
131
  executables: []
@@ -186,7 +166,7 @@ licenses:
186
166
  metadata:
187
167
  bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
188
168
  changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/google-apis-core/CHANGELOG.md
189
- documentation_uri: https://googleapis.dev/ruby/google-apis-core/v0.9.0
169
+ documentation_uri: https://googleapis.dev/ruby/google-apis-core/v0.15.0
190
170
  source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/google-apis-core
191
171
  post_install_message:
192
172
  rdoc_options: []
@@ -196,14 +176,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
196
176
  requirements:
197
177
  - - ">="
198
178
  - !ruby/object:Gem::Version
199
- version: '2.5'
179
+ version: '2.7'
200
180
  required_rubygems_version: !ruby/object:Gem::Requirement
201
181
  requirements:
202
182
  - - ">="
203
183
  - !ruby/object:Gem::Version
204
184
  version: '0'
205
185
  requirements: []
206
- rubygems_version: 3.3.14
186
+ rubygems_version: 3.5.6
207
187
  signing_key:
208
188
  specification_version: 4
209
189
  summary: Common utility and base classes for legacy Google REST clients