google-cloud-bigquery-storage-v1 0.6.2 → 0.8.1

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: f3ee48f556489873d73de342f983d552d7f613f35581cd047a83561f6a6ab5e6
4
- data.tar.gz: dbbab82846fa82748b9bc9a0c020ee1b3d5ad5800f4da8eb67f90bd9658a59cc
3
+ metadata.gz: ff39be0c1b0dfb6fbab5badfa076d2d9ee567a741fc30c48aa293cbc7ff07f5d
4
+ data.tar.gz: 66f5972871629dbce68c38fe523fcd28bf8e202f03b6342309fe19921149067d
5
5
  SHA512:
6
- metadata.gz: fefd9b92ca5b6f42eafbe4768dfbc30429efebfedef044a4291202f99bb85729425a7c322a30598643c07f40c832a0a476cc4a691d2edd449a743416e9a36918
7
- data.tar.gz: 94a98be8ec85dd24f7bcfecfd555e6a669b0a3df525341bf5fe56f52eaa222adfb790c680d2894896c547c1faed85b6e7013ae4873c6b6cbb720be0eef143f40
6
+ metadata.gz: 3606ce4b938d2b6d6e6881cfe3af07c0198eb64d2588561332413f998eef33cb7041d6c95eb1902c703852639a9b1836131c896eae4144cec3cadd37d55a404a
7
+ data.tar.gz: eda0cb59794e4ef3738688149ac1a8c143f4fac3866ed4f6bb500de8d7636f3ac3bfbdebde96e48df21de4a69b728235f8c64dd23ac88672e44cc441a102cc6f
@@ -44,13 +44,12 @@ module Google
44
44
  # See {::Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client::Configuration}
45
45
  # for a description of the configuration fields.
46
46
  #
47
- # ## Example
47
+ # @example
48
48
  #
49
- # To modify the configuration for all BigQueryRead clients:
50
- #
51
- # ::Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.configure do |config|
52
- # config.timeout = 10.0
53
- # end
49
+ # # Modify the configuration for all BigQueryRead clients
50
+ # ::Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.configure do |config|
51
+ # config.timeout = 10.0
52
+ # end
54
53
  #
55
54
  # @yield [config] Configure the Client client.
56
55
  # @yieldparam config [Client::Configuration]
@@ -112,19 +111,15 @@ module Google
112
111
  ##
113
112
  # Create a new BigQueryRead client object.
114
113
  #
115
- # ## Examples
116
- #
117
- # To create a new BigQueryRead client with the default
118
- # configuration:
114
+ # @example
119
115
  #
120
- # client = ::Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new
116
+ # # Create a client using the default configuration
117
+ # client = ::Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new
121
118
  #
122
- # To create a new BigQueryRead client with a custom
123
- # configuration:
124
- #
125
- # client = ::Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new do |config|
126
- # config.timeout = 10.0
127
- # end
119
+ # # Create a client using a custom configuration
120
+ # client = ::Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new do |config|
121
+ # config.timeout = 10.0
122
+ # end
128
123
  #
129
124
  # @yield [config] Configure the BigQueryRead client.
130
125
  # @yieldparam config [Client::Configuration]
@@ -144,10 +139,9 @@ module Google
144
139
 
145
140
  # Create credentials
146
141
  credentials = @config.credentials
147
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
142
+ # Use self-signed JWT if the endpoint is unchanged from default,
148
143
  # but only if the default endpoint does not have a region prefix.
149
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
150
- @config.endpoint == Client.configure.endpoint &&
144
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
151
145
  !@config.endpoint.split(".").first.include?("-")
152
146
  credentials ||= Credentials.default scope: @config.scope,
153
147
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -186,7 +180,7 @@ module Google
186
180
  # limits are enforced based on the number of pre-filtered rows, so some
187
181
  # filters can lead to lopsided assignments.
188
182
  #
189
- # Read sessions automatically expire 24 hours after they are created and do
183
+ # Read sessions automatically expire 6 hours after they are created and do
190
184
  # not require manual clean-up by the caller.
191
185
  #
192
186
  # @overload create_read_session(request, options = nil)
@@ -227,6 +221,21 @@ module Google
227
221
  #
228
222
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
229
223
  #
224
+ # @example Basic example
225
+ # require "google/cloud/bigquery/storage/v1"
226
+ #
227
+ # # Create a client object. The client can be reused for multiple calls.
228
+ # client = Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new
229
+ #
230
+ # # Create a request. To set request fields, pass in keyword arguments.
231
+ # request = Google::Cloud::Bigquery::Storage::V1::CreateReadSessionRequest.new
232
+ #
233
+ # # Call the create_read_session method.
234
+ # result = client.create_read_session request
235
+ #
236
+ # # The returned object is of type Google::Cloud::Bigquery::Storage::V1::ReadSession.
237
+ # p result
238
+ #
230
239
  def create_read_session request, options = nil
231
240
  raise ::ArgumentError, "request must be provided" if request.nil?
232
241
 
@@ -244,16 +253,20 @@ module Google
244
253
  gapic_version: ::Google::Cloud::Bigquery::Storage::V1::VERSION
245
254
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
246
255
 
247
- header_params = {
248
- "read_session.table" => request.read_session.table
249
- }
256
+ header_params = {}
257
+ if request.read_session&.table
258
+ header_params["read_session.table"] = request.read_session.table
259
+ end
260
+
250
261
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
251
262
  metadata[:"x-goog-request-params"] ||= request_params_header
252
263
 
253
264
  options.apply_defaults timeout: @config.rpcs.create_read_session.timeout,
254
265
  metadata: metadata,
255
266
  retry_policy: @config.rpcs.create_read_session.retry_policy
256
- options.apply_defaults metadata: @config.metadata,
267
+
268
+ options.apply_defaults timeout: @config.timeout,
269
+ metadata: @config.metadata,
257
270
  retry_policy: @config.retry_policy
258
271
 
259
272
  @big_query_read_stub.call_rpc :create_read_session, request, options: options do |response, operation|
@@ -303,6 +316,24 @@ module Google
303
316
  #
304
317
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
305
318
  #
319
+ # @example Basic example
320
+ # require "google/cloud/bigquery/storage/v1"
321
+ #
322
+ # # Create a client object. The client can be reused for multiple calls.
323
+ # client = Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new
324
+ #
325
+ # # Create a request. To set request fields, pass in keyword arguments.
326
+ # request = Google::Cloud::Bigquery::Storage::V1::ReadRowsRequest.new
327
+ #
328
+ # # Call the read_rows method.
329
+ # result = client.read_rows request
330
+ #
331
+ # # The returned object is a streamed enumerable yielding elements of
332
+ # # type ::Google::Cloud::Bigquery::Storage::V1::ReadRowsResponse.
333
+ # result.each do |response|
334
+ # p response
335
+ # end
336
+ #
306
337
  def read_rows request, options = nil
307
338
  raise ::ArgumentError, "request must be provided" if request.nil?
308
339
 
@@ -320,16 +351,20 @@ module Google
320
351
  gapic_version: ::Google::Cloud::Bigquery::Storage::V1::VERSION
321
352
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
322
353
 
323
- header_params = {
324
- "read_stream" => request.read_stream
325
- }
354
+ header_params = {}
355
+ if request.read_stream
356
+ header_params["read_stream"] = request.read_stream
357
+ end
358
+
326
359
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
327
360
  metadata[:"x-goog-request-params"] ||= request_params_header
328
361
 
329
362
  options.apply_defaults timeout: @config.rpcs.read_rows.timeout,
330
363
  metadata: metadata,
331
364
  retry_policy: @config.rpcs.read_rows.retry_policy
332
- options.apply_defaults metadata: @config.metadata,
365
+
366
+ options.apply_defaults timeout: @config.timeout,
367
+ metadata: @config.metadata,
333
368
  retry_policy: @config.retry_policy
334
369
 
335
370
  @big_query_read_stub.call_rpc :read_rows, request, options: options do |response, operation|
@@ -388,6 +423,21 @@ module Google
388
423
  #
389
424
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
390
425
  #
426
+ # @example Basic example
427
+ # require "google/cloud/bigquery/storage/v1"
428
+ #
429
+ # # Create a client object. The client can be reused for multiple calls.
430
+ # client = Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new
431
+ #
432
+ # # Create a request. To set request fields, pass in keyword arguments.
433
+ # request = Google::Cloud::Bigquery::Storage::V1::SplitReadStreamRequest.new
434
+ #
435
+ # # Call the split_read_stream method.
436
+ # result = client.split_read_stream request
437
+ #
438
+ # # The returned object is of type Google::Cloud::Bigquery::Storage::V1::SplitReadStreamResponse.
439
+ # p result
440
+ #
391
441
  def split_read_stream request, options = nil
392
442
  raise ::ArgumentError, "request must be provided" if request.nil?
393
443
 
@@ -405,16 +455,20 @@ module Google
405
455
  gapic_version: ::Google::Cloud::Bigquery::Storage::V1::VERSION
406
456
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
407
457
 
408
- header_params = {
409
- "name" => request.name
410
- }
458
+ header_params = {}
459
+ if request.name
460
+ header_params["name"] = request.name
461
+ end
462
+
411
463
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
412
464
  metadata[:"x-goog-request-params"] ||= request_params_header
413
465
 
414
466
  options.apply_defaults timeout: @config.rpcs.split_read_stream.timeout,
415
467
  metadata: metadata,
416
468
  retry_policy: @config.rpcs.split_read_stream.retry_policy
417
- options.apply_defaults metadata: @config.metadata,
469
+
470
+ options.apply_defaults timeout: @config.timeout,
471
+ metadata: @config.metadata,
418
472
  retry_policy: @config.retry_policy
419
473
 
420
474
  @big_query_read_stub.call_rpc :split_read_stream, request, options: options do |response, operation|
@@ -438,22 +492,21 @@ module Google
438
492
  # Configuration can be applied globally to all clients, or to a single client
439
493
  # on construction.
440
494
  #
441
- # # Examples
442
- #
443
- # To modify the global config, setting the timeout for create_read_session
444
- # to 20 seconds, and all remaining timeouts to 10 seconds:
445
- #
446
- # ::Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.configure do |config|
447
- # config.timeout = 10.0
448
- # config.rpcs.create_read_session.timeout = 20.0
449
- # end
450
- #
451
- # To apply the above configuration only to a new client:
452
- #
453
- # client = ::Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new do |config|
454
- # config.timeout = 10.0
455
- # config.rpcs.create_read_session.timeout = 20.0
456
- # end
495
+ # @example
496
+ #
497
+ # # Modify the global config, setting the timeout for
498
+ # # create_read_session to 20 seconds,
499
+ # # and all remaining timeouts to 10 seconds.
500
+ # ::Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.configure do |config|
501
+ # config.timeout = 10.0
502
+ # config.rpcs.create_read_session.timeout = 20.0
503
+ # end
504
+ #
505
+ # # Apply the above configuration only to a new client.
506
+ # client = ::Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new do |config|
507
+ # config.timeout = 10.0
508
+ # config.rpcs.create_read_session.timeout = 20.0
509
+ # end
457
510
  #
458
511
  # @!attribute [rw] endpoint
459
512
  # The hostname or hostname:port of the service endpoint.